@angular/core 21.0.0-next.3 → 21.0.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/api.d.d.ts +7 -4
- package/chrome_dev_tools_performance.d.d.ts +1 -1
- package/discovery.d.d.ts +48 -21
- package/effect.d.d.ts +1 -2
- package/event_dispatcher.d.d.ts +1 -1
- package/fesm2022/attribute.mjs +1 -1
- package/fesm2022/attribute.mjs.map +1 -1
- package/fesm2022/core.mjs +228 -72
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/debug_node.mjs +564 -747
- package/fesm2022/debug_node.mjs.map +1 -1
- package/fesm2022/effect.mjs +3 -4
- package/fesm2022/effect.mjs.map +1 -1
- package/fesm2022/not_found.mjs +1 -1
- package/fesm2022/not_found.mjs.map +1 -1
- package/fesm2022/primitives/di.mjs +1 -1
- package/fesm2022/primitives/di.mjs.map +1 -1
- package/fesm2022/primitives/event-dispatch.mjs +1 -1
- package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +4 -5
- package/fesm2022/primitives/signals.mjs.map +1 -1
- package/fesm2022/resource.mjs +5 -4
- package/fesm2022/resource.mjs.map +1 -1
- package/fesm2022/root_effect_scheduler.mjs +61 -45
- package/fesm2022/root_effect_scheduler.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +3 -1
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/signal.mjs +32 -11
- package/fesm2022/signal.mjs.map +1 -1
- package/fesm2022/testing.mjs +4 -4
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/weak_ref.mjs +1 -1
- package/fesm2022/weak_ref.mjs.map +1 -1
- package/graph.d.d.ts +24 -4
- package/index.d.ts +19 -140
- package/package.json +2 -2
- package/primitives/di/index.d.ts +1 -1
- package/primitives/event-dispatch/index.d.ts +1 -1
- package/primitives/signals/index.d.ts +2 -3
- package/rxjs-interop/index.d.ts +3 -1
- package/schematics/bundles/add-bootstrap-context-to-server-main.cjs +5 -5
- package/schematics/bundles/application-config-core.cjs +6 -6
- package/schematics/bundles/{apply_import_manager-tNexl58m.cjs → apply_import_manager-Bx60Uquz.cjs} +3 -3
- package/schematics/bundles/bootstrap-options-migration.cjs +637 -0
- package/schematics/bundles/cleanup-unused-imports.cjs +5 -5
- package/schematics/bundles/{compiler_host-Df7s6Riz.cjs → compiler_host-Aouk-n4F.cjs} +2 -2
- package/schematics/bundles/control-flow-migration.cjs +71 -39
- package/schematics/bundles/{imports-26VeX8i-.cjs → imports-DwPXlGFl.cjs} +27 -1
- package/schematics/bundles/{index-Clvp4COX.cjs → index-BZQb51Qf.cjs} +4 -4
- package/schematics/bundles/{index-CBaykQBv.cjs → index-Bb6iejCd.cjs} +130 -41
- package/schematics/bundles/inject-migration.cjs +5 -5
- package/schematics/bundles/leading_space-D9nQ8UQC.cjs +1 -1
- package/schematics/bundles/{migrate_ts_type_references-C_gTvDtH.cjs → migrate_ts_type_references-By2ZtKls.cjs} +5 -5
- package/schematics/bundles/{ng_component_template-HYGPuVhy.cjs → ng_component_template-B4M8mTyv.cjs} +3 -3
- package/schematics/bundles/{ng_decorators-CtYwz9Lw.cjs → ng_decorators-BI0uV7KI.cjs} +2 -2
- package/schematics/bundles/ngclass-to-class-migration.cjs +110 -98
- package/schematics/bundles/ngstyle-to-style-migration.cjs +490 -0
- package/schematics/bundles/nodes-B16H9JUd.cjs +1 -1
- package/schematics/bundles/output-migration.cjs +6 -6
- package/schematics/bundles/parse_html-7Wl_HDnw.cjs +132 -0
- package/schematics/bundles/{project_paths-BJTqcWvC.cjs → project_paths-Dr2s3Pq3.cjs} +3 -3
- package/schematics/bundles/{project_tsconfig_paths-bRwOJEk9.cjs → project_tsconfig_paths-DX9KHLn9.cjs} +423 -236
- package/schematics/bundles/property_name-BBwFuqMe.cjs +1 -1
- package/schematics/bundles/route-lazy-loading.cjs +48 -4
- package/schematics/bundles/router-current-navigation.cjs +6 -6
- package/schematics/bundles/router-last-successful-navigation.cjs +6 -6
- package/schematics/bundles/self-closing-tags-migration.cjs +8 -8
- package/schematics/bundles/signal-input-migration.cjs +17 -9
- package/schematics/bundles/signal-queries-migration.cjs +7 -7
- package/schematics/bundles/signals.cjs +7 -7
- package/schematics/bundles/standalone-migration.cjs +17 -10
- package/schematics/bundles/{symbol-VPWguRxr.cjs → symbol-BObKoqes.cjs} +3 -2
- package/schematics/collection.json +6 -0
- package/schematics/migrations/ngstyle-to-style-migration/schema.json +20 -0
- package/schematics/migrations.json +5 -0
- package/testing/index.d.ts +1 -1
- package/weak_ref.d.d.ts +1 -1
- package/schematics/bundles/parse_html-CLFKoiOK.cjs +0 -41
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
/**
|
|
3
|
-
* @license Angular v21.0.0-next.
|
|
3
|
+
* @license Angular v21.0.0-next.5
|
|
4
4
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
5
5
|
* License: MIT
|
|
6
6
|
*/
|
|
@@ -1233,6 +1233,27 @@ class InstantiateExpr extends Expression {
|
|
|
1233
1233
|
return new InstantiateExpr(this.classExpr.clone(), this.args.map((arg) => arg.clone()), this.type, this.sourceSpan);
|
|
1234
1234
|
}
|
|
1235
1235
|
}
|
|
1236
|
+
let RegularExpressionLiteral$1 = class RegularExpressionLiteral extends Expression {
|
|
1237
|
+
body;
|
|
1238
|
+
flags;
|
|
1239
|
+
constructor(body, flags, sourceSpan) {
|
|
1240
|
+
super(null, sourceSpan);
|
|
1241
|
+
this.body = body;
|
|
1242
|
+
this.flags = flags;
|
|
1243
|
+
}
|
|
1244
|
+
isEquivalent(e) {
|
|
1245
|
+
return e instanceof RegularExpressionLiteral && this.body === e.body && this.flags === e.flags;
|
|
1246
|
+
}
|
|
1247
|
+
isConstant() {
|
|
1248
|
+
return true;
|
|
1249
|
+
}
|
|
1250
|
+
visitExpression(visitor, context) {
|
|
1251
|
+
return visitor.visitRegularExpressionLiteral(this, context);
|
|
1252
|
+
}
|
|
1253
|
+
clone() {
|
|
1254
|
+
return new RegularExpressionLiteral(this.body, this.flags, this.sourceSpan);
|
|
1255
|
+
}
|
|
1256
|
+
};
|
|
1236
1257
|
class LiteralExpr extends Expression {
|
|
1237
1258
|
value;
|
|
1238
1259
|
constructor(value, type, sourceSpan) {
|
|
@@ -2007,6 +2028,9 @@ let RecursiveAstVisitor$1 = class RecursiveAstVisitor {
|
|
|
2007
2028
|
visitLiteralExpr(ast, context) {
|
|
2008
2029
|
return this.visitExpression(ast, context);
|
|
2009
2030
|
}
|
|
2031
|
+
visitRegularExpressionLiteral(ast, context) {
|
|
2032
|
+
return this.visitExpression(ast, context);
|
|
2033
|
+
}
|
|
2010
2034
|
visitLocalizedString(ast, context) {
|
|
2011
2035
|
return this.visitExpression(ast, context);
|
|
2012
2036
|
}
|
|
@@ -2447,6 +2471,9 @@ class GenericKeyFn {
|
|
|
2447
2471
|
else if (expr instanceof LiteralExpr) {
|
|
2448
2472
|
return String(expr.value);
|
|
2449
2473
|
}
|
|
2474
|
+
else if (expr instanceof RegularExpressionLiteral$1) {
|
|
2475
|
+
return `/${expr.body}/${expr.flags ?? ''}`;
|
|
2476
|
+
}
|
|
2450
2477
|
else if (expr instanceof LiteralArrayExpr) {
|
|
2451
2478
|
const entries = [];
|
|
2452
2479
|
for (const entry of expr.entries) {
|
|
@@ -2851,10 +2878,6 @@ class Identifiers {
|
|
|
2851
2878
|
name: 'ɵɵExternalStylesFeature',
|
|
2852
2879
|
moduleName: CORE,
|
|
2853
2880
|
};
|
|
2854
|
-
static AnimationsFeature = {
|
|
2855
|
-
name: 'ɵɵAnimationsFeature',
|
|
2856
|
-
moduleName: CORE,
|
|
2857
|
-
};
|
|
2858
2881
|
static listener = { name: 'ɵɵlistener', moduleName: CORE };
|
|
2859
2882
|
static getInheritedFactory = {
|
|
2860
2883
|
name: 'ɵɵgetInheritedFactory',
|
|
@@ -2988,7 +3011,7 @@ function getJitStandaloneDefaultForVersion(version) {
|
|
|
2988
3011
|
}
|
|
2989
3012
|
|
|
2990
3013
|
// https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
|
|
2991
|
-
const VERSION = 3;
|
|
3014
|
+
const VERSION$1 = 3;
|
|
2992
3015
|
const JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,';
|
|
2993
3016
|
class SourceMapGenerator {
|
|
2994
3017
|
file;
|
|
@@ -3082,7 +3105,7 @@ class SourceMapGenerator {
|
|
|
3082
3105
|
mappings = mappings.slice(0, -1);
|
|
3083
3106
|
return {
|
|
3084
3107
|
'file': this.file || '',
|
|
3085
|
-
'version': VERSION,
|
|
3108
|
+
'version': VERSION$1,
|
|
3086
3109
|
'sourceRoot': '',
|
|
3087
3110
|
'sources': sources,
|
|
3088
3111
|
'sourcesContent': sourcesContent,
|
|
@@ -3445,6 +3468,10 @@ class AbstractEmitterVisitor {
|
|
|
3445
3468
|
}
|
|
3446
3469
|
return null;
|
|
3447
3470
|
}
|
|
3471
|
+
visitRegularExpressionLiteral(ast, ctx) {
|
|
3472
|
+
ctx.print(ast, `/${ast.body}/${ast.flags || ''}`);
|
|
3473
|
+
return null;
|
|
3474
|
+
}
|
|
3448
3475
|
visitLocalizedString(ast, ctx) {
|
|
3449
3476
|
const head = ast.serializeI18nHead();
|
|
3450
3477
|
ctx.print(ast, '$localize `' + head.raw);
|
|
@@ -4253,6 +4280,18 @@ class ParenthesizedExpression extends AST {
|
|
|
4253
4280
|
return visitor.visitParenthesizedExpression(this, context);
|
|
4254
4281
|
}
|
|
4255
4282
|
}
|
|
4283
|
+
class RegularExpressionLiteral extends AST {
|
|
4284
|
+
body;
|
|
4285
|
+
flags;
|
|
4286
|
+
constructor(span, sourceSpan, body, flags) {
|
|
4287
|
+
super(span, sourceSpan);
|
|
4288
|
+
this.body = body;
|
|
4289
|
+
this.flags = flags;
|
|
4290
|
+
}
|
|
4291
|
+
visit(visitor, context) {
|
|
4292
|
+
return visitor.visitRegularExpressionLiteral(this, context);
|
|
4293
|
+
}
|
|
4294
|
+
}
|
|
4256
4295
|
/**
|
|
4257
4296
|
* Records the absolute position of a text span in a source file, where `start` and `end` are the
|
|
4258
4297
|
* starting and ending byte offsets, respectively, of the text span in a source file.
|
|
@@ -4413,6 +4452,7 @@ class RecursiveAstVisitor {
|
|
|
4413
4452
|
visitParenthesizedExpression(ast, context) {
|
|
4414
4453
|
this.visit(ast.expression, context);
|
|
4415
4454
|
}
|
|
4455
|
+
visitRegularExpressionLiteral(ast, context) { }
|
|
4416
4456
|
// This is not part of the AstVisitor interface, just a helper method
|
|
4417
4457
|
visitAll(asts, context) {
|
|
4418
4458
|
for (const ast of asts) {
|
|
@@ -10328,7 +10368,8 @@ function transformExpressionsInExpression(expr, transform, flags) {
|
|
|
10328
10368
|
}
|
|
10329
10369
|
else if (expr instanceof ReadVarExpr ||
|
|
10330
10370
|
expr instanceof ExternalExpr ||
|
|
10331
|
-
expr instanceof LiteralExpr
|
|
10371
|
+
expr instanceof LiteralExpr ||
|
|
10372
|
+
expr instanceof RegularExpressionLiteral$1) ;
|
|
10332
10373
|
else {
|
|
10333
10374
|
throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
|
|
10334
10375
|
}
|
|
@@ -11706,6 +11747,16 @@ function extractAttributeOp(unit, op, elements) {
|
|
|
11706
11747
|
}
|
|
11707
11748
|
}
|
|
11708
11749
|
|
|
11750
|
+
const ARIA_PREFIX = 'aria-';
|
|
11751
|
+
/**
|
|
11752
|
+
* Returns whether `name` is an ARIA attribute name.
|
|
11753
|
+
*
|
|
11754
|
+
* This is a heuristic based on whether name begins with and is longer than `aria-`.
|
|
11755
|
+
*/
|
|
11756
|
+
function isAriaAttribute(name) {
|
|
11757
|
+
return name.startsWith(ARIA_PREFIX) && name.length > ARIA_PREFIX.length;
|
|
11758
|
+
}
|
|
11759
|
+
|
|
11709
11760
|
/**
|
|
11710
11761
|
* Looks up an element in the given map by xref ID.
|
|
11711
11762
|
*/
|
|
@@ -11751,7 +11802,15 @@ function specializeBindings(job) {
|
|
|
11751
11802
|
break;
|
|
11752
11803
|
case BindingKind.Property:
|
|
11753
11804
|
case BindingKind.LegacyAnimation:
|
|
11754
|
-
|
|
11805
|
+
// Convert a property binding targeting an ARIA attribute (e.g. [aria-label]) into an
|
|
11806
|
+
// attribute binding when we know it can't also target an input. Note that a `Host` job is
|
|
11807
|
+
// always `DomOnly`, so this condition must be checked first.
|
|
11808
|
+
if (job.mode === TemplateCompilationMode.DomOnly && isAriaAttribute(op.name)) {
|
|
11809
|
+
OpList.replace(op, createAttributeOp(op.target,
|
|
11810
|
+
/* namespace= */ null, op.name, op.expression, op.securityContext,
|
|
11811
|
+
/* isTextAttribute= */ false, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan));
|
|
11812
|
+
}
|
|
11813
|
+
else if (job.kind === CompilationJobKind.Host) {
|
|
11755
11814
|
OpList.replace(op, createDomPropertyOp(op.name, op.expression, op.bindingKind, op.i18nContext, op.securityContext, op.sourceSpan));
|
|
11756
11815
|
}
|
|
11757
11816
|
else {
|
|
@@ -18137,7 +18196,9 @@ var TokenType;
|
|
|
18137
18196
|
TokenType[TokenType["String"] = 4] = "String";
|
|
18138
18197
|
TokenType[TokenType["Operator"] = 5] = "Operator";
|
|
18139
18198
|
TokenType[TokenType["Number"] = 6] = "Number";
|
|
18140
|
-
TokenType[TokenType["
|
|
18199
|
+
TokenType[TokenType["RegExpBody"] = 7] = "RegExpBody";
|
|
18200
|
+
TokenType[TokenType["RegExpFlags"] = 8] = "RegExpFlags";
|
|
18201
|
+
TokenType[TokenType["Error"] = 9] = "Error";
|
|
18141
18202
|
})(TokenType || (TokenType = {}));
|
|
18142
18203
|
var StringTokenKind;
|
|
18143
18204
|
(function (StringTokenKind) {
|
|
@@ -18232,6 +18293,12 @@ class Token {
|
|
|
18232
18293
|
isError() {
|
|
18233
18294
|
return this.type === TokenType.Error;
|
|
18234
18295
|
}
|
|
18296
|
+
isRegExpBody() {
|
|
18297
|
+
return this.type === TokenType.RegExpBody;
|
|
18298
|
+
}
|
|
18299
|
+
isRegExpFlags() {
|
|
18300
|
+
return this.type === TokenType.RegExpFlags;
|
|
18301
|
+
}
|
|
18235
18302
|
toNumber() {
|
|
18236
18303
|
return this.type === TokenType.Number ? this.numValue : -1;
|
|
18237
18304
|
}
|
|
@@ -18258,6 +18325,8 @@ class Token {
|
|
|
18258
18325
|
case TokenType.PrivateIdentifier:
|
|
18259
18326
|
case TokenType.String:
|
|
18260
18327
|
case TokenType.Error:
|
|
18328
|
+
case TokenType.RegExpBody:
|
|
18329
|
+
case TokenType.RegExpFlags:
|
|
18261
18330
|
return this.strValue;
|
|
18262
18331
|
case TokenType.Number:
|
|
18263
18332
|
return this.numValue.toString();
|
|
@@ -18294,6 +18363,12 @@ function newNumberToken(index, end, n) {
|
|
|
18294
18363
|
function newErrorToken(index, end, message) {
|
|
18295
18364
|
return new Token(index, end, TokenType.Error, 0, message);
|
|
18296
18365
|
}
|
|
18366
|
+
function newRegExpBodyToken(index, end, text) {
|
|
18367
|
+
return new Token(index, end, TokenType.RegExpBody, 0, text);
|
|
18368
|
+
}
|
|
18369
|
+
function newRegExpFlagsToken(index, end, text) {
|
|
18370
|
+
return new Token(index, end, TokenType.RegExpFlags, 0, text);
|
|
18371
|
+
}
|
|
18297
18372
|
const EOF = new Token(-1, -1, TokenType.Character, 0, '');
|
|
18298
18373
|
class _Scanner {
|
|
18299
18374
|
input;
|
|
@@ -18377,7 +18452,9 @@ class _Scanner {
|
|
|
18377
18452
|
case $MINUS:
|
|
18378
18453
|
return this.scanComplexOperator(start, '-', $EQ, '=');
|
|
18379
18454
|
case $SLASH:
|
|
18380
|
-
return this.
|
|
18455
|
+
return this.isStartOfRegex()
|
|
18456
|
+
? this.scanRegex(index)
|
|
18457
|
+
: this.scanComplexOperator(start, '/', $EQ, '=');
|
|
18381
18458
|
case $PERCENT:
|
|
18382
18459
|
return this.scanComplexOperator(start, '%', $EQ, '=');
|
|
18383
18460
|
case $CARET:
|
|
@@ -18640,6 +18717,81 @@ class _Scanner {
|
|
|
18640
18717
|
}
|
|
18641
18718
|
return newOperatorToken(start, this.index, operator);
|
|
18642
18719
|
}
|
|
18720
|
+
isStartOfRegex() {
|
|
18721
|
+
if (this.tokens.length === 0) {
|
|
18722
|
+
return true;
|
|
18723
|
+
}
|
|
18724
|
+
const prevToken = this.tokens[this.tokens.length - 1];
|
|
18725
|
+
// If a slash is preceded by a `!` operator, we need to distinguish whether it's a
|
|
18726
|
+
// negation or a non-null assertion. Regexes can only be precded by negations.
|
|
18727
|
+
if (prevToken.isOperator('!')) {
|
|
18728
|
+
const beforePrevToken = this.tokens.length > 1 ? this.tokens[this.tokens.length - 2] : null;
|
|
18729
|
+
const isNegation = beforePrevToken === null ||
|
|
18730
|
+
(beforePrevToken.type !== TokenType.Identifier &&
|
|
18731
|
+
!beforePrevToken.isCharacter($RPAREN) &&
|
|
18732
|
+
!beforePrevToken.isCharacter($RBRACKET));
|
|
18733
|
+
return isNegation;
|
|
18734
|
+
}
|
|
18735
|
+
// Only consider the slash a regex if it's preceded either by:
|
|
18736
|
+
// - Any operator, aside from `!` which is special-cased above.
|
|
18737
|
+
// - Opening paren (e.g. `(/a/)`).
|
|
18738
|
+
// - Opening bracket (e.g. `[/a/]`).
|
|
18739
|
+
// - A comma (e.g. `[1, /a/]`).
|
|
18740
|
+
// - A colon (e.g. `{foo: /a/}`).
|
|
18741
|
+
return (prevToken.type === TokenType.Operator ||
|
|
18742
|
+
prevToken.isCharacter($LPAREN) ||
|
|
18743
|
+
prevToken.isCharacter($LBRACKET) ||
|
|
18744
|
+
prevToken.isCharacter($COMMA) ||
|
|
18745
|
+
prevToken.isCharacter($COLON));
|
|
18746
|
+
}
|
|
18747
|
+
scanRegex(tokenStart) {
|
|
18748
|
+
this.advance();
|
|
18749
|
+
const textStart = this.index;
|
|
18750
|
+
let inEscape = false;
|
|
18751
|
+
let inCharacterClass = false;
|
|
18752
|
+
while (true) {
|
|
18753
|
+
const peek = this.peek;
|
|
18754
|
+
if (peek === $EOF) {
|
|
18755
|
+
return this.error('Unterminated regular expression', 0);
|
|
18756
|
+
}
|
|
18757
|
+
if (inEscape) {
|
|
18758
|
+
inEscape = false;
|
|
18759
|
+
}
|
|
18760
|
+
else if (peek === $BACKSLASH) {
|
|
18761
|
+
inEscape = true;
|
|
18762
|
+
}
|
|
18763
|
+
else if (peek === $LBRACKET) {
|
|
18764
|
+
inCharacterClass = true;
|
|
18765
|
+
}
|
|
18766
|
+
else if (peek === $RBRACKET) {
|
|
18767
|
+
inCharacterClass = false;
|
|
18768
|
+
}
|
|
18769
|
+
else if (peek === $SLASH && !inCharacterClass) {
|
|
18770
|
+
break;
|
|
18771
|
+
}
|
|
18772
|
+
this.advance();
|
|
18773
|
+
}
|
|
18774
|
+
// Note that we want the text without the slashes,
|
|
18775
|
+
// but we still want the slashes to be part of the span.
|
|
18776
|
+
const value = this.input.substring(textStart, this.index);
|
|
18777
|
+
this.advance();
|
|
18778
|
+
const bodyToken = newRegExpBodyToken(tokenStart, this.index, value);
|
|
18779
|
+
const flagsToken = this.scanRegexFlags(this.index);
|
|
18780
|
+
if (flagsToken !== null) {
|
|
18781
|
+
this.tokens.push(bodyToken);
|
|
18782
|
+
return flagsToken;
|
|
18783
|
+
}
|
|
18784
|
+
return bodyToken;
|
|
18785
|
+
}
|
|
18786
|
+
scanRegexFlags(start) {
|
|
18787
|
+
if (!isAsciiLetter(this.peek)) {
|
|
18788
|
+
return null;
|
|
18789
|
+
}
|
|
18790
|
+
while (isAsciiLetter(this.peek)) {
|
|
18791
|
+
this.advance();
|
|
18792
|
+
}
|
|
18793
|
+
return newRegExpFlagsToken(start, this.index, this.input.substring(start, this.index));
|
|
18794
|
+
}
|
|
18643
18795
|
}
|
|
18644
18796
|
function isIdentifierStart(code) {
|
|
18645
18797
|
return (($a <= code && code <= $z) ||
|
|
@@ -18991,6 +19143,8 @@ var ParseContextFlags;
|
|
|
18991
19143
|
*/
|
|
18992
19144
|
ParseContextFlags[ParseContextFlags["Writable"] = 1] = "Writable";
|
|
18993
19145
|
})(ParseContextFlags || (ParseContextFlags = {}));
|
|
19146
|
+
/** Possible flags that can be used in a regex literal. */
|
|
19147
|
+
const SUPPORTED_REGEX_FLAGS = new Set(['d', 'g', 'i', 'm', 's', 'u', 'v', 'y']);
|
|
18994
19148
|
class _ParseAST {
|
|
18995
19149
|
input;
|
|
18996
19150
|
parseSourceSpan;
|
|
@@ -19560,6 +19714,9 @@ class _ParseAST {
|
|
|
19560
19714
|
this._reportErrorForPrivateIdentifier(this.next, null);
|
|
19561
19715
|
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
19562
19716
|
}
|
|
19717
|
+
else if (this.next.isRegExpBody()) {
|
|
19718
|
+
return this.parseRegularExpressionLiteral();
|
|
19719
|
+
}
|
|
19563
19720
|
else if (this.index >= this.tokens.length) {
|
|
19564
19721
|
this.error(`Unexpected end of expression: ${this.input}`);
|
|
19565
19722
|
return new EmptyExpr$1(this.span(start), this.sourceSpan(start));
|
|
@@ -19929,6 +20086,35 @@ class _ParseAST {
|
|
|
19929
20086
|
}
|
|
19930
20087
|
return new TemplateLiteral(this.span(start), this.sourceSpan(start), elements, expressions);
|
|
19931
20088
|
}
|
|
20089
|
+
parseRegularExpressionLiteral() {
|
|
20090
|
+
const bodyToken = this.next;
|
|
20091
|
+
this.advance();
|
|
20092
|
+
if (!bodyToken.isRegExpBody()) {
|
|
20093
|
+
return new EmptyExpr$1(this.span(this.inputIndex), this.sourceSpan(this.inputIndex));
|
|
20094
|
+
}
|
|
20095
|
+
let flagsToken = null;
|
|
20096
|
+
if (this.next.isRegExpFlags()) {
|
|
20097
|
+
flagsToken = this.next;
|
|
20098
|
+
this.advance();
|
|
20099
|
+
const seenFlags = new Set();
|
|
20100
|
+
for (let i = 0; i < flagsToken.strValue.length; i++) {
|
|
20101
|
+
const char = flagsToken.strValue[i];
|
|
20102
|
+
if (!SUPPORTED_REGEX_FLAGS.has(char)) {
|
|
20103
|
+
this.error(`Unsupported regular expression flag "${char}". The supported flags are: ` +
|
|
20104
|
+
Array.from(SUPPORTED_REGEX_FLAGS, (f) => `"${f}"`).join(', '), flagsToken.index + i);
|
|
20105
|
+
}
|
|
20106
|
+
else if (seenFlags.has(char)) {
|
|
20107
|
+
this.error(`Duplicate regular expression flag "${char}"`, flagsToken.index + i);
|
|
20108
|
+
}
|
|
20109
|
+
else {
|
|
20110
|
+
seenFlags.add(char);
|
|
20111
|
+
}
|
|
20112
|
+
}
|
|
20113
|
+
}
|
|
20114
|
+
const start = bodyToken.index;
|
|
20115
|
+
const end = flagsToken ? flagsToken.end : bodyToken.end;
|
|
20116
|
+
return new RegularExpressionLiteral(this.span(start, end), this.sourceSpan(start, end), bodyToken.strValue, flagsToken ? flagsToken.strValue : null);
|
|
20117
|
+
}
|
|
19932
20118
|
/**
|
|
19933
20119
|
* Consume the optional statement terminator: semicolon or comma.
|
|
19934
20120
|
*/
|
|
@@ -20142,6 +20328,9 @@ class SerializeExpressionVisitor {
|
|
|
20142
20328
|
visitVoidExpression(ast, context) {
|
|
20143
20329
|
return `void ${ast.expression.visit(this, context)}`;
|
|
20144
20330
|
}
|
|
20331
|
+
visitRegularExpressionLiteral(ast, context) {
|
|
20332
|
+
return `/${ast.body}/${ast.flags || ''}`;
|
|
20333
|
+
}
|
|
20145
20334
|
visitASTWithSource(ast, context) {
|
|
20146
20335
|
return ast.ast.visit(this, context);
|
|
20147
20336
|
}
|
|
@@ -20338,7 +20527,7 @@ const OBJECT = 'object';
|
|
|
20338
20527
|
//
|
|
20339
20528
|
// =================================================================================================
|
|
20340
20529
|
const SCHEMA = [
|
|
20341
|
-
'[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot' +
|
|
20530
|
+
'[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaInvalid,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot' +
|
|
20342
20531
|
/* added manually to avoid breaking changes */
|
|
20343
20532
|
',*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored',
|
|
20344
20533
|
'[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy',
|
|
@@ -23244,6 +23433,27 @@ function transformLiteralMap(expr) {
|
|
|
23244
23433
|
return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
|
|
23245
23434
|
}
|
|
23246
23435
|
|
|
23436
|
+
/** Optimizes regular expressions used in expressions. */
|
|
23437
|
+
function optimizeRegularExpressions(job) {
|
|
23438
|
+
for (const view of job.units) {
|
|
23439
|
+
for (const op of view.ops()) {
|
|
23440
|
+
transformExpressionsInOp(op, (expr) => {
|
|
23441
|
+
if (expr instanceof RegularExpressionLiteral$1 &&
|
|
23442
|
+
// We can't optimize global regexes, because they're stateful.
|
|
23443
|
+
(expr.flags === null || !expr.flags.includes('g'))) {
|
|
23444
|
+
return job.pool.getSharedConstant(new RegularExpressionConstant(), expr);
|
|
23445
|
+
}
|
|
23446
|
+
return expr;
|
|
23447
|
+
}, VisitorContextFlag.None);
|
|
23448
|
+
}
|
|
23449
|
+
}
|
|
23450
|
+
}
|
|
23451
|
+
class RegularExpressionConstant extends GenericKeyFn {
|
|
23452
|
+
toSharedConstantDeclaration(declName, keyExpr) {
|
|
23453
|
+
return new DeclareVarStmt(declName, keyExpr, undefined, exports.StmtModifier.Final);
|
|
23454
|
+
}
|
|
23455
|
+
}
|
|
23456
|
+
|
|
23247
23457
|
// This file contains helpers for generating calls to Ivy instructions. In particular, each
|
|
23248
23458
|
// instruction type is represented as a function, which may select a specific instruction variant
|
|
23249
23459
|
// depending on the exact arguments.
|
|
@@ -23857,7 +24067,6 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
|
|
|
23857
24067
|
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
|
|
23858
24068
|
}
|
|
23859
24069
|
|
|
23860
|
-
const ARIA_PREFIX = 'aria';
|
|
23861
24070
|
/**
|
|
23862
24071
|
* Map of target resolvers for event listeners.
|
|
23863
24072
|
*/
|
|
@@ -24236,33 +24445,6 @@ function reifyUpdateOperations(unit, ops) {
|
|
|
24236
24445
|
}
|
|
24237
24446
|
}
|
|
24238
24447
|
}
|
|
24239
|
-
/**
|
|
24240
|
-
* Converts an ARIA property name to its corresponding attribute name, if necessary.
|
|
24241
|
-
*
|
|
24242
|
-
* For example, converts `ariaLabel` to `aria-label`.
|
|
24243
|
-
*
|
|
24244
|
-
* https://www.w3.org/TR/wai-aria-1.2/#accessibilityroleandproperties-correspondence
|
|
24245
|
-
*
|
|
24246
|
-
* This must be kept in sync with the the function of the same name in
|
|
24247
|
-
* packages/core/src/render3/instructions/aria_property.ts.
|
|
24248
|
-
*
|
|
24249
|
-
* @param name A property name that starts with `aria`.
|
|
24250
|
-
* @returns The corresponding attribute name.
|
|
24251
|
-
*/
|
|
24252
|
-
function ariaAttrName(name) {
|
|
24253
|
-
return name.charAt(ARIA_PREFIX.length) !== '-'
|
|
24254
|
-
? ARIA_PREFIX + '-' + name.slice(ARIA_PREFIX.length).toLowerCase()
|
|
24255
|
-
: name; // Property already has attribute name.
|
|
24256
|
-
}
|
|
24257
|
-
/**
|
|
24258
|
-
* Returns whether `name` is an ARIA property (or attribute) name.
|
|
24259
|
-
*
|
|
24260
|
-
* This is a heuristic based on whether name begins with and is longer than `aria`. For example,
|
|
24261
|
-
* this returns true for both `ariaLabel` and `aria-label`.
|
|
24262
|
-
*/
|
|
24263
|
-
function isAriaProperty(name) {
|
|
24264
|
-
return name.startsWith(ARIA_PREFIX) && name.length > ARIA_PREFIX.length;
|
|
24265
|
-
}
|
|
24266
24448
|
/**
|
|
24267
24449
|
* Reifies a DOM property binding operation.
|
|
24268
24450
|
*
|
|
@@ -24273,9 +24455,7 @@ function isAriaProperty(name) {
|
|
|
24273
24455
|
* @returns A statement to update the property at runtime.
|
|
24274
24456
|
*/
|
|
24275
24457
|
function reifyDomProperty(op) {
|
|
24276
|
-
return
|
|
24277
|
-
? attribute(ariaAttrName(op.name), op.expression, null, null, op.sourceSpan)
|
|
24278
|
-
: domProperty(DOM_PROPERTY_REMAPPING.get(op.name) ?? op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
24458
|
+
return domProperty(DOM_PROPERTY_REMAPPING.get(op.name) ?? op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
24279
24459
|
}
|
|
24280
24460
|
/**
|
|
24281
24461
|
* Reifies a property binding operation.
|
|
@@ -24287,7 +24467,7 @@ function reifyDomProperty(op) {
|
|
|
24287
24467
|
* @returns A statement to update the property at runtime.
|
|
24288
24468
|
*/
|
|
24289
24469
|
function reifyProperty(op) {
|
|
24290
|
-
return
|
|
24470
|
+
return isAriaAttribute(op.name)
|
|
24291
24471
|
? ariaProperty(op.name, op.expression, op.sourceSpan)
|
|
24292
24472
|
: property(op.name, op.expression, op.sanitizer, op.sourceSpan);
|
|
24293
24473
|
}
|
|
@@ -26335,6 +26515,7 @@ function wrapI18nIcus(job) {
|
|
|
26335
26515
|
*/
|
|
26336
26516
|
const phases = [
|
|
26337
26517
|
{ kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
|
|
26518
|
+
{ kind: CompilationJobKind.Both, fn: optimizeRegularExpressions },
|
|
26338
26519
|
{ kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
|
|
26339
26520
|
{ kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
|
|
26340
26521
|
{ kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
|
|
@@ -27181,6 +27362,9 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
27181
27362
|
else if (ast instanceof ParenthesizedExpression) {
|
|
27182
27363
|
return new ParenthesizedExpr(convertAst(ast.expression, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan));
|
|
27183
27364
|
}
|
|
27365
|
+
else if (ast instanceof RegularExpressionLiteral) {
|
|
27366
|
+
return new RegularExpressionLiteral$1(ast.body, ast.flags, baseSourceSpan);
|
|
27367
|
+
}
|
|
27184
27368
|
else {
|
|
27185
27369
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan?.start.file.url}"`);
|
|
27186
27370
|
}
|
|
@@ -30106,184 +30290,9 @@ function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, s
|
|
|
30106
30290
|
return new BindingParser(new Parser(new Lexer(), selectorlessEnabled), interpolationConfig, elementRegistry, []);
|
|
30107
30291
|
}
|
|
30108
30292
|
|
|
30109
|
-
/*!
|
|
30110
|
-
* @license
|
|
30111
|
-
* Copyright Google LLC All Rights Reserved.
|
|
30112
|
-
*
|
|
30113
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
30114
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
30115
|
-
*/
|
|
30116
|
-
/**
|
|
30117
|
-
* Visitor that traverses all template and expression AST nodes in a template.
|
|
30118
|
-
* Useful for cases where every single node needs to be visited.
|
|
30119
|
-
*/
|
|
30120
|
-
class CombinedRecursiveAstVisitor extends RecursiveAstVisitor {
|
|
30121
|
-
visit(node) {
|
|
30122
|
-
if (node instanceof ASTWithSource) {
|
|
30123
|
-
this.visit(node.ast);
|
|
30124
|
-
}
|
|
30125
|
-
else {
|
|
30126
|
-
node.visit(this);
|
|
30127
|
-
}
|
|
30128
|
-
}
|
|
30129
|
-
visitElement(element) {
|
|
30130
|
-
this.visitAllTemplateNodes(element.attributes);
|
|
30131
|
-
this.visitAllTemplateNodes(element.inputs);
|
|
30132
|
-
this.visitAllTemplateNodes(element.outputs);
|
|
30133
|
-
this.visitAllTemplateNodes(element.directives);
|
|
30134
|
-
this.visitAllTemplateNodes(element.references);
|
|
30135
|
-
this.visitAllTemplateNodes(element.children);
|
|
30136
|
-
}
|
|
30137
|
-
visitTemplate(template) {
|
|
30138
|
-
this.visitAllTemplateNodes(template.attributes);
|
|
30139
|
-
this.visitAllTemplateNodes(template.inputs);
|
|
30140
|
-
this.visitAllTemplateNodes(template.outputs);
|
|
30141
|
-
this.visitAllTemplateNodes(template.directives);
|
|
30142
|
-
this.visitAllTemplateNodes(template.templateAttrs);
|
|
30143
|
-
this.visitAllTemplateNodes(template.variables);
|
|
30144
|
-
this.visitAllTemplateNodes(template.references);
|
|
30145
|
-
this.visitAllTemplateNodes(template.children);
|
|
30146
|
-
}
|
|
30147
|
-
visitContent(content) {
|
|
30148
|
-
this.visitAllTemplateNodes(content.children);
|
|
30149
|
-
}
|
|
30150
|
-
visitBoundAttribute(attribute) {
|
|
30151
|
-
this.visit(attribute.value);
|
|
30152
|
-
}
|
|
30153
|
-
visitBoundEvent(attribute) {
|
|
30154
|
-
this.visit(attribute.handler);
|
|
30155
|
-
}
|
|
30156
|
-
visitBoundText(text) {
|
|
30157
|
-
this.visit(text.value);
|
|
30158
|
-
}
|
|
30159
|
-
visitIcu(icu) {
|
|
30160
|
-
Object.keys(icu.vars).forEach((key) => this.visit(icu.vars[key]));
|
|
30161
|
-
Object.keys(icu.placeholders).forEach((key) => this.visit(icu.placeholders[key]));
|
|
30162
|
-
}
|
|
30163
|
-
visitDeferredBlock(deferred) {
|
|
30164
|
-
deferred.visitAll(this);
|
|
30165
|
-
}
|
|
30166
|
-
visitDeferredTrigger(trigger) {
|
|
30167
|
-
if (trigger instanceof BoundDeferredTrigger) {
|
|
30168
|
-
this.visit(trigger.value);
|
|
30169
|
-
}
|
|
30170
|
-
}
|
|
30171
|
-
visitDeferredBlockPlaceholder(block) {
|
|
30172
|
-
this.visitAllTemplateNodes(block.children);
|
|
30173
|
-
}
|
|
30174
|
-
visitDeferredBlockError(block) {
|
|
30175
|
-
this.visitAllTemplateNodes(block.children);
|
|
30176
|
-
}
|
|
30177
|
-
visitDeferredBlockLoading(block) {
|
|
30178
|
-
this.visitAllTemplateNodes(block.children);
|
|
30179
|
-
}
|
|
30180
|
-
visitSwitchBlock(block) {
|
|
30181
|
-
this.visit(block.expression);
|
|
30182
|
-
this.visitAllTemplateNodes(block.cases);
|
|
30183
|
-
}
|
|
30184
|
-
visitSwitchBlockCase(block) {
|
|
30185
|
-
block.expression && this.visit(block.expression);
|
|
30186
|
-
this.visitAllTemplateNodes(block.children);
|
|
30187
|
-
}
|
|
30188
|
-
visitForLoopBlock(block) {
|
|
30189
|
-
block.item.visit(this);
|
|
30190
|
-
this.visitAllTemplateNodes(block.contextVariables);
|
|
30191
|
-
this.visit(block.expression);
|
|
30192
|
-
this.visitAllTemplateNodes(block.children);
|
|
30193
|
-
block.empty?.visit(this);
|
|
30194
|
-
}
|
|
30195
|
-
visitForLoopBlockEmpty(block) {
|
|
30196
|
-
this.visitAllTemplateNodes(block.children);
|
|
30197
|
-
}
|
|
30198
|
-
visitIfBlock(block) {
|
|
30199
|
-
this.visitAllTemplateNodes(block.branches);
|
|
30200
|
-
}
|
|
30201
|
-
visitIfBlockBranch(block) {
|
|
30202
|
-
block.expression && this.visit(block.expression);
|
|
30203
|
-
block.expressionAlias?.visit(this);
|
|
30204
|
-
this.visitAllTemplateNodes(block.children);
|
|
30205
|
-
}
|
|
30206
|
-
visitLetDeclaration(decl) {
|
|
30207
|
-
this.visit(decl.value);
|
|
30208
|
-
}
|
|
30209
|
-
visitComponent(component) {
|
|
30210
|
-
this.visitAllTemplateNodes(component.attributes);
|
|
30211
|
-
this.visitAllTemplateNodes(component.inputs);
|
|
30212
|
-
this.visitAllTemplateNodes(component.outputs);
|
|
30213
|
-
this.visitAllTemplateNodes(component.directives);
|
|
30214
|
-
this.visitAllTemplateNodes(component.references);
|
|
30215
|
-
this.visitAllTemplateNodes(component.children);
|
|
30216
|
-
}
|
|
30217
|
-
visitDirective(directive) {
|
|
30218
|
-
this.visitAllTemplateNodes(directive.attributes);
|
|
30219
|
-
this.visitAllTemplateNodes(directive.inputs);
|
|
30220
|
-
this.visitAllTemplateNodes(directive.outputs);
|
|
30221
|
-
this.visitAllTemplateNodes(directive.references);
|
|
30222
|
-
}
|
|
30223
|
-
visitVariable(variable) { }
|
|
30224
|
-
visitReference(reference) { }
|
|
30225
|
-
visitTextAttribute(attribute) { }
|
|
30226
|
-
visitText(text) { }
|
|
30227
|
-
visitUnknownBlock(block) { }
|
|
30228
|
-
visitAllTemplateNodes(nodes) {
|
|
30229
|
-
for (const node of nodes) {
|
|
30230
|
-
this.visit(node);
|
|
30231
|
-
}
|
|
30232
|
-
}
|
|
30233
|
-
}
|
|
30234
|
-
|
|
30235
|
-
/*!
|
|
30236
|
-
* @license
|
|
30237
|
-
* Copyright Google LLC All Rights Reserved.
|
|
30238
|
-
*
|
|
30239
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
30240
|
-
* found in the LICENSE file at https://angular.dev/license
|
|
30241
|
-
*/
|
|
30242
|
-
const ANIMATE_LEAVE$1 = `animate.leave`;
|
|
30243
|
-
/**
|
|
30244
|
-
* Analyzes a component's template to determine if it's using animate.enter
|
|
30245
|
-
* or animate.leave syntax.
|
|
30246
|
-
*/
|
|
30247
|
-
function analyzeTemplateForAnimations(template) {
|
|
30248
|
-
const analyzer = new AnimationsAnalyzer();
|
|
30249
|
-
visitAll$1(analyzer, template);
|
|
30250
|
-
// The template is considered selectorless only if there
|
|
30251
|
-
// are direct references to directives or pipes.
|
|
30252
|
-
return analyzer.hasAnimations;
|
|
30253
|
-
}
|
|
30254
|
-
/**
|
|
30255
|
-
* Visitor that traverses all the template nodes and
|
|
30256
|
-
* expressions to look for selectorless references.
|
|
30257
|
-
*/
|
|
30258
|
-
class AnimationsAnalyzer extends CombinedRecursiveAstVisitor {
|
|
30259
|
-
hasAnimations = false;
|
|
30260
|
-
visitElement(element) {
|
|
30261
|
-
// check for regular strings
|
|
30262
|
-
for (const attr of element.attributes) {
|
|
30263
|
-
if (attr.name === ANIMATE_LEAVE$1) {
|
|
30264
|
-
this.hasAnimations = true;
|
|
30265
|
-
}
|
|
30266
|
-
}
|
|
30267
|
-
// check for attribute bindings
|
|
30268
|
-
for (const input of element.inputs) {
|
|
30269
|
-
if (input.name === ANIMATE_LEAVE$1) {
|
|
30270
|
-
this.hasAnimations = true;
|
|
30271
|
-
}
|
|
30272
|
-
}
|
|
30273
|
-
// check for event bindings
|
|
30274
|
-
for (const output of element.outputs) {
|
|
30275
|
-
if (output.name === ANIMATE_LEAVE$1) {
|
|
30276
|
-
this.hasAnimations = true;
|
|
30277
|
-
}
|
|
30278
|
-
}
|
|
30279
|
-
super.visitElement(element);
|
|
30280
|
-
}
|
|
30281
|
-
}
|
|
30282
|
-
|
|
30283
30293
|
const COMPONENT_VARIABLE = '%COMP%';
|
|
30284
30294
|
const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
|
30285
30295
|
const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`;
|
|
30286
|
-
const ANIMATE_LEAVE = `animate.leave`;
|
|
30287
30296
|
function baseDirectiveFields(meta, constantPool, bindingParser) {
|
|
30288
30297
|
const definitionMap = new DefinitionMap();
|
|
30289
30298
|
const selectors = parseSelectorToR3Selector(meta.selector);
|
|
@@ -30317,11 +30326,6 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
|
|
|
30317
30326
|
}
|
|
30318
30327
|
return definitionMap;
|
|
30319
30328
|
}
|
|
30320
|
-
function hasAnimationHostBinding(meta) {
|
|
30321
|
-
return (meta.host.attributes[ANIMATE_LEAVE] !== undefined ||
|
|
30322
|
-
meta.host.properties[ANIMATE_LEAVE] !== undefined ||
|
|
30323
|
-
meta.host.listeners[ANIMATE_LEAVE] !== undefined);
|
|
30324
|
-
}
|
|
30325
30329
|
/**
|
|
30326
30330
|
* Add features to the definition map.
|
|
30327
30331
|
*/
|
|
@@ -30356,12 +30360,6 @@ function addFeatures(definitionMap, meta) {
|
|
|
30356
30360
|
const externalStyleNodes = meta.externalStyles.map((externalStyle) => literal(externalStyle));
|
|
30357
30361
|
features.push(importExpr(Identifiers.ExternalStylesFeature).callFn([literalArr(externalStyleNodes)]));
|
|
30358
30362
|
}
|
|
30359
|
-
const template = meta.template;
|
|
30360
|
-
if (hasAnimationHostBinding(meta) || (template && template.nodes.length > 0)) {
|
|
30361
|
-
if (hasAnimationHostBinding(meta) || analyzeTemplateForAnimations(template.nodes)) {
|
|
30362
|
-
features.push(importExpr(Identifiers.AnimationsFeature).callFn([]));
|
|
30363
|
-
}
|
|
30364
|
-
}
|
|
30365
30363
|
if (features.length) {
|
|
30366
30364
|
definitionMap.set('features', literalArr(features));
|
|
30367
30365
|
}
|
|
@@ -30802,6 +30800,132 @@ function compileDeferResolverFunction(meta) {
|
|
|
30802
30800
|
return arrowFn([], literalArr(depExpressions));
|
|
30803
30801
|
}
|
|
30804
30802
|
|
|
30803
|
+
/*!
|
|
30804
|
+
* @license
|
|
30805
|
+
* Copyright Google LLC All Rights Reserved.
|
|
30806
|
+
*
|
|
30807
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
30808
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
30809
|
+
*/
|
|
30810
|
+
/**
|
|
30811
|
+
* Visitor that traverses all template and expression AST nodes in a template.
|
|
30812
|
+
* Useful for cases where every single node needs to be visited.
|
|
30813
|
+
*/
|
|
30814
|
+
class CombinedRecursiveAstVisitor extends RecursiveAstVisitor {
|
|
30815
|
+
visit(node) {
|
|
30816
|
+
if (node instanceof ASTWithSource) {
|
|
30817
|
+
this.visit(node.ast);
|
|
30818
|
+
}
|
|
30819
|
+
else {
|
|
30820
|
+
node.visit(this);
|
|
30821
|
+
}
|
|
30822
|
+
}
|
|
30823
|
+
visitElement(element) {
|
|
30824
|
+
this.visitAllTemplateNodes(element.attributes);
|
|
30825
|
+
this.visitAllTemplateNodes(element.inputs);
|
|
30826
|
+
this.visitAllTemplateNodes(element.outputs);
|
|
30827
|
+
this.visitAllTemplateNodes(element.directives);
|
|
30828
|
+
this.visitAllTemplateNodes(element.references);
|
|
30829
|
+
this.visitAllTemplateNodes(element.children);
|
|
30830
|
+
}
|
|
30831
|
+
visitTemplate(template) {
|
|
30832
|
+
this.visitAllTemplateNodes(template.attributes);
|
|
30833
|
+
this.visitAllTemplateNodes(template.inputs);
|
|
30834
|
+
this.visitAllTemplateNodes(template.outputs);
|
|
30835
|
+
this.visitAllTemplateNodes(template.directives);
|
|
30836
|
+
this.visitAllTemplateNodes(template.templateAttrs);
|
|
30837
|
+
this.visitAllTemplateNodes(template.variables);
|
|
30838
|
+
this.visitAllTemplateNodes(template.references);
|
|
30839
|
+
this.visitAllTemplateNodes(template.children);
|
|
30840
|
+
}
|
|
30841
|
+
visitContent(content) {
|
|
30842
|
+
this.visitAllTemplateNodes(content.children);
|
|
30843
|
+
}
|
|
30844
|
+
visitBoundAttribute(attribute) {
|
|
30845
|
+
this.visit(attribute.value);
|
|
30846
|
+
}
|
|
30847
|
+
visitBoundEvent(attribute) {
|
|
30848
|
+
this.visit(attribute.handler);
|
|
30849
|
+
}
|
|
30850
|
+
visitBoundText(text) {
|
|
30851
|
+
this.visit(text.value);
|
|
30852
|
+
}
|
|
30853
|
+
visitIcu(icu) {
|
|
30854
|
+
Object.keys(icu.vars).forEach((key) => this.visit(icu.vars[key]));
|
|
30855
|
+
Object.keys(icu.placeholders).forEach((key) => this.visit(icu.placeholders[key]));
|
|
30856
|
+
}
|
|
30857
|
+
visitDeferredBlock(deferred) {
|
|
30858
|
+
deferred.visitAll(this);
|
|
30859
|
+
}
|
|
30860
|
+
visitDeferredTrigger(trigger) {
|
|
30861
|
+
if (trigger instanceof BoundDeferredTrigger) {
|
|
30862
|
+
this.visit(trigger.value);
|
|
30863
|
+
}
|
|
30864
|
+
}
|
|
30865
|
+
visitDeferredBlockPlaceholder(block) {
|
|
30866
|
+
this.visitAllTemplateNodes(block.children);
|
|
30867
|
+
}
|
|
30868
|
+
visitDeferredBlockError(block) {
|
|
30869
|
+
this.visitAllTemplateNodes(block.children);
|
|
30870
|
+
}
|
|
30871
|
+
visitDeferredBlockLoading(block) {
|
|
30872
|
+
this.visitAllTemplateNodes(block.children);
|
|
30873
|
+
}
|
|
30874
|
+
visitSwitchBlock(block) {
|
|
30875
|
+
this.visit(block.expression);
|
|
30876
|
+
this.visitAllTemplateNodes(block.cases);
|
|
30877
|
+
}
|
|
30878
|
+
visitSwitchBlockCase(block) {
|
|
30879
|
+
block.expression && this.visit(block.expression);
|
|
30880
|
+
this.visitAllTemplateNodes(block.children);
|
|
30881
|
+
}
|
|
30882
|
+
visitForLoopBlock(block) {
|
|
30883
|
+
block.item.visit(this);
|
|
30884
|
+
this.visitAllTemplateNodes(block.contextVariables);
|
|
30885
|
+
this.visit(block.expression);
|
|
30886
|
+
this.visitAllTemplateNodes(block.children);
|
|
30887
|
+
block.empty?.visit(this);
|
|
30888
|
+
}
|
|
30889
|
+
visitForLoopBlockEmpty(block) {
|
|
30890
|
+
this.visitAllTemplateNodes(block.children);
|
|
30891
|
+
}
|
|
30892
|
+
visitIfBlock(block) {
|
|
30893
|
+
this.visitAllTemplateNodes(block.branches);
|
|
30894
|
+
}
|
|
30895
|
+
visitIfBlockBranch(block) {
|
|
30896
|
+
block.expression && this.visit(block.expression);
|
|
30897
|
+
block.expressionAlias?.visit(this);
|
|
30898
|
+
this.visitAllTemplateNodes(block.children);
|
|
30899
|
+
}
|
|
30900
|
+
visitLetDeclaration(decl) {
|
|
30901
|
+
this.visit(decl.value);
|
|
30902
|
+
}
|
|
30903
|
+
visitComponent(component) {
|
|
30904
|
+
this.visitAllTemplateNodes(component.attributes);
|
|
30905
|
+
this.visitAllTemplateNodes(component.inputs);
|
|
30906
|
+
this.visitAllTemplateNodes(component.outputs);
|
|
30907
|
+
this.visitAllTemplateNodes(component.directives);
|
|
30908
|
+
this.visitAllTemplateNodes(component.references);
|
|
30909
|
+
this.visitAllTemplateNodes(component.children);
|
|
30910
|
+
}
|
|
30911
|
+
visitDirective(directive) {
|
|
30912
|
+
this.visitAllTemplateNodes(directive.attributes);
|
|
30913
|
+
this.visitAllTemplateNodes(directive.inputs);
|
|
30914
|
+
this.visitAllTemplateNodes(directive.outputs);
|
|
30915
|
+
this.visitAllTemplateNodes(directive.references);
|
|
30916
|
+
}
|
|
30917
|
+
visitVariable(variable) { }
|
|
30918
|
+
visitReference(reference) { }
|
|
30919
|
+
visitTextAttribute(attribute) { }
|
|
30920
|
+
visitText(text) { }
|
|
30921
|
+
visitUnknownBlock(block) { }
|
|
30922
|
+
visitAllTemplateNodes(nodes) {
|
|
30923
|
+
for (const node of nodes) {
|
|
30924
|
+
this.visit(node);
|
|
30925
|
+
}
|
|
30926
|
+
}
|
|
30927
|
+
}
|
|
30928
|
+
|
|
30805
30929
|
/**
|
|
30806
30930
|
* Processes `Target`s with a given set of directives and performs a binding operation, which
|
|
30807
30931
|
* returns an object similar to TypeScript's `ts.TypeChecker` that contains knowledge about the
|
|
@@ -32840,7 +32964,7 @@ function isAttrNode(ast) {
|
|
|
32840
32964
|
* @description
|
|
32841
32965
|
* Entry point for all public APIs of the compiler package.
|
|
32842
32966
|
*/
|
|
32843
|
-
new Version('21.0.0-next.
|
|
32967
|
+
const VERSION = new Version('21.0.0-next.5');
|
|
32844
32968
|
|
|
32845
32969
|
//////////////////////////////////////
|
|
32846
32970
|
// THIS FILE HAS GLOBAL SIDE EFFECT //
|
|
@@ -33388,6 +33512,21 @@ exports.ErrorCode = void 0;
|
|
|
33388
33512
|
* ```
|
|
33389
33513
|
*/
|
|
33390
33514
|
ErrorCode[ErrorCode["UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION"] = 8117] = "UNINVOKED_FUNCTION_IN_TEXT_INTERPOLATION";
|
|
33515
|
+
/**
|
|
33516
|
+
* A required initializer is being invoked in a forbidden context such as a property initializer
|
|
33517
|
+
* or a constructor.
|
|
33518
|
+
*
|
|
33519
|
+
* For example:
|
|
33520
|
+
* ```ts
|
|
33521
|
+
* class MyComponent {
|
|
33522
|
+
* myInput = input.required();
|
|
33523
|
+
* somValue = this.myInput(); // Error
|
|
33524
|
+
*
|
|
33525
|
+
* constructor() {
|
|
33526
|
+
* this.myInput(); // Error
|
|
33527
|
+
* }
|
|
33528
|
+
*/
|
|
33529
|
+
ErrorCode[ErrorCode["FORBIDDEN_REQUIRED_INITIALIZER_INVOCATION"] = 8118] = "FORBIDDEN_REQUIRED_INITIALIZER_INVOCATION";
|
|
33391
33530
|
/**
|
|
33392
33531
|
* The template type-checking engine would need to generate an inline type check block for a
|
|
33393
33532
|
* component, but the current type-checking environment doesn't support it.
|
|
@@ -33522,6 +33661,18 @@ function isFatalDiagnosticError(err) {
|
|
|
33522
33661
|
return err._isFatalDiagnosticError === true;
|
|
33523
33662
|
}
|
|
33524
33663
|
|
|
33664
|
+
/**
|
|
33665
|
+
* Base URL for the error details page.
|
|
33666
|
+
*
|
|
33667
|
+
* Keep the files below in full sync:
|
|
33668
|
+
* - packages/compiler-cli/src/ngtsc/diagnostics/src/error_details_base_url.ts
|
|
33669
|
+
* - packages/core/src/error_details_base_url.ts
|
|
33670
|
+
*/
|
|
33671
|
+
const ERROR_DETAILS_PAGE_BASE_URL = (() => {
|
|
33672
|
+
const versionSubDomain = VERSION.major !== '0' ? `v${VERSION.major}.` : '';
|
|
33673
|
+
return `https://${versionSubDomain}angular.dev/errors`;
|
|
33674
|
+
})();
|
|
33675
|
+
|
|
33525
33676
|
/**
|
|
33526
33677
|
* Enum holding the name of each extended template diagnostic. The name is used as a user-meaningful
|
|
33527
33678
|
* value for configuring the diagnostic in the project's options.
|
|
@@ -33876,7 +34027,7 @@ class NodeJSPathManipulation {
|
|
|
33876
34027
|
// G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
|
|
33877
34028
|
// CommonJS/ESM interop for determining the current file name and containing dir.
|
|
33878
34029
|
const isCommonJS = typeof __filename !== 'undefined';
|
|
33879
|
-
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-
|
|
34030
|
+
const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('project_tsconfig_paths-DX9KHLn9.cjs', document.baseURI).href));
|
|
33880
34031
|
// Note, when this code loads in the browser, `url` may be an empty `{}` due to the Closure shims.
|
|
33881
34032
|
const currentFileName = isCommonJS
|
|
33882
34033
|
? __filename
|
|
@@ -38276,6 +38427,9 @@ class ExpressionTranslatorVisitor {
|
|
|
38276
38427
|
visitLiteralExpr(ast, _context) {
|
|
38277
38428
|
return this.setSourceMapRange(this.factory.createLiteral(ast.value), ast.sourceSpan);
|
|
38278
38429
|
}
|
|
38430
|
+
visitRegularExpressionLiteral(ast, context) {
|
|
38431
|
+
return this.setSourceMapRange(this.factory.createRegularExpressionLiteral(ast.body, ast.flags), ast.sourceSpan);
|
|
38432
|
+
}
|
|
38279
38433
|
visitLocalizedString(ast, context) {
|
|
38280
38434
|
// A `$localize` message consists of `messageParts` and `expressions`, which get interleaved
|
|
38281
38435
|
// together. The interleaved pieces look like:
|
|
@@ -38773,6 +38927,9 @@ class TypeTranslatorVisitor {
|
|
|
38773
38927
|
visitDynamicImportExpr(ast, context) {
|
|
38774
38928
|
throw new Error('Method not implemented.');
|
|
38775
38929
|
}
|
|
38930
|
+
visitRegularExpressionLiteral(ast, context) {
|
|
38931
|
+
throw new Error('Method not implemented.');
|
|
38932
|
+
}
|
|
38776
38933
|
visitNotExpr(ast, context) {
|
|
38777
38934
|
throw new Error('Method not implemented.');
|
|
38778
38935
|
}
|
|
@@ -39076,6 +39233,9 @@ class TypeScriptAstFactory {
|
|
|
39076
39233
|
ts.factory.createVariableDeclaration(variableName, undefined, undefined, initializer ?? undefined),
|
|
39077
39234
|
], this.VAR_TYPES[type]));
|
|
39078
39235
|
}
|
|
39236
|
+
createRegularExpressionLiteral(body, flags) {
|
|
39237
|
+
return ts.factory.createRegularExpressionLiteral(`/${body}/${flags ?? ''}`);
|
|
39238
|
+
}
|
|
39079
39239
|
setSourceMapRange(node, sourceMapRange) {
|
|
39080
39240
|
if (sourceMapRange === null) {
|
|
39081
39241
|
return node;
|
|
@@ -42475,6 +42635,10 @@ class MagicString {
|
|
|
42475
42635
|
if (chunk.outro.length) mappings.advance(chunk.outro);
|
|
42476
42636
|
});
|
|
42477
42637
|
|
|
42638
|
+
if (this.outro) {
|
|
42639
|
+
mappings.advance(this.outro);
|
|
42640
|
+
}
|
|
42641
|
+
|
|
42478
42642
|
return {
|
|
42479
42643
|
file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
|
|
42480
42644
|
sources: [
|
|
@@ -43140,7 +43304,12 @@ class MagicString {
|
|
|
43140
43304
|
const index = original.indexOf(string);
|
|
43141
43305
|
|
|
43142
43306
|
if (index !== -1) {
|
|
43143
|
-
|
|
43307
|
+
if (typeof replacement === 'function') {
|
|
43308
|
+
replacement = replacement(string, index, original);
|
|
43309
|
+
}
|
|
43310
|
+
if (string !== replacement) {
|
|
43311
|
+
this.overwrite(index, index + string.length, replacement);
|
|
43312
|
+
}
|
|
43144
43313
|
}
|
|
43145
43314
|
|
|
43146
43315
|
return this;
|
|
@@ -43163,7 +43332,11 @@ class MagicString {
|
|
|
43163
43332
|
index = original.indexOf(string, index + stringLength)
|
|
43164
43333
|
) {
|
|
43165
43334
|
const previous = original.slice(index, index + stringLength);
|
|
43166
|
-
|
|
43335
|
+
let _replacement = replacement;
|
|
43336
|
+
if (typeof replacement === 'function') {
|
|
43337
|
+
_replacement = replacement(previous, index, original);
|
|
43338
|
+
}
|
|
43339
|
+
if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
|
|
43167
43340
|
}
|
|
43168
43341
|
|
|
43169
43342
|
return this;
|
|
@@ -44844,6 +45017,9 @@ class AstTranslator {
|
|
|
44844
45017
|
visitThisReceiver(ast) {
|
|
44845
45018
|
throw new Error('Method not implemented.');
|
|
44846
45019
|
}
|
|
45020
|
+
visitRegularExpressionLiteral(ast, context) {
|
|
45021
|
+
return wrapForTypeChecker(ts.factory.createRegularExpressionLiteral(`/${ast.body}/${ast.flags ?? ''}`));
|
|
45022
|
+
}
|
|
44847
45023
|
visitInterpolation(ast) {
|
|
44848
45024
|
// Build up a chain of binary + operations to simulate the string concatenation of the
|
|
44849
45025
|
// interpolation's expressions. The chain is started using an actual string literal to ensure
|
|
@@ -45170,6 +45346,9 @@ class VeSafeLhsInferenceBugDetector {
|
|
|
45170
45346
|
visitParenthesizedExpression(ast, context) {
|
|
45171
45347
|
return ast.expression.visit(this);
|
|
45172
45348
|
}
|
|
45349
|
+
visitRegularExpressionLiteral(ast, context) {
|
|
45350
|
+
return false;
|
|
45351
|
+
}
|
|
45173
45352
|
}
|
|
45174
45353
|
|
|
45175
45354
|
/**
|
|
@@ -47871,11 +48050,17 @@ function getBoundAttributes(directive, node) {
|
|
|
47871
48050
|
});
|
|
47872
48051
|
}
|
|
47873
48052
|
};
|
|
47874
|
-
node.inputs.forEach(processAttribute);
|
|
47875
|
-
node.attributes.forEach(processAttribute);
|
|
47876
48053
|
if (node instanceof Template) {
|
|
48054
|
+
if (node.tagName === 'ng-template') {
|
|
48055
|
+
node.inputs.forEach(processAttribute);
|
|
48056
|
+
node.attributes.forEach(processAttribute);
|
|
48057
|
+
}
|
|
47877
48058
|
node.templateAttrs.forEach(processAttribute);
|
|
47878
48059
|
}
|
|
48060
|
+
else {
|
|
48061
|
+
node.inputs.forEach(processAttribute);
|
|
48062
|
+
node.attributes.forEach(processAttribute);
|
|
48063
|
+
}
|
|
47879
48064
|
return boundInputs;
|
|
47880
48065
|
}
|
|
47881
48066
|
/**
|
|
@@ -50868,6 +51053,7 @@ exports.Directive = Directive$1;
|
|
|
50868
51053
|
exports.DomElementSchemaRegistry = DomElementSchemaRegistry;
|
|
50869
51054
|
exports.DynamicImportExpr = DynamicImportExpr;
|
|
50870
51055
|
exports.DynamicValue = DynamicValue;
|
|
51056
|
+
exports.ERROR_DETAILS_PAGE_BASE_URL = ERROR_DETAILS_PAGE_BASE_URL;
|
|
50871
51057
|
exports.Element = Element;
|
|
50872
51058
|
exports.Element$1 = Element$1;
|
|
50873
51059
|
exports.EnumValue = EnumValue;
|
|
@@ -50887,6 +51073,7 @@ exports.ImportManager = ImportManager;
|
|
|
50887
51073
|
exports.Interpolation = Interpolation$1;
|
|
50888
51074
|
exports.InterpolationConfig = InterpolationConfig;
|
|
50889
51075
|
exports.InvokeFunctionExpr = InvokeFunctionExpr;
|
|
51076
|
+
exports.KeyedRead = KeyedRead;
|
|
50890
51077
|
exports.KnownFn = KnownFn;
|
|
50891
51078
|
exports.LetDeclaration = LetDeclaration$1;
|
|
50892
51079
|
exports.LiteralArrayExpr = LiteralArrayExpr;
|