@angular/compiler 20.2.0-rc.1 → 21.0.0-next.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.1
2
+ * @license Angular v21.0.0-next.0
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -421,6 +421,7 @@ 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";
424
425
  })(ViewEncapsulation$1 || (ViewEncapsulation$1 = {}));
425
426
  var ChangeDetectionStrategy;
426
427
  (function (ChangeDetectionStrategy) {
@@ -529,6 +530,7 @@ var ViewEncapsulation;
529
530
  // Historically the 1 value was for `Native` encapsulation which has been removed as of v11.
530
531
  ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None";
531
532
  ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom";
533
+ ViewEncapsulation[ViewEncapsulation["IsolatedShadowDom"] = 4] = "IsolatedShadowDom";
532
534
  })(ViewEncapsulation || (ViewEncapsulation = {}));
533
535
 
534
536
  /**
@@ -23224,6 +23226,11 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
23224
23226
  subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex);
23225
23227
  }
23226
23228
  break;
23229
+ case OpKind.Projection:
23230
+ if (op.fallbackView !== null) {
23231
+ subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.fallbackView), i18nBlock, op.fallbackViewI18nPlaceholder, subTemplateIndex);
23232
+ }
23233
+ break;
23227
23234
  }
23228
23235
  }
23229
23236
  return subTemplateIndex;
@@ -24807,6 +24814,21 @@ function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingSt
24807
24814
  // Clear out the pending structural directive now that its been accounted for.
24808
24815
  pendingStructuralDirective = undefined;
24809
24816
  }
24817
+ if (op.fallbackView !== null) {
24818
+ const view = job.views.get(op.fallbackView);
24819
+ if (op.fallbackViewI18nPlaceholder === undefined) {
24820
+ resolvePlaceholdersForView(job, view, i18nContexts, elements);
24821
+ }
24822
+ else {
24823
+ if (currentOps === null) {
24824
+ throw Error('i18n tag placeholder should only occur inside an i18n block');
24825
+ }
24826
+ recordTemplateStart(job, view, op.handle.slot, op.fallbackViewI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
24827
+ resolvePlaceholdersForView(job, view, i18nContexts, elements);
24828
+ recordTemplateClose(job, view, op.handle.slot, op.fallbackViewI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
24829
+ pendingStructuralDirective = undefined;
24830
+ }
24831
+ }
24810
24832
  break;
24811
24833
  case OpKind.ConditionalCreate:
24812
24834
  case OpKind.ConditionalBranchCreate:
@@ -26656,10 +26678,16 @@ function ingestHostAttribute(job, name, value, securityContexts) {
26656
26678
  job.root.update.push(attrBinding);
26657
26679
  }
26658
26680
  function ingestHostEvent(job, event) {
26659
- const [phase, target] = event.type !== ParsedEventType.LegacyAnimation
26660
- ? [null, event.targetOrPhase]
26661
- : [event.targetOrPhase, null];
26662
- const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan);
26681
+ let eventBinding;
26682
+ if (event.type === ParsedEventType.Animation) {
26683
+ 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);
26684
+ }
26685
+ else {
26686
+ const [phase, target] = event.type !== ParsedEventType.LegacyAnimation
26687
+ ? [null, event.targetOrPhase]
26688
+ : [event.targetOrPhase, null];
26689
+ eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan);
26690
+ }
26663
26691
  job.root.create.push(eventBinding);
26664
26692
  }
26665
26693
  /**
@@ -29720,11 +29748,11 @@ class HtmlAstToIvyAst {
29720
29748
  const templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length);
29721
29749
  const parsedVariables = [];
29722
29750
  const absoluteValueOffset = attribute.valueSpan
29723
- ? attribute.valueSpan.start.offset
29751
+ ? attribute.valueSpan.fullStart.offset
29724
29752
  : // If there is no value span the attribute does not have a value, like `attr` in
29725
29753
  //`<div attr></div>`. In this case, point to one character beyond the last character of
29726
29754
  // the attribute name.
29727
- attribute.sourceSpan.start.offset + attribute.name.length;
29755
+ attribute.sourceSpan.fullStart.offset + attribute.name.length;
29728
29756
  this.bindingParser.parseInlineTemplateBinding(templateKey, templateValue, attribute.sourceSpan, absoluteValueOffset, [], templateParsedProperties, parsedVariables, true /* isIvyAst */);
29729
29757
  templateVariables.push(...parsedVariables.map((v) => new Variable(v.name, v.value, v.sourceSpan, v.keySpan, v.valueSpan)));
29730
29758
  }
