@angular/core 20.3.10 → 20.3.12

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.
Files changed (64) hide show
  1. package/README.md +1 -2
  2. package/api.d.d.ts +1 -1
  3. package/chrome_dev_tools_performance.d.d.ts +1 -1
  4. package/discovery.d.d.ts +3 -3
  5. package/effect.d.d.ts +1 -1
  6. package/event_dispatcher.d.d.ts +1 -1
  7. package/fesm2022/attribute.mjs +1 -1
  8. package/fesm2022/core.mjs +1 -1
  9. package/fesm2022/core.mjs.map +1 -1
  10. package/fesm2022/debug_node.mjs +52 -17
  11. package/fesm2022/debug_node.mjs.map +1 -1
  12. package/fesm2022/effect.mjs +1 -1
  13. package/fesm2022/effect.mjs.map +1 -1
  14. package/fesm2022/not_found.mjs +1 -1
  15. package/fesm2022/primitives/di.mjs +1 -1
  16. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  17. package/fesm2022/primitives/signals.mjs +1 -1
  18. package/fesm2022/primitives/signals.mjs.map +1 -1
  19. package/fesm2022/resource.mjs +4 -15
  20. package/fesm2022/resource.mjs.map +1 -1
  21. package/fesm2022/root_effect_scheduler.mjs +2 -2
  22. package/fesm2022/root_effect_scheduler.mjs.map +1 -1
  23. package/fesm2022/rxjs-interop.mjs +1 -1
  24. package/fesm2022/signal.mjs +1 -1
  25. package/fesm2022/signal.mjs.map +1 -1
  26. package/fesm2022/testing.mjs +1 -1
  27. package/fesm2022/weak_ref.mjs +1 -1
  28. package/formatter.d.d.ts +2 -2
  29. package/index.d.ts +2 -2
  30. package/package.json +2 -2
  31. package/primitives/di/index.d.ts +1 -1
  32. package/primitives/event-dispatch/index.d.ts +1 -1
  33. package/primitives/signals/index.d.ts +6 -5
  34. package/rxjs-interop/index.d.ts +1 -1
  35. package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +1 -1
  36. package/schematics/bundles/apply_import_manager-D4J7SXHI.cjs +1 -1
  37. package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
  38. package/schematics/bundles/compiler_host-C306_97v.cjs +1 -1
  39. package/schematics/bundles/control-flow-migration.cjs +1 -1
  40. package/schematics/bundles/document-core.cjs +1 -1
  41. package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
  42. package/schematics/bundles/index-AeYmwRJL.cjs +11 -11
  43. package/schematics/bundles/index-u3tqvIQa.cjs +1 -1
  44. package/schematics/bundles/inject-flags.cjs +1 -1
  45. package/schematics/bundles/inject-migration.cjs +1 -1
  46. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  47. package/schematics/bundles/migrate_ts_type_references-D0f8FXVW.cjs +1 -1
  48. package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
  49. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  50. package/schematics/bundles/output-migration.cjs +1 -1
  51. package/schematics/bundles/project_paths-CMd3bdgw.cjs +1 -1
  52. package/schematics/bundles/project_tsconfig_paths-CopGppNj.cjs +2 -2
  53. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  54. package/schematics/bundles/route-lazy-loading.cjs +1 -1
  55. package/schematics/bundles/router-current-navigation.cjs +1 -1
  56. package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
  57. package/schematics/bundles/signal-input-migration.cjs +1 -1
  58. package/schematics/bundles/signal-queries-migration.cjs +1 -1
  59. package/schematics/bundles/signals.cjs +1 -1
  60. package/schematics/bundles/standalone-migration.cjs +1 -1
  61. package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
  62. package/schematics/bundles/test-bed-get.cjs +1 -1
  63. package/testing/index.d.ts +1 -1
  64. package/weak_ref.d.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.3.10
2
+ * @license Angular v20.3.12
3
3
  * (c) 2010-2025 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -8208,18 +8208,35 @@ const ANIMATION_QUEUE = new InjectionToken(typeof ngDevMode !== 'undefined' && n
8208
8208
  };
