* Function used to scope a keyframes name (obtained from an animation declaration) * using an existing set of unscopedKeyframes names to discern if the scoping needs to be * performed (keyframes names of keyframes not defined in the component's css need not to be * scoped). * * @param
(
keyframe: string,
scopeSelector: string,
unscopedKeyframesSet: ReadonlySet<string>,
)
| 315 | * scoped. |
| 316 | */ |
| 317 | private _scopeAnimationKeyframe( |
| 318 | keyframe: string, |
| 319 | scopeSelector: string, |
| 320 | unscopedKeyframesSet: ReadonlySet<string>, |
| 321 | ): string { |
| 322 | return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => { |
| 323 | name = `${ |
| 324 | unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : '' |
| 325 | }${name}`; |
| 326 | return `${spaces1}${quote}${name}${quote}${spaces2}`; |
| 327 | }); |
| 328 | } |
| 329 | |
| 330 | /** |
| 331 | * Regular expression used to extrapolate the possible keyframes from an |
no test coverage detected