@angular/core 21.0.0-next.7 → 21.0.0-next.9
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.
- package/fesm2022/_attribute-chunk.mjs +1 -1
- package/fesm2022/_attribute-chunk.mjs.map +1 -1
- package/fesm2022/_debug_node-chunk.mjs +722 -569
- package/fesm2022/_debug_node-chunk.mjs.map +1 -1
- package/fesm2022/_effect-chunk.mjs +512 -48
- package/fesm2022/_effect-chunk.mjs.map +1 -1
- package/fesm2022/{_root_effect_scheduler-chunk.mjs → _effect-chunk2.mjs} +202 -19
- package/fesm2022/_effect-chunk2.mjs.map +1 -0
- package/fesm2022/_not_found-chunk.mjs +1 -1
- package/fesm2022/_not_found-chunk.mjs.map +1 -1
- package/fesm2022/_resource-chunk.mjs +5 -173
- package/fesm2022/_resource-chunk.mjs.map +1 -1
- package/fesm2022/_untracked-chunk.mjs +117 -0
- package/fesm2022/_untracked-chunk.mjs.map +1 -0
- package/fesm2022/_weak_ref-chunk.mjs +1 -1
- package/fesm2022/_weak_ref-chunk.mjs.map +1 -1
- package/fesm2022/core.mjs +15 -18
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives-di.mjs +1 -1
- package/fesm2022/primitives-di.mjs.map +1 -1
- package/fesm2022/primitives-event-dispatch.mjs +1 -1
- package/fesm2022/primitives-event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives-signals.mjs +4 -4
- package/fesm2022/primitives-signals.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +5 -5
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +3 -3
- package/fesm2022/testing.mjs.map +1 -1
- package/package.json +2 -2
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +5 -5
- package/schematics/bundles/application-config-core.cjs +5 -5
- package/schematics/bundles/{apply_import_manager-D_4NSuRa.cjs → apply_import_manager-CoeTX_Ob.cjs} +3 -3
- package/schematics/bundles/bootstrap-options-migration.cjs +5 -5
- package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
- package/schematics/bundles/common-to-standalone-migration.cjs +385 -0
- package/schematics/bundles/{compiler_host-C1KRWoxv.cjs → compiler_host-emLDwK2U.cjs} +2 -2
- package/schematics/bundles/control-flow-migration.cjs +4 -4
- package/schematics/bundles/imports-DwPXlGFl.cjs +1 -1
- package/schematics/bundles/{index-DYqR8Lpq.cjs → index-CLxYZ09c.cjs} +4 -4
- package/schematics/bundles/{index-BFENxhdR.cjs → index-Dvqnp6JS.cjs} +391 -152
- package/schematics/bundles/inject-migration.cjs +3 -3
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-CemH7A8e.cjs → migrate_ts_type_references-CpM5FPGa.cjs} +47 -5
- package/schematics/bundles/{ng_component_template-AYs8YXuT.cjs → ng_component_template-BRbBIAUX.cjs} +2 -2
- package/schematics/bundles/ng_decorators-BI0uV7KI.cjs +1 -1
- package/schematics/bundles/ngclass-to-class-migration.cjs +7 -7
- package/schematics/bundles/ngstyle-to-style-migration.cjs +7 -7
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +6 -6
- package/schematics/bundles/{parse_html-6-AB4O-A.cjs → parse_html-CPWfkfhR.cjs} +2 -2
- package/schematics/bundles/{project_paths-EiOrjlNS.cjs → project_paths-C8H7KDJ3.cjs} +3 -3
- package/schematics/bundles/{project_tsconfig_paths-BbVhi4fG.cjs → project_tsconfig_paths-CiBzGSIa.cjs} +335 -47
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +3 -3
- package/schematics/bundles/router-current-navigation.cjs +4 -4
- package/schematics/bundles/router-last-successful-navigation.cjs +4 -4
- package/schematics/bundles/router-testing-module-migration.cjs +513 -0
- package/schematics/bundles/self-closing-tags-migration.cjs +6 -6
- package/schematics/bundles/signal-input-migration.cjs +7 -7
- package/schematics/bundles/signal-queries-migration.cjs +7 -7
- package/schematics/bundles/signals.cjs +7 -7
- package/schematics/bundles/standalone-migration.cjs +4 -4
- package/schematics/bundles/symbol-BObKoqes.cjs +1 -1
- package/schematics/collection.json +11 -0
- package/schematics/migrations/common-to-standalone-migration/schema.json +14 -0
- package/schematics/migrations/router-testing-module-migration/schema.json +14 -0
- package/types/_api-chunk.d.ts +1 -1
- package/types/_chrome_dev_tools_performance-chunk.d.ts +22 -12
- package/types/_discovery-chunk.d.ts +58 -10
- package/types/_effect-chunk.d.ts +1 -1
- package/types/_event_dispatcher-chunk.d.ts +1 -1
- package/types/_formatter-chunk.d.ts +4 -3
- package/types/_weak_ref-chunk.d.ts +1 -1
- package/types/core.d.ts +68 -33
- package/types/primitives-di.d.ts +1 -1
- package/types/primitives-event-dispatch.d.ts +1 -1
- package/types/primitives-signals.d.ts +2 -2
- package/types/rxjs-interop.d.ts +1 -1
- package/types/testing.d.ts +1 -1
- package/fesm2022/_root_effect_scheduler-chunk.mjs.map +0 -1
- package/fesm2022/_signal-chunk.mjs +0 -581
- package/fesm2022/_signal-chunk.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v21.0.0-next.
|
|
3
|
+
* @license Angular v21.0.0-next.9
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -2907,6 +2907,16 @@ class Identifiers {
|
|
|
2907
2907
|
name: 'ɵɵvalidateIframeAttribute',
|
|
2908
2908
|
moduleName: CORE,
|
|
2909
2909
|
};
|
|
2910
|
+
// Decorators
|
|
2911
|
+
static inputDecorator = { name: 'Input', moduleName: CORE };
|
|
2912
|
+
static outputDecorator = { name: 'Output', moduleName: CORE };
|
|
2913
|
+
static viewChildDecorator = { name: 'ViewChild', moduleName: CORE };
|
|
2914
|
+
static viewChildrenDecorator = { name: 'ViewChildren', moduleName: CORE };
|
|
2915
|
+
static contentChildDecorator = { name: 'ContentChild', moduleName: CORE };
|
|
2916
|
+
static contentChildrenDecorator = {
|
|
2917
|
+
name: 'ContentChildren',
|
|
2918
|
+
moduleName: CORE,
|
|
2919
|
+
};
|
|
2910
2920
|
// type-checking
|
|
2911
2921
|
static InputSignalBrandWriteType = { name: 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE', moduleName: CORE };
|
|
2912
2922
|
static UnwrapDirectiveSignalInputs = { name: 'ɵUnwrapDirectiveSignalInputs', moduleName: CORE };
|
|
@@ -4833,9 +4843,11 @@ class InteractionDeferredTrigger extends DeferredTrigger {
|
|
|
4833
4843
|
}
|
|
4834
4844
|
class ViewportDeferredTrigger extends DeferredTrigger {
|
|
4835
4845
|
reference;
|
|
4836
|
-
|
|
4846
|
+
options;
|
|
4847
|
+
constructor(reference, options, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) {
|
|
4837
4848
|
super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
|
|
4838
4849
|
this.reference = reference;
|
|
4850
|
+
this.options = options;
|
|
4839
4851
|
}
|
|
4840
4852
|
}
|
|
4841
4853
|
class BlockNode {
|
|
@@ -8660,14 +8672,14 @@ var OpKind;
|
|
|
8660
8672
|
*/
|
|
8661
8673
|
OpKind[OpKind["AnimationListener"] = 56] = "AnimationListener";
|
|
8662
8674
|
/**
|
|
8663
|
-
* An operation to bind an expression to a `
|
|
8675
|
+
* An operation to bind an expression to a `field` property of an element.
|
|
8664
8676
|
*/
|
|
8665
8677
|
OpKind[OpKind["Control"] = 57] = "Control";
|
|
8666
8678
|
/**
|
|
8667
8679
|
* An operation to set up a corresponding {@link Control} operation.
|
|
8668
8680
|
*
|
|
8669
8681
|
* This is responsible for setting up event listeners on a native or custom form control when
|
|
8670
|
-
* bound to a specialized
|
|
8682
|
+
* bound to a specialized field directive.
|
|
8671
8683
|
*/
|
|
8672
8684
|
OpKind[OpKind["ControlCreate"] = 58] = "ControlCreate";
|
|
8673
8685
|
})(OpKind || (OpKind = {}));
|
|
@@ -11653,7 +11665,7 @@ function extractAttributes(job) {
|
|
|
11653
11665
|
case OpKind.Control:
|
|
11654
11666
|
OpList.insertBefore(
|
|
11655
11667
|
// Deliberately null i18nMessage value
|
|
11656
|
-
createExtractedAttributeOp(op.target, BindingKind.Property, null, '
|
|
11668
|
+
createExtractedAttributeOp(op.target, BindingKind.Property, null, 'field',
|
|
11657
11669
|
/* expression */ null,
|
|
11658
11670
|
/* i18nContext */ null,
|
|
11659
11671
|
/* i18nMessage */ null, op.securityContext), lookupElement$3(elements, op.target));
|
|
@@ -11817,7 +11829,7 @@ function specializeBindings(job) {
|
|
|
11817
11829
|
else if (job.kind === CompilationJobKind.Host) {
|
|
11818
11830
|
OpList.replace(op, createDomPropertyOp(op.name, op.expression, op.bindingKind, op.i18nContext, op.securityContext, op.sourceSpan));
|
|
11819
11831
|
}
|
|
11820
|
-
else if (op.name === '
|
|
11832
|
+
else if (op.name === 'field') {
|
|
11821
11833
|
OpList.replace(op, createControlOp(op));
|
|
11822
11834
|
}
|
|
11823
11835
|
else {
|
|
@@ -16405,7 +16417,7 @@ class _Tokenizer {
|
|
|
16405
16417
|
this._cursor.advance();
|
|
16406
16418
|
try {
|
|
16407
16419
|
const charCode = parseInt(strNum, isHex ? 16 : 10);
|
|
16408
|
-
this._endToken([String.
|
|
16420
|
+
this._endToken([String.fromCodePoint(charCode), this._cursor.getChars(start)]);
|
|
16409
16421
|
}
|
|
16410
16422
|
catch {
|
|
16411
16423
|
throw this._createError(_unknownEntityErrorMsg(this._cursor.getChars(start)), this._cursor.getSpan());
|
|
@@ -23669,7 +23681,7 @@ function deferOn(trigger, args, modifier, sourceSpan) {
|
|
|
23669
23681
|
if (instructionToCall === undefined) {
|
|
23670
23682
|
throw new Error(`Unable to determine instruction for trigger ${trigger}`);
|
|
23671
23683
|
}
|
|
23672
|
-
return call(instructionToCall, args
|
|
23684
|
+
return call(instructionToCall, args, sourceSpan);
|
|
23673
23685
|
}
|
|
23674
23686
|
function projectionDef(def) {
|
|
23675
23687
|
return call(Identifiers.projectionDef, def ? [def] : [], null);
|
|
@@ -24260,11 +24272,30 @@ function reifyCreateOperations(unit, ops) {
|
|
|
24260
24272
|
case DeferTriggerKind.Immediate:
|
|
24261
24273
|
break;
|
|
24262
24274
|
case DeferTriggerKind.Timer:
|
|
24263
|
-
args = [op.trigger.delay];
|
|
24275
|
+
args = [literal(op.trigger.delay)];
|
|
24276
|
+
break;
|
|
24277
|
+
case DeferTriggerKind.Viewport:
|
|
24278
|
+
// `hydrate` triggers don't support targets.
|
|
24279
|
+
if (op.modifier === "hydrate" /* ir.DeferOpModifierKind.HYDRATE */) {
|
|
24280
|
+
args = op.trigger.options ? [op.trigger.options] : [];
|
|
24281
|
+
}
|
|
24282
|
+
else {
|
|
24283
|
+
// The slots not being defined at this point is invalid, however we
|
|
24284
|
+
// catch it during type checking. Pass in null in such cases.
|
|
24285
|
+
args = [literal(op.trigger.targetSlot?.slot ?? null)];
|
|
24286
|
+
if (op.trigger.targetSlotViewSteps !== 0) {
|
|
24287
|
+
args.push(literal(op.trigger.targetSlotViewSteps));
|
|
24288
|
+
}
|
|
24289
|
+
else if (op.trigger.options) {
|
|
24290
|
+
args.push(literal(null));
|
|
24291
|
+
}
|
|
24292
|
+
if (op.trigger.options) {
|
|
24293
|
+
args.push(op.trigger.options);
|
|
24294
|
+
}
|
|
24295
|
+
}
|
|
24264
24296
|
break;
|
|
24265
24297
|
case DeferTriggerKind.Interaction:
|
|
24266
24298
|
case DeferTriggerKind.Hover:
|
|
24267
|
-
case DeferTriggerKind.Viewport:
|
|
24268
24299
|
// `hydrate` triggers don't support targets.
|
|
24269
24300
|
if (op.modifier === "hydrate" /* ir.DeferOpModifierKind.HYDRATE */) {
|
|
24270
24301
|
args = [];
|
|
@@ -24272,9 +24303,9 @@ function reifyCreateOperations(unit, ops) {
|
|
|
24272
24303
|
else {
|
|
24273
24304
|
// The slots not being defined at this point is invalid, however we
|
|
24274
24305
|
// catch it during type checking. Pass in null in such cases.
|
|
24275
|
-
args = [op.trigger.targetSlot?.slot ?? null];
|
|
24306
|
+
args = [literal(op.trigger.targetSlot?.slot ?? null)];
|
|
24276
24307
|
if (op.trigger.targetSlotViewSteps !== 0) {
|
|
24277
|
-
args.push(op.trigger.targetSlotViewSteps);
|
|
24308
|
+
args.push(literal(op.trigger.targetSlotViewSteps));
|
|
24278
24309
|
}
|
|
24279
24310
|
}
|
|
24280
24311
|
break;
|
|
@@ -27150,6 +27181,9 @@ function ingestDeferTriggers(modifier, triggers, onOps, whenOps, unit, deferXref
|
|
|
27150
27181
|
targetSlot: null,
|
|
27151
27182
|
targetView: null,
|
|
27152
27183
|
targetSlotViewSteps: null,
|
|
27184
|
+
options: triggers.viewport.options
|
|
27185
|
+
? convertAst(triggers.viewport.options, unit.job, triggers.viewport.sourceSpan)
|
|
27186
|
+
: null,
|
|
27153
27187
|
}, modifier, triggers.viewport.sourceSpan);
|
|
27154
27188
|
onOps.push(deferOnOp);
|
|
27155
27189
|
}
|
|
@@ -27480,9 +27514,9 @@ function ingestElementBindings(unit, op, element) {
|
|
|
27480
27514
|
}
|
|
27481
27515
|
// All dynamic bindings (both attribute and property bindings).
|
|
27482
27516
|
bindings.push(createBindingOp(op.xref, BINDING_KINDS.get(input.type), input.name, convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n), input.unit, input.securityContext, false, false, null, asMessage(input.i18n) ?? null, input.sourceSpan));
|
|
27483
|
-
// If the input name is '
|
|
27517
|
+
// If the input name is 'field', this could be a form control binding which requires a
|
|
27484
27518
|
// `ControlCreateOp` to properly initialize.
|
|
27485
|
-
if (input.type === exports.BindingType.Property && input.name === '
|
|
27519
|
+
if (input.type === exports.BindingType.Property && input.name === 'field') {
|
|
27486
27520
|
unit.create.push(createControlCreateOp(input.sourceSpan));
|
|
27487
27521
|
}
|
|
27488
27522
|
}
|
|
@@ -28661,6 +28695,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
28661
28695
|
// main `for` body, use `mainSourceSpan`.
|
|
28662
28696
|
const endSpan = empty?.endSourceSpan ?? ast.endSourceSpan;
|
|
28663
28697
|
const sourceSpan = new ParseSourceSpan(ast.sourceSpan.start, endSpan?.end ?? ast.sourceSpan.end);
|
|
28698
|
+
validateTrackByExpression(params.trackBy.expression, params.trackBy.keywordSpan, errors);
|
|
28664
28699
|
node = new ForLoopBlock(params.itemName, params.expression, params.trackBy.expression, params.trackBy.keywordSpan, params.context, visitAll(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan, ast.nameSpan, ast.i18n);
|
|
28665
28700
|
}
|
|
28666
28701
|
}
|
|
@@ -28760,6 +28795,13 @@ function parseForLoopParameters(block, errors, bindingParser) {
|
|
|
28760
28795
|
}
|
|
28761
28796
|
return result;
|
|
28762
28797
|
}
|
|
28798
|
+
function validateTrackByExpression(expression, parseSourceSpan, errors) {
|
|
28799
|
+
const visitor = new PipeVisitor();
|
|
28800
|
+
expression.ast.visit(visitor);
|
|
28801
|
+
if (visitor.hasPipe) {
|
|
28802
|
+
errors.push(new ParseError(parseSourceSpan, 'Cannot use pipes in track expressions'));
|
|
28803
|
+
}
|
|
28804
|
+
}
|
|
28763
28805
|
/** Parses the `let` parameter of a `for` loop block. */
|
|
28764
28806
|
function parseLetParameter(sourceSpan, expression, span, loopItemName, context, errors) {
|
|
28765
28807
|
const parts = expression.split(',');
|
|
@@ -28970,6 +29012,12 @@ function stripOptionalParentheses(param, errors) {
|
|
|
28970
29012
|
}
|
|
28971
29013
|
return expression.slice(start, end);
|
|
28972
29014
|
}
|
|
29015
|
+
class PipeVisitor extends RecursiveAstVisitor {
|
|
29016
|
+
hasPipe = false;
|
|
29017
|
+
visitPipe() {
|
|
29018
|
+
this.hasPipe = true;
|
|
29019
|
+
}
|
|
29020
|
+
}
|
|
28973
29021
|
|
|
28974
29022
|
/** Pattern for a timing value in a trigger. */
|
|
28975
29023
|
const TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
|
|
@@ -29025,7 +29073,7 @@ function parseWhenTrigger({ expression, sourceSpan }, bindingParser, triggers, e
|
|
|
29025
29073
|
}
|
|
29026
29074
|
}
|
|
29027
29075
|
/** Parses an `on` trigger */
|
|
29028
|
-
function parseOnTrigger({ expression, sourceSpan }, triggers, errors, placeholder) {
|
|
29076
|
+
function parseOnTrigger({ expression, sourceSpan }, bindingParser, triggers, errors, placeholder) {
|
|
29029
29077
|
const onIndex = expression.indexOf('on');
|
|
29030
29078
|
const onSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(onIndex), sourceSpan.start.moveBy(onIndex + 'on'.length));
|
|
29031
29079
|
const prefetchSpan = getPrefetchSpan(expression, sourceSpan);
|
|
@@ -29037,9 +29085,10 @@ function parseOnTrigger({ expression, sourceSpan }, triggers, errors, placeholde
|
|
|
29037
29085
|
}
|
|
29038
29086
|
else {
|
|
29039
29087
|
const start = getTriggerParametersStart(expression, onIndex + 1);
|
|
29040
|
-
const
|
|
29088
|
+
const isHydrationTrigger = expression.startsWith('hydrate');
|
|
29089
|
+
const parser = new OnTriggerParser(expression, bindingParser, start, sourceSpan, triggers, errors, isHydrationTrigger
|
|
29041
29090
|
? validateHydrateReferenceBasedTrigger
|
|
29042
|
-
: validatePlainReferenceBasedTrigger,
|
|
29091
|
+
: validatePlainReferenceBasedTrigger, isHydrationTrigger, prefetchSpan, onSourceSpan, hydrateSpan);
|
|
29043
29092
|
parser.parse();
|
|
29044
29093
|
}
|
|
29045
29094
|
}
|
|
@@ -29057,25 +29106,27 @@ function getHydrateSpan(expression, sourceSpan) {
|
|
|
29057
29106
|
}
|
|
29058
29107
|
class OnTriggerParser {
|
|
29059
29108
|
expression;
|
|
29109
|
+
bindingParser;
|
|
29060
29110
|
start;
|
|
29061
29111
|
span;
|
|
29062
29112
|
triggers;
|
|
29063
29113
|
errors;
|
|
29064
29114
|
validator;
|
|
29065
|
-
|
|
29115
|
+
isHydrationTrigger;
|
|
29066
29116
|
prefetchSpan;
|
|
29067
29117
|
onSourceSpan;
|
|
29068
29118
|
hydrateSpan;
|
|
29069
29119
|
index = 0;
|
|
29070
29120
|
tokens;
|
|
29071
|
-
constructor(expression, start, span, triggers, errors, validator,
|
|
29121
|
+
constructor(expression, bindingParser, start, span, triggers, errors, validator, isHydrationTrigger, prefetchSpan, onSourceSpan, hydrateSpan) {
|
|
29072
29122
|
this.expression = expression;
|
|
29123
|
+
this.bindingParser = bindingParser;
|
|
29073
29124
|
this.start = start;
|
|
29074
29125
|
this.span = span;
|
|
29075
29126
|
this.triggers = triggers;
|
|
29076
29127
|
this.errors = errors;
|
|
29077
29128
|
this.validator = validator;
|
|
29078
|
-
this.
|
|
29129
|
+
this.isHydrationTrigger = isHydrationTrigger;
|
|
29079
29130
|
this.prefetchSpan = prefetchSpan;
|
|
29080
29131
|
this.onSourceSpan = onSourceSpan;
|
|
29081
29132
|
this.hydrateSpan = hydrateSpan;
|
|
@@ -29149,10 +29200,10 @@ class OnTriggerParser {
|
|
|
29149
29200
|
this.trackTrigger('immediate', createImmediateTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan));
|
|
29150
29201
|
break;
|
|
29151
29202
|
case OnTriggerType.HOVER:
|
|
29152
|
-
this.trackTrigger('hover', createHoverTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.
|
|
29203
|
+
this.trackTrigger('hover', createHoverTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.validator));
|
|
29153
29204
|
break;
|
|
29154
29205
|
case OnTriggerType.VIEWPORT:
|
|
29155
|
-
this.trackTrigger('viewport', createViewportTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.validator));
|
|
29206
|
+
this.trackTrigger('viewport', createViewportTrigger(this.start, this.isHydrationTrigger, this.bindingParser, parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.validator));
|
|
29156
29207
|
break;
|
|
29157
29208
|
default:
|
|
29158
29209
|
throw new Error(`Unrecognized trigger type "${identifier}"`);
|
|
@@ -29170,15 +29221,15 @@ class OnTriggerParser {
|
|
|
29170
29221
|
}
|
|
29171
29222
|
this.advance();
|
|
29172
29223
|
const commaDelimStack = [];
|
|
29173
|
-
let
|
|
29224
|
+
let tokens = [];
|
|
29174
29225
|
while (this.index < this.tokens.length) {
|
|
29175
29226
|
const token = this.token();
|
|
29176
29227
|
// Stop parsing if we've hit the end character and we're outside of a comma-delimited syntax.
|
|
29177
29228
|
// Note that we don't need to account for strings here since the lexer already parsed them
|
|
29178
29229
|
// into string tokens.
|
|
29179
29230
|
if (token.isCharacter($RPAREN) && commaDelimStack.length === 0) {
|
|
29180
|
-
if (
|
|
29181
|
-
parameters.push(
|
|
29231
|
+
if (tokens.length) {
|
|
29232
|
+
parameters.push({ expression: this.tokenRangeText(tokens), start: tokens[0].index });
|
|
29182
29233
|
}
|
|
29183
29234
|
break;
|
|
29184
29235
|
}
|
|
@@ -29197,14 +29248,14 @@ class OnTriggerParser {
|
|
|
29197
29248
|
}
|
|
29198
29249
|
// If we hit a comma outside of a comma-delimited syntax, it means
|
|
29199
29250
|
// that we're at the top level and we're starting a new parameter.
|
|
29200
|
-
if (commaDelimStack.length === 0 && token.isCharacter($COMMA) &&
|
|
29201
|
-
parameters.push(
|
|
29202
|
-
current = '';
|
|
29251
|
+
if (commaDelimStack.length === 0 && token.isCharacter($COMMA) && tokens.length > 0) {
|
|
29252
|
+
parameters.push({ expression: this.tokenRangeText(tokens), start: tokens[0].index });
|
|
29203
29253
|
this.advance();
|
|
29254
|
+
tokens = [];
|
|
29204
29255
|
continue;
|
|
29205
29256
|
}
|
|
29206
29257
|
// Otherwise treat the token as a plain text character in the current parameter.
|
|
29207
|
-
|
|
29258
|
+
tokens.push(token);
|
|
29208
29259
|
this.advance();
|
|
29209
29260
|
}
|
|
29210
29261
|
if (!this.token().isCharacter($RPAREN) || commaDelimStack.length > 0) {
|
|
@@ -29216,10 +29267,11 @@ class OnTriggerParser {
|
|
|
29216
29267
|
}
|
|
29217
29268
|
return parameters;
|
|
29218
29269
|
}
|
|
29219
|
-
|
|
29220
|
-
|
|
29221
|
-
|
|
29222
|
-
|
|
29270
|
+
tokenRangeText(tokens) {
|
|
29271
|
+
if (tokens.length === 0) {
|
|
29272
|
+
return '';
|
|
29273
|
+
}
|
|
29274
|
+
return this.expression.slice(this.start + tokens[0].index, this.start + tokens[tokens.length - 1].end);
|
|
29223
29275
|
}
|
|
29224
29276
|
trackTrigger(name, trigger) {
|
|
29225
29277
|
trackTrigger(name, this.triggers, this.errors, trigger);
|
|
@@ -29252,7 +29304,7 @@ function createTimerTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSo
|
|
|
29252
29304
|
if (parameters.length !== 1) {
|
|
29253
29305
|
throw new Error(`"${OnTriggerType.TIMER}" trigger must have exactly one parameter`);
|
|
29254
29306
|
}
|
|
29255
|
-
const delay = parseDeferredTime(parameters[0]);
|
|
29307
|
+
const delay = parseDeferredTime(parameters[0].expression);
|
|
29256
29308
|
if (delay === null) {
|
|
29257
29309
|
throw new Error(`Could not parse time value of trigger "${OnTriggerType.TIMER}"`);
|
|
29258
29310
|
}
|
|
@@ -29264,17 +29316,61 @@ function createImmediateTrigger(parameters, nameSpan, sourceSpan, prefetchSpan,
|
|
|
29264
29316
|
}
|
|
29265
29317
|
return new ImmediateDeferredTrigger(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
|
|
29266
29318
|
}
|
|
29267
|
-
function createHoverTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan,
|
|
29319
|
+
function createHoverTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, validator) {
|
|
29268
29320
|
validator(OnTriggerType.HOVER, parameters);
|
|
29269
|
-
return new HoverDeferredTrigger(parameters[0] ?? null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
|
|
29321
|
+
return new HoverDeferredTrigger(parameters[0]?.expression ?? null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
|
|
29270
29322
|
}
|
|
29271
29323
|
function createInteractionTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, validator) {
|
|
29272
29324
|
validator(OnTriggerType.INTERACTION, parameters);
|
|
29273
|
-
return new InteractionDeferredTrigger(parameters[0] ?? null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
|
|
29325
|
+
return new InteractionDeferredTrigger(parameters[0]?.expression ?? null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
|
|
29274
29326
|
}
|
|
29275
|
-
function createViewportTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, validator) {
|
|
29327
|
+
function createViewportTrigger(start, isHydrationTrigger, bindingParser, parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, validator) {
|
|
29276
29328
|
validator(OnTriggerType.VIEWPORT, parameters);
|
|
29277
|
-
|
|
29329
|
+
let reference;
|
|
29330
|
+
let options;
|
|
29331
|
+
if (parameters.length === 0) {
|
|
29332
|
+
reference = options = null;
|
|
29333
|
+
}
|
|
29334
|
+
else if (!parameters[0].expression.startsWith('{')) {
|
|
29335
|
+
reference = parameters[0].expression;
|
|
29336
|
+
options = null;
|
|
29337
|
+
}
|
|
29338
|
+
else {
|
|
29339
|
+
const parsed = bindingParser.parseBinding(parameters[0].expression, false, sourceSpan, sourceSpan.start.offset + start + parameters[0].start);
|
|
29340
|
+
if (!(parsed.ast instanceof LiteralMap)) {
|
|
29341
|
+
throw new Error('Options parameter of the "viewport" trigger must be an object literal');
|
|
29342
|
+
}
|
|
29343
|
+
else if (parsed.ast.keys.some((key) => key.key === 'root')) {
|
|
29344
|
+
throw new Error('The "root" option is not supported in the options parameter of the "viewport" trigger');
|
|
29345
|
+
}
|
|
29346
|
+
const triggerIndex = parsed.ast.keys.findIndex((key) => key.key === 'trigger');
|
|
29347
|
+
if (triggerIndex === -1) {
|
|
29348
|
+
reference = null;
|
|
29349
|
+
options = parsed.ast;
|
|
29350
|
+
}
|
|
29351
|
+
else {
|
|
29352
|
+
const value = parsed.ast.values[triggerIndex];
|
|
29353
|
+
const triggerFilter = (_, index) => index !== triggerIndex;
|
|
29354
|
+
if (!(value instanceof PropertyRead) ||
|
|
29355
|
+
!(value.receiver instanceof ImplicitReceiver) ||
|
|
29356
|
+
value.receiver instanceof ThisReceiver) {
|
|
29357
|
+
throw new Error(`"trigger" option of the "viewport" trigger must be an identifier`);
|
|
29358
|
+
}
|
|
29359
|
+
reference = value.name;
|
|
29360
|
+
options = new LiteralMap(parsed.ast.span, parsed.ast.sourceSpan, parsed.ast.keys.filter(triggerFilter), parsed.ast.values.filter(triggerFilter));
|
|
29361
|
+
}
|
|
29362
|
+
}
|
|
29363
|
+
if (isHydrationTrigger && reference !== null) {
|
|
29364
|
+
throw new Error(`"viewport" hydration trigger cannot have a "trigger"`);
|
|
29365
|
+
}
|
|
29366
|
+
else if (options) {
|
|
29367
|
+
const dynamicNode = DynamicAstValidator.findDynamicNode(options);
|
|
29368
|
+
if (dynamicNode !== null) {
|
|
29369
|
+
throw new Error(`Options of the "viewport" trigger must be an object ` +
|
|
29370
|
+
`literal containing only literal values, but "${dynamicNode.constructor.name}" was found`);
|
|
29371
|
+
}
|
|
29372
|
+
}
|
|
29373
|
+
return new ViewportDeferredTrigger(reference, options, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan);
|
|
29278
29374
|
}
|
|
29279
29375
|
/**
|
|
29280
29376
|
* Checks whether the structure of a non-hydrate reference-based trigger is valid.
|
|
@@ -29292,6 +29388,12 @@ function validatePlainReferenceBasedTrigger(type, parameters) {
|
|
|
29292
29388
|
* @param parameters Parameters of the trigger.
|
|
29293
29389
|
*/
|
|
29294
29390
|
function validateHydrateReferenceBasedTrigger(type, parameters) {
|
|
29391
|
+
if (type === OnTriggerType.VIEWPORT) {
|
|
29392
|
+
if (parameters.length > 1) {
|
|
29393
|
+
throw new Error(`Hydration trigger "${type}" cannot have more than one parameter`);
|
|
29394
|
+
}
|
|
29395
|
+
return;
|
|
29396
|
+
}
|
|
29295
29397
|
if (parameters.length > 0) {
|
|
29296
29398
|
throw new Error(`Hydration trigger "${type}" cannot have parameters`);
|
|
29297
29399
|
}
|
|
@@ -29321,6 +29423,25 @@ function parseDeferredTime(value) {
|
|
|
29321
29423
|
const [time, units] = match;
|
|
29322
29424
|
return parseFloat(time) * (units === 's' ? 1000 : 1);
|
|
29323
29425
|
}
|
|
29426
|
+
class DynamicAstValidator extends RecursiveAstVisitor {
|
|
29427
|
+
dynamicNode = null;
|
|
29428
|
+
static findDynamicNode(ast) {
|
|
29429
|
+
const visitor = new DynamicAstValidator();
|
|
29430
|
+
visitor.visit(ast);
|
|
29431
|
+
return visitor.dynamicNode;
|
|
29432
|
+
}
|
|
29433
|
+
visit(ast) {
|
|
29434
|
+
if (!(ast instanceof ASTWithSource) &&
|
|
29435
|
+
!(ast instanceof LiteralPrimitive) &&
|
|
29436
|
+
!(ast instanceof LiteralArray) &&
|
|
29437
|
+
!(ast instanceof LiteralMap)) {
|
|
29438
|
+
this.dynamicNode = ast;
|
|
29439
|
+
}
|
|
29440
|
+
else {
|
|
29441
|
+
super.visit(ast);
|
|
29442
|
+
}
|
|
29443
|
+
}
|
|
29444
|
+
}
|
|
29324
29445
|
|
|
29325
29446
|
/** Pattern to identify a `prefetch when` trigger. */
|
|
29326
29447
|
const PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
|
|
@@ -29351,7 +29472,7 @@ function isConnectedDeferLoopBlock(name) {
|
|
|
29351
29472
|
function createDeferredBlock(ast, connectedBlocks, visitor, bindingParser) {
|
|
29352
29473
|
const errors = [];
|
|
29353
29474
|
const { placeholder, loading, error } = parseConnectedBlocks(connectedBlocks, errors, visitor);
|
|
29354
|
-
const { triggers, prefetchTriggers, hydrateTriggers } = parsePrimaryTriggers(ast, bindingParser, errors
|
|
29475
|
+
const { triggers, prefetchTriggers, hydrateTriggers } = parsePrimaryTriggers(ast, bindingParser, errors);
|
|
29355
29476
|
// The `defer` block has a main span encompassing all of the connected branches as well.
|
|
29356
29477
|
let lastEndSourceSpan = ast.endSourceSpan;
|
|
29357
29478
|
let endOfLastSourceSpan = ast.sourceSpan.end;
|
|
@@ -29473,19 +29594,19 @@ function parsePrimaryTriggers(ast, bindingParser, errors, placeholder) {
|
|
|
29473
29594
|
parseWhenTrigger(param, bindingParser, triggers, errors);
|
|
29474
29595
|
}
|
|
29475
29596
|
else if (ON_PARAMETER_PATTERN.test(param.expression)) {
|
|
29476
|
-
parseOnTrigger(param, triggers, errors
|
|
29597
|
+
parseOnTrigger(param, bindingParser, triggers, errors);
|
|
29477
29598
|
}
|
|
29478
29599
|
else if (PREFETCH_WHEN_PATTERN.test(param.expression)) {
|
|
29479
29600
|
parseWhenTrigger(param, bindingParser, prefetchTriggers, errors);
|
|
29480
29601
|
}
|
|
29481
29602
|
else if (PREFETCH_ON_PATTERN.test(param.expression)) {
|
|
29482
|
-
parseOnTrigger(param, prefetchTriggers, errors
|
|
29603
|
+
parseOnTrigger(param, bindingParser, prefetchTriggers, errors);
|
|
29483
29604
|
}
|
|
29484
29605
|
else if (HYDRATE_WHEN_PATTERN.test(param.expression)) {
|
|
29485
29606
|
parseWhenTrigger(param, bindingParser, hydrateTriggers, errors);
|
|
29486
29607
|
}
|
|
29487
29608
|
else if (HYDRATE_ON_PATTERN.test(param.expression)) {
|
|
29488
|
-
parseOnTrigger(param, hydrateTriggers, errors
|
|
29609
|
+
parseOnTrigger(param, bindingParser, hydrateTriggers, errors);
|
|
29489
29610
|
}
|
|
29490
29611
|
else if (HYDRATE_NEVER_PATTERN.test(param.expression)) {
|
|
29491
29612
|
parseNeverTrigger(param, hydrateTriggers, errors);
|
|
@@ -30895,6 +31016,9 @@ class CombinedRecursiveAstVisitor extends RecursiveAstVisitor {
|
|
|
30895
31016
|
if (trigger instanceof BoundDeferredTrigger) {
|
|
30896
31017
|
this.visit(trigger.value);
|
|
30897
31018
|
}
|
|
31019
|
+
else if (trigger instanceof ViewportDeferredTrigger && trigger.options !== null) {
|
|
31020
|
+
this.visit(trigger.options);
|
|
31021
|
+
}
|
|
30898
31022
|
}
|
|
30899
31023
|
visitDeferredBlockPlaceholder(block) {
|
|
30900
31024
|
this.visitAllTemplateNodes(block.children);
|
|
@@ -32989,7 +33113,7 @@ function isAttrNode(ast) {
|
|
|
32989
33113
|
* @description
|
|
32990
33114
|
* Entry point for all public APIs of the compiler package.
|
|
32991
33115
|
*/
|
|
32992
|
-
const VERSION = new Version('21.0.0-next.
|
|
33116
|
+
const VERSION = new Version('21.0.0-next.9');
|
|
32993
33117
|
|
|
32994
33118
|
//////////////////////////////////////
|
|
32995
33119
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
@@ -33156,6 +33280,11 @@ exports.ErrorCode = void 0;
|
|
|
33156
33280
|
* Raised for `@Component` fields that aren't supported in a selectorless context.
|
|
33157
33281
|
*/
|
|
33158
33282
|
ErrorCode[ErrorCode["UNSUPPORTED_SELECTORLESS_COMPONENT_FIELD"] = 2026] = "UNSUPPORTED_SELECTORLESS_COMPONENT_FIELD";
|
|
33283
|
+
/**
|
|
33284
|
+
* A component is using both the `animations` property and `animate.enter` or `animate.leave`
|
|
33285
|
+
* in the template.
|
|
33286
|
+
*/
|
|
33287
|
+
ErrorCode[ErrorCode["COMPONENT_ANIMATIONS_CONFLICT"] = 2027] = "COMPONENT_ANIMATIONS_CONFLICT";
|
|
33159
33288
|
ErrorCode[ErrorCode["SYMBOL_NOT_EXPORTED"] = 3001] = "SYMBOL_NOT_EXPORTED";
|
|
33160
33289
|
/**
|
|
33161
33290
|
* Raised when a relationship between directives and/or pipes would cause a cyclic import to be
|
|
@@ -33365,6 +33494,12 @@ exports.ErrorCode = void 0;
|
|
|
33365
33494
|
* ```
|
|
33366
33495
|
*/
|
|
33367
33496
|
ErrorCode[ErrorCode["DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER"] = 8020] = "DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER";
|
|
33497
|
+
/**
|
|
33498
|
+
* Raised when an `@defer` block defines unreachable or redundant triggers.
|
|
33499
|
+
* Examples: multiple main triggers, 'on immediate' together with other mains or any prefetch,
|
|
33500
|
+
* prefetch timer delay that is not earlier than the main timer, or an identical prefetch
|
|
33501
|
+
*/
|
|
33502
|
+
ErrorCode[ErrorCode["DEFER_TRIGGER_MISCONFIGURATION"] = 8021] = "DEFER_TRIGGER_MISCONFIGURATION";
|
|
33368
33503
|
/**
|
|
33369
33504
|
* A two way binding in a template has an incorrect syntax,
|
|
33370
33505
|
* parentheses outside brackets. For example:
|
|
@@ -33726,6 +33861,7 @@ exports.ExtendedTemplateDiagnosticName = void 0;
|
|
|
33726
33861
|
ExtendedTemplateDiagnosticName["UNUSED_STANDALONE_IMPORTS"] = "unusedStandaloneImports";
|
|
33727
33862
|
ExtendedTemplateDiagnosticName["UNPARENTHESIZED_NULLISH_COALESCING"] = "unparenthesizedNullishCoalescing";
|
|
33728
33863
|
ExtendedTemplateDiagnosticName["UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION"] = "uninvokedFunctionInTextInterpolation";
|
|
33864
|
+
ExtendedTemplateDiagnosticName["DEFER_TRIGGER_MISCONFIGURATION"] = "deferTriggerMisconfiguration";
|
|
33729
33865
|
})(exports.ExtendedTemplateDiagnosticName || (exports.ExtendedTemplateDiagnosticName = {}));
|
|
33730
33866
|
|
|
33731
33867
|
/**
|
|
@@ -34052,7 +34188,7 @@ class NodeJSPathManipulation {
|
|
|
34052
34188
|
// G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
|
|
34053
34189
|
// CommonJS/ESM interop for determining the current file name and containing dir.
|
|
34054
34190
|
const isCommonJS = typeof __filename !== 'undefined';
|
|
34055
|
-
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-
|
|
34191
|
+
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-CiBzGSIa.cjs', document.baseURI).href));
|
|
34056
34192
|
// Note, when this code loads in the browser, `url` may be an empty `{}` due to the Closure shims.
|
|
34057
34193
|
const currentFileName = isCommonJS
|
|
34058
34194
|
? __filename
|
|
@@ -34080,6 +34216,9 @@ class NodeJSReadonlyFileSystem extends NodeJSPathManipulation {
|
|
|
34080
34216
|
return fs$1.readFileSync(path, 'utf8');
|
|
34081
34217
|
}
|
|
34082
34218
|
readFileBuffer(path) {
|
|
34219
|
+
// TODO: go/ts59upgrade - Remove the suppression after TS 5.9.2 upgrade
|
|
34220
|
+
// TS2322: Type 'Buffer' is not assignable to type 'Uint8Array<ArrayBufferLike>'.
|
|
34221
|
+
// @ts-ignore
|
|
34083
34222
|
return fs$1.readFileSync(path);
|
|
34084
34223
|
}
|
|
34085
34224
|
readdir(path) {
|
|
@@ -40455,6 +40594,120 @@ function parseFieldStringArrayValue(directive, field, evaluator) {
|
|
|
40455
40594
|
}
|
|
40456
40595
|
return value;
|
|
40457
40596
|
}
|
|
40597
|
+
/**
|
|
40598
|
+
* Returns a function that can be used to extract data for the `setClassMetadata`
|
|
40599
|
+
* calls from undecorated directive class members.
|
|
40600
|
+
*/
|
|
40601
|
+
function getDirectiveUndecoratedMetadataExtractor(reflector, importTracker) {
|
|
40602
|
+
return (member) => {
|
|
40603
|
+
const input = tryParseSignalInputMapping(member, reflector, importTracker);
|
|
40604
|
+
if (input !== null) {
|
|
40605
|
+
return getDecoratorMetaArray([
|
|
40606
|
+
[new ExternalExpr(Identifiers.inputDecorator), memberMetadataFromSignalInput(input)],
|
|
40607
|
+
]);
|
|
40608
|
+
}
|
|
40609
|
+
const output = tryParseInitializerBasedOutput(member, reflector, importTracker);
|
|
40610
|
+
if (output !== null) {
|
|
40611
|
+
return getDecoratorMetaArray([
|
|
40612
|
+
[
|
|
40613
|
+
new ExternalExpr(Identifiers.outputDecorator),
|
|
40614
|
+
memberMetadataFromInitializerOutput(output.metadata),
|
|
40615
|
+
],
|
|
40616
|
+
]);
|
|
40617
|
+
}
|
|
40618
|
+
const model = tryParseSignalModelMapping(member, reflector, importTracker);
|
|
40619
|
+
if (model !== null) {
|
|
40620
|
+
return getDecoratorMetaArray([
|
|
40621
|
+
[
|
|
40622
|
+
new ExternalExpr(Identifiers.inputDecorator),
|
|
40623
|
+
memberMetadataFromSignalInput(model.input),
|
|
40624
|
+
],
|
|
40625
|
+
[
|
|
40626
|
+
new ExternalExpr(Identifiers.outputDecorator),
|
|
40627
|
+
memberMetadataFromInitializerOutput(model.output),
|
|
40628
|
+
],
|
|
40629
|
+
]);
|
|
40630
|
+
}
|
|
40631
|
+
const query = tryParseSignalQueryFromInitializer(member, reflector, importTracker);
|
|
40632
|
+
if (query !== null) {
|
|
40633
|
+
let identifier;
|
|
40634
|
+
if (query.name === 'viewChild') {
|
|
40635
|
+
identifier = Identifiers.viewChildDecorator;
|
|
40636
|
+
}
|
|
40637
|
+
else if (query.name === 'viewChildren') {
|
|
40638
|
+
identifier = Identifiers.viewChildrenDecorator;
|
|
40639
|
+
}
|
|
40640
|
+
else if (query.name === 'contentChild') {
|
|
40641
|
+
identifier = Identifiers.contentChildDecorator;
|
|
40642
|
+
}
|
|
40643
|
+
else if (query.name === 'contentChildren') {
|
|
40644
|
+
identifier = Identifiers.contentChildrenDecorator;
|
|
40645
|
+
}
|
|
40646
|
+
else {
|
|
40647
|
+
return null;
|
|
40648
|
+
}
|
|
40649
|
+
return getDecoratorMetaArray([
|
|
40650
|
+
[new ExternalExpr(identifier), memberMetadataFromSignalQuery(query.call)],
|
|
40651
|
+
]);
|
|
40652
|
+
}
|
|
40653
|
+
return null;
|
|
40654
|
+
};
|
|
40655
|
+
}
|
|
40656
|
+
function getDecoratorMetaArray(decorators) {
|
|
40657
|
+
return new LiteralArrayExpr(decorators.map(([type, args]) => literalMap([
|
|
40658
|
+
{ key: 'type', value: type, quoted: false },
|
|
40659
|
+
{ key: 'args', value: args, quoted: false },
|
|
40660
|
+
])));
|
|
40661
|
+
}
|
|
40662
|
+
function memberMetadataFromSignalInput(input) {
|
|
40663
|
+
// Note that for signal inputs the transform is captured in the signal
|
|
40664
|
+
// initializer so we don't need to capture it here.
|
|
40665
|
+
return new LiteralArrayExpr([
|
|
40666
|
+
literalMap([
|
|
40667
|
+
{
|
|
40668
|
+
key: 'isSignal',
|
|
40669
|
+
value: literal(true),
|
|
40670
|
+
quoted: false,
|
|
40671
|
+
},
|
|
40672
|
+
{
|
|
40673
|
+
key: 'alias',
|
|
40674
|
+
value: literal(input.bindingPropertyName),
|
|
40675
|
+
quoted: false,
|
|
40676
|
+
},
|
|
40677
|
+
{
|
|
40678
|
+
key: 'required',
|
|
40679
|
+
value: literal(input.required),
|
|
40680
|
+
quoted: false,
|
|
40681
|
+
},
|
|
40682
|
+
]),
|
|
40683
|
+
]);
|
|
40684
|
+
}
|
|
40685
|
+
function memberMetadataFromInitializerOutput(output) {
|
|
40686
|
+
return new LiteralArrayExpr([literal(output.bindingPropertyName)]);
|
|
40687
|
+
}
|
|
40688
|
+
function memberMetadataFromSignalQuery(call) {
|
|
40689
|
+
const firstArg = call.arguments[0];
|
|
40690
|
+
const firstArgMeta = ts.isStringLiteralLike(firstArg) || ts.isCallExpression(firstArg)
|
|
40691
|
+
? new WrappedNodeExpr(firstArg)
|
|
40692
|
+
: // If the first argument is a class reference, we need to wrap it in a `forwardRef`
|
|
40693
|
+
// because the reference might occur after the current class. This wouldn't be flagged
|
|
40694
|
+
// on the query initializer, because it executes after the class is initialized, whereas
|
|
40695
|
+
// `setClassMetadata` runs immediately.
|
|
40696
|
+
new ExternalExpr(Identifiers.forwardRef).callFn([
|
|
40697
|
+
new ArrowFunctionExpr([], new WrappedNodeExpr(firstArg)),
|
|
40698
|
+
]);
|
|
40699
|
+
const entries = [
|
|
40700
|
+
// We use wrapped nodes here, because the output AST doesn't support spread assignments.
|
|
40701
|
+
firstArgMeta,
|
|
40702
|
+
new WrappedNodeExpr(ts.factory.createObjectLiteralExpression([
|
|
40703
|
+
...(call.arguments.length > 1
|
|
40704
|
+
? [ts.factory.createSpreadAssignment(call.arguments[1])]
|
|
40705
|
+
: []),
|
|
40706
|
+
ts.factory.createPropertyAssignment('isSignal', ts.factory.createTrue()),
|
|
40707
|
+
])),
|
|
40708
|
+
];
|
|
40709
|
+
return new LiteralArrayExpr(entries);
|
|
40710
|
+
}
|
|
40458
40711
|
function isStringArrayOrDie(value, name, node) {
|
|
40459
40712
|
if (!Array.isArray(value)) {
|
|
40460
40713
|
return false;
|
|
@@ -44775,10 +45028,10 @@ class OutOfBandDiagnosticRecorderImpl {
|
|
|
44775
45028
|
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), node.keySpan || node.sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(exports.ErrorCode.UNCLAIMED_DIRECTIVE_BINDING), errorMsg));
|
|
44776
45029
|
}
|
|
44777
45030
|
deferImplicitTriggerMissingPlaceholder(id, trigger) {
|
|
44778
|
-
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(exports.ErrorCode.DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER), 'Trigger with no
|
|
45031
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(exports.ErrorCode.DEFER_IMPLICIT_TRIGGER_MISSING_PLACEHOLDER), 'Trigger with no target can only be placed on an @defer that has a @placeholder block'));
|
|
44779
45032
|
}
|
|
44780
45033
|
deferImplicitTriggerInvalidPlaceholder(id, trigger) {
|
|
44781
|
-
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(exports.ErrorCode.DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER), 'Trigger with no
|
|
45034
|
+
this._diagnostics.push(makeTemplateDiagnostic(id, this.resolver.getTemplateSourceMapping(id), trigger.sourceSpan, ts.DiagnosticCategory.Error, ngErrorCode(exports.ErrorCode.DEFER_IMPLICIT_TRIGGER_INVALID_PLACEHOLDER), 'Trigger with no target can only be placed on an @defer that has a ' +
|
|
44782
45035
|
'@placeholder block with exactly one root element node'));
|
|
44783
45036
|
}
|
|
44784
45037
|
}
|
|
@@ -46996,6 +47249,28 @@ class TcbForOfOp extends TcbOp {
|
|
|
46996
47249
|
return null;
|
|
46997
47250
|
}
|
|
46998
47251
|
}
|
|
47252
|
+
/**
|
|
47253
|
+
* A `TcbOp` which can be used to type check the options of an `IntersectionObserver`.
|
|
47254
|
+
*/
|
|
47255
|
+
class TcbIntersectionObserverOp extends TcbOp {
|
|
47256
|
+
tcb;
|
|
47257
|
+
scope;
|
|
47258
|
+
options;
|
|
47259
|
+
constructor(tcb, scope, options) {
|
|
47260
|
+
super();
|
|
47261
|
+
this.tcb = tcb;
|
|
47262
|
+
this.scope = scope;
|
|
47263
|
+
this.options = options;
|
|
47264
|
+
}
|
|
47265
|
+
optional = false;
|
|
47266
|
+
execute() {
|
|
47267
|
+
const options = tcbExpression(this.options, this.tcb, this.scope);
|
|
47268
|
+
const callback = ts.factory.createNonNullExpression(ts.factory.createNull());
|
|
47269
|
+
const expression = ts.factory.createNewExpression(ts.factory.createIdentifier('IntersectionObserver'), undefined, [callback, options]);
|
|
47270
|
+
this.scope.addStatement(ts.factory.createExpressionStatement(expression));
|
|
47271
|
+
return null;
|
|
47272
|
+
}
|
|
47273
|
+
}
|
|
46999
47274
|
/**
|
|
47000
47275
|
* Overall generation context for the type check block.
|
|
47001
47276
|
*
|
|
@@ -47767,6 +48042,9 @@ class Scope {
|
|
|
47767
48042
|
if (triggers.when !== undefined) {
|
|
47768
48043
|
this.opQueue.push(new TcbExpressionOp(this.tcb, this, triggers.when.value));
|
|
47769
48044
|
}
|
|
48045
|
+
if (triggers.viewport !== undefined && triggers.viewport.options !== null) {
|
|
48046
|
+
this.opQueue.push(new TcbIntersectionObserverOp(this.tcb, this, triggers.viewport.options));
|
|
48047
|
+
}
|
|
47770
48048
|
if (triggers.hover !== undefined) {
|
|
47771
48049
|
this.validateReferenceBasedDeferredTrigger(block, triggers.hover);
|
|
47772
48050
|
}
|
|
@@ -49737,6 +50015,9 @@ class TemplateTypeCheckerImpl {
|
|
|
49737
50015
|
const { data } = this.getLatestComponentState(directive, optimizeFor);
|
|
49738
50016
|
return data?.hostElement ?? null;
|
|
49739
50017
|
}
|
|
50018
|
+
getDirectivesOfNode(component, node) {
|
|
50019
|
+
return (this.getLatestComponentState(component).data?.boundTarget.getDirectivesOfNode(node) ?? null);
|
|
50020
|
+
}
|
|
49740
50021
|
getUsedDirectives(component) {
|
|
49741
50022
|
return this.getLatestComponentState(component).data?.boundTarget.getUsedDirectives() ?? null;
|
|
49742
50023
|
}
|
|
@@ -51072,6 +51353,7 @@ exports.Declaration = Declaration;
|
|
|
51072
51353
|
exports.DeclareFunctionStmt = DeclareFunctionStmt;
|
|
51073
51354
|
exports.DeclareVarStmt = DeclareVarStmt;
|
|
51074
51355
|
exports.DefaultImportTracker = DefaultImportTracker;
|
|
51356
|
+
exports.DeferredBlock = DeferredBlock;
|
|
51075
51357
|
exports.DefinitionMap = DefinitionMap;
|
|
51076
51358
|
exports.Directive = Directive$1;
|
|
51077
51359
|
exports.DomElementSchemaRegistry = DomElementSchemaRegistry;
|
|
@@ -51086,14 +51368,17 @@ exports.FatalDiagnosticError = FatalDiagnosticError;
|
|
|
51086
51368
|
exports.FnParam = FnParam;
|
|
51087
51369
|
exports.ForLoopBlock = ForLoopBlock;
|
|
51088
51370
|
exports.FunctionExpr = FunctionExpr;
|
|
51371
|
+
exports.HoverDeferredTrigger = HoverDeferredTrigger;
|
|
51089
51372
|
exports.HtmlParser = HtmlParser;
|
|
51090
51373
|
exports.INPUT_INITIALIZER_FN = INPUT_INITIALIZER_FN;
|
|
51091
51374
|
exports.Icu = Icu;
|
|
51092
51375
|
exports.IcuPlaceholder = IcuPlaceholder;
|
|
51093
51376
|
exports.Identifiers = Identifiers;
|
|
51094
51377
|
exports.IfBlock = IfBlock;
|
|
51378
|
+
exports.ImmediateDeferredTrigger = ImmediateDeferredTrigger;
|
|
51095
51379
|
exports.ImplicitReceiver = ImplicitReceiver;
|
|
51096
51380
|
exports.ImportManager = ImportManager;
|
|
51381
|
+
exports.InteractionDeferredTrigger = InteractionDeferredTrigger;
|
|
51097
51382
|
exports.Interpolation = Interpolation$1;
|
|
51098
51383
|
exports.InvokeFunctionExpr = InvokeFunctionExpr;
|
|
51099
51384
|
exports.KeyedRead = KeyedRead;
|
|
@@ -51148,6 +51433,7 @@ exports.Text$1 = Text$1;
|
|
|
51148
51433
|
exports.Text$2 = Text$2;
|
|
51149
51434
|
exports.TextAttribute = TextAttribute;
|
|
51150
51435
|
exports.ThisReceiver = ThisReceiver;
|
|
51436
|
+
exports.TimerDeferredTrigger = TimerDeferredTrigger;
|
|
51151
51437
|
exports.Trait = Trait;
|
|
51152
51438
|
exports.TypeCheckShimGenerator = TypeCheckShimGenerator;
|
|
51153
51439
|
exports.TypeScriptReflectionHost = TypeScriptReflectionHost;
|
|
@@ -51155,6 +51441,7 @@ exports.UNSAFE_OBJECT_KEY_NAME_REGEXP = UNSAFE_OBJECT_KEY_NAME_REGEXP;
|
|
|
51155
51441
|
exports.UnifiedModulesStrategy = UnifiedModulesStrategy;
|
|
51156
51442
|
exports.Variable = Variable;
|
|
51157
51443
|
exports.Version = Version;
|
|
51444
|
+
exports.ViewportDeferredTrigger = ViewportDeferredTrigger;
|
|
51158
51445
|
exports.WhitespaceVisitor = WhitespaceVisitor;
|
|
51159
51446
|
exports.WrappedNodeExpr = WrappedNodeExpr;
|
|
51160
51447
|
exports.Xmb = Xmb;
|
|
@@ -51210,6 +51497,7 @@ exports.getConstructorDependencies = getConstructorDependencies;
|
|
|
51210
51497
|
exports.getContainingImportDeclaration = getContainingImportDeclaration;
|
|
51211
51498
|
exports.getDefaultImportDeclaration = getDefaultImportDeclaration;
|
|
51212
51499
|
exports.getDirectiveDiagnostics = getDirectiveDiagnostics;
|
|
51500
|
+
exports.getDirectiveUndecoratedMetadataExtractor = getDirectiveUndecoratedMetadataExtractor;
|
|
51213
51501
|
exports.getFileSystem = getFileSystem;
|
|
51214
51502
|
exports.getOriginNodeForDiagnostics = getOriginNodeForDiagnostics;
|
|
51215
51503
|
exports.getProjectTsConfigPaths = getProjectTsConfigPaths;
|