@angular/animations 13.2.3 → 13.2.6
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/animations.d.ts +1 -1
- package/browser/browser.d.ts +13 -1
- package/browser/testing/testing.d.ts +2 -1
- package/esm2020/browser/src/dsl/animation.mjs +7 -2
- package/esm2020/browser/src/dsl/animation_ast_builder.mjs +14 -7
- package/esm2020/browser/src/private_export.mjs +2 -2
- package/esm2020/browser/src/render/animation_driver.mjs +8 -5
- package/esm2020/browser/src/render/animation_engine_next.mjs +7 -2
- package/esm2020/browser/src/render/shared.mjs +14 -3
- package/esm2020/browser/src/render/timeline_animation_engine.mjs +7 -2
- package/esm2020/browser/src/render/transition_animation_engine.mjs +38 -11
- package/esm2020/browser/src/render/web_animations/web_animations_driver.mjs +5 -2
- package/esm2020/browser/src/warning_helpers.mjs +33 -0
- package/esm2020/browser/testing/src/mock_animation_driver.mjs +5 -2
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/animations.mjs +1 -1
- package/fesm2015/browser/testing.mjs +5 -2
- package/fesm2015/browser/testing.mjs.map +1 -1
- package/fesm2015/browser.mjs +157 -62
- package/fesm2015/browser.mjs.map +1 -1
- package/fesm2020/animations.mjs +1 -1
- package/fesm2020/browser/testing.mjs +5 -2
- package/fesm2020/browser/testing.mjs.map +1 -1
- package/fesm2020/browser.mjs +157 -62
- package/fesm2020/browser.mjs.map +1 -1
- package/package.json +2 -2
package/fesm2015/browser.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v13.2.
|
|
2
|
+
* @license Angular v13.2.6
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -15,130 +15,130 @@ import { ɵRuntimeError, Injectable } from '@angular/core';
|
|
|
15
15
|
* Use of this source code is governed by an MIT-style license that can be
|
|
16
16
|
* found in the LICENSE file at https://angular.io/license
|
|
17
17
|
*/
|
|
18
|
-
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
18
|
+
const NG_DEV_MODE$1 = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
19
19
|
const LINE_START = '\n - ';
|
|
20
20
|
function invalidTimingValue(exp) {
|
|
21
|
-
return new ɵRuntimeError(3000 /* INVALID_TIMING_VALUE */, NG_DEV_MODE && `The provided timing value "${exp}" is invalid.`);
|
|
21
|
+
return new ɵRuntimeError(3000 /* INVALID_TIMING_VALUE */, NG_DEV_MODE$1 && `The provided timing value "${exp}" is invalid.`);
|
|
22
22
|
}
|
|
23
23
|
function negativeStepValue() {
|
|
24
|
-
return new ɵRuntimeError(3100 /* NEGATIVE_STEP_VALUE */, NG_DEV_MODE && 'Duration values below 0 are not allowed for this animation step.');
|
|
24
|
+
return new ɵRuntimeError(3100 /* NEGATIVE_STEP_VALUE */, NG_DEV_MODE$1 && 'Duration values below 0 are not allowed for this animation step.');
|
|
25
25
|
}
|
|
26
26
|
function negativeDelayValue() {
|
|
27
|
-
return new ɵRuntimeError(3101 /* NEGATIVE_DELAY_VALUE */, NG_DEV_MODE && 'Delay values below 0 are not allowed for this animation step.');
|
|
27
|
+
return new ɵRuntimeError(3101 /* NEGATIVE_DELAY_VALUE */, NG_DEV_MODE$1 && 'Delay values below 0 are not allowed for this animation step.');
|
|
28
28
|
}
|
|
29
29
|
function invalidStyleParams(varName) {
|
|
30
|
-
return new ɵRuntimeError(3001 /* INVALID_STYLE_PARAMS */, NG_DEV_MODE &&
|
|
30
|
+
return new ɵRuntimeError(3001 /* INVALID_STYLE_PARAMS */, NG_DEV_MODE$1 &&
|
|
31
31
|
`Unable to resolve the local animation param ${varName} in the given list of values`);
|
|
32
32
|
}
|
|
33
33
|
function invalidParamValue(varName) {
|
|
34
|
-
return new ɵRuntimeError(3003 /* INVALID_PARAM_VALUE */, NG_DEV_MODE && `Please provide a value for the animation param ${varName}`);
|
|
34
|
+
return new ɵRuntimeError(3003 /* INVALID_PARAM_VALUE */, NG_DEV_MODE$1 && `Please provide a value for the animation param ${varName}`);
|
|
35
35
|
}
|
|
36
36
|
function invalidNodeType(nodeType) {
|
|
37
|
-
return new ɵRuntimeError(3004 /* INVALID_NODE_TYPE */, NG_DEV_MODE && `Unable to resolve animation metadata node #${nodeType}`);
|
|
37
|
+
return new ɵRuntimeError(3004 /* INVALID_NODE_TYPE */, NG_DEV_MODE$1 && `Unable to resolve animation metadata node #${nodeType}`);
|
|
38
38
|
}
|
|
39
39
|
function invalidCssUnitValue(userProvidedProperty, value) {
|
|
40
|
-
return new ɵRuntimeError(3005 /* INVALID_CSS_UNIT_VALUE */, NG_DEV_MODE && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);
|
|
40
|
+
return new ɵRuntimeError(3005 /* INVALID_CSS_UNIT_VALUE */, NG_DEV_MODE$1 && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);
|
|
41
41
|
}
|
|
42
42
|
function invalidTrigger() {
|
|
43
|
-
return new ɵRuntimeError(3006 /* INVALID_TRIGGER */, NG_DEV_MODE &&
|
|
43
|
+
return new ɵRuntimeError(3006 /* INVALID_TRIGGER */, NG_DEV_MODE$1 &&
|
|
44
44
|
'animation triggers cannot be prefixed with an `@` sign (e.g. trigger(\'@foo\', [...]))');
|
|
45
45
|
}
|
|
46
46
|
function invalidDefinition() {
|
|
47
|
-
return new ɵRuntimeError(3007 /* INVALID_DEFINITION */, NG_DEV_MODE && 'only state() and transition() definitions can sit inside of a trigger()');
|
|
47
|
+
return new ɵRuntimeError(3007 /* INVALID_DEFINITION */, NG_DEV_MODE$1 && 'only state() and transition() definitions can sit inside of a trigger()');
|
|
48
48
|
}
|
|
49
49
|
function invalidState(metadataName, missingSubs) {
|
|
50
|
-
return new ɵRuntimeError(3008 /* INVALID_STATE */, NG_DEV_MODE &&
|
|
50
|
+
return new ɵRuntimeError(3008 /* INVALID_STATE */, NG_DEV_MODE$1 &&
|
|
51
51
|
`state("${metadataName}", ...) must define default values for all the following style substitutions: ${missingSubs.join(', ')}`);
|
|
52
52
|
}
|
|
53
53
|
function invalidStyleValue(value) {
|
|
54
|
-
return new ɵRuntimeError(3002 /* INVALID_STYLE_VALUE */, NG_DEV_MODE && `The provided style string value ${value} is not allowed.`);
|
|
54
|
+
return new ɵRuntimeError(3002 /* INVALID_STYLE_VALUE */, NG_DEV_MODE$1 && `The provided style string value ${value} is not allowed.`);
|
|
55
55
|
}
|
|
56
56
|
function invalidProperty(prop) {
|
|
57
|
-
return new ɵRuntimeError(3009 /* INVALID_PROPERTY */, NG_DEV_MODE &&
|
|
57
|
+
return new ɵRuntimeError(3009 /* INVALID_PROPERTY */, NG_DEV_MODE$1 &&
|
|
58
58
|
`The provided animation property "${prop}" is not a supported CSS property for animations`);
|
|
59
59
|
}
|
|
60
60
|
function invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) {
|
|
61
|
-
return new ɵRuntimeError(3010 /* INVALID_PARALLEL_ANIMATION */, NG_DEV_MODE &&
|
|
61
|
+
return new ɵRuntimeError(3010 /* INVALID_PARALLEL_ANIMATION */, NG_DEV_MODE$1 &&
|
|
62
62
|
`The CSS property "${prop}" that exists between the times of "${firstStart}ms" and "${firstEnd}ms" is also being animated in a parallel animation between the times of "${secondStart}ms" and "${secondEnd}ms"`);
|
|
63
63
|
}
|
|
64
64
|
function invalidKeyframes() {
|
|
65
|
-
return new ɵRuntimeError(3011 /* INVALID_KEYFRAMES */, NG_DEV_MODE && `keyframes() must be placed inside of a call to animate()`);
|
|
65
|
+
return new ɵRuntimeError(3011 /* INVALID_KEYFRAMES */, NG_DEV_MODE$1 && `keyframes() must be placed inside of a call to animate()`);
|
|
66
66
|
}
|
|
67
67
|
function invalidOffset() {
|
|
68
|
-
return new ɵRuntimeError(3012 /* INVALID_OFFSET */, NG_DEV_MODE && `Please ensure that all keyframe offsets are between 0 and 1`);
|
|
68
|
+
return new ɵRuntimeError(3012 /* INVALID_OFFSET */, NG_DEV_MODE$1 && `Please ensure that all keyframe offsets are between 0 and 1`);
|
|
69
69
|
}
|
|
70
70
|
function keyframeOffsetsOutOfOrder() {
|
|
71
|
-
return new ɵRuntimeError(3200 /* KEYFRAME_OFFSETS_OUT_OF_ORDER */, NG_DEV_MODE && `Please ensure that all keyframe offsets are in order`);
|
|
71
|
+
return new ɵRuntimeError(3200 /* KEYFRAME_OFFSETS_OUT_OF_ORDER */, NG_DEV_MODE$1 && `Please ensure that all keyframe offsets are in order`);
|
|
72
72
|
}
|
|
73
73
|
function keyframesMissingOffsets() {
|
|
74
|
-
return new ɵRuntimeError(3202 /* KEYFRAMES_MISSING_OFFSETS */, NG_DEV_MODE && `Not all style() steps within the declared keyframes() contain offsets`);
|
|
74
|
+
return new ɵRuntimeError(3202 /* KEYFRAMES_MISSING_OFFSETS */, NG_DEV_MODE$1 && `Not all style() steps within the declared keyframes() contain offsets`);
|
|
75
75
|
}
|
|
76
76
|
function invalidStagger() {
|
|
77
|
-
return new ɵRuntimeError(3013 /* INVALID_STAGGER */, NG_DEV_MODE && `stagger() can only be used inside of query()`);
|
|
77
|
+
return new ɵRuntimeError(3013 /* INVALID_STAGGER */, NG_DEV_MODE$1 && `stagger() can only be used inside of query()`);
|
|
78
78
|
}
|
|
79
79
|
function invalidQuery(selector) {
|
|
80
|
-
return new ɵRuntimeError(3014 /* INVALID_QUERY */, NG_DEV_MODE &&
|
|
80
|
+
return new ɵRuntimeError(3014 /* INVALID_QUERY */, NG_DEV_MODE$1 &&
|
|
81
81
|
`\`query("${selector}")\` returned zero elements. (Use \`query("${selector}", { optional: true })\` if you wish to allow this.)`);
|
|
82
82
|
}
|
|
83
83
|
function invalidExpression(expr) {
|
|
84
|
-
return new ɵRuntimeError(3015 /* INVALID_EXPRESSION */, NG_DEV_MODE && `The provided transition expression "${expr}" is not supported`);
|
|
84
|
+
return new ɵRuntimeError(3015 /* INVALID_EXPRESSION */, NG_DEV_MODE$1 && `The provided transition expression "${expr}" is not supported`);
|
|
85
85
|
}
|
|
86
86
|
function invalidTransitionAlias(alias) {
|
|
87
|
-
return new ɵRuntimeError(3016 /* INVALID_TRANSITION_ALIAS */, NG_DEV_MODE && `The transition alias value "${alias}" is not supported`);
|
|
87
|
+
return new ɵRuntimeError(3016 /* INVALID_TRANSITION_ALIAS */, NG_DEV_MODE$1 && `The transition alias value "${alias}" is not supported`);
|
|
88
88
|
}
|
|
89
89
|
function validationFailed(errors) {
|
|
90
|
-
return new ɵRuntimeError(3500 /* VALIDATION_FAILED */, NG_DEV_MODE && `animation validation failed:\n${errors.map(err => err.message).join('\n')}`);
|
|
90
|
+
return new ɵRuntimeError(3500 /* VALIDATION_FAILED */, NG_DEV_MODE$1 && `animation validation failed:\n${errors.map(err => err.message).join('\n')}`);
|
|
91
91
|
}
|
|
92
92
|
function buildingFailed(errors) {
|
|
93
|
-
return new ɵRuntimeError(3501 /* BUILDING_FAILED */, NG_DEV_MODE && `animation building failed:\n${errors.map(err => err.message).join('\n')}`);
|
|
93
|
+
return new ɵRuntimeError(3501 /* BUILDING_FAILED */, NG_DEV_MODE$1 && `animation building failed:\n${errors.map(err => err.message).join('\n')}`);
|
|
94
94
|
}
|
|
95
95
|
function triggerBuildFailed(name, errors) {
|
|
96
|
-
return new ɵRuntimeError(3404 /* TRIGGER_BUILD_FAILED */, NG_DEV_MODE &&
|
|
96
|
+
return new ɵRuntimeError(3404 /* TRIGGER_BUILD_FAILED */, NG_DEV_MODE$1 &&
|
|
97
97
|
`The animation trigger "${name}" has failed to build due to the following errors:\n - ${errors.map(err => err.message).join('\n - ')}`);
|
|
98
98
|
}
|
|
99
99
|
function animationFailed(errors) {
|
|
100
|
-
return new ɵRuntimeError(3502 /* ANIMATION_FAILED */, NG_DEV_MODE &&
|
|
100
|
+
return new ɵRuntimeError(3502 /* ANIMATION_FAILED */, NG_DEV_MODE$1 &&
|
|
101
101
|
`Unable to animate due to the following errors:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`);
|
|
102
102
|
}
|
|
103
103
|
function registerFailed(errors) {
|
|
104
|
-
return new ɵRuntimeError(3503 /* REGISTRATION_FAILED */, NG_DEV_MODE &&
|
|
104
|
+
return new ɵRuntimeError(3503 /* REGISTRATION_FAILED */, NG_DEV_MODE$1 &&
|
|
105
105
|
`Unable to build the animation due to the following errors: ${errors.map(err => err.message).join('\n')}`);
|
|
106
106
|
}
|
|
107
107
|
function missingOrDestroyedAnimation() {
|
|
108
|
-
return new ɵRuntimeError(3300 /* MISSING_OR_DESTROYED_ANIMATION */, NG_DEV_MODE && 'The requested animation doesn\'t exist or has already been destroyed');
|
|
108
|
+
return new ɵRuntimeError(3300 /* MISSING_OR_DESTROYED_ANIMATION */, NG_DEV_MODE$1 && 'The requested animation doesn\'t exist or has already been destroyed');
|
|
109
109
|
}
|
|
110
110
|
function createAnimationFailed(errors) {
|
|
111
|
-
return new ɵRuntimeError(3504 /* CREATE_ANIMATION_FAILED */, NG_DEV_MODE &&
|
|
111
|
+
return new ɵRuntimeError(3504 /* CREATE_ANIMATION_FAILED */, NG_DEV_MODE$1 &&
|
|
112
112
|
`Unable to create the animation due to the following errors:${errors.map(err => err.message).join('\n')}`);
|
|
113
113
|
}
|
|
114
114
|
function missingPlayer(id) {
|
|
115
|
-
return new ɵRuntimeError(3301 /* MISSING_PLAYER */, NG_DEV_MODE && `Unable to find the timeline player referenced by ${id}`);
|
|
115
|
+
return new ɵRuntimeError(3301 /* MISSING_PLAYER */, NG_DEV_MODE$1 && `Unable to find the timeline player referenced by ${id}`);
|
|
116
116
|
}
|
|
117
117
|
function missingTrigger(phase, name) {
|
|
118
|
-
return new ɵRuntimeError(3302 /* MISSING_TRIGGER */, NG_DEV_MODE &&
|
|
118
|
+
return new ɵRuntimeError(3302 /* MISSING_TRIGGER */, NG_DEV_MODE$1 &&
|
|
119
119
|
`Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn\'t exist!`);
|
|
120
120
|
}
|
|
121
121
|
function missingEvent(name) {
|
|
122
|
-
return new ɵRuntimeError(3303 /* MISSING_EVENT */, NG_DEV_MODE &&
|
|
122
|
+
return new ɵRuntimeError(3303 /* MISSING_EVENT */, NG_DEV_MODE$1 &&
|
|
123
123
|
`Unable to listen on the animation trigger "${name}" because the provided event is undefined!`);
|
|
124
124
|
}
|
|
125
125
|
function unsupportedTriggerEvent(phase, name) {
|
|
126
|
-
return new ɵRuntimeError(3400 /* UNSUPPORTED_TRIGGER_EVENT */, NG_DEV_MODE &&
|
|
126
|
+
return new ɵRuntimeError(3400 /* UNSUPPORTED_TRIGGER_EVENT */, NG_DEV_MODE$1 &&
|
|
127
127
|
`The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`);
|
|
128
128
|
}
|
|
129
129
|
function unregisteredTrigger(name) {
|
|
130
|
-
return new ɵRuntimeError(3401 /* UNREGISTERED_TRIGGER */, NG_DEV_MODE && `The provided animation trigger "${name}" has not been registered!`);
|
|
130
|
+
return new ɵRuntimeError(3401 /* UNREGISTERED_TRIGGER */, NG_DEV_MODE$1 && `The provided animation trigger "${name}" has not been registered!`);
|
|
131
131
|
}
|
|
132
132
|
function triggerTransitionsFailed(errors) {
|
|
133
|
-
return new ɵRuntimeError(3402 /* TRIGGER_TRANSITIONS_FAILED */, NG_DEV_MODE &&
|
|
133
|
+
return new ɵRuntimeError(3402 /* TRIGGER_TRANSITIONS_FAILED */, NG_DEV_MODE$1 &&
|
|
134
134
|
`Unable to process animations due to the following failed trigger transitions\n ${errors.map(err => err.message).join('\n')}`);
|
|
135
135
|
}
|
|
136
136
|
function triggerParsingFailed(name, errors) {
|
|
137
|
-
return new ɵRuntimeError(3403 /* TRIGGER_PARSING_FAILED */, NG_DEV_MODE &&
|
|
137
|
+
return new ɵRuntimeError(3403 /* TRIGGER_PARSING_FAILED */, NG_DEV_MODE$1 &&
|
|
138
138
|
`Animation parsing for the ${name} trigger have failed:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`);
|
|
139
139
|
}
|
|
140
140
|
function transitionFailed(name, errors) {
|
|
141
|
-
return new ɵRuntimeError(3505 /* TRANSITION_FAILED */, NG_DEV_MODE &&
|
|
141
|
+
return new ɵRuntimeError(3505 /* TRANSITION_FAILED */, NG_DEV_MODE$1 &&
|
|
142
142
|
`@${name} has failed due to:\n ${errors.map(err => err.message).join('\n- ')}`);
|
|
143
143
|
}
|
|
144
144
|
|
|
@@ -262,6 +262,14 @@ let _contains = (elm1, elm2) => false;
|
|
|
262
262
|
let _query = (element, selector, multi) => {
|
|
263
263
|
return [];
|
|
264
264
|
};
|
|
265
|
+
let _documentElement = null;
|
|
266
|
+
function getParentElement(element) {
|
|
267
|
+
const parent = element.parentNode || element.host; // consider host to support shadow DOM
|
|
268
|
+
if (parent === _documentElement) {
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
return parent;
|
|
272
|
+
}
|
|
265
273
|
// Define utility methods for browsers and platform-server(domino) where Element
|
|
266
274
|
// and utility methods exist.
|
|
267
275
|
const _isNode = isNode();
|
|
@@ -270,12 +278,15 @@ if (_isNode || typeof Element !== 'undefined') {
|
|
|
270
278
|
_contains = (elm1, elm2) => elm1.contains(elm2);
|
|
271
279
|
}
|
|
272
280
|
else {
|
|
281
|
+
// Read the document element in an IIFE that's been marked pure to avoid a top-level property
|
|
282
|
+
// read that may prevent tree-shaking.
|
|
283
|
+
_documentElement = /* @__PURE__ */ (() => document.documentElement)();
|
|
273
284
|
_contains = (elm1, elm2) => {
|
|
274
|
-
while (elm2
|
|
285
|
+
while (elm2) {
|
|
275
286
|
if (elm2 === elm1) {
|
|
276
287
|
return true;
|
|
277
288
|
}
|
|
278
|
-
elm2 = elm2
|
|
289
|
+
elm2 = getParentElement(elm2);
|
|
279
290
|
}
|
|
280
291
|
return false;
|
|
281
292
|
};
|
|
@@ -348,6 +359,9 @@ class NoopAnimationDriver {
|
|
|
348
359
|
containsElement(elm1, elm2) {
|
|
349
360
|
return containsElement(elm1, elm2);
|
|
350
361
|
}
|
|
362
|
+
getParentElement(element) {
|
|
363
|
+
return getParentElement(element);
|
|
364
|
+
}
|
|
351
365
|
query(element, selector, multi) {
|
|
352
366
|
return invokeQuery(element, selector, multi);
|
|
353
367
|
}
|
|
@@ -358,9 +372,9 @@ class NoopAnimationDriver {
|
|
|
358
372
|
return new NoopAnimationPlayer(duration, delay);
|
|
359
373
|
}
|
|
360
374
|
}
|
|
361
|
-
NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.
|
|
362
|
-
NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.
|
|
363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.
|
|
375
|
+
NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
376
|
+
NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NoopAnimationDriver });
|
|
377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NoopAnimationDriver, decorators: [{
|
|
364
378
|
type: Injectable
|
|
365
379
|
}] });
|
|
366
380
|
/**
|
|
@@ -658,6 +672,39 @@ function computeStyle(element, prop) {
|
|
|
658
672
|
return window.getComputedStyle(element)[prop];
|
|
659
673
|
}
|
|
660
674
|
|
|
675
|
+
/**
|
|
676
|
+
* @license
|
|
677
|
+
* Copyright Google LLC All Rights Reserved.
|
|
678
|
+
*
|
|
679
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
680
|
+
* found in the LICENSE file at https://angular.io/license
|
|
681
|
+
*/
|
|
682
|
+
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
683
|
+
function createListOfWarnings(warnings) {
|
|
684
|
+
const LINE_START = '\n - ';
|
|
685
|
+
return `${LINE_START}${warnings.filter(Boolean).map(warning => warning).join(LINE_START)}`;
|
|
686
|
+
}
|
|
687
|
+
function warnValidation(warnings) {
|
|
688
|
+
NG_DEV_MODE && console.warn(`animation validation warnings:${createListOfWarnings(warnings)}`);
|
|
689
|
+
}
|
|
690
|
+
function warnTriggerBuild(name, warnings) {
|
|
691
|
+
NG_DEV_MODE &&
|
|
692
|
+
console.warn(`The animation trigger "${name}" has built with the following warnings:${createListOfWarnings(warnings)}`);
|
|
693
|
+
}
|
|
694
|
+
function warnRegister(warnings) {
|
|
695
|
+
NG_DEV_MODE &&
|
|
696
|
+
console.warn(`Animation built with the following warnings:${createListOfWarnings(warnings)}`);
|
|
697
|
+
}
|
|
698
|
+
function triggerParsingWarnings(name, warnings) {
|
|
699
|
+
NG_DEV_MODE &&
|
|
700
|
+
console.warn(`Animation parsing for the ${name} trigger presents the following warnings:${createListOfWarnings(warnings)}`);
|
|
701
|
+
}
|
|
702
|
+
function pushUnrecognizedPropertiesWarning(warnings, props) {
|
|
703
|
+
if (ngDevMode && props.length) {
|
|
704
|
+
warnings.push(`The provided CSS properties are not recognized properties supported for animations: ${props.join(', ')}`);
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
661
708
|
/**
|
|
662
709
|
* @license
|
|
663
710
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -781,18 +828,22 @@ const SELF_TOKEN_REGEX = new RegExp(`\s*${SELF_TOKEN}\s*,?`, 'g');
|
|
|
781
828
|
*
|
|
782
829
|
* Otherwise an error will be thrown.
|
|
783
830
|
*/
|
|
784
|
-
function buildAnimationAst(driver, metadata, errors) {
|
|
785
|
-
return new AnimationAstBuilderVisitor(driver).build(metadata, errors);
|
|
831
|
+
function buildAnimationAst(driver, metadata, errors, warnings) {
|
|
832
|
+
return new AnimationAstBuilderVisitor(driver).build(metadata, errors, warnings);
|
|
786
833
|
}
|
|
787
834
|
const ROOT_SELECTOR = '';
|
|
788
835
|
class AnimationAstBuilderVisitor {
|
|
789
836
|
constructor(_driver) {
|
|
790
837
|
this._driver = _driver;
|
|
791
838
|
}
|
|
792
|
-
build(metadata, errors) {
|
|
839
|
+
build(metadata, errors, warnings) {
|
|
793
840
|
const context = new AnimationAstBuilderContext(errors);
|
|
794
841
|
this._resetContextStyleTimingState(context);
|
|
795
|
-
|
|
842
|
+
const ast = visitDslNode(this, normalizeAnimationEntry(metadata), context);
|
|
843
|
+
if (context.unsupportedCSSPropertiesFound.size) {
|
|
844
|
+
pushUnrecognizedPropertiesWarning(warnings, [...context.unsupportedCSSPropertiesFound.keys()]);
|
|
845
|
+
}
|
|
846
|
+
return ast;
|
|
796
847
|
}
|
|
797
848
|
_resetContextStyleTimingState(context) {
|
|
798
849
|
context.currentQuerySelector = ROOT_SELECTOR;
|
|
@@ -1005,7 +1056,8 @@ class AnimationAstBuilderVisitor {
|
|
|
1005
1056
|
return;
|
|
1006
1057
|
Object.keys(tuple).forEach(prop => {
|
|
1007
1058
|
if (!this._driver.validateStyleProperty(prop)) {
|
|
1008
|
-
|
|
1059
|
+
delete tuple[prop];
|
|
1060
|
+
context.unsupportedCSSPropertiesFound.add(prop);
|
|
1009
1061
|
return;
|
|
1010
1062
|
}
|
|
1011
1063
|
const collectedStyles = context.collectedStyles[context.currentQuerySelector];
|
|
@@ -1172,6 +1224,7 @@ class AnimationAstBuilderContext {
|
|
|
1172
1224
|
this.currentTime = 0;
|
|
1173
1225
|
this.collectedStyles = {};
|
|
1174
1226
|
this.options = null;
|
|
1227
|
+
this.unsupportedCSSPropertiesFound = new Set();
|
|
1175
1228
|
}
|
|
1176
1229
|
}
|
|
1177
1230
|
function consumeOffset(styles) {
|
|
@@ -2041,10 +2094,14 @@ class Animation {
|
|
|
2041
2094
|
constructor(_driver, input) {
|
|
2042
2095
|
this._driver = _driver;
|
|
2043
2096
|
const errors = [];
|
|
2044
|
-
const
|
|
2097
|
+
const warnings = [];
|
|
2098
|
+
const ast = buildAnimationAst(_driver, input, errors, warnings);
|
|
2045
2099
|
if (errors.length) {
|
|
2046
2100
|
throw validationFailed(errors);
|
|
2047
2101
|
}
|
|
2102
|
+
if (warnings.length) {
|
|
2103
|
+
warnValidation(warnings);
|
|
2104
|
+
}
|
|
2048
2105
|
this._animationAst = ast;
|
|
2049
2106
|
}
|
|
2050
2107
|
buildTimelines(element, startingStyles, destinationStyles, options, subInstructions) {
|
|
@@ -2304,11 +2361,15 @@ class TimelineAnimationEngine {
|
|
|
2304
2361
|
}
|
|
2305
2362
|
register(id, metadata) {
|
|
2306
2363
|
const errors = [];
|
|
2307
|
-
const
|
|
2364
|
+
const warnings = [];
|
|
2365
|
+
const ast = buildAnimationAst(this._driver, metadata, errors, warnings);
|
|
2308
2366
|
if (errors.length) {
|
|
2309
2367
|
throw registerFailed(errors);
|
|
2310
2368
|
}
|
|
2311
2369
|
else {
|
|
2370
|
+
if (warnings.length) {
|
|
2371
|
+
warnRegister(warnings);
|
|
2372
|
+
}
|
|
2312
2373
|
this._animations[id] = ast;
|
|
2313
2374
|
}
|
|
2314
2375
|
}
|
|
@@ -2892,25 +2953,52 @@ class TransitionAnimationEngine {
|
|
|
2892
2953
|
return this._namespaceLookup[namespaceId] = ns;
|
|
2893
2954
|
}
|
|
2894
2955
|
_balanceNamespaceList(ns, hostElement) {
|
|
2895
|
-
const
|
|
2956
|
+
const namespaceList = this._namespaceList;
|
|
2957
|
+
const namespacesByHostElement = this.namespacesByHostElement;
|
|
2958
|
+
const limit = namespaceList.length - 1;
|
|
2896
2959
|
if (limit >= 0) {
|
|
2897
2960
|
let found = false;
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2961
|
+
if (this.driver.getParentElement !== undefined) {
|
|
2962
|
+
// Fast path for when the driver implements `getParentElement`, which allows us to find the
|
|
2963
|
+
// closest ancestor with an existing namespace that we can then insert `ns` after, without
|
|
2964
|
+
// having to inspect all existing namespaces.
|
|
2965
|
+
let ancestor = this.driver.getParentElement(hostElement);
|
|
2966
|
+
while (ancestor) {
|
|
2967
|
+
const ancestorNs = namespacesByHostElement.get(ancestor);
|
|
2968
|
+
if (ancestorNs) {
|
|
2969
|
+
// An animation namespace has been registered for this ancestor, so we insert `ns`
|
|
2970
|
+
// right after it to establish top-down ordering of animation namespaces.
|
|
2971
|
+
const index = namespaceList.indexOf(ancestorNs);
|
|
2972
|
+
namespaceList.splice(index + 1, 0, ns);
|
|
2973
|
+
found = true;
|
|
2974
|
+
break;
|
|
2975
|
+
}
|
|
2976
|
+
ancestor = this.driver.getParentElement(ancestor);
|
|
2977
|
+
}
|
|
2978
|
+
}
|
|
2979
|
+
else {
|
|
2980
|
+
// Slow path for backwards compatibility if the driver does not implement
|
|
2981
|
+
// `getParentElement`, to be removed once `getParentElement` is a required method.
|
|
2982
|
+
for (let i = limit; i >= 0; i--) {
|
|
2983
|
+
const nextNamespace = namespaceList[i];
|
|
2984
|
+
if (this.driver.containsElement(nextNamespace.hostElement, hostElement)) {
|
|
2985
|
+
namespaceList.splice(i + 1, 0, ns);
|
|
2986
|
+
found = true;
|
|
2987
|
+
break;
|
|
2988
|
+
}
|
|
2904
2989
|
}
|
|
2905
2990
|
}
|
|
2906
2991
|
if (!found) {
|
|
2907
|
-
|
|
2992
|
+
// No namespace exists that is an ancestor of `ns`, so `ns` is inserted at the front to
|
|
2993
|
+
// ensure that any existing descendants are ordered after `ns`, retaining the desired
|
|
2994
|
+
// top-down ordering.
|
|
2995
|
+
namespaceList.unshift(ns);
|
|
2908
2996
|
}
|
|
2909
2997
|
}
|
|
2910
2998
|
else {
|
|
2911
|
-
|
|
2999
|
+
namespaceList.push(ns);
|
|
2912
3000
|
}
|
|
2913
|
-
|
|
3001
|
+
namespacesByHostElement.set(hostElement, ns);
|
|
2914
3002
|
return ns;
|
|
2915
3003
|
}
|
|
2916
3004
|
register(namespaceId, hostElement) {
|
|
@@ -3954,10 +4042,14 @@ class AnimationEngine {
|
|
|
3954
4042
|
let trigger = this._triggerCache[cacheKey];
|
|
3955
4043
|
if (!trigger) {
|
|
3956
4044
|
const errors = [];
|
|
3957
|
-
const
|
|
4045
|
+
const warnings = [];
|
|
4046
|
+
const ast = buildAnimationAst(this._driver, metadata, errors, warnings);
|
|
3958
4047
|
if (errors.length) {
|
|
3959
4048
|
throw triggerBuildFailed(name, errors);
|
|
3960
4049
|
}
|
|
4050
|
+
if (warnings.length) {
|
|
4051
|
+
warnTriggerBuild(name, warnings);
|
|
4052
|
+
}
|
|
3961
4053
|
trigger = buildTrigger(name, ast, this._normalizer);
|
|
3962
4054
|
this._triggerCache[cacheKey] = trigger;
|
|
3963
4055
|
}
|
|
@@ -4279,6 +4371,9 @@ class WebAnimationsDriver {
|
|
|
4279
4371
|
containsElement(elm1, elm2) {
|
|
4280
4372
|
return containsElement(elm1, elm2);
|
|
4281
4373
|
}
|
|
4374
|
+
getParentElement(element) {
|
|
4375
|
+
return getParentElement(element);
|
|
4376
|
+
}
|
|
4282
4377
|
query(element, selector, multi) {
|
|
4283
4378
|
return invokeQuery(element, selector, multi);
|
|
4284
4379
|
}
|
|
@@ -4344,5 +4439,5 @@ class WebAnimationsDriver {
|
|
|
4344
4439
|
* Generated bundle index. Do not edit.
|
|
4345
4440
|
*/
|
|
4346
4441
|
|
|
4347
|
-
export { AnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationDriver as ɵNoopAnimationDriver, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, containsElement as ɵcontainsElement, invokeQuery as ɵinvokeQuery, validateStyleProperty as ɵvalidateStyleProperty };
|
|
4442
|
+
export { AnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationDriver as ɵNoopAnimationDriver, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, containsElement as ɵcontainsElement, getParentElement as ɵgetParentElement, invokeQuery as ɵinvokeQuery, validateStyleProperty as ɵvalidateStyleProperty };
|
|
4348
4443
|
//# sourceMappingURL=browser.mjs.map
|