@angular/animations 17.0.2 → 17.1.0-next.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/esm2022/browser/src/create_engine.mjs +1 -1
- package/esm2022/browser/src/dsl/animation.mjs +1 -1
- package/esm2022/browser/src/dsl/animation_ast_builder.mjs +18 -18
- package/esm2022/browser/src/dsl/animation_timeline_builder.mjs +5 -5
- package/esm2022/browser/src/dsl/animation_transition_expr.mjs +1 -1
- package/esm2022/browser/src/dsl/animation_transition_factory.mjs +1 -1
- package/esm2022/browser/src/dsl/animation_trigger.mjs +11 -3
- package/esm2022/browser/src/dsl/element_instruction_map.mjs +1 -1
- package/esm2022/browser/src/dsl/style_normalization/web_animations_style_normalizer.mjs +1 -1
- package/esm2022/browser/src/render/animation_driver.mjs +3 -3
- package/esm2022/browser/src/render/animation_engine_next.mjs +1 -1
- package/esm2022/browser/src/render/animation_renderer.mjs +1 -1
- package/esm2022/browser/src/render/renderer.mjs +1 -1
- package/esm2022/browser/src/render/shared.mjs +1 -1
- package/esm2022/browser/src/render/special_cased_styles.mjs +1 -1
- package/esm2022/browser/src/render/timeline_animation_engine.mjs +1 -1
- package/esm2022/browser/src/render/transition_animation_engine.mjs +1 -1
- package/esm2022/browser/src/render/web_animations/web_animations_driver.mjs +1 -1
- package/esm2022/browser/src/render/web_animations/web_animations_player.mjs +1 -1
- package/esm2022/browser/src/util.mjs +15 -15
- package/esm2022/browser/src/warning_helpers.mjs +1 -1
- package/esm2022/browser/testing/src/mock_animation_driver.mjs +1 -1
- package/esm2022/src/animation_builder.mjs +7 -7
- package/esm2022/src/animation_metadata.mjs +90 -14
- package/esm2022/src/animations.mjs +2 -2
- package/esm2022/src/players/animation_group_player.mjs +1 -1
- package/esm2022/src/players/animation_player.mjs +1 -1
- package/esm2022/src/version.mjs +1 -1
- package/fesm2022/animations.mjs +97 -21
- 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 +39 -39
- package/fesm2022/browser.mjs.map +1 -1
- package/index.d.ts +2 -2
- package/package.json +2 -2
package/fesm2022/browser.mjs
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
/**
|
2
|
-
* @license Angular v17.0.
|
2
|
+
* @license Angular v17.1.0-next.0
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
4
4
|
* License: MIT
|
5
5
|
*/
|
6
6
|
|
7
|
-
import { ɵAnimationGroupPlayer, NoopAnimationPlayer, AUTO_STYLE, ɵPRE_STYLE, sequence, style } from '@angular/animations';
|
7
|
+
import { ɵAnimationGroupPlayer, NoopAnimationPlayer, AUTO_STYLE, ɵPRE_STYLE, sequence, AnimationMetadataType, style } from '@angular/animations';
|
8
8
|
import * as i0 from '@angular/core';
|
9
9
|
import { ɵRuntimeError, Injectable } from '@angular/core';
|
10
10
|
|
@@ -545,10 +545,10 @@ class NoopAnimationDriver {
|
|
545
545
|
animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {
|
546
546
|
return new NoopAnimationPlayer(duration, delay);
|
547
547
|
}
|
548
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.
|
549
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.
|
548
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.0-next.0", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
549
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.0-next.0", ngImport: i0, type: NoopAnimationDriver }); }
|
550
550
|
}
|
551
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.
|
551
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.0-next.0", ngImport: i0, type: NoopAnimationDriver, decorators: [{
|
552
552
|
type: Injectable
|
553
553
|
}] });
|
554
554
|
/**
|
@@ -787,31 +787,31 @@ function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles)
|
|
787
787
|
}
|
788
788
|
function visitDslNode(visitor, node, context) {
|
789
789
|
switch (node.type) {
|
790
|
-
case
|
790
|
+
case AnimationMetadataType.Trigger:
|
791
791
|
return visitor.visitTrigger(node, context);
|
792
|
-
case
|
792
|
+
case AnimationMetadataType.State:
|
793
793
|
return visitor.visitState(node, context);
|
794
|
-
case
|
794
|
+
case AnimationMetadataType.Transition:
|
795
795
|
return visitor.visitTransition(node, context);
|
796
|
-
case
|
796
|
+
case AnimationMetadataType.Sequence:
|
797
797
|
return visitor.visitSequence(node, context);
|
798
|
-
case
|
798
|
+
case AnimationMetadataType.Group:
|
799
799
|
return visitor.visitGroup(node, context);
|
800
|
-
case
|
800
|
+
case AnimationMetadataType.Animate:
|
801
801
|
return visitor.visitAnimate(node, context);
|
802
|
-
case
|
802
|
+
case AnimationMetadataType.Keyframes:
|
803
803
|
return visitor.visitKeyframes(node, context);
|
804
|
-
case
|
804
|
+
case AnimationMetadataType.Style:
|
805
805
|
return visitor.visitStyle(node, context);
|
806
|
-
case
|
806
|
+
case AnimationMetadataType.Reference:
|
807
807
|
return visitor.visitReference(node, context);
|
808
|
-
case
|
808
|
+
case AnimationMetadataType.AnimateChild:
|
809
809
|
return visitor.visitAnimateChild(node, context);
|
810
|
-
case
|
810
|
+
case AnimationMetadataType.AnimateRef:
|
811
811
|
return visitor.visitAnimateRef(node, context);
|
812
|
-
case
|
812
|
+
case AnimationMetadataType.Query:
|
813
813
|
return visitor.visitQuery(node, context);
|
814
|
-
case
|
814
|
+
case AnimationMetadataType.Stagger:
|
815
815
|
return visitor.visitStagger(node, context);
|
816
816
|
default:
|
817
817
|
throw invalidNodeType(node.type);
|
@@ -1045,7 +1045,7 @@ class AnimationAstBuilderVisitor {
|
|
1045
1045
|
}
|
1046
1046
|
metadata.definitions.forEach(def => {
|
1047
1047
|
this._resetContextStyleTimingState(context);
|
1048
|
-
if (def.type ==
|
1048
|
+
if (def.type == AnimationMetadataType.State) {
|
1049
1049
|
const stateDef = def;
|
1050
1050
|
const name = stateDef.name;
|
1051
1051
|
name.toString().split(/\s*,\s*/).forEach(n => {
|
@@ -1054,7 +1054,7 @@ class AnimationAstBuilderVisitor {
|
|
1054
1054
|
});
|
1055
1055
|
stateDef.name = name;
|
1056
1056
|
}
|
1057
|
-
else if (def.type ==
|
1057
|
+
else if (def.type == AnimationMetadataType.Transition) {
|
1058
1058
|
const transition = this.visitTransition(def, context);
|
1059
1059
|
queryCount += transition.queryCount;
|
1060
1060
|
depCount += transition.depCount;
|
@@ -1065,7 +1065,7 @@ class AnimationAstBuilderVisitor {
|
|
1065
1065
|
}
|
1066
1066
|
});
|
1067
1067
|
return {
|
1068
|
-
type:
|
1068
|
+
type: AnimationMetadataType.Trigger,
|
1069
1069
|
name: metadata.name,
|
1070
1070
|
states,
|
1071
1071
|
transitions,
|
@@ -1097,7 +1097,7 @@ class AnimationAstBuilderVisitor {
|
|
1097
1097
|
}
|
1098
1098
|
}
|
1099
1099
|
return {
|
1100
|
-
type:
|
1100
|
+
type: AnimationMetadataType.State,
|
1101
1101
|
name: metadata.name,
|
1102
1102
|
style: styleAst,
|
1103
1103
|
options: astParams ? { params: astParams } : null
|
@@ -1109,7 +1109,7 @@ class AnimationAstBuilderVisitor {
|
|
1109
1109
|
const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
|
1110
1110
|
const matchers = parseTransitionExpr(metadata.expr, context.errors);
|
1111
1111
|
return {
|
1112
|
-
type:
|
1112
|
+
type: AnimationMetadataType.Transition,
|
1113
1113
|
matchers,
|
1114
1114
|
animation,
|
1115
1115
|
queryCount: context.queryCount,
|
@@ -1119,7 +1119,7 @@ class AnimationAstBuilderVisitor {
|
|
1119
1119
|
}
|
1120
1120
|
visitSequence(metadata, context) {
|
1121
1121
|
return {
|
1122
|
-
type:
|
1122
|
+
type: AnimationMetadataType.Sequence,
|
1123
1123
|
steps: metadata.steps.map(s => visitDslNode(this, s, context)),
|
1124
1124
|
options: normalizeAnimationOptions(metadata.options)
|
1125
1125
|
};
|
@@ -1135,7 +1135,7 @@ class AnimationAstBuilderVisitor {
|
|
1135
1135
|
});
|
1136
1136
|
context.currentTime = furthestTime;
|
1137
1137
|
return {
|
1138
|
-
type:
|
1138
|
+
type: AnimationMetadataType.Group,
|
1139
1139
|
steps,
|
1140
1140
|
options: normalizeAnimationOptions(metadata.options)
|
1141
1141
|
};
|
@@ -1145,7 +1145,7 @@ class AnimationAstBuilderVisitor {
|
|
1145
1145
|
context.currentAnimateTimings = timingAst;
|
1146
1146
|
let styleAst;
|
1147
1147
|
let styleMetadata = metadata.styles ? metadata.styles : style({});
|
1148
|
-
if (styleMetadata.type ==
|
1148
|
+
if (styleMetadata.type == AnimationMetadataType.Keyframes) {
|
1149
1149
|
styleAst = this.visitKeyframes(styleMetadata, context);
|
1150
1150
|
}
|
1151
1151
|
else {
|
@@ -1166,7 +1166,7 @@ class AnimationAstBuilderVisitor {
|
|
1166
1166
|
}
|
1167
1167
|
context.currentAnimateTimings = null;
|
1168
1168
|
return {
|
1169
|
-
type:
|
1169
|
+
type: AnimationMetadataType.Animate,
|
1170
1170
|
timings: timingAst,
|
1171
1171
|
style: styleAst,
|
1172
1172
|
options: null
|
@@ -1212,7 +1212,7 @@ class AnimationAstBuilderVisitor {
|
|
1212
1212
|
}
|
1213
1213
|
});
|
1214
1214
|
return {
|
1215
|
-
type:
|
1215
|
+
type: AnimationMetadataType.Style,
|
1216
1216
|
styles,
|
1217
1217
|
easing: collectedEasing,
|
1218
1218
|
offset: metadata.offset,
|
@@ -1264,7 +1264,7 @@ class AnimationAstBuilderVisitor {
|
|
1264
1264
|
});
|
1265
1265
|
}
|
1266
1266
|
visitKeyframes(metadata, context) {
|
1267
|
-
const ast = { type:
|
1267
|
+
const ast = { type: AnimationMetadataType.Keyframes, styles: [], options: null };
|
1268
1268
|
if (!context.currentAnimateTimings) {
|
1269
1269
|
context.errors.push(invalidKeyframes());
|
1270
1270
|
return ast;
|
@@ -1320,7 +1320,7 @@ class AnimationAstBuilderVisitor {
|
|
1320
1320
|
}
|
1321
1321
|
visitReference(metadata, context) {
|
1322
1322
|
return {
|
1323
|
-
type:
|
1323
|
+
type: AnimationMetadataType.Reference,
|
1324
1324
|
animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),
|
1325
1325
|
options: normalizeAnimationOptions(metadata.options)
|
1326
1326
|
};
|
@@ -1328,13 +1328,13 @@ class AnimationAstBuilderVisitor {
|
|
1328
1328
|
visitAnimateChild(metadata, context) {
|
1329
1329
|
context.depCount++;
|
1330
1330
|
return {
|
1331
|
-
type:
|
1331
|
+
type: AnimationMetadataType.AnimateChild,
|
1332
1332
|
options: normalizeAnimationOptions(metadata.options)
|
1333
1333
|
};
|
1334
1334
|
}
|
1335
1335
|
visitAnimateRef(metadata, context) {
|
1336
1336
|
return {
|
1337
|
-
type:
|
1337
|
+
type: AnimationMetadataType.AnimateRef,
|
1338
1338
|
animation: this.visitReference(metadata.animation, context),
|
1339
1339
|
options: normalizeAnimationOptions(metadata.options)
|
1340
1340
|
};
|
@@ -1352,7 +1352,7 @@ class AnimationAstBuilderVisitor {
|
|
1352
1352
|
context.currentQuery = null;
|
1353
1353
|
context.currentQuerySelector = parentSelector;
|
1354
1354
|
return {
|
1355
|
-
type:
|
1355
|
+
type: AnimationMetadataType.Query,
|
1356
1356
|
selector,
|
1357
1357
|
limit: options.limit || 0,
|
1358
1358
|
optional: !!options.optional,
|
@@ -1370,7 +1370,7 @@ class AnimationAstBuilderVisitor {
|
|
1370
1370
|
{ duration: 0, delay: 0, easing: 'full' } :
|
1371
1371
|
resolveTiming(metadata.timings, context.errors, true);
|
1372
1372
|
return {
|
1373
|
-
type:
|
1373
|
+
type: AnimationMetadataType.Stagger,
|
1374
1374
|
animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),
|
1375
1375
|
timings,
|
1376
1376
|
options: null
|
@@ -1689,7 +1689,7 @@ class AnimationTimelineBuilderVisitor {
|
|
1689
1689
|
ctx = context.createSubContext(options);
|
1690
1690
|
ctx.transformIntoNewTimeline();
|
1691
1691
|
if (options.delay != null) {
|
1692
|
-
if (ctx.previousNode.type ==
|
1692
|
+
if (ctx.previousNode.type == AnimationMetadataType.Style) {
|
1693
1693
|
ctx.currentTimeline.snapshotCurrentStyles();
|
1694
1694
|
ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
|
1695
1695
|
}
|
@@ -1748,7 +1748,7 @@ class AnimationTimelineBuilderVisitor {
|
|
1748
1748
|
timeline.snapshotCurrentStyles();
|
1749
1749
|
}
|
1750
1750
|
const style = ast.style;
|
1751
|
-
if (style.type ==
|
1751
|
+
if (style.type == AnimationMetadataType.Keyframes) {
|
1752
1752
|
this.visitKeyframes(style, context);
|
1753
1753
|
}
|
1754
1754
|
else {
|
@@ -1804,7 +1804,7 @@ class AnimationTimelineBuilderVisitor {
|
|
1804
1804
|
const options = (ast.options || {});
|
1805
1805
|
const delay = options.delay ? resolveTimingValue(options.delay) : 0;
|
1806
1806
|
if (delay &&
|
1807
|
-
(context.previousNode.type ===
|
1807
|
+
(context.previousNode.type === AnimationMetadataType.Style ||
|
1808
1808
|
(startTime == 0 && context.currentTimeline.hasCurrentStyleProperties()))) {
|
1809
1809
|
context.currentTimeline.snapshotCurrentStyles();
|
1810
1810
|
context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
|
@@ -2468,9 +2468,9 @@ class AnimationTrigger {
|
|
2468
2468
|
}
|
2469
2469
|
function createFallbackTransition(triggerName, states, normalizer) {
|
2470
2470
|
const matchers = [(fromState, toState) => true];
|
2471
|
-
const animation = { type:
|
2471
|
+
const animation = { type: AnimationMetadataType.Sequence, steps: [], options: null };
|
2472
2472
|
const transition = {
|
2473
|
-
type:
|
2473
|
+
type: AnimationMetadataType.Transition,
|
2474
2474
|
animation,
|
2475
2475
|
matchers,
|
2476
2476
|
options: null,
|