@angular/compiler 20.2.0-rc.0 → 20.2.0

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.2.0-rc.0
2
+ * @license Angular v20.2.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -421,7 +421,6 @@ var ViewEncapsulation$1;
421
421
  // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
422
422
  ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
423
423
  ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
424
- ViewEncapsulation[ViewEncapsulation["IsolatedShadowDom"] = 4] = "IsolatedShadowDom";
425
424
  })(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
426
425
  var ChangeDetectionStrategy;
427
426
  (function (ChangeDetectionStrategy) {
@@ -530,7 +529,6 @@ var ViewEncapsulation;
530
529
  // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
531
530
  ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
532
531
  ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
533
- ViewEncapsulation[ViewEncapsulation["IsolatedShadowDom"] = 4] = "IsolatedShadowDom";
534
532
  })(ViewEncapsulation || (ViewEncapsulation = {}));
535
533
 
536
534
  /**
@@ -23226,6 +23224,11 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
23226
23224
  subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex);
23227
23225
  }
23228
23226
  break;
23227
+ case OpKind.Projection:
23228
+ if (op.fallbackView !== null) {
23229
+ subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.fallbackView), i18nBlock, op.fallbackViewI18nPlaceholder, subTemplateIndex);
23230
+ }
23231
+ break;
23229
23232
  }
23230
23233
  }
23231
23234
  return subTemplateIndex;
@@ -24809,6 +24812,21 @@ function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingSt
24809
24812
  // Clear out the pending structural directive now that its been accounted for.
24810
24813
  pendingStructuralDirective = undefined;
24811
24814
  }
24815
+ if (op.fallbackView !== null) {
24816
+ const view = job.views.get(op.fallbackView);
24817
+ if (op.fallbackViewI18nPlaceholder === undefined) {
24818
+ resolvePlaceholdersForView(job, view, i18nContexts, elements);
24819
+ }
24820
+ else {
24821
+ if (currentOps === null) {
24822
+ throw Error('i18n tag placeholder should only occur inside an i18n block');
24823
+ }
24824
+ recordTemplateStart(job, view, op.handle.slot, op.fallbackViewI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
24825
+ resolvePlaceholdersForView(job, view, i18nContexts, elements);
24826
+ recordTemplateClose(job, view, op.handle.slot, op.fallbackViewI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
24827
+ pendingStructuralDirective = undefined;
24828
+ }
24829
+ }
24812
24830
  break;
24813
24831
  case OpKind.ConditionalCreate:
24814
24832
  case OpKind.ConditionalBranchCreate:
@@ -26658,10 +26676,16 @@ function ingestHostAttribute(job, name, value, securityContexts) {
26658
26676
  job.root.update.push(attrBinding);
26659
26677
  }
26660
26678
  function ingestHostEvent(job, event) {
26661
- const [phase, target] = event.type !== ParsedEventType.LegacyAnimation
26662
- ? [null, event.targetOrPhase]
26663
- : [event.targetOrPhase, null];
26664
- const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan);
26679
+ let eventBinding;
26680
+ if (event.type === ParsedEventType.Animation) {
26681
+ eventBinding = createAnimationListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), event.name.endsWith('enter') ? "enter" /* ir.AnimationKind.ENTER */ : "leave" /* ir.AnimationKind.LEAVE */, event.targetOrPhase, true, event.sourceSpan);
26682
+ }
26683
+ else {
26684
+ const [phase, target] = event.type !== ParsedEventType.LegacyAnimation
26685
+ ? [null, event.targetOrPhase]
26686
+ : [event.targetOrPhase, null];
26687
+ eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan);
26688
+ }
26665
26689
  job.root.create.push(eventBinding);
26666
26690
  }
26667
26691
  /**
@@ -29722,11 +29746,11 @@ class HtmlAstToIvyAst {
29722
29746
  const templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length);
29723
29747
  const parsedVariables = [];
29724
29748
  const absoluteValueOffset = attribute.valueSpan
29725
- ? attribute.valueSpan.start.offset
29749
+ ? attribute.valueSpan.fullStart.offset
29726
29750
  : // If there is no value span the attribute does not have a value, like `attr` in
29727
29751
  //`<div attr></div>`. In this case, point to one character beyond the last character of
29728
29752
  // the attribute name.
29729
- attribute.sourceSpan.start.offset + attribute.name.length;
29753
+ attribute.sourceSpan.fullStart.offset + attribute.name.length;
29730
29754
  this.bindingParser.parseInlineTemplateBinding(templateKey, templateValue, attribute.sourceSpan, absoluteValueOffset, [], templateParsedProperties, parsedVariables, true /* isIvyAst */);
29731
29755
  templateVariables.push(...parsedVariables.map((v) => new Variable(v.name, v.value, v.sourceSpan, v.keySpan, v.valueSpan)));
29732
29756
  }
