@angular/core 17.0.2 → 17.0.3
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/core_render3_private_export.mjs +2 -2
- package/esm2022/src/render3/index.mjs +2 -2
- package/esm2022/src/render3/instructions/change_detection.mjs +9 -19
- package/esm2022/src/render3/instructions/shared.mjs +4 -5
- package/esm2022/src/render3/interfaces/container.mjs +22 -17
- package/esm2022/src/render3/interfaces/view.mjs +2 -2
- package/esm2022/src/render3/node_manipulation.mjs +3 -3
- package/esm2022/src/render3/util/change_detection_utils.mjs +13 -2
- package/esm2022/src/render3/util/injector_discovery_utils.mjs +10 -13
- package/esm2022/src/render3/util/view_utils.mjs +4 -4
- package/esm2022/src/render3/view_ref.mjs +3 -3
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed_compiler.mjs +4 -1
- package/fesm2022/core.mjs +59 -56
- 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 +4 -1
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +27 -36
- 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 +187 -98
- package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
- package/schematics/ng-generate/control-flow-migration/bundle.js +518 -232
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
- package/schematics/ng-generate/standalone-migration/bundle.js +176 -106
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
|
@@ -7868,8 +7868,8 @@ var OpKind;
|
|
|
7868
7868
|
OpKind2[OpKind2["I18nEnd"] = 38] = "I18nEnd";
|
|
7869
7869
|
OpKind2[OpKind2["I18nExpression"] = 39] = "I18nExpression";
|
|
7870
7870
|
OpKind2[OpKind2["I18nApply"] = 40] = "I18nApply";
|
|
7871
|
-
OpKind2[OpKind2["
|
|
7872
|
-
OpKind2[OpKind2["
|
|
7871
|
+
OpKind2[OpKind2["IcuStart"] = 41] = "IcuStart";
|
|
7872
|
+
OpKind2[OpKind2["IcuEnd"] = 42] = "IcuEnd";
|
|
7873
7873
|
OpKind2[OpKind2["I18nContext"] = 43] = "I18nContext";
|
|
7874
7874
|
})(OpKind || (OpKind = {}));
|
|
7875
7875
|
var ExpressionKind;
|
|
@@ -7954,6 +7954,7 @@ var I18nParamValueFlags;
|
|
|
7954
7954
|
I18nParamValueFlags2[I18nParamValueFlags2["TemplateTag"] = 2] = "TemplateTag";
|
|
7955
7955
|
I18nParamValueFlags2[I18nParamValueFlags2["OpenTag"] = 4] = "OpenTag";
|
|
7956
7956
|
I18nParamValueFlags2[I18nParamValueFlags2["CloseTag"] = 8] = "CloseTag";
|
|
7957
|
+
I18nParamValueFlags2[I18nParamValueFlags2["ExpressionIndex"] = 16] = "ExpressionIndex";
|
|
7957
7958
|
})(I18nParamValueFlags || (I18nParamValueFlags = {}));
|
|
7958
7959
|
var Namespace;
|
|
7959
7960
|
(function(Namespace2) {
|
|
@@ -8180,13 +8181,6 @@ function createI18nApplyOp(target, handle, sourceSpan) {
|
|
|
8180
8181
|
sourceSpan
|
|
8181
8182
|
}, NEW_OP);
|
|
8182
8183
|
}
|
|
8183
|
-
function createIcuUpdateOp(xref, sourceSpan) {
|
|
8184
|
-
return __spreadValues({
|
|
8185
|
-
kind: OpKind.IcuUpdate,
|
|
8186
|
-
xref,
|
|
8187
|
-
sourceSpan
|
|
8188
|
-
}, NEW_OP);
|
|
8189
|
-
}
|
|
8190
8184
|
|
|
8191
8185
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
|
|
8192
8186
|
var _a;
|
|
@@ -8950,8 +8944,8 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
8950
8944
|
case OpKind.I18nContext:
|
|
8951
8945
|
case OpKind.I18nEnd:
|
|
8952
8946
|
case OpKind.I18nStart:
|
|
8953
|
-
case OpKind.
|
|
8954
|
-
case OpKind.
|
|
8947
|
+
case OpKind.IcuEnd:
|
|
8948
|
+
case OpKind.IcuStart:
|
|
8955
8949
|
case OpKind.Namespace:
|
|
8956
8950
|
case OpKind.Pipe:
|
|
8957
8951
|
case OpKind.Projection:
|
|
@@ -9453,17 +9447,22 @@ function createI18nEndOp(xref) {
|
|
|
9453
9447
|
xref
|
|
9454
9448
|
}, NEW_OP);
|
|
9455
9449
|
}
|
|
9456
|
-
function
|
|
9450
|
+
function createIcuStartOp(xref, message, messagePlaceholder, sourceSpan) {
|
|
9457
9451
|
return __spreadValues({
|
|
9458
|
-
kind: OpKind.
|
|
9452
|
+
kind: OpKind.IcuStart,
|
|
9459
9453
|
xref,
|
|
9460
9454
|
message,
|
|
9461
|
-
icu,
|
|
9462
9455
|
messagePlaceholder,
|
|
9463
9456
|
context: null,
|
|
9464
9457
|
sourceSpan
|
|
9465
9458
|
}, NEW_OP);
|
|
9466
9459
|
}
|
|
9460
|
+
function createIcuEndOp(xref) {
|
|
9461
|
+
return __spreadValues({
|
|
9462
|
+
kind: OpKind.IcuEnd,
|
|
9463
|
+
xref
|
|
9464
|
+
}, NEW_OP);
|
|
9465
|
+
}
|
|
9467
9466
|
function createI18nContextOp(xref, i18nBlock, message, sourceSpan) {
|
|
9468
9467
|
return __spreadValues({
|
|
9469
9468
|
kind: OpKind.I18nContext,
|
|
@@ -9617,20 +9616,30 @@ function removeAnys(e) {
|
|
|
9617
9616
|
|
|
9618
9617
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
|
|
9619
9618
|
function applyI18nExpressions(job) {
|
|
9619
|
+
const i18nContexts = /* @__PURE__ */ new Map();
|
|
9620
|
+
for (const unit of job.units) {
|
|
9621
|
+
for (const op of unit.create) {
|
|
9622
|
+
if (op.kind === OpKind.I18nContext) {
|
|
9623
|
+
i18nContexts.set(op.xref, op);
|
|
9624
|
+
}
|
|
9625
|
+
}
|
|
9626
|
+
}
|
|
9620
9627
|
for (const unit of job.units) {
|
|
9621
9628
|
for (const op of unit.update) {
|
|
9622
|
-
if (op.kind === OpKind.I18nExpression && needsApplication(op)) {
|
|
9629
|
+
if (op.kind === OpKind.I18nExpression && needsApplication(i18nContexts, op)) {
|
|
9623
9630
|
OpList.insertAfter(createI18nApplyOp(op.target, op.handle, null), op);
|
|
9624
9631
|
}
|
|
9625
9632
|
}
|
|
9626
9633
|
}
|
|
9627
9634
|
}
|
|
9628
|
-
function needsApplication(op) {
|
|
9635
|
+
function needsApplication(i18nContexts, op) {
|
|
9629
9636
|
var _a2;
|
|
9630
9637
|
if (((_a2 = op.next) == null ? void 0 : _a2.kind) !== OpKind.I18nExpression) {
|
|
9631
9638
|
return true;
|
|
9632
9639
|
}
|
|
9633
|
-
|
|
9640
|
+
const context = i18nContexts.get(op.context);
|
|
9641
|
+
const nextContext2 = i18nContexts.get(op.next.context);
|
|
9642
|
+
if (context.i18nBlock !== nextContext2.i18nBlock) {
|
|
9634
9643
|
return true;
|
|
9635
9644
|
}
|
|
9636
9645
|
return false;
|
|
@@ -10174,7 +10183,7 @@ function createI18nContexts(job) {
|
|
|
10174
10183
|
case OpKind.I18nEnd:
|
|
10175
10184
|
currentI18nOp = null;
|
|
10176
10185
|
break;
|
|
10177
|
-
case OpKind.
|
|
10186
|
+
case OpKind.IcuStart:
|
|
10178
10187
|
if (currentI18nOp === null) {
|
|
10179
10188
|
throw Error("Unexpected ICU outside of an i18n block.");
|
|
10180
10189
|
}
|
|
@@ -10191,52 +10200,6 @@ function createI18nContexts(job) {
|
|
|
10191
10200
|
}
|
|
10192
10201
|
}
|
|
10193
10202
|
|
|
10194
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_icu_expressions.mjs
|
|
10195
|
-
function createI18nIcuExpressions(job) {
|
|
10196
|
-
const icus = /* @__PURE__ */ new Map();
|
|
10197
|
-
const i18nContexts = /* @__PURE__ */ new Map();
|
|
10198
|
-
const i18nBlocks = /* @__PURE__ */ new Map();
|
|
10199
|
-
for (const unit of job.units) {
|
|
10200
|
-
for (const op of unit.create) {
|
|
10201
|
-
switch (op.kind) {
|
|
10202
|
-
case OpKind.Icu:
|
|
10203
|
-
icus.set(op.xref, op);
|
|
10204
|
-
break;
|
|
10205
|
-
case OpKind.I18nContext:
|
|
10206
|
-
i18nContexts.set(op.xref, op);
|
|
10207
|
-
break;
|
|
10208
|
-
case OpKind.I18nStart:
|
|
10209
|
-
i18nBlocks.set(op.xref, op);
|
|
10210
|
-
break;
|
|
10211
|
-
}
|
|
10212
|
-
}
|
|
10213
|
-
for (const op of unit.update) {
|
|
10214
|
-
switch (op.kind) {
|
|
10215
|
-
case OpKind.IcuUpdate:
|
|
10216
|
-
const icuOp = icus.get(op.xref);
|
|
10217
|
-
if ((icuOp == null ? void 0 : icuOp.icu.expressionPlaceholder) === void 0) {
|
|
10218
|
-
throw Error("ICU should have an i18n placeholder");
|
|
10219
|
-
}
|
|
10220
|
-
if (icuOp.context === null) {
|
|
10221
|
-
throw Error("ICU should have its i18n context set");
|
|
10222
|
-
}
|
|
10223
|
-
const i18nContext = i18nContexts.get(icuOp.context);
|
|
10224
|
-
const i18nBlock = i18nBlocks.get(i18nContext.i18nBlock);
|
|
10225
|
-
OpList.replace(op, createI18nExpressionOp(
|
|
10226
|
-
i18nContext.xref,
|
|
10227
|
-
i18nBlock.xref,
|
|
10228
|
-
i18nBlock.handle,
|
|
10229
|
-
new LexicalReadExpr(icuOp.icu.expression),
|
|
10230
|
-
icuOp.icu.expressionPlaceholder,
|
|
10231
|
-
I18nParamResolutionTime.Postproccessing,
|
|
10232
|
-
null
|
|
10233
|
-
));
|
|
10234
|
-
break;
|
|
10235
|
-
}
|
|
10236
|
-
}
|
|
10237
|
-
}
|
|
10238
|
-
}
|
|
10239
|
-
|
|
10240
10203
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
|
|
10241
10204
|
function configureDeferInstructions(job) {
|
|
10242
10205
|
for (const unit of job.units) {
|
|
@@ -10550,18 +10513,23 @@ function extractI18nMessages(job) {
|
|
|
10550
10513
|
}
|
|
10551
10514
|
for (const unit of job.units) {
|
|
10552
10515
|
for (const op of unit.create) {
|
|
10553
|
-
|
|
10554
|
-
|
|
10555
|
-
|
|
10556
|
-
|
|
10557
|
-
|
|
10558
|
-
|
|
10559
|
-
|
|
10560
|
-
|
|
10561
|
-
|
|
10562
|
-
|
|
10563
|
-
|
|
10564
|
-
|
|
10516
|
+
switch (op.kind) {
|
|
10517
|
+
case OpKind.IcuStart:
|
|
10518
|
+
if (!op.context) {
|
|
10519
|
+
throw Error("ICU op should have its context set.");
|
|
10520
|
+
}
|
|
10521
|
+
if (!i18nBlockContexts.has(op.context)) {
|
|
10522
|
+
const i18nContext = i18nContexts.get(op.context);
|
|
10523
|
+
const subMessage = createI18nMessage(job, i18nContext, op.messagePlaceholder);
|
|
10524
|
+
unit.create.push(subMessage);
|
|
10525
|
+
const parentMessage = i18nBlockMessages.get(i18nContext.i18nBlock);
|
|
10526
|
+
parentMessage == null ? void 0 : parentMessage.subMessages.push(subMessage.xref);
|
|
10527
|
+
}
|
|
10528
|
+
OpList.remove(op);
|
|
10529
|
+
break;
|
|
10530
|
+
case OpKind.IcuEnd:
|
|
10531
|
+
OpList.remove(op);
|
|
10532
|
+
break;
|
|
10565
10533
|
}
|
|
10566
10534
|
}
|
|
10567
10535
|
}
|
|
@@ -10577,7 +10545,7 @@ function createI18nMessage(job, context, messagePlaceholder) {
|
|
|
10577
10545
|
}
|
|
10578
10546
|
function formatParams(params) {
|
|
10579
10547
|
const result = /* @__PURE__ */ new Map();
|
|
10580
|
-
for (const [placeholder, placeholderValues] of
|
|
10548
|
+
for (const [placeholder, placeholderValues] of params) {
|
|
10581
10549
|
const serializedValues = formatParamValues(placeholderValues);
|
|
10582
10550
|
if (serializedValues !== null) {
|
|
10583
10551
|
result.set(placeholder, literal(formatParamValues(placeholderValues)));
|
|
@@ -10593,6 +10561,9 @@ function formatParamValues(values) {
|
|
|
10593
10561
|
return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
|
|
10594
10562
|
}
|
|
10595
10563
|
function formatValue(value) {
|
|
10564
|
+
if (value.flags === I18nParamValueFlags.None) {
|
|
10565
|
+
return `${value.value}`;
|
|
10566
|
+
}
|
|
10596
10567
|
let tagMarker = "";
|
|
10597
10568
|
let closeMarker = "";
|
|
10598
10569
|
if (value.flags & I18nParamValueFlags.ElementTag) {
|
|
@@ -16745,11 +16716,13 @@ function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
|
|
|
16745
16716
|
statements.push(...subMessageStatements);
|
|
16746
16717
|
messageOp.params.set(subMessage.messagePlaceholder, subMessageVar);
|
|
16747
16718
|
}
|
|
16719
|
+
messageOp.params = new Map([...messageOp.params.entries()].sort());
|
|
16748
16720
|
assertAllParamsResolved(messageOp);
|
|
16749
16721
|
const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
|
|
16750
16722
|
const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
|
|
16751
16723
|
let transformFn = void 0;
|
|
16752
16724
|
if (messageOp.needsPostprocessing) {
|
|
16725
|
+
messageOp.postprocessingParams = new Map([...messageOp.postprocessingParams.entries()].sort());
|
|
16753
16726
|
const extraTransformFnParams = [];
|
|
16754
16727
|
if (messageOp.postprocessingParams.size > 0) {
|
|
16755
16728
|
extraTransformFnParams.push(literalMap([...messageOp.postprocessingParams].map(([key, value]) => ({ key, value, quoted: true }))));
|
|
@@ -16787,12 +16760,14 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
|
|
|
16787
16760
|
return variable(name);
|
|
16788
16761
|
}
|
|
16789
16762
|
function assertAllParamsResolved(op) {
|
|
16790
|
-
for (
|
|
16763
|
+
for (let placeholder in op.message.placeholders) {
|
|
16764
|
+
placeholder = placeholder.trimEnd();
|
|
16791
16765
|
if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
|
|
16792
16766
|
throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
|
|
16793
16767
|
}
|
|
16794
16768
|
}
|
|
16795
|
-
for (
|
|
16769
|
+
for (let placeholder in op.message.placeholderToMessage) {
|
|
16770
|
+
placeholder = placeholder.trimEnd();
|
|
16796
16771
|
if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
|
|
16797
16772
|
throw Error(`Failed to resolve i18n message placeholder: ${placeholder}`);
|
|
16798
16773
|
}
|
|
@@ -16804,7 +16779,9 @@ function extractI18nText(job) {
|
|
|
16804
16779
|
var _a2;
|
|
16805
16780
|
for (const unit of job.units) {
|
|
16806
16781
|
let currentI18n = null;
|
|
16782
|
+
let currentIcu = null;
|
|
16807
16783
|
const textNodeI18nBlocks = /* @__PURE__ */ new Map();
|
|
16784
|
+
const textNodeIcus = /* @__PURE__ */ new Map();
|
|
16808
16785
|
for (const op of unit.create) {
|
|
16809
16786
|
switch (op.kind) {
|
|
16810
16787
|
case OpKind.I18nStart:
|
|
@@ -16816,9 +16793,19 @@ function extractI18nText(job) {
|
|
|
16816
16793
|
case OpKind.I18nEnd:
|
|
16817
16794
|
currentI18n = null;
|
|
16818
16795
|
break;
|
|
16796
|
+
case OpKind.IcuStart:
|
|
16797
|
+
if (op.context === null) {
|
|
16798
|
+
throw Error("Icu op should have its context set.");
|
|
16799
|
+
}
|
|
16800
|
+
currentIcu = op;
|
|
16801
|
+
break;
|
|
16802
|
+
case OpKind.IcuEnd:
|
|
16803
|
+
currentIcu = null;
|
|
16804
|
+
break;
|
|
16819
16805
|
case OpKind.Text:
|
|
16820
16806
|
if (currentI18n !== null) {
|
|
16821
16807
|
textNodeI18nBlocks.set(op.xref, currentI18n);
|
|
16808
|
+
textNodeIcus.set(op.xref, currentIcu);
|
|
16822
16809
|
OpList.remove(op);
|
|
16823
16810
|
}
|
|
16824
16811
|
break;
|
|
@@ -16831,11 +16818,13 @@ function extractI18nText(job) {
|
|
|
16831
16818
|
continue;
|
|
16832
16819
|
}
|
|
16833
16820
|
const i18nOp = textNodeI18nBlocks.get(op.target);
|
|
16821
|
+
const icuOp = textNodeIcus.get(op.target);
|
|
16822
|
+
const contextId = icuOp ? icuOp.context : i18nOp.context;
|
|
16823
|
+
const resolutionTime = icuOp ? I18nParamResolutionTime.Postproccessing : I18nParamResolutionTime.Creation;
|
|
16834
16824
|
const ops = [];
|
|
16835
16825
|
for (let i = 0; i < op.interpolation.expressions.length; i++) {
|
|
16836
16826
|
const expr = op.interpolation.expressions[i];
|
|
16837
|
-
|
|
16838
|
-
ops.push(createI18nExpressionOp(i18nOp.context, i18nOp.xref, i18nOp.handle, expr, placeholder.name, I18nParamResolutionTime.Creation, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
|
|
16827
|
+
ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.handle, expr, op.i18nPlaceholders[i], resolutionTime, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
|
|
16839
16828
|
}
|
|
16840
16829
|
OpList.replaceWithMany(op, ops);
|
|
16841
16830
|
break;
|
|
@@ -18575,7 +18564,7 @@ function getSubTemplateIndexForTemplateTag(job, i18nOp, op) {
|
|
|
18575
18564
|
}
|
|
18576
18565
|
return i18nOp.subTemplateIndex;
|
|
18577
18566
|
}
|
|
18578
|
-
function addParam(params, placeholder, value, subTemplateIndex, flags
|
|
18567
|
+
function addParam(params, placeholder, value, subTemplateIndex, flags) {
|
|
18579
18568
|
var _a2;
|
|
18580
18569
|
const values = (_a2 = params.get(placeholder)) != null ? _a2 : [];
|
|
18581
18570
|
values.push({ value, subTemplateIndex, flags });
|
|
@@ -18602,18 +18591,75 @@ function resolveI18nExpressionPlaceholders(job) {
|
|
|
18602
18591
|
for (const unit of job.units) {
|
|
18603
18592
|
for (const op of unit.update) {
|
|
18604
18593
|
if (op.kind === OpKind.I18nExpression) {
|
|
18605
|
-
const index = expressionIndices.get(op.context) || 0;
|
|
18606
18594
|
const i18nContext = i18nContexts.get(op.context);
|
|
18595
|
+
const index = expressionIndices.get(i18nContext.i18nBlock) || 0;
|
|
18607
18596
|
const subTemplateIndex = subTemplateIndicies.get(i18nContext.i18nBlock);
|
|
18608
18597
|
const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
|
|
18609
18598
|
const values = params.get(op.i18nPlaceholder) || [];
|
|
18610
|
-
values.push({
|
|
18599
|
+
values.push({
|
|
18600
|
+
value: index,
|
|
18601
|
+
subTemplateIndex,
|
|
18602
|
+
flags: I18nParamValueFlags.ExpressionIndex
|
|
18603
|
+
});
|
|
18611
18604
|
params.set(op.i18nPlaceholder, values);
|
|
18612
|
-
expressionIndices.set(
|
|
18605
|
+
expressionIndices.set(i18nContext.i18nBlock, index + 1);
|
|
18606
|
+
}
|
|
18607
|
+
}
|
|
18608
|
+
}
|
|
18609
|
+
}
|
|
18610
|
+
|
|
18611
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
|
|
18612
|
+
function resolveI18nIcuPlaceholders(job) {
|
|
18613
|
+
const contextOps = /* @__PURE__ */ new Map();
|
|
18614
|
+
for (const unit of job.units) {
|
|
18615
|
+
for (const op of unit.create) {
|
|
18616
|
+
switch (op.kind) {
|
|
18617
|
+
case OpKind.I18nContext:
|
|
18618
|
+
contextOps.set(op.xref, op);
|
|
18619
|
+
break;
|
|
18620
|
+
}
|
|
18621
|
+
}
|
|
18622
|
+
}
|
|
18623
|
+
for (const unit of job.units) {
|
|
18624
|
+
for (const op of unit.create) {
|
|
18625
|
+
switch (op.kind) {
|
|
18626
|
+
case OpKind.IcuStart:
|
|
18627
|
+
if (op.context === null) {
|
|
18628
|
+
throw Error("Icu should have its i18n context set.");
|
|
18629
|
+
}
|
|
18630
|
+
const i18nContext = contextOps.get(op.context);
|
|
18631
|
+
for (const node of op.message.nodes) {
|
|
18632
|
+
node.visit(new ResolveIcuPlaceholdersVisitor(i18nContext.postprocessingParams));
|
|
18633
|
+
}
|
|
18634
|
+
break;
|
|
18613
18635
|
}
|
|
18614
18636
|
}
|
|
18615
18637
|
}
|
|
18616
18638
|
}
|
|
18639
|
+
var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
|
|
18640
|
+
constructor(params) {
|
|
18641
|
+
super();
|
|
18642
|
+
this.params = params;
|
|
18643
|
+
}
|
|
18644
|
+
visitTagPlaceholder(placeholder) {
|
|
18645
|
+
var _a2, _b2;
|
|
18646
|
+
super.visitTagPlaceholder(placeholder);
|
|
18647
|
+
if (placeholder.startName && placeholder.startSourceSpan && !this.params.has(placeholder.startName)) {
|
|
18648
|
+
this.params.set(placeholder.startName, [{
|
|
18649
|
+
value: (_a2 = placeholder.startSourceSpan) == null ? void 0 : _a2.toString(),
|
|
18650
|
+
subTemplateIndex: null,
|
|
18651
|
+
flags: I18nParamValueFlags.None
|
|
18652
|
+
}]);
|
|
18653
|
+
}
|
|
18654
|
+
if (placeholder.closeName && placeholder.endSourceSpan && !this.params.has(placeholder.closeName)) {
|
|
18655
|
+
this.params.set(placeholder.closeName, [{
|
|
18656
|
+
value: (_b2 = placeholder.endSourceSpan) == null ? void 0 : _b2.toString(),
|
|
18657
|
+
subTemplateIndex: null,
|
|
18658
|
+
flags: I18nParamValueFlags.None
|
|
18659
|
+
}]);
|
|
18660
|
+
}
|
|
18661
|
+
}
|
|
18662
|
+
};
|
|
18617
18663
|
|
|
18618
18664
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
|
|
18619
18665
|
function resolveNames(job) {
|
|
@@ -19331,6 +19377,7 @@ function allowConservativeInlining(decl, target) {
|
|
|
19331
19377
|
function wrapI18nIcus(job) {
|
|
19332
19378
|
for (const unit of job.units) {
|
|
19333
19379
|
let currentI18nOp = null;
|
|
19380
|
+
let addedI18nId = null;
|
|
19334
19381
|
for (const op of unit.create) {
|
|
19335
19382
|
switch (op.kind) {
|
|
19336
19383
|
case OpKind.I18nStart:
|
|
@@ -19339,11 +19386,16 @@ function wrapI18nIcus(job) {
|
|
|
19339
19386
|
case OpKind.I18nEnd:
|
|
19340
19387
|
currentI18nOp = null;
|
|
19341
19388
|
break;
|
|
19342
|
-
case OpKind.
|
|
19389
|
+
case OpKind.IcuStart:
|
|
19343
19390
|
if (currentI18nOp === null) {
|
|
19344
|
-
|
|
19345
|
-
OpList.insertBefore(createI18nStartOp(
|
|
19346
|
-
|
|
19391
|
+
addedI18nId = job.allocateXrefId();
|
|
19392
|
+
OpList.insertBefore(createI18nStartOp(addedI18nId, op.message), op);
|
|
19393
|
+
}
|
|
19394
|
+
break;
|
|
19395
|
+
case OpKind.IcuEnd:
|
|
19396
|
+
if (addedI18nId !== null) {
|
|
19397
|
+
OpList.insertAfter(createI18nEndOp(addedI18nId), op);
|
|
19398
|
+
addedI18nId = null;
|
|
19347
19399
|
}
|
|
19348
19400
|
break;
|
|
19349
19401
|
}
|
|
@@ -19370,7 +19422,6 @@ var phases = [
|
|
|
19370
19422
|
{ kind: CompilationJobKind.Tmpl, fn: createPipes },
|
|
19371
19423
|
{ kind: CompilationJobKind.Tmpl, fn: configureDeferInstructions },
|
|
19372
19424
|
{ kind: CompilationJobKind.Tmpl, fn: extractI18nText },
|
|
19373
|
-
{ kind: CompilationJobKind.Tmpl, fn: createI18nIcuExpressions },
|
|
19374
19425
|
{ kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
|
|
19375
19426
|
{ kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
|
|
19376
19427
|
{ kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
|
|
@@ -19394,6 +19445,7 @@ var phases = [
|
|
|
19394
19445
|
{ kind: CompilationJobKind.Tmpl, fn: createDeferDepsFns },
|
|
19395
19446
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
|
|
19396
19447
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
|
|
19448
|
+
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nIcuPlaceholders },
|
|
19397
19449
|
{ kind: CompilationJobKind.Tmpl, fn: mergeI18nContexts },
|
|
19398
19450
|
{ kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
|
|
19399
19451
|
{ kind: CompilationJobKind.Tmpl, fn: generateTrackFns },
|
|
@@ -19658,7 +19710,7 @@ function ingestContent(unit, content) {
|
|
|
19658
19710
|
function ingestText(unit, text2) {
|
|
19659
19711
|
unit.create.push(createTextOp(unit.job.allocateXrefId(), text2.value, text2.sourceSpan));
|
|
19660
19712
|
}
|
|
19661
|
-
function ingestBoundText(unit, text2) {
|
|
19713
|
+
function ingestBoundText(unit, text2, i18nPlaceholders) {
|
|
19662
19714
|
var _a2;
|
|
19663
19715
|
let value = text2.value;
|
|
19664
19716
|
if (value instanceof ASTWithSource) {
|
|
@@ -19670,7 +19722,12 @@ function ingestBoundText(unit, text2) {
|
|
|
19670
19722
|
if (text2.i18n !== void 0 && !(text2.i18n instanceof Container)) {
|
|
19671
19723
|
throw Error(`Unhandled i18n metadata type for text interpolation: ${(_a2 = text2.i18n) == null ? void 0 : _a2.constructor.name}`);
|
|
19672
19724
|
}
|
|
19673
|
-
|
|
19725
|
+
if (i18nPlaceholders === void 0) {
|
|
19726
|
+
i18nPlaceholders = text2.i18n instanceof Container ? text2.i18n.children.filter((node) => node instanceof Placeholder).map((placeholder) => placeholder.name) : [];
|
|
19727
|
+
}
|
|
19728
|
+
if (i18nPlaceholders.length > 0 && i18nPlaceholders.length !== value.expressions.length) {
|
|
19729
|
+
throw Error(`Unexpected number of i18n placeholders (${value.expressions.length}) for BoundText with ${value.expressions.length} expressions`);
|
|
19730
|
+
}
|
|
19674
19731
|
const textXref = unit.job.allocateXrefId();
|
|
19675
19732
|
unit.create.push(createTextOp(textXref, "", text2.sourceSpan));
|
|
19676
19733
|
const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
|
|
@@ -19816,13 +19873,26 @@ function ingestDeferBlock(unit, deferBlock) {
|
|
|
19816
19873
|
unit.update.push(deferWhenOps);
|
|
19817
19874
|
}
|
|
19818
19875
|
function ingestIcu(unit, icu) {
|
|
19819
|
-
var _a2;
|
|
19876
|
+
var _a2, _b2;
|
|
19820
19877
|
if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
|
|
19821
19878
|
const xref = unit.job.allocateXrefId();
|
|
19822
|
-
|
|
19823
|
-
unit.
|
|
19879
|
+
const icuNode = icu.i18n.nodes[0];
|
|
19880
|
+
unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
|
|
19881
|
+
const expressionPlaceholder = (_a2 = icuNode.expressionPlaceholder) == null ? void 0 : _a2.trimEnd();
|
|
19882
|
+
if (expressionPlaceholder === void 0 || icu.vars[expressionPlaceholder] === void 0) {
|
|
19883
|
+
throw Error("ICU should have a text binding");
|
|
19884
|
+
}
|
|
19885
|
+
ingestBoundText(unit, icu.vars[expressionPlaceholder], [expressionPlaceholder]);
|
|
19886
|
+
for (const [placeholder, text2] of Object.entries(icu.placeholders)) {
|
|
19887
|
+
if (text2 instanceof BoundText) {
|
|
19888
|
+
ingestBoundText(unit, text2, [placeholder]);
|
|
19889
|
+
} else {
|
|
19890
|
+
ingestText(unit, text2);
|
|
19891
|
+
}
|
|
19892
|
+
}
|
|
19893
|
+
unit.create.push(createIcuEndOp(xref));
|
|
19824
19894
|
} else {
|
|
19825
|
-
throw Error(`Unhandled i18n metadata type for ICU: ${(
|
|
19895
|
+
throw Error(`Unhandled i18n metadata type for ICU: ${(_b2 = icu.i18n) == null ? void 0 : _b2.constructor.name}`);
|
|
19826
19896
|
}
|
|
19827
19897
|
}
|
|
19828
19898
|
function ingestForBlock(unit, forBlock) {
|
|
@@ -22781,7 +22851,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
22781
22851
|
const placeholders = this.i18nBindProps(icu.placeholders);
|
|
22782
22852
|
const message = icu.i18n;
|
|
22783
22853
|
const transformFn = (raw) => {
|
|
22784
|
-
const params = __spreadValues(__spreadValues({}, vars), placeholders);
|
|
22854
|
+
const params = Object.fromEntries(Object.entries(__spreadValues(__spreadValues({}, vars), placeholders)).sort());
|
|
22785
22855
|
const formatted = formatI18nPlaceholderNamesInMap(params, false);
|
|
22786
22856
|
return invokeInstruction(null, Identifiers.i18nPostprocess, [raw, mapLiteral(formatted, true)]);
|
|
22787
22857
|
};
|
|
@@ -25574,7 +25644,7 @@ function publishFacade(global) {
|
|
|
25574
25644
|
}
|
|
25575
25645
|
|
|
25576
25646
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
|
|
25577
|
-
var VERSION2 = new Version("17.0.
|
|
25647
|
+
var VERSION2 = new Version("17.0.3");
|
|
25578
25648
|
|
|
25579
25649
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
25580
25650
|
var _I18N_ATTR = "i18n";
|
|
@@ -26611,7 +26681,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
|
|
|
26611
26681
|
function compileDeclareClassMetadata(metadata) {
|
|
26612
26682
|
const definitionMap = new DefinitionMap();
|
|
26613
26683
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
26614
|
-
definitionMap.set("version", literal("17.0.
|
|
26684
|
+
definitionMap.set("version", literal("17.0.3"));
|
|
26615
26685
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
26616
26686
|
definitionMap.set("type", metadata.type);
|
|
26617
26687
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -26682,7 +26752,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
26682
26752
|
const hasTransformFunctions = Object.values(meta.inputs).some((input) => input.transformFunction !== null);
|
|
26683
26753
|
const minVersion = hasTransformFunctions ? MINIMUM_PARTIAL_LINKER_VERSION2 : "14.0.0";
|
|
26684
26754
|
definitionMap.set("minVersion", literal(minVersion));
|
|
26685
|
-
definitionMap.set("version", literal("17.0.
|
|
26755
|
+
definitionMap.set("version", literal("17.0.3"));
|
|
26686
26756
|
definitionMap.set("type", meta.type.value);
|
|
26687
26757
|
if (meta.isStandalone) {
|
|
26688
26758
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -26914,7 +26984,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION3 = "12.0.0";
|
|
|
26914
26984
|
function compileDeclareFactoryFunction(meta) {
|
|
26915
26985
|
const definitionMap = new DefinitionMap();
|
|
26916
26986
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
26917
|
-
definitionMap.set("version", literal("17.0.
|
|
26987
|
+
definitionMap.set("version", literal("17.0.3"));
|
|
26918
26988
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
26919
26989
|
definitionMap.set("type", meta.type.value);
|
|
26920
26990
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -26937,7 +27007,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
26937
27007
|
function createInjectableDefinitionMap(meta) {
|
|
26938
27008
|
const definitionMap = new DefinitionMap();
|
|
26939
27009
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
26940
|
-
definitionMap.set("version", literal("17.0.
|
|
27010
|
+
definitionMap.set("version", literal("17.0.3"));
|
|
26941
27011
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
26942
27012
|
definitionMap.set("type", meta.type.value);
|
|
26943
27013
|
if (meta.providedIn !== void 0) {
|
|
@@ -26975,7 +27045,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
26975
27045
|
function createInjectorDefinitionMap(meta) {
|
|
26976
27046
|
const definitionMap = new DefinitionMap();
|
|
26977
27047
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
26978
|
-
definitionMap.set("version", literal("17.0.
|
|
27048
|
+
definitionMap.set("version", literal("17.0.3"));
|
|
26979
27049
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
26980
27050
|
definitionMap.set("type", meta.type.value);
|
|
26981
27051
|
definitionMap.set("providers", meta.providers);
|
|
@@ -26999,7 +27069,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
26999
27069
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
27000
27070
|
}
|
|
27001
27071
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
27002
|
-
definitionMap.set("version", literal("17.0.
|
|
27072
|
+
definitionMap.set("version", literal("17.0.3"));
|
|
27003
27073
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27004
27074
|
definitionMap.set("type", meta.type.value);
|
|
27005
27075
|
if (meta.bootstrap.length > 0) {
|
|
@@ -27034,7 +27104,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
27034
27104
|
function createPipeDefinitionMap(meta) {
|
|
27035
27105
|
const definitionMap = new DefinitionMap();
|
|
27036
27106
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION7));
|
|
27037
|
-
definitionMap.set("version", literal("17.0.
|
|
27107
|
+
definitionMap.set("version", literal("17.0.3"));
|
|
27038
27108
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27039
27109
|
definitionMap.set("type", meta.type.value);
|
|
27040
27110
|
if (meta.isStandalone) {
|
|
@@ -27051,7 +27121,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
27051
27121
|
publishFacade(_global);
|
|
27052
27122
|
|
|
27053
27123
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
27054
|
-
var VERSION3 = new Version("17.0.
|
|
27124
|
+
var VERSION3 = new Version("17.0.3");
|
|
27055
27125
|
|
|
27056
27126
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
27057
27127
|
var EmitFlags;
|