@angular/animations 14.1.0-next.3 → 14.1.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.0-next.3
2
+ * @license Angular v14.1.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.0-next.3
2
+ * @license Angular v14.1.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.0-next.3
2
+ * @license Angular v14.1.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -578,9 +578,9 @@ class NoopAnimationDriver {
578
578
  return new NoopAnimationPlayer(duration, delay);
579
579
  }
580
580
  }
581
- NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0-next.3", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
582
- NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0-next.3", ngImport: i0, type: NoopAnimationDriver });
583
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0-next.3", ngImport: i0, type: NoopAnimationDriver, decorators: [{
581
+ NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
582
+ NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: NoopAnimationDriver });
583
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.0", ngImport: i0, type: NoopAnimationDriver, decorators: [{
584
584
  type: Injectable
585
585
  }] });
586
586
  /**
@@ -920,11 +920,6 @@ function pushUnrecognizedPropertiesWarning(warnings, props) {
920
920
  warnings.push(`The following provided properties are not recognized: ${props.join(', ')}`);
921
921
  }
922
922
  }
923
- function pushNonAnimatablePropertiesWarning(warnings, props) {
924
- if (props.length) {
925
- warnings.push(`The following provided properties are not animatable: ${props.join(', ')}\n (see: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)`);
926
- }
927
- }
928
923
 
929
924
  /**
930
925
  * @license
@@ -1065,9 +1060,6 @@ class AnimationAstBuilderVisitor {
1065
1060
  if (context.unsupportedCSSPropertiesFound.size) {
1066
1061
  pushUnrecognizedPropertiesWarning(warnings, [...context.unsupportedCSSPropertiesFound.keys()]);
1067
1062
  }
1068
- if (context.nonAnimatableCSSPropertiesFound.size) {
1069
- pushNonAnimatablePropertiesWarning(warnings, [...context.nonAnimatableCSSPropertiesFound.keys()]);
1070
- }
1071
1063
  }
1072
1064
  return ast;
1073
1065
  }
@@ -1279,14 +1271,6 @@ class AnimationAstBuilderVisitor {
1279
1271
  context.unsupportedCSSPropertiesFound.add(prop);
1280
1272
  return;
1281
1273
  }
1282
- if (this._driver.validateAnimatableStyleProperty) {
1283
- if (!this._driver.validateAnimatableStyleProperty(prop)) {
1284
- context.nonAnimatableCSSPropertiesFound.add(prop);
1285
- // note: non animatable properties are not removed for the tuple just in case they are
1286
- // categorized as non animatable but can actually be animated
1287
- return;
1288
- }
1289
- }
1290
1274
  }
1291
1275
  // This is guaranteed to have a defined Map at this querySelector location making it
1292
1276
  // safe to add the assertion here. It is set as a default empty map in prior methods.
@@ -1455,7 +1439,6 @@ class AnimationAstBuilderContext {
1455
1439
  this.collectedStyles = new Map();
1456
1440
  this.options = null;
1457
1441
  this.unsupportedCSSPropertiesFound = new Set();
1458
- this.nonAnimatableCSSPropertiesFound = new Set();
1459
1442
  }
1460
1443
  }
1461
1444
  function consumeOffset(styles) {
@@ -2152,7 +2135,7 @@ class TimelineBuilder {
2152
2135
  const val = interpolateParams(value, params, errors);
2153
2136
  this._pendingStyles.set(prop, val);
2154
2137
  if (!this._localTimelineStyles.has(prop)) {
2155
- this._backFill.set(prop, this._globalTimelineStyles.get(prop) || AUTO_STYLE);
2138
+ this._backFill.set(prop, this._globalTimelineStyles.get(prop) ?? AUTO_STYLE);
2156
2139
  }
2157
2140
  this._updateStyle(prop, val);
2158
2141
  }
@@ -2498,10 +2481,56 @@ class AnimationTransitionFactory {
2498
2481
  queriedElements.add(elm);
2499
2482
  }
2500
2483
  });
2484
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
2485
+ checkNonAnimatableInTimelines(timelines, this._triggerName, driver);
2486
+ }
2501
2487
  const queriedElementsList = iteratorToArray(queriedElements.values());
2502
2488
  return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, timelines, queriedElementsList, preStyleMap, postStyleMap, totalTime);
2503
2489
  }
2504
2490
  }
2491
+ /**
2492
+ * Checks inside a set of timelines if they try to animate a css property which is not considered
2493
+ * animatable, in that case it prints a warning on the console.
2494
+ * Besides that the function doesn't have any other effect.
2495
+ *
2496
+ * Note: this check is done here after the timelines are built instead of doing on a lower level so
2497
+ * that we can make sure that the warning appears only once per instruction (we can aggregate here
2498
+ * all the issues instead of finding them separately).
2499
+ *
2500
+ * @param timelines The built timelines for the current instruction.
2501
+ * @param triggerName The name of the trigger for the current instruction.
2502
+ * @param driver Animation driver used to perform the check.
2503
+ *
2504
+ */
2505
+ function checkNonAnimatableInTimelines(timelines, triggerName, driver) {
2506
+ if (!driver.validateAnimatableStyleProperty) {
2507
+ return;
2508
+ }
2509
+ const invalidNonAnimatableProps = new Set();
2510
+ timelines.forEach(({ keyframes }) => {
2511
+ const nonAnimatablePropsInitialValues = new Map();
2512
+ keyframes.forEach(keyframe => {
2513
+ for (const [prop, value] of keyframe.entries()) {
2514
+ if (!driver.validateAnimatableStyleProperty(prop)) {
2515
+ if (nonAnimatablePropsInitialValues.has(prop) && !invalidNonAnimatableProps.has(prop)) {
2516
+ const propInitialValue = nonAnimatablePropsInitialValues.get(prop);
2517
+ if (propInitialValue !== value) {
2518
+ invalidNonAnimatableProps.add(prop);
2519
+ }
2520
+ }
2521
+ else {
2522
+ nonAnimatablePropsInitialValues.set(prop, value);
2523
+ }
2524
+ }
2525
+ }
2526
+ });
2527
+ });
2528
+ if (invalidNonAnimatableProps.size > 0) {
2529
+ console.warn(`Warning: The animation trigger "${triggerName}" is attempting to animate the following` +
2530
+ ' not animatable properties: ' + Array.from(invalidNonAnimatableProps).join(', ') + '\n' +
2531
+ '(to check the list of all animatable properties visit https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)');
2532
+ }
2533
+ }
2505
2534
  function oneOrMoreTransitionsMatch(matchFns, currentState, nextState, element, params) {
2506
2535
  return matchFns.some(fn => fn(currentState, nextState, element, params));
2507
2536
  }