@@ -29756,8 +29780,8 @@ class HtmlAstToIvyAst {
29756
29780
  const value = attribute.value;
29757
29781
  const srcSpan = attribute.sourceSpan;
29758
29782
  const absoluteOffset = attribute.valueSpan
29759
- ? attribute.valueSpan.start.offset
29760
- : srcSpan.start.offset;
29783
+ ? attribute.valueSpan.fullStart.offset
29784
+ : srcSpan.fullStart.offset;
29761
29785
  function createKeySpan(srcSpan, prefix, identifier) {
29762
29786
  // We need to adjust the start location for the keySpan to account for the removed 'data-'
29763
29787
  // prefix from `normalizeAttributeName`.
@@ -34276,7 +34300,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
34276
34300
  function compileDeclareClassMetadata(metadata) {
34277
34301
  const definitionMap = new DefinitionMap();
34278
34302
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
34279
- definitionMap.set('version', literal('20.2.0-rc.0'));
34303
+ definitionMap.set('version', literal('20.2.0'));
34280
34304
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34281
34305
  definitionMap.set('type', metadata.type);
34282
34306
  definitionMap.set('decorators', metadata.decorators);
@@ -34294,7 +34318,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
34294
34318
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
34295
34319
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
34296
34320
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
34297
- definitionMap.set('version', literal('20.2.0-rc.0'));
34321
+ definitionMap.set('version', literal('20.2.0'));
34298
34322
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34299
34323
  definitionMap.set('type', metadata.type);
34300
34324
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -34389,7 +34413,7 @@ function createDirectiveDefinitionMap(meta) {
34389
34413
  const definitionMap = new DefinitionMap();
34390
34414
  const minVersion = getMinimumVersionForPartialOutput(meta);
34391
34415
  definitionMap.set('minVersion', literal(minVersion));
34392
- definitionMap.set('version', literal('20.2.0-rc.0'));
34416
+ definitionMap.set('version', literal('20.2.0'));
34393
34417
  // e.g. `type: MyDirective`
34394
34418
  definitionMap.set('type', meta.type.value);
34395
34419
  if (meta.isStandalone !== undefined) {
@@ -34805,7 +34829,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
34805
34829
  function compileDeclareFactoryFunction(meta) {
34806
34830
  const definitionMap = new DefinitionMap();
34807
34831
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
34808
- definitionMap.set('version', literal('20.2.0-rc.0'));
34832
+ definitionMap.set('version', literal('20.2.0'));
34809
34833
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34810
34834
  definitionMap.set('type', meta.type.value);
34811
34835
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -34840,7 +34864,7 @@ function compileDeclareInjectableFromMetadata(meta) {
34840
34864
  function createInjectableDefinitionMap(meta) {
34841
34865
  const definitionMap = new DefinitionMap();
34842
34866
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
34843
- definitionMap.set('version', literal('20.2.0-rc.0'));
34867
+ definitionMap.set('version', literal('20.2.0'));
34844
34868
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34845
34869
  definitionMap.set('type', meta.type.value);
34846
34870
  // Only generate providedIn property if it has a non-null value
@@ -34891,7 +34915,7 @@ function compileDeclareInjectorFromMetadata(meta) {
34891
34915
  function createInjectorDefinitionMap(meta) {
34892
34916
  const definitionMap = new DefinitionMap();
34893
34917
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
34894
- definitionMap.set('version', literal('20.2.0-rc.0'));
34918
+ definitionMap.set('version', literal('20.2.0'));
34895
34919
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34896
34920
  definitionMap.set('type', meta.type.value);
34897
34921
  definitionMap.set('providers', meta.providers);
@@ -34924,7 +34948,7 @@ function createNgModuleDefinitionMap(meta) {
34924
34948
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
34925
34949
  }
34926
34950
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
34927
- definitionMap.set('version', literal('20.2.0-rc.0'));
34951
+ definitionMap.set('version', literal('20.2.0'));
34928
34952
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34929
34953
  definitionMap.set('type', meta.type.value);
34930
34954
  // We only generate the keys in the metadata if the arrays contain values.
@@ -34975,7 +34999,7 @@ function compileDeclarePipeFromMetadata(meta) {
34975
34999
  function createPipeDefinitionMap(meta) {
34976
35000
  const definitionMap = new DefinitionMap();
34977
35001
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
34978
- definitionMap.set('version', literal('20.2.0-rc.0'));
35002
+ definitionMap.set('version', literal('20.2.0'));
34979
35003
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34980
35004
  // e.g. `type: MyPipe`
34981
35005
  definitionMap.set('type', meta.type.value);
@@ -35131,7 +35155,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
35131
35155
  * @description
35132
35156
  * Entry point for all public APIs of the compiler package.
35133
35157
  */
35134
- const VERSION = new Version('20.2.0-rc.0');
35158
+ const VERSION = new Version('20.2.0');
35135
35159
 
35136
35160
  //////////////////////////////////////
35137
35161
  // THIS FILE HAS GLOBAL SIDE EFFECT //