@angular/animations 14.0.0-next.3 → 14.0.0-next.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 +2 -6
- package/browser/testing/testing.d.ts +1 -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/render/animation_driver.mjs +4 -4
- package/esm2020/browser/src/render/animation_engine_next.mjs +7 -2
- package/esm2020/browser/src/render/timeline_animation_engine.mjs +7 -2
- package/esm2020/browser/src/render/transition_animation_engine.mjs +14 -29
- package/esm2020/browser/src/warning_helpers.mjs +33 -0
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/animations.mjs +1 -1
- package/fesm2015/animations.mjs.map +1 -1
- package/fesm2015/browser/testing.mjs +1 -1
- package/fesm2015/browser/testing.mjs.map +1 -1
- package/fesm2015/browser.mjs +113 -77
- package/fesm2015/browser.mjs.map +1 -1
- package/fesm2020/animations.mjs +1 -1
- package/fesm2020/animations.mjs.map +1 -1
- package/fesm2020/browser/testing.mjs +1 -1
- package/fesm2020/browser/testing.mjs.map +1 -1
- package/fesm2020/browser.mjs +113 -77
- package/fesm2020/browser.mjs.map +1 -1
- package/package.json +3 -3
package/fesm2020/browser.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.0-next.
|
|
2
|
+
* @license Angular v14.0.0-next.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
|
|
|
@@ -363,9 +363,9 @@ class NoopAnimationDriver {
|
|
|
363
363
|
return new NoopAnimationPlayer(duration, delay);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
367
|
-
NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
368
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.
|
|
366
|
+
NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
367
|
+
NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: NoopAnimationDriver });
|
|
368
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.6", ngImport: i0, type: NoopAnimationDriver, decorators: [{
|
|
369
369
|
type: Injectable
|
|
370
370
|
}] });
|
|
371
371
|
/**
|
|
@@ -673,6 +673,39 @@ function computeStyle(element, prop) {
|
|
|
673
673
|
return window.getComputedStyle(element)[prop];
|
|
674
674
|
}
|
|
675
675
|
|
|
676
|
+
/**
|
|
677
|
+
* @license
|
|
678
|
+
* Copyright Google LLC All Rights Reserved.
|
|
679
|
+
*
|
|
680
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
681
|
+
* found in the LICENSE file at https://angular.io/license
|
|
682
|
+
*/
|
|
683
|
+
const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
|
|
684
|
+
function createListOfWarnings(warnings) {
|
|
685
|
+
const LINE_START = '\n - ';
|
|
686
|
+
return `${LINE_START}${warnings.filter(Boolean).map(warning => warning).join(LINE_START)}`;
|
|
687
|
+
}
|
|
688
|
+
function warnValidation(warnings) {
|
|
689
|
+
NG_DEV_MODE && console.warn(`animation validation warnings:${createListOfWarnings(warnings)}`);
|
|
690
|
+
}
|
|
691
|
+
function warnTriggerBuild(name, warnings) {
|
|
692
|
+
NG_DEV_MODE &&
|
|
693
|
+
console.warn(`The animation trigger "${name}" has built with the following warnings:${createListOfWarnings(warnings)}`);
|
|
694
|
+
}
|
|
695
|
+
function warnRegister(warnings) {
|
|
696
|
+
NG_DEV_MODE &&
|
|
697
|
+
console.warn(`Animation built with the following warnings:${createListOfWarnings(warnings)}`);
|
|
698
|
+
}
|
|
699
|
+
function triggerParsingWarnings(name, warnings) {
|
|
700
|
+
NG_DEV_MODE &&
|
|
701
|
+
console.warn(`Animation parsing for the ${name} trigger presents the following warnings:${createListOfWarnings(warnings)}`);
|
|
702
|
+
}
|
|
703
|
+
function pushUnrecognizedPropertiesWarning(warnings, props) {
|
|
704
|
+
if (ngDevMode && props.length) {
|
|
705
|
+
warnings.push(`The provided CSS properties are not recognized properties supported for animations: ${props.join(', ')}`);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
|
|
676
709
|
/**
|
|
677
710
|
* @license
|
|
678
711
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -796,18 +829,22 @@ const SELF_TOKEN_REGEX = new RegExp(`\s*${SELF_TOKEN}\s*,?`, 'g');
|
|
|
796
829
|
*
|
|
797
830
|
* Otherwise an error will be thrown.
|
|
798
831
|
*/
|
|
799
|
-
function buildAnimationAst(driver, metadata, errors) {
|
|
800
|
-
return new AnimationAstBuilderVisitor(driver).build(metadata, errors);
|
|
832
|
+
function buildAnimationAst(driver, metadata, errors, warnings) {
|
|
833
|
+
return new AnimationAstBuilderVisitor(driver).build(metadata, errors, warnings);
|
|
801
834
|
}
|
|
802
835
|
const ROOT_SELECTOR = '';
|
|
803
836
|
class AnimationAstBuilderVisitor {
|
|
804
837
|
constructor(_driver) {
|
|
805
838
|
this._driver = _driver;
|
|
806
839
|
}
|
|
807
|
-
build(metadata, errors) {
|
|
840
|
+
build(metadata, errors, warnings) {
|
|
808
841
|
const context = new AnimationAstBuilderContext(errors);
|
|
809
842
|
this._resetContextStyleTimingState(context);
|
|
810
|
-
|
|
843
|
+
const ast = visitDslNode(this, normalizeAnimationEntry(metadata), context);
|
|
844
|
+
if (context.unsupportedCSSPropertiesFound.size) {
|
|
845
|
+
pushUnrecognizedPropertiesWarning(warnings, [...context.unsupportedCSSPropertiesFound.keys()]);
|
|
846
|
+
}
|
|
847
|
+
return ast;
|
|
811
848
|
}
|
|
812
849
|
_resetContextStyleTimingState(context) {
|
|
813
850
|
context.currentQuerySelector = ROOT_SELECTOR;
|
|
@@ -1012,7 +1049,8 @@ class AnimationAstBuilderVisitor {
|
|
|
1012
1049
|
return;
|
|
1013
1050
|
tuple.forEach((value, prop) => {
|
|
1014
1051
|
if (!this._driver.validateStyleProperty(prop)) {
|
|
1015
|
-
|
|
1052
|
+
tuple.delete(prop);
|
|
1053
|
+
context.unsupportedCSSPropertiesFound.add(prop);
|
|
1016
1054
|
return;
|
|
1017
1055
|
}
|
|
1018
1056
|
// This is guaranteed to have a defined Map at this querySelector location making it
|
|
@@ -1181,6 +1219,7 @@ class AnimationAstBuilderContext {
|
|
|
1181
1219
|
this.currentTime = 0;
|
|
1182
1220
|
this.collectedStyles = new Map();
|
|
1183
1221
|
this.options = null;
|
|
1222
|
+
this.unsupportedCSSPropertiesFound = new Set();
|
|
1184
1223
|
}
|
|
1185
1224
|
}
|
|
1186
1225
|
function consumeOffset(styles) {
|
|
@@ -2037,10 +2076,14 @@ class Animation {
|
|
|
2037
2076
|
constructor(_driver, input) {
|
|
2038
2077
|
this._driver = _driver;
|
|
2039
2078
|
const errors = [];
|
|
2040
|
-
const
|
|
2079
|
+
const warnings = [];
|
|
2080
|
+
const ast = buildAnimationAst(_driver, input, errors, warnings);
|
|
2041
2081
|
if (errors.length) {
|
|
2042
2082
|
throw validationFailed(errors);
|
|
2043
2083
|
}
|
|
2084
|
+
if (warnings.length) {
|
|
2085
|
+
warnValidation(warnings);
|
|
2086
|
+
}
|
|
2044
2087
|
this._animationAst = ast;
|
|
2045
2088
|
}
|
|
2046
2089
|
buildTimelines(element, startingStyles, destinationStyles, options, subInstructions) {
|
|
@@ -2333,11 +2376,15 @@ class TimelineAnimationEngine {
|
|
|
2333
2376
|
}
|
|
2334
2377
|
register(id, metadata) {
|
|
2335
2378
|
const errors = [];
|
|
2336
|
-
const
|
|
2379
|
+
const warnings = [];
|
|
2380
|
+
const ast = buildAnimationAst(this._driver, metadata, errors, warnings);
|
|
2337
2381
|
if (errors.length) {
|
|
2338
2382
|
throw registerFailed(errors);
|
|
2339
2383
|
}
|
|
2340
2384
|
else {
|
|
2385
|
+
if (warnings.length) {
|
|
2386
|
+
warnRegister(warnings);
|
|
2387
|
+
}
|
|
2341
2388
|
this._animations.set(id, ast);
|
|
2342
2389
|
}
|
|
2343
2390
|
}
|
|
@@ -2924,35 +2971,20 @@ class TransitionAnimationEngine {
|
|
|
2924
2971
|
const limit = namespaceList.length - 1;
|
|
2925
2972
|
if (limit >= 0) {
|
|
2926
2973
|
let found = false;
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
found = true;
|
|
2940
|
-
break;
|
|
2941
|
-
}
|
|
2942
|
-
ancestor = this.driver.getParentElement(ancestor);
|
|
2943
|
-
}
|
|
2944
|
-
}
|
|
2945
|
-
else {
|
|
2946
|
-
// Slow path for backwards compatibility if the driver does not implement
|
|
2947
|
-
// `getParentElement`, to be removed once `getParentElement` is a required method.
|
|
2948
|
-
for (let i = limit; i >= 0; i--) {
|
|
2949
|
-
const nextNamespace = namespaceList[i];
|
|
2950
|
-
if (this.driver.containsElement(nextNamespace.hostElement, hostElement)) {
|
|
2951
|
-
namespaceList.splice(i + 1, 0, ns);
|
|
2952
|
-
found = true;
|
|
2953
|
-
break;
|
|
2954
|
-
}
|
|
2974
|
+
// Find the closest ancestor with an existing namespace so we can then insert `ns` after it,
|
|
2975
|
+
// establishing a top-down ordering of namespaces in `this._namespaceList`.
|
|
2976
|
+
let ancestor = this.driver.getParentElement(hostElement);
|
|
2977
|
+
while (ancestor) {
|
|
2978
|
+
const ancestorNs = namespacesByHostElement.get(ancestor);
|
|
2979
|
+
if (ancestorNs) {
|
|
2980
|
+
// An animation namespace has been registered for this ancestor, so we insert `ns`
|
|
2981
|
+
// right after it to establish top-down ordering of animation namespaces.
|
|
2982
|
+
const index = namespaceList.indexOf(ancestorNs);
|
|
2983
|
+
namespaceList.splice(index + 1, 0, ns);
|
|
2984
|
+
found = true;
|
|
2985
|
+
break;
|
|
2955
2986
|
}
|
|
2987
|
+
ancestor = this.driver.getParentElement(ancestor);
|
|
2956
2988
|
}
|
|
2957
2989
|
if (!found) {
|
|
2958
2990
|
// No namespace exists that is an ancestor of `ns`, so `ns` is inserted at the front to
|
|
@@ -3989,10 +4021,14 @@ class AnimationEngine {
|
|
|
3989
4021
|
let trigger = this._triggerCache[cacheKey];
|
|
3990
4022
|
if (!trigger) {
|
|
3991
4023
|
const errors = [];
|
|
3992
|
-
const
|
|
4024
|
+
const warnings = [];
|
|
4025
|
+
const ast = buildAnimationAst(this._driver, metadata, errors, warnings);
|
|
3993
4026
|
if (errors.length) {
|
|
3994
4027
|
throw triggerBuildFailed(name, errors);
|
|
3995
4028
|
}
|
|
4029
|
+
if (warnings.length) {
|
|
4030
|
+
warnTriggerBuild(name, warnings);
|
|
4031
|
+
}
|
|
3996
4032
|
trigger = buildTrigger(name, ast, this._normalizer);
|
|
3997
4033
|
this._triggerCache[cacheKey] = trigger;
|
|
3998
4034
|
}
|