* 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>,
)
| 314 | * scoped. |
| 315 | */ |
| 316 | private _scopeAnimationKeyframe( |
| 317 | keyframe: string, |
| 318 | scopeSelector: string, |
| 319 | unscopedKeyframesSet: ReadonlySet<string>, |
| 320 | ): string { |
| 321 | return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => { |
| 322 | name = `${ |
| 323 | unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : '' |
| 324 | }${name}`; |
| 325 | return `${spaces1}${quote}${name}${quote}${spaces2}`; |
| 326 | }); |
| 327 | } |
| 328 | |
| 329 | /** |
| 330 | * Regular expression used to extrapolate the possible keyframes from an |
no test coverage detected