@angular/animations 19.0.0-next.9 → 19.0.0-rc.0
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/browser/index.d.ts +1 -1
- package/browser/testing/index.d.ts +1 -1
- package/fesm2022/animations.mjs +38 -30
- package/fesm2022/animations.mjs.map +1 -1
- package/fesm2022/browser/testing.mjs +14 -8
- package/fesm2022/browser/testing.mjs.map +1 -1
- package/fesm2022/browser.mjs +170 -99
- package/fesm2022/browser.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"testing.mjs","sources":["../../../../../../../packages/animations/browser/testing/src/mock_animation_driver.ts","../../../../../../../packages/animations/browser/testing/public_api.ts","../../../../../../../packages/animations/browser/testing/index.ts","../../../../../../../packages/animations/browser/testing/testing.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 {AnimationPlayer, AUTO_STYLE, NoopAnimationPlayer, ɵStyleDataMap} from '@angular/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 '@angular/animations/browser';\n\n/**\n * @publicApi\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 */\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","/**\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 */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n","/**\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 */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verifcation. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["validateStyleProperty","containsElement","getParentElement","invokeQuery","normalizeKeyframes","allowPreviousPlayerStylesMerge"],"mappings":";;;;;;;;;AAoBA;;AAEG;MACU,mBAAmB,CAAA;
|
1
|
+
{"version":3,"file":"testing.mjs","sources":["../../../../../../../packages/animations/browser/testing/src/mock_animation_driver.ts","../../../../../../../packages/animations/browser/testing/public_api.ts","../../../../../../../packages/animations/browser/testing/index.ts","../../../../../../../packages/animations/browser/testing/testing.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 {AnimationPlayer, AUTO_STYLE, NoopAnimationPlayer, ɵStyleDataMap} from '@angular/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 '@angular/animations/browser';\n\n/**\n * @publicApi\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 */\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","/**\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 */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of this package.\n */\nexport * from './src/testing';\n","/**\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 */\n\n// This file is not used to build this module. It is only used during editing\n// by the TypeScript language service and during build for verifcation. `ngc`\n// replaces this file with production index.ts when it rewrites private symbol\n// names.\n\nexport * from './public_api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["validateStyleProperty","containsElement","getParentElement","invokeQuery","normalizeKeyframes","allowPreviousPlayerStylesMerge"],"mappings":";;;;;;;;;AAoBA;;AAEG;MACU,mBAAmB,CAAA;AAC9B,IAAA,OAAO,GAAG,G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GAAG,UAAU,CAAC,CAAC;qBACxD;iBACF;AACH,aAAC,CAAC,CAAC;SACJ;AAED,QAAA,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;KACjC;AACF;;AC5JD;;;;AAIG;;ACJH;;ACRA;;AAEG;;;;"}
|
package/fesm2022/browser.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/**
|
2
|
-
* @license Angular v19.0.0-
|
2
|
+
* @license Angular v19.0.0-rc.0
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
4
4
|
* License: MIT
|
5
5
|
*/
|
@@ -548,10 +548,10 @@ class NoopAnimationDriver {
|
|
548
548
|
animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {
|
549
549
|
return new NoopAnimationPlayer(duration, delay);
|
550
550
|
}
|
551
|
-
static
|
552
|
-
static
|
551
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
552
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: NoopAnimationDriver });
|
553
553
|
}
|
554
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-
|
554
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-rc.0", ngImport: i0, type: NoopAnimationDriver, decorators: [{
|
555
555
|
type: Injectable
|
556
556
|
}] });
|
557
557
|
/**
|
@@ -561,7 +561,7 @@ class AnimationDriver {
|
|
561
561
|
/**
|
562
562
|
* @deprecated Use the NoopAnimationDriver class.
|
563
563
|
*/
|
564
|
-
static
|
564
|
+
static NOOP = new NoopAnimationDriver();
|
565
565
|
}
|
566
566
|
|
567
567
|
class AnimationStyleNormalizer {
|
@@ -982,6 +982,7 @@ function buildAnimationAst(driver, metadata, errors, warnings) {
|
|
982
982
|
}
|
983
983
|
const ROOT_SELECTOR = '';
|
984
984
|
class AnimationAstBuilderVisitor {
|
985
|
+
_driver;
|
985
986
|
constructor(_driver) {
|
986
987
|
this._driver = _driver;
|
987
988
|
}
|
@@ -1371,18 +1372,19 @@ function normalizeParams(obj) {
|
|
1371
1372
|
return obj ? { ...obj } : null;
|
1372
1373
|
}
|
1373
1374
|
class AnimationAstBuilderContext {
|
1375
|
+
errors;
|
1376
|
+
queryCount = 0;
|
1377
|
+
depCount = 0;
|
1378
|
+
currentTransition = null;
|
1379
|
+
currentQuery = null;
|
1380
|
+
currentQuerySelector = null;
|
1381
|
+
currentAnimateTimings = null;
|
1382
|
+
currentTime = 0;
|
1383
|
+
collectedStyles = new Map();
|
1384
|
+
options = null;
|
1385
|
+
unsupportedCSSPropertiesFound = new Set();
|
1374
1386
|
constructor(errors) {
|
1375
1387
|
this.errors = errors;
|
1376
|
-
this.queryCount = 0;
|
1377
|
-
this.depCount = 0;
|
1378
|
-
this.currentTransition = null;
|
1379
|
-
this.currentQuery = null;
|
1380
|
-
this.currentQuerySelector = null;
|
1381
|
-
this.currentAnimateTimings = null;
|
1382
|
-
this.currentTime = 0;
|
1383
|
-
this.collectedStyles = new Map();
|
1384
|
-
this.options = null;
|
1385
|
-
this.unsupportedCSSPropertiesFound = new Set();
|
1386
1388
|
}
|
1387
1389
|
}
|
1388
1390
|
function consumeOffset(styles) {
|
@@ -1456,9 +1458,7 @@ function createTimelineInstruction(element, keyframes, preStyleProps, postStyleP
|
|
1456
1458
|
}
|
1457
1459
|
|
1458
1460
|
class ElementInstructionMap {
|
1459
|
-
|
1460
|
-
this._map = new Map();
|
1461
|
-
}
|
1461
|
+
_map = new Map();
|
1462
1462
|
get(element) {
|
1463
1463
|
return this._map.get(element) || [];
|
1464
1464
|
}
|
@@ -1850,6 +1850,22 @@ class AnimationTimelineBuilderVisitor {
|
|
1850
1850
|
}
|
1851
1851
|
const DEFAULT_NOOP_PREVIOUS_NODE = {};
|
1852
1852
|
class AnimationTimelineContext {
|
1853
|
+
_driver;
|
1854
|
+
element;
|
1855
|
+
subInstructions;
|
1856
|
+
_enterClassName;
|
1857
|
+
_leaveClassName;
|
1858
|
+
errors;
|
1859
|
+
timelines;
|
1860
|
+
parentContext = null;
|
1861
|
+
currentTimeline;
|
1862
|
+
currentAnimateTimings = null;
|
1863
|
+
previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
|
1864
|
+
subContextCount = 0;
|
1865
|
+
options = {};
|
1866
|
+
currentQueryIndex = 0;
|
1867
|
+
currentQueryTotal = 0;
|
1868
|
+
currentStaggerTime = 0;
|
1853
1869
|
constructor(_driver, element, subInstructions, _enterClassName, _leaveClassName, errors, timelines, initialTimeline) {
|
1854
1870
|
this._driver = _driver;
|
1855
1871
|
this.element = element;
|
@@ -1858,14 +1874,6 @@ class AnimationTimelineContext {
|
|
1858
1874
|
this._leaveClassName = _leaveClassName;
|
1859
1875
|
this.errors = errors;
|
1860
1876
|
this.timelines = timelines;
|
1861
|
-
this.parentContext = null;
|
1862
|
-
this.currentAnimateTimings = null;
|
1863
|
-
this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
|
1864
|
-
this.subContextCount = 0;
|
1865
|
-
this.options = {};
|
1866
|
-
this.currentQueryIndex = 0;
|
1867
|
-
this.currentQueryTotal = 0;
|
1868
|
-
this.currentStaggerTime = 0;
|
1869
1877
|
this.currentTimeline = initialTimeline || new TimelineBuilder(this._driver, element, 0);
|
1870
1878
|
timelines.push(this.currentTimeline);
|
1871
1879
|
}
|
@@ -1974,21 +1982,26 @@ class AnimationTimelineContext {
|
|
1974
1982
|
}
|
1975
1983
|
}
|
1976
1984
|
class TimelineBuilder {
|
1985
|
+
_driver;
|
1986
|
+
element;
|
1987
|
+
startTime;
|
1988
|
+
_elementTimelineStylesLookup;
|
1989
|
+
duration = 0;
|
1990
|
+
easing = null;
|
1991
|
+
_previousKeyframe = new Map();
|
1992
|
+
_currentKeyframe = new Map();
|
1993
|
+
_keyframes = new Map();
|
1994
|
+
_styleSummary = new Map();
|
1995
|
+
_localTimelineStyles = new Map();
|
1996
|
+
_globalTimelineStyles;
|
1997
|
+
_pendingStyles = new Map();
|
1998
|
+
_backFill = new Map();
|
1999
|
+
_currentEmptyStepKeyframe = null;
|
1977
2000
|
constructor(_driver, element, startTime, _elementTimelineStylesLookup) {
|
1978
2001
|
this._driver = _driver;
|
1979
2002
|
this.element = element;
|
1980
2003
|
this.startTime = startTime;
|
1981
2004
|
this._elementTimelineStylesLookup = _elementTimelineStylesLookup;
|
1982
|
-
this.duration = 0;
|
1983
|
-
this.easing = null;
|
1984
|
-
this._previousKeyframe = new Map();
|
1985
|
-
this._currentKeyframe = new Map();
|
1986
|
-
this._keyframes = new Map();
|
1987
|
-
this._styleSummary = new Map();
|
1988
|
-
this._localTimelineStyles = new Map();
|
1989
|
-
this._pendingStyles = new Map();
|
1990
|
-
this._backFill = new Map();
|
1991
|
-
this._currentEmptyStepKeyframe = null;
|
1992
2005
|
if (!this._elementTimelineStylesLookup) {
|
1993
2006
|
this._elementTimelineStylesLookup = new Map();
|
1994
2007
|
}
|
@@ -2165,6 +2178,11 @@ class TimelineBuilder {
|
|
2165
2178
|
}
|
2166
2179
|
}
|
2167
2180
|
class SubTimelineBuilder extends TimelineBuilder {
|
2181
|
+
keyframes;
|
2182
|
+
preStyleProps;
|
2183
|
+
postStyleProps;
|
2184
|
+
_stretchStartingKeyframe;
|
2185
|
+
timings;
|
2168
2186
|
constructor(driver, element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe = false) {
|
2169
2187
|
super(driver, element, timings.delay);
|
2170
2188
|
this.keyframes = keyframes;
|
@@ -2266,6 +2284,9 @@ function createTransitionInstruction(element, triggerName, fromState, toState, i
|
|
2266
2284
|
|
2267
2285
|
const EMPTY_OBJECT = {};
|
2268
2286
|
class AnimationTransitionFactory {
|
2287
|
+
_triggerName;
|
2288
|
+
ast;
|
2289
|
+
_stateStyles;
|
2269
2290
|
constructor(_triggerName, ast, _stateStyles) {
|
2270
2291
|
this._triggerName = _triggerName;
|
2271
2292
|
this.ast = ast;
|
@@ -2388,6 +2409,9 @@ function applyParamDefaults(userParams, defaults) {
|
|
2388
2409
|
return result;
|
2389
2410
|
}
|
2390
2411
|
class AnimationStateStyles {
|
2412
|
+
styles;
|
2413
|
+
defaultParams;
|
2414
|
+
normalizer;
|
2391
2415
|
constructor(styles, defaultParams, normalizer) {
|
2392
2416
|
this.styles = styles;
|
2393
2417
|
this.defaultParams = defaultParams;
|
@@ -2416,12 +2440,16 @@ function buildTrigger(name, ast, normalizer) {
|
|
2416
2440
|
return new AnimationTrigger(name, ast, normalizer);
|
2417
2441
|
}
|
2418
2442
|
class AnimationTrigger {
|
2443
|
+
name;
|
2444
|
+
ast;
|
2445
|
+
_normalizer;
|
2446
|
+
transitionFactories = [];
|
2447
|
+
fallbackTransition;
|
2448
|
+
states = new Map();
|
2419
2449
|
constructor(name, ast, _normalizer) {
|
2420
2450
|
this.name = name;
|
2421
2451
|
this.ast = ast;
|
2422
2452
|
this._normalizer = _normalizer;
|
2423
|
-
this.transitionFactories = [];
|
2424
|
-
this.states = new Map();
|
2425
2453
|
ast.states.forEach((ast) => {
|
2426
2454
|
const defaultParams = (ast.options && ast.options.params) || {};
|
2427
2455
|
this.states.set(ast.name, new AnimationStateStyles(ast.style, defaultParams, _normalizer));
|
@@ -2470,13 +2498,16 @@ function balanceProperties(stateMap, key1, key2) {
|
|
2470
2498
|
|
2471
2499
|
const EMPTY_INSTRUCTION_MAP = new ElementInstructionMap();
|
2472
2500
|
class TimelineAnimationEngine {
|
2501
|
+
bodyNode;
|
2502
|
+
_driver;
|
2503
|
+
_normalizer;
|
2504
|
+
_animations = new Map();
|
2505
|
+
_playersById = new Map();
|
2506
|
+
players = [];
|
2473
2507
|
constructor(bodyNode, _driver, _normalizer) {
|
2474
2508
|
this.bodyNode = bodyNode;
|
2475
2509
|
this._driver = _driver;
|
2476
2510
|
this._normalizer = _normalizer;
|
2477
|
-
this._animations = new Map();
|
2478
|
-
this._playersById = new Map();
|
2479
|
-
this.players = [];
|
2480
2511
|
}
|
2481
2512
|
register(id, metadata) {
|
2482
2513
|
const errors = [];
|
@@ -2616,6 +2647,9 @@ const NULL_REMOVED_QUERIED_STATE = {
|
|
2616
2647
|
};
|
2617
2648
|
const REMOVAL_FLAG = '__ng_removed';
|
2618
2649
|
class StateValue {
|
2650
|
+
namespaceId;
|
2651
|
+
value;
|
2652
|
+
options;
|
2619
2653
|
get params() {
|
2620
2654
|
return this.options.params;
|
2621
2655
|
}
|
@@ -2651,14 +2685,18 @@ class StateValue {
|
|
2651
2685
|
const VOID_VALUE = 'void';
|
2652
2686
|
const DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE);
|
2653
2687
|
class AnimationTransitionNamespace {
|
2688
|
+
id;
|
2689
|
+
hostElement;
|
2690
|
+
_engine;
|
2691
|
+
players = [];
|
2692
|
+
_triggers = new Map();
|
2693
|
+
_queue = [];
|
2694
|
+
_elementListeners = new Map();
|
2695
|
+
_hostClassName;
|
2654
2696
|
constructor(id, hostElement, _engine) {
|
2655
2697
|
this.id = id;
|
2656
2698
|
this.hostElement = hostElement;
|
2657
2699
|
this._engine = _engine;
|
2658
|
-
this.players = [];
|
2659
|
-
this._triggers = new Map();
|
2660
|
-
this._queue = [];
|
2661
|
-
this._elementListeners = new Map();
|
2662
2700
|
this._hostClassName = 'ng-tns-' + id;
|
2663
2701
|
addClass(hostElement, this._hostClassName);
|
2664
2702
|
}
|
@@ -3008,6 +3046,26 @@ class AnimationTransitionNamespace {
|
|
3008
3046
|
}
|
3009
3047
|
}
|
3010
3048
|
class TransitionAnimationEngine {
|
3049
|
+
bodyNode;
|
3050
|
+
driver;
|
3051
|
+
_normalizer;
|
3052
|
+
players = [];
|
3053
|
+
newHostElements = new Map();
|
3054
|
+
playersByElement = new Map();
|
3055
|
+
playersByQueriedElement = new Map();
|
3056
|
+
statesByElement = new Map();
|
3057
|
+
disabledNodes = new Set();
|
3058
|
+
totalAnimations = 0;
|
3059
|
+
totalQueuedPlayers = 0;
|
3060
|
+
_namespaceLookup = {};
|
3061
|
+
_namespaceList = [];
|
3062
|
+
_flushFns = [];
|
3063
|
+
_whenQuietFns = [];
|
3064
|
+
namespacesByHostElement = new Map();
|
3065
|
+
collectedEnterElements = [];
|
3066
|
+
collectedLeaveElements = [];
|
3067
|
+
// this method is designed to be overridden by the code that uses this engine
|
3068
|
+
onRemovalComplete = (element, context) => { };
|
3011
3069
|
/** @internal */
|
3012
3070
|
_onRemovalComplete(element, context) {
|
3013
3071
|
this.onRemovalComplete(element, context);
|
@@ -3016,23 +3074,6 @@ class TransitionAnimationEngine {
|
|
3016
3074
|
this.bodyNode = bodyNode;
|
3017
3075
|
this.driver = driver;
|
3018
3076
|
this._normalizer = _normalizer;
|
3019
|
-
this.players = [];
|
3020
|
-
this.newHostElements = new Map();
|
3021
|
-
this.playersByElement = new Map();
|
3022
|
-
this.playersByQueriedElement = new Map();
|
3023
|
-
this.statesByElement = new Map();
|
3024
|
-
this.disabledNodes = new Set();
|
3025
|
-
this.totalAnimations = 0;
|
3026
|
-
this.totalQueuedPlayers = 0;
|
3027
|
-
this._namespaceLookup = {};
|
3028
|
-
this._namespaceList = [];
|
3029
|
-
this._flushFns = [];
|
3030
|
-
this._whenQuietFns = [];
|
3031
|
-
this.namespacesByHostElement = new Map();
|
3032
|
-
this.collectedEnterElements = [];
|
3033
|
-
this.collectedLeaveElements = [];
|
3034
|
-
// this method is designed to be overridden by the code that uses this engine
|
3035
|
-
this.onRemovalComplete = (element, context) => { };
|
3036
3077
|
}
|
3037
3078
|
get queuedPlayers() {
|
3038
3079
|
const players = [];
|
@@ -3841,19 +3882,22 @@ class TransitionAnimationEngine {
|
|
3841
3882
|
}
|
3842
3883
|
}
|
3843
3884
|
class TransitionAnimationPlayer {
|
3885
|
+
namespaceId;
|
3886
|
+
triggerName;
|
3887
|
+
element;
|
3888
|
+
_player = new NoopAnimationPlayer();
|
3889
|
+
_containsRealPlayer = false;
|
3890
|
+
_queuedCallbacks = new Map();
|
3891
|
+
destroyed = false;
|
3892
|
+
parentPlayer = null;
|
3893
|
+
markedForDestroy = false;
|
3894
|
+
disabled = false;
|
3895
|
+
queued = true;
|
3896
|
+
totalTime = 0;
|
3844
3897
|
constructor(namespaceId, triggerName, element) {
|
3845
3898
|
this.namespaceId = namespaceId;
|
3846
3899
|
this.triggerName = triggerName;
|
3847
3900
|
this.element = element;
|
3848
|
-
this._player = new NoopAnimationPlayer();
|
3849
|
-
this._containsRealPlayer = false;
|
3850
|
-
this._queuedCallbacks = new Map();
|
3851
|
-
this.destroyed = false;
|
3852
|
-
this.parentPlayer = null;
|
3853
|
-
this.markedForDestroy = false;
|
3854
|
-
this.disabled = false;
|
3855
|
-
this.queued = true;
|
3856
|
-
this.totalTime = 0;
|
3857
3901
|
}
|
3858
3902
|
setRealPlayer(player) {
|
3859
3903
|
if (this._containsRealPlayer)
|
@@ -4098,12 +4142,16 @@ function replacePostStylesAsPre(element, allPreStyleElements, allPostStyleElemen
|
|
4098
4142
|
}
|
4099
4143
|
|
4100
4144
|
class AnimationEngine {
|
4145
|
+
_driver;
|
4146
|
+
_normalizer;
|
4147
|
+
_transitionEngine;
|
4148
|
+
_timelineEngine;
|
4149
|
+
_triggerCache = {};
|
4150
|
+
// this method is designed to be overridden by the code that uses this engine
|
4151
|
+
onRemovalComplete = (element, context) => { };
|
4101
4152
|
constructor(doc, _driver, _normalizer) {
|
4102
4153
|
this._driver = _driver;
|
4103
4154
|
this._normalizer = _normalizer;
|
4104
|
-
this._triggerCache = {};
|
4105
|
-
// this method is designed to be overridden by the code that uses this engine
|
4106
|
-
this.onRemovalComplete = (element, context) => { };
|
4107
4155
|
this._transitionEngine = new TransitionAnimationEngine(doc.body, _driver, _normalizer);
|
4108
4156
|
this._timelineEngine = new TimelineAnimationEngine(doc.body, _driver, _normalizer);
|
4109
4157
|
this._transitionEngine.onRemovalComplete = (element, context) => this.onRemovalComplete(element, context);
|
@@ -4207,12 +4255,16 @@ function packageNonAnimatableStyles(element, styles) {
|
|
4207
4255
|
* `destroy()` is called then all styles will be removed.
|
4208
4256
|
*/
|
4209
4257
|
class SpecialCasedStyles {
|
4210
|
-
|
4258
|
+
_element;
|
4259
|
+
_startStyles;
|
4260
|
+
_endStyles;
|
4261
|
+
static initialStylesByElement = /* @__PURE__ */ new WeakMap();
|
4262
|
+
_state = 0 /* SpecialCasedStylesState.Pending */;
|
4263
|
+
_initialStyles;
|
4211
4264
|
constructor(_element, _startStyles, _endStyles) {
|
4212
4265
|
this._element = _element;
|
4213
4266
|
this._startStyles = _startStyles;
|
4214
4267
|
this._endStyles = _endStyles;
|
4215
|
-
this._state = 0 /* SpecialCasedStylesState.Pending */;
|
4216
4268
|
let initialStyles = SpecialCasedStyles.initialStylesByElement.get(_element);
|
4217
4269
|
if (!initialStyles) {
|
4218
4270
|
SpecialCasedStyles.initialStylesByElement.set(_element, (initialStyles = new Map()));
|
@@ -4270,26 +4322,35 @@ function isNonAnimatableStyle(prop) {
|
|
4270
4322
|
}
|
4271
4323
|
|
4272
4324
|
class WebAnimationsPlayer {
|
4325
|
+
element;
|
4326
|
+
keyframes;
|
4327
|
+
options;
|
4328
|
+
_specialStyles;
|
4329
|
+
_onDoneFns = [];
|
4330
|
+
_onStartFns = [];
|
4331
|
+
_onDestroyFns = [];
|
4332
|
+
_duration;
|
4333
|
+
_delay;
|
4334
|
+
_initialized = false;
|
4335
|
+
_finished = false;
|
4336
|
+
_started = false;
|
4337
|
+
_destroyed = false;
|
4338
|
+
_finalKeyframe;
|
4339
|
+
// the following original fns are persistent copies of the _onStartFns and _onDoneFns
|
4340
|
+
// and are used to reset the fns to their original values upon reset()
|
4341
|
+
// (since the _onStartFns and _onDoneFns get deleted after they are called)
|
4342
|
+
_originalOnDoneFns = [];
|
4343
|
+
_originalOnStartFns = [];
|
4344
|
+
// using non-null assertion because it's re(set) by init();
|
4345
|
+
domPlayer;
|
4346
|
+
time = 0;
|
4347
|
+
parentPlayer = null;
|
4348
|
+
currentSnapshot = new Map();
|
4273
4349
|
constructor(element, keyframes, options, _specialStyles) {
|
4274
4350
|
this.element = element;
|
4275
4351
|
this.keyframes = keyframes;
|
4276
4352
|
this.options = options;
|
4277
4353
|
this._specialStyles = _specialStyles;
|
4278
|
-
this._onDoneFns = [];
|
4279
|
-
this._onStartFns = [];
|
4280
|
-
this._onDestroyFns = [];
|
4281
|
-
this._initialized = false;
|
4282
|
-
this._finished = false;
|
4283
|
-
this._started = false;
|
4284
|
-
this._destroyed = false;
|
4285
|
-
// the following original fns are persistent copies of the _onStartFns and _onDoneFns
|
4286
|
-
// and are used to reset the fns to their original values upon reset()
|
4287
|
-
// (since the _onStartFns and _onDoneFns get deleted after they are called)
|
4288
|
-
this._originalOnDoneFns = [];
|
4289
|
-
this._originalOnStartFns = [];
|
4290
|
-
this.time = 0;
|
4291
|
-
this.parentPlayer = null;
|
4292
|
-
this.currentSnapshot = new Map();
|
4293
4354
|
this._duration = options['duration'];
|
4294
4355
|
this._delay = options['delay'] || 0;
|
4295
4356
|
this.time = this._duration + this._delay;
|
@@ -4504,6 +4565,8 @@ function createEngine(type, doc) {
|
|
4504
4565
|
}
|
4505
4566
|
|
4506
4567
|
class Animation {
|
4568
|
+
_driver;
|
4569
|
+
_animationAst;
|
4507
4570
|
constructor(_driver, input) {
|
4508
4571
|
this._driver = _driver;
|
4509
4572
|
const errors = [];
|
@@ -4537,14 +4600,18 @@ class Animation {
|
|
4537
4600
|
const ANIMATION_PREFIX = '@';
|
4538
4601
|
const DISABLE_ANIMATIONS_FLAG = '@.disabled';
|
4539
4602
|
class BaseAnimationRenderer {
|
4603
|
+
namespaceId;
|
4604
|
+
delegate;
|
4605
|
+
engine;
|
4606
|
+
_onDestroy;
|
4607
|
+
// We need to explicitly type this property because of an api-extractor bug
|
4608
|
+
// See https://github.com/microsoft/rushstack/issues/4390
|
4609
|
+
ɵtype = 0 /* AnimationRendererType.Regular */;
|
4540
4610
|
constructor(namespaceId, delegate, engine, _onDestroy) {
|
4541
4611
|
this.namespaceId = namespaceId;
|
4542
4612
|
this.delegate = delegate;
|
4543
4613
|
this.engine = engine;
|
4544
4614
|
this._onDestroy = _onDestroy;
|
4545
|
-
// We need to explicitly type this property because of an api-extractor bug
|
4546
|
-
// See https://github.com/microsoft/rushstack/issues/4390
|
4547
|
-
this.ɵtype = 0 /* AnimationRendererType.Regular */;
|
4548
4615
|
}
|
4549
4616
|
get data() {
|
4550
4617
|
return this.delegate.data;
|
@@ -4636,6 +4703,7 @@ class BaseAnimationRenderer {
|
|
4636
4703
|
}
|
4637
4704
|
}
|
4638
4705
|
class AnimationRenderer extends BaseAnimationRenderer {
|
4706
|
+
factory;
|
4639
4707
|
constructor(factory, namespaceId, delegate, engine, onDestroy) {
|
4640
4708
|
super(namespaceId, delegate, engine, onDestroy);
|
4641
4709
|
this.factory = factory;
|
@@ -4693,15 +4761,18 @@ function parseTriggerCallbackName(triggerName) {
|
|
4693
4761
|
}
|
4694
4762
|
|
4695
4763
|
class AnimationRendererFactory {
|
4764
|
+
delegate;
|
4765
|
+
engine;
|
4766
|
+
_zone;
|
4767
|
+
_currentId = 0;
|
4768
|
+
_microtaskId = 1;
|
4769
|
+
_animationCallbacksBuffer = [];
|
4770
|
+
_rendererCache = new Map();
|
4771
|
+
_cdRecurDepth = 0;
|
4696
4772
|
constructor(delegate, engine, _zone) {
|
4697
4773
|
this.delegate = delegate;
|
4698
4774
|
this.engine = engine;
|
4699
4775
|
this._zone = _zone;
|
4700
|
-
this._currentId = 0;
|
4701
|
-
this._microtaskId = 1;
|
4702
|
-
this._animationCallbacksBuffer = [];
|
4703
|
-
this._rendererCache = new Map();
|
4704
|
-
this._cdRecurDepth = 0;
|
4705
4776
|
engine.onRemovalComplete = (element, delegate) => {
|
4706
4777
|
delegate?.removeChild(null, element);
|
4707
4778
|
};
|