@angular/core 20.2.0-next.6 → 20.2.0-rc.1

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 (58) 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 +2 -8
  4. package/event_dispatcher.d.d.ts +1 -1
  5. package/fesm2022/attribute.mjs +1 -1
  6. package/fesm2022/core.mjs +17 -13
  7. package/fesm2022/core.mjs.map +1 -1
  8. package/fesm2022/debug_node.mjs +31 -16
  9. package/fesm2022/debug_node.mjs.map +1 -1
  10. package/fesm2022/not_found.mjs +1 -1
  11. package/fesm2022/primitives/di.mjs +1 -1
  12. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  13. package/fesm2022/primitives/signals.mjs +1 -1
  14. package/fesm2022/resource.mjs +2 -11
  15. package/fesm2022/resource.mjs.map +1 -1
  16. package/fesm2022/root_effect_scheduler.mjs +1 -1
  17. package/fesm2022/rxjs-interop.mjs +1 -1
  18. package/fesm2022/signal.mjs +1 -1
  19. package/fesm2022/testing.mjs +1 -1
  20. package/fesm2022/untracked.mjs +1 -1
  21. package/fesm2022/weak_ref.mjs +1 -1
  22. package/graph.d.d.ts +1 -1
  23. package/index.d.ts +3 -11
  24. package/package.json +2 -2
  25. package/primitives/di/index.d.ts +1 -1
  26. package/primitives/event-dispatch/index.d.ts +1 -1
  27. package/primitives/signals/index.d.ts +1 -1
  28. package/rxjs-interop/index.d.ts +1 -1
  29. package/schematics/bundles/{apply_import_manager-DDzBE76c.cjs → apply_import_manager-OJAv7nyR.cjs} +3 -3
  30. package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
  31. package/schematics/bundles/{compiler_host-PbDBLXD_.cjs → compiler_host-GMENszSm.cjs} +2 -2
  32. package/schematics/bundles/control-flow-migration.cjs +3 -3
  33. package/schematics/bundles/document-core.cjs +5 -5
  34. package/schematics/bundles/imports-CIX-JgAN.cjs +1 -1
  35. package/schematics/bundles/{index-HnBPwNoT.cjs → index-C0gVsyDQ.cjs} +4 -4
  36. package/schematics/bundles/{index-bNLbdiQu.cjs → index-CvCDOy8a.cjs} +17 -19
  37. package/schematics/bundles/inject-flags.cjs +5 -5
  38. package/schematics/bundles/inject-migration.cjs +3 -3
  39. package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
  40. package/schematics/bundles/{migrate_ts_type_references-DvNm2DJd.cjs → migrate_ts_type_references-ByPRdLHL.cjs} +5 -5
  41. package/schematics/bundles/ng_decorators-B5HCqr20.cjs +1 -1
  42. package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
  43. package/schematics/bundles/output-migration.cjs +6 -6
  44. package/schematics/bundles/{project_paths-WYk3KB4n.cjs → project_paths-BfWTWKz0.cjs} +3 -3
  45. package/schematics/bundles/{project_tsconfig_paths-iei5hRhJ.cjs → project_tsconfig_paths-Bhn4jDr1.cjs} +37 -27
  46. package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
  47. package/schematics/bundles/route-lazy-loading.cjs +3 -3
  48. package/schematics/bundles/router-current-navigation.cjs +4 -4
  49. package/schematics/bundles/self-closing-tags-migration.cjs +4 -4
  50. package/schematics/bundles/signal-input-migration.cjs +7 -7
  51. package/schematics/bundles/signal-queries-migration.cjs +7 -7
  52. package/schematics/bundles/signals.cjs +7 -7
  53. package/schematics/bundles/standalone-migration.cjs +4 -4
  54. package/schematics/bundles/symbol-VPWguRxr.cjs +1 -1
  55. package/schematics/bundles/test-bed-get.cjs +4 -4
  56. package/signal.d.d.ts +1 -1
  57. package/testing/index.d.ts +1 -1
  58. package/weak_ref.d.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.2.0-next.6
2
+ * @license Angular v20.2.0-rc.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -4896,12 +4896,6 @@ var ViewEncapsulation;
4896
4896
  * all the Component's styling.
4897
4897
  */
4898
4898
  ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
4899
- /**
4900
- * Similar to `ShadowDom`, but prevents any external styles from leaking into the
4901
- * component's ShadowRoot. This is useful when you want to ensure that the component's
4902
- * styles are completely isolated from the rest of the application, including global styles.
4903
- */
4904
- ViewEncapsulation[ViewEncapsulation["IsolatedShadowDom"] = 4] = "IsolatedShadowDom";
4905
4899
  })(ViewEncapsulation || (ViewEncapsulation = {}));
4906
4900
 