@@ -34274,7 +34302,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
34274
34302
  function compileDeclareClassMetadata(metadata) {
34275
34303
  const definitionMap = new DefinitionMap();
34276
34304
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
34277
- definitionMap.set('version', literal('20.2.0-rc.1'));
34305
+ definitionMap.set('version', literal('21.0.0-next.0'));
34278
34306
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34279
34307
  definitionMap.set('type', metadata.type);
34280
34308
  definitionMap.set('decorators', metadata.decorators);
@@ -34292,7 +34320,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
34292
34320
  callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
34293
34321
  callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
34294
34322
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
34295
- definitionMap.set('version', literal('20.2.0-rc.1'));
34323
+ definitionMap.set('version', literal('21.0.0-next.0'));
34296
34324
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34297
34325
  definitionMap.set('type', metadata.type);
34298
34326
  definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
@@ -34387,7 +34415,7 @@ function createDirectiveDefinitionMap(meta) {
34387
34415
  const definitionMap = new DefinitionMap();
34388
34416
  const minVersion = getMinimumVersionForPartialOutput(meta);
34389
34417
  definitionMap.set('minVersion', literal(minVersion));
34390
- definitionMap.set('version', literal('20.2.0-rc.1'));
34418
+ definitionMap.set('version', literal('21.0.0-next.0'));
34391
34419
  // e.g. `type: MyDirective`
34392
34420
  definitionMap.set('type', meta.type.value);
34393
34421
  if (meta.isStandalone !== undefined) {
@@ -34803,7 +34831,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
34803
34831
  function compileDeclareFactoryFunction(meta) {
34804
34832
  const definitionMap = new DefinitionMap();
34805
34833
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
34806
- definitionMap.set('version', literal('20.2.0-rc.1'));
34834
+ definitionMap.set('version', literal('21.0.0-next.0'));
34807
34835
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34808
34836
  definitionMap.set('type', meta.type.value);
34809
34837
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -34838,7 +34866,7 @@ function compileDeclareInjectableFromMetadata(meta) {
34838
34866
  function createInjectableDefinitionMap(meta) {
34839
34867
  const definitionMap = new DefinitionMap();
34840
34868
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
34841
- definitionMap.set('version', literal('20.2.0-rc.1'));
34869
+ definitionMap.set('version', literal('21.0.0-next.0'));
34842
34870
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34843
34871
  definitionMap.set('type', meta.type.value);
34844
34872
  // Only generate providedIn property if it has a non-null value
@@ -34889,7 +34917,7 @@ function compileDeclareInjectorFromMetadata(meta) {
34889
34917
  function createInjectorDefinitionMap(meta) {
34890
34918
  const definitionMap = new DefinitionMap();
34891
34919
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
34892
- definitionMap.set('version', literal('20.2.0-rc.1'));
34920
+ definitionMap.set('version', literal('21.0.0-next.0'));
34893
34921
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34894
34922
  definitionMap.set('type', meta.type.value);
34895
34923
  definitionMap.set('providers', meta.providers);
@@ -34922,7 +34950,7 @@ function createNgModuleDefinitionMap(meta) {
34922
34950
  throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
34923
34951
  }
34924
34952
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
34925
- definitionMap.set('version', literal('20.2.0-rc.1'));
34953
+ definitionMap.set('version', literal('21.0.0-next.0'));
34926
34954
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34927
34955
  definitionMap.set('type', meta.type.value);
34928
34956
  // We only generate the keys in the metadata if the arrays contain values.
@@ -34973,7 +35001,7 @@ function compileDeclarePipeFromMetadata(meta) {
34973
35001
  function createPipeDefinitionMap(meta) {
34974
35002
  const definitionMap = new DefinitionMap();
34975
35003
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
34976
- definitionMap.set('version', literal('20.2.0-rc.1'));
35004
+ definitionMap.set('version', literal('21.0.0-next.0'));
34977
35005
  definitionMap.set('ngImport', importExpr(Identifiers.core));
34978
35006
  // e.g. `type: MyPipe`
34979
35007
  definitionMap.set('type', meta.type.value);
@@ -35129,7 +35157,7 @@ function compileHmrUpdateCallback(definitions, constantStatements, meta) {
35129
35157
  * @description
35130
35158
  * Entry point for all public APIs of the compiler package.
35131
35159
  */
35132
- const VERSION = new Version('20.2.0-rc.1');
35160
+ const VERSION = new Version('21.0.0-next.0');
35133
35161
 
35134
35162
  //////////////////////////////////////
35135
35163
  // THIS FILE HAS GLOBAL SIDE EFFECT //