@angular/core 18.1.4 → 18.1.5

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 (34) hide show
  1. package/esm2022/primitives/event-dispatch/src/event_dispatcher.mjs +5 -1
  2. package/esm2022/src/event_delegation_utils.mjs +19 -7
  3. package/esm2022/src/event_dispatch/event_delegation.mjs +9 -2
  4. package/esm2022/src/hydration/annotate.mjs +1 -1
  5. package/esm2022/src/hydration/cleanup.mjs +8 -4
  6. package/esm2022/src/hydration/i18n.mjs +13 -5
  7. package/esm2022/src/hydration/skip_hydration.mjs +11 -1
  8. package/esm2022/src/linker/view_container_ref.mjs +1 -1
  9. package/esm2022/src/render3/component_ref.mjs +1 -1
  10. package/esm2022/src/render3/i18n/i18n_parse.mjs +2 -1
  11. package/esm2022/src/render3/instructions/element_container.mjs +6 -3
  12. package/esm2022/src/render3/interfaces/i18n.mjs +1 -1
  13. package/esm2022/src/version.mjs +1 -1
  14. package/esm2022/testing/src/application_error_handler.mjs +3 -3
  15. package/esm2022/testing/src/logger.mjs +3 -3
  16. package/fesm2022/core.mjs +61 -17
  17. package/fesm2022/core.mjs.map +1 -1
  18. package/fesm2022/primitives/event-dispatch.mjs +5 -1
  19. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  20. package/fesm2022/primitives/signals.mjs +1 -1
  21. package/fesm2022/rxjs-interop.mjs +1 -1
  22. package/fesm2022/testing.mjs +4 -4
  23. package/index.d.ts +9 -3
  24. package/package.json +1 -1
  25. package/primitives/event-dispatch/index.d.ts +1 -1
  26. package/primitives/signals/index.d.ts +1 -1
  27. package/rxjs-interop/index.d.ts +1 -1
  28. package/schematics/migrations/invalid-two-way-bindings/bundle.js +1 -1
  29. package/schematics/migrations/invalid-two-way-bindings/bundle.js.map +1 -1
  30. package/schematics/ng-generate/control-flow-migration/bundle.js +1 -1
  31. package/schematics/ng-generate/control-flow-migration/bundle.js.map +1 -1
  32. package/schematics/ng-generate/standalone-migration/bundle.js +18 -18
  33. package/schematics/ng-generate/standalone-migration/bundle.js.map +2 -2
  34. package/testing/index.d.ts +1 -1
@@ -25,10 +25,10 @@ export class Log {
25
25
  result() {
26
26
  return this.logItems.join('; ');
27
27
  }
28
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: Log, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
29
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: Log }); }
28
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: Log, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
29
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: Log }); }
30
30
  }
31
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.4", ngImport: i0, type: Log, decorators: [{
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.5", ngImport: i0, type: Log, decorators: [{
32
32
  type: Injectable
33
33
  }], ctorParameters: () => [] });
34
34
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29yZS90ZXN0aW5nL3NyYy9sb2dnZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLFVBQVUsRUFBQyxNQUFNLGVBQWUsQ0FBQzs7QUFHekMsTUFBTSxPQUFPLEdBQUc7SUFHZDtRQUNFLElBQUksQ0FBQyxRQUFRLEdBQUcsRUFBRSxDQUFDO0lBQ3JCLENBQUM7SUFFRCxHQUFHLENBQUMsS0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5wdXNoKHZhbHVlKTtcbiAgfVxuXG4gIGZuKHZhbHVlOiBUKSB7XG4gICAgcmV0dXJuICgpID0+IHtcbiAgICAgIHRoaXMubG9nSXRlbXMucHVzaCh2YWx1ZSk7XG4gICAgfTtcbiAgfVxuXG4gIGNsZWFyKCk6IHZvaWQge1xuICAgIHRoaXMubG9nSXRlbXMgPSBbXTtcbiAgfVxuXG4gIHJlc3VsdCgpOiBzdHJpbmcge1xuICAgIHJldHVybiB0aGlzLmxvZ0l0ZW1zLmpvaW4oJzsgJyk7XG4gIH1cbn1cbiJdfQ==
package/fesm2022/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.1.4
2
+ * @license Angular v18.1.5
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -7855,6 +7855,16 @@ function isInSkipHydrationBlock(tNode) {
7855
7855
  }