4907
4901
  /**
@@ -7996,9 +7990,7 @@ function locateHostElement(renderer, elementOrSelector, encapsulation, injector)
7996
7990
  const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT);
7997
7991
  // When using native Shadow DOM, do not clear host element to allow native slot
7998
7992
  // projection.
7999
- const preserveContent = preserveHostContent ||
8000
- encapsulation === ViewEncapsulation.ShadowDom ||
8001
- encapsulation === ViewEncapsulation.IsolatedShadowDom;
7993
+ const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation.ShadowDom;
8002
7994
  const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent);
8003
7995
  applyRootElementTransform(rootElement);
8004
7996
  return rootElement;
@@ -13523,7 +13515,7 @@ class ComponentFactory extends ComponentFactory$1 {
13523
13515
  }
13524
13516
  function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
13525
13517
  const tAttributes = rootSelectorOrNode
13526
- ? ['ng-version', '20.2.0-next.6']
13518
+ ? ['ng-version', '20.2.0-rc.1']
13527
13519
  : // Extract attributes and classes from the first selector only to match VE behavior.
13528
13520
  extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
13529
13521
  let creationBindings = null;
@@ -21962,6 +21954,10 @@ const noOpAnimationComplete = () => { };
21962
21954
  // we remove all of the classes in the case of animation composition via host bindings.
21963
21955
  const enterClassMap = new WeakMap();
21964
21956
  const longestAnimations = new WeakMap();
21957
+ // Tracks nodes that are animating away for the duration of the animation. This is
21958
+ // used to prevent duplicate nodes from showing up when nodes have been toggled quickly
21959
+ // from an `@if` or `@for`.
21960
+ const leavingNodes = new WeakMap();
21965
21961
  /**
21966
21962
  * Instruction to handle the `animate.enter` behavior for class bindings.
21967
21963
  *
@@ -22012,6 +22008,14 @@ function ɵɵanimateEnter(value) {
22012
22008
  cleanupFns.push(renderer.listen(nativeElement, 'animationstart', handleAnimationStart));
22013
22009
  cleanupFns.push(renderer.listen(nativeElement, 'transitionstart', handleAnimationStart));
22014
22010
  });
22011
+ // In the case that we have an existing node that's animating away, like when
22012
+ // an `@if` toggles quickly or `@for` adds and removes elements quickly, we
22013
+ // need to end the animation for the former node and remove it right away to
22014
+ // prevent duplicate nodes showing up.
22015
+ leavingNodes
22016
+ .get(tNode)
22017
+ ?.pop()
22018
+ ?.dispatchEvent(new CustomEvent('animationend', { detail: { cancel: true } }));
22015
22019
  trackEnterClasses(nativeElement, activeClasses, cleanupFns);
22016
22020
  for (const klass of activeClasses) {
22017
22021
  renderer.addClass(nativeElement, klass);
@@ -22099,7 +22103,7 @@ function ɵɵanimateLeave(value) {
22099
22103
  // begins.
22100
22104
  const animate = (el, value, resolvers) => {
22101
22105
  return (removalFn) => {
22102
- animateLeaveClassRunner(el, getClassList(value, resolvers), removalFn, renderer, animationsDisabled, ngZone);
22106
+ animateLeaveClassRunner(el, tNode, getClassList(value, resolvers), removalFn, renderer, animationsDisabled, ngZone);
22103
22107
  };
22104
22108
  };
22105
22109
  // Ensure cleanup if the LView is destroyed before the animation runs.
@@ -22273,7 +22277,7 @@ function assertAnimationTypes(value, instruction) {
22273
22277
  * This function actually adds the classes that animate element that's leaving the DOM.
22274
22278
  * Once it finishes, it calls the remove function that was provided by the DOM renderer.
22275
22279
  */
22276
- function animateLeaveClassRunner(el, classList, finalRemoveFn, renderer, animationsDisabled, ngZone) {
22280
+ function animateLeaveClassRunner(el, tNode, classList, finalRemoveFn, renderer, animationsDisabled, ngZone) {
22277
22281
  if (animationsDisabled) {
22278
22282
  longestAnimations.delete(el);
22279
22283
  finalRemoveFn();
@@ -22283,13 +22287,16 @@ function animateLeaveClassRunner(el, classList, finalRemoveFn, renderer, animati
22283
22287
  determineLongestAnimation(event, el, longestAnimations, areAnimationSupported);
22284
22288
  };
22285
22289
  const handleOutAnimationEnd = (event) => {
22286
- if (isLongestAnimation(event, el)) {
22290
+ if (event instanceof CustomEvent || isLongestAnimation(event, el)) {
22287
22291
  // Now that we've found the longest animation, there's no need
22288
22292
  // to keep bubbling up this event as it's not going to apply to
22289
22293
  // other elements further up. We don't want it to inadvertently
22290
22294
  // affect any other animations on the page.
22291
22295
  event.stopImmediatePropagation();
22292
22296
  longestAnimations.delete(el);
22297
+ if (leavingNodes.get(tNode)?.length === 0) {
22298
+ leavingNodes.delete(tNode);
22299
+ }
22293
22300
  finalRemoveFn();
22294
22301
  }
22295
22302
  };
@@ -22300,6 +22307,15 @@ function animateLeaveClassRunner(el, classList, finalRemoveFn, renderer, animati
22300
22307
  renderer.listen(el, 'animationend', handleOutAnimationEnd);
22301
22308
  renderer.listen(el, 'transitionend', handleOutAnimationEnd);
22302
22309
  });
22310
+ // We need to track this tNode's element just to be sure we don't add
22311
+ // a new RNode for this TNode while this one is still animating away.
22312
+ // once the animation is complete, we remove this reference.
22313
+ if (leavingNodes.has(tNode)) {
22314
+ leavingNodes.get(tNode)?.push(el);
22315
+ }
22316
+ else {
22317
+ leavingNodes.set(tNode, [el]);
22318
+ }
22303
22319
  for (const item of classList) {
22304
22320
  renderer.addClass(el, item);
22305
22321
  }
@@ -29053,8 +29069,7 @@ function recreateLView(importMeta, id, newDef, oldDef, lView) {
29053
29069
  // shadow root. The browser will throw if we attempt to attach another one and there's no way
29054
29070
  // to detach it. Our only option is to make a clone only of the root node, replace the node
29055
29071
  // with the clone and use it for the newly-created LView.
29056
- if (oldDef.encapsulation === ViewEncapsulation.ShadowDom ||
29057
- oldDef.encapsulation === ViewEncapsulation.IsolatedShadowDom) {
29072
+ if (oldDef.encapsulation === ViewEncapsulation.ShadowDom) {
29058
29073
  const newHost = host.cloneNode(false);
29059
29074
  host.replaceWith(newHost);
29060
29075
  host = newHost;