@@ -2968,13 +2997,10 @@ class AnimationTransitionNamespace {
2968
2997
  }
2969
2998
  _signalRemovalForInnerTriggers(rootElement, context) {
2970
2999
  const elements = this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true);
2971
- const shadowElements = rootElement.shadowRoot ?
2972
- this._engine.driver.query(rootElement.shadowRoot, NG_TRIGGER_SELECTOR, true) :
2973
- [];
2974
3000
  // emulate a leave animation for all inner nodes within this node.
2975
3001
  // If there are no animations found for any of the nodes then clear the cache
2976
3002
  // for the element.
2977
- [...elements, ...shadowElements].forEach(elm => {
3003
+ elements.forEach(elm => {
2978
3004
  // this means that an inner remove() operation has already kicked off
2979
3005
  // the animation on this element...
2980
3006
  if (elm[REMOVAL_FLAG])
@@ -3049,9 +3075,7 @@ class AnimationTransitionNamespace {
3049
3075
  }
3050
3076
  removeNode(element, context) {
3051
3077
  const engine = this._engine;
3052
- const elementHasChildren = !!element.childElementCount;
3053
- const elementHasShadowChildren = !!(element.shadowRoot && element.shadowRoot.childElementCount);
3054
- if (elementHasChildren || elementHasShadowChildren) {
3078
+ if (element.childElementCount) {
3055
3079
  this._signalRemovalForInnerTriggers(element, context);
3056
3080
  }
3057
3081
  // this means that a * => VOID animation was detected and kicked off