@angular/core 20.2.1 → 20.2.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.
Files changed (70) hide show
  1. package/api.d.d.ts +1 -1
  2. package/chrome_dev_tools_performance.d.d.ts +1 -1
  3. package/discovery.d.d.ts +7 -8
  4. package/{signal.d.d.ts → effect.d.d.ts} +13 -3
  5. package/event_dispatcher.d.d.ts +1 -1
  6. package/fesm2022/attribute.mjs +1 -1
  7. package/fesm2022/attribute.mjs.map +1 -1
  8. package/fesm2022/core.mjs +3 -3
  9. package/fesm2022/core.mjs.map +1 -1
  10. package/fesm2022/debug_node.mjs +48 -31
  11. package/fesm2022/debug_node.mjs.map +1 -1
  12. package/fesm2022/{untracked.mjs → effect.mjs} +29 -4
  13. package/fesm2022/effect.mjs.map +1 -0
  14. package/fesm2022/not_found.mjs +1 -1
  15. package/fesm2022/not_found.mjs.map +1 -1
  16. package/fesm2022/primitives/di.mjs +1 -1
  17. package/fesm2022/primitives/di.mjs.map +1 -1
  18. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  19. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  20. package/fesm2022/primitives/signals.mjs +2 -2
  21. package/fesm2022/primitives/signals.mjs.map +1 -1
  22. package/fesm2022/resource.mjs +18 -27
  23. package/fesm2022/resource.mjs.map +1 -1
  24. package/fesm2022/root_effect_scheduler.mjs +1 -1
  25. package/fesm2022/root_effect_scheduler.mjs.map +1 -1
  26. package/fesm2022/rxjs-interop.mjs +2 -2
  27. package/fesm2022/rxjs-interop.mjs.map +1 -1
  28. package/fesm2022/signal.mjs +1 -1
  29. package/fesm2022/signal.mjs.map +1 -1
  30. package/fesm2022/testing.mjs +1 -1
  31. package/fesm2022/testing.mjs.map +1 -1
  32. package/fesm2022/weak_ref.mjs +1 -1
  33. package/fesm2022/weak_ref.mjs.map +1 -1
  34. package/graph.d.d.ts +1 -1
  35. package/index.d.ts +2 -2
  36. package/package.json +2 -2
  37. package/primitives/di/index.d.ts +1 -1
  38. package/primitives/event-dispatch/index.d.ts +1 -1
  39. package/primitives/signals/index.d.ts +3 -3
  40. package/rxjs-interop/index.d.ts +1 -1
  41. package/schematics/bundles/{apply_import_manager-BvwNQhfG.cjs → apply_import_manager-jh6mrC6i.cjs} +3 -3
  42. package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
  43. package/schematics/bundles/{compiler_host-DbXQvYKt.cjs → compiler_host-B_eI7M_O.cjs} +2 -2
  44. package/schematics/bundles/control-flow-migration.cjs +10 -9
  45. package/schematics/bundles/document-core.cjs +5 -5
  46. package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
  47. package/schematics/bundles/{index-Bphk20D_.cjs → index-BakSPuLU.cjs} +4 -4
  48. package/schematics/bundles/{index-Bcv0dPD8.cjs → index-D6oJ4URa.cjs} +12 -12
  49. package/schematics/bundles/inject-flags.cjs +5 -5
  50. package/schematics/bundles/inject-migration.cjs +3 -3
  51. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  52. package/schematics/bundles/{migrate_ts_type_references-xcaijJqF.cjs → migrate_ts_type_references-Cv_ejjaV.cjs} +10 -9
  53. package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
  54. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  55. package/schematics/bundles/output-migration.cjs +6 -6
  56. package/schematics/bundles/{project_paths-BaK5P5a5.cjs → project_paths-CSaggenP.cjs} +3 -3
  57. package/schematics/bundles/{project_tsconfig_paths-COqholMT.cjs → project_tsconfig_paths-BDoOg2Cc.cjs} +11 -5
  58. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  59. package/schematics/bundles/route-lazy-loading.cjs +3 -3
  60. package/schematics/bundles/router-current-navigation.cjs +4 -4
  61. package/schematics/bundles/self-closing-tags-migration.cjs +4 -4
  62. package/schematics/bundles/signal-input-migration.cjs +13 -12
  63. package/schematics/bundles/signal-queries-migration.cjs +8 -7
  64. package/schematics/bundles/signals.cjs +8 -7
  65. package/schematics/bundles/standalone-migration.cjs +4 -4
  66. package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
  67. package/schematics/bundles/test-bed-get.cjs +4 -4
  68. package/testing/index.d.ts +2 -2
  69. package/weak_ref.d.d.ts +1 -1
  70. package/fesm2022/untracked.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.2.1
2
+ * @license Angular v20.2.2
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -13515,7 +13515,7 @@ class ComponentFactory extends ComponentFactory$1 {
13515
13515
  }