8209
8209
  },
8210
8210
  });
8211
- function addToAnimationQueue(injector, animationFns) {
8211
+ function addToAnimationQueue(injector, animationFns, animationData) {
8212
8212
  const animationQueue = injector.get(ANIMATION_QUEUE);
8213
8213
  if (Array.isArray(animationFns)) {
8214
8214
  for (const animateFn of animationFns) {
8215
8215
  animationQueue.queue.add(animateFn);
8216
+ // If a node is detached, we need to keep track of the queued animation functions
8217
+ // so we can later remove them from the global animation queue if the view
8218
+ // is re-attached before the animation queue runs.
8219
+ animationData?.detachedLeaveAnimationFns?.push(animateFn);
8216
8220
  }
8217
8221
  }
8218
8222
  else {
8219
8223
  animationQueue.queue.add(animationFns);
8224
+ // If a node is detached, we need to keep track of the queued animation functions
8225
+ // so we can later remove them from the global animation queue if the view
8226
+ // is re-attached before the animation queue runs.
8227
+ animationData?.detachedLeaveAnimationFns?.push(animationFns);
8220
8228
  }
8221
8229
  animationQueue.scheduler && animationQueue.scheduler(injector);
8222
8230
  }
8231
+ function removeFromAnimationQueue(injector, animationData) {
8232
+ const animationQueue = injector.get(ANIMATION_QUEUE);
8233
+ if (animationData.detachedLeaveAnimationFns) {
8234
+ for (const animationFn of animationData.detachedLeaveAnimationFns) {
8235
+ animationQueue.queue.delete(animationFn);
8236
+ }
8237
+ animationData.detachedLeaveAnimationFns = undefined;
8238
+ }
8239
+ }
8223
8240
  function scheduleAnimationQueue(injector) {
8224
8241
  const animationQueue = injector.get(ANIMATION_QUEUE);
8225
8242
  // We only want to schedule the animation queue if it hasn't already been scheduled.
@@ -8483,12 +8500,6 @@ function runLeaveAnimationsWithCallback(lView, tNode, injector, callback) {
8483
8500
  const animations = lView?.[ANIMATIONS];
8484
8501
  if (animations == null || animations.leave == undefined || !animations.leave.has(tNode.index))
8485
8502
  return callback(false);
8486
- // this is solely for move operations to prevent leave animations from running
8487
- // on the moved nodes, which would have deleted the node.
8488
- if (animations.skipLeaveAnimations) {
8489
- animations.skipLeaveAnimations = false;
8490
- return callback(false);
8491
- }
8492
8503
  if (lView)
8493
8504
  allLeavingAnimations.add(lView);
8494
8505
  addToAnimationQueue(injector, () => {
@@ -8505,6 +8516,7 @@ function runLeaveAnimationsWithCallback(lView, tNode, injector, callback) {
8505
8516
  const { promise } = animationFn();
8506
8517
  runningAnimations.push(promise);
8507
8518
  }
8519
+ animations.detachedLeaveAnimationFns = undefined;
8508
8520
  }
8509
8521
  animations.running = Promise.allSettled(runningAnimations);
8510
8522
  runAfterLeaveAnimations(lView, callback);
@@ -8514,7 +8526,7 @@ function runLeaveAnimationsWithCallback(lView, tNode, injector, callback) {
8514
8526
  allLeavingAnimations.delete(lView);
8515
8527
  callback(false);
8516
8528
  }
8517
- });
8529
+ }, animations);
8518
8530
  }
