@angular/compiler-cli 20.0.0 → 20.0.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.
@@ -106,6 +106,8 @@ var ErrorCode;
106
106
  ErrorCode2[ErrorCode2["LET_USED_BEFORE_DEFINITION"] = 8016] = "LET_USED_BEFORE_DEFINITION";
107
107
  ErrorCode2[ErrorCode2["CONFLICTING_LET_DECLARATION"] = 8017] = "CONFLICTING_LET_DECLARATION";
108
108
  ErrorCode2[ErrorCode2["UNCLAIMED_DIRECTIVE_BINDING"] = 8018] = "UNCLAIMED_DIRECTIVE_BINDING";
109
+ ErrorCode2[ErrorCode2["DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER"] = 8019] = "DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER";
110
+ ErrorCode2[ErrorCode2["DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER"] = 8020] = "DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER";
109
111
  ErrorCode2[ErrorCode2["INVALID_BANANA_IN_BOX"] = 8101] = "INVALID_BANANA_IN_BOX";
110
112
  ErrorCode2[ErrorCode2["NULLISH_COALESCING_NOT_NULLABLE"] = 8102] = "NULLISH_COALESCING_NOT_NULLABLE";
111
113
  ErrorCode2[ErrorCode2["MISSING_CONTROL_FLOW_DIRECTIVE"] = 8103] = "MISSING_CONTROL_FLOW_DIRECTIVE";
@@ -11484,6 +11486,12 @@ Deferred blocks can only access triggers in same view, a parent embedded view or
11484
11486
  const errorMsg = `Directive ${directive.name} does not have an ${node instanceof TmplAstBoundEvent2 ? "output" : "input"} named "${node.name}". Bindings to directives must target existing inputs or outputs.`;
11485
11487
  this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), node.keySpan || node.sourceSpan, ts55.DiagnosticCategory.Error, ngErrorCode(ErrorCode.UNCLAIMED_DIRECTIVE_BINDING), errorMsg));
11486
11488
  }
11489
+ deferImplicitTriggerMissingPlaceholder(id, trigger) {
11490
+ this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts55.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER), "Trigger with no parameters can only be placed on an @defer that has a @placeholder block"));
11491
+ }
11492
+ deferImplicitTriggerInvalidPlaceholder(id, trigger) {
11493
+ this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts55.DiagnosticCategory.Error, ngErrorCode(ErrorCode.DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER), "Trigger with no parameters can only be placed on an @defer that has a @placeholder block with exactly one root element node"));
11494
+ }
11487
11495
  };
11488
11496
  function makeInlineDiagnostic(id, code, node, messageText, relatedInformation) {
11489
11497
  return {
@@ -13527,16 +13535,38 @@ var _Scope = class {
13527
13535
  this.opQueue.push(new TcbExpressionOp(this.tcb, this, triggers.when.value));
13528
13536
  }
13529
13537
  if (triggers.hover !== void 0) {
13530
- this.appendReferenceBasedDeferredTrigger(block, triggers.hover);
13538
+ this.validateReferenceBasedDeferredTrigger(block, triggers.hover);
13531
13539
  }
13532
13540
  if (triggers.interaction !== void 0) {
13533
- this.appendReferenceBasedDeferredTrigger(block, triggers.interaction);
13541
+ this.validateReferenceBasedDeferredTrigger(block, triggers.interaction);
13534
13542
  }
13535
13543
  if (triggers.viewport !== void 0) {
13536
- this.appendReferenceBasedDeferredTrigger(block, triggers.viewport);
13544
+ this.validateReferenceBasedDeferredTrigger(block, triggers.viewport);
13537
13545
  }
13538
13546
  }
13539
- appendReferenceBasedDeferredTrigger(block, trigger) {
13547
+ validateReferenceBasedDeferredTrigger(block, trigger) {
13548
+ if (trigger.reference === null) {
13549
+ if (block.placeholder === null) {
13550
+ this.tcb.oobRecorder.deferImplicitTriggerMissingPlaceholder(this.tcb.id, trigger);
13551
+ return;
13552
+ }
13553
+ let rootNode = null;
13554
+ for (const child of block.placeholder.children) {
13555
+ if (!this.tcb.hostPreserveWhitespaces && child instanceof TmplAstText && child.value.trim().length === 0) {
13556
+ continue;
13557
+ }
13558
+ if (rootNode === null) {
13559
+ rootNode = child;
13560
+ } else {
13561
+ rootNode = null;
13562
+ break;
13563
+ }
13564
+ }
13565
+ if (rootNode === null || !(rootNode instanceof TmplAstElement2)) {
13566
+ this.tcb.oobRecorder.deferImplicitTriggerInvalidPlaceholder(this.tcb.id, trigger);
13567
+ }
13568
+ return;
13569
+ }
13540
13570
  if (this.tcb.boundTarget.getDeferredTriggerTarget(block, trigger) === null) {
13541
13571
  this.tcb.oobRecorder.inaccessibleDeferredTriggerElement(this.tcb.id, trigger);
13542
13572
  }
@@ -19157,4 +19187,4 @@ export {
19157
19187
  * Use of this source code is governed by an MIT-style license that can be
19158
19188
  * found in the LICENSE file at https://angular.dev/license
19159
19189
  */
19160
- //# sourceMappingURL=chunk-TSBVO2TY.js.map
19190
+ //# sourceMappingURL=chunk-3TXROOKD.js.map