@angular/compiler 15.0.0-next.4 → 15.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/esm2020/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2020/src/render3/partial/directive.mjs +1 -1
- package/esm2020/src/render3/partial/factory.mjs +1 -1
- package/esm2020/src/render3/partial/injectable.mjs +1 -1
- package/esm2020/src/render3/partial/injector.mjs +1 -1
- package/esm2020/src/render3/partial/ng_module.mjs +1 -1
- package/esm2020/src/render3/partial/pipe.mjs +1 -1
- package/esm2020/src/shadow_css.mjs +291 -12
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +296 -20
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +299 -20
- package/fesm2020/compiler.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
package/esm2020/src/version.mjs
CHANGED
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
* Entry point for all public APIs of the compiler package.
|
|
12
12
|
*/
|
|
13
13
|
import { Version } from './util';
|
|
14
|
-
export const VERSION = new Version('15.0.0-next.
|
|
14
|
+
export const VERSION = new Version('15.0.0-next.5');
|
|
15
15
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVIOzs7O0dBSUc7QUFFSCxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sUUFBUSxDQUFDO0FBRS9CLE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSBjb21waWxlciBwYWNrYWdlLlxuICovXG5cbmltcG9ydCB7VmVyc2lvbn0gZnJvbSAnLi91dGlsJztcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ==
|
package/fesm2015/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0-next.
|
|
2
|
+
* @license Angular v15.0.0-next.5
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7682,7 +7682,26 @@ class BuiltinFunctionCall extends Call {
|
|
|
7682
7682
|
* found in the LICENSE file at https://angular.io/license
|
|
7683
7683
|
*/
|
|
7684
7684
|
/**
|
|
7685
|
-
*
|
|
7685
|
+
* The following set contains all keywords that can be used in the animation css shorthand
|
|
7686
|
+
* property and is used during the scoping of keyframes to make sure such keywords
|
|
7687
|
+
* are not modified.
|
|
7688
|
+
*/
|
|
7689
|
+
const animationKeywords = new Set([
|
|
7690
|
+
// global values
|
|
7691
|
+
'inherit', 'initial', 'revert', 'unset',
|
|
7692
|
+
// animation-direction
|
|
7693
|
+
'alternate', 'alternate-reverse', 'normal', 'reverse',
|
|
7694
|
+
// animation-fill-mode
|
|
7695
|
+
'backwards', 'both', 'forwards', 'none',
|
|
7696
|
+
// animation-play-state
|
|
7697
|
+
'paused', 'running',
|
|
7698
|
+
// animation-timing-function
|
|
7699
|
+
'ease', 'ease-in', 'ease-in-out', 'ease-out', 'linear', 'step-start', 'step-end',
|
|
7700
|
+
// `steps()` function
|
|
7701
|
+
'end', 'jump-both', 'jump-end', 'jump-none', 'jump-start', 'start'
|
|
7702
|
+
]);
|
|
7703
|
+
/**
|
|
7704
|
+
* The following class is a port of shadowCSS from webcomponents.js to TypeScript.
|
|
7686
7705
|
*
|
|
7687
7706
|
* Please make sure to keep to edits in sync with the source file.
|
|
7688
7707
|
*
|
|
@@ -7808,6 +7827,21 @@ class BuiltinFunctionCall extends Call {
|
|
|
7808
7827
|
class ShadowCss {
|
|
7809
7828
|
constructor() {
|
|
7810
7829
|
this.strictStyling = true;
|
|
7830
|
+
/**
|
|
7831
|
+
* Regular expression used to extrapolate the possible keyframes from an
|
|
7832
|
+
* animation declaration (with possibly multiple animation definitions)
|
|
7833
|
+
*
|
|
7834
|
+
* The regular expression can be divided in three parts
|
|
7835
|
+
* - (^|\s+)
|
|
7836
|
+
* simply captures how many (if any) leading whitespaces are present
|
|
7837
|
+
* - (?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))
|
|
7838
|
+
* captures two different possible keyframes, ones which are quoted or ones which are valid css
|
|
7839
|
+
* idents (custom properties excluded)
|
|
7840
|
+
* - (?=[,\s;]|$)
|
|
7841
|
+
* simply matches the end of the possible keyframe, valid endings are: a comma, a space, a
|
|
7842
|
+
* semicolon or the end of the string
|
|
7843
|
+
*/
|
|
7844
|
+
this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
|
|
7811
7845
|
}
|
|
7812
7846
|
/*
|
|
7813
7847
|
* Shim some cssText with the given selector. Returns cssText that can
|
|
@@ -7828,6 +7862,140 @@ class ShadowCss {
|
|
|
7828
7862
|
cssText = this._insertPolyfillDirectivesInCssText(cssText);
|
|
7829
7863
|
return this._insertPolyfillRulesInCssText(cssText);
|
|
7830
7864
|
}
|
|
7865
|
+
/**
|
|
7866
|
+
* Process styles to add scope to keyframes.
|
|
7867
|
+
*
|
|
7868
|
+
* Modify both the names of the keyframes defined in the component styles and also the css
|
|
7869
|
+
* animation rules using them.
|
|
7870
|
+
*
|
|
7871
|
+
* Animation rules using keyframes defined elsewhere are not modified to allow for globally
|
|
7872
|
+
* defined keyframes.
|
|
7873
|
+
*
|
|
7874
|
+
* For example, we convert this css:
|
|
7875
|
+
*
|
|
7876
|
+
* ```
|
|
7877
|
+
* .box {
|
|
7878
|
+
* animation: box-animation 1s forwards;
|
|
7879
|
+
* }
|
|
7880
|
+
*
|
|
7881
|
+
* @keyframes box-animation {
|
|
7882
|
+
* to {
|
|
7883
|
+
* background-color: green;
|
|
7884
|
+
* }
|
|
7885
|
+
* }
|
|
7886
|
+
* ```
|
|
7887
|
+
*
|
|
7888
|
+
* to this:
|
|
7889
|
+
*
|
|
7890
|
+
* ```
|
|
7891
|
+
* .box {
|
|
7892
|
+
* animation: scopeName_box-animation 1s forwards;
|
|
7893
|
+
* }
|
|
7894
|
+
*
|
|
7895
|
+
* @keyframes scopeName_box-animation {
|
|
7896
|
+
* to {
|
|
7897
|
+
* background-color: green;
|
|
7898
|
+
* }
|
|
7899
|
+
* }
|
|
7900
|
+
* ```
|
|
7901
|
+
*
|
|
7902
|
+
* @param cssText the component's css text that needs to be scoped.
|
|
7903
|
+
* @param scopeSelector the component's scope selector.
|
|
7904
|
+
*
|
|
7905
|
+
* @returns the scoped css text.
|
|
7906
|
+
*/
|
|
7907
|
+
_scopeKeyframesRelatedCss(cssText, scopeSelector) {
|
|
7908
|
+
const unscopedKeyframesSet = new Set();
|
|
7909
|
+
const scopedKeyframesCssText = processRules(cssText, rule => this._scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet));
|
|
7910
|
+
return processRules(scopedKeyframesCssText, rule => this._scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet));
|
|
7911
|
+
}
|
|
7912
|
+
/**
|
|
7913
|
+
* Scopes local keyframes names, returning the updated css rule and it also
|
|
7914
|
+
* adds the original keyframe name to a provided set to collect all keyframes names
|
|
7915
|
+
* so that it can later be used to scope the animation rules.
|
|
7916
|
+
*
|
|
7917
|
+
* For example, it takes a rule such as:
|
|
7918
|
+
*
|
|
7919
|
+
* ```
|
|
7920
|
+
* @keyframes box-animation {
|
|
7921
|
+
* to {
|
|
7922
|
+
* background-color: green;
|
|
7923
|
+
* }
|
|
7924
|
+
* }
|
|
7925
|
+
* ```
|
|
7926
|
+
*
|
|
7927
|
+
* and returns:
|
|
7928
|
+
*
|
|
7929
|
+
* ```
|
|
7930
|
+
* @keyframes scopeName_box-animation {
|
|
7931
|
+
* to {
|
|
7932
|
+
* background-color: green;
|
|
7933
|
+
* }
|
|
7934
|
+
* }
|
|
7935
|
+
* ```
|
|
7936
|
+
* and as a side effect it adds "box-animation" to the `unscopedKeyframesSet` set
|
|
7937
|
+
*
|
|
7938
|
+
* @param cssRule the css rule to process.
|
|
7939
|
+
* @param scopeSelector the component's scope selector.
|
|
7940
|
+
* @param unscopedKeyframesSet the set of unscoped keyframes names (which can be
|
|
7941
|
+
* modified as a side effect)
|
|
7942
|
+
*
|
|
7943
|
+
* @returns the css rule modified with the scoped keyframes name.
|
|
7944
|
+
*/
|
|
7945
|
+
_scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet) {
|
|
7946
|
+
return Object.assign(Object.assign({}, rule), { selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => {
|
|
7947
|
+
unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));
|
|
7948
|
+
return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;
|
|
7949
|
+
}) });
|
|
7950
|
+
}
|
|
7951
|
+
/**
|
|
7952
|
+
* Function used to scope a keyframes name (obtained from an animation declaration)
|
|
7953
|
+
* using an existing set of unscopedKeyframes names to discern if the scoping needs to be
|
|
7954
|
+
* performed (keyframes names of keyframes not defined in the component's css need not to be
|
|
7955
|
+
* scoped).
|
|
7956
|
+
*
|
|
7957
|
+
* @param keyframe the keyframes name to check.
|
|
7958
|
+
* @param scopeSelector the component's scope selector.
|
|
7959
|
+
* @param unscopedKeyframesSet the set of unscoped keyframes names.
|
|
7960
|
+
*
|
|
7961
|
+
* @returns the scoped name of the keyframe, or the original name is the name need not to be
|
|
7962
|
+
* scoped.
|
|
7963
|
+
*/
|
|
7964
|
+
_scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet) {
|
|
7965
|
+
return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => {
|
|
7966
|
+
name = `${unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : ''}${name}`;
|
|
7967
|
+
return `${spaces1}${quote}${name}${quote}${spaces2}`;
|
|
7968
|
+
});
|
|
7969
|
+
}
|
|
7970
|
+
/**
|
|
7971
|
+
* Scope an animation rule so that the keyframes mentioned in such rule
|
|
7972
|
+
* are scoped if defined in the component's css and left untouched otherwise.
|
|
7973
|
+
*
|
|
7974
|
+
* It can scope values of both the 'animation' and 'animation-name' properties.
|
|
7975
|
+
*
|
|
7976
|
+
* @param rule css rule to scope.
|
|
7977
|
+
* @param scopeSelector the component's scope selector.
|
|
7978
|
+
* @param unscopedKeyframesSet the set of unscoped keyframes names.
|
|
7979
|
+
*
|
|
7980
|
+
* @returns the updated css rule.
|
|
7981
|
+
**/
|
|
7982
|
+
_scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {
|
|
7983
|
+
let content = rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g, (_, start, animationDeclarations) => start +
|
|
7984
|
+
animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = '', quotedName, nonQuotedName) => {
|
|
7985
|
+
if (quotedName) {
|
|
7986
|
+
return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;
|
|
7987
|
+
}
|
|
7988
|
+
else {
|
|
7989
|
+
return animationKeywords.has(nonQuotedName) ?
|
|
7990
|
+
original :
|
|
7991
|
+
`${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName, scopeSelector, unscopedKeyframesSet)}`;
|
|
7992
|
+
}
|
|
7993
|
+
}));
|
|
7994
|
+
content = content.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes.split(',')
|
|
7995
|
+
.map((keyframe) => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet))
|
|
7996
|
+
.join(',')}`);
|
|
7997
|
+
return Object.assign(Object.assign({}, rule), { content });
|
|
7998
|
+
}
|
|
7831
7999
|
/*
|
|
7832
8000
|
* Process styles to convert native ShadowDOM rules that will trip
|
|
7833
8001
|
* up the css parser; we rely on decorating the stylesheet with inert rules.
|
|
@@ -7886,6 +8054,7 @@ class ShadowCss {
|
|
|
7886
8054
|
cssText = this._convertColonHostContext(cssText);
|
|
7887
8055
|
cssText = this._convertShadowDOMSelectors(cssText);
|
|
7888
8056
|
if (scopeSelector) {
|
|
8057
|
+
cssText = this._scopeKeyframesRelatedCss(cssText, scopeSelector);
|
|
7889
8058
|
cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);
|
|
7890
8059
|
}
|
|
7891
8060
|
cssText = cssText + '\n' + unscopedRules;
|
|
@@ -8258,11 +8427,14 @@ function extractCommentsWithHash(input) {
|
|
|
8258
8427
|
return input.match(_commentWithHashRe) || [];
|
|
8259
8428
|
}
|
|
8260
8429
|
const BLOCK_PLACEHOLDER = '%BLOCK%';
|
|
8261
|
-
const QUOTE_PLACEHOLDER = '%QUOTED%';
|
|
8262
8430
|
const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
|
|
8263
|
-
const _quotedRe = /%QUOTED%/g;
|
|
8264
8431
|
const CONTENT_PAIRS = new Map([['{', '}']]);
|
|
8265
|
-
const
|
|
8432
|
+
const COMMA_IN_PLACEHOLDER = '%COMMA_IN_PLACEHOLDER%';
|
|
8433
|
+
const SEMI_IN_PLACEHOLDER = '%SEMI_IN_PLACEHOLDER%';
|
|
8434
|
+
const COLON_IN_PLACEHOLDER = '%COLON_IN_PLACEHOLDER%';
|
|
8435
|
+
const _cssCommaInPlaceholderReGlobal = new RegExp(COMMA_IN_PLACEHOLDER, 'g');
|
|
8436
|
+
const _cssSemiInPlaceholderReGlobal = new RegExp(SEMI_IN_PLACEHOLDER, 'g');
|
|
8437
|
+
const _cssColonInPlaceholderReGlobal = new RegExp(COLON_IN_PLACEHOLDER, 'g');
|
|
8266
8438
|
class CssRule {
|
|
8267
8439
|
constructor(selector, content) {
|
|
8268
8440
|
this.selector = selector;
|
|
@@ -8270,12 +8442,10 @@ class CssRule {
|
|
|
8270
8442
|
}
|
|
8271
8443
|
}
|
|
8272
8444
|
function processRules(input, ruleCallback) {
|
|
8273
|
-
const
|
|
8274
|
-
const inputWithEscapedBlocks = escapeBlocks(
|
|
8445
|
+
const escaped = escapeInStrings(input);
|
|
8446
|
+
const inputWithEscapedBlocks = escapeBlocks(escaped, CONTENT_PAIRS, BLOCK_PLACEHOLDER);
|
|
8275
8447
|
let nextBlockIndex = 0;
|
|
8276
|
-
|
|
8277
|
-
return inputWithEscapedBlocks.escapedString
|
|
8278
|
-
.replace(_ruleRe, (...m) => {
|
|
8448
|
+
const escapedResult = inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
|
|
8279
8449
|
const selector = m[2];
|
|
8280
8450
|
let content = '';
|
|
8281
8451
|
let suffix = m[4];
|
|
@@ -8287,8 +8457,8 @@ function processRules(input, ruleCallback) {
|
|
|
8287
8457
|
}
|
|
8288
8458
|
const rule = ruleCallback(new CssRule(selector, content));
|
|
8289
8459
|
return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
|
|
8290
|
-
})
|
|
8291
|
-
|
|
8460
|
+
});
|
|
8461
|
+
return unescapeInStrings(escapedResult);
|
|
8292
8462
|
}
|
|
8293
8463
|
class StringWithEscapedBlocks {
|
|
8294
8464
|
constructor(escapedString, blocks) {
|
|
@@ -8339,6 +8509,112 @@ function escapeBlocks(input, charPairs, placeholder) {
|
|
|
8339
8509
|
}
|
|
8340
8510
|
return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);
|
|
8341
8511
|
}
|
|
8512
|
+
/**
|
|
8513
|
+
* Object containing as keys characters that should be substituted by placeholders
|
|
8514
|
+
* when found in strings during the css text parsing, and as values the respective
|
|
8515
|
+
* placeholders
|
|
8516
|
+
*/
|
|
8517
|
+
const ESCAPE_IN_STRING_MAP = {
|
|
8518
|
+
';': SEMI_IN_PLACEHOLDER,
|
|
8519
|
+
',': COMMA_IN_PLACEHOLDER,
|
|
8520
|
+
':': COLON_IN_PLACEHOLDER
|
|
8521
|
+
};
|
|
8522
|
+
/**
|
|
8523
|
+
* Parse the provided css text and inside strings (meaning, inside pairs of unescaped single or
|
|
8524
|
+
* double quotes) replace specific characters with their respective placeholders as indicated
|
|
8525
|
+
* by the `ESCAPE_IN_STRING_MAP` map.
|
|
8526
|
+
*
|
|
8527
|
+
* For example convert the text
|
|
8528
|
+
* `animation: "my-anim:at\"ion" 1s;`
|
|
8529
|
+
* to
|
|
8530
|
+
* `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;`
|
|
8531
|
+
*
|
|
8532
|
+
* This is necessary in order to remove the meaning of some characters when found inside strings
|
|
8533
|
+
* (for example `;` indicates the end of a css declaration, `,` the sequence of values and `:` the
|
|
8534
|
+
* division between property and value during a declaration, none of these meanings apply when such
|
|
8535
|
+
* characters are within strings and so in order to prevent parsing issues they need to be replaced
|
|
8536
|
+
* with placeholder text for the duration of the css manipulation process).
|
|
8537
|
+
*
|
|
8538
|
+
* @param input the original css text.
|
|
8539
|
+
*
|
|
8540
|
+
* @returns the css text with specific characters in strings replaced by placeholders.
|
|
8541
|
+
**/
|
|
8542
|
+
function escapeInStrings(input) {
|
|
8543
|
+
let result = input;
|
|
8544
|
+
let currentQuoteChar = null;
|
|
8545
|
+
for (let i = 0; i < result.length; i++) {
|
|
8546
|
+
const char = result[i];
|
|
8547
|
+
if (char === '\\') {
|
|
8548
|
+
i++;
|
|
8549
|
+
}
|
|
8550
|
+
else {
|
|
8551
|
+
if (currentQuoteChar !== null) {
|
|
8552
|
+
// index i is inside a quoted sub-string
|
|
8553
|
+
if (char === currentQuoteChar) {
|
|
8554
|
+
currentQuoteChar = null;
|
|
8555
|
+
}
|
|
8556
|
+
else {
|
|
8557
|
+
const placeholder = ESCAPE_IN_STRING_MAP[char];
|
|
8558
|
+
if (placeholder) {
|
|
8559
|
+
result = `${result.substr(0, i)}${placeholder}${result.substr(i + 1)}`;
|
|
8560
|
+
i += placeholder.length - 1;
|
|
8561
|
+
}
|
|
8562
|
+
}
|
|
8563
|
+
}
|
|
8564
|
+
else if (char === '\'' || char === '"') {
|
|
8565
|
+
currentQuoteChar = char;
|
|
8566
|
+
}
|
|
8567
|
+
}
|
|
8568
|
+
}
|
|
8569
|
+
return result;
|
|
8570
|
+
}
|
|
8571
|
+
/**
|
|
8572
|
+
* Replace in a string all occurrences of keys in the `ESCAPE_IN_STRING_MAP` map with their
|
|
8573
|
+
* original representation, this is simply used to revert the changes applied by the
|
|
8574
|
+
* escapeInStrings function.
|
|
8575
|
+
*
|
|
8576
|
+
* For example it reverts the text:
|
|
8577
|
+
* `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;`
|
|
8578
|
+
* to it's original form of:
|
|
8579
|
+
* `animation: "my-anim:at\"ion" 1s;`
|
|
8580
|
+
*
|
|
8581
|
+
* Note: For the sake of simplicity this function does not check that the placeholders are
|
|
8582
|
+
* actually inside strings as it would anyway be extremely unlikely to find them outside of strings.
|
|
8583
|
+
*
|
|
8584
|
+
* @param input the css text containing the placeholders.
|
|
8585
|
+
*
|
|
8586
|
+
* @returns the css text without the placeholders.
|
|
8587
|
+
*/
|
|
8588
|
+
function unescapeInStrings(input) {
|
|
8589
|
+
let result = input.replace(_cssCommaInPlaceholderReGlobal, ',');
|
|
8590
|
+
result = result.replace(_cssSemiInPlaceholderReGlobal, ';');
|
|
8591
|
+
result = result.replace(_cssColonInPlaceholderReGlobal, ':');
|
|
8592
|
+
return result;
|
|
8593
|
+
}
|
|
8594
|
+
/**
|
|
8595
|
+
* Unescape all quotes present in a string, but only if the string was actually already
|
|
8596
|
+
* quoted.
|
|
8597
|
+
*
|
|
8598
|
+
* This generates a "canonical" representation of strings which can be used to match strings
|
|
8599
|
+
* which would otherwise only differ because of differently escaped quotes.
|
|
8600
|
+
*
|
|
8601
|
+
* For example it converts the string (assumed to be quoted):
|
|
8602
|
+
* `this \\"is\\" a \\'\\\\'test`
|
|
8603
|
+
* to:
|
|
8604
|
+
* `this "is" a '\\\\'test`
|
|
8605
|
+
* (note that the latter backslashes are not removed as they are not actually escaping the single
|
|
8606
|
+
* quote)
|
|
8607
|
+
*
|
|
8608
|
+
*
|
|
8609
|
+
* @param input the string possibly containing escaped quotes.
|
|
8610
|
+
* @param isQuoted boolean indicating whether the string was quoted inside a bigger string (if not
|
|
8611
|
+
* then it means that it doesn't represent an inner string and thus no unescaping is required)
|
|
8612
|
+
*
|
|
8613
|
+
* @returns the string in the "canonical" representation without escaped quotes.
|
|
8614
|
+
*/
|
|
8615
|
+
function unescapeQuotes(str, isQuoted) {
|
|
8616
|
+
return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, '$1');
|
|
8617
|
+
}
|
|
8342
8618
|
/**
|
|
8343
8619
|
* Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors`
|
|
8344
8620
|
* to create a selector that matches the same as `:host-context()`.
|
|
@@ -19969,7 +20245,7 @@ function publishFacade(global) {
|
|
|
19969
20245
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19970
20246
|
* found in the LICENSE file at https://angular.io/license
|
|
19971
20247
|
*/
|
|
19972
|
-
const VERSION = new Version('15.0.0-next.
|
|
20248
|
+
const VERSION = new Version('15.0.0-next.5');
|
|
19973
20249
|
|
|
19974
20250
|
/**
|
|
19975
20251
|
* @license
|
|
@@ -21995,7 +22271,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
21995
22271
|
function compileDeclareClassMetadata(metadata) {
|
|
21996
22272
|
const definitionMap = new DefinitionMap();
|
|
21997
22273
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
21998
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22274
|
+
definitionMap.set('version', literal('15.0.0-next.5'));
|
|
21999
22275
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22000
22276
|
definitionMap.set('type', metadata.type);
|
|
22001
22277
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -22113,7 +22389,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
22113
22389
|
var _a;
|
|
22114
22390
|
const definitionMap = new DefinitionMap();
|
|
22115
22391
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
22116
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22392
|
+
definitionMap.set('version', literal('15.0.0-next.5'));
|
|
22117
22393
|
// e.g. `type: MyDirective`
|
|
22118
22394
|
definitionMap.set('type', meta.internalType);
|
|
22119
22395
|
if (meta.isStandalone) {
|
|
@@ -22352,7 +22628,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22352
22628
|
function compileDeclareFactoryFunction(meta) {
|
|
22353
22629
|
const definitionMap = new DefinitionMap();
|
|
22354
22630
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22355
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22631
|
+
definitionMap.set('version', literal('15.0.0-next.5'));
|
|
22356
22632
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22357
22633
|
definitionMap.set('type', meta.internalType);
|
|
22358
22634
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -22394,7 +22670,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22394
22670
|
function createInjectableDefinitionMap(meta) {
|
|
22395
22671
|
const definitionMap = new DefinitionMap();
|
|
22396
22672
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22397
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22673
|
+
definitionMap.set('version', literal('15.0.0-next.5'));
|
|
22398
22674
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22399
22675
|
definitionMap.set('type', meta.internalType);
|
|
22400
22676
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -22452,7 +22728,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22452
22728
|
function createInjectorDefinitionMap(meta) {
|
|
22453
22729
|
const definitionMap = new DefinitionMap();
|
|
22454
22730
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22455
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22731
|
+
definitionMap.set('version', literal('15.0.0-next.5'));
|
|
22456
22732
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22457
22733
|
definitionMap.set('type', meta.internalType);
|
|
22458
22734
|
definitionMap.set('providers', meta.providers);
|
|
@@ -22489,7 +22765,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22489
22765
|
function createNgModuleDefinitionMap(meta) {
|
|
22490
22766
|
const definitionMap = new DefinitionMap();
|
|
22491
22767
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22492
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22768
|
+
definitionMap.set('version', literal('15.0.0-next.5'));
|
|
22493
22769
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22494
22770
|
definitionMap.set('type', meta.internalType);
|
|
22495
22771
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -22547,7 +22823,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22547
22823
|
function createPipeDefinitionMap(meta) {
|
|
22548
22824
|
const definitionMap = new DefinitionMap();
|
|
22549
22825
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22550
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22826
|
+
definitionMap.set('version', literal('15.0.0-next.5'));
|
|
22551
22827
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22552
22828
|
// e.g. `type: MyPipe`
|
|
22553
22829
|
definitionMap.set('type', meta.internalType);
|