8519
8531
  function runAfterLeaveAnimations(lView, callback) {
8520
8532
  const runningAnimations = lView[ANIMATIONS]?.running;
@@ -14632,7 +14644,7 @@ class ComponentFactory extends ComponentFactory$1 {
14632
14644
  }
14633
14645
  function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
14634
14646
  const tAttributes = rootSelectorOrNode
14635
- ? ['ng-version', '20.3.10']
14647
+ ? ['ng-version', '20.3.12']
14636
14648
  : // Extract attributes and classes from the first selector only to match VE behavior.
14637
14649
  extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
14638
14650
  let creationBindings = null;
@@ -22579,7 +22591,7 @@ class LiveCollection {
22579
22591
  // DOM nodes, which would trigger `animate.leave` bindings. We need to skip
22580
22592
  // those animations in the case of a move operation so the moving elements don't
22581
22593
  // unexpectedly disappear.
22582
- this.attach(newIdx, this.detach(prevIndex, true /* skipLeaveAnimations */));
22594
+ this.attach(newIdx, this.detach(prevIndex));
22583
22595
  }
22584
22596
  }
22585
22597
  function valuesMatching(liveIdx, liveValue, newIdx, newValue, trackBy) {
@@ -23150,11 +23162,11 @@ class LiveCollectionLContainerImpl extends LiveCollection {
23150
23162
  const dehydratedView = lView[HYDRATION];
23151
23163
  this.needsIndexUpdate ||= index !== this.length;
23152
23164
  addLViewToLContainer(this.lContainer, lView, index, shouldAddViewToDom(this.templateTNode, dehydratedView));
23165
+ clearDetachAnimationList(this.lContainer, index);
23153
23166
  }
23154
- detach(index, skipLeaveAnimations) {
23167
+ detach(index) {
23155
23168
  this.needsIndexUpdate ||= index !== this.length - 1;
23156
- if (skipLeaveAnimations)
23157
- setSkipLeaveAnimations(this.lContainer, index);
23169
+ maybeInitDetachAnimationList(this.lContainer, index);
23158
23170
  return detachExistingView(this.lContainer, index);
23159
23171
  }
23160
23172
  create(index, value) {
@@ -23260,13 +23272,36 @@ function getLContainer(lView, index) {
23260
23272
  ngDevMode && assertLContainer(lContainer);
23261
23273
  return lContainer;
23262
23274
  }
23263
- function setSkipLeaveAnimations(lContainer, index) {
23275
+ function clearDetachAnimationList(lContainer, index) {
23264
23276
  if (lContainer.length <= CONTAINER_HEADER_OFFSET)
23265
23277
  return;
23266
23278
  const indexInContainer = CONTAINER_HEADER_OFFSET + index;
23267
23279
  const viewToDetach = lContainer[indexInContainer];
23268
- if (viewToDetach && viewToDetach[ANIMATIONS]) {
23269
- viewToDetach[ANIMATIONS].skipLeaveAnimations = true;
23280
+ const animations = viewToDetach
23281
+ ? viewToDetach[ANIMATIONS]
23282
+ : undefined;
23283
+ if (viewToDetach &&
23284
+ animations &&
23285
+ animations.detachedLeaveAnimationFns &&
23286
+ animations.detachedLeaveAnimationFns.length > 0) {
23287
+ const injector = viewToDetach[INJECTOR];
23288
+ removeFromAnimationQueue(injector, animations);
23289
+ allLeavingAnimations.delete(viewToDetach);
23290
+ animations.detachedLeaveAnimationFns = undefined;
23291
+ }
23292
+ }
23293
+ // Initialize the detach leave animation list for a view about to be detached, but only
23294
+ // if it has leave animations.
23295
+ function maybeInitDetachAnimationList(lContainer, index) {
23296
+ if (lContainer.length <= CONTAINER_HEADER_OFFSET)
23297
+ return;
23298
+ const indexInContainer = CONTAINER_HEADER_OFFSET + index;
23299
+ const viewToDetach = lContainer[indexInContainer];
23300
+ const animations = viewToDetach
23301
+ ? viewToDetach[ANIMATIONS]
23302
+ : undefined;
23303
+ if (animations && animations.leave && animations.leave.size > 0) {
23304
+ animations.detachedLeaveAnimationFns = [];
23270
23305
  }
23271
23306
  }
23272
23307
  function detachExistingView(lContainer, index) {