13516
13516
  function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
13517
13517
  const tAttributes = rootSelectorOrNode
13518
- ? ['ng-version', '20.2.1']
13518
+ ? ['ng-version', '20.2.2']
13519
13519
  : // Extract attributes and classes from the first selector only to match VE behavior.
13520
13520
  extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
13521
13521
  let creationBindings = null;
@@ -21997,11 +21997,39 @@ const longestAnimations = new WeakMap();
21997
21997
  // used to prevent duplicate nodes from showing up when nodes have been toggled quickly
21998
21998
  // from an `@if` or `@for`.
21999
21999
  const leavingNodes = new WeakMap();
22000
- function clearLeavingNodes(tNode) {
22001
- if (leavingNodes.get(tNode)?.length === 0) {
22000
+ function clearLeavingNodes(tNode, el) {
22001
+ const nodes = leavingNodes.get(tNode);
22002
+ if (nodes && nodes.length > 0) {
22003
+ const ix = nodes.findIndex((node) => node === el);
22004
+ if (ix > -1)
22005
+ nodes.splice(ix, 1);
22006
+ }
22007
+ if (nodes?.length === 0) {
22002
22008
  leavingNodes.delete(tNode);
22003
22009
  }
22004
22010
  }
22011
+ /**
22012
+ * In the case that we have an existing node that's animating away, like when
22013
+ * an `@if` toggles quickly, we need to end the animation for the former node
22014
+ * and remove it right away to prevent duplicate nodes showing up.
22015
+ */
22016
+ function cancelLeavingNodes(tNode, lView) {
22017
+ const leavingEl = leavingNodes.get(tNode)?.shift();
22018
+ const lContainer = lView[DECLARATION_LCONTAINER];
22019
+ if (lContainer) {
22020
+ // this is the insertion point for the new TNode element.
22021
+ // it will be inserted before the declaring containers anchor.
22022
+ const beforeNode = getBeforeNodeForView(tNode.index, lContainer);
22023
+ // here we need to check the previous sibling of that anchor
22024
+ const previousNode = beforeNode?.previousSibling;
22025
+ // We really only want to cancel animations if the leaving node is the
22026
+ // same as the node before where the new node will be inserted. This is
22027
+ // the control flow scenario where an if was toggled.
22028
+ if (leavingEl && previousNode && leavingEl === previousNode) {
22029
+ leavingEl.dispatchEvent(new CustomEvent('animationend', { detail: { cancel: true } }));
22030
+ }
22031
+ }
22032
+ }
22005
22033
  function trackLeavingNodes(tNode, el) {
22006
22034
  // We need to track this tNode's element just to be sure we don't add
22007
22035
  // a new RNode for this TNode while this one is still animating away.
@@ -22033,6 +22061,7 @@ function ɵɵanimateEnter(value) {
22033
22061
  }
22034
22062
  const tNode = getCurrentTNode();
22035
22063
  const nativeElement = getNativeByTNode(tNode, lView);
22064
+ ngDevMode && assertElementNodes(nativeElement, 'animate.enter');
22036
22065
  const renderer = lView[RENDERER];
22037
22066
  const ngZone = lView[INJECTOR].get(NgZone);
22038
22067
  // Retrieve the actual class list from the value. This will resolve any resolver functions from
@@ -22060,14 +22089,7 @@ function ɵɵanimateEnter(value) {
22060
22089
  cleanupFns.push(renderer.listen(nativeElement, 'animationstart', handleAnimationStart));
22061
22090
  cleanupFns.push(renderer.listen(nativeElement, 'transitionstart', handleAnimationStart));
22062
22091
  });
22063
- // In the case that we have an existing node that's animating away, like when
22064
- // an `@if` toggles quickly or `@for` adds and removes elements quickly, we
22065
- // need to end the animation for the former node and remove it right away to
22066
- // prevent duplicate nodes showing up.
22067
- leavingNodes
22068
- .get(tNode)
22069
- ?.pop()
22070
- ?.dispatchEvent(new CustomEvent('animationend', { detail: { cancel: true } }));
22092
+ cancelLeavingNodes(tNode, lView);
22071
22093
  trackEnterClasses(nativeElement, activeClasses, cleanupFns);
22072
22094
  for (const klass of activeClasses) {
22073
22095
  renderer.addClass(nativeElement, klass);
@@ -22130,14 +22152,8 @@ function ɵɵanimateEnterListener(value) {
22130
22152
  }
22131
22153
  const tNode = getCurrentTNode();
22132
22154
  const nativeElement = getNativeByTNode(tNode, lView);
22133
- // In the case that we have an existing node that's animating away, like when
22134
- // an `@if` toggles quickly or `@for` adds and removes elements quickly, we
22135
- // need to end the animation for the former node and remove it right away to
22136
- // prevent duplicate nodes showing up.
22137
- leavingNodes
22138
- .get(tNode)
22139
- ?.pop()
22140
- ?.dispatchEvent(new CustomEvent('animationend', { detail: { cancel: true } }));
22155
+ ngDevMode && assertElementNodes(nativeElement, 'animate.enter');
22156
+ cancelLeavingNodes(tNode, lView);
22141
22157
  value.call(lView[CONTEXT], { target: nativeElement, animationComplete: noOpAnimationComplete });
22142
22158
  return ɵɵanimateEnterListener;
22143
22159
  }
@@ -22165,6 +22181,7 @@ function ɵɵanimateLeave(value) {
22165
22181
  const tView = getTView();
22166
22182
  const tNode = getCurrentTNode();
22167
22183
  const nativeElement = getNativeByTNode(tNode, lView);
22184
+ ngDevMode && assertElementNodes(nativeElement, 'animate.leave');
22168
22185
  // This instruction is called in the update pass.
22169
22186
  const renderer = lView[RENDERER];
22170
22187
  const elementRegistry = getAnimationElementRemovalRegistry();
@@ -22209,9 +22226,7 @@ function ɵɵanimateLeaveListener(value) {
22209
22226
  const tNode = getCurrentTNode();
22210
22227
  const tView = getTView();
22211
22228
  const nativeElement = getNativeByTNode(tNode, lView);
22212
- if (nativeElement.nodeType !== Node.ELEMENT_NODE) {
22213
- return ɵɵanimateLeaveListener;
22214
- }
22229
+ ngDevMode && assertElementNodes(nativeElement, 'animate.leave');
22215
22230
  const elementRegistry = getAnimationElementRemovalRegistry();
22216
22231
  ngDevMode &&
22217
22232
  assertDefined(elementRegistry.elements, 'Expected `ElementRegistry` to be present in animations subsystem');
@@ -22227,7 +22242,7 @@ function ɵɵanimateLeaveListener(value) {
22227
22242
  const event = {
22228
22243
  target: nativeElement,
22229
22244
  animationComplete: () => {
22230
- clearLeavingNodes(tNode);
22245
+ clearLeavingNodes(tNode, _el);
22231
22246
  removeFn();
22232
22247
  },
22233
22248
  };
@@ -22253,15 +22268,12 @@ function getClassList(value, resolvers) {
22253
22268
  const classList = new Set(value);
22254
22269
  if (resolvers && resolvers.length) {
22255
22270
  for (const resolverFn of resolvers) {
22256
- const resolvedValue = resolverFn();
22257
- if (resolvedValue instanceof Array) {
22271
+ const resolvedValue = getClassListFromValue(resolverFn);
22272
+ if (resolvedValue) {
22258
22273
  for (const rv of resolvedValue) {
22259
22274
  classList.add(rv);
22260
22275
  }
22261
22276
  }
22262
- else {
22263
- classList.add(resolvedValue);
22264
- }
22265
22277
  }
22266
22278
  }
22267
22279
  return classList;
@@ -22337,6 +22349,11 @@ function assertAnimationTypes(value, instruction) {
22337
22349
  throw new RuntimeError(650 /* RuntimeErrorCode.ANIMATE_INVALID_VALUE */, `'${instruction}' value must be a string of CSS classes or an animation function, got ${stringify(value)}`);
22338
22350
  }
22339
22351
  }
22352
+ function assertElementNodes(nativeElement, instruction) {
22353
+ if (nativeElement.nodeType !== Node.ELEMENT_NODE) {
22354
+ throw new RuntimeError(650 /* RuntimeErrorCode.ANIMATE_INVALID_VALUE */, `'${instruction}' can only be used on an element node, got ${stringify(nativeElement.nodeType)}`);
22355
+ }
22356
+ }
22340
22357
  /**
22341
22358
  * This function actually adds the classes that animate element that's leaving the DOM.
22342
22359
  * Once it finishes, it calls the remove function that was provided by the DOM renderer.
@@ -22356,7 +22373,7 @@ function animateLeaveClassRunner(el, tNode, classList, finalRemoveFn, renderer,
22356
22373
  // affect any other animations on the page.
22357
22374
  event.stopImmediatePropagation();
22358
22375
  longestAnimations.delete(el);
22359
- clearLeavingNodes(tNode);
22376
+ clearLeavingNodes(tNode, el);
22360
22377
  finalRemoveFn();
22361
22378
  }
22362
22379
  };
@@ -22375,7 +22392,7 @@ function animateLeaveClassRunner(el, tNode, classList, finalRemoveFn, renderer,
22375
22392
  requestAnimationFrame(() => {
22376
22393
  determineLongestAnimation(el, longestAnimations, areAnimationSupported);
22377
22394
  if (!longestAnimations.has(el)) {
22378
- clearLeavingNodes(tNode);
22395
+ clearLeavingNodes(tNode, el);
22379
22396
  finalRemoveFn();
22380
22397
  }
22381
22398
  });