@angular/core 21.2.0-rc.0 → 21.2.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 (75) hide show
  1. package/fesm2022/_attribute-chunk.mjs +1 -1
  2. package/fesm2022/_attribute-chunk.mjs.map +1 -1
  3. package/fesm2022/_debug_node-chunk.mjs +69 -20
  4. package/fesm2022/_debug_node-chunk.mjs.map +1 -1
  5. package/fesm2022/_effect-chunk.mjs +1 -1
  6. package/fesm2022/_effect-chunk.mjs.map +1 -1
  7. package/fesm2022/_effect-chunk2.mjs +27 -19
  8. package/fesm2022/_effect-chunk2.mjs.map +1 -1
  9. package/fesm2022/_not_found-chunk.mjs +1 -1
  10. package/fesm2022/_not_found-chunk.mjs.map +1 -1
  11. package/fesm2022/_resource-chunk.mjs +7 -4
  12. package/fesm2022/_resource-chunk.mjs.map +1 -1
  13. package/fesm2022/_untracked-chunk.mjs +1 -1
  14. package/fesm2022/_untracked-chunk.mjs.map +1 -1
  15. package/fesm2022/_weak_ref-chunk.mjs +1 -1
  16. package/fesm2022/_weak_ref-chunk.mjs.map +1 -1
  17. package/fesm2022/core.mjs +3 -3
  18. package/fesm2022/core.mjs.map +1 -1
  19. package/fesm2022/primitives-di.mjs +1 -1
  20. package/fesm2022/primitives-di.mjs.map +1 -1
  21. package/fesm2022/primitives-event-dispatch.mjs +1 -1
  22. package/fesm2022/primitives-event-dispatch.mjs.map +1 -1
  23. package/fesm2022/primitives-signals.mjs +1 -1
  24. package/fesm2022/primitives-signals.mjs.map +1 -1
  25. package/fesm2022/rxjs-interop.mjs +1 -1
  26. package/fesm2022/rxjs-interop.mjs.map +1 -1
  27. package/fesm2022/testing.mjs +1 -1
  28. package/fesm2022/testing.mjs.map +1 -1
  29. package/package.json +2 -2
  30. package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +1 -1
  31. package/schematics/bundles/application-config-core.cjs +1 -1
  32. package/schematics/bundles/apply_import_manager-CxA_YYgB.cjs +1 -1
  33. package/schematics/bundles/bootstrap-options-migration.cjs +1 -1
  34. package/schematics/bundles/cleanup-unused-imports.cjs +1 -1
  35. package/schematics/bundles/common-to-standalone-migration.cjs +1 -1
  36. package/schematics/bundles/compiler_host-CY14HvaP.cjs +1 -1
  37. package/schematics/bundles/control-flow-migration.cjs +1 -1
  38. package/schematics/bundles/imports-CVmcbVA9.cjs +1 -1
  39. package/schematics/bundles/index-BtLcQH8g.cjs +1 -1
  40. package/schematics/bundles/inject-migration.cjs +1 -1
  41. package/schematics/bundles/leading_space-BTPRV0wu.cjs +1 -1
  42. package/schematics/bundles/migrate_ts_type_references-MWoZx-Cb.cjs +1 -1
  43. package/schematics/bundles/ng_component_template-BOuKAnQd.cjs +1 -1
  44. package/schematics/bundles/ng_decorators-DYy6II6x.cjs +1 -1
  45. package/schematics/bundles/ngclass-to-class-migration.cjs +1 -1
  46. package/schematics/bundles/ngstyle-to-style-migration.cjs +1 -1
  47. package/schematics/bundles/nodes-ZSQ7WZRB.cjs +1 -1
  48. package/schematics/bundles/output-migration.cjs +1 -1
  49. package/schematics/bundles/parse_html-C8eKA9px.cjs +1 -1
  50. package/schematics/bundles/project_paths-D2V-Uh2L.cjs +1 -1
  51. package/schematics/bundles/project_tsconfig_paths-DkkMibv-.cjs +1 -1
  52. package/schematics/bundles/property_name-BCpALNpZ.cjs +1 -1
  53. package/schematics/bundles/route-lazy-loading.cjs +1 -1
  54. package/schematics/bundles/router-current-navigation.cjs +1 -1
  55. package/schematics/bundles/router-last-successful-navigation.cjs +1 -1
  56. package/schematics/bundles/router-testing-module-migration.cjs +1 -1
  57. package/schematics/bundles/self-closing-tags-migration.cjs +1 -1
  58. package/schematics/bundles/signal-input-migration.cjs +1 -1
  59. package/schematics/bundles/signal-queries-migration.cjs +1 -1
  60. package/schematics/bundles/signals.cjs +1 -1
  61. package/schematics/bundles/standalone-migration.cjs +1 -1
  62. package/schematics/bundles/symbol-DZeHSR-V.cjs +1 -1
  63. package/types/_api-chunk.d.ts +1 -1
  64. package/types/_chrome_dev_tools_performance-chunk.d.ts +1 -1
  65. package/types/_discovery-chunk.d.ts +1 -1
  66. package/types/_effect-chunk.d.ts +1 -1
  67. package/types/_event_dispatcher-chunk.d.ts +1 -1
  68. package/types/_formatter-chunk.d.ts +1 -1
  69. package/types/_weak_ref-chunk.d.ts +1 -1
  70. package/types/core.d.ts +10 -10
  71. package/types/primitives-di.d.ts +1 -1
  72. package/types/primitives-event-dispatch.d.ts +1 -1
  73. package/types/primitives-signals.d.ts +1 -1
  74. package/types/rxjs-interop.d.ts +1 -1
  75. package/types/testing.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-rc.0
