@angular/core 17.1.0-next.4 → 17.1.0-next.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.
- package/esm2022/src/application/application_ref.mjs +4 -8
- package/esm2022/src/application/create_application.mjs +2 -2
- package/esm2022/src/change_detection/flags.mjs +16 -0
- package/esm2022/src/change_detection/scheduling/ng_zone_scheduling.mjs +164 -0
- package/esm2022/src/change_detection/scheduling/zoneless_scheduling.mjs +13 -0
- package/esm2022/src/core.mjs +2 -2
- package/esm2022/src/core_private_export.mjs +4 -2
- package/esm2022/src/event_emitter.mjs +1 -2
- package/esm2022/src/pending_tasks.mjs +57 -0
- package/esm2022/src/platform/platform_ref.mjs +2 -2
- package/esm2022/src/render3/after_render_hooks.mjs +2 -2
- package/esm2022/src/render3/component_ref.mjs +13 -9
- package/esm2022/src/render3/instructions/control_flow.mjs +5 -3
- package/esm2022/src/render3/instructions/mark_view_dirty.mjs +3 -2
- package/esm2022/src/render3/instructions/shared.mjs +3 -2
- package/esm2022/src/render3/interfaces/view.mjs +1 -1
- package/esm2022/src/render3/util/view_utils.mjs +18 -5
- package/esm2022/src/render3/view_ref.mjs +2 -1
- package/esm2022/src/version.mjs +6 -5
- package/esm2022/src/zone/ng_zone.mjs +1 -61
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +176 -138
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +1 -1
- package/index.d.ts +41 -23
- package/package.json +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/block-template-entities/bundle.js +378 -278
- package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
- package/schematics/ng-generate/control-flow-migration/bundle.js +543 -344
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
- package/schematics/ng-generate/standalone-migration/bundle.js +412 -266
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
- package/esm2022/src/change_detection/scheduling.mjs +0 -103
- package/esm2022/src/initial_render_pending_tasks.mjs +0 -49
|
@@ -2369,7 +2369,7 @@ var ConstantPool = class {
|
|
|
2369
2369
|
}))));
|
|
2370
2370
|
}
|
|
2371
2371
|
}
|
|
2372
|
-
getSharedFunctionReference(fn2, prefix) {
|
|
2372
|
+
getSharedFunctionReference(fn2, prefix, useUniqueName = true) {
|
|
2373
2373
|
var _a2;
|
|
2374
2374
|
const isArrow = fn2 instanceof ArrowFunctionExpr;
|
|
2375
2375
|
for (const current of this.statements) {
|
|
@@ -2380,7 +2380,7 @@ var ConstantPool = class {
|
|
|
2380
2380
|
return variable(current.name);
|
|
2381
2381
|
}
|
|
2382
2382
|
}
|
|
2383
|
-
const name = this.uniqueName(prefix);
|
|
2383
|
+
const name = useUniqueName ? this.uniqueName(prefix) : prefix;
|
|
2384
2384
|
this.statements.push(fn2.toDeclStmt(name, StmtModifier.Final));
|
|
2385
2385
|
return variable(name);
|
|
2386
2386
|
}
|
|
@@ -4010,13 +4010,17 @@ var TagContentType;
|
|
|
4010
4010
|
TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
|
|
4011
4011
|
TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
|
|
4012
4012
|
})(TagContentType || (TagContentType = {}));
|
|
4013
|
-
function splitNsName(elementName) {
|
|
4013
|
+
function splitNsName(elementName, fatal = true) {
|
|
4014
4014
|
if (elementName[0] != ":") {
|
|
4015
4015
|
return [null, elementName];
|
|
4016
4016
|
}
|
|
4017
4017
|
const colonIndex = elementName.indexOf(":", 1);
|
|
4018
4018
|
if (colonIndex === -1) {
|
|
4019
|
-
|
|
4019
|
+
if (fatal) {
|
|
4020
|
+
throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
|
|
4021
|
+
} else {
|
|
4022
|
+
return [null, elementName];
|
|
4023
|
+
}
|
|
4020
4024
|
}
|
|
4021
4025
|
return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
|
|
4022
4026
|
}
|
|
@@ -7978,8 +7982,9 @@ var OpKind;
|
|
|
7978
7982
|
OpKind2[OpKind2["I18nApply"] = 40] = "I18nApply";
|
|
7979
7983
|
OpKind2[OpKind2["IcuStart"] = 41] = "IcuStart";
|
|
7980
7984
|
OpKind2[OpKind2["IcuEnd"] = 42] = "IcuEnd";
|
|
7981
|
-
OpKind2[OpKind2["
|
|
7982
|
-
OpKind2[OpKind2["
|
|
7985
|
+
OpKind2[OpKind2["IcuPlaceholder"] = 43] = "IcuPlaceholder";
|
|
7986
|
+
OpKind2[OpKind2["I18nContext"] = 44] = "I18nContext";
|
|
7987
|
+
OpKind2[OpKind2["I18nAttributes"] = 45] = "I18nAttributes";
|
|
7983
7988
|
})(OpKind || (OpKind = {}));
|
|
7984
7989
|
var ExpressionKind;
|
|
7985
7990
|
(function(ExpressionKind2) {
|
|
@@ -8283,15 +8288,15 @@ function createRepeaterOp(repeaterCreate2, targetSlot, collection, sourceSpan) {
|
|
|
8283
8288
|
}, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
|
|
8284
8289
|
}
|
|
8285
8290
|
function createDeferWhenOp(target, expr, prefetch, sourceSpan) {
|
|
8286
|
-
return __spreadValues(__spreadValues({
|
|
8291
|
+
return __spreadValues(__spreadValues(__spreadValues({
|
|
8287
8292
|
kind: OpKind.DeferWhen,
|
|
8288
8293
|
target,
|
|
8289
8294
|
expr,
|
|
8290
8295
|
prefetch,
|
|
8291
8296
|
sourceSpan
|
|
8292
|
-
}, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
|
|
8297
|
+
}, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
|
|
8293
8298
|
}
|
|
8294
|
-
function createI18nExpressionOp(context, target, i18nOwner, handle, expression, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
|
|
8299
|
+
function createI18nExpressionOp(context, target, i18nOwner, handle, expression, icuPlaceholder, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
|
|
8295
8300
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
8296
8301
|
kind: OpKind.I18nExpression,
|
|
8297
8302
|
context,
|
|
@@ -8299,6 +8304,7 @@ function createI18nExpressionOp(context, target, i18nOwner, handle, expression,
|
|
|
8299
8304
|
i18nOwner,
|
|
8300
8305
|
handle,
|
|
8301
8306
|
expression,
|
|
8307
|
+
icuPlaceholder,
|
|
8302
8308
|
i18nPlaceholder,
|
|
8303
8309
|
resolutionTime,
|
|
8304
8310
|
usage,
|
|
@@ -9031,6 +9037,9 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
9031
9037
|
if (op.placeholderConfig !== null) {
|
|
9032
9038
|
op.placeholderConfig = transformExpressionsInExpression(op.placeholderConfig, transform2, flags);
|
|
9033
9039
|
}
|
|
9040
|
+
if (op.resolverFn !== null) {
|
|
9041
|
+
op.resolverFn = transformExpressionsInExpression(op.resolverFn, transform2, flags);
|
|
9042
|
+
}
|
|
9034
9043
|
break;
|
|
9035
9044
|
case OpKind.I18nMessage:
|
|
9036
9045
|
for (const [placeholder, expr] of op.params) {
|
|
@@ -9067,6 +9076,7 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
9067
9076
|
case OpKind.Template:
|
|
9068
9077
|
case OpKind.Text:
|
|
9069
9078
|
case OpKind.I18nAttributes:
|
|
9079
|
+
case OpKind.IcuPlaceholder:
|
|
9070
9080
|
break;
|
|
9071
9081
|
default:
|
|
9072
9082
|
throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
|
|
@@ -9124,6 +9134,14 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
9124
9134
|
} else if (expr instanceof TaggedTemplateExpr) {
|
|
9125
9135
|
expr.tag = transformExpressionsInExpression(expr.tag, transform2, flags);
|
|
9126
9136
|
expr.template.expressions = expr.template.expressions.map((e) => transformExpressionsInExpression(e, transform2, flags));
|
|
9137
|
+
} else if (expr instanceof ArrowFunctionExpr) {
|
|
9138
|
+
if (Array.isArray(expr.body)) {
|
|
9139
|
+
for (let i = 0; i < expr.body.length; i++) {
|
|
9140
|
+
transformExpressionsInStatement(expr.body[i], transform2, flags);
|
|
9141
|
+
}
|
|
9142
|
+
} else {
|
|
9143
|
+
expr.body = transformExpressionsInExpression(expr.body, transform2, flags);
|
|
9144
|
+
}
|
|
9127
9145
|
} else if (expr instanceof WrappedNodeExpr) {
|
|
9128
9146
|
} else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) {
|
|
9129
9147
|
} else {
|
|
@@ -9366,7 +9384,7 @@ var elementContainerOpKinds = /* @__PURE__ */ new Set([
|
|
|
9366
9384
|
function isElementOrContainerOp(op) {
|
|
9367
9385
|
return elementContainerOpKinds.has(op.kind);
|
|
9368
9386
|
}
|
|
9369
|
-
function createElementStartOp(tag, xref, namespace, i18nPlaceholder,
|
|
9387
|
+
function createElementStartOp(tag, xref, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
|
|
9370
9388
|
return __spreadValues(__spreadValues({
|
|
9371
9389
|
kind: OpKind.ElementStart,
|
|
9372
9390
|
xref,
|
|
@@ -9377,10 +9395,11 @@ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan)
|
|
|
9377
9395
|
nonBindable: false,
|
|
9378
9396
|
namespace,
|
|
9379
9397
|
i18nPlaceholder,
|
|
9380
|
-
|
|
9398
|
+
startSourceSpan,
|
|
9399
|
+
wholeSourceSpan
|
|
9381
9400
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
9382
9401
|
}
|
|
9383
|
-
function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder,
|
|
9402
|
+
function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) {
|
|
9384
9403
|
return __spreadValues(__spreadValues({
|
|
9385
9404
|
kind: OpKind.Template,
|
|
9386
9405
|
xref,
|
|
@@ -9395,11 +9414,12 @@ function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace
|
|
|
9395
9414
|
nonBindable: false,
|
|
9396
9415
|
namespace,
|
|
9397
9416
|
i18nPlaceholder,
|
|
9398
|
-
|
|
9417
|
+
startSourceSpan,
|
|
9418
|
+
wholeSourceSpan
|
|
9399
9419
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
9400
9420
|
}
|
|
9401
|
-
function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, i18nPlaceholder, emptyI18nPlaceholder,
|
|
9402
|
-
return __spreadProps(__spreadValues(__spreadValues({
|
|
9421
|
+
function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, emptyTag, i18nPlaceholder, emptyI18nPlaceholder, startSourceSpan, wholeSourceSpan) {
|
|
9422
|
+
return __spreadProps(__spreadValues(__spreadValues(__spreadValues({
|
|
9403
9423
|
kind: OpKind.RepeaterCreate,
|
|
9404
9424
|
attributes: null,
|
|
9405
9425
|
xref: primaryView,
|
|
@@ -9408,6 +9428,8 @@ function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, i1
|
|
|
9408
9428
|
track,
|
|
9409
9429
|
trackByFn: null,
|
|
9410
9430
|
tag,
|
|
9431
|
+
emptyTag,
|
|
9432
|
+
emptyAttributes: null,
|
|
9411
9433
|
functionNameSuffix: "For",
|
|
9412
9434
|
namespace: Namespace.HTML,
|
|
9413
9435
|
nonBindable: false,
|
|
@@ -9418,8 +9440,9 @@ function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, i1
|
|
|
9418
9440
|
usesComponentInstance: false,
|
|
9419
9441
|
i18nPlaceholder,
|
|
9420
9442
|
emptyI18nPlaceholder,
|
|
9421
|
-
|
|
9422
|
-
|
|
9443
|
+
startSourceSpan,
|
|
9444
|
+
wholeSourceSpan
|
|
9445
|
+
}, TRAIT_CONSUMES_SLOT), NEW_OP), TRAIT_CONSUMES_VARS), {
|
|
9423
9446
|
numSlotsUsed: emptyView === null ? 2 : 3
|
|
9424
9447
|
});
|
|
9425
9448
|
}
|
|
@@ -9442,12 +9465,13 @@ function createEnableBindingsOp(xref) {
|
|
|
9442
9465
|
xref
|
|
9443
9466
|
}, NEW_OP);
|
|
9444
9467
|
}
|
|
9445
|
-
function createTextOp(xref, initialValue, sourceSpan) {
|
|
9468
|
+
function createTextOp(xref, initialValue, icuPlaceholder, sourceSpan) {
|
|
9446
9469
|
return __spreadValues(__spreadValues({
|
|
9447
9470
|
kind: OpKind.Text,
|
|
9448
9471
|
xref,
|
|
9449
9472
|
handle: new SlotHandle(),
|
|
9450
9473
|
initialValue,
|
|
9474
|
+
icuPlaceholder,
|
|
9451
9475
|
sourceSpan
|
|
9452
9476
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
9453
9477
|
}
|
|
@@ -9490,7 +9514,7 @@ function createProjectionDefOp(def) {
|
|
|
9490
9514
|
def
|
|
9491
9515
|
}, NEW_OP);
|
|
9492
9516
|
}
|
|
9493
|
-
function createProjectionOp(xref, selector, i18nPlaceholder,
|
|
9517
|
+
function createProjectionOp(xref, selector, i18nPlaceholder, sourceSpan) {
|
|
9494
9518
|
return __spreadValues(__spreadValues({
|
|
9495
9519
|
kind: OpKind.Projection,
|
|
9496
9520
|
xref,
|
|
@@ -9498,7 +9522,7 @@ function createProjectionOp(xref, selector, i18nPlaceholder, attributes, sourceS
|
|
|
9498
9522
|
selector,
|
|
9499
9523
|
i18nPlaceholder,
|
|
9500
9524
|
projectionSlotIndex: 0,
|
|
9501
|
-
attributes,
|
|
9525
|
+
attributes: null,
|
|
9502
9526
|
localRefs: [],
|
|
9503
9527
|
sourceSpan
|
|
9504
9528
|
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
@@ -9564,7 +9588,7 @@ function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlace
|
|
|
9564
9588
|
subMessages: []
|
|
9565
9589
|
}, NEW_OP);
|
|
9566
9590
|
}
|
|
9567
|
-
function createI18nStartOp(xref, message, root) {
|
|
9591
|
+
function createI18nStartOp(xref, message, root, sourceSpan) {
|
|
9568
9592
|
return __spreadValues(__spreadValues({
|
|
9569
9593
|
kind: OpKind.I18nStart,
|
|
9570
9594
|
xref,
|
|
@@ -9573,13 +9597,15 @@ function createI18nStartOp(xref, message, root) {
|
|
|
9573
9597
|
message,
|
|
9574
9598
|
messageIndex: null,
|
|
9575
9599
|
subTemplateIndex: null,
|
|
9576
|
-
context: null
|
|
9600
|
+
context: null,
|
|
9601
|
+
sourceSpan
|
|
9577
9602
|
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
9578
9603
|
}
|
|
9579
|
-
function createI18nEndOp(xref) {
|
|
9604
|
+
function createI18nEndOp(xref, sourceSpan) {
|
|
9580
9605
|
return __spreadValues({
|
|
9581
9606
|
kind: OpKind.I18nEnd,
|
|
9582
|
-
xref
|
|
9607
|
+
xref,
|
|
9608
|
+
sourceSpan
|
|
9583
9609
|
}, NEW_OP);
|
|
9584
9610
|
}
|
|
9585
9611
|
function createIcuStartOp(xref, message, messagePlaceholder, sourceSpan) {
|
|
@@ -9598,6 +9624,15 @@ function createIcuEndOp(xref) {
|
|
|
9598
9624
|
xref
|
|
9599
9625
|
}, NEW_OP);
|
|
9600
9626
|
}
|
|
9627
|
+
function createIcuPlaceholderOp(xref, name, strings) {
|
|
9628
|
+
return __spreadValues({
|
|
9629
|
+
kind: OpKind.IcuPlaceholder,
|
|
9630
|
+
xref,
|
|
9631
|
+
name,
|
|
9632
|
+
strings,
|
|
9633
|
+
expressionPlaceholders: []
|
|
9634
|
+
}, NEW_OP);
|
|
9635
|
+
}
|
|
9601
9636
|
function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {
|
|
9602
9637
|
if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {
|
|
9603
9638
|
throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");
|
|
@@ -9861,6 +9896,9 @@ function createOpXrefMap(unit) {
|
|
|
9861
9896
|
continue;
|
|
9862
9897
|
}
|
|
9863
9898
|
map.set(op.xref, op);
|
|
9899
|
+
if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) {
|
|
9900
|
+
map.set(op.emptyView, op);
|
|
9901
|
+
}
|
|
9864
9902
|
}
|
|
9865
9903
|
return map;
|
|
9866
9904
|
}
|
|
@@ -9924,6 +9962,9 @@ function extractAttributes(job) {
|
|
|
9924
9962
|
SecurityContext.NONE
|
|
9925
9963
|
);
|
|
9926
9964
|
if (job.kind === CompilationJobKind.Host) {
|
|
9965
|
+
if (job.compatibility) {
|
|
9966
|
+
break;
|
|
9967
|
+
}
|
|
9927
9968
|
unit.create.push(extractedAttributeOp);
|
|
9928
9969
|
} else {
|
|
9929
9970
|
OpList.insertBefore(extractedAttributeOp, lookupElement(elements, op.target));
|
|
@@ -9945,15 +9986,9 @@ function extractAttributeOp(unit, op, elements) {
|
|
|
9945
9986
|
if (op.expression instanceof Interpolation2) {
|
|
9946
9987
|
return;
|
|
9947
9988
|
}
|
|
9948
|
-
let extractable = op.expression.isConstant();
|
|
9989
|
+
let extractable = op.isTextAttribute || op.expression.isConstant();
|
|
9949
9990
|
if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
|
|
9950
|
-
extractable =
|
|
9951
|
-
if (op.name === "style" || op.name === "class") {
|
|
9952
|
-
extractable && (extractable = op.isTextAttribute);
|
|
9953
|
-
}
|
|
9954
|
-
if (unit.job.kind === CompilationJobKind.Host) {
|
|
9955
|
-
extractable && (extractable = op.isTextAttribute);
|
|
9956
|
-
}
|
|
9991
|
+
extractable && (extractable = op.isTextAttribute);
|
|
9957
9992
|
}
|
|
9958
9993
|
if (extractable) {
|
|
9959
9994
|
const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplateAttribute ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression, op.i18nContext, op.i18nMessage, op.securityContext);
|
|
@@ -10188,7 +10223,7 @@ function collectElementConsts(job) {
|
|
|
10188
10223
|
for (const unit of job.units) {
|
|
10189
10224
|
for (const op of unit.create) {
|
|
10190
10225
|
if (op.kind === OpKind.ExtractedAttribute) {
|
|
10191
|
-
const attributes = allElementAttributes.get(op.target) || new ElementAttributes();
|
|
10226
|
+
const attributes = allElementAttributes.get(op.target) || new ElementAttributes(job.compatibility);
|
|
10192
10227
|
allElementAttributes.set(op.target, attributes);
|
|
10193
10228
|
attributes.add(op.bindingKind, op.name, op.expression, op.trustedValueFn);
|
|
10194
10229
|
OpList.remove(op);
|
|
@@ -10198,14 +10233,19 @@ function collectElementConsts(job) {
|
|
|
10198
10233
|
if (job instanceof ComponentCompilationJob) {
|
|
10199
10234
|
for (const unit of job.units) {
|
|
10200
10235
|
for (const op of unit.create) {
|
|
10201
|
-
if (
|
|
10236
|
+
if (op.kind == OpKind.Projection) {
|
|
10202
10237
|
const attributes = allElementAttributes.get(op.xref);
|
|
10203
10238
|
if (attributes !== void 0) {
|
|
10204
10239
|
const attrArray = serializeAttributes(attributes);
|
|
10205
10240
|
if (attrArray.entries.length > 0) {
|
|
10206
|
-
op.attributes =
|
|
10241
|
+
op.attributes = attrArray;
|
|
10207
10242
|
}
|
|
10208
10243
|
}
|
|
10244
|
+
} else if (isElementOrContainerOp(op)) {
|
|
10245
|
+
op.attributes = getConstIndex(job, allElementAttributes, op.xref);
|
|
10246
|
+
if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) {
|
|
10247
|
+
op.emptyAttributes = getConstIndex(job, allElementAttributes, op.emptyView);
|
|
10248
|
+
}
|
|
10209
10249
|
}
|
|
10210
10250
|
}
|
|
10211
10251
|
}
|
|
@@ -10221,13 +10261,18 @@ function collectElementConsts(job) {
|
|
|
10221
10261
|
}
|
|
10222
10262
|
}
|
|
10223
10263
|
}
|
|
10264
|
+
function getConstIndex(job, allElementAttributes, xref) {
|
|
10265
|
+
const attributes = allElementAttributes.get(xref);
|
|
10266
|
+
if (attributes !== void 0) {
|
|
10267
|
+
const attrArray = serializeAttributes(attributes);
|
|
10268
|
+
if (attrArray.entries.length > 0) {
|
|
10269
|
+
return job.addConst(attrArray);
|
|
10270
|
+
}
|
|
10271
|
+
}
|
|
10272
|
+
return null;
|
|
10273
|
+
}
|
|
10224
10274
|
var FLYWEIGHT_ARRAY = Object.freeze([]);
|
|
10225
10275
|
var ElementAttributes = class {
|
|
10226
|
-
constructor() {
|
|
10227
|
-
this.known = /* @__PURE__ */ new Set();
|
|
10228
|
-
this.byKind = /* @__PURE__ */ new Map();
|
|
10229
|
-
this.projectAs = null;
|
|
10230
|
-
}
|
|
10231
10276
|
get attributes() {
|
|
10232
10277
|
var _a2;
|
|
10233
10278
|
return (_a2 = this.byKind.get(BindingKind.Attribute)) != null ? _a2 : FLYWEIGHT_ARRAY;
|
|
@@ -10252,12 +10297,28 @@ var ElementAttributes = class {
|
|
|
10252
10297
|
var _a2;
|
|
10253
10298
|
return (_a2 = this.byKind.get(BindingKind.I18n)) != null ? _a2 : FLYWEIGHT_ARRAY;
|
|
10254
10299
|
}
|
|
10300
|
+
constructor(compatibility) {
|
|
10301
|
+
this.compatibility = compatibility;
|
|
10302
|
+
this.known = /* @__PURE__ */ new Map();
|
|
10303
|
+
this.byKind = /* @__PURE__ */ new Map();
|
|
10304
|
+
this.projectAs = null;
|
|
10305
|
+
}
|
|
10306
|
+
isKnown(kind, name, value) {
|
|
10307
|
+
var _a2;
|
|
10308
|
+
const nameToValue = (_a2 = this.known.get(kind)) != null ? _a2 : /* @__PURE__ */ new Set();
|
|
10309
|
+
this.known.set(kind, nameToValue);
|
|
10310
|
+
if (nameToValue.has(name)) {
|
|
10311
|
+
return true;
|
|
10312
|
+
}
|
|
10313
|
+
nameToValue.add(name);
|
|
10314
|
+
return false;
|
|
10315
|
+
}
|
|
10255
10316
|
add(kind, name, value, trustedValueFn) {
|
|
10256
10317
|
var _a2;
|
|
10257
|
-
|
|
10318
|
+
const allowDuplicates = this.compatibility === CompatibilityMode.TemplateDefinitionBuilder && (kind === BindingKind.Attribute || kind === BindingKind.ClassName || kind === BindingKind.StyleProperty);
|
|
10319
|
+
if (!allowDuplicates && this.isKnown(kind, name, value)) {
|
|
10258
10320
|
return;
|
|
10259
10321
|
}
|
|
10260
|
-
this.known.add(name);
|
|
10261
10322
|
if (name === "ngProjectAs") {
|
|
10262
10323
|
if (value === null || !(value instanceof LiteralExpr) || value.value == null || typeof ((_a2 = value.value) == null ? void 0 : _a2.toString()) !== "string") {
|
|
10263
10324
|
throw Error("ngProjectAs must have a string literal value");
|
|
@@ -10288,7 +10349,7 @@ var ElementAttributes = class {
|
|
|
10288
10349
|
}
|
|
10289
10350
|
};
|
|
10290
10351
|
function getAttributeNameLiterals(name) {
|
|
10291
|
-
const [attributeNamespace, attributeName] = splitNsName(name);
|
|
10352
|
+
const [attributeNamespace, attributeName] = splitNsName(name, false);
|
|
10292
10353
|
const nameLiteral = literal(attributeName);
|
|
10293
10354
|
if (attributeNamespace) {
|
|
10294
10355
|
return [
|
|
@@ -10355,7 +10416,7 @@ function convertI18nBindings(job) {
|
|
|
10355
10416
|
if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {
|
|
10356
10417
|
throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`);
|
|
10357
10418
|
}
|
|
10358
|
-
ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
|
|
10419
|
+
ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, null, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
|
|
10359
10420
|
}
|
|
10360
10421
|
OpList.replaceWithMany(op, ops);
|
|
10361
10422
|
break;
|
|
@@ -10386,7 +10447,11 @@ function createDeferDepsFns(job) {
|
|
|
10386
10447
|
if (op.handle.slot === null) {
|
|
10387
10448
|
throw new Error("AssertionError: slot must be assigned bfore extracting defer deps functions");
|
|
10388
10449
|
}
|
|
10389
|
-
op.resolverFn = job.pool.getSharedFunctionReference(
|
|
10450
|
+
op.resolverFn = job.pool.getSharedFunctionReference(
|
|
10451
|
+
depsFnExpr,
|
|
10452
|
+
`${job.componentName}_Defer_${op.handle.slot}_DepsFn`,
|
|
10453
|
+
false
|
|
10454
|
+
);
|
|
10390
10455
|
}
|
|
10391
10456
|
}
|
|
10392
10457
|
}
|
|
@@ -10394,62 +10459,99 @@ function createDeferDepsFns(job) {
|
|
|
10394
10459
|
|
|
10395
10460
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
|
|
10396
10461
|
function createI18nContexts(job) {
|
|
10397
|
-
const
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
|
|
10462
|
+
const attrContextByMessage = /* @__PURE__ */ new Map();
|
|
10463
|
+
for (const unit of job.units) {
|
|
10464
|
+
for (const op of unit.ops()) {
|
|
10465
|
+
switch (op.kind) {
|
|
10466
|
+
case OpKind.Binding:
|
|
10467
|
+
case OpKind.Property:
|
|
10468
|
+
case OpKind.Attribute:
|
|
10469
|
+
case OpKind.ExtractedAttribute:
|
|
10470
|
+
if (op.i18nMessage === null) {
|
|
10471
|
+
continue;
|
|
10472
|
+
}
|
|
10473
|
+
if (!attrContextByMessage.has(op.i18nMessage)) {
|
|
10474
|
+
const i18nContext = createI18nContextOp(I18nContextKind.Attr, job.allocateXrefId(), null, op.i18nMessage, null);
|
|
10475
|
+
unit.create.push(i18nContext);
|
|
10476
|
+
attrContextByMessage.set(op.i18nMessage, i18nContext.xref);
|
|
10477
|
+
}
|
|
10478
|
+
op.i18nContext = attrContextByMessage.get(op.i18nMessage);
|
|
10479
|
+
break;
|
|
10480
|
+
}
|
|
10481
|
+
}
|
|
10482
|
+
}
|
|
10483
|
+
const blockContextByI18nBlock = /* @__PURE__ */ new Map();
|
|
10401
10484
|
for (const unit of job.units) {
|
|
10402
10485
|
for (const op of unit.create) {
|
|
10403
10486
|
switch (op.kind) {
|
|
10404
10487
|
case OpKind.I18nStart:
|
|
10405
|
-
currentI18nOp = op;
|
|
10406
10488
|
if (op.xref === op.root) {
|
|
10407
|
-
|
|
10408
|
-
unit.create.push(
|
|
10409
|
-
op.context = xref;
|
|
10410
|
-
|
|
10489
|
+
const contextOp = createI18nContextOp(I18nContextKind.RootI18n, job.allocateXrefId(), op.xref, op.message, null);
|
|
10490
|
+
unit.create.push(contextOp);
|
|
10491
|
+
op.context = contextOp.xref;
|
|
10492
|
+
blockContextByI18nBlock.set(op.xref, contextOp);
|
|
10411
10493
|
}
|
|
10412
10494
|
break;
|
|
10495
|
+
}
|
|
10496
|
+
}
|
|
10497
|
+
}
|
|
10498
|
+
for (const unit of job.units) {
|
|
10499
|
+
for (const op of unit.create) {
|
|
10500
|
+
if (op.kind === OpKind.I18nStart && op.xref !== op.root) {
|
|
10501
|
+
const rootContext = blockContextByI18nBlock.get(op.root);
|
|
10502
|
+
if (rootContext === void 0) {
|
|
10503
|
+
throw Error("AssertionError: Root i18n block i18n context should have been created.");
|
|
10504
|
+
}
|
|
10505
|
+
op.context = rootContext.xref;
|
|
10506
|
+
blockContextByI18nBlock.set(op.xref, rootContext);
|
|
10507
|
+
}
|
|
10508
|
+
}
|
|
10509
|
+
}
|
|
10510
|
+
let currentI18nOp = null;
|
|
10511
|
+
for (const unit of job.units) {
|
|
10512
|
+
for (const op of unit.create) {
|
|
10513
|
+
switch (op.kind) {
|
|
10514
|
+
case OpKind.I18nStart:
|
|
10515
|
+
currentI18nOp = op;
|
|
10516
|
+
break;
|
|
10413
10517
|
case OpKind.I18nEnd:
|
|
10414
10518
|
currentI18nOp = null;
|
|
10415
10519
|
break;
|
|
10416
10520
|
case OpKind.IcuStart:
|
|
10417
10521
|
if (currentI18nOp === null) {
|
|
10418
|
-
throw Error("Unexpected ICU outside of an i18n block.");
|
|
10522
|
+
throw Error("AssertionError: Unexpected ICU outside of an i18n block.");
|
|
10419
10523
|
}
|
|
10420
10524
|
if (op.message.id !== currentI18nOp.message.id) {
|
|
10421
|
-
|
|
10422
|
-
unit.create.push(
|
|
10423
|
-
op.context = xref;
|
|
10525
|
+
const contextOp = createI18nContextOp(I18nContextKind.Icu, job.allocateXrefId(), currentI18nOp.xref, op.message, null);
|
|
10526
|
+
unit.create.push(contextOp);
|
|
10527
|
+
op.context = contextOp.xref;
|
|
10424
10528
|
} else {
|
|
10425
10529
|
op.context = currentI18nOp.context;
|
|
10530
|
+
blockContextByI18nBlock.get(currentI18nOp.xref).contextKind = I18nContextKind.Icu;
|
|
10426
10531
|
}
|
|
10427
10532
|
break;
|
|
10428
10533
|
}
|
|
10429
10534
|
}
|
|
10430
|
-
for (const op of unit.ops()) {
|
|
10431
|
-
switch (op.kind) {
|
|
10432
|
-
case OpKind.Binding:
|
|
10433
|
-
case OpKind.Property:
|
|
10434
|
-
case OpKind.Attribute:
|
|
10435
|
-
case OpKind.ExtractedAttribute:
|
|
10436
|
-
if (!op.i18nMessage) {
|
|
10437
|
-
continue;
|
|
10438
|
-
}
|
|
10439
|
-
if (!messageToContext.has(op.i18nMessage)) {
|
|
10440
|
-
const i18nContext = job.allocateXrefId();
|
|
10441
|
-
unit.create.push(createI18nContextOp(I18nContextKind.Attr, i18nContext, null, op.i18nMessage, null));
|
|
10442
|
-
messageToContext.set(op.i18nMessage, i18nContext);
|
|
10443
|
-
}
|
|
10444
|
-
op.i18nContext = messageToContext.get(op.i18nMessage);
|
|
10445
|
-
break;
|
|
10446
|
-
}
|
|
10447
|
-
}
|
|
10448
10535
|
}
|
|
10536
|
+
}
|
|
10537
|
+
|
|
10538
|
+
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/deduplicate_text_bindings.mjs
|
|
10539
|
+
function deduplicateTextBindings(job) {
|
|
10540
|
+
const seen = /* @__PURE__ */ new Map();
|
|
10449
10541
|
for (const unit of job.units) {
|
|
10450
|
-
for (const op of unit.
|
|
10451
|
-
if (op.kind === OpKind.
|
|
10452
|
-
|
|
10542
|
+
for (const op of unit.update.reversed()) {
|
|
10543
|
+
if (op.kind === OpKind.Binding && op.isTextAttribute) {
|
|
10544
|
+
const seenForElement = seen.get(op.target) || /* @__PURE__ */ new Set();
|
|
10545
|
+
if (seenForElement.has(op.name)) {
|
|
10546
|
+
if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
|
|
10547
|
+
if (op.name === "style" || op.name === "class") {
|
|
10548
|
+
OpList.remove(op);
|
|
10549
|
+
}
|
|
10550
|
+
} else {
|
|
10551
|
+
}
|
|
10552
|
+
}
|
|
10553
|
+
seenForElement.add(op.name);
|
|
10554
|
+
seen.set(op.target, seenForElement);
|
|
10453
10555
|
}
|
|
10454
10556
|
}
|
|
10455
10557
|
}
|
|
@@ -10739,12 +10841,16 @@ var LIST_START_MARKER = "[";
|
|
|
10739
10841
|
var LIST_END_MARKER = "]";
|
|
10740
10842
|
var LIST_DELIMITER = "|";
|
|
10741
10843
|
function extractI18nMessages(job) {
|
|
10742
|
-
const
|
|
10844
|
+
const i18nMessagesByContext = /* @__PURE__ */ new Map();
|
|
10743
10845
|
const i18nBlocks = /* @__PURE__ */ new Map();
|
|
10846
|
+
const i18nContexts = /* @__PURE__ */ new Map();
|
|
10744
10847
|
for (const unit of job.units) {
|
|
10745
10848
|
for (const op of unit.create) {
|
|
10746
10849
|
switch (op.kind) {
|
|
10747
10850
|
case OpKind.I18nContext:
|
|
10851
|
+
const i18nMessageOp = createI18nMessage(job, op);
|
|
10852
|
+
unit.create.push(i18nMessageOp);
|
|
10853
|
+
i18nMessagesByContext.set(op.xref, i18nMessageOp);
|
|
10748
10854
|
i18nContexts.set(op.xref, op);
|
|
10749
10855
|
break;
|
|
10750
10856
|
case OpKind.I18nStart:
|
|
@@ -10753,49 +10859,40 @@ function extractI18nMessages(job) {
|
|
|
10753
10859
|
}
|
|
10754
10860
|
}
|
|
10755
10861
|
}
|
|
10756
|
-
|
|
10757
|
-
for (const op of unit.create) {
|
|
10758
|
-
if (op.kind !== OpKind.I18nContext || op.contextKind !== I18nContextKind.Attr) {
|
|
10759
|
-
continue;
|
|
10760
|
-
}
|
|
10761
|
-
const i18nMessageOp = createI18nMessage(job, op);
|
|
10762
|
-
unit.create.push(i18nMessageOp);
|
|
10763
|
-
}
|
|
10764
|
-
}
|
|
10765
|
-
const i18nBlockMessages = /* @__PURE__ */ new Map();
|
|
10766
|
-
for (const unit of job.units) {
|
|
10767
|
-
for (const op of unit.create) {
|
|
10768
|
-
if (op.kind === OpKind.I18nStart && op.xref === op.root) {
|
|
10769
|
-
if (!op.context) {
|
|
10770
|
-
throw Error("I18n start op should have its context set.");
|
|
10771
|
-
}
|
|
10772
|
-
const i18nMessageOp = createI18nMessage(job, i18nContexts.get(op.context));
|
|
10773
|
-
i18nBlockMessages.set(op.xref, i18nMessageOp);
|
|
10774
|
-
unit.create.push(i18nMessageOp);
|
|
10775
|
-
}
|
|
10776
|
-
}
|
|
10777
|
-
}
|
|
10862
|
+
let currentIcu = null;
|
|
10778
10863
|
for (const unit of job.units) {
|
|
10779
10864
|
for (const op of unit.create) {
|
|
10780
10865
|
switch (op.kind) {
|
|
10781
10866
|
case OpKind.IcuStart:
|
|
10782
|
-
|
|
10783
|
-
|
|
10867
|
+
currentIcu = op;
|
|
10868
|
+
OpList.remove(op);
|
|
10869
|
+
const icuContext = i18nContexts.get(op.context);
|
|
10870
|
+
if (icuContext.contextKind !== I18nContextKind.Icu) {
|
|
10871
|
+
continue;
|
|
10784
10872
|
}
|
|
10785
|
-
const
|
|
10786
|
-
if (
|
|
10787
|
-
|
|
10788
|
-
throw Error("ICU context should have its i18n block set.");
|
|
10789
|
-
}
|
|
10790
|
-
const subMessage = createI18nMessage(job, i18nContext, op.messagePlaceholder);
|
|
10791
|
-
unit.create.push(subMessage);
|
|
10792
|
-
const rootI18nId = i18nBlocks.get(i18nContext.i18nBlock).root;
|
|
10793
|
-
const parentMessage = i18nBlockMessages.get(rootI18nId);
|
|
10794
|
-
parentMessage == null ? void 0 : parentMessage.subMessages.push(subMessage.xref);
|
|
10873
|
+
const i18nBlock = i18nBlocks.get(icuContext.i18nBlock);
|
|
10874
|
+
if (i18nBlock.context === icuContext.xref) {
|
|
10875
|
+
continue;
|
|
10795
10876
|
}
|
|
10796
|
-
|
|
10877
|
+
const rootI18nBlock = i18nBlocks.get(i18nBlock.root);
|
|
10878
|
+
const rootMessage = i18nMessagesByContext.get(rootI18nBlock.context);
|
|
10879
|
+
if (rootMessage === void 0) {
|
|
10880
|
+
throw Error("AssertionError: ICU sub-message should belong to a root message.");
|
|
10881
|
+
}
|
|
10882
|
+
const subMessage = i18nMessagesByContext.get(icuContext.xref);
|
|
10883
|
+
subMessage.messagePlaceholder = op.messagePlaceholder;
|
|
10884
|
+
rootMessage.subMessages.push(subMessage.xref);
|
|
10797
10885
|
break;
|
|
10798
10886
|
case OpKind.IcuEnd:
|
|
10887
|
+
currentIcu = null;
|
|
10888
|
+
OpList.remove(op);
|
|
10889
|
+
break;
|
|
10890
|
+
case OpKind.IcuPlaceholder:
|
|
10891
|
+
if (currentIcu === null || currentIcu.context == null) {
|
|
10892
|
+
throw Error("AssertionError: Unexpected ICU placeholder outside of i18n context");
|
|
10893
|
+
}
|
|
10894
|
+
const msg = i18nMessagesByContext.get(currentIcu.context);
|
|
10895
|
+
msg.postprocessingParams.set(op.name, literal(formatIcuPlaceholder(op)));
|
|
10799
10896
|
OpList.remove(op);
|
|
10800
10897
|
break;
|
|
10801
10898
|
}
|
|
@@ -10805,14 +10902,16 @@ function extractI18nMessages(job) {
|
|
|
10805
10902
|
function createI18nMessage(job, context, messagePlaceholder) {
|
|
10806
10903
|
let formattedParams = formatParams(context.params);
|
|
10807
10904
|
const formattedPostprocessingParams = formatParams(context.postprocessingParams);
|
|
10808
|
-
let needsPostprocessing =
|
|
10809
|
-
for (const values of context.params.values()) {
|
|
10810
|
-
if (values.length > 1) {
|
|
10811
|
-
needsPostprocessing = true;
|
|
10812
|
-
}
|
|
10813
|
-
}
|
|
10905
|
+
let needsPostprocessing = [...context.params.values()].some((v) => v.length > 1);
|
|
10814
10906
|
return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
|
|
10815
10907
|
}
|
|
10908
|
+
function formatIcuPlaceholder(op) {
|
|
10909
|
+
if (op.strings.length !== op.expressionPlaceholders.length + 1) {
|
|
10910
|
+
throw Error(`AsserionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`);
|
|
10911
|
+
}
|
|
10912
|
+
const values = op.expressionPlaceholders.map(formatValue);
|
|
10913
|
+
return op.strings.flatMap((str, i) => [str, values[i] || ""]).join("");
|
|
10914
|
+
}
|
|
10816
10915
|
function formatParams(params) {
|
|
10817
10916
|
const formattedParams = /* @__PURE__ */ new Map();
|
|
10818
10917
|
for (const [placeholder, placeholderValues] of params) {
|
|
@@ -11039,7 +11138,7 @@ var CLASS_BANG = "class!";
|
|
|
11039
11138
|
var BANG_IMPORTANT = "!important";
|
|
11040
11139
|
function parseHostStyleProperties(job) {
|
|
11041
11140
|
for (const op of job.root.update) {
|
|
11042
|
-
if (op.kind
|
|
11141
|
+
if (!(op.kind === OpKind.Binding && op.bindingKind === BindingKind.Property)) {
|
|
11043
11142
|
continue;
|
|
11044
11143
|
}
|
|
11045
11144
|
if (op.name.endsWith(BANG_IMPORTANT)) {
|
|
@@ -17140,7 +17239,7 @@ function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
|
|
|
17140
17239
|
const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
|
|
17141
17240
|
const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
|
|
17142
17241
|
let transformFn = void 0;
|
|
17143
|
-
if (messageOp.needsPostprocessing) {
|
|
17242
|
+
if (messageOp.needsPostprocessing || messageOp.postprocessingParams.size > 0) {
|
|
17144
17243
|
const postprocessingParams = Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());
|
|
17145
17244
|
const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(postprocessingParams, false);
|
|
17146
17245
|
const extraTransformFnParams = [];
|
|
@@ -17159,7 +17258,6 @@ function addSubMessageParams(messageOp, subMessagePlaceholders) {
|
|
|
17159
17258
|
} else {
|
|
17160
17259
|
messageOp.params.set(placeholder, literal(`${ESCAPE2}${I18N_ICU_MAPPING_PREFIX2}${placeholder}${ESCAPE2}`));
|
|
17161
17260
|
messageOp.postprocessingParams.set(placeholder, literalArr(subMessages));
|
|
17162
|
-
messageOp.needsPostprocessing = true;
|
|
17163
17261
|
}
|
|
17164
17262
|
}
|
|
17165
17263
|
}
|
|
@@ -17193,12 +17291,13 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
|
|
|
17193
17291
|
|
|
17194
17292
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
|
|
17195
17293
|
function convertI18nText(job) {
|
|
17196
|
-
var _a2;
|
|
17294
|
+
var _a2, _b2, _c2;
|
|
17197
17295
|
for (const unit of job.units) {
|
|
17198
17296
|
let currentI18n = null;
|
|
17199
17297
|
let currentIcu = null;
|
|
17200
17298
|
const textNodeI18nBlocks = /* @__PURE__ */ new Map();
|
|
17201
17299
|
const textNodeIcus = /* @__PURE__ */ new Map();
|
|
17300
|
+
const icuPlaceholderByText = /* @__PURE__ */ new Map();
|
|
17202
17301
|
for (const op of unit.create) {
|
|
17203
17302
|
switch (op.kind) {
|
|
17204
17303
|
case OpKind.I18nStart:
|
|
@@ -17223,7 +17322,13 @@ function convertI18nText(job) {
|
|
|
17223
17322
|
if (currentI18n !== null) {
|
|
17224
17323
|
textNodeI18nBlocks.set(op.xref, currentI18n);
|
|
17225
17324
|
textNodeIcus.set(op.xref, currentIcu);
|
|
17226
|
-
|
|
17325
|
+
if (op.icuPlaceholder !== null) {
|
|
17326
|
+
const icuPlaceholderOp = createIcuPlaceholderOp(job.allocateXrefId(), op.icuPlaceholder, [op.initialValue]);
|
|
17327
|
+
OpList.replace(op, icuPlaceholderOp);
|
|
17328
|
+
icuPlaceholderByText.set(op.xref, icuPlaceholderOp);
|
|
17329
|
+
} else {
|
|
17330
|
+
OpList.remove(op);
|
|
17331
|
+
}
|
|
17227
17332
|
}
|
|
17228
17333
|
break;
|
|
17229
17334
|
}
|
|
@@ -17236,14 +17341,18 @@ function convertI18nText(job) {
|
|
|
17236
17341
|
}
|
|
17237
17342
|
const i18nOp = textNodeI18nBlocks.get(op.target);
|
|
17238
17343
|
const icuOp = textNodeIcus.get(op.target);
|
|
17344
|
+
const icuPlaceholder = icuPlaceholderByText.get(op.target);
|
|
17239
17345
|
const contextId = icuOp ? icuOp.context : i18nOp.context;
|
|
17240
17346
|
const resolutionTime = icuOp ? I18nParamResolutionTime.Postproccessing : I18nParamResolutionTime.Creation;
|
|
17241
17347
|
const ops = [];
|
|
17242
17348
|
for (let i = 0; i < op.interpolation.expressions.length; i++) {
|
|
17243
17349
|
const expr = op.interpolation.expressions[i];
|
|
17244
|
-
ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.xref, i18nOp.handle, expr, op.interpolation.i18nPlaceholders[i], resolutionTime, I18nExpressionFor.I18nText, "", (
|
|
17350
|
+
ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.xref, i18nOp.handle, expr, (_a2 = icuPlaceholder == null ? void 0 : icuPlaceholder.xref) != null ? _a2 : null, (_b2 = op.interpolation.i18nPlaceholders[i]) != null ? _b2 : null, resolutionTime, I18nExpressionFor.I18nText, "", (_c2 = expr.sourceSpan) != null ? _c2 : op.sourceSpan));
|
|
17245
17351
|
}
|
|
17246
17352
|
OpList.replaceWithMany(op, ops);
|
|
17353
|
+
if (icuPlaceholder !== void 0) {
|
|
17354
|
+
icuPlaceholder.strings = op.interpolation.strings;
|
|
17355
|
+
}
|
|
17247
17356
|
break;
|
|
17248
17357
|
}
|
|
17249
17358
|
}
|
|
@@ -17394,7 +17503,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
17394
17503
|
op.handlerFnName = sanitizeIdentifier(op.handlerFnName);
|
|
17395
17504
|
break;
|
|
17396
17505
|
case OpKind.Variable:
|
|
17397
|
-
varNames.set(op.xref, getVariableName(op.variable, state));
|
|
17506
|
+
varNames.set(op.xref, getVariableName(unit, op.variable, state));
|
|
17398
17507
|
break;
|
|
17399
17508
|
case OpKind.RepeaterCreate:
|
|
17400
17509
|
if (!(unit instanceof ViewCompilationUnit)) {
|
|
@@ -17445,14 +17554,19 @@ function addNamesToView(unit, baseName, state, compatibility) {
|
|
|
17445
17554
|
});
|
|
17446
17555
|
}
|
|
17447
17556
|
}
|
|
17448
|
-
function getVariableName(variable2, state) {
|
|
17557
|
+
function getVariableName(unit, variable2, state) {
|
|
17449
17558
|
if (variable2.name === null) {
|
|
17450
17559
|
switch (variable2.kind) {
|
|
17451
17560
|
case SemanticVariableKind.Context:
|
|
17452
17561
|
variable2.name = `ctx_r${state.index++}`;
|
|
17453
17562
|
break;
|
|
17454
17563
|
case SemanticVariableKind.Identifier:
|
|
17455
|
-
|
|
17564
|
+
if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) {
|
|
17565
|
+
const compatPrefix = variable2.identifier === "ctx" ? "i" : "";
|
|
17566
|
+
variable2.name = `${variable2.identifier}_${compatPrefix}r${++state.index}`;
|
|
17567
|
+
} else {
|
|
17568
|
+
variable2.name = `${variable2.identifier}_i${state.index++}`;
|
|
17569
|
+
}
|
|
17456
17570
|
break;
|
|
17457
17571
|
default:
|
|
17458
17572
|
variable2.name = `_r${++state.index}`;
|
|
@@ -17595,17 +17709,24 @@ var CREATE_ORDERING = [
|
|
|
17595
17709
|
{ test: (op) => op.kind === OpKind.Listener && !(op.hostListener && op.isAnimationListener) }
|
|
17596
17710
|
];
|
|
17597
17711
|
var UPDATE_ORDERING = [
|
|
17598
|
-
{ test: kindWithInterpolationTest(OpKind.HostProperty, true) },
|
|
17599
|
-
{ test: kindWithInterpolationTest(OpKind.HostProperty, false) },
|
|
17600
17712
|
{ test: kindTest(OpKind.StyleMap), transform: keepLast },
|
|
17601
17713
|
{ test: kindTest(OpKind.ClassMap), transform: keepLast },
|
|
17602
17714
|
{ test: kindTest(OpKind.StyleProp) },
|
|
17603
17715
|
{ test: kindTest(OpKind.ClassProp) },
|
|
17604
|
-
{ test: kindWithInterpolationTest(OpKind.Property, true) },
|
|
17605
17716
|
{ test: kindWithInterpolationTest(OpKind.Attribute, true) },
|
|
17717
|
+
{ test: kindWithInterpolationTest(OpKind.Property, true) },
|
|
17606
17718
|
{ test: kindWithInterpolationTest(OpKind.Property, false) },
|
|
17607
17719
|
{ test: kindWithInterpolationTest(OpKind.Attribute, false) }
|
|
17608
17720
|
];
|
|
17721
|
+
var UPDATE_HOST_ORDERING = [
|
|
17722
|
+
{ test: kindWithInterpolationTest(OpKind.HostProperty, true) },
|
|
17723
|
+
{ test: kindWithInterpolationTest(OpKind.HostProperty, false) },
|
|
17724
|
+
{ test: kindTest(OpKind.Attribute) },
|
|
17725
|
+
{ test: kindTest(OpKind.StyleMap), transform: keepLast },
|
|
17726
|
+
{ test: kindTest(OpKind.ClassMap), transform: keepLast },
|
|
17727
|
+
{ test: kindTest(OpKind.StyleProp) },
|
|
17728
|
+
{ test: kindTest(OpKind.ClassProp) }
|
|
17729
|
+
];
|
|
17609
17730
|
var handledOpKinds = /* @__PURE__ */ new Set([
|
|
17610
17731
|
OpKind.Listener,
|
|
17611
17732
|
OpKind.StyleMap,
|
|
@@ -17619,7 +17740,8 @@ var handledOpKinds = /* @__PURE__ */ new Set([
|
|
|
17619
17740
|
function orderOps(job) {
|
|
17620
17741
|
for (const unit of job.units) {
|
|
17621
17742
|
orderWithin(unit.create, CREATE_ORDERING);
|
|
17622
|
-
|
|
17743
|
+
const ordering = unit.job.kind === CompilationJobKind.Host ? UPDATE_HOST_ORDERING : UPDATE_ORDERING;
|
|
17744
|
+
orderWithin(unit.update, ordering);
|
|
17623
17745
|
}
|
|
17624
17746
|
}
|
|
17625
17747
|
function orderWithin(opList, ordering) {
|
|
@@ -17657,9 +17779,21 @@ function keepLast(ops) {
|
|
|
17657
17779
|
|
|
17658
17780
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
|
|
17659
17781
|
function parseExtractedStyles(job) {
|
|
17782
|
+
const elements = /* @__PURE__ */ new Map();
|
|
17783
|
+
for (const unit of job.units) {
|
|
17784
|
+
for (const op of unit.create) {
|
|
17785
|
+
if (isElementOrContainerOp(op)) {
|
|
17786
|
+
elements.set(op.xref, op);
|
|
17787
|
+
}
|
|
17788
|
+
}
|
|
17789
|
+
}
|
|
17660
17790
|
for (const unit of job.units) {
|
|
17661
17791
|
for (const op of unit.create) {
|
|
17662
17792
|
if (op.kind === OpKind.ExtractedAttribute && op.bindingKind === BindingKind.Attribute && isStringLiteral(op.expression)) {
|
|
17793
|
+
const target = elements.get(op.target);
|
|
17794
|
+
if (target !== void 0 && target.kind === OpKind.Template && target.templateKind === TemplateKind.Structural) {
|
|
17795
|
+
continue;
|
|
17796
|
+
}
|
|
17663
17797
|
if (op.name === "style") {
|
|
17664
17798
|
const parsedStyles = parse(op.expression.value);
|
|
17665
17799
|
for (let i = 0; i < parsedStyles.length - 1; i += 2) {
|
|
@@ -17690,13 +17824,6 @@ function removeContentSelectors(job) {
|
|
|
17690
17824
|
OpList.remove(op);
|
|
17691
17825
|
}
|
|
17692
17826
|
break;
|
|
17693
|
-
case OpKind.Projection:
|
|
17694
|
-
for (let i = op.attributes.length - 2; i >= 0; i -= 2) {
|
|
17695
|
-
if (isSelectAttribute(op.attributes[i])) {
|
|
17696
|
-
op.attributes.splice(i, 2);
|
|
17697
|
-
}
|
|
17698
|
-
}
|
|
17699
|
-
break;
|
|
17700
17827
|
}
|
|
17701
17828
|
}
|
|
17702
17829
|
}
|
|
@@ -17823,8 +17950,11 @@ function wrapTemplateWithI18n(unit, parentI18n) {
|
|
|
17823
17950
|
var _a2;
|
|
17824
17951
|
if (((_a2 = unit.create.head.next) == null ? void 0 : _a2.kind) !== OpKind.I18nStart) {
|
|
17825
17952
|
const id = unit.job.allocateXrefId();
|
|
17826
|
-
OpList.insertAfter(
|
|
17827
|
-
|
|
17953
|
+
OpList.insertAfter(
|
|
17954
|
+
createI18nStartOp(id, parentI18n.message, parentI18n.root, null),
|
|
17955
|
+
unit.create.head
|
|
17956
|
+
);
|
|
17957
|
+
OpList.insertBefore(createI18nEndOp(id, null), unit.create.tail);
|
|
17828
17958
|
}
|
|
17829
17959
|
}
|
|
17830
17960
|
|
|
@@ -18079,22 +18209,22 @@ function projectionDef(def) {
|
|
|
18079
18209
|
}
|
|
18080
18210
|
function projection(slot, projectionSlotIndex, attributes, sourceSpan) {
|
|
18081
18211
|
const args = [literal(slot)];
|
|
18082
|
-
if (projectionSlotIndex !== 0 || attributes
|
|
18212
|
+
if (projectionSlotIndex !== 0 || attributes !== null) {
|
|
18083
18213
|
args.push(literal(projectionSlotIndex));
|
|
18084
|
-
if (attributes
|
|
18085
|
-
args.push(
|
|
18214
|
+
if (attributes !== null) {
|
|
18215
|
+
args.push(attributes);
|
|
18086
18216
|
}
|
|
18087
18217
|
}
|
|
18088
18218
|
return call(Identifiers.projection, args, sourceSpan);
|
|
18089
18219
|
}
|
|
18090
|
-
function i18nStart(slot, constIndex, subTemplateIndex) {
|
|
18220
|
+
function i18nStart(slot, constIndex, subTemplateIndex, sourceSpan) {
|
|
18091
18221
|
const args = [literal(slot), literal(constIndex)];
|
|
18092
18222
|
if (subTemplateIndex !== null) {
|
|
18093
18223
|
args.push(literal(subTemplateIndex));
|
|
18094
18224
|
}
|
|
18095
|
-
return call(Identifiers.i18nStart, args,
|
|
18225
|
+
return call(Identifiers.i18nStart, args, sourceSpan);
|
|
18096
18226
|
}
|
|
18097
|
-
function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, sourceSpan) {
|
|
18227
|
+
function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, emptyTag, emptyConstIndex, sourceSpan) {
|
|
18098
18228
|
const args = [
|
|
18099
18229
|
literal(slot),
|
|
18100
18230
|
variable(viewFnName),
|
|
@@ -18108,6 +18238,12 @@ function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByF
|
|
|
18108
18238
|
args.push(literal(trackByUsesComponentInstance));
|
|
18109
18239
|
if (emptyViewFnName !== null) {
|
|
18110
18240
|
args.push(variable(emptyViewFnName), literal(emptyDecls), literal(emptyVars));
|
|
18241
|
+
if (emptyTag !== null || emptyConstIndex !== null) {
|
|
18242
|
+
args.push(literal(emptyTag));
|
|
18243
|
+
}
|
|
18244
|
+
if (emptyConstIndex !== null) {
|
|
18245
|
+
args.push(literal(emptyConstIndex));
|
|
18246
|
+
}
|
|
18111
18247
|
}
|
|
18112
18248
|
}
|
|
18113
18249
|
return call(Identifiers.repeaterCreate, args, sourceSpan);
|
|
@@ -18118,15 +18254,15 @@ function repeater(collection, sourceSpan) {
|
|
|
18118
18254
|
function deferWhen(prefetch, expr, sourceSpan) {
|
|
18119
18255
|
return call(prefetch ? Identifiers.deferPrefetchWhen : Identifiers.deferWhen, [expr], sourceSpan);
|
|
18120
18256
|
}
|
|
18121
|
-
function i18n(slot, constIndex, subTemplateIndex) {
|
|
18257
|
+
function i18n(slot, constIndex, subTemplateIndex, sourceSpan) {
|
|
18122
18258
|
const args = [literal(slot), literal(constIndex)];
|
|
18123
18259
|
if (subTemplateIndex) {
|
|
18124
18260
|
args.push(literal(subTemplateIndex));
|
|
18125
18261
|
}
|
|
18126
|
-
return call(Identifiers.i18n, args,
|
|
18262
|
+
return call(Identifiers.i18n, args, sourceSpan);
|
|
18127
18263
|
}
|
|
18128
|
-
function i18nEnd() {
|
|
18129
|
-
return call(Identifiers.i18nEnd, [],
|
|
18264
|
+
function i18nEnd(endSourceSpan) {
|
|
18265
|
+
return call(Identifiers.i18nEnd, [], endSourceSpan);
|
|
18130
18266
|
}
|
|
18131
18267
|
function i18nAttributes(slot, i18nAttributesConfig) {
|
|
18132
18268
|
const args = [literal(slot), literal(i18nAttributesConfig)];
|
|
@@ -18453,31 +18589,31 @@ function reifyCreateOperations(unit, ops) {
|
|
|
18453
18589
|
OpList.replace(op, text(op.handle.slot, op.initialValue, op.sourceSpan));
|
|
18454
18590
|
break;
|
|
18455
18591
|
case OpKind.ElementStart:
|
|
18456
|
-
OpList.replace(op, elementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.
|
|
18592
|
+
OpList.replace(op, elementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
|
|
18457
18593
|
break;
|
|
18458
18594
|
case OpKind.Element:
|
|
18459
|
-
OpList.replace(op, element(op.handle.slot, op.tag, op.attributes, op.localRefs, op.
|
|
18595
|
+
OpList.replace(op, element(op.handle.slot, op.tag, op.attributes, op.localRefs, op.wholeSourceSpan));
|
|
18460
18596
|
break;
|
|
18461
18597
|
case OpKind.ElementEnd:
|
|
18462
18598
|
OpList.replace(op, elementEnd(op.sourceSpan));
|
|
18463
18599
|
break;
|
|
18464
18600
|
case OpKind.ContainerStart:
|
|
18465
|
-
OpList.replace(op, elementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.
|
|
18601
|
+
OpList.replace(op, elementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.startSourceSpan));
|
|
18466
18602
|
break;
|
|
18467
18603
|
case OpKind.Container:
|
|
18468
|
-
OpList.replace(op, elementContainer(op.handle.slot, op.attributes, op.localRefs, op.
|
|
18604
|
+
OpList.replace(op, elementContainer(op.handle.slot, op.attributes, op.localRefs, op.wholeSourceSpan));
|
|
18469
18605
|
break;
|
|
18470
18606
|
case OpKind.ContainerEnd:
|
|
18471
18607
|
OpList.replace(op, elementContainerEnd());
|
|
18472
18608
|
break;
|
|
18473
18609
|
case OpKind.I18nStart:
|
|
18474
|
-
OpList.replace(op, i18nStart(op.handle.slot, op.messageIndex, op.subTemplateIndex));
|
|
18610
|
+
OpList.replace(op, i18nStart(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan));
|
|
18475
18611
|
break;
|
|
18476
18612
|
case OpKind.I18nEnd:
|
|
18477
|
-
OpList.replace(op, i18nEnd());
|
|
18613
|
+
OpList.replace(op, i18nEnd(op.sourceSpan));
|
|
18478
18614
|
break;
|
|
18479
18615
|
case OpKind.I18n:
|
|
18480
|
-
OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex));
|
|
18616
|
+
OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan));
|
|
18481
18617
|
break;
|
|
18482
18618
|
case OpKind.I18nAttributes:
|
|
18483
18619
|
if (op.i18nAttributesConfig === null) {
|
|
@@ -18493,7 +18629,7 @@ function reifyCreateOperations(unit, ops) {
|
|
|
18493
18629
|
throw new Error(`AssertionError: local refs array should have been extracted into a constant`);
|
|
18494
18630
|
}
|
|
18495
18631
|
const childView = unit.job.views.get(op.xref);
|
|
18496
|
-
OpList.replace(op, template(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.
|
|
18632
|
+
OpList.replace(op, template(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan));
|
|
18497
18633
|
break;
|
|
18498
18634
|
case OpKind.DisableBindings:
|
|
18499
18635
|
OpList.replace(op, disableBindings2());
|
|
@@ -18508,7 +18644,7 @@ function reifyCreateOperations(unit, ops) {
|
|
|
18508
18644
|
const listenerFn = reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, op.consumesDollarEvent);
|
|
18509
18645
|
const eventTargetResolver = op.eventTarget ? GLOBAL_TARGET_RESOLVERS.get(op.eventTarget) : null;
|
|
18510
18646
|
if (eventTargetResolver === void 0) {
|
|
18511
|
-
throw new Error(`
|
|
18647
|
+
throw new Error(`Unexpected global target '${op.eventTarget}' defined for '${op.name}' event. Supported list of global targets: window,document,body.`);
|
|
18512
18648
|
}
|
|
18513
18649
|
OpList.replace(op, listener(op.name, listenerFn, eventTargetResolver, op.hostListener && op.isAnimationListener, op.sourceSpan));
|
|
18514
18650
|
break;
|
|
@@ -18595,7 +18731,7 @@ function reifyCreateOperations(unit, ops) {
|
|
|
18595
18731
|
emptyDecls = emptyView.decls;
|
|
18596
18732
|
emptyVars = emptyView.vars;
|
|
18597
18733
|
}
|
|
18598
|
-
OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.
|
|
18734
|
+
OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.emptyTag, op.emptyAttributes, op.wholeSourceSpan));
|
|
18599
18735
|
break;
|
|
18600
18736
|
case OpKind.Statement:
|
|
18601
18737
|
break;
|
|
@@ -19102,6 +19238,7 @@ function resolveI18nExpressionPlaceholders(job) {
|
|
|
19102
19238
|
var _a2;
|
|
19103
19239
|
const subTemplateIndicies = /* @__PURE__ */ new Map();
|
|
19104
19240
|
const i18nContexts = /* @__PURE__ */ new Map();
|
|
19241
|
+
const icuPlaceholders = /* @__PURE__ */ new Map();
|
|
19105
19242
|
for (const unit of job.units) {
|
|
19106
19243
|
for (const op of unit.create) {
|
|
19107
19244
|
switch (op.kind) {
|
|
@@ -19111,6 +19248,9 @@ function resolveI18nExpressionPlaceholders(job) {
|
|
|
19111
19248
|
case OpKind.I18nContext:
|
|
19112
19249
|
i18nContexts.set(op.xref, op);
|
|
19113
19250
|
break;
|
|
19251
|
+
case OpKind.IcuPlaceholder:
|
|
19252
|
+
icuPlaceholders.set(op.xref, op);
|
|
19253
|
+
break;
|
|
19114
19254
|
}
|
|
19115
19255
|
}
|
|
19116
19256
|
}
|
|
@@ -19119,66 +19259,32 @@ function resolveI18nExpressionPlaceholders(job) {
|
|
|
19119
19259
|
for (const unit of job.units) {
|
|
19120
19260
|
for (const op of unit.update) {
|
|
19121
19261
|
if (op.kind === OpKind.I18nExpression) {
|
|
19122
|
-
const i18nContext = i18nContexts.get(op.context);
|
|
19123
19262
|
const index = expressionIndices.get(referenceIndex(op)) || 0;
|
|
19124
19263
|
const subTemplateIndex = (_a2 = subTemplateIndicies.get(op.i18nOwner)) != null ? _a2 : null;
|
|
19125
|
-
const
|
|
19126
|
-
const values = params.get(op.i18nPlaceholder) || [];
|
|
19127
|
-
values.push({
|
|
19264
|
+
const value = {
|
|
19128
19265
|
value: index,
|
|
19129
19266
|
subTemplateIndex,
|
|
19130
19267
|
flags: I18nParamValueFlags.ExpressionIndex
|
|
19131
|
-
}
|
|
19132
|
-
|
|
19268
|
+
};
|
|
19269
|
+
updatePlaceholder(op, value, i18nContexts, icuPlaceholders);
|
|
19133
19270
|
expressionIndices.set(referenceIndex(op), index + 1);
|
|
19134
19271
|
}
|
|
19135
19272
|
}
|
|
19136
19273
|
}
|
|
19137
19274
|
}
|
|
19138
|
-
|
|
19139
|
-
|
|
19140
|
-
|
|
19141
|
-
|
|
19142
|
-
|
|
19143
|
-
|
|
19144
|
-
|
|
19145
|
-
node.visit(new ResolveIcuPlaceholdersVisitor(op.postprocessingParams));
|
|
19146
|
-
}
|
|
19147
|
-
}
|
|
19148
|
-
}
|
|
19275
|
+
function updatePlaceholder(op, value, i18nContexts, icuPlaceholders) {
|
|
19276
|
+
if (op.i18nPlaceholder !== null) {
|
|
19277
|
+
const i18nContext = i18nContexts.get(op.context);
|
|
19278
|
+
const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
|
|
19279
|
+
const values = params.get(op.i18nPlaceholder) || [];
|
|
19280
|
+
values.push(value);
|
|
19281
|
+
params.set(op.i18nPlaceholder, values);
|
|
19149
19282
|
}
|
|
19150
|
-
|
|
19151
|
-
|
|
19152
|
-
|
|
19153
|
-
super();
|
|
19154
|
-
this.params = params;
|
|
19283
|
+
if (op.icuPlaceholder !== null) {
|
|
19284
|
+
const icuPlaceholderOp = icuPlaceholders.get(op.icuPlaceholder);
|
|
19285
|
+
icuPlaceholderOp == null ? void 0 : icuPlaceholderOp.expressionPlaceholders.push(value);
|
|
19155
19286
|
}
|
|
19156
|
-
|
|
19157
|
-
var _a2, _b2;
|
|
19158
|
-
if (placeholder.startName && placeholder.startSourceSpan && !this.params.has(placeholder.startName)) {
|
|
19159
|
-
this.params.set(placeholder.startName, [{
|
|
19160
|
-
value: (_a2 = placeholder.startSourceSpan) == null ? void 0 : _a2.toString(),
|
|
19161
|
-
subTemplateIndex: null,
|
|
19162
|
-
flags: I18nParamValueFlags.None
|
|
19163
|
-
}]);
|
|
19164
|
-
}
|
|
19165
|
-
if (placeholder.closeName && placeholder.endSourceSpan && !this.params.has(placeholder.closeName)) {
|
|
19166
|
-
this.params.set(placeholder.closeName, [{
|
|
19167
|
-
value: (_b2 = placeholder.endSourceSpan) == null ? void 0 : _b2.toString(),
|
|
19168
|
-
subTemplateIndex: null,
|
|
19169
|
-
flags: I18nParamValueFlags.None
|
|
19170
|
-
}]);
|
|
19171
|
-
}
|
|
19172
|
-
}
|
|
19173
|
-
visitTagPlaceholder(placeholder) {
|
|
19174
|
-
super.visitTagPlaceholder(placeholder);
|
|
19175
|
-
this.visitContainerPlaceholder(placeholder);
|
|
19176
|
-
}
|
|
19177
|
-
visitBlockPlaceholder(placeholder) {
|
|
19178
|
-
super.visitBlockPlaceholder(placeholder);
|
|
19179
|
-
this.visitContainerPlaceholder(placeholder);
|
|
19180
|
-
}
|
|
19181
|
-
};
|
|
19287
|
+
}
|
|
19182
19288
|
|
|
19183
19289
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
|
|
19184
19290
|
function resolveNames(job) {
|
|
@@ -19484,6 +19590,9 @@ function generateTrackFns(job) {
|
|
|
19484
19590
|
}
|
|
19485
19591
|
let usesComponentContext = false;
|
|
19486
19592
|
op.track = transformExpressionsInExpression(op.track, (expr) => {
|
|
19593
|
+
if (expr instanceof PipeBindingExpr || expr instanceof PipeBindingVariadicExpr) {
|
|
19594
|
+
throw new Error(`Illegal State: Pipes are not allowed in this context`);
|
|
19595
|
+
}
|
|
19487
19596
|
if (expr instanceof TrackContextExpr) {
|
|
19488
19597
|
usesComponentContext = true;
|
|
19489
19598
|
return variable("this");
|
|
@@ -19648,7 +19757,10 @@ function varsUsedByOp(op) {
|
|
|
19648
19757
|
return op.interpolation.expressions.length;
|
|
19649
19758
|
case OpKind.I18nExpression:
|
|
19650
19759
|
case OpKind.Conditional:
|
|
19760
|
+
case OpKind.DeferWhen:
|
|
19651
19761
|
return 1;
|
|
19762
|
+
case OpKind.RepeaterCreate:
|
|
19763
|
+
return op.emptyView ? 1 : 0;
|
|
19652
19764
|
default:
|
|
19653
19765
|
throw new Error(`Unhandled op: ${OpKind[op.kind]}`);
|
|
19654
19766
|
}
|
|
@@ -19941,12 +20053,12 @@ function wrapI18nIcus(job) {
|
|
|
19941
20053
|
case OpKind.IcuStart:
|
|
19942
20054
|
if (currentI18nOp === null) {
|
|
19943
20055
|
addedI18nId = job.allocateXrefId();
|
|
19944
|
-
OpList.insertBefore(createI18nStartOp(addedI18nId, op.message), op);
|
|
20056
|
+
OpList.insertBefore(createI18nStartOp(addedI18nId, op.message, void 0, null), op);
|
|
19945
20057
|
}
|
|
19946
20058
|
break;
|
|
19947
20059
|
case OpKind.IcuEnd:
|
|
19948
20060
|
if (addedI18nId !== null) {
|
|
19949
|
-
OpList.insertAfter(createI18nEndOp(addedI18nId), op);
|
|
20061
|
+
OpList.insertAfter(createI18nEndOp(addedI18nId, null), op);
|
|
19950
20062
|
addedI18nId = null;
|
|
19951
20063
|
}
|
|
19952
20064
|
break;
|
|
@@ -19962,6 +20074,7 @@ var phases = [
|
|
|
19962
20074
|
{ kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
|
|
19963
20075
|
{ kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
|
|
19964
20076
|
{ kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
|
|
20077
|
+
{ kind: CompilationJobKind.Both, fn: deduplicateTextBindings },
|
|
19965
20078
|
{ kind: CompilationJobKind.Both, fn: specializeStyleBindings },
|
|
19966
20079
|
{ kind: CompilationJobKind.Both, fn: specializeBindings },
|
|
19967
20080
|
{ kind: CompilationJobKind.Both, fn: extractAttributes },
|
|
@@ -20000,7 +20113,6 @@ var phases = [
|
|
|
20000
20113
|
{ kind: CompilationJobKind.Tmpl, fn: createDeferDepsFns },
|
|
20001
20114
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
|
|
20002
20115
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
|
|
20003
|
-
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nIcuPlaceholders },
|
|
20004
20116
|
{ kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
|
|
20005
20117
|
{ kind: CompilationJobKind.Tmpl, fn: generateTrackFns },
|
|
20006
20118
|
{ kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
|
|
@@ -20143,7 +20255,7 @@ function ingestHostBinding(input, bindingParser, constantPool) {
|
|
|
20143
20255
|
bindingKind = BindingKind.Animation;
|
|
20144
20256
|
}
|
|
20145
20257
|
const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, property2.name, bindingKind === BindingKind.Attribute).filter((context) => context !== SecurityContext.NONE);
|
|
20146
|
-
ingestHostProperty(job, property2, bindingKind,
|
|
20258
|
+
ingestHostProperty(job, property2, bindingKind, securityContexts);
|
|
20147
20259
|
}
|
|
20148
20260
|
for (const [name, expr] of (_b2 = Object.entries(input.attributes)) != null ? _b2 : []) {
|
|
20149
20261
|
const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, name, true).filter((context) => context !== SecurityContext.NONE);
|
|
@@ -20154,7 +20266,7 @@ function ingestHostBinding(input, bindingParser, constantPool) {
|
|
|
20154
20266
|
}
|
|
20155
20267
|
return job;
|
|
20156
20268
|
}
|
|
20157
|
-
function ingestHostProperty(job, property2, bindingKind,
|
|
20269
|
+
function ingestHostProperty(job, property2, bindingKind, securityContexts) {
|
|
20158
20270
|
let expression;
|
|
20159
20271
|
const ast = property2.expression.ast;
|
|
20160
20272
|
if (ast instanceof Interpolation) {
|
|
@@ -20162,7 +20274,7 @@ function ingestHostProperty(job, property2, bindingKind, isTextAttribute, securi
|
|
|
20162
20274
|
} else {
|
|
20163
20275
|
expression = convertAst(ast, job, property2.sourceSpan);
|
|
20164
20276
|
}
|
|
20165
|
-
job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, securityContexts,
|
|
20277
|
+
job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, securityContexts, false, false, null, null, property2.sourceSpan));
|
|
20166
20278
|
}
|
|
20167
20279
|
function ingestHostAttribute(job, name, value, securityContexts) {
|
|
20168
20280
|
const attrBinding = createBindingOp(
|
|
@@ -20176,14 +20288,13 @@ function ingestHostAttribute(job, name, value, securityContexts) {
|
|
|
20176
20288
|
false,
|
|
20177
20289
|
null,
|
|
20178
20290
|
null,
|
|
20179
|
-
|
|
20291
|
+
value.sourceSpan
|
|
20180
20292
|
);
|
|
20181
20293
|
job.root.update.push(attrBinding);
|
|
20182
20294
|
}
|
|
20183
20295
|
function ingestHostEvent(job, event) {
|
|
20184
20296
|
const [phase, target] = event.type === 0 ? [null, event.targetOrPhase] : [event.targetOrPhase, null];
|
|
20185
|
-
const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null,
|
|
20186
|
-
eventBinding.handlerOps.push(createStatementOp(new ReturnStatement(convertAst(event.handler.ast, job, event.sourceSpan), event.handlerSpan)));
|
|
20297
|
+
const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan);
|
|
20187
20298
|
job.root.create.push(eventBinding);
|
|
20188
20299
|
}
|
|
20189
20300
|
function ingestNodes(unit, template2) {
|
|
@@ -20195,9 +20306,9 @@ function ingestNodes(unit, template2) {
|
|
|
20195
20306
|
} else if (node instanceof Content) {
|
|
20196
20307
|
ingestContent(unit, node);
|
|
20197
20308
|
} else if (node instanceof Text) {
|
|
20198
|
-
ingestText(unit, node);
|
|
20309
|
+
ingestText(unit, node, null);
|
|
20199
20310
|
} else if (node instanceof BoundText) {
|
|
20200
|
-
ingestBoundText(unit, node);
|
|
20311
|
+
ingestBoundText(unit, node, null);
|
|
20201
20312
|
} else if (node instanceof IfBlock) {
|
|
20202
20313
|
ingestIfBlock(unit, node);
|
|
20203
20314
|
} else if (node instanceof SwitchBlock) {
|
|
@@ -20214,29 +20325,30 @@ function ingestNodes(unit, template2) {
|
|
|
20214
20325
|
}
|
|
20215
20326
|
}
|
|
20216
20327
|
function ingestElement(unit, element2) {
|
|
20217
|
-
var _a2;
|
|
20328
|
+
var _a2, _b2;
|
|
20218
20329
|
if (element2.i18n !== void 0 && !(element2.i18n instanceof Message || element2.i18n instanceof TagPlaceholder)) {
|
|
20219
20330
|
throw Error(`Unhandled i18n metadata type for element: ${element2.i18n.constructor.name}`);
|
|
20220
20331
|
}
|
|
20221
20332
|
const id = unit.job.allocateXrefId();
|
|
20222
20333
|
const [namespaceKey, elementName] = splitNsName(element2.name);
|
|
20223
|
-
const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n instanceof TagPlaceholder ? element2.i18n : void 0, element2.startSourceSpan);
|
|
20334
|
+
const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n instanceof TagPlaceholder ? element2.i18n : void 0, element2.startSourceSpan, element2.sourceSpan);
|
|
20224
20335
|
unit.create.push(startOp);
|
|
20225
20336
|
ingestElementBindings(unit, startOp, element2);
|
|
20226
20337
|
ingestReferences(startOp, element2);
|
|
20227
20338
|
let i18nBlockId = null;
|
|
20228
20339
|
if (element2.i18n instanceof Message) {
|
|
20229
20340
|
i18nBlockId = unit.job.allocateXrefId();
|
|
20230
|
-
unit.create.push(createI18nStartOp(i18nBlockId, element2.i18n));
|
|
20341
|
+
unit.create.push(createI18nStartOp(i18nBlockId, element2.i18n, void 0, element2.startSourceSpan));
|
|
20231
20342
|
}
|
|
20232
20343
|
ingestNodes(unit, element2.children);
|
|
20233
20344
|
const endOp = createElementEndOp(id, (_a2 = element2.endSourceSpan) != null ? _a2 : element2.startSourceSpan);
|
|
20234
20345
|
unit.create.push(endOp);
|
|
20235
20346
|
if (i18nBlockId !== null) {
|
|
20236
|
-
OpList.insertBefore(createI18nEndOp(i18nBlockId), endOp);
|
|
20347
|
+
OpList.insertBefore(createI18nEndOp(i18nBlockId, (_b2 = element2.endSourceSpan) != null ? _b2 : element2.startSourceSpan), endOp);
|
|
20237
20348
|
}
|
|
20238
20349
|
}
|
|
20239
20350
|
function ingestTemplate(unit, tmpl) {
|
|
20351
|
+
var _a2;
|
|
20240
20352
|
if (tmpl.i18n !== void 0 && !(tmpl.i18n instanceof Message || tmpl.i18n instanceof TagPlaceholder)) {
|
|
20241
20353
|
throw Error(`Unhandled i18n metadata type for template: ${tmpl.i18n.constructor.name}`);
|
|
20242
20354
|
}
|
|
@@ -20250,7 +20362,7 @@ function ingestTemplate(unit, tmpl) {
|
|
|
20250
20362
|
const namespace = namespaceForKey(namespacePrefix);
|
|
20251
20363
|
const functionNameSuffix = tagNameWithoutNamespace === null ? "" : prefixWithNamespace(tagNameWithoutNamespace, namespace);
|
|
20252
20364
|
const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural;
|
|
20253
|
-
const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
|
|
20365
|
+
const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan, tmpl.sourceSpan);
|
|
20254
20366
|
unit.create.push(templateOp);
|
|
20255
20367
|
ingestTemplateBindings(unit, templateOp, tmpl, templateKind);
|
|
20256
20368
|
ingestReferences(templateOp, tmpl);
|
|
@@ -20260,26 +20372,25 @@ function ingestTemplate(unit, tmpl) {
|
|
|
20260
20372
|
}
|
|
20261
20373
|
if (templateKind === TemplateKind.NgTemplate && tmpl.i18n instanceof Message) {
|
|
20262
20374
|
const id = unit.job.allocateXrefId();
|
|
20263
|
-
OpList.insertAfter(createI18nStartOp(id, tmpl.i18n), childView.create.head);
|
|
20264
|
-
OpList.insertBefore(createI18nEndOp(id), childView.create.tail);
|
|
20375
|
+
OpList.insertAfter(createI18nStartOp(id, tmpl.i18n, void 0, tmpl.startSourceSpan), childView.create.head);
|
|
20376
|
+
OpList.insertBefore(createI18nEndOp(id, (_a2 = tmpl.endSourceSpan) != null ? _a2 : tmpl.startSourceSpan), childView.create.tail);
|
|
20265
20377
|
}
|
|
20266
20378
|
}
|
|
20267
20379
|
function ingestContent(unit, content) {
|
|
20268
20380
|
if (content.i18n !== void 0 && !(content.i18n instanceof TagPlaceholder)) {
|
|
20269
20381
|
throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
|
|
20270
20382
|
}
|
|
20271
|
-
const
|
|
20272
|
-
const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, attrs, content.sourceSpan);
|
|
20383
|
+
const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, content.sourceSpan);
|
|
20273
20384
|
for (const attr of content.attributes) {
|
|
20274
20385
|
const securityContext = domSchema.securityContext(content.name, attr.name, true);
|
|
20275
20386
|
unit.update.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan));
|
|
20276
20387
|
}
|
|
20277
20388
|
unit.create.push(op);
|
|
20278
20389
|
}
|
|
20279
|
-
function ingestText(unit, text2) {
|
|
20280
|
-
unit.create.push(createTextOp(unit.job.allocateXrefId(), text2.value, text2.sourceSpan));
|
|
20390
|
+
function ingestText(unit, text2, icuPlaceholder) {
|
|
20391
|
+
unit.create.push(createTextOp(unit.job.allocateXrefId(), text2.value, icuPlaceholder, text2.sourceSpan));
|
|
20281
20392
|
}
|
|
20282
|
-
function ingestBoundText(unit, text2,
|
|
20393
|
+
function ingestBoundText(unit, text2, icuPlaceholder) {
|
|
20283
20394
|
var _a2;
|
|
20284
20395
|
let value = text2.value;
|
|
20285
20396
|
if (value instanceof ASTWithSource) {
|
|
@@ -20291,14 +20402,12 @@ function ingestBoundText(unit, text2, i18nPlaceholders) {
|
|
|
20291
20402
|
if (text2.i18n !== void 0 && !(text2.i18n instanceof Container)) {
|
|
20292
20403
|
throw Error(`Unhandled i18n metadata type for text interpolation: ${(_a2 = text2.i18n) == null ? void 0 : _a2.constructor.name}`);
|
|
20293
20404
|
}
|
|
20294
|
-
|
|
20295
|
-
i18nPlaceholders = text2.i18n instanceof Container ? text2.i18n.children.filter((node) => node instanceof Placeholder).map((placeholder) => placeholder.name) : [];
|
|
20296
|
-
}
|
|
20405
|
+
const i18nPlaceholders = text2.i18n instanceof Container ? text2.i18n.children.filter((node) => node instanceof Placeholder).map((placeholder) => placeholder.name) : [];
|
|
20297
20406
|
if (i18nPlaceholders.length > 0 && i18nPlaceholders.length !== value.expressions.length) {
|
|
20298
20407
|
throw Error(`Unexpected number of i18n placeholders (${value.expressions.length}) for BoundText with ${value.expressions.length} expressions`);
|
|
20299
20408
|
}
|
|
20300
20409
|
const textXref = unit.job.allocateXrefId();
|
|
20301
|
-
unit.create.push(createTextOp(textXref, "", text2.sourceSpan));
|
|
20410
|
+
unit.create.push(createTextOp(textXref, "", icuPlaceholder, text2.sourceSpan));
|
|
20302
20411
|
const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
|
|
20303
20412
|
unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan)), i18nPlaceholders), text2.sourceSpan));
|
|
20304
20413
|
}
|
|
@@ -20324,7 +20433,7 @@ function ingestIfBlock(unit, ifBlock) {
|
|
|
20324
20433
|
}
|
|
20325
20434
|
ifCaseI18nMeta = ifCase.i18n;
|
|
20326
20435
|
}
|
|
20327
|
-
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.sourceSpan);
|
|
20436
|
+
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.startSourceSpan, ifCase.sourceSpan);
|
|
20328
20437
|
unit.create.push(templateOp);
|
|
20329
20438
|
if (firstXref === null) {
|
|
20330
20439
|
firstXref = cView.xref;
|
|
@@ -20352,7 +20461,7 @@ function ingestSwitchBlock(unit, switchBlock) {
|
|
|
20352
20461
|
}
|
|
20353
20462
|
switchCaseI18nMeta = switchCase.i18n;
|
|
20354
20463
|
}
|
|
20355
|
-
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, null, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.sourceSpan);
|
|
20464
|
+
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, null, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.startSourceSpan, switchCase.sourceSpan);
|
|
20356
20465
|
unit.create.push(templateOp);
|
|
20357
20466
|
if (firstXref === null) {
|
|
20358
20467
|
firstXref = cView.xref;
|
|
@@ -20375,7 +20484,7 @@ function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) {
|
|
|
20375
20484
|
}
|
|
20376
20485
|
const secondaryView = unit.job.allocateView(unit.xref);
|
|
20377
20486
|
ingestNodes(secondaryView, children);
|
|
20378
|
-
const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, i18nMeta, sourceSpan);
|
|
20487
|
+
const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, i18nMeta, sourceSpan, sourceSpan);
|
|
20379
20488
|
unit.create.push(templateOp);
|
|
20380
20489
|
return templateOp;
|
|
20381
20490
|
}
|
|
@@ -20449,6 +20558,9 @@ function ingestDeferBlock(unit, deferBlock) {
|
|
|
20449
20558
|
deferOnOps.push(deferOnOp);
|
|
20450
20559
|
}
|
|
20451
20560
|
if (triggers.when !== void 0) {
|
|
20561
|
+
if (triggers.when.value instanceof Interpolation) {
|
|
20562
|
+
throw new Error(`Unexpected interpolation in defer block when trigger`);
|
|
20563
|
+
}
|
|
20452
20564
|
const deferOnOp = createDeferWhenOp(deferXref, convertAst(triggers.when.value, unit.job, triggers.when.sourceSpan), prefetch, triggers.when.sourceSpan);
|
|
20453
20565
|
deferWhenOps.push(deferOnOp);
|
|
20454
20566
|
}
|
|
@@ -20468,9 +20580,9 @@ function ingestIcu(unit, icu) {
|
|
|
20468
20580
|
unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
|
|
20469
20581
|
for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
|
|
20470
20582
|
if (text2 instanceof BoundText) {
|
|
20471
|
-
ingestBoundText(unit, text2,
|
|
20583
|
+
ingestBoundText(unit, text2, placeholder);
|
|
20472
20584
|
} else {
|
|
20473
|
-
ingestText(unit, text2);
|
|
20585
|
+
ingestText(unit, text2, placeholder);
|
|
20474
20586
|
}
|
|
20475
20587
|
}
|
|
20476
20588
|
unit.create.push(createIcuEndOp(xref));
|
|
@@ -20500,9 +20612,11 @@ function ingestForBlock(unit, forBlock) {
|
|
|
20500
20612
|
const track = convertAst(forBlock.trackBy, unit.job, sourceSpan);
|
|
20501
20613
|
ingestNodes(repeaterView, forBlock.children);
|
|
20502
20614
|
let emptyView = null;
|
|
20615
|
+
let emptyTagName = null;
|
|
20503
20616
|
if (forBlock.empty !== null) {
|
|
20504
20617
|
emptyView = unit.job.allocateView(unit.xref);
|
|
20505
20618
|
ingestNodes(emptyView, forBlock.empty.children);
|
|
20619
|
+
emptyTagName = ingestControlFlowInsertionPoint(unit, emptyView.xref, forBlock.empty);
|
|
20506
20620
|
}
|
|
20507
20621
|
const varNames = {
|
|
20508
20622
|
$index: forBlock.contextVariables.$index.name,
|
|
@@ -20522,7 +20636,7 @@ function ingestForBlock(unit, forBlock) {
|
|
|
20522
20636
|
const i18nPlaceholder = forBlock.i18n;
|
|
20523
20637
|
const emptyI18nPlaceholder = (_b2 = forBlock.empty) == null ? void 0 : _b2.i18n;
|
|
20524
20638
|
const tagName = ingestControlFlowInsertionPoint(unit, repeaterView.xref, forBlock);
|
|
20525
|
-
const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_c2 = emptyView == null ? void 0 : emptyView.xref) != null ? _c2 : null, tagName, track, varNames, i18nPlaceholder, emptyI18nPlaceholder, forBlock.sourceSpan);
|
|
20639
|
+
const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_c2 = emptyView == null ? void 0 : emptyView.xref) != null ? _c2 : null, tagName, track, varNames, emptyTagName, i18nPlaceholder, emptyI18nPlaceholder, forBlock.startSourceSpan, forBlock.sourceSpan);
|
|
20526
20640
|
unit.create.push(repeaterCreate2);
|
|
20527
20641
|
const expression = convertAst(forBlock.expression, unit.job, convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan));
|
|
20528
20642
|
const repeater2 = createRepeaterOp(repeaterCreate2.xref, repeaterCreate2.handle, expression, forBlock.sourceSpan);
|
|
@@ -20532,7 +20646,10 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
20532
20646
|
if (ast instanceof ASTWithSource) {
|
|
20533
20647
|
return convertAst(ast.ast, job, baseSourceSpan);
|
|
20534
20648
|
} else if (ast instanceof PropertyRead) {
|
|
20535
|
-
|
|
20649
|
+
const isThisReceiver = ast.receiver instanceof ThisReceiver;
|
|
20650
|
+
const isImplicitReceiver = ast.receiver instanceof ImplicitReceiver && !(ast.receiver instanceof ThisReceiver);
|
|
20651
|
+
const isSpecialNode = ast.name === "$any" || ast.name === "$event";
|
|
20652
|
+
if (isImplicitReceiver || isThisReceiver && !isSpecialNode) {
|
|
20536
20653
|
return new LexicalReadExpr(ast.name);
|
|
20537
20654
|
} else {
|
|
20538
20655
|
return new ReadPropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, null, convertSourceSpan(ast.span, baseSourceSpan));
|
|
@@ -20610,13 +20727,13 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
20610
20727
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan == null ? void 0 : baseSourceSpan.start.file.url}"`);
|
|
20611
20728
|
}
|
|
20612
20729
|
}
|
|
20613
|
-
function convertAstWithInterpolation(job, value, i18nMeta) {
|
|
20730
|
+
function convertAstWithInterpolation(job, value, i18nMeta, sourceSpan) {
|
|
20614
20731
|
var _a2, _b2;
|
|
20615
20732
|
let expression;
|
|
20616
20733
|
if (value instanceof Interpolation) {
|
|
20617
|
-
expression = new Interpolation2(value.strings, value.expressions.map((e) => convertAst(e, job, null)), Object.keys((_b2 = (_a2 = asMessage(i18nMeta)) == null ? void 0 : _a2.placeholders) != null ? _b2 : {}));
|
|
20734
|
+
expression = new Interpolation2(value.strings, value.expressions.map((e) => convertAst(e, job, sourceSpan != null ? sourceSpan : null)), Object.keys((_b2 = (_a2 = asMessage(i18nMeta)) == null ? void 0 : _a2.placeholders) != null ? _b2 : {}));
|
|
20618
20735
|
} else if (value instanceof AST) {
|
|
20619
|
-
expression = convertAst(value, job, null);
|
|
20736
|
+
expression = convertAst(value, job, sourceSpan != null ? sourceSpan : null);
|
|
20620
20737
|
} else {
|
|
20621
20738
|
expression = literal(value);
|
|
20622
20739
|
}
|
|
@@ -23711,7 +23828,12 @@ var TemplateDefinitionBuilder = class {
|
|
|
23711
23828
|
});
|
|
23712
23829
|
const { expression: trackByExpression, usesComponentInstance: trackByUsesComponentInstance } = this.createTrackByFunction(block);
|
|
23713
23830
|
let emptyData = null;
|
|
23831
|
+
let emptyTagName = null;
|
|
23832
|
+
let emptyAttrsExprs;
|
|
23714
23833
|
if (block.empty !== null) {
|
|
23834
|
+
const emptyInferred = this.inferProjectionDataFromInsertionPoint(block.empty);
|
|
23835
|
+
emptyTagName = emptyInferred.tagName;
|
|
23836
|
+
emptyAttrsExprs = emptyInferred.attrsExprs;
|
|
23715
23837
|
emptyData = this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty", void 0, block.empty.i18n);
|
|
23716
23838
|
this.allocateBindingSlots(null);
|
|
23717
23839
|
}
|
|
@@ -23727,11 +23849,11 @@ var TemplateDefinitionBuilder = class {
|
|
|
23727
23849
|
trackByExpression
|
|
23728
23850
|
];
|
|
23729
23851
|
if (emptyData !== null) {
|
|
23730
|
-
params.push(literal(trackByUsesComponentInstance), variable(emptyData.name), literal(emptyData.getConstCount()), literal(emptyData.getVarCount()));
|
|
23852
|
+
params.push(literal(trackByUsesComponentInstance), variable(emptyData.name), literal(emptyData.getConstCount()), literal(emptyData.getVarCount()), literal(emptyTagName), this.addAttrsToConsts(emptyAttrsExprs || null));
|
|
23731
23853
|
} else if (trackByUsesComponentInstance) {
|
|
23732
23854
|
params.push(literal(trackByUsesComponentInstance));
|
|
23733
23855
|
}
|
|
23734
|
-
return params;
|
|
23856
|
+
return trimTrailingNulls(params);
|
|
23735
23857
|
});
|
|
23736
23858
|
const value = block.expression.visit(this._valueConverter);
|
|
23737
23859
|
this.updateInstructionWithAdvance(blockIndex, block.sourceSpan, Identifiers.repeater, () => [this.convertPropertyBinding(value)]);
|
|
@@ -24294,12 +24416,15 @@ var BindingScope = class {
|
|
|
24294
24416
|
}
|
|
24295
24417
|
};
|
|
24296
24418
|
var TrackByBindingScope = class extends BindingScope {
|
|
24297
|
-
constructor(parentScope,
|
|
24419
|
+
constructor(parentScope, globalOverrides) {
|
|
24298
24420
|
super(parentScope.bindingLevel + 1, parentScope);
|
|
24299
|
-
this.
|
|
24421
|
+
this.globalOverrides = globalOverrides;
|
|
24300
24422
|
this.componentAccessCount = 0;
|
|
24301
24423
|
}
|
|
24302
24424
|
get(name) {
|
|
24425
|
+
if (this.globalOverrides.hasOwnProperty(name)) {
|
|
24426
|
+
return variable(this.globalOverrides[name]);
|
|
24427
|
+
}
|
|
24303
24428
|
let current = this.parent;
|
|
24304
24429
|
while (current) {
|
|
24305
24430
|
if (current.hasLocal(name)) {
|
|
@@ -24307,9 +24432,6 @@ var TrackByBindingScope = class extends BindingScope {
|
|
|
24307
24432
|
}
|
|
24308
24433
|
current = current.parent;
|
|
24309
24434
|
}
|
|
24310
|
-
if (this.globalAliases[name]) {
|
|
24311
|
-
return variable(this.globalAliases[name]);
|
|
24312
|
-
}
|
|
24313
24435
|
this.componentAccessCount++;
|
|
24314
24436
|
return variable("this").prop(name);
|
|
24315
24437
|
}
|
|
@@ -26328,7 +26450,7 @@ function publishFacade(global) {
|
|
|
26328
26450
|
}
|
|
26329
26451
|
|
|
26330
26452
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
|
|
26331
|
-
var VERSION2 = new Version("17.1.0-next.
|
|
26453
|
+
var VERSION2 = new Version("17.1.0-next.5");
|
|
26332
26454
|
|
|
26333
26455
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
26334
26456
|
var _I18N_ATTR = "i18n";
|
|
@@ -27394,7 +27516,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
|
|
|
27394
27516
|
function compileDeclareClassMetadata(metadata) {
|
|
27395
27517
|
const definitionMap = new DefinitionMap();
|
|
27396
27518
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
27397
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27519
|
+
definitionMap.set("version", literal("17.1.0-next.5"));
|
|
27398
27520
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27399
27521
|
definitionMap.set("type", metadata.type);
|
|
27400
27522
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -27463,7 +27585,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
27463
27585
|
const definitionMap = new DefinitionMap();
|
|
27464
27586
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
27465
27587
|
definitionMap.set("minVersion", literal(minVersion));
|
|
27466
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27588
|
+
definitionMap.set("version", literal("17.1.0-next.5"));
|
|
27467
27589
|
definitionMap.set("type", meta.type.value);
|
|
27468
27590
|
if (meta.isStandalone) {
|
|
27469
27591
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -27756,7 +27878,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION2 = "12.0.0";
|
|
|
27756
27878
|
function compileDeclareFactoryFunction(meta) {
|
|
27757
27879
|
const definitionMap = new DefinitionMap();
|
|
27758
27880
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION2));
|
|
27759
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27881
|
+
definitionMap.set("version", literal("17.1.0-next.5"));
|
|
27760
27882
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27761
27883
|
definitionMap.set("type", meta.type.value);
|
|
27762
27884
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -27779,7 +27901,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
27779
27901
|
function createInjectableDefinitionMap(meta) {
|
|
27780
27902
|
const definitionMap = new DefinitionMap();
|
|
27781
27903
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
27782
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27904
|
+
definitionMap.set("version", literal("17.1.0-next.5"));
|
|
27783
27905
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27784
27906
|
definitionMap.set("type", meta.type.value);
|
|
27785
27907
|
if (meta.providedIn !== void 0) {
|
|
@@ -27817,7 +27939,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
27817
27939
|
function createInjectorDefinitionMap(meta) {
|
|
27818
27940
|
const definitionMap = new DefinitionMap();
|
|
27819
27941
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
27820
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27942
|
+
definitionMap.set("version", literal("17.1.0-next.5"));
|
|
27821
27943
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27822
27944
|
definitionMap.set("type", meta.type.value);
|
|
27823
27945
|
definitionMap.set("providers", meta.providers);
|
|
@@ -27841,7 +27963,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
27841
27963
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
27842
27964
|
}
|
|
27843
27965
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
27844
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27966
|
+
definitionMap.set("version", literal("17.1.0-next.5"));
|
|
27845
27967
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27846
27968
|
definitionMap.set("type", meta.type.value);
|
|
27847
27969
|
if (meta.bootstrap.length > 0) {
|
|
@@ -27876,7 +27998,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
27876
27998
|
function createPipeDefinitionMap(meta) {
|
|
27877
27999
|
const definitionMap = new DefinitionMap();
|
|
27878
28000
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
27879
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
28001
|
+
definitionMap.set("version", literal("17.1.0-next.5"));
|
|
27880
28002
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27881
28003
|
definitionMap.set("type", meta.type.value);
|
|
27882
28004
|
if (meta.isStandalone) {
|
|
@@ -27893,7 +28015,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
27893
28015
|
publishFacade(_global);
|
|
27894
28016
|
|
|
27895
28017
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
27896
|
-
var VERSION3 = new Version("17.1.0-next.
|
|
28018
|
+
var VERSION3 = new Version("17.1.0-next.5");
|
|
27897
28019
|
|
|
27898
28020
|
// bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
27899
28021
|
var EmitFlags;
|
|
@@ -41505,7 +41627,14 @@ Deferred blocks can only access triggers in same view, a parent embedded view or
|
|
|
41505
41627
|
this._diagnostics.push(makeTemplateDiagnostic(templateId, this.resolver.getSourceMapping(templateId), trigger.sourceSpan, import_typescript87.default.DiagnosticCategory.Error, ngErrorCode(ErrorCode.INACCESSIBLE_DEFERRED_TRIGGER_ELEMENT), message));
|
|
41506
41628
|
}
|
|
41507
41629
|
controlFlowPreventingContentProjection(templateId, category, projectionNode, componentName, slotSelector, controlFlowNode, preservesWhitespaces) {
|
|
41508
|
-
|
|
41630
|
+
let blockName;
|
|
41631
|
+
if (controlFlowNode instanceof ForLoopBlockEmpty) {
|
|
41632
|
+
blockName = "@empty";
|
|
41633
|
+
} else if (controlFlowNode instanceof ForLoopBlock) {
|
|
41634
|
+
blockName = "@for";
|
|
41635
|
+
} else {
|
|
41636
|
+
blockName = "@if";
|
|
41637
|
+
}
|
|
41509
41638
|
const lines = [
|
|
41510
41639
|
`Node matches the "${slotSelector}" slot of the "${componentName}" component, but will not be projected into the specific slot because the surrounding ${blockName} has more than one node at its root. To project the node in the right slot, you can:
|
|
41511
41640
|
`,
|
|
@@ -42460,7 +42589,12 @@ var TcbControlFlowContentProjectionOp = class extends TcbOp {
|
|
|
42460
42589
|
for (const child of this.element.children) {
|
|
42461
42590
|
let eligibleNode = null;
|
|
42462
42591
|
if (child instanceof ForLoopBlock) {
|
|
42463
|
-
|
|
42592
|
+
if (this.shouldCheck(child)) {
|
|
42593
|
+
result.push(child);
|
|
42594
|
+
}
|
|
42595
|
+
if (child.empty !== null && this.shouldCheck(child.empty)) {
|
|
42596
|
+
result.push(child.empty);
|
|
42597
|
+
}
|
|
42464
42598
|
} else if (child instanceof IfBlock) {
|
|
42465
42599
|
eligibleNode = child.branches[0];
|
|
42466
42600
|
}
|
|
@@ -42479,6 +42613,18 @@ var TcbControlFlowContentProjectionOp = class extends TcbOp {
|
|
|
42479
42613
|
}
|
|
42480
42614
|
return result;
|
|
42481
42615
|
}
|
|
42616
|
+
shouldCheck(node) {
|
|
42617
|
+
if (node.children.length < 2) {
|
|
42618
|
+
return false;
|
|
42619
|
+
}
|
|
42620
|
+
const rootNodeCount = node.children.reduce((count, node2) => {
|
|
42621
|
+
if (!(node2 instanceof Text) || this.tcb.hostPreserveWhitespaces || node2.value.trim().length > 0) {
|
|
42622
|
+
count++;
|
|
42623
|
+
}
|
|
42624
|
+
return count;
|
|
42625
|
+
}, 0);
|
|
42626
|
+
return rootNodeCount > 1;
|
|
42627
|
+
}
|
|
42482
42628
|
};
|
|
42483
42629
|
var ATTR_TO_PROP = new Map(Object.entries({
|
|
42484
42630
|
"class": "className",
|