7856
7856
  return false;
7857
7857
  }
7858
+ /**
7859
+ * Check if an i18n block is in a skip hydration section by looking at a parent TNode
7860
+ * to determine if this TNode is in a skip hydration section or the TNode has
7861
+ * the `ngSkipHydration` attribute.
7862
+ */
7863
+ function isI18nInSkipHydrationBlock(parentTNode) {
7864
+ return (hasInSkipHydrationBlockFlag(parentTNode) ||
7865
+ hasSkipHydrationAttrOnTNode(parentTNode) ||
7866
+ isInSkipHydrationBlock(parentTNode));
7867
+ }
7858
7868
 
7859
7869
  // Keeps track of the currently-active LViews.
7860
7870
  const TRACKED_LVIEWS = new Map();
@@ -15568,6 +15578,10 @@ function trySerializeI18nBlock(lView, index, context) {
15568
15578
  if (!tI18n || !tI18n.ast) {
15569
15579
  return null;
15570
15580
  }
15581
+ const parentTNode = tView.data[tI18n.parentTNodeIndex];
15582
+ if (parentTNode && isI18nInSkipHydrationBlock(parentTNode)) {
15583
+ return null;
15584
+ }
15571
15585
  const serializedI18nBlock = {
15572
15586
  caseQueue: [],
15573
15587
  disconnectedNodes: new Set(),
@@ -15716,13 +15730,16 @@ function forkHydrationState(state, nextNode) {
15716
15730
  return { currentNode: nextNode, isConnected: state.isConnected };
15717
15731
  }
15718
15732
  function prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex) {
15719
- if (!isI18nHydrationSupportEnabled()) {
15720
- return;
15721
- }
15722
15733
  const hydrationInfo = lView[HYDRATION];
15723
15734
  if (!hydrationInfo) {
15724
15735
  return;
15725
15736
  }
15737
+ if (!isI18nHydrationSupportEnabled() ||
15738
+ (parentTNode &&
15739
+ (isI18nInSkipHydrationBlock(parentTNode) ||
15740
+ isDisconnectedNode$1(hydrationInfo, parentTNode.index - HEADER_OFFSET)))) {
15741
+ return;
15742
+ }
15726
15743
  const tView = lView[TVIEW];
15727
15744
  const tI18n = tView.data[index];
15728
15745
  ngDevMode &&
@@ -15955,6 +15972,13 @@ function removeDehydratedView(dehydratedView, renderer) {
15955
15972
  */
15956
15973
  function cleanupLContainer(lContainer) {
15957
15974
  removeDehydratedViews(lContainer);
15975
+ // The host could be an LView if this container is on a component node.
15976
+ // In this case, descend into host LView for further cleanup. See also
15977
+ // LContainer[HOST] docs for additional information.
15978
+ const hostLView = lContainer[HOST];
15979
+ if (isLView(hostLView)) {
15980
+ cleanupLView(hostLView);
15981
+ }
15958
15982
  for (let i = CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) {
15959
15983
  cleanupLView(lContainer[i]);
15960
15984
  }
@@ -15992,9 +16016,6 @@ function cleanupDehydratedViews(appRef) {
15992
16016
  cleanupLView(lNode);
15993
16017
  }
15994
16018
  else {
15995
- // Cleanup in the root component view
15996
- const componentLView = lNode[HOST];
15997
- cleanupLView(componentLView);
15998
16019
  // Cleanup in all views within this view container
15999
16020
  cleanupLContainer(lNode);
16000
16021
  }
@@ -17207,7 +17228,7 @@ function createRootComponent(componentView, rootComponentDef, rootDirectives, ho
17207
17228
  function setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {
17208
17229
  if (rootSelectorOrNode) {
17209
17230
  // The placeholder will be replaced with the actual version at build time.
17210
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', '18.1.4']);
17231
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', '18.1.5']);
17211
17232
  }
17212
17233
  else {
17213
17234
  // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
@@ -24541,7 +24562,10 @@ let _locateOrCreateElementContainerNode = (tView, lView, tNode, index) => {
24541
24562
  function locateOrCreateElementContainerNode(tView, lView, tNode, index) {
24542
24563
  let comment;
24543
24564
  const hydrationInfo = lView[HYDRATION];
24544
- const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock$1() || isDetachedByI18n(tNode);
24565
+ const isNodeCreationMode = !hydrationInfo ||
24566
+ isInSkipHydrationBlock$1() ||
24567
+ isDisconnectedNode$1(hydrationInfo, index) ||
24568
+ isDetachedByI18n(tNode);
24545
24569
  lastNodeWasCreated(isNodeCreationMode);
24546
24570
  // Regular creation mode.
24547
24571
  if (isNodeCreationMode) {
@@ -25641,6 +25665,7 @@ function i18nStartFirstCreatePass(tView, parentTNodeIndex, lView, index, message
25641
25665
  create: createOpCodes,
25642
25666
  update: updateOpCodes,
25643
25667
  ast: astStack[0],
25668
+ parentTNodeIndex,
25644
25669
  };
25645
25670
  }
25646
25671
  /**
@@ -31003,7 +31028,7 @@ class Version {
31003
31028
  /**
31004
31029
  * @publicApi
31005
31030
  */
31006
- const VERSION = new Version('18.1.4');
31031
+ const VERSION = new Version('18.1.5');
31007
31032
 
31008
31033
  /*
31009
31034
  * This file exists to support compilation of @angular/core in Ivy mode.
@@ -36816,14 +36841,26 @@ class GlobalEventDelegation {
36816
36841
  supports(eventType) {
36817
36842
  return isEarlyEventType(eventType);
36818
36843
  }
36819
- addEventListener(element, eventName, handler) {
36820
- this.eventContractDetails.instance.addEvent(eventName);
36821
- sharedStashFunction(element, eventName, handler);
36822
- getActionCache(element)[eventName] = '';
36823
- return () => this.removeEventListener(element, eventName, handler);
36844
+ addEventListener(element, eventType, handler) {
36845
+ // Note: contrary to the type, Window and Document can be passed in
36846
+ // as well.
36847
+ if (element.nodeType === Node.ELEMENT_NODE) {
36848
+ this.eventContractDetails.instance.addEvent(eventType);
36849
+ getActionCache(element)[eventType] = '';
36850
+ sharedStashFunction(element, eventType, handler);
36851
+ }
36852
+ else {
36853
+ element.addEventListener(eventType, handler);
36854
+ }
36855
+ return () => this.removeEventListener(element, eventType, handler);
36824
36856
  }
36825
36857
  removeEventListener(element, eventType, callback) {
36826
- getActionCache(element)[eventType] = undefined;
36858
+ if (element.nodeType === Node.ELEMENT_NODE) {
36859
+ getActionCache(element)[eventType] = undefined;
36860
+ }
36861
+ else {
36862
+ element.removeEventListener(eventType, callback);
36863
+ }
36827
36864
  }
36828
36865
  static { this.ɵfac = function GlobalEventDelegation_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || GlobalEventDelegation)(); }; }
36829
36866
  static { this.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: GlobalEventDelegation, factory: GlobalEventDelegation.ɵfac }); }
@@ -37757,8 +37794,10 @@ function verifySsrContentsIntegrity() {
37757
37794
 
37758
37795
  /**
37759
37796
  * Returns a set of providers required to setup support for event delegation.
37797
+ * @param multiContract - Experimental support to provide one event contract
37798
+ * when there are multiple binaries on the page.
37760
37799
  */
37761
- function provideGlobalEventDelegation() {
37800
+ function provideGlobalEventDelegation(multiContract = false) {
37762
37801
  return [
37763
37802
  {
37764
37803
  provide: IS_GLOBAL_EVENT_DELEGATION_ENABLED,
@@ -37769,7 +37808,12 @@ function provideGlobalEventDelegation() {
37769
37808
  useValue: () => {
37770
37809
  const injector = inject(Injector);
37771
37810
  const eventContractDetails = injector.get(JSACTION_EVENT_CONTRACT);
37811
+ if (multiContract && window.__jsaction_contract) {
37812
+ eventContractDetails.instance = window.__jsaction_contract;
37813
+ return;
37814
+ }
37772
37815
  initGlobalEventDelegation(eventContractDetails, injector);
37816
+ window.__jsaction_contract = eventContractDetails.instance;
37773
37817
  },
37774
37818
  multi: true,
37775
37819
  },