2
+ * @license Angular v21.2.1
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"_attribute-chunk.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/event-dispatch/src/attribute.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport const Attribute = {\n /**\n * The jsaction attribute defines a mapping of a DOM event to a\n * generic event (aka jsaction), to which the actual event handlers\n * that implement the behavior of the application are bound. The\n * value is a semicolon separated list of colon separated pairs of\n * an optional DOM event name and a jsaction name. If the optional\n * DOM event name is omitted, 'click' is assumed. The jsaction names\n * are dot separated pairs of a namespace and a simple jsaction\n * name.\n *\n * See grammar in README.md for expected syntax in the attribute value.\n */\n JSACTION: 'jsaction' as const,\n};\n"],"names":["Attribute","JSACTION"],"mappings":";;;;;;AAQO,MAAMA,SAAS,GAAG;AAavBC,EAAAA,QAAQ,EAAE;;;;;"}
1
+ {"version":3,"file":"_attribute-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/core/primitives/event-dispatch/src/attribute.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nexport const Attribute = {\n /**\n * The jsaction attribute defines a mapping of a DOM event to a\n * generic event (aka jsaction), to which the actual event handlers\n * that implement the behavior of the application are bound. The\n * value is a semicolon separated list of colon separated pairs of\n * an optional DOM event name and a jsaction name. If the optional\n * DOM event name is omitted, 'click' is assumed. The jsaction names\n * are dot separated pairs of a namespace and a simple jsaction\n * name.\n *\n * See grammar in README.md for expected syntax in the attribute value.\n */\n JSACTION: 'jsaction' as const,\n};\n"],"names":["Attribute","JSACTION"],"mappings":";;;;;;AAQO,MAAMA,SAAS,GAAG;AAavBC,EAAAA,QAAQ,EAAE;;;;;"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-rc.0
2
+ * @license Angular v21.2.1
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1212,7 +1212,7 @@ function reflectDependency(dep) {
1212
1212
  meta.token = param.token;
1213
1213
  } else if (param instanceof Attribute) {
1214
1214
  if (param.attributeName === undefined) {
1215
- throw new RuntimeError(204, ngDevMode && `Attribute name must be defined.`);
1215
+ throw new RuntimeError(-204, ngDevMode && `Attribute name must be defined.`);
1216
1216
  }
1217
1217
  meta.attribute = param.attributeName;
1218
1218
  } else {
@@ -4048,6 +4048,7 @@ const noOpAnimationComplete = () => {};
4048
4048
  const enterClassMap = new WeakMap();
4049
4049
  const longestAnimations = new WeakMap();
4050
4050
  const leavingNodes = new WeakMap();
4051
+ const reusedNodes = new WeakSet();
4051
4052
  function clearLeavingNodes(tNode, el) {
4052
4053
  const nodes = leavingNodes.get(tNode);
4053
4054
  if (nodes && nodes.length > 0) {
@@ -4066,7 +4067,15 @@ function cancelLeavingNodes(tNode, newElement) {
4066
4067
  for (let i = nodes.length - 1; i >= 0; i--) {
4067
4068
  const leavingEl = nodes[i];
4068
4069
  const leavingParent = leavingEl.parentNode;
4069
- if (prevSibling && leavingEl === prevSibling || leavingParent && newParent && leavingParent !== newParent) {
4070
+ if (leavingEl === newElement) {
4071
+ nodes.splice(i, 1);
4072
+ reusedNodes.add(leavingEl);
4073
+ leavingEl.dispatchEvent(new CustomEvent('animationend', {
4074
+ detail: {
4075
+ cancel: true
4076
+ }
4077
+ }));
4078
+ } else if (prevSibling && leavingEl === prevSibling || leavingParent && newParent && leavingParent !== newParent) {
4070
4079
  nodes.splice(i, 1);
4071
4080
  leavingEl.dispatchEvent(new CustomEvent('animationend', {
4072
4081
  detail: {
@@ -4119,10 +4128,13 @@ function elementHasClassList(element, classList) {
4119
4128
  }
4120
4129
  return false;
4121
4130
  }
4131
+ function getEventTarget(event) {
4132
+ return event.composedPath ? event.composedPath()[0] : event.target;
4133
+ }
4122
4134
  function isLongestAnimation(event, nativeElement) {
4123
4135
  const longestAnimation = longestAnimations.get(nativeElement);
4124
4136
  if (longestAnimation === undefined) return true;
4125
- return nativeElement === event.target && (longestAnimation.animationName !== undefined && event.animationName === longestAnimation.animationName || longestAnimation.propertyName !== undefined && event.propertyName === longestAnimation.propertyName);
4137
+ return nativeElement === getEventTarget(event) && (longestAnimation.animationName !== undefined && event.animationName === longestAnimation.animationName || longestAnimation.propertyName !== undefined && (longestAnimation.propertyName === 'all' || event.propertyName === longestAnimation.propertyName));
4126
4138
  }
4127
4139
  function addAnimationToLView(animations, tNode, fn) {
4128
4140
  const nodeAnimations = animations.get(tNode.index) ?? {
@@ -4182,6 +4194,7 @@ function getLongestComputedAnimation(computedStyle) {
4182
4194
  const rawNames = parseCssPropertyValue(computedStyle, 'animation-name');
4183
4195
  const rawDelays = parseCssPropertyValue(computedStyle, 'animation-delay');
4184
4196
  const rawDurations = parseCssPropertyValue(computedStyle, 'animation-duration');
4197
+ const rawIterationCounts = parseCssPropertyValue(computedStyle, 'animation-iteration-count');
4185
4198
  const longest = {
4186
4199
  animationName: '',
4187
4200
  propertyName: undefined,
@@ -4189,7 +4202,8 @@ function getLongestComputedAnimation(computedStyle) {
4189
4202
  };
4190
4203
  for (let i = 0; i < rawNames.length; i++) {
4191
4204
  const duration = parseCssTimeUnitsToMs(rawDelays[i]) + parseCssTimeUnitsToMs(rawDurations[i]);
4192
- if (duration > longest.duration) {
4205
+ const iterationCount = rawIterationCounts[i];
4206
+ if (duration > longest.duration && iterationCount !== 'infinite') {
4193
4207
  longest.animationName = rawNames[i];
4194
4208
  longest.duration = duration;
4195
4209
  }
@@ -4225,6 +4239,9 @@ function determineLongestAnimationFromElementAnimations(el, animationsMap, anima
4225
4239
  };
4226
4240
  for (const animation of animations) {
4227
4241
  const timing = animation.effect?.getTiming();
4242
+ if (timing?.iterations === Infinity) {
4243
+ continue;
4244
+ }
4228
4245
  const animDuration = typeof timing?.duration === 'number' ? timing.duration : 0;
4229
4246
  let duration = (timing?.delay ?? 0) + animDuration;
4230
4247
  let propertyName;
@@ -4683,6 +4700,10 @@ function applyToElementOrContainer(action, renderer, injector, parent, lNodeToHa
4683
4700
  trackLeavingNodes(tNode, rNode);
4684
4701
  }
4685
4702
  runLeaveAnimationsWithCallback(parentLView, tNode, injector, nodeHasLeaveAnimations => {
4703
+ if (reusedNodes.has(rNode)) {
4704
+ reusedNodes.delete(rNode);
4705
+ return;
4706
+ }
4686
4707
  nativeRemoveNode(renderer, rNode, isComponent, nodeHasLeaveAnimations);
4687
4708
  });
4688
4709
  } else if (action === 3) {
@@ -8712,7 +8733,7 @@ class ComponentFactory extends ComponentFactory$1 {
8712
8733
  }
8713
8734
  }
8714
8735
  function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) {
8715
- const tAttributes = rootSelectorOrNode ? ['ng-version', '21.2.0-rc.0'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
8736
+ const tAttributes = rootSelectorOrNode ? ['ng-version', '21.2.1'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]);
8716
8737
  let creationBindings = null;
8717
8738
  let updateBindings = null;
8718
8739
  let varsToAllocate = 0;
@@ -13327,15 +13348,19 @@ function runEnterAnimation(lView, tNode, value, ngZone) {
13327
13348
  const renderer = lView[RENDERER];
13328
13349
  const activeClasses = getClassListFromValue(value);
13329
13350
  const cleanupFns = [];
13351
+ let hasCompleted = false;
13330
13352
  const handleEnterAnimationStart = event => {
13331
- if (event.target !== nativeElement) return;
13353
+ if (getEventTarget(event) !== nativeElement) return;
13332
13354
  const eventName = event instanceof AnimationEvent ? 'animationend' : 'transitionend';
13333
13355
  ngZone.runOutsideAngular(() => {
13334
13356
  renderer.listen(nativeElement, eventName, handleEnterAnimationEnd);
13335
13357
  });
13336
13358
  };
13337
13359
  const handleEnterAnimationEnd = event => {
13338
- if (event.target !== nativeElement) return;
13360
+ if (getEventTarget(event) !== nativeElement) return;
13361
+ if (isLongestAnimation(event, nativeElement)) {
13362
+ hasCompleted = true;
13363
+ }
13339
13364
  enterAnimationEnd(event, nativeElement, renderer);
13340
13365
  };
13341
13366
  if (activeClasses && activeClasses.length > 0) {
@@ -13349,6 +13374,7 @@ function runEnterAnimation(lView, tNode, value, ngZone) {
13349
13374
  }
13350
13375
  ngZone.runOutsideAngular(() => {
13351
13376
  requestAnimationFrame(() => {
13377
+ if (hasCompleted) return;
13352
13378
  determineLongestAnimation(nativeElement, longestAnimations, areAnimationSupported);
13353
13379
  if (!longestAnimations.has(nativeElement)) {
13354
13380
  for (const klass of activeClasses) {
@@ -13362,9 +13388,9 @@ function runEnterAnimation(lView, tNode, value, ngZone) {
13362
13388
  }
13363
13389
  function enterAnimationEnd(event, nativeElement, renderer) {
13364
13390
  const elementData = enterClassMap.get(nativeElement);
13365
- if (event.target !== nativeElement || !elementData) return;
13391
+ if (getEventTarget(event) !== nativeElement || !elementData) return;
13366
13392
  if (isLongestAnimation(event, nativeElement)) {
13367
- event.stopImmediatePropagation();
13393
+ event.stopPropagation();
13368
13394
  for (const klass of elementData.classList) {
13369
13395
  renderer.removeClass(nativeElement, klass);
13370
13396
  }
@@ -13436,11 +13462,16 @@ function runLeaveAnimations(lView, tNode, value, ngZone) {
13436
13462
  function animateLeaveClassRunner(el, tNode, lView, classList, renderer, ngZone) {
13437
13463
  cancelAnimationsIfRunning(el, renderer);
13438
13464
  const cleanupFns = [];
13439
- const resolvers = getLViewLeaveAnimations(lView).get(tNode.index)?.resolvers;
13465
+ const componentResolvers = getLViewLeaveAnimations(lView).get(tNode.index)?.resolvers;
13466
+ let fallbackTimeoutId;
13467
+ let hasCompleted = false;
13440
13468
  const handleOutAnimationEnd = event => {
13441
- if (event.target !== el) return;
13442
- if (event instanceof CustomEvent || isLongestAnimation(event, el)) {
13443
- event.stopImmediatePropagation();
13469
+ const target = getEventTarget(event);
13470
+ if (target !== el && event.type !== 'animation-fallback') return;
13471
+ if (event.type === 'animation-fallback' || isLongestAnimation(event, el)) {
13472
+ hasCompleted = true;
13473
+ if (fallbackTimeoutId) clearTimeout(fallbackTimeoutId);
13474
+ if (event.type !== 'animation-fallback') event.stopPropagation();
13444
13475
  longestAnimations.delete(el);
13445
13476
  clearLeavingNodes(tNode, el);
13446
13477
  if (Array.isArray(tNode.projection)) {
@@ -13448,7 +13479,7 @@ function animateLeaveClassRunner(el, tNode, lView, classList, renderer, ngZone)
13448
13479
  renderer.removeClass(el, item);
13449
13480
  }
13450
13481
  }
13451
- cleanupAfterLeaveAnimations(resolvers, cleanupFns);
13482
+ cleanupAfterLeaveAnimations(componentResolvers, cleanupFns);
13452
13483
  clearLViewNodeAnimationResolvers(lView, tNode);
13453
13484
  }
13454
13485
  };
@@ -13462,11 +13493,18 @@ function animateLeaveClassRunner(el, tNode, lView, classList, renderer, ngZone)
13462
13493
  }
13463
13494
  ngZone.runOutsideAngular(() => {
13464
13495
  requestAnimationFrame(() => {
13496
+ if (hasCompleted) return;
13465
13497
  determineLongestAnimation(el, longestAnimations, areAnimationSupported);
13466
- if (!longestAnimations.has(el)) {
13498
+ const longest = longestAnimations.get(el);
13499
+ if (!longest) {
13467
13500
  clearLeavingNodes(tNode, el);
13468
- cleanupAfterLeaveAnimations(resolvers, cleanupFns);
13501
+ cleanupAfterLeaveAnimations(componentResolvers, cleanupFns);
13469
13502
  clearLViewNodeAnimationResolvers(lView, tNode);
13503
+ } else {
13504
+ fallbackTimeoutId = setTimeout(() => {
13505
+ handleOutAnimationEnd(new CustomEvent('animation-fallback'));
13506
+ }, longest.duration + 50);
13507
+ cleanupFns.push(() => clearTimeout(fallbackTimeoutId));
13470
13508
  }
13471
13509
  });
13472
13510
  });
@@ -15210,8 +15248,19 @@ function walkIcuTree(ast, tView, tIcu, lView, sharedUpdateOpCodes, create, remov
15210
15248
  } else {
15211
15249
  ngDevMode && console.warn(`WARNING: ignoring unsafe attribute value ` + `${lowerAttrName} on element ${tagName} ` + `(see ${XSS_SECURITY_URL})`);
15212
15250
  }
15251
+ } else if (VALID_ATTRS[lowerAttrName]) {
15252
+ if (URI_ATTRS[lowerAttrName]) {
15253
+ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
15254
+ console.warn(`WARNING: ignoring unsafe attribute ` + `${lowerAttrName} on element ${tagName} ` + `(see ${XSS_SECURITY_URL})`);
15255
+ }
15256
+ addCreateAttribute(create, newIndex, attr.name, 'unsafe:blocked');
15257
+ } else {
15258
+ addCreateAttribute(create, newIndex, attr.name, attr.value);
15259
+ }
15213
15260
  } else {
15214
- addCreateAttribute(create, newIndex, attr);
15261
+ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
15262
+ console.warn(`WARNING: ignoring unknown attribute name ` + `${lowerAttrName} on element ${tagName} ` + `(see ${XSS_SECURITY_URL})`);
15263
+ }
15215
15264
  }
15216
15265
  }
15217
15266
  const elementNode = {
@@ -15275,8 +15324,8 @@ function addCreateNodeAndAppend(create, marker, text, appendToParentIdx, createA
15275
15324
  }
15276
15325
  create.push(text, createAtIdx, icuCreateOpCode(0, appendToParentIdx, createAtIdx));
15277
15326
  }
15278
- function addCreateAttribute(create, newIndex, attr) {
15279
- create.push(newIndex << 1 | 1, attr.name, attr.value);
15327
+ function addCreateAttribute(create, newIndex, attrName, attrValue) {
15328
+ create.push(newIndex << 1 | 1, attrName, attrValue);
15280
15329
  }
15281
15330
 
15282
15331
  const ROOT_TEMPLATE_ID = 0;