@angular/animations 20.3.6 → 20.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/animation_driver.d.d.ts +1 -1
- package/animation_player.d.d.ts +1 -1
- package/browser/index.d.ts +2 -2
- package/browser/testing/index.d.ts +1 -1
- package/fesm2022/animations.mjs +7 -7
- package/fesm2022/animations.mjs.map +1 -1
- package/fesm2022/browser/testing.mjs +1 -1
- package/fesm2022/browser/testing.mjs.map +1 -1
- package/fesm2022/browser.mjs +45 -23
- package/fesm2022/browser.mjs.map +1 -1
- package/fesm2022/private_export.mjs +1 -1
- package/fesm2022/private_export.mjs.map +1 -1
- package/fesm2022/util.mjs +1 -1
- package/fesm2022/util.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
package/animation_driver.d.d.ts
CHANGED
package/animation_player.d.d.ts
CHANGED
package/browser/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.9
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -203,7 +203,7 @@ declare class WebAnimationsPlayer implements AnimationPlayer {
|
|
|
203
203
|
private _finalKeyframe?;
|
|
204
204
|
private _originalOnDoneFns;
|
|
205
205
|
private _originalOnStartFns;
|
|
206
|
-
|
|
206
|
+
domPlayer: Animation | null;
|
|
207
207
|
time: number;
|
|
208
208
|
parentPlayer: AnimationPlayer | null;
|
|
209
209
|
currentSnapshot: _StyleDataMap;
|
package/fesm2022/animations.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.9
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -58,10 +58,10 @@ export { AUTO_STYLE, AnimationMetadataType, NoopAnimationPlayer, animate, animat
|
|
|
58
58
|
* @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23
|
|
59
59
|
*/
|
|
60
60
|
class AnimationBuilder {
|
|
61
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
62
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AnimationBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
62
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AnimationBuilder, providedIn: 'root', useFactory: () => inject(BrowserAnimationBuilder) });
|
|
63
63
|
}
|
|
64
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: AnimationBuilder, decorators: [{
|
|
65
65
|
type: Injectable,
|
|
66
66
|
args: [{ providedIn: 'root', useFactory: () => inject(BrowserAnimationBuilder) }]
|
|
67
67
|
}] });
|
|
@@ -103,10 +103,10 @@ class BrowserAnimationBuilder extends AnimationBuilder {
|
|
|
103
103
|
issueAnimationCommand(this._renderer, null, id, 'register', [entry]);
|
|
104
104
|
return new BrowserAnimationFactory(id, this._renderer);
|
|
105
105
|
}
|
|
106
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
107
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: BrowserAnimationBuilder, deps: [{ token: i0.RendererFactory2 }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
107
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: BrowserAnimationBuilder, providedIn: 'root' });
|
|
108
108
|
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: BrowserAnimationBuilder, decorators: [{
|
|
110
110
|
type: Injectable,
|
|
111
111
|
args: [{ providedIn: 'root' }]
|
|
112
112
|
}], ctorParameters: () => [{ type: i0.RendererFactory2 }, { type: Document, decorators: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animations.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/animations/src/animation_builder.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {\n ANIMATION_MODULE_TYPE,\n DOCUMENT,\n Inject,\n inject,\n Injectable,\n Renderer2,\n RendererFactory2,\n RendererType2,\n ViewEncapsulation,\n ɵAnimationRendererType as AnimationRendererType,\n ɵRuntimeError as RuntimeError,\n} from '@angular/core';\n\nimport {AnimationMetadata, AnimationOptions, sequence} from './animation_metadata';\nimport {RuntimeErrorCode} from './errors';\nimport {AnimationPlayer} from './players/animation_player';\n\n/**\n * An injectable service that produces an animation sequence programmatically within an\n * Angular component or directive.\n * Provided by the `BrowserAnimationsModule` or `NoopAnimationsModule`.\n *\n * @usageNotes\n *\n * To use this service, add it to your component or directive as a dependency.\n * The service is instantiated along with your component.\n *\n * Apps do not typically need to create their own animation players, but if you\n * do need to, follow these steps:\n *\n * 1. Use the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code> method\n * to create a programmatic animation. The method returns an `AnimationFactory` instance.\n *\n * 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element.\n *\n * 3. Use the player object to control the animation programmatically.\n *\n * For example:\n *\n * ```ts\n * // import the service from BrowserAnimationsModule\n * import {AnimationBuilder} from '@angular/animations';\n * // require the service as a dependency\n * class MyCmp {\n * constructor(private _builder: AnimationBuilder) {}\n *\n * makeAnimation(element: any) {\n * // first define a reusable animation\n * const myAnimation = this._builder.build([\n * style({ width: 0 }),\n * animate(1000, style({ width: '100px' }))\n * ]);\n *\n * // use the returned factory object to create a player\n * const player = myAnimation.create(element);\n *\n * player.play();\n * }\n * }\n * ```\n *\n * @publicApi\n *\n * @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23\n */\n@Injectable({providedIn: 'root', useFactory: () => inject(BrowserAnimationBuilder)})\nexport abstract class AnimationBuilder {\n /**\n * Builds a factory for producing a defined animation.\n * @param animation A reusable animation definition.\n * @returns A factory object that can create a player for the defined animation.\n * @see {@link animate}\n */\n abstract build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory;\n}\n\n/**\n * A factory object returned from the\n * <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>\n * method.\n *\n * @publicApi\n *\n * @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23\n */\nexport abstract class AnimationFactory {\n /**\n * Creates an `AnimationPlayer` instance for the reusable animation defined by\n * the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>\n * method that created this factory and attaches the new player a DOM element.\n *\n * @param element The DOM element to which to attach the player.\n * @param options A set of options that can include a time delay and\n * additional developer-defined parameters.\n */\n abstract create(element: any, options?: AnimationOptions): AnimationPlayer;\n}\n\n@Injectable({providedIn: 'root'})\nexport class BrowserAnimationBuilder extends AnimationBuilder {\n private animationModuleType = inject(ANIMATION_MODULE_TYPE, {optional: true});\n private _nextAnimationId = 0;\n private _renderer: Renderer2;\n\n constructor(rootRenderer: RendererFactory2, @Inject(DOCUMENT) doc: Document) {\n super();\n const typeData: RendererType2 = {\n id: '0',\n encapsulation: ViewEncapsulation.None,\n styles: [],\n data: {animation: []},\n };\n this._renderer = rootRenderer.createRenderer(doc.body, typeData);\n\n if (this.animationModuleType === null && !isAnimationRenderer(this._renderer)) {\n // We only support AnimationRenderer & DynamicDelegationRenderer for this AnimationBuilder\n\n throw new RuntimeError(\n RuntimeErrorCode.BROWSER_ANIMATION_BUILDER_INJECTED_WITHOUT_ANIMATIONS,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n 'Angular detected that the `AnimationBuilder` was injected, but animation support was not enabled. ' +\n 'Please make sure that you enable animations in your application by calling `provideAnimations()` or `provideAnimationsAsync()` function.',\n );\n }\n }\n\n override build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory {\n const id = this._nextAnimationId;\n this._nextAnimationId++;\n const entry = Array.isArray(animation) ? sequence(animation) : animation;\n issueAnimationCommand(this._renderer, null, id, 'register', [entry]);\n return new BrowserAnimationFactory(id, this._renderer);\n }\n}\n\nclass BrowserAnimationFactory extends AnimationFactory {\n constructor(\n private _id: number,\n private _renderer: Renderer2,\n ) {\n super();\n }\n\n override create(element: any, options?: AnimationOptions): AnimationPlayer {\n return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);\n }\n}\n\nclass RendererAnimationPlayer implements AnimationPlayer {\n public parentPlayer: AnimationPlayer | null = null;\n private _started = false;\n\n constructor(\n public id: number,\n public element: any,\n options: AnimationOptions,\n private _renderer: Renderer2,\n ) {\n this._command('create', options);\n }\n\n private _listen(eventName: string, callback: (event: any) => any): () => void {\n return this._renderer.listen(this.element, `@@${this.id}:${eventName}`, callback);\n }\n\n private _command(command: string, ...args: any[]): void {\n issueAnimationCommand(this._renderer, this.element, this.id, command, args);\n }\n\n onDone(fn: () => void): void {\n this._listen('done', fn);\n }\n\n onStart(fn: () => void): void {\n this._listen('start', fn);\n }\n\n onDestroy(fn: () => void): void {\n this._listen('destroy', fn);\n }\n\n init(): void {\n this._command('init');\n }\n\n hasStarted(): boolean {\n return this._started;\n }\n\n play(): void {\n this._command('play');\n this._started = true;\n }\n\n pause(): void {\n this._command('pause');\n }\n\n restart(): void {\n this._command('restart');\n }\n\n finish(): void {\n this._command('finish');\n }\n\n destroy(): void {\n this._command('destroy');\n }\n\n reset(): void {\n this._command('reset');\n this._started = false;\n }\n\n setPosition(p: number): void {\n this._command('setPosition', p);\n }\n\n getPosition(): number {\n return unwrapAnimationRenderer(this._renderer)?.engine?.players[this.id]?.getPosition() ?? 0;\n }\n\n public totalTime = 0;\n}\n\nfunction issueAnimationCommand(\n renderer: Renderer2,\n element: any,\n id: number,\n command: string,\n args: any[],\n): void {\n renderer.setProperty(element, `@@${id}:${command}`, args);\n}\n\n/**\n * The following 2 methods cannot reference their correct types (AnimationRenderer &\n * DynamicDelegationRenderer) since this would introduce a import cycle.\n */\n\nfunction unwrapAnimationRenderer(\n renderer: Renderer2,\n): {engine: {players: AnimationPlayer[]}} | null {\n const type = (renderer as unknown as {ɵtype: AnimationRendererType}).ɵtype;\n if (type === AnimationRendererType.Regular) {\n return renderer as any;\n } else if (type === AnimationRendererType.Delegated) {\n return (renderer as any).animationRenderer;\n }\n\n return null;\n}\n\nfunction isAnimationRenderer(renderer: Renderer2): boolean {\n const type = (renderer as unknown as {ɵtype: AnimationRendererType}).ɵtype;\n return type === AnimationRendererType.Regular || type === AnimationRendererType.Delegated;\n}\n"],"names":["RuntimeError"],"mappings":";;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CG;MAEmB,gBAAgB,CAAA;kHAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;sHAAhB,gBAAgB,EAAA,UAAA,EADb,MAAM,EAAc,UAAA,EAAA,MAAM,MAAM,CAAC,uBAAuB,CAAC,EAAA,CAAA;;sGAC5D,gBAAgB,EAAA,UAAA,EAAA,CAAA;k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js","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/animations/src/animation_builder.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {\n ANIMATION_MODULE_TYPE,\n DOCUMENT,\n Inject,\n inject,\n Injectable,\n Renderer2,\n RendererFactory2,\n RendererType2,\n ViewEncapsulation,\n ɵAnimationRendererType as AnimationRendererType,\n ɵRuntimeError as RuntimeError,\n} from '@angular/core';\n\nimport {AnimationMetadata, AnimationOptions, sequence} from './animation_metadata';\nimport {RuntimeErrorCode} from './errors';\nimport {AnimationPlayer} from './players/animation_player';\n\n/**\n * An injectable service that produces an animation sequence programmatically within an\n * Angular component or directive.\n * Provided by the `BrowserAnimationsModule` or `NoopAnimationsModule`.\n *\n * @usageNotes\n *\n * To use this service, add it to your component or directive as a dependency.\n * The service is instantiated along with your component.\n *\n * Apps do not typically need to create their own animation players, but if you\n * do need to, follow these steps:\n *\n * 1. Use the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code> method\n * to create a programmatic animation. The method returns an `AnimationFactory` instance.\n *\n * 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element.\n *\n * 3. Use the player object to control the animation programmatically.\n *\n * For example:\n *\n * ```ts\n * // import the service from BrowserAnimationsModule\n * import {AnimationBuilder} from '@angular/animations';\n * // require the service as a dependency\n * class MyCmp {\n * constructor(private _builder: AnimationBuilder) {}\n *\n * makeAnimation(element: any) {\n * // first define a reusable animation\n * const myAnimation = this._builder.build([\n * style({ width: 0 }),\n * animate(1000, style({ width: '100px' }))\n * ]);\n *\n * // use the returned factory object to create a player\n * const player = myAnimation.create(element);\n *\n * player.play();\n * }\n * }\n * ```\n *\n * @publicApi\n *\n * @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23\n */\n@Injectable({providedIn: 'root', useFactory: () => inject(BrowserAnimationBuilder)})\nexport abstract class AnimationBuilder {\n /**\n * Builds a factory for producing a defined animation.\n * @param animation A reusable animation definition.\n * @returns A factory object that can create a player for the defined animation.\n * @see {@link animate}\n */\n abstract build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory;\n}\n\n/**\n * A factory object returned from the\n * <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>\n * method.\n *\n * @publicApi\n *\n * @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23\n */\nexport abstract class AnimationFactory {\n /**\n * Creates an `AnimationPlayer` instance for the reusable animation defined by\n * the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code>\n * method that created this factory and attaches the new player a DOM element.\n *\n * @param element The DOM element to which to attach the player.\n * @param options A set of options that can include a time delay and\n * additional developer-defined parameters.\n */\n abstract create(element: any, options?: AnimationOptions): AnimationPlayer;\n}\n\n@Injectable({providedIn: 'root'})\nexport class BrowserAnimationBuilder extends AnimationBuilder {\n private animationModuleType = inject(ANIMATION_MODULE_TYPE, {optional: true});\n private _nextAnimationId = 0;\n private _renderer: Renderer2;\n\n constructor(rootRenderer: RendererFactory2, @Inject(DOCUMENT) doc: Document) {\n super();\n const typeData: RendererType2 = {\n id: '0',\n encapsulation: ViewEncapsulation.None,\n styles: [],\n data: {animation: []},\n };\n this._renderer = rootRenderer.createRenderer(doc.body, typeData);\n\n if (this.animationModuleType === null && !isAnimationRenderer(this._renderer)) {\n // We only support AnimationRenderer & DynamicDelegationRenderer for this AnimationBuilder\n\n throw new RuntimeError(\n RuntimeErrorCode.BROWSER_ANIMATION_BUILDER_INJECTED_WITHOUT_ANIMATIONS,\n (typeof ngDevMode === 'undefined' || ngDevMode) &&\n 'Angular detected that the `AnimationBuilder` was injected, but animation support was not enabled. ' +\n 'Please make sure that you enable animations in your application by calling `provideAnimations()` or `provideAnimationsAsync()` function.',\n );\n }\n }\n\n override build(animation: AnimationMetadata | AnimationMetadata[]): AnimationFactory {\n const id = this._nextAnimationId;\n this._nextAnimationId++;\n const entry = Array.isArray(animation) ? sequence(animation) : animation;\n issueAnimationCommand(this._renderer, null, id, 'register', [entry]);\n return new BrowserAnimationFactory(id, this._renderer);\n }\n}\n\nclass BrowserAnimationFactory extends AnimationFactory {\n constructor(\n private _id: number,\n private _renderer: Renderer2,\n ) {\n super();\n }\n\n override create(element: any, options?: AnimationOptions): AnimationPlayer {\n return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer);\n }\n}\n\nclass RendererAnimationPlayer implements AnimationPlayer {\n public parentPlayer: AnimationPlayer | null = null;\n private _started = false;\n\n constructor(\n public id: number,\n public element: any,\n options: AnimationOptions,\n private _renderer: Renderer2,\n ) {\n this._command('create', options);\n }\n\n private _listen(eventName: string, callback: (event: any) => any): () => void {\n return this._renderer.listen(this.element, `@@${this.id}:${eventName}`, callback);\n }\n\n private _command(command: string, ...args: any[]): void {\n issueAnimationCommand(this._renderer, this.element, this.id, command, args);\n }\n\n onDone(fn: () => void): void {\n this._listen('done', fn);\n }\n\n onStart(fn: () => void): void {\n this._listen('start', fn);\n }\n\n onDestroy(fn: () => void): void {\n this._listen('destroy', fn);\n }\n\n init(): void {\n this._command('init');\n }\n\n hasStarted(): boolean {\n return this._started;\n }\n\n play(): void {\n this._command('play');\n this._started = true;\n }\n\n pause(): void {\n this._command('pause');\n }\n\n restart(): void {\n this._command('restart');\n }\n\n finish(): void {\n this._command('finish');\n }\n\n destroy(): void {\n this._command('destroy');\n }\n\n reset(): void {\n this._command('reset');\n this._started = false;\n }\n\n setPosition(p: number): void {\n this._command('setPosition', p);\n }\n\n getPosition(): number {\n return unwrapAnimationRenderer(this._renderer)?.engine?.players[this.id]?.getPosition() ?? 0;\n }\n\n public totalTime = 0;\n}\n\nfunction issueAnimationCommand(\n renderer: Renderer2,\n element: any,\n id: number,\n command: string,\n args: any[],\n): void {\n renderer.setProperty(element, `@@${id}:${command}`, args);\n}\n\n/**\n * The following 2 methods cannot reference their correct types (AnimationRenderer &\n * DynamicDelegationRenderer) since this would introduce a import cycle.\n */\n\nfunction unwrapAnimationRenderer(\n renderer: Renderer2,\n): {engine: {players: AnimationPlayer[]}} | null {\n const type = (renderer as unknown as {ɵtype: AnimationRendererType}).ɵtype;\n if (type === AnimationRendererType.Regular) {\n return renderer as any;\n } else if (type === AnimationRendererType.Delegated) {\n return (renderer as any).animationRenderer;\n }\n\n return null;\n}\n\nfunction isAnimationRenderer(renderer: Renderer2): boolean {\n const type = (renderer as unknown as {ɵtype: AnimationRendererType}).ɵtype;\n return type === AnimationRendererType.Regular || type === AnimationRendererType.Delegated;\n}\n"],"names":["RuntimeError"],"mappings":";;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CG;MAEmB,gBAAgB,CAAA;kHAAhB,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;sHAAhB,gBAAgB,EAAA,UAAA,EADb,MAAM,EAAc,UAAA,EAAA,MAAM,MAAM,CAAC,uBAAuB,CAAC,EAAA,CAAA;;sGAC5D,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA,EAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC,uBAAuB,CAAC,EAAC;;AAWnF;;;;;;;;AAQG;MACmB,gBAAgB,CAAA;AAWrC;AAGK,MAAO,uBAAwB,SAAQ,gBAAgB,CAAA;IACnD,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;IACrE,gBAAgB,GAAG,CAAC;AACpB,IAAA,SAAS;IAEjB,WAAY,CAAA,YAA8B,EAAoB,GAAa,EAAA;AACzE,QAAA,KAAK,EAAE;AACP,QAAA,MAAM,QAAQ,GAAkB;AAC9B,YAAA,EAAE,EAAE,GAAG;YACP,aAAa,EAAE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E,WAAW,EAAE,IAAI,CAAC;;IAGvF,SAAS,GAAG,CAAC;AACrB;AAED,SAAS,qBAAqB,CAC5B,QAAmB,EACnB,OAAY,EACZ,EAAU,EACV,OAAe,EACf,IAAW,EAAA;AAEX,IAAA,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,CAAA,EAAA,EAAK,EAAE,CAAA,CAAA,EAAI,OAAO,CAAA,CAAE,EAAE,IAAI,CAAC;AAC3D;AAEA;;;AAGG;AAEH,SAAS,uBAAuB,CAC9B,QAAmB,EAAA;AAEnB,IAAA,MAAM,IAAI,GAAI,QAAsD,CAAC,KAAK;IAC1E,IAAI,IAAI,KAAkC,CAAA,sCAAE;AAC1C,QAAA,OAAO,QAAe;;SACjB,IAAI,IAAI,KAAoC,CAAA,wCAAE;QACnD,OAAQ,QAAgB,CAAC,iBAAiB;;AAG5C,IAAA,OAAO,IAAI;AACb;AAEA,SAAS,mBAAmB,CAAC,QAAmB,EAAA;AAC9C,IAAA,MAAM,IAAI,GAAI,QAAsD,CAAC,KAAK;AAC1E,IAAA,OAAO,IAAI,KAAA,CAAA,wCAAsC,IAAI;AACvD;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../
|
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/animations/browser/testing/src/mock_animation_driver.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\nimport {\n AnimationPlayer,\n AUTO_STYLE,\n NoopAnimationPlayer,\n ɵStyleDataMap,\n} from '../../../src/animations';\nimport {\n AnimationDriver,\n ɵallowPreviousPlayerStylesMerge as allowPreviousPlayerStylesMerge,\n ɵcamelCaseToDashCase,\n ɵcontainsElement as containsElement,\n ɵgetParentElement as getParentElement,\n ɵinvokeQuery as invokeQuery,\n ɵnormalizeKeyframes as normalizeKeyframes,\n ɵvalidateStyleProperty as validateStyleProperty,\n ɵvalidateWebAnimatableStyleProperty,\n} from '../../../browser';\n\n/**\n * @publicApi\n *\n * @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23\n */\nexport class MockAnimationDriver implements AnimationDriver {\n static log: AnimationPlayer[] = [];\n\n validateStyleProperty(prop: string): boolean {\n return validateStyleProperty(prop);\n }\n\n validateAnimatableStyleProperty(prop: string): boolean {\n const cssProp = ɵcamelCaseToDashCase(prop);\n return ɵvalidateWebAnimatableStyleProperty(cssProp);\n }\n\n containsElement(elm1: any, elm2: any): boolean {\n return containsElement(elm1, elm2);\n }\n\n getParentElement(element: unknown): unknown {\n return getParentElement(element);\n }\n\n query(element: any, selector: string, multi: boolean): any[] {\n return invokeQuery(element, selector, multi);\n }\n\n computeStyle(element: any, prop: string, defaultValue?: string): string {\n return defaultValue || '';\n }\n\n animate(\n element: any,\n keyframes: Array<ɵStyleDataMap>,\n duration: number,\n delay: number,\n easing: string,\n previousPlayers: any[] = [],\n ): MockAnimationPlayer {\n const player = new MockAnimationPlayer(\n element,\n keyframes,\n duration,\n delay,\n easing,\n previousPlayers,\n );\n MockAnimationDriver.log.push(<AnimationPlayer>player);\n return player;\n }\n}\n\n/**\n * @publicApi\n *\n * @deprecated 20.2 Use `animate.enter` or `animate.leave` instead. Intent to remove in v23\n */\nexport class MockAnimationPlayer extends NoopAnimationPlayer {\n private __finished = false;\n private __started = false;\n public previousStyles: ɵStyleDataMap = new Map();\n private _onInitFns: (() => any)[] = [];\n public currentSnapshot: ɵStyleDataMap = new Map();\n private _keyframes: Array<ɵStyleDataMap> = [];\n\n constructor(\n public element: any,\n public keyframes: Array<ɵStyleDataMap>,\n public duration: number,\n public delay: number,\n public easing: string,\n public previousPlayers: any[],\n ) {\n super(duration, delay);\n\n this._keyframes = normalizeKeyframes(keyframes);\n\n if (allowPreviousPlayerStylesMerge(duration, delay)) {\n previousPlayers.forEach((player) => {\n if (player instanceof MockAnimationPlayer) {\n const styles = player.currentSnapshot;\n styles.forEach((val, prop) => this.previousStyles.set(prop, val));\n }\n });\n }\n }\n\n /** @internal */\n onInit(fn: () => any) {\n this._onInitFns.push(fn);\n }\n\n /** @internal */\n override init() {\n super.init();\n this._onInitFns.forEach((fn) => fn());\n this._onInitFns = [];\n }\n\n override reset() {\n super.reset();\n this.__started = false;\n }\n\n override finish(): void {\n super.finish();\n this.__finished = true;\n }\n\n override destroy(): void {\n super.destroy();\n this.__finished = true;\n }\n\n /** @internal */\n triggerMicrotask() {}\n\n override play(): void {\n super.play();\n this.__started = true;\n }\n\n override hasStarted() {\n return this.__started;\n }\n\n beforeDestroy() {\n const captures: ɵStyleDataMap = new Map();\n\n this.previousStyles.forEach((val, prop) => captures.set(prop, val));\n\n if (this.hasStarted()) {\n // when assembling the captured styles, it's important that\n // we build the keyframe styles in the following order:\n // {other styles within keyframes, ... previousStyles }\n this._keyframes.forEach((kf) => {\n for (let [prop, val] of kf) {\n if (prop !== 'offset') {\n captures.set(prop, this.__finished ? val : AUTO_STYLE);\n }\n }\n });\n }\n\n this.currentSnapshot = captures;\n }\n}\n"],"names":["ɵcamelCaseToDashCase","ɵvalidateWebAnimatableStyleProperty"],"mappings":";;;;;;;;;;AAyBA;;;;AAIG;MACU,mBAAmB,CAAA;AAC9B,IAAA,OAAO,GAAG,GAAsB,EAAE;AAElC,IAAA,qBAAqB,CAAC,IAAY,EAAA;AAChC,QAAA,OAAO,qBAAqB,CAAC,IAAI,CAAC;;AAGpC,IAAA,+BAA+B,CAAC,IAAY,EAAA;AAC1C,QAAA,MAAM,OAAO,GAAGA,mBAAoB,CAAC,IAAI,CAAC;AAC1C,QAAA,OAAOC,kCAAmC,CAAC,OAAO,CAAC;;IAGrD,eAAe,CAAC,IAAS,EAAE,IAAS,EAAA;AAClC,QAAA,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC;;AAGpC,IAAA,gBAAgB,CAAC,OAAgB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QAAQ,GAAkB,IAAI,GAAG,EAAE;QAEzC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,IAAI,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AAEnE,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE,EAAE;;;;YAIrB,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,KAAI;gBAC7B,KAAK,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,EAAE;AAC1B,oBAAA,IAAI,IAAI,KAAK,QAAQ,EAAE;AACrB,wBAAA,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,UAAU,GAAG,GAAG,GAAG,UAAU,CAAC;;;AAG5D,aAAC,CAAC;;AAGJ,QAAA,IAAI,CAAC,eAAe,GAAG,QAAQ;;AAElC;;;;"}
|
package/fesm2022/browser.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.3.
|
|
2
|
+
* @license Angular v20.3.9
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -55,10 +55,10 @@ class NoopAnimationDriver {
|
|
|
55
55
|
animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {
|
|
56
56
|
return new NoopAnimationPlayer(duration, delay);
|
|
57
57
|
}
|
|
58
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.
|
|
59
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.
|
|
58
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
59
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NoopAnimationDriver });
|
|
60
60
|
}
|
|
61
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.9", ngImport: i0, type: NoopAnimationDriver, decorators: [{
|
|
62
62
|
type: Injectable
|
|
63
63
|
}] });
|
|
64
64
|
/**
|
|
@@ -3639,8 +3639,7 @@ class WebAnimationsPlayer {
|
|
|
3639
3639
|
// (since the _onStartFns and _onDoneFns get deleted after they are called)
|
|
3640
3640
|
_originalOnDoneFns = [];
|
|
3641
3641
|
_originalOnStartFns = [];
|
|
3642
|
-
|
|
3643
|
-
domPlayer;
|
|
3642
|
+
domPlayer = null;
|
|
3644
3643
|
time = 0;
|
|
3645
3644
|
parentPlayer = null;
|
|
3646
3645
|
currentSnapshot = new Map();
|
|
@@ -3661,25 +3660,32 @@ class WebAnimationsPlayer {
|
|
|
3661
3660
|
}
|
|
3662
3661
|
}
|
|
3663
3662
|
init() {
|
|
3664
|
-
this._buildPlayer()
|
|
3663
|
+
if (!this._buildPlayer()) {
|
|
3664
|
+
return;
|
|
3665
|
+
}
|
|
3665
3666
|
this._preparePlayerBeforeStart();
|
|
3666
3667
|
}
|
|
3667
3668
|
_buildPlayer() {
|
|
3668
3669
|
if (this._initialized)
|
|
3669
|
-
return;
|
|
3670
|
+
return this.domPlayer;
|
|
3670
3671
|
this._initialized = true;
|
|
3671
3672
|
const keyframes = this.keyframes;
|
|
3672
|
-
|
|
3673
|
-
|
|
3673
|
+
const animation = this._triggerWebAnimation(this.element, keyframes, this.options);
|
|
3674
|
+
if (!animation) {
|
|
3675
|
+
this._onFinish();
|
|
3676
|
+
return null;
|
|
3677
|
+
}
|
|
3678
|
+
this.domPlayer = animation;
|
|
3674
3679
|
this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : new Map();
|
|
3675
3680
|
const onFinish = () => this._onFinish();
|
|
3676
|
-
|
|
3681
|
+
animation.addEventListener('finish', onFinish);
|
|
3677
3682
|
this.onDestroy(() => {
|
|
3678
3683
|
// We must remove the `finish` event listener once an animation has completed all its
|
|
3679
3684
|
// iterations. This action is necessary to prevent a memory leak since the listener captures
|
|
3680
3685
|
// `this`, creating a closure that prevents `this` from being garbage collected.
|
|
3681
|
-
|
|
3686
|
+
animation.removeEventListener('finish', onFinish);
|
|
3682
3687
|
});
|
|
3688
|
+
return animation;
|
|
3683
3689
|
}
|
|
3684
3690
|
_preparePlayerBeforeStart() {
|
|
3685
3691
|
// this is required so that the player doesn't start to animate right away
|
|
@@ -3687,7 +3693,7 @@ class WebAnimationsPlayer {
|
|
|
3687
3693
|
this._resetDomPlayerState();
|
|
3688
3694
|
}
|
|
3689
3695
|
else {
|
|
3690
|
-
this.domPlayer
|
|
3696
|
+
this.domPlayer?.pause();
|
|
3691
3697
|
}
|
|
3692
3698
|
}
|
|
3693
3699
|
_convertKeyframesToObject(keyframes) {
|
|
@@ -3699,7 +3705,15 @@ class WebAnimationsPlayer {
|
|
|
3699
3705
|
}
|
|
3700
3706
|
/** @internal */
|
|
3701
3707
|
_triggerWebAnimation(element, keyframes, options) {
|
|
3702
|
-
|
|
3708
|
+
const keyframesObject = this._convertKeyframesToObject(keyframes);
|
|
3709
|
+
// Account for `Element.animate` throwing an exception (Firefox) or returning null (Chromium) in certain
|
|
3710
|
+
// conditions. See https://github.com/angular/angular/issues/64486
|
|
3711
|
+
try {
|
|
3712
|
+
return element.animate(keyframesObject, options);
|
|
3713
|
+
}
|
|
3714
|
+
catch {
|
|
3715
|
+
return null;
|
|
3716
|
+
}
|
|
3703
3717
|
}
|
|
3704
3718
|
onStart(fn) {
|
|
3705
3719
|
this._originalOnStartFns.push(fn);
|
|
@@ -3713,7 +3727,10 @@ class WebAnimationsPlayer {
|
|
|
3713
3727
|
this._onDestroyFns.push(fn);
|
|
3714
3728
|
}
|
|
3715
3729
|
play() {
|
|
3716
|
-
this._buildPlayer();
|
|
3730
|
+
const player = this._buildPlayer();
|
|
3731
|
+
if (!player) {
|
|
3732
|
+
return;
|
|
3733
|
+
}
|
|
3717
3734
|
if (!this.hasStarted()) {
|
|
3718
3735
|
this._onStartFns.forEach((fn) => fn());
|
|
3719
3736
|
this._onStartFns = [];
|
|
@@ -3722,14 +3739,16 @@ class WebAnimationsPlayer {
|
|
|
3722
3739
|
this._specialStyles.start();
|
|
3723
3740
|
}
|
|
3724
3741
|
}
|
|
3725
|
-
|
|
3742
|
+
player.play();
|
|
3726
3743
|
}
|
|
3727
3744
|
pause() {
|
|
3728
3745
|
this.init();
|
|
3729
|
-
this.domPlayer
|
|
3746
|
+
this.domPlayer?.pause();
|
|
3730
3747
|
}
|
|
3731
3748
|
finish() {
|
|
3732
3749
|
this.init();
|
|
3750
|
+
if (!this.domPlayer)
|
|
3751
|
+
return;
|
|
3733
3752
|
if (this._specialStyles) {
|
|
3734
3753
|
this._specialStyles.finish();
|
|
3735
3754
|
}
|
|
@@ -3745,9 +3764,7 @@ class WebAnimationsPlayer {
|
|
|
3745
3764
|
this._onDoneFns = this._originalOnDoneFns;
|
|
3746
3765
|
}
|
|
3747
3766
|
_resetDomPlayerState() {
|
|
3748
|
-
|
|
3749
|
-
this.domPlayer.cancel();
|
|
3750
|
-
}
|
|
3767
|
+
this.domPlayer?.cancel();
|
|
3751
3768
|
}
|
|
3752
3769
|
restart() {
|
|
3753
3770
|
this.reset();
|
|
@@ -3769,12 +3786,17 @@ class WebAnimationsPlayer {
|
|
|
3769
3786
|
}
|
|
3770
3787
|
}
|
|
3771
3788
|
setPosition(p) {
|
|
3772
|
-
if (this.domPlayer
|
|
3789
|
+
if (!this.domPlayer) {
|
|
3773
3790
|
this.init();
|
|
3774
3791
|
}
|
|
3775
|
-
this.domPlayer
|
|
3792
|
+
if (this.domPlayer) {
|
|
3793
|
+
this.domPlayer.currentTime = p * this.time;
|
|
3794
|
+
}
|
|
3776
3795
|
}
|
|
3777
3796
|
getPosition() {
|
|
3797
|
+
if (!this.domPlayer) {
|
|
3798
|
+
return this._initialized ? 1 : 0;
|
|
3799
|
+
}
|
|
3778
3800
|
// tsc is complaining with TS2362 without the conversion to number
|
|
3779
3801
|
return +(this.domPlayer.currentTime ?? 0) / this.time;
|
|
3780
3802
|
}
|
|
@@ -3954,7 +3976,7 @@ class BaseAnimationRenderer {
|
|
|
3954
3976
|
// Elements using the new `animate.leave` API require synchronous removal and should
|
|
3955
3977
|
// skip the rest of the legacy animation behaviors.
|
|
3956
3978
|
if (requireSynchronousElementRemoval) {
|
|
3957
|
-
this.delegate.removeChild(parent, oldChild, isHostElement);
|
|
3979
|
+
this.delegate.removeChild(parent, oldChild, isHostElement, requireSynchronousElementRemoval);
|
|
3958
3980
|
return;
|
|
3959
3981
|
}
|
|
3960
3982
|
// Prior to the changes in #57203, this method wasn't being called at all by `core` if the child
|