@angular/core 17.1.0-next.0 → 17.1.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/src/defer/instructions.mjs +3 -2
- package/esm2022/src/defer/utils.mjs +2 -2
- package/esm2022/src/image_performance_warning.mjs +14 -3
- package/esm2022/src/render3/instructions/change_detection.mjs +2 -2
- package/esm2022/src/render3/instructions/control_flow.mjs +9 -11
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +26 -16
- 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 +2 -5
- 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 +201 -64
- package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
- package/schematics/ng-generate/control-flow-migration/bundle.js +361 -151
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
- package/schematics/ng-generate/control-flow-migration/schema.json +6 -0
- package/schematics/ng-generate/standalone-migration/bundle.js +257 -73
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
|
@@ -868,6 +868,9 @@ var _SerializerVisitor = class {
|
|
|
868
868
|
visitIcuPlaceholder(ph, context) {
|
|
869
869
|
return `<ph icu name="${ph.name}">${ph.value.visit(this)}</ph>`;
|
|
870
870
|
}
|
|
871
|
+
visitBlockPlaceholder(ph, context) {
|
|
872
|
+
return `<ph block name="${ph.startName}">${ph.children.map((child) => child.visit(this)).join(", ")}</ph name="${ph.closeName}">`;
|
|
873
|
+
}
|
|
871
874
|
};
|
|
872
875
|
var serializerVisitor = new _SerializerVisitor();
|
|
873
876
|
function serializeNodes(nodes) {
|
|
@@ -4152,43 +4155,47 @@ var BlockNode = class {
|
|
|
4152
4155
|
}
|
|
4153
4156
|
};
|
|
4154
4157
|
var DeferredBlockPlaceholder = class extends BlockNode {
|
|
4155
|
-
constructor(children, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
4158
|
+
constructor(children, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
4156
4159
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
4157
4160
|
this.children = children;
|
|
4158
4161
|
this.minimumTime = minimumTime;
|
|
4162
|
+
this.i18n = i18n2;
|
|
4159
4163
|
}
|
|
4160
4164
|
visit(visitor) {
|
|
4161
4165
|
return visitor.visitDeferredBlockPlaceholder(this);
|
|
4162
4166
|
}
|
|
4163
4167
|
};
|
|
4164
4168
|
var DeferredBlockLoading = class extends BlockNode {
|
|
4165
|
-
constructor(children, afterTime, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
4169
|
+
constructor(children, afterTime, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
4166
4170
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
4167
4171
|
this.children = children;
|
|
4168
4172
|
this.afterTime = afterTime;
|
|
4169
4173
|
this.minimumTime = minimumTime;
|
|
4174
|
+
this.i18n = i18n2;
|
|
4170
4175
|
}
|
|
4171
4176
|
visit(visitor) {
|
|
4172
4177
|
return visitor.visitDeferredBlockLoading(this);
|
|
4173
4178
|
}
|
|
4174
4179
|
};
|
|
4175
4180
|
var DeferredBlockError = class extends BlockNode {
|
|
4176
|
-
constructor(children, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
4181
|
+
constructor(children, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
4177
4182
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
4178
4183
|
this.children = children;
|
|
4184
|
+
this.i18n = i18n2;
|
|
4179
4185
|
}
|
|
4180
4186
|
visit(visitor) {
|
|
4181
4187
|
return visitor.visitDeferredBlockError(this);
|
|
4182
4188
|
}
|
|
4183
4189
|
};
|
|
4184
4190
|
var DeferredBlock = class extends BlockNode {
|
|
4185
|
-
constructor(children, triggers, prefetchTriggers, placeholder, loading, error2, nameSpan, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan) {
|
|
4191
|
+
constructor(children, triggers, prefetchTriggers, placeholder, loading, error2, nameSpan, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, i18n2) {
|
|
4186
4192
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
4187
4193
|
this.children = children;
|
|
4188
4194
|
this.placeholder = placeholder;
|
|
4189
4195
|
this.loading = loading;
|
|
4190
4196
|
this.error = error2;
|
|
4191
4197
|
this.mainBlockSpan = mainBlockSpan;
|
|
4198
|
+
this.i18n = i18n2;
|
|
4192
4199
|
this.triggers = triggers;
|
|
4193
4200
|
this.prefetchTriggers = prefetchTriggers;
|
|
4194
4201
|
this.definedTriggers = Object.keys(triggers);
|
|
@@ -4220,17 +4227,18 @@ var SwitchBlock = class extends BlockNode {
|
|
|
4220
4227
|
}
|
|
4221
4228
|
};
|
|
4222
4229
|
var SwitchBlockCase = class extends BlockNode {
|
|
4223
|
-
constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
|
|
4230
|
+
constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
|
|
4224
4231
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
4225
4232
|
this.expression = expression;
|
|
4226
4233
|
this.children = children;
|
|
4234
|
+
this.i18n = i18n2;
|
|
4227
4235
|
}
|
|
4228
4236
|
visit(visitor) {
|
|
4229
4237
|
return visitor.visitSwitchBlockCase(this);
|
|
4230
4238
|
}
|
|
4231
4239
|
};
|
|
4232
4240
|
var ForLoopBlock = class extends BlockNode {
|
|
4233
|
-
constructor(item, expression, trackBy, trackKeywordSpan, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, nameSpan) {
|
|
4241
|
+
constructor(item, expression, trackBy, trackKeywordSpan, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
|
|
4234
4242
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
4235
4243
|
this.item = item;
|
|
4236
4244
|
this.expression = expression;
|
|
@@ -4240,15 +4248,17 @@ var ForLoopBlock = class extends BlockNode {
|
|
|
4240
4248
|
this.children = children;
|
|
4241
4249
|
this.empty = empty;
|
|
4242
4250
|
this.mainBlockSpan = mainBlockSpan;
|
|
4251
|
+
this.i18n = i18n2;
|
|
4243
4252
|
}
|
|
4244
4253
|
visit(visitor) {
|
|
4245
4254
|
return visitor.visitForLoopBlock(this);
|
|
4246
4255
|
}
|
|
4247
4256
|
};
|
|
4248
4257
|
var ForLoopBlockEmpty = class extends BlockNode {
|
|
4249
|
-
constructor(children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
|
|
4258
|
+
constructor(children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
|
|
4250
4259
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
4251
4260
|
this.children = children;
|
|
4261
|
+
this.i18n = i18n2;
|
|
4252
4262
|
}
|
|
4253
4263
|
visit(visitor) {
|
|
4254
4264
|
return visitor.visitForLoopBlockEmpty(this);
|
|
@@ -4264,11 +4274,12 @@ var IfBlock = class extends BlockNode {
|
|
|
4264
4274
|
}
|
|
4265
4275
|
};
|
|
4266
4276
|
var IfBlockBranch = class extends BlockNode {
|
|
4267
|
-
constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
|
|
4277
|
+
constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
|
|
4268
4278
|
super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
|
|
4269
4279
|
this.expression = expression;
|
|
4270
4280
|
this.children = children;
|
|
4271
4281
|
this.expressionAlias = expressionAlias;
|
|
4282
|
+
this.i18n = i18n2;
|
|
4272
4283
|
}
|
|
4273
4284
|
visit(visitor) {
|
|
4274
4285
|
return visitor.visitIfBlockBranch(this);
|
|
@@ -4531,6 +4542,21 @@ var IcuPlaceholder = class {
|
|
|
4531
4542
|
return visitor.visitIcuPlaceholder(this, context);
|
|
4532
4543
|
}
|
|
4533
4544
|
};
|
|
4545
|
+
var BlockPlaceholder = class {
|
|
4546
|
+
constructor(name, parameters, startName, closeName, children, sourceSpan, startSourceSpan, endSourceSpan) {
|
|
4547
|
+
this.name = name;
|
|
4548
|
+
this.parameters = parameters;
|
|
4549
|
+
this.startName = startName;
|
|
4550
|
+
this.closeName = closeName;
|
|
4551
|
+
this.children = children;
|
|
4552
|
+
this.sourceSpan = sourceSpan;
|
|
4553
|
+
this.startSourceSpan = startSourceSpan;
|
|
4554
|
+
this.endSourceSpan = endSourceSpan;
|
|
4555
|
+
}
|
|
4556
|
+
visit(visitor, context) {
|
|
4557
|
+
return visitor.visitBlockPlaceholder(this, context);
|
|
4558
|
+
}
|
|
4559
|
+
};
|
|
4534
4560
|
var CloneVisitor = class {
|
|
4535
4561
|
visitText(text2, context) {
|
|
4536
4562
|
return new Text2(text2.value, text2.sourceSpan);
|
|
@@ -4555,6 +4581,10 @@ var CloneVisitor = class {
|
|
|
4555
4581
|
visitIcuPlaceholder(ph, context) {
|
|
4556
4582
|
return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan);
|
|
4557
4583
|
}
|
|
4584
|
+
visitBlockPlaceholder(ph, context) {
|
|
4585
|
+
const children = ph.children.map((n) => n.visit(this, context));
|
|
4586
|
+
return new BlockPlaceholder(ph.name, ph.parameters, ph.startName, ph.closeName, children, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);
|
|
4587
|
+
}
|
|
4558
4588
|
};
|
|
4559
4589
|
var RecurseVisitor = class {
|
|
4560
4590
|
visitText(text2, context) {
|
|
@@ -4574,6 +4604,9 @@ var RecurseVisitor = class {
|
|
|
4574
4604
|
}
|
|
4575
4605
|
visitIcuPlaceholder(ph, context) {
|
|
4576
4606
|
}
|
|
4607
|
+
visitBlockPlaceholder(ph, context) {
|
|
4608
|
+
ph.children.forEach((child) => child.visit(this));
|
|
4609
|
+
}
|
|
4577
4610
|
};
|
|
4578
4611
|
function serializeMessage(messageNodes) {
|
|
4579
4612
|
const visitor = new LocalizeMessageStringVisitor();
|
|
@@ -4601,6 +4634,10 @@ var LocalizeMessageStringVisitor = class {
|
|
|
4601
4634
|
visitIcuPlaceholder(ph) {
|
|
4602
4635
|
return `{$${ph.name}}`;
|
|
4603
4636
|
}
|
|
4637
|
+
visitBlockPlaceholder(ph) {
|
|
4638
|
+
const children = ph.children.map((child) => child.visit(this)).join("");
|
|
4639
|
+
return `{$${ph.startName}}${children}{$${ph.closeName}}`;
|
|
4640
|
+
}
|
|
4604
4641
|
};
|
|
4605
4642
|
|
|
4606
4643
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/serializer.mjs
|
|
@@ -4635,6 +4672,11 @@ var SimplePlaceholderMapper = class extends RecurseVisitor {
|
|
|
4635
4672
|
visitPlaceholder(ph, context) {
|
|
4636
4673
|
this.visitPlaceholderName(ph.name);
|
|
4637
4674
|
}
|
|
4675
|
+
visitBlockPlaceholder(ph, context) {
|
|
4676
|
+
this.visitPlaceholderName(ph.startName);
|
|
4677
|
+
super.visitBlockPlaceholder(ph, context);
|
|
4678
|
+
this.visitPlaceholderName(ph.closeName);
|
|
4679
|
+
}
|
|
4638
4680
|
visitIcuPlaceholder(ph, context) {
|
|
4639
4681
|
this.visitPlaceholderName(ph.name);
|
|
4640
4682
|
}
|
|
@@ -4843,6 +4885,15 @@ var _Visitor2 = class {
|
|
|
4843
4885
|
new Tag(_PLACEHOLDER_TAG, { name: ph.name }, [exTag, interpolationAsText])
|
|
4844
4886
|
];
|
|
4845
4887
|
}
|
|
4888
|
+
visitBlockPlaceholder(ph, context) {
|
|
4889
|
+
const startAsText = new Text3(`@${ph.name}`);
|
|
4890
|
+
const startEx = new Tag(_EXAMPLE_TAG, {}, [startAsText]);
|
|
4891
|
+
const startTagPh = new Tag(_PLACEHOLDER_TAG, { name: ph.startName }, [startEx, startAsText]);
|
|
4892
|
+
const closeAsText = new Text3(`}`);
|
|
4893
|
+
const closeEx = new Tag(_EXAMPLE_TAG, {}, [closeAsText]);
|
|
4894
|
+
const closeTagPh = new Tag(_PLACEHOLDER_TAG, { name: ph.closeName }, [closeEx, closeAsText]);
|
|
4895
|
+
return [startTagPh, ...this.serialize(ph.children), closeTagPh];
|
|
4896
|
+
}
|
|
4846
4897
|
visitIcuPlaceholder(ph, context) {
|
|
4847
4898
|
const icuExpression = ph.value.expression;
|
|
4848
4899
|
const icuType = ph.value.type;
|
|
@@ -5318,7 +5369,7 @@ function assertInterpolationSymbols(identifier, value) {
|
|
|
5318
5369
|
}
|
|
5319
5370
|
}
|
|
5320
5371
|
|
|
5321
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/
|
|
5372
|
+
// bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
|
|
5322
5373
|
var InterpolationConfig = class {
|
|
5323
5374
|
static fromArray(markers) {
|
|
5324
5375
|
if (!markers) {
|
|
@@ -5333,6 +5384,7 @@ var InterpolationConfig = class {
|
|
|
5333
5384
|
}
|
|
5334
5385
|
};
|
|
5335
5386
|
var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
|
|
5387
|
+
var DEFAULT_CONTAINER_BLOCKS = /* @__PURE__ */ new Set(["switch"]);
|
|
5336
5388
|
|
|
5337
5389
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/chars.mjs
|
|
5338
5390
|
var $EOF = 0;
|
|
@@ -8144,13 +8196,13 @@ function createConditionalOp(target, targetSlot, test, conditions, sourceSpan) {
|
|
|
8144
8196
|
}, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
|
|
8145
8197
|
}
|
|
8146
8198
|
function createRepeaterOp(repeaterCreate2, targetSlot, collection, sourceSpan) {
|
|
8147
|
-
return __spreadValues({
|
|
8199
|
+
return __spreadValues(__spreadValues({
|
|
8148
8200
|
kind: OpKind.Repeater,
|
|
8149
8201
|
target: repeaterCreate2,
|
|
8150
8202
|
targetSlot,
|
|
8151
8203
|
collection,
|
|
8152
8204
|
sourceSpan
|
|
8153
|
-
}, NEW_OP);
|
|
8205
|
+
}, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
|
|
8154
8206
|
}
|
|
8155
8207
|
function createDeferWhenOp(target, expr, prefetch, sourceSpan) {
|
|
8156
8208
|
return __spreadValues(__spreadValues({
|
|
@@ -10825,6 +10877,9 @@ var IcuSerializerVisitor = class {
|
|
|
10825
10877
|
visitPlaceholder(ph) {
|
|
10826
10878
|
return this.formatPh(ph.name);
|
|
10827
10879
|
}
|
|
10880
|
+
visitBlockPlaceholder(ph) {
|
|
10881
|
+
return `${this.formatPh(ph.startName)}${ph.children.map((child) => child.visit(this)).join("")}${this.formatPh(ph.closeName)}`;
|
|
10882
|
+
}
|
|
10828
10883
|
visitIcuPlaceholder(ph, context) {
|
|
10829
10884
|
return this.formatPh(ph.name);
|
|
10830
10885
|
}
|
|
@@ -12168,12 +12223,12 @@ var Comment2 = class {
|
|
|
12168
12223
|
return visitor.visitComment(this, context);
|
|
12169
12224
|
}
|
|
12170
12225
|
};
|
|
12171
|
-
var Block = class {
|
|
12172
|
-
constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null) {
|
|
12226
|
+
var Block = class extends NodeWithI18n {
|
|
12227
|
+
constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null, i18n2) {
|
|
12228
|
+
super(sourceSpan, i18n2);
|
|
12173
12229
|
this.name = name;
|
|
12174
12230
|
this.parameters = parameters;
|
|
12175
12231
|
this.children = children;
|
|
12176
|
-
this.sourceSpan = sourceSpan;
|
|
12177
12232
|
this.nameSpan = nameSpan;
|
|
12178
12233
|
this.startSourceSpan = startSourceSpan;
|
|
12179
12234
|
this.endSourceSpan = endSourceSpan;
|
|
@@ -12751,6 +12806,24 @@ var PlaceholderRegistry = class {
|
|
|
12751
12806
|
getUniquePlaceholder(name) {
|
|
12752
12807
|
return this._generateUniqueName(name.toUpperCase());
|
|
12753
12808
|
}
|
|
12809
|
+
getStartBlockPlaceholderName(name, parameters) {
|
|
12810
|
+
const signature = this._hashBlock(name, parameters);
|
|
12811
|
+
if (this._signatureToName[signature]) {
|
|
12812
|
+
return this._signatureToName[signature];
|
|
12813
|
+
}
|
|
12814
|
+
const placeholder = this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(name)}`);
|
|
12815
|
+
this._signatureToName[signature] = placeholder;
|
|
12816
|
+
return placeholder;
|
|
12817
|
+
}
|
|
12818
|
+
getCloseBlockPlaceholderName(name) {
|
|
12819
|
+
const signature = this._hashClosingBlock(name);
|
|
12820
|
+
if (this._signatureToName[signature]) {
|
|
12821
|
+
return this._signatureToName[signature];
|
|
12822
|
+
}
|
|
12823
|
+
const placeholder = this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(name)}`);
|
|
12824
|
+
this._signatureToName[signature] = placeholder;
|
|
12825
|
+
return placeholder;
|
|
12826
|
+
}
|
|
12754
12827
|
_hashTag(tag, attrs, isVoid) {
|
|
12755
12828
|
const start = `<${tag}`;
|
|
12756
12829
|
const strAttrs = Object.keys(attrs).sort().map((name) => ` ${name}=${attrs[name]}`).join("");
|
|
@@ -12760,6 +12833,16 @@ var PlaceholderRegistry = class {
|
|
|
12760
12833
|
_hashClosingTag(tag) {
|
|
12761
12834
|
return this._hashTag(`/${tag}`, {}, false);
|
|
12762
12835
|
}
|
|
12836
|
+
_hashBlock(name, parameters) {
|
|
12837
|
+
const params = parameters.length === 0 ? "" : ` (${parameters.sort().join("; ")})`;
|
|
12838
|
+
return `@${name}${params} {}`;
|
|
12839
|
+
}
|
|
12840
|
+
_hashClosingBlock(name) {
|
|
12841
|
+
return this._hashBlock(`close_${name}`, []);
|
|
12842
|
+
}
|
|
12843
|
+
_toSnakeCase(name) {
|
|
12844
|
+
return name.toUpperCase().replace(/[^A-Z0-9]/g, "_");
|
|
12845
|
+
}
|
|
12763
12846
|
_generateUniqueName(base) {
|
|
12764
12847
|
const seen = this._placeHolderNameCounts.hasOwnProperty(base);
|
|
12765
12848
|
if (!seen) {
|
|
@@ -12774,17 +12857,18 @@ var PlaceholderRegistry = class {
|
|
|
12774
12857
|
|
|
12775
12858
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
|
|
12776
12859
|
var _expParser = new Parser(new Lexer());
|
|
12777
|
-
function createI18nMessageFactory(interpolationConfig) {
|
|
12778
|
-
const visitor = new _I18nVisitor(_expParser, interpolationConfig);
|
|
12860
|
+
function createI18nMessageFactory(interpolationConfig, containerBlocks) {
|
|
12861
|
+
const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks);
|
|
12779
12862
|
return (nodes, meaning, description, customId, visitNodeFn) => visitor.toI18nMessage(nodes, meaning, description, customId, visitNodeFn);
|
|
12780
12863
|
}
|
|
12781
12864
|
function noopVisitNodeFn(_html, i18n2) {
|
|
12782
12865
|
return i18n2;
|
|
12783
12866
|
}
|
|
12784
12867
|
var _I18nVisitor = class {
|
|
12785
|
-
constructor(_expressionParser, _interpolationConfig) {
|
|
12868
|
+
constructor(_expressionParser, _interpolationConfig, _containerBlocks) {
|
|
12786
12869
|
this._expressionParser = _expressionParser;
|
|
12787
12870
|
this._interpolationConfig = _interpolationConfig;
|
|
12871
|
+
this._containerBlocks = _containerBlocks;
|
|
12788
12872
|
}
|
|
12789
12873
|
toI18nMessage(nodes, meaning = "", description = "", customId = "", visitNodeFn) {
|
|
12790
12874
|
const context = {
|
|
@@ -12859,11 +12943,27 @@ var _I18nVisitor = class {
|
|
|
12859
12943
|
throw new Error("Unreachable code");
|
|
12860
12944
|
}
|
|
12861
12945
|
visitBlock(block, context) {
|
|
12946
|
+
var _a2;
|
|
12862
12947
|
const children = visitAll2(this, block.children, context);
|
|
12863
|
-
|
|
12948
|
+
if (this._containerBlocks.has(block.name)) {
|
|
12949
|
+
return new Container(children, block.sourceSpan);
|
|
12950
|
+
}
|
|
12951
|
+
const parameters = block.parameters.map((param) => param.expression);
|
|
12952
|
+
const startPhName = context.placeholderRegistry.getStartBlockPlaceholderName(block.name, parameters);
|
|
12953
|
+
const closePhName = context.placeholderRegistry.getCloseBlockPlaceholderName(block.name);
|
|
12954
|
+
context.placeholderToContent[startPhName] = {
|
|
12955
|
+
text: block.startSourceSpan.toString(),
|
|
12956
|
+
sourceSpan: block.startSourceSpan
|
|
12957
|
+
};
|
|
12958
|
+
context.placeholderToContent[closePhName] = {
|
|
12959
|
+
text: block.endSourceSpan ? block.endSourceSpan.toString() : "}",
|
|
12960
|
+
sourceSpan: (_a2 = block.endSourceSpan) != null ? _a2 : block.sourceSpan
|
|
12961
|
+
};
|
|
12962
|
+
const node = new BlockPlaceholder(block.name, parameters, startPhName, closePhName, children, block.sourceSpan, block.startSourceSpan, block.endSourceSpan);
|
|
12864
12963
|
return context.visitNodeFn(block, node);
|
|
12865
12964
|
}
|
|
12866
12965
|
visitBlockParameter(_parameter, _context) {
|
|
12966
|
+
throw new Error("Unreachable code");
|
|
12867
12967
|
}
|
|
12868
12968
|
_visitTextWithInterpolation(tokens, sourceSpan, context, previousI18n) {
|
|
12869
12969
|
const nodes = [];
|
|
@@ -16403,16 +16503,17 @@ var setI18nRefs = (htmlNode, i18nNode) => {
|
|
|
16403
16503
|
return i18nNode;
|
|
16404
16504
|
};
|
|
16405
16505
|
var I18nMetaVisitor = class {
|
|
16406
|
-
constructor(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, keepI18nAttrs = false, enableI18nLegacyMessageIdFormat = false) {
|
|
16506
|
+
constructor(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, keepI18nAttrs = false, enableI18nLegacyMessageIdFormat = false, containerBlocks = DEFAULT_CONTAINER_BLOCKS) {
|
|
16407
16507
|
this.interpolationConfig = interpolationConfig;
|
|
16408
16508
|
this.keepI18nAttrs = keepI18nAttrs;
|
|
16409
16509
|
this.enableI18nLegacyMessageIdFormat = enableI18nLegacyMessageIdFormat;
|
|
16510
|
+
this.containerBlocks = containerBlocks;
|
|
16410
16511
|
this.hasI18nMeta = false;
|
|
16411
16512
|
this._errors = [];
|
|
16412
16513
|
}
|
|
16413
16514
|
_generateI18nMessage(nodes, meta = "", visitNodeFn) {
|
|
16414
16515
|
const { meaning, description, customId } = this._parseMetadata(meta);
|
|
16415
|
-
const createI18nMessage2 = createI18nMessageFactory(this.interpolationConfig);
|
|
16516
|
+
const createI18nMessage2 = createI18nMessageFactory(this.interpolationConfig, this.containerBlocks);
|
|
16416
16517
|
const message = createI18nMessage2(nodes, meaning, description, customId, visitNodeFn);
|
|
16417
16518
|
this._setMessageId(message, meta);
|
|
16418
16519
|
this._setLegacyIds(message, meta);
|
|
@@ -16587,6 +16688,9 @@ var GetMsgSerializerVisitor = class {
|
|
|
16587
16688
|
visitPlaceholder(ph) {
|
|
16588
16689
|
return this.formatPh(ph.name);
|
|
16589
16690
|
}
|
|
16691
|
+
visitBlockPlaceholder(ph) {
|
|
16692
|
+
return `${this.formatPh(ph.startName)}${ph.children.map((child) => child.visit(this)).join("")}${this.formatPh(ph.closeName)}`;
|
|
16693
|
+
}
|
|
16590
16694
|
visitIcuPlaceholder(ph, context) {
|
|
16591
16695
|
return this.formatPh(ph.name);
|
|
16592
16696
|
}
|
|
@@ -16635,6 +16739,12 @@ var LocalizeSerializerVisitor = class {
|
|
|
16635
16739
|
visitPlaceholder(ph) {
|
|
16636
16740
|
this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan));
|
|
16637
16741
|
}
|
|
16742
|
+
visitBlockPlaceholder(ph) {
|
|
16743
|
+
var _a2, _b2;
|
|
16744
|
+
this.pieces.push(this.createPlaceholderPiece(ph.startName, (_a2 = ph.startSourceSpan) != null ? _a2 : ph.sourceSpan));
|
|
16745
|
+
ph.children.forEach((child) => child.visit(this));
|
|
16746
|
+
this.pieces.push(this.createPlaceholderPiece(ph.closeName, (_b2 = ph.endSourceSpan) != null ? _b2 : ph.sourceSpan));
|
|
16747
|
+
}
|
|
16638
16748
|
visitIcuPlaceholder(ph) {
|
|
16639
16749
|
this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan, this.placeholderToMessage[ph.name]));
|
|
16640
16750
|
}
|
|
@@ -17716,8 +17826,8 @@ function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByF
|
|
|
17716
17826
|
}
|
|
17717
17827
|
return call(Identifiers.repeaterCreate, args, sourceSpan);
|
|
17718
17828
|
}
|
|
17719
|
-
function repeater(
|
|
17720
|
-
return call(Identifiers.repeater, [
|
|
17829
|
+
function repeater(collection, sourceSpan) {
|
|
17830
|
+
return call(Identifiers.repeater, [collection], sourceSpan);
|
|
17721
17831
|
}
|
|
17722
17832
|
function deferWhen(prefetch, expr, sourceSpan) {
|
|
17723
17833
|
return call(prefetch ? Identifiers.deferPrefetchWhen : Identifiers.deferWhen, [expr], sourceSpan);
|
|
@@ -18275,7 +18385,7 @@ function reifyUpdateOperations(_unit, ops) {
|
|
|
18275
18385
|
OpList.replace(op, conditional(op.targetSlot.slot, op.processed, op.contextValue, op.sourceSpan));
|
|
18276
18386
|
break;
|
|
18277
18387
|
case OpKind.Repeater:
|
|
18278
|
-
OpList.replace(op, repeater(op.
|
|
18388
|
+
OpList.replace(op, repeater(op.collection, op.sourceSpan));
|
|
18279
18389
|
break;
|
|
18280
18390
|
case OpKind.DeferWhen:
|
|
18281
18391
|
OpList.replace(op, deferWhen(op.prefetch, op.expr, op.sourceSpan));
|
|
@@ -18641,9 +18751,8 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
|
|
|
18641
18751
|
super();
|
|
18642
18752
|
this.params = params;
|
|
18643
18753
|
}
|
|
18644
|
-
|
|
18754
|
+
visitContainerPlaceholder(placeholder) {
|
|
18645
18755
|
var _a2, _b2;
|
|
18646
|
-
super.visitTagPlaceholder(placeholder);
|
|
18647
18756
|
if (placeholder.startName && placeholder.startSourceSpan && !this.params.has(placeholder.startName)) {
|
|
18648
18757
|
this.params.set(placeholder.startName, [{
|
|
18649
18758
|
value: (_a2 = placeholder.startSourceSpan) == null ? void 0 : _a2.toString(),
|
|
@@ -18659,6 +18768,14 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
|
|
|
18659
18768
|
}]);
|
|
18660
18769
|
}
|
|
18661
18770
|
}
|
|
18771
|
+
visitTagPlaceholder(placeholder) {
|
|
18772
|
+
super.visitTagPlaceholder(placeholder);
|
|
18773
|
+
this.visitContainerPlaceholder(placeholder);
|
|
18774
|
+
}
|
|
18775
|
+
visitBlockPlaceholder(placeholder) {
|
|
18776
|
+
super.visitBlockPlaceholder(placeholder);
|
|
18777
|
+
this.visitContainerPlaceholder(placeholder);
|
|
18778
|
+
}
|
|
18662
18779
|
};
|
|
18663
18780
|
|
|
18664
18781
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
|
|
@@ -20978,18 +21095,18 @@ function createIfBlock(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
20978
21095
|
const branches = [];
|
|
20979
21096
|
const mainBlockParams = parseConditionalBlockParameters(ast, errors, bindingParser);
|
|
20980
21097
|
if (mainBlockParams !== null) {
|
|
20981
|
-
branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll2(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan));
|
|
21098
|
+
branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll2(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan, ast.i18n));
|
|
20982
21099
|
}
|
|
20983
21100
|
for (const block of connectedBlocks) {
|
|
20984
21101
|
if (ELSE_IF_PATTERN.test(block.name)) {
|
|
20985
21102
|
const params = parseConditionalBlockParameters(block, errors, bindingParser);
|
|
20986
21103
|
if (params !== null) {
|
|
20987
21104
|
const children = visitAll2(visitor, block.children, block.children);
|
|
20988
|
-
branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan));
|
|
21105
|
+
branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n));
|
|
20989
21106
|
}
|
|
20990
21107
|
} else if (block.name === "else") {
|
|
20991
21108
|
const children = visitAll2(visitor, block.children, block.children);
|
|
20992
|
-
branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan));
|
|
21109
|
+
branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n));
|
|
20993
21110
|
}
|
|
20994
21111
|
}
|
|
20995
21112
|
const ifBlockStartSourceSpan = branches.length > 0 ? branches[0].startSourceSpan : ast.startSourceSpan;
|
|
@@ -21017,7 +21134,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
21017
21134
|
} else if (block.parameters.length > 0) {
|
|
21018
21135
|
errors.push(new ParseError(block.sourceSpan, "@empty block cannot have parameters"));
|
|
21019
21136
|
} else {
|
|
21020
|
-
empty = new ForLoopBlockEmpty(visitAll2(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan);
|
|
21137
|
+
empty = new ForLoopBlockEmpty(visitAll2(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n);
|
|
21021
21138
|
}
|
|
21022
21139
|
} else {
|
|
21023
21140
|
errors.push(new ParseError(block.sourceSpan, `Unrecognized @for loop block "${block.name}"`));
|
|
@@ -21029,7 +21146,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
21029
21146
|
} else {
|
|
21030
21147
|
const endSpan = (_a2 = empty == null ? void 0 : empty.endSourceSpan) != null ? _a2 : ast.endSourceSpan;
|
|
21031
21148
|
const sourceSpan = new ParseSourceSpan(ast.sourceSpan.start, (_b2 = endSpan == null ? void 0 : endSpan.end) != null ? _b2 : ast.sourceSpan.end);
|
|
21032
|
-
node = new ForLoopBlock(params.itemName, params.expression, params.trackBy.expression, params.trackBy.keywordSpan, params.context, visitAll2(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan, ast.nameSpan);
|
|
21149
|
+
node = new ForLoopBlock(params.itemName, params.expression, params.trackBy.expression, params.trackBy.keywordSpan, params.context, visitAll2(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan, ast.nameSpan, ast.i18n);
|
|
21033
21150
|
}
|
|
21034
21151
|
}
|
|
21035
21152
|
return { node, errors };
|
|
@@ -21049,7 +21166,7 @@ function createSwitchBlock(ast, visitor, bindingParser) {
|
|
|
21049
21166
|
continue;
|
|
21050
21167
|
}
|
|
21051
21168
|
const expression = node.name === "case" ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null;
|
|
21052
|
-
const ast2 = new SwitchBlockCase(expression, visitAll2(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.nameSpan);
|
|
21169
|
+
const ast2 = new SwitchBlockCase(expression, visitAll2(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.nameSpan, node.i18n);
|
|
21053
21170
|
if (expression === null) {
|
|
21054
21171
|
defaultCase = ast2;
|
|
21055
21172
|
} else {
|
|
@@ -21537,7 +21654,7 @@ function createDeferredBlock(ast, connectedBlocks, visitor, bindingParser) {
|
|
|
21537
21654
|
endOfLastSourceSpan = lastConnectedBlock.sourceSpan.end;
|
|
21538
21655
|
}
|
|
21539
21656
|
const sourceSpanWithConnectedBlocks = new ParseSourceSpan(ast.sourceSpan.start, endOfLastSourceSpan);
|
|
21540
|
-
const node = new DeferredBlock(visitAll2(visitor, ast.children, ast.children), triggers, prefetchTriggers, placeholder, loading, error2, ast.nameSpan, sourceSpanWithConnectedBlocks, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan);
|
|
21657
|
+
const node = new DeferredBlock(visitAll2(visitor, ast.children, ast.children), triggers, prefetchTriggers, placeholder, loading, error2, ast.nameSpan, sourceSpanWithConnectedBlocks, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan, ast.i18n);
|
|
21541
21658
|
return { node, errors };
|
|
21542
21659
|
}
|
|
21543
21660
|
function parseConnectedBlocks(connectedBlocks, errors, visitor) {
|
|
@@ -21595,7 +21712,7 @@ function parsePlaceholderBlock(ast, visitor) {
|
|
|
21595
21712
|
throw new Error(`Unrecognized parameter in @placeholder block: "${param.expression}"`);
|
|
21596
21713
|
}
|
|
21597
21714
|
}
|
|
21598
|
-
return new DeferredBlockPlaceholder(visitAll2(visitor, ast.children, ast.children), minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
|
|
21715
|
+
return new DeferredBlockPlaceholder(visitAll2(visitor, ast.children, ast.children), minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
|
|
21599
21716
|
}
|
|
21600
21717
|
function parseLoadingBlock(ast, visitor) {
|
|
21601
21718
|
let afterTime = null;
|
|
@@ -21623,13 +21740,13 @@ function parseLoadingBlock(ast, visitor) {
|
|
|
21623
21740
|
throw new Error(`Unrecognized parameter in @loading block: "${param.expression}"`);
|
|
21624
21741
|
}
|
|
21625
21742
|
}
|
|
21626
|
-
return new DeferredBlockLoading(visitAll2(visitor, ast.children, ast.children), afterTime, minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
|
|
21743
|
+
return new DeferredBlockLoading(visitAll2(visitor, ast.children, ast.children), afterTime, minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
|
|
21627
21744
|
}
|
|
21628
21745
|
function parseErrorBlock(ast, visitor) {
|
|
21629
21746
|
if (ast.parameters.length > 0) {
|
|
21630
21747
|
throw new Error(`@error block cannot have parameters`);
|
|
21631
21748
|
}
|
|
21632
|
-
return new DeferredBlockError(visitAll2(visitor, ast.children, ast.children), ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
|
|
21749
|
+
return new DeferredBlockError(visitAll2(visitor, ast.children, ast.children), ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
|
|
21633
21750
|
}
|
|
21634
21751
|
function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
|
|
21635
21752
|
const triggers = {};
|
|
@@ -22113,6 +22230,11 @@ var I18nContext = class {
|
|
|
22113
22230
|
const content = { type, index, ctx: this.id, isVoid: node.isVoid, closed };
|
|
22114
22231
|
updatePlaceholderMap(this.placeholders, ph, content);
|
|
22115
22232
|
}
|
|
22233
|
+
appendBlockPart(node, index, closed) {
|
|
22234
|
+
const ph = closed ? node.closeName : node.startName;
|
|
22235
|
+
const content = { type: TagType.TEMPLATE, index, ctx: this.id, closed };
|
|
22236
|
+
updatePlaceholderMap(this.placeholders, ph, content);
|
|
22237
|
+
}
|
|
22116
22238
|
get icus() {
|
|
22117
22239
|
return this._registry.icus;
|
|
22118
22240
|
}
|
|
@@ -22142,6 +22264,11 @@ var I18nContext = class {
|
|
|
22142
22264
|
this.appendTag(TagType.TEMPLATE, node, index, true);
|
|
22143
22265
|
this._unresolvedCtxCount++;
|
|
22144
22266
|
}
|
|
22267
|
+
appendBlock(node, index) {
|
|
22268
|
+
this.appendBlockPart(node, index, false);
|
|
22269
|
+
this.appendBlockPart(node, index, true);
|
|
22270
|
+
this._unresolvedCtxCount++;
|
|
22271
|
+
}
|
|
22145
22272
|
appendElement(node, index, closed) {
|
|
22146
22273
|
this.appendTag(TagType.ELEMENT, node, index, closed);
|
|
22147
22274
|
}
|
|
@@ -22337,12 +22464,18 @@ var TemplateDefinitionBuilder = class {
|
|
|
22337
22464
|
this.creationInstruction(null, Identifiers.pipe, [literal(slot), literal(name)]);
|
|
22338
22465
|
});
|
|
22339
22466
|
}
|
|
22340
|
-
buildTemplateFunction(nodes, variables, ngContentSelectorsOffset = 0, i18n2) {
|
|
22467
|
+
buildTemplateFunction(nodes, variables, ngContentSelectorsOffset = 0, i18n2, variableAliases) {
|
|
22341
22468
|
this._ngContentSelectorsOffset = ngContentSelectorsOffset;
|
|
22342
22469
|
if (this._namespace !== Identifiers.namespaceHTML) {
|
|
22343
22470
|
this.creationInstruction(null, this._namespace);
|
|
22344
22471
|
}
|
|
22345
|
-
variables.forEach((v) =>
|
|
22472
|
+
variables.forEach((v) => {
|
|
22473
|
+
const alias = variableAliases == null ? void 0 : variableAliases[v.name];
|
|
22474
|
+
this.registerContextVariables(v.name, v.value);
|
|
22475
|
+
if (alias) {
|
|
22476
|
+
this.registerContextVariables(alias, v.value);
|
|
22477
|
+
}
|
|
22478
|
+
});
|
|
22346
22479
|
const initI18nContext = this.i18nContext || isI18nRootNode(i18n2) && !isSingleI18nIcu(i18n2) && !(isSingleElementTemplate(nodes) && nodes[0].i18n === i18n2);
|
|
22347
22480
|
const selfClosingI18nInstruction = hasTextChildrenOnly(nodes);
|
|
22348
22481
|
if (initI18nContext) {
|
|
@@ -22397,12 +22530,12 @@ var TemplateDefinitionBuilder = class {
|
|
|
22397
22530
|
this._constants.prepareStatements.push(...statements);
|
|
22398
22531
|
return _ref;
|
|
22399
22532
|
}
|
|
22400
|
-
registerContextVariables(
|
|
22533
|
+
registerContextVariables(name, value) {
|
|
22401
22534
|
const scopedName = this._bindingScope.freshReferenceName();
|
|
22402
22535
|
const retrievalLevel = this.level;
|
|
22403
|
-
const isDirect =
|
|
22404
|
-
const lhs = variable(
|
|
22405
|
-
this._bindingScope.set(retrievalLevel,
|
|
22536
|
+
const isDirect = value === DIRECT_CONTEXT_REFERENCE;
|
|
22537
|
+
const lhs = variable(name + scopedName);
|
|
22538
|
+
this._bindingScope.set(retrievalLevel, name, (scope) => {
|
|
22406
22539
|
return isDirect && scope.bindingLevel === retrievalLevel && !scope.isListenerScope() ? variable(CONTEXT_NAME) : lhs;
|
|
22407
22540
|
}, 1, (scope, relativeLevel) => {
|
|
22408
22541
|
let rhs;
|
|
@@ -22420,7 +22553,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
22420
22553
|
rhs = sharedCtxVar ? sharedCtxVar : generateNextContextExpr(relativeLevel);
|
|
22421
22554
|
}
|
|
22422
22555
|
return [
|
|
22423
|
-
lhs.set(isDirect ? rhs : rhs.prop(
|
|
22556
|
+
lhs.set(isDirect ? rhs : rhs.prop(value || IMPLICIT_REFERENCE)).toConstDecl()
|
|
22424
22557
|
];
|
|
22425
22558
|
});
|
|
22426
22559
|
}
|
|
@@ -22759,16 +22892,20 @@ var TemplateDefinitionBuilder = class {
|
|
|
22759
22892
|
this.creationInstruction(span, isNgContainer2 ? Identifiers.elementContainerEnd : Identifiers.elementEnd);
|
|
22760
22893
|
}
|
|
22761
22894
|
}
|
|
22762
|
-
prepareEmbeddedTemplateFn(children, contextNameSuffix, variables = [],
|
|
22895
|
+
prepareEmbeddedTemplateFn(children, contextNameSuffix, variables = [], i18nMeta, variableAliases) {
|
|
22763
22896
|
const index = this.allocateDataSlot();
|
|
22764
|
-
if (this.i18n &&
|
|
22765
|
-
|
|
22897
|
+
if (this.i18n && i18nMeta) {
|
|
22898
|
+
if (i18nMeta instanceof BlockPlaceholder) {
|
|
22899
|
+
this.i18n.appendBlock(i18nMeta, index);
|
|
22900
|
+
} else {
|
|
22901
|
+
this.i18n.appendTemplate(i18nMeta, index);
|
|
22902
|
+
}
|
|
22766
22903
|
}
|
|
22767
22904
|
const contextName = `${this.contextName}${contextNameSuffix}_${index}`;
|
|
22768
22905
|
const name = `${contextName}_Template`;
|
|
22769
22906
|
const visitor = new TemplateDefinitionBuilder(this.constantPool, this._bindingScope, this.level + 1, contextName, this.i18n, index, name, this._namespace, this.fileBasedI18nSuffix, this.i18nUseExternalIds, this.deferBlocks, this.elementLocations, this._constants);
|
|
22770
22907
|
this._nestedTemplateFns.push(() => {
|
|
22771
|
-
const templateFunctionExpr = visitor.buildTemplateFunction(children, variables, this._ngContentReservedSlots.length + this._ngContentSelectorsOffset,
|
|
22908
|
+
const templateFunctionExpr = visitor.buildTemplateFunction(children, variables, this._ngContentReservedSlots.length + this._ngContentSelectorsOffset, i18nMeta, variableAliases);
|
|
22772
22909
|
this.constantPool.statements.push(templateFunctionExpr.toDeclStmt(name));
|
|
22773
22910
|
if (visitor._ngContentReservedSlots.length) {
|
|
22774
22911
|
this._ngContentReservedSlots.push(...visitor._ngContentReservedSlots);
|
|
@@ -22878,7 +23015,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
22878
23015
|
tagName = inferredData.tagName;
|
|
22879
23016
|
attrsExprs = inferredData.attrsExprs;
|
|
22880
23017
|
}
|
|
22881
|
-
const templateIndex = this.createEmbeddedTemplateFn(tagName, children, "_Conditional", sourceSpan, variables, attrsExprs);
|
|
23018
|
+
const templateIndex = this.createEmbeddedTemplateFn(tagName, children, "_Conditional", sourceSpan, variables, attrsExprs, void 0, branch.i18n);
|
|
22882
23019
|
const processedExpression = expression === null ? null : expression.visit(this._valueConverter);
|
|
22883
23020
|
return { index: templateIndex, expression: processedExpression, alias: expressionAlias };
|
|
22884
23021
|
});
|
|
@@ -22912,7 +23049,7 @@ var TemplateDefinitionBuilder = class {
|
|
|
22912
23049
|
}
|
|
22913
23050
|
visitSwitchBlock(block) {
|
|
22914
23051
|
const caseData = block.cases.map((currentCase) => {
|
|
22915
|
-
const index = this.createEmbeddedTemplateFn(null, currentCase.children, "_Case", currentCase.sourceSpan);
|
|
23052
|
+
const index = this.createEmbeddedTemplateFn(null, currentCase.children, "_Case", currentCase.sourceSpan, void 0, void 0, void 0, currentCase.i18n);
|
|
22916
23053
|
const expression = currentCase.expression === null ? null : currentCase.expression.visit(this._valueConverter);
|
|
22917
23054
|
return { index, expression };
|
|
22918
23055
|
});
|
|
@@ -22940,12 +23077,12 @@ var TemplateDefinitionBuilder = class {
|
|
|
22940
23077
|
if (!metadata) {
|
|
22941
23078
|
throw new Error("Could not resolve `defer` block metadata. Block may need to be analyzed.");
|
|
22942
23079
|
}
|
|
22943
|
-
const primaryTemplateIndex = this.createEmbeddedTemplateFn(null, deferred.children, "_Defer", deferred.sourceSpan);
|
|
22944
|
-
const loadingIndex = loading ? this.createEmbeddedTemplateFn(null, loading.children, "_DeferLoading", loading.sourceSpan) : null;
|
|
23080
|
+
const primaryTemplateIndex = this.createEmbeddedTemplateFn(null, deferred.children, "_Defer", deferred.sourceSpan, void 0, void 0, void 0, deferred.i18n);
|
|
23081
|
+
const loadingIndex = loading ? this.createEmbeddedTemplateFn(null, loading.children, "_DeferLoading", loading.sourceSpan, void 0, void 0, void 0, loading.i18n) : null;
|
|
22945
23082
|
const loadingConsts = loading ? trimTrailingNulls([literal(loading.minimumTime), literal(loading.afterTime)]) : null;
|
|
22946
|
-
const placeholderIndex = placeholder ? this.createEmbeddedTemplateFn(null, placeholder.children, "_DeferPlaceholder", placeholder.sourceSpan) : null;
|
|
23083
|
+
const placeholderIndex = placeholder ? this.createEmbeddedTemplateFn(null, placeholder.children, "_DeferPlaceholder", placeholder.sourceSpan, void 0, void 0, void 0, placeholder.i18n) : null;
|
|
22947
23084
|
const placeholderConsts = placeholder && placeholder.minimumTime !== null ? literalArr([literal(placeholder.minimumTime)]) : null;
|
|
22948
|
-
const errorIndex = error2 ? this.createEmbeddedTemplateFn(null, error2.children, "_DeferError", error2.sourceSpan) : null;
|
|
23085
|
+
const errorIndex = error2 ? this.createEmbeddedTemplateFn(null, error2.children, "_DeferError", error2.sourceSpan, void 0, void 0, void 0, error2.i18n) : null;
|
|
22949
23086
|
const deferredIndex = this.allocateDataSlot();
|
|
22950
23087
|
const depsFnName = `${this.contextName}_Defer_${deferredIndex}_DepsFn`;
|
|
22951
23088
|
this.creationInstruction(deferred.sourceSpan, Identifiers.defer, trimTrailingNulls([
|
|
@@ -23054,11 +23191,14 @@ var TemplateDefinitionBuilder = class {
|
|
|
23054
23191
|
visitForLoopBlock(block) {
|
|
23055
23192
|
const blockIndex = this.allocateDataSlot();
|
|
23056
23193
|
const { tagName, attrsExprs } = this.inferProjectionDataFromInsertionPoint(block);
|
|
23057
|
-
const primaryData = this.prepareEmbeddedTemplateFn(block.children, "_For", [block.item, block.contextVariables.$index, block.contextVariables.$count]
|
|
23194
|
+
const primaryData = this.prepareEmbeddedTemplateFn(block.children, "_For", [block.item, block.contextVariables.$index, block.contextVariables.$count], block.i18n, {
|
|
23195
|
+
[block.contextVariables.$index.name]: this.getLevelSpecificVariableName("$index", this.level + 1),
|
|
23196
|
+
[block.contextVariables.$count.name]: this.getLevelSpecificVariableName("$count", this.level + 1)
|
|
23197
|
+
});
|
|
23058
23198
|
const { expression: trackByExpression, usesComponentInstance: trackByUsesComponentInstance } = this.createTrackByFunction(block);
|
|
23059
23199
|
let emptyData = null;
|
|
23060
23200
|
if (block.empty !== null) {
|
|
23061
|
-
emptyData = this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty");
|
|
23201
|
+
emptyData = this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty", void 0, block.empty.i18n);
|
|
23062
23202
|
this.allocateBindingSlots(null);
|
|
23063
23203
|
}
|
|
23064
23204
|
this.registerComputedLoopVariables(block, primaryData.scope);
|
|
@@ -23080,16 +23220,31 @@ var TemplateDefinitionBuilder = class {
|
|
|
23080
23220
|
return params;
|
|
23081
23221
|
});
|
|
23082
23222
|
const value = block.expression.visit(this._valueConverter);
|
|
23083
|
-
this.
|
|
23223
|
+
this.updateInstructionWithAdvance(blockIndex, block.sourceSpan, Identifiers.repeater, () => [this.convertPropertyBinding(value)]);
|
|
23084
23224
|
}
|
|
23085
23225
|
registerComputedLoopVariables(block, bindingScope) {
|
|
23086
|
-
const indexLocalName = block.contextVariables.$index.name;
|
|
23087
|
-
const countLocalName = block.contextVariables.$count.name;
|
|
23088
23226
|
const level = bindingScope.bindingLevel;
|
|
23089
|
-
bindingScope.set(level, block.contextVariables.$odd.name, (scope) =>
|
|
23090
|
-
|
|
23091
|
-
|
|
23092
|
-
bindingScope.set(level, block.contextVariables.$
|
|
23227
|
+
bindingScope.set(level, block.contextVariables.$odd.name, (scope, retrievalLevel) => {
|
|
23228
|
+
return this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$index").modulo(literal(2)).notIdentical(literal(0));
|
|
23229
|
+
});
|
|
23230
|
+
bindingScope.set(level, block.contextVariables.$even.name, (scope, retrievalLevel) => {
|
|
23231
|
+
return this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$index").modulo(literal(2)).identical(literal(0));
|
|
23232
|
+
});
|
|
23233
|
+
bindingScope.set(level, block.contextVariables.$first.name, (scope, retrievalLevel) => {
|
|
23234
|
+
return this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$index").identical(literal(0));
|
|
23235
|
+
});
|
|
23236
|
+
bindingScope.set(level, block.contextVariables.$last.name, (scope, retrievalLevel) => {
|
|
23237
|
+
const index = this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$index");
|
|
23238
|
+
const count = this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$count");
|
|
23239
|
+
return index.identical(count.minus(literal(1)));
|
|
23240
|
+
});
|
|
23241
|
+
}
|
|
23242
|
+
getLevelSpecificVariableName(name, level) {
|
|
23243
|
+
return `\u0275${name}_${level}`;
|
|
23244
|
+
}
|
|
23245
|
+
getLevelSpecificForLoopVariable(block, scope, retrievalLevel, name) {
|
|
23246
|
+
const scopeName = scope.bindingLevel === retrievalLevel ? block.contextVariables[name].name : this.getLevelSpecificVariableName(name, retrievalLevel);
|
|
23247
|
+
return scope.get(scopeName);
|
|
23093
23248
|
}
|
|
23094
23249
|
optimizeTrackByFunction(block) {
|
|
23095
23250
|
const indexLocalName = block.contextVariables.$index.name;
|
|
@@ -23499,7 +23654,7 @@ var BindingScope = class {
|
|
|
23499
23654
|
if (value.declareLocalCallback && !value.declare) {
|
|
23500
23655
|
value.declare = true;
|
|
23501
23656
|
}
|
|
23502
|
-
return typeof value.lhs === "function" ? value.lhs(this) : value.lhs;
|
|
23657
|
+
return typeof value.lhs === "function" ? value.lhs(this, value.retrievalLevel) : value.lhs;
|
|
23503
23658
|
}
|
|
23504
23659
|
current = current.parent;
|
|
23505
23660
|
}
|
|
@@ -23575,7 +23730,7 @@ var BindingScope = class {
|
|
|
23575
23730
|
const componentValue = this.map.get(SHARED_CONTEXT_KEY + 0);
|
|
23576
23731
|
componentValue.declare = true;
|
|
23577
23732
|
this.maybeRestoreView();
|
|
23578
|
-
const lhs = typeof componentValue.lhs === "function" ? componentValue.lhs(this) : componentValue.lhs;
|
|
23733
|
+
const lhs = typeof componentValue.lhs === "function" ? componentValue.lhs(this, componentValue.retrievalLevel) : componentValue.lhs;
|
|
23579
23734
|
return name === DIRECT_CONTEXT_REFERENCE ? lhs : lhs.prop(name);
|
|
23580
23735
|
}
|
|
23581
23736
|
maybeRestoreView() {
|
|
@@ -25644,7 +25799,7 @@ function publishFacade(global) {
|
|
|
25644
25799
|
}
|
|
25645
25800
|
|
|
25646
25801
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
|
|
25647
|
-
var VERSION2 = new Version("17.1.0-next.
|
|
25802
|
+
var VERSION2 = new Version("17.1.0-next.1");
|
|
25648
25803
|
|
|
25649
25804
|
// bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
25650
25805
|
var _I18N_ATTR = "i18n";
|
|
@@ -25831,7 +25986,7 @@ var _Visitor3 = class {
|
|
|
25831
25986
|
this._errors = [];
|
|
25832
25987
|
this._messages = [];
|
|
25833
25988
|
this._inImplicitNode = false;
|
|
25834
|
-
this._createI18nMessage = createI18nMessageFactory(interpolationConfig);
|
|
25989
|
+
this._createI18nMessage = createI18nMessageFactory(interpolationConfig, DEFAULT_CONTAINER_BLOCKS);
|
|
25835
25990
|
}
|
|
25836
25991
|
_visitAttributesOf(el) {
|
|
25837
25992
|
const explicitAttrNameToValue = {};
|
|
@@ -26089,6 +26244,12 @@ var _WriteVisitor = class {
|
|
|
26089
26244
|
visitPlaceholder(ph, context) {
|
|
26090
26245
|
return [new Tag(_PLACEHOLDER_TAG2, { id: ph.name, "equiv-text": `{{${ph.value}}}` })];
|
|
26091
26246
|
}
|
|
26247
|
+
visitBlockPlaceholder(ph, context) {
|
|
26248
|
+
const ctype = `x-${ph.name.toLowerCase().replace(/[^a-z0-9]/g, "-")}`;
|
|
26249
|
+
const startTagPh = new Tag(_PLACEHOLDER_TAG2, { id: ph.startName, ctype, "equiv-text": `@${ph.name}` });
|
|
26250
|
+
const closeTagPh = new Tag(_PLACEHOLDER_TAG2, { id: ph.closeName, ctype, "equiv-text": `}` });
|
|
26251
|
+
return [startTagPh, ...this.serialize(ph.children), closeTagPh];
|
|
26252
|
+
}
|
|
26092
26253
|
visitIcuPlaceholder(ph, context) {
|
|
26093
26254
|
const equivText = `{${ph.value.expression}, ${ph.value.type}, ${Object.keys(ph.value.cases).map((value) => value + " {...}").join(" ")}}`;
|
|
26094
26255
|
return [new Tag(_PLACEHOLDER_TAG2, { id: ph.name, "equiv-text": equivText })];
|
|
@@ -26360,6 +26521,23 @@ var _WriteVisitor2 = class {
|
|
|
26360
26521
|
disp: `{{${ph.value}}}`
|
|
26361
26522
|
})];
|
|
26362
26523
|
}
|
|
26524
|
+
visitBlockPlaceholder(ph, context) {
|
|
26525
|
+
const tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, {
|
|
26526
|
+
id: (this._nextPlaceholderId++).toString(),
|
|
26527
|
+
equivStart: ph.startName,
|
|
26528
|
+
equivEnd: ph.closeName,
|
|
26529
|
+
type: "other",
|
|
26530
|
+
dispStart: `@${ph.name}`,
|
|
26531
|
+
dispEnd: `}`
|
|
26532
|
+
});
|
|
26533
|
+
const nodes = [].concat(...ph.children.map((node) => node.visit(this)));
|
|
26534
|
+
if (nodes.length) {
|
|
26535
|
+
nodes.forEach((node) => tagPc.children.push(node));
|
|
26536
|
+
} else {
|
|
26537
|
+
tagPc.children.push(new Text3(""));
|
|
26538
|
+
}
|
|
26539
|
+
return [tagPc];
|
|
26540
|
+
}
|
|
26363
26541
|
visitIcuPlaceholder(ph, context) {
|
|
26364
26542
|
const cases = Object.keys(ph.value.cases).map((value) => value + " {...}").join(" ");
|
|
26365
26543
|
const idStr = (this._nextPlaceholderId++).toString();
|
|
@@ -26596,6 +26774,12 @@ var MapPlaceholderNames = class extends CloneVisitor {
|
|
|
26596
26774
|
const children = ph.children.map((n) => n.visit(this, mapper));
|
|
26597
26775
|
return new TagPlaceholder(ph.tag, ph.attrs, startName, closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);
|
|
26598
26776
|
}
|
|
26777
|
+
visitBlockPlaceholder(ph, mapper) {
|
|
26778
|
+
const startName = mapper.toPublicName(ph.startName);
|
|
26779
|
+
const closeName = ph.closeName ? mapper.toPublicName(ph.closeName) : ph.closeName;
|
|
26780
|
+
const children = ph.children.map((n) => n.visit(this, mapper));
|
|
26781
|
+
return new BlockPlaceholder(ph.name, ph.parameters, startName, closeName, children, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan);
|
|
26782
|
+
}
|
|
26599
26783
|
visitPlaceholder(ph, mapper) {
|
|
26600
26784
|
return new Placeholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan);
|
|
26601
26785
|
}
|
|
@@ -26681,7 +26865,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION = "12.0.0";
|
|
|
26681
26865
|
function compileDeclareClassMetadata(metadata) {
|
|
26682
26866
|
const definitionMap = new DefinitionMap();
|
|
26683
26867
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
26684
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
26868
|
+
definitionMap.set("version", literal("17.1.0-next.1"));
|
|
26685
26869
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
26686
26870
|
definitionMap.set("type", metadata.type);
|
|
26687
26871
|
definitionMap.set("decorators", metadata.decorators);
|
|
@@ -26752,7 +26936,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
26752
26936
|
const hasTransformFunctions = Object.values(meta.inputs).some((input) => input.transformFunction !== null);
|
|
26753
26937
|
const minVersion = hasTransformFunctions ? MINIMUM_PARTIAL_LINKER_VERSION2 : "14.0.0";
|
|
26754
26938
|
definitionMap.set("minVersion", literal(minVersion));
|
|
26755
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
26939
|
+
definitionMap.set("version", literal("17.1.0-next.1"));
|
|
26756
26940
|
definitionMap.set("type", meta.type.value);
|
|
26757
26941
|
if (meta.isStandalone) {
|
|
26758
26942
|
definitionMap.set("isStandalone", literal(meta.isStandalone));
|
|
@@ -26984,7 +27168,7 @@ var MINIMUM_PARTIAL_LINKER_VERSION3 = "12.0.0";
|
|
|
26984
27168
|
function compileDeclareFactoryFunction(meta) {
|
|
26985
27169
|
const definitionMap = new DefinitionMap();
|
|
26986
27170
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION3));
|
|
26987
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27171
|
+
definitionMap.set("version", literal("17.1.0-next.1"));
|
|
26988
27172
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
26989
27173
|
definitionMap.set("type", meta.type.value);
|
|
26990
27174
|
definitionMap.set("deps", compileDependencies(meta.deps));
|
|
@@ -27007,7 +27191,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
27007
27191
|
function createInjectableDefinitionMap(meta) {
|
|
27008
27192
|
const definitionMap = new DefinitionMap();
|
|
27009
27193
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION4));
|
|
27010
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27194
|
+
definitionMap.set("version", literal("17.1.0-next.1"));
|
|
27011
27195
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27012
27196
|
definitionMap.set("type", meta.type.value);
|
|
27013
27197
|
if (meta.providedIn !== void 0) {
|
|
@@ -27045,7 +27229,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
27045
27229
|
function createInjectorDefinitionMap(meta) {
|
|
27046
27230
|
const definitionMap = new DefinitionMap();
|
|
27047
27231
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION5));
|
|
27048
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27232
|
+
definitionMap.set("version", literal("17.1.0-next.1"));
|
|
27049
27233
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27050
27234
|
definitionMap.set("type", meta.type.value);
|
|
27051
27235
|
definitionMap.set("providers", meta.providers);
|
|
@@ -27069,7 +27253,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
27069
27253
|
throw new Error("Invalid path! Local compilation mode should not get into the partial compilation path");
|
|
27070
27254
|
}
|
|
27071
27255
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION6));
|
|
27072
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27256
|
+
definitionMap.set("version", literal("17.1.0-next.1"));
|
|
27073
27257
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27074
27258
|
definitionMap.set("type", meta.type.value);
|
|
27075
27259
|
if (meta.bootstrap.length > 0) {
|
|
@@ -27104,7 +27288,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
27104
27288
|
function createPipeDefinitionMap(meta) {
|
|
27105
27289
|
const definitionMap = new DefinitionMap();
|
|
27106
27290
|
definitionMap.set("minVersion", literal(MINIMUM_PARTIAL_LINKER_VERSION7));
|
|
27107
|
-
definitionMap.set("version", literal("17.1.0-next.
|
|
27291
|
+
definitionMap.set("version", literal("17.1.0-next.1"));
|
|
27108
27292
|
definitionMap.set("ngImport", importExpr(Identifiers.core));
|
|
27109
27293
|
definitionMap.set("type", meta.type.value);
|
|
27110
27294
|
if (meta.isStandalone) {
|
|
@@ -27121,7 +27305,7 @@ function createPipeDefinitionMap(meta) {
|
|
|
27121
27305
|
publishFacade(_global);
|
|
27122
27306
|
|
|
27123
27307
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/version.mjs
|
|
27124
|
-
var VERSION3 = new Version("17.1.0-next.
|
|
27308
|
+
var VERSION3 = new Version("17.1.0-next.1");
|
|
27125
27309
|
|
|
27126
27310
|
// bazel-out/k8-fastbuild/bin/packages/compiler-cli/src/transformers/api.mjs
|
|
27127
27311
|
var EmitFlags;
|