@angular/animations 13.1.0-next.2 → 13.1.2
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 +172 -168
- package/browser/browser.d.ts +10 -9
- package/browser/testing/testing.d.ts +3 -3
- package/esm2020/browser/src/dsl/animation_ast_builder.mjs +3 -2
- package/esm2020/browser/src/dsl/animation_timeline_builder.mjs +8 -8
- package/esm2020/browser/src/dsl/element_instruction_map.mjs +3 -10
- package/esm2020/browser/src/private_export.mjs +2 -2
- package/esm2020/browser/src/render/animation_driver.mjs +8 -7
- package/esm2020/browser/src/render/css_keyframes/css_keyframes_driver.mjs +5 -4
- package/esm2020/browser/src/render/shared.mjs +1 -19
- package/esm2020/browser/src/render/transition_animation_engine.mjs +59 -60
- package/esm2020/browser/src/render/web_animations/web_animations_driver.mjs +5 -4
- package/esm2020/browser/src/render/web_animations/web_animations_player.mjs +7 -4
- package/esm2020/browser/src/util.mjs +1 -3
- package/esm2020/browser/testing/src/mock_animation_driver.mjs +4 -4
- package/esm2020/src/animation_builder.mjs +6 -4
- package/esm2020/src/animation_metadata.mjs +156 -157
- package/esm2020/src/players/animation_player.mjs +1 -1
- package/esm2020/src/version.mjs +3 -16
- package/fesm2015/animations.mjs +162 -161
- package/fesm2015/animations.mjs.map +1 -1
- package/fesm2015/browser/testing.mjs +5 -5
- package/fesm2015/browser/testing.mjs.map +1 -1
- package/fesm2015/browser.mjs +93 -111
- package/fesm2015/browser.mjs.map +1 -1
- package/fesm2020/animations.mjs +162 -161
- package/fesm2020/animations.mjs.map +1 -1
- package/fesm2020/browser/testing.mjs +5 -5
- package/fesm2020/browser/testing.mjs.map +1 -1
- package/fesm2020/browser.mjs +90 -111
- package/fesm2020/browser.mjs.map +1 -1
- package/package.json +2 -2
package/fesm2015/browser.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v13.1.
|
|
3
|
-
* (c) 2010-
|
|
2
|
+
* @license Angular v13.1.2
|
|
3
|
+
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -126,7 +126,6 @@ function parseTimelineCommand(command) {
|
|
|
126
126
|
return [id, action];
|
|
127
127
|
}
|
|
128
128
|
let _contains = (elm1, elm2) => false;
|
|
129
|
-
let _matches = (element, selector) => false;
|
|
130
129
|
let _query = (element, selector, multi) => {
|
|
131
130
|
return [];
|
|
132
131
|
};
|
|
@@ -148,22 +147,6 @@ if (_isNode || typeof Element !== 'undefined') {
|
|
|
148
147
|
return false;
|
|
149
148
|
};
|
|
150
149
|
}
|
|
151
|
-
_matches = (() => {
|
|
152
|
-
if (_isNode || Element.prototype.matches) {
|
|
153
|
-
return (element, selector) => element.matches(selector);
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
const proto = Element.prototype;
|
|
157
|
-
const fn = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector ||
|
|
158
|
-
proto.oMatchesSelector || proto.webkitMatchesSelector;
|
|
159
|
-
if (fn) {
|
|
160
|
-
return (element, selector) => fn.apply(element, [selector]);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
return _matches;
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
})();
|
|
167
150
|
_query = (element, selector, multi) => {
|
|
168
151
|
let results = [];
|
|
169
152
|
if (multi) {
|
|
@@ -216,7 +199,6 @@ function getBodyNode() {
|
|
|
216
199
|
}
|
|
217
200
|
return null;
|
|
218
201
|
}
|
|
219
|
-
const matchesElement = _matches;
|
|
220
202
|
const containsElement = _contains;
|
|
221
203
|
const invokeQuery = _query;
|
|
222
204
|
function hypenatePropsObject(object) {
|
|
@@ -242,8 +224,9 @@ class NoopAnimationDriver {
|
|
|
242
224
|
validateStyleProperty(prop) {
|
|
243
225
|
return validateStyleProperty(prop);
|
|
244
226
|
}
|
|
245
|
-
matchesElement(
|
|
246
|
-
return
|
|
227
|
+
matchesElement(_element, _selector) {
|
|
228
|
+
// This method is deprecated and no longer in use so we return false.
|
|
229
|
+
return false;
|
|
247
230
|
}
|
|
248
231
|
containsElement(elm1, elm2) {
|
|
249
232
|
return containsElement(elm1, elm2);
|
|
@@ -258,9 +241,9 @@ class NoopAnimationDriver {
|
|
|
258
241
|
return new NoopAnimationPlayer(duration, delay);
|
|
259
242
|
}
|
|
260
243
|
}
|
|
261
|
-
NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.
|
|
262
|
-
NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.
|
|
263
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.
|
|
244
|
+
NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
245
|
+
NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NoopAnimationDriver });
|
|
246
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.2", ngImport: i0, type: NoopAnimationDriver, decorators: [{
|
|
264
247
|
type: Injectable
|
|
265
248
|
}] });
|
|
266
249
|
/**
|
|
@@ -282,8 +265,6 @@ const SUBSTITUTION_EXPR_START = '{{';
|
|
|
282
265
|
const SUBSTITUTION_EXPR_END = '}}';
|
|
283
266
|
const ENTER_CLASSNAME = 'ng-enter';
|
|
284
267
|
const LEAVE_CLASSNAME = 'ng-leave';
|
|
285
|
-
const ENTER_SELECTOR = '.ng-enter';
|
|
286
|
-
const LEAVE_SELECTOR = '.ng-leave';
|
|
287
268
|
const NG_TRIGGER_CLASSNAME = 'ng-trigger';
|
|
288
269
|
const NG_TRIGGER_SELECTOR = '.ng-trigger';
|
|
289
270
|
const NG_ANIMATING_CLASSNAME = 'ng-animating';
|
|
@@ -1054,7 +1035,8 @@ function normalizeSelector(selector) {
|
|
|
1054
1035
|
if (hasAmpersand) {
|
|
1055
1036
|
selector = selector.replace(SELF_TOKEN_REGEX, '');
|
|
1056
1037
|
}
|
|
1057
|
-
// the :enter and :leave
|
|
1038
|
+
// Note: the :enter and :leave aren't normalized here since those
|
|
1039
|
+
// selectors are filled in at runtime during timeline building
|
|
1058
1040
|
selector = selector.replace(/@\*/g, NG_TRIGGER_SELECTOR)
|
|
1059
1041
|
.replace(/@\w+/g, match => NG_TRIGGER_SELECTOR + '-' + match.substr(1))
|
|
1060
1042
|
.replace(/:animating/g, NG_ANIMATING_SELECTOR);
|
|
@@ -1155,15 +1137,8 @@ class ElementInstructionMap {
|
|
|
1155
1137
|
constructor() {
|
|
1156
1138
|
this._map = new Map();
|
|
1157
1139
|
}
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
if (instructions) {
|
|
1161
|
-
this._map.delete(element);
|
|
1162
|
-
}
|
|
1163
|
-
else {
|
|
1164
|
-
instructions = [];
|
|
1165
|
-
}
|
|
1166
|
-
return instructions;
|
|
1140
|
+
get(element) {
|
|
1141
|
+
return this._map.get(element) || [];
|
|
1167
1142
|
}
|
|
1168
1143
|
append(element, instructions) {
|
|
1169
1144
|
let existingInstructions = this._map.get(element);
|
|
@@ -1229,14 +1204,14 @@ const LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');
|
|
|
1229
1204
|
* [TimelineBuilder]
|
|
1230
1205
|
* This class is responsible for tracking the styles and building a series of keyframe objects for a
|
|
1231
1206
|
* timeline between a start and end time. The builder starts off with an initial timeline and each
|
|
1232
|
-
* time the AST comes across a `group()`, `keyframes()` or a combination of the two
|
|
1207
|
+
* time the AST comes across a `group()`, `keyframes()` or a combination of the two within a
|
|
1233
1208
|
* `sequence()` then it will generate a sub timeline for each step as well as a new one after
|
|
1234
1209
|
* they are complete.
|
|
1235
1210
|
*
|
|
1236
1211
|
* As the AST is traversed, the timing state on each of the timelines will be incremented. If a sub
|
|
1237
1212
|
* timeline was created (based on one of the cases above) then the parent timeline will attempt to
|
|
1238
1213
|
* merge the styles used within the sub timelines into itself (only with group() this will happen).
|
|
1239
|
-
* This happens with a merge operation (much like how the merge works in
|
|
1214
|
+
* This happens with a merge operation (much like how the merge works in mergeSort) and it will only
|
|
1240
1215
|
* copy the most recently used styles from the sub timelines into the parent timeline. This ensures
|
|
1241
1216
|
* that if the styles are used later on in another phase of the animation then they will be the most
|
|
1242
1217
|
* up-to-date values.
|
|
@@ -1261,7 +1236,7 @@ const LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');
|
|
|
1261
1236
|
* from all previous keyframes up until where it is first used. For the timeline keyframe generation
|
|
1262
1237
|
* to properly fill in the style it will place the previous value (the value from the parent
|
|
1263
1238
|
* timeline) or a default value of `*` into the backFill object. Given that each of the keyframe
|
|
1264
|
-
* styles
|
|
1239
|
+
* styles is an object that prototypically inherits from the backFill object, this means that if a
|
|
1265
1240
|
* value is added into the backFill then it will automatically propagate any missing values to all
|
|
1266
1241
|
* keyframes. Therefore the missing `height` value will be properly filled into the already
|
|
1267
1242
|
* processed keyframes.
|
|
@@ -1307,7 +1282,7 @@ class AnimationTimelineBuilderVisitor {
|
|
|
1307
1282
|
// these values are not visited in this AST
|
|
1308
1283
|
}
|
|
1309
1284
|
visitAnimateChild(ast, context) {
|
|
1310
|
-
const elementInstructions = context.subInstructions.
|
|
1285
|
+
const elementInstructions = context.subInstructions.get(context.element);
|
|
1311
1286
|
if (elementInstructions) {
|
|
1312
1287
|
const innerContext = context.createSubContext(ast.options);
|
|
1313
1288
|
const startTime = context.currentTimeline.currentTime;
|
|
@@ -1366,7 +1341,7 @@ class AnimationTimelineBuilderVisitor {
|
|
|
1366
1341
|
}
|
|
1367
1342
|
if (ast.steps.length) {
|
|
1368
1343
|
ast.steps.forEach(s => visitDslNode(this, s, ctx));
|
|
1369
|
-
// this is here just
|
|
1344
|
+
// this is here just in case the inner steps only contain or end with a style() call
|
|
1370
1345
|
ctx.currentTimeline.applyStylesToKeyframe();
|
|
1371
1346
|
// this means that some animation function within the sequence
|
|
1372
1347
|
// ended up creating a sub timeline (which means the current
|
|
@@ -1642,7 +1617,7 @@ class AnimationTimelineContext {
|
|
|
1642
1617
|
if (includeSelf) {
|
|
1643
1618
|
results.push(this.element);
|
|
1644
1619
|
}
|
|
1645
|
-
if (selector.length > 0) { // if :self is
|
|
1620
|
+
if (selector.length > 0) { // only if :self is used then the selector can be empty
|
|
1646
1621
|
selector = selector.replace(ENTER_TOKEN_REGEX, '.' + this._enterClassName);
|
|
1647
1622
|
selector = selector.replace(LEAVE_TOKEN_REGEX, '.' + this._leaveClassName);
|
|
1648
1623
|
const multi = limit != 1;
|
|
@@ -1887,7 +1862,7 @@ class SubTimelineBuilder extends TimelineBuilder {
|
|
|
1887
1862
|
When the keyframe is stretched then it means that the delay before the animation
|
|
1888
1863
|
starts is gone. Instead the first keyframe is placed at the start of the animation
|
|
1889
1864
|
and it is then copied to where it starts when the original delay is over. This basically
|
|
1890
|
-
means nothing animates during that delay, but the styles are still
|
|
1865
|
+
means nothing animates during that delay, but the styles are still rendered. For this
|
|
1891
1866
|
to work the original offset values that exist in the original keyframes must be "warped"
|
|
1892
1867
|
so that they can take the new keyframe + delay into account.
|
|
1893
1868
|
|
|
@@ -2491,7 +2466,7 @@ class AnimationTransitionNamespace {
|
|
|
2491
2466
|
// only remove the player if it is queued on the EXACT same trigger/namespace
|
|
2492
2467
|
// we only also deal with queued players here because if the animation has
|
|
2493
2468
|
// started then we want to keep the player alive until the flush happens
|
|
2494
|
-
// (which is where the previousPlayers are passed into the new
|
|
2469
|
+
// (which is where the previousPlayers are passed into the new player)
|
|
2495
2470
|
if (player.namespaceId == this.id && player.triggerName == triggerName && player.queued) {
|
|
2496
2471
|
player.destroy();
|
|
2497
2472
|
}
|
|
@@ -2573,9 +2548,11 @@ class AnimationTransitionNamespace {
|
|
|
2573
2548
|
}
|
|
2574
2549
|
triggerLeaveAnimation(element, context, destroyAfterComplete, defaultToFallback) {
|
|
2575
2550
|
const triggerStates = this._engine.statesByElement.get(element);
|
|
2551
|
+
const previousTriggersValues = new Map();
|
|
2576
2552
|
if (triggerStates) {
|
|
2577
2553
|
const players = [];
|
|
2578
2554
|
Object.keys(triggerStates).forEach(triggerName => {
|
|
2555
|
+
previousTriggersValues.set(triggerName, triggerStates[triggerName].value);
|
|
2579
2556
|
// this check is here in the event that an element is removed
|
|
2580
2557
|
// twice (both on the host level and the component level)
|
|
2581
2558
|
if (this._triggers[triggerName]) {
|
|
@@ -2586,7 +2563,7 @@ class AnimationTransitionNamespace {
|
|
|
2586
2563
|
}
|
|
2587
2564
|
});
|
|
2588
2565
|
if (players.length) {
|
|
2589
|
-
this._engine.markElementAsRemoved(this.id, element, true, context);
|
|
2566
|
+
this._engine.markElementAsRemoved(this.id, element, true, context, previousTriggersValues);
|
|
2590
2567
|
if (destroyAfterComplete) {
|
|
2591
2568
|
optimizeGroupPlayer(players).onDone(() => this._engine.processLeaveNode(element));
|
|
2592
2569
|
}
|
|
@@ -2781,7 +2758,7 @@ class TransitionAnimationEngine {
|
|
|
2781
2758
|
// been inserted so that we know exactly where to place it in
|
|
2782
2759
|
// the namespace list
|
|
2783
2760
|
this.newHostElements.set(hostElement, ns);
|
|
2784
|
-
// given that this host element is
|
|
2761
|
+
// given that this host element is a part of the animation code, it
|
|
2785
2762
|
// may or may not be inserted by a parent node that is of an
|
|
2786
2763
|
// animation renderer type. If this happens then we can still have
|
|
2787
2764
|
// access to this item when we query for :enter nodes. If the parent
|
|
@@ -2846,8 +2823,8 @@ class TransitionAnimationEngine {
|
|
|
2846
2823
|
// normally there should only be one namespace per element, however
|
|
2847
2824
|
// if @triggers are placed on both the component element and then
|
|
2848
2825
|
// its host element (within the component code) then there will be
|
|
2849
|
-
// two namespaces returned. We use a set here to simply
|
|
2850
|
-
//
|
|
2826
|
+
// two namespaces returned. We use a set here to simply deduplicate
|
|
2827
|
+
// the namespaces in case (for the reason described above) there are multiple triggers
|
|
2851
2828
|
const namespaces = new Set();
|
|
2852
2829
|
const elementStates = this.statesByElement.get(element);
|
|
2853
2830
|
if (elementStates) {
|
|
@@ -2943,10 +2920,15 @@ class TransitionAnimationEngine {
|
|
|
2943
2920
|
this._onRemovalComplete(element, context);
|
|
2944
2921
|
}
|
|
2945
2922
|
}
|
|
2946
|
-
markElementAsRemoved(namespaceId, element, hasAnimation, context) {
|
|
2923
|
+
markElementAsRemoved(namespaceId, element, hasAnimation, context, previousTriggersValues) {
|
|
2947
2924
|
this.collectedLeaveElements.push(element);
|
|
2948
|
-
element[REMOVAL_FLAG] =
|
|
2949
|
-
|
|
2925
|
+
element[REMOVAL_FLAG] = {
|
|
2926
|
+
namespaceId,
|
|
2927
|
+
setForRemoval: context,
|
|
2928
|
+
hasAnimation,
|
|
2929
|
+
removedBeforeQueried: false,
|
|
2930
|
+
previousTriggersValues
|
|
2931
|
+
};
|
|
2950
2932
|
}
|
|
2951
2933
|
listen(namespaceId, element, name, phase, callback) {
|
|
2952
2934
|
if (isElementNode(element)) {
|
|
@@ -2998,6 +2980,7 @@ class TransitionAnimationEngine {
|
|
|
2998
2980
|
});
|
|
2999
2981
|
}
|
|
3000
2982
|
processLeaveNode(element) {
|
|
2983
|
+
var _a;
|
|
3001
2984
|
const details = element[REMOVAL_FLAG];
|
|
3002
2985
|
if (details && details.setForRemoval) {
|
|
3003
2986
|
// this will prevent it from removing it twice
|
|
@@ -3011,7 +2994,7 @@ class TransitionAnimationEngine {
|
|
|
3011
2994
|
}
|
|
3012
2995
|
this._onRemovalComplete(element, details.setForRemoval);
|
|
3013
2996
|
}
|
|
3014
|
-
if (
|
|
2997
|
+
if ((_a = element.classList) === null || _a === void 0 ? void 0 : _a.contains(DISABLED_CLASSNAME)) {
|
|
3015
2998
|
this.markElementAsDisabled(element, false);
|
|
3016
2999
|
}
|
|
3017
3000
|
this.driver.query(element, DISABLED_SELECTOR, true).forEach(node => {
|
|
@@ -3148,8 +3131,19 @@ class TransitionAnimationEngine {
|
|
|
3148
3131
|
allPlayers.push(player);
|
|
3149
3132
|
if (this.collectedEnterElements.length) {
|
|
3150
3133
|
const details = element[REMOVAL_FLAG];
|
|
3151
|
-
// move
|
|
3134
|
+
// animations for move operations (elements being removed and reinserted,
|
|
3135
|
+
// e.g. when the order of an *ngFor list changes) are currently not supported
|
|
3152
3136
|
if (details && details.setForMove) {
|
|
3137
|
+
if (details.previousTriggersValues &&
|
|
3138
|
+
details.previousTriggersValues.has(entry.triggerName)) {
|
|
3139
|
+
const previousValue = details.previousTriggersValues.get(entry.triggerName);
|
|
3140
|
+
// we need to restore the previous trigger value since the element has
|
|
3141
|
+
// only been moved and hasn't actually left the DOM
|
|
3142
|
+
const triggersWithStates = this.statesByElement.get(entry.element);
|
|
3143
|
+
if (triggersWithStates && triggersWithStates[entry.triggerName]) {
|
|
3144
|
+
triggersWithStates[entry.triggerName].value = previousValue;
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3153
3147
|
player.destroy();
|
|
3154
3148
|
return;
|
|
3155
3149
|
}
|
|
@@ -3162,30 +3156,38 @@ class TransitionAnimationEngine {
|
|
|
3162
3156
|
erroneousTransitions.push(instruction);
|
|
3163
3157
|
return;
|
|
3164
3158
|
}
|
|
3165
|
-
// even though the element may not be
|
|
3166
|
-
//
|
|
3159
|
+
// even though the element may not be in the DOM, it may still
|
|
3160
|
+
// be added at a later point (due to the mechanics of content
|
|
3167
3161
|
// projection and/or dynamic component insertion) therefore it's
|
|
3168
|
-
// important
|
|
3162
|
+
// important to still style the element.
|
|
3169
3163
|
if (nodeIsOrphaned) {
|
|
3170
3164
|
player.onStart(() => eraseStyles(element, instruction.fromStyles));
|
|
3171
3165
|
player.onDestroy(() => setStyles(element, instruction.toStyles));
|
|
3172
3166
|
skippedPlayers.push(player);
|
|
3173
3167
|
return;
|
|
3174
3168
|
}
|
|
3175
|
-
// if
|
|
3176
|
-
// an animation and cancel the
|
|
3169
|
+
// if an unmatched transition is queued and ready to go
|
|
3170
|
+
// then it SHOULD NOT render an animation and cancel the
|
|
3171
|
+
// previously running animations.
|
|
3177
3172
|
if (entry.isFallbackTransition) {
|
|
3178
3173
|
player.onStart(() => eraseStyles(element, instruction.fromStyles));
|
|
3179
3174
|
player.onDestroy(() => setStyles(element, instruction.toStyles));
|
|
3180
3175
|
skippedPlayers.push(player);
|
|
3181
3176
|
return;
|
|
3182
3177
|
}
|
|
3183
|
-
// this means that if a parent animation uses this animation as a sub
|
|
3184
|
-
// then it will instruct the timeline builder to
|
|
3185
|
-
// instead stretch the first keyframe gap
|
|
3186
|
-
//
|
|
3187
|
-
// required by the user
|
|
3188
|
-
|
|
3178
|
+
// this means that if a parent animation uses this animation as a sub-trigger
|
|
3179
|
+
// then it will instruct the timeline builder not to add a player delay, but
|
|
3180
|
+
// instead stretch the first keyframe gap until the animation starts. This is
|
|
3181
|
+
// important in order to prevent extra initialization styles from being
|
|
3182
|
+
// required by the user for the animation.
|
|
3183
|
+
const timelines = [];
|
|
3184
|
+
instruction.timelines.forEach(tl => {
|
|
3185
|
+
tl.stretchStartingKeyframe = true;
|
|
3186
|
+
if (!this.disabledNodes.has(tl.element)) {
|
|
3187
|
+
timelines.push(tl);
|
|
3188
|
+
}
|
|
3189
|
+
});
|
|
3190
|
+
instruction.timelines = timelines;
|
|
3189
3191
|
subTimelines.append(element, instruction.timelines);
|
|
3190
3192
|
const tuple = { instruction, player, element };
|
|
3191
3193
|
queuedInstructions.push(tuple);
|
|
@@ -3220,10 +3222,10 @@ class TransitionAnimationEngine {
|
|
|
3220
3222
|
this.reportError(errors);
|
|
3221
3223
|
}
|
|
3222
3224
|
const allPreviousPlayersMap = new Map();
|
|
3223
|
-
// this map
|
|
3224
|
-
// which animation. Further down
|
|
3225
|
-
// the players are built and in doing so
|
|
3226
|
-
// if a sub player is skipped due to a parent player having priority.
|
|
3225
|
+
// this map tells us which element in the DOM tree is contained by
|
|
3226
|
+
// which animation. Further down this map will get populated once
|
|
3227
|
+
// the players are built and in doing so we can use it to efficiently
|
|
3228
|
+
// figure out if a sub player is skipped due to a parent player having priority.
|
|
3227
3229
|
const animationElementMap = new Map();
|
|
3228
3230
|
queuedInstructions.forEach(entry => {
|
|
3229
3231
|
const element = entry.element;
|
|
@@ -3240,13 +3242,13 @@ class TransitionAnimationEngine {
|
|
|
3240
3242
|
prevPlayer.destroy();
|
|
3241
3243
|
});
|
|
3242
3244
|
});
|
|
3243
|
-
// this is a special case for nodes that will be removed
|
|
3245
|
+
// this is a special case for nodes that will be removed either by
|
|
3244
3246
|
// having their own leave animations or by being queried in a container
|
|
3245
3247
|
// that will be removed once a parent animation is complete. The idea
|
|
3246
3248
|
// here is that * styles must be identical to ! styles because of
|
|
3247
3249
|
// backwards compatibility (* is also filled in by default in many places).
|
|
3248
|
-
// Otherwise * styles will return an empty value or auto since the element
|
|
3249
|
-
//
|
|
3250
|
+
// Otherwise * styles will return an empty value or "auto" since the element
|
|
3251
|
+
// passed to getComputedStyle will not be visible (since * === destination)
|
|
3250
3252
|
const replaceNodes = allLeaveNodes.filter(node => {
|
|
3251
3253
|
return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements);
|
|
3252
3254
|
});
|
|
@@ -3328,9 +3330,9 @@ class TransitionAnimationEngine {
|
|
|
3328
3330
|
}
|
|
3329
3331
|
}
|
|
3330
3332
|
});
|
|
3331
|
-
// find all of the sub players' corresponding inner animation
|
|
3333
|
+
// find all of the sub players' corresponding inner animation players
|
|
3332
3334
|
subPlayers.forEach(player => {
|
|
3333
|
-
// even if
|
|
3335
|
+
// even if no players are found for a sub animation it
|
|
3334
3336
|
// will still complete itself after the next tick since it's Noop
|
|
3335
3337
|
const playersForElement = skippedPlayersMap.get(player.element);
|
|
3336
3338
|
if (playersForElement && playersForElement.length) {
|
|
@@ -3758,38 +3760,13 @@ function buildRootMap(roots, nodes) {
|
|
|
3758
3760
|
});
|
|
3759
3761
|
return rootMap;
|
|
3760
3762
|
}
|
|
3761
|
-
const CLASSES_CACHE_KEY = '$$classes';
|
|
3762
|
-
function containsClass(element, className) {
|
|
3763
|
-
if (element.classList) {
|
|
3764
|
-
return element.classList.contains(className);
|
|
3765
|
-
}
|
|
3766
|
-
else {
|
|
3767
|
-
const classes = element[CLASSES_CACHE_KEY];
|
|
3768
|
-
return classes && classes[className];
|
|
3769
|
-
}
|
|
3770
|
-
}
|
|
3771
3763
|
function addClass(element, className) {
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
}
|
|
3775
|
-
else {
|
|
3776
|
-
let classes = element[CLASSES_CACHE_KEY];
|
|
3777
|
-
if (!classes) {
|
|
3778
|
-
classes = element[CLASSES_CACHE_KEY] = {};
|
|
3779
|
-
}
|
|
3780
|
-
classes[className] = true;
|
|
3781
|
-
}
|
|
3764
|
+
var _a;
|
|
3765
|
+
(_a = element.classList) === null || _a === void 0 ? void 0 : _a.add(className);
|
|
3782
3766
|
}
|
|
3783
3767
|
function removeClass(element, className) {
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
}
|
|
3787
|
-
else {
|
|
3788
|
-
let classes = element[CLASSES_CACHE_KEY];
|
|
3789
|
-
if (classes) {
|
|
3790
|
-
delete classes[className];
|
|
3791
|
-
}
|
|
3792
|
-
}
|
|
3768
|
+
var _a;
|
|
3769
|
+
(_a = element.classList) === null || _a === void 0 ? void 0 : _a.remove(className);
|
|
3793
3770
|
}
|
|
3794
3771
|
function removeNodesAfterAnimationDone(engine, element, players) {
|
|
3795
3772
|
optimizeGroupPlayer(players).onDone(() => engine.processLeaveNode(element));
|
|
@@ -4340,8 +4317,9 @@ class CssKeyframesDriver {
|
|
|
4340
4317
|
validateStyleProperty(prop) {
|
|
4341
4318
|
return validateStyleProperty(prop);
|
|
4342
4319
|
}
|
|
4343
|
-
matchesElement(
|
|
4344
|
-
return
|
|
4320
|
+
matchesElement(_element, _selector) {
|
|
4321
|
+
// This method is deprecated and no longer in use so we return false.
|
|
4322
|
+
return false;
|
|
4345
4323
|
}
|
|
4346
4324
|
containsElement(elm1, elm2) {
|
|
4347
4325
|
return containsElement(elm1, elm2);
|
|
@@ -4581,10 +4559,13 @@ class WebAnimationsPlayer {
|
|
|
4581
4559
|
beforeDestroy() {
|
|
4582
4560
|
const styles = {};
|
|
4583
4561
|
if (this.hasStarted()) {
|
|
4584
|
-
|
|
4562
|
+
// note: this code is invoked only when the `play` function was called prior to this
|
|
4563
|
+
// (thus `hasStarted` returns true), this implies that the code that initializes
|
|
4564
|
+
// `_finalKeyframe` has also been executed and the non-null assertion can be safely used here
|
|
4565
|
+
const finalKeyframe = this._finalKeyframe;
|
|
4566
|
+
Object.keys(finalKeyframe).forEach(prop => {
|
|
4585
4567
|
if (prop != 'offset') {
|
|
4586
|
-
styles[prop] =
|
|
4587
|
-
this._finished ? this._finalKeyframe[prop] : computeStyle(this.element, prop);
|
|
4568
|
+
styles[prop] = this._finished ? finalKeyframe[prop] : computeStyle(this.element, prop);
|
|
4588
4569
|
}
|
|
4589
4570
|
});
|
|
4590
4571
|
}
|
|
@@ -4606,8 +4587,9 @@ class WebAnimationsDriver {
|
|
|
4606
4587
|
validateStyleProperty(prop) {
|
|
4607
4588
|
return validateStyleProperty(prop);
|
|
4608
4589
|
}
|
|
4609
|
-
matchesElement(
|
|
4610
|
-
return
|
|
4590
|
+
matchesElement(_element, _selector) {
|
|
4591
|
+
// This method is deprecated and no longer in use so we return false.
|
|
4592
|
+
return false;
|
|
4611
4593
|
}
|
|
4612
4594
|
containsElement(elm1, elm2) {
|
|
4613
4595
|
return containsElement(elm1, elm2);
|
|
@@ -4690,5 +4672,5 @@ function getElementAnimateFn() {
|
|
|
4690
4672
|
* Generated bundle index. Do not edit.
|
|
4691
4673
|
*/
|
|
4692
4674
|
|
|
4693
|
-
export { AnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, CssKeyframesDriver as ɵCssKeyframesDriver, CssKeyframesPlayer as ɵCssKeyframesPlayer, NoopAnimationDriver as ɵNoopAnimationDriver, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, containsElement as ɵcontainsElement, invokeQuery as ɵinvokeQuery,
|
|
4675
|
+
export { AnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, CssKeyframesDriver as ɵCssKeyframesDriver, CssKeyframesPlayer as ɵCssKeyframesPlayer, NoopAnimationDriver as ɵNoopAnimationDriver, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, containsElement as ɵcontainsElement, invokeQuery as ɵinvokeQuery, supportsWebAnimations as ɵsupportsWebAnimations, validateStyleProperty as ɵvalidateStyleProperty };
|
|
4694
4676
|
//# sourceMappingURL=browser.mjs.map
|