@angular/compiler 14.0.0-next.14 → 14.0.0-next.15

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.
Files changed (124) hide show
  1. package/esm2020/src/compiler.mjs +3 -2
  2. package/esm2020/src/jit_compiler_facade.mjs +9 -13
  3. package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
  4. package/esm2020/src/render3/partial/directive.mjs +1 -1
  5. package/esm2020/src/render3/partial/factory.mjs +1 -1
  6. package/esm2020/src/render3/partial/injectable.mjs +1 -1
  7. package/esm2020/src/render3/partial/injector.mjs +1 -1
  8. package/esm2020/src/render3/partial/ng_module.mjs +1 -1
  9. package/esm2020/src/render3/partial/pipe.mjs +1 -1
  10. package/esm2020/src/shadow_css.mjs +291 -12
  11. package/esm2020/src/util.mjs +8 -8
  12. package/esm2020/src/version.mjs +1 -1
  13. package/fesm2015/compiler.mjs +311 -39
  14. package/fesm2015/compiler.mjs.map +1 -1
  15. package/fesm2015/testing.mjs +1 -1
  16. package/fesm2020/compiler.mjs +314 -39
  17. package/fesm2020/compiler.mjs.map +1 -1
  18. package/fesm2020/testing.mjs +1 -1
  19. package/index.d.ts +4964 -5
  20. package/package.json +3 -3
  21. package/testing/index.d.ts +22 -5
  22. package/compiler.d.ts +0 -8
  23. package/public_api.d.ts +0 -13
  24. package/src/assertions.d.ts +0 -8
  25. package/src/chars.d.ts +0 -75
  26. package/src/compiler.d.ts +0 -77
  27. package/src/compiler_facade_interface.d.ts +0 -299
  28. package/src/compiler_util/expression_converter.d.ts +0 -71
  29. package/src/config.d.ts +0 -25
  30. package/src/constant_pool.d.ts +0 -37
  31. package/src/core.d.ts +0 -216
  32. package/src/expression_parser/ast.d.ts +0 -440
  33. package/src/expression_parser/lexer.d.ts +0 -47
  34. package/src/expression_parser/parser.d.ts +0 -315
  35. package/src/i18n/big_integer.d.ts +0 -108
  36. package/src/i18n/digest.d.ts +0 -44
  37. package/src/i18n/extractor_merger.d.ts +0 -27
  38. package/src/i18n/i18n_ast.d.ts +0 -148
  39. package/src/i18n/i18n_html_parser.d.ts +0 -19
  40. package/src/i18n/i18n_parser.d.ts +0 -18
  41. package/src/i18n/index.d.ts +0 -15
  42. package/src/i18n/message_bundle.d.ts +0 -28
  43. package/src/i18n/parse_util.d.ts +0 -14
  44. package/src/i18n/serializers/placeholder.d.ts +0 -25
  45. package/src/i18n/serializers/serializer.d.ts +0 -46
  46. package/src/i18n/serializers/xliff.d.ts +0 -19
  47. package/src/i18n/serializers/xliff2.d.ts +0 -19
  48. package/src/i18n/serializers/xmb.d.ts +0 -22
  49. package/src/i18n/serializers/xml_helper.d.ts +0 -52
  50. package/src/i18n/serializers/xtb.d.ts +0 -20
  51. package/src/i18n/translation_bundle.d.ts +0 -27
  52. package/src/injectable_compiler_2.d.ts +0 -24
  53. package/src/jit_compiler_facade.d.ts +0 -46
  54. package/src/ml_parser/ast.d.ts +0 -89
  55. package/src/ml_parser/entities.d.ts +0 -9
  56. package/src/ml_parser/html_parser.d.ts +0 -13
  57. package/src/ml_parser/html_tags.d.ts +0 -33
  58. package/src/ml_parser/html_whitespaces.d.ts +0 -45
  59. package/src/ml_parser/icu_ast_expander.d.ts +0 -42
  60. package/src/ml_parser/interpolation_config.d.ts +0 -14
  61. package/src/ml_parser/lexer.d.ts +0 -114
  62. package/src/ml_parser/parser.d.ts +0 -26
  63. package/src/ml_parser/tags.d.ts +0 -29
  64. package/src/ml_parser/tokens.d.ts +0 -141
  65. package/src/ml_parser/xml_parser.d.ts +0 -13
  66. package/src/ml_parser/xml_tags.d.ts +0 -24
  67. package/src/output/abstract_emitter.d.ts +0 -66
  68. package/src/output/abstract_js_emitter.d.ts +0 -19
  69. package/src/output/map_util.d.ts +0 -18
  70. package/src/output/output_ast.d.ts +0 -575
  71. package/src/output/output_jit.d.ts +0 -73
  72. package/src/output/output_jit_trusted_types.d.ts +0 -43
  73. package/src/output/source_map.d.ts +0 -29
  74. package/src/parse_util.d.ts +0 -75
  75. package/src/render3/partial/api.d.ts +0 -463
  76. package/src/render3/partial/class_metadata.d.ts +0 -10
  77. package/src/render3/partial/component.d.ts +0 -39
  78. package/src/render3/partial/directive.d.ts +0 -13
  79. package/src/render3/partial/factory.d.ts +0 -3
  80. package/src/render3/partial/injectable.d.ts +0 -19
  81. package/src/render3/partial/injector.d.ts +0 -3
  82. package/src/render3/partial/ng_module.d.ts +0 -3
  83. package/src/render3/partial/pipe.d.ts +0 -12
  84. package/src/render3/partial/util.d.ts +0 -33
  85. package/src/render3/r3_ast.d.ts +0 -211
  86. package/src/render3/r3_class_metadata_compiler.d.ts +0 -35
  87. package/src/render3/r3_factory.d.ts +0 -94
  88. package/src/render3/r3_identifiers.d.ts +0 -183
  89. package/src/render3/r3_injector_compiler.d.ts +0 -18
  90. package/src/render3/r3_jit.d.ts +0 -22
  91. package/src/render3/r3_module_compiler.d.ts +0 -103
  92. package/src/render3/r3_pipe_compiler.d.ts +0 -50
  93. package/src/render3/r3_template_transform.d.ts +0 -24
  94. package/src/render3/util.d.ts +0 -94
  95. package/src/render3/view/api.d.ts +0 -342
  96. package/src/render3/view/compiler.d.ts +0 -86
  97. package/src/render3/view/i18n/context.d.ts +0 -68
  98. package/src/render3/view/i18n/get_msg_utils.d.ts +0 -47
  99. package/src/render3/view/i18n/icu_serializer.d.ts +0 -9
  100. package/src/render3/view/i18n/localize_utils.d.ts +0 -24
  101. package/src/render3/view/i18n/meta.d.ts +0 -78
  102. package/src/render3/view/i18n/util.d.ts +0 -78
  103. package/src/render3/view/style_parser.d.ts +0 -18
  104. package/src/render3/view/styling_builder.d.ts +0 -211
  105. package/src/render3/view/t2_api.d.ts +0 -152
  106. package/src/render3/view/t2_binder.d.ts +0 -57
  107. package/src/render3/view/template.d.ts +0 -450
  108. package/src/render3/view/util.d.ts +0 -94
  109. package/src/resource_loader.d.ts +0 -17
  110. package/src/schema/dom_element_schema_registry.d.ts +0 -45
  111. package/src/schema/dom_security_schema.d.ts +0 -11
  112. package/src/schema/element_schema_registry.d.ts +0 -29
  113. package/src/schema/trusted_types_sinks.d.ts +0 -15
  114. package/src/selector.d.ts +0 -105
  115. package/src/shadow_css.d.ts +0 -76
  116. package/src/style_url_resolver.d.ts +0 -8
  117. package/src/template_parser/binding_parser.d.ts +0 -91
  118. package/src/template_parser/template_preparser.d.ts +0 -24
  119. package/src/util.d.ts +0 -42
  120. package/src/version.d.ts +0 -14
  121. package/testing/package.json +0 -9
  122. package/testing/public_api.d.ts +0 -13
  123. package/testing/src/testing.d.ts +0 -23
  124. package/testing/testing.d.ts +0 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.14
2
+ * @license Angular v14.0.0-next.15
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.14
2
+ * @license Angular v14.0.0-next.15
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -756,13 +756,13 @@ class Version {
756
756
  this.patch = splits.slice(2).join('.');
757
757
  }
758
758
  }
759
- const __window = typeof window !== 'undefined' && window;
760
- const __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
761
- self instanceof WorkerGlobalScope && self;
762
- const __global = typeof global !== 'undefined' && global;
763
- // Check __global first, because in Node tests both __global and __window may be defined and _global
764
- // should be __global in that case.
765
- const _global = __global || __window || __self;
759
+ // Check `global` first, because in Node tests both `global` and `window` may be defined and our
760
+ // `_global` variable should point to the NodeJS `global` in that case. Note: Typeof/Instanceof
761
+ // checks are considered side-effects in Terser. We explicitly mark this as side-effect free:
762
+ // https://github.com/terser/terser/issues/250.
763
+ const _global = ( /* @__PURE__ */(() => (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||
764
+ (typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
765
+ self instanceof WorkerGlobalScope && self))());
766
766
  function newArray(size, value) {
767
767
  const list = [];
768
768
  for (let i = 0; i < size; i++) {
@@ -7687,7 +7687,26 @@ class BuiltinFunctionCall extends Call {
7687
7687
  * found in the LICENSE file at https://angular.io/license
7688
7688
  */
7689
7689
  /**
7690
- * This file is a port of shadowCSS from webcomponents.js to TypeScript.
7690
+ * The following set contains all keywords that can be used in the animation css shorthand
7691
+ * property and is used during the scoping of keyframes to make sure such keywords
7692
+ * are not modified.
7693
+ */
7694
+ const animationKeywords = new Set([
7695
+ // global values
7696
+ 'inherit', 'initial', 'revert', 'unset',
7697
+ // animation-direction
7698
+ 'alternate', 'alternate-reverse', 'normal', 'reverse',
7699
+ // animation-fill-mode
7700
+ 'backwards', 'both', 'forwards', 'none',
7701
+ // animation-play-state
7702
+ 'paused', 'running',
7703
+ // animation-timing-function
7704
+ 'ease', 'ease-in', 'ease-in-out', 'ease-out', 'linear', 'step-start', 'step-end',
7705
+ // `steps()` function
7706
+ 'end', 'jump-both', 'jump-end', 'jump-none', 'jump-start', 'start'
7707
+ ]);
7708
+ /**
7709
+ * The following class is a port of shadowCSS from webcomponents.js to TypeScript.
7691
7710
  *
7692
7711
  * Please make sure to keep to edits in sync with the source file.
7693
7712
  *
@@ -7813,6 +7832,21 @@ class BuiltinFunctionCall extends Call {
7813
7832
  class ShadowCss {
7814
7833
  constructor() {
7815
7834
  this.strictStyling = true;
7835
+ /**
7836
+ * Regular expression used to extrapolate the possible keyframes from an
7837
+ * animation declaration (with possibly multiple animation definitions)
7838
+ *
7839
+ * The regular expression can be divided in three parts
7840
+ * - (^|\s+)
7841
+ * simply captures how many (if any) leading whitespaces are present
7842
+ * - (?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))
7843
+ * captures two different possible keyframes, ones which are quoted or ones which are valid css
7844
+ * idents (custom properties excluded)
7845
+ * - (?=[,\s;]|$)
7846
+ * simply matches the end of the possible keyframe, valid endings are: a comma, a space, a
7847
+ * semicolon or the end of the string
7848
+ */
7849
+ this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
7816
7850
  }
7817
7851
  /*
7818
7852
  * Shim some cssText with the given selector. Returns cssText that can
@@ -7833,6 +7867,143 @@ class ShadowCss {
7833
7867
  cssText = this._insertPolyfillDirectivesInCssText(cssText);
7834
7868
  return this._insertPolyfillRulesInCssText(cssText);
7835
7869
  }
7870
+ /**
7871
+ * Process styles to add scope to keyframes.
7872
+ *
7873
+ * Modify both the names of the keyframes defined in the component styles and also the css
7874
+ * animation rules using them.
7875
+ *
7876
+ * Animation rules using keyframes defined elsewhere are not modified to allow for globally
7877
+ * defined keyframes.
7878
+ *
7879
+ * For example, we convert this css:
7880
+ *
7881
+ * ```
7882
+ * .box {
7883
+ * animation: box-animation 1s forwards;
7884
+ * }
7885
+ *
7886
+ * @keyframes box-animation {
7887
+ * to {
7888
+ * background-color: green;
7889
+ * }
7890
+ * }
7891
+ * ```
7892
+ *
7893
+ * to this:
7894
+ *
7895
+ * ```
7896
+ * .box {
7897
+ * animation: scopeName_box-animation 1s forwards;
7898
+ * }
7899
+ *
7900
+ * @keyframes scopeName_box-animation {
7901
+ * to {
7902
+ * background-color: green;
7903
+ * }
7904
+ * }
7905
+ * ```
7906
+ *
7907
+ * @param cssText the component's css text that needs to be scoped.
7908
+ * @param scopeSelector the component's scope selector.
7909
+ *
7910
+ * @returns the scoped css text.
7911
+ */
7912
+ _scopeKeyframesRelatedCss(cssText, scopeSelector) {
7913
+ const unscopedKeyframesSet = new Set();
7914
+ const scopedKeyframesCssText = processRules(cssText, rule => this._scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet));
7915
+ return processRules(scopedKeyframesCssText, rule => this._scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet));
7916
+ }
7917
+ /**
7918
+ * Scopes local keyframes names, returning the updated css rule and it also
7919
+ * adds the original keyframe name to a provided set to collect all keyframes names
7920
+ * so that it can later be used to scope the animation rules.
7921
+ *
7922
+ * For example, it takes a rule such as:
7923
+ *
7924
+ * ```
7925
+ * @keyframes box-animation {
7926
+ * to {
7927
+ * background-color: green;
7928
+ * }
7929
+ * }
7930
+ * ```
7931
+ *
7932
+ * and returns:
7933
+ *
7934
+ * ```
7935
+ * @keyframes scopeName_box-animation {
7936
+ * to {
7937
+ * background-color: green;
7938
+ * }
7939
+ * }
7940
+ * ```
7941
+ * and as a side effect it adds "box-animation" to the `unscopedKeyframesSet` set
7942
+ *
7943
+ * @param cssRule the css rule to process.
7944
+ * @param scopeSelector the component's scope selector.
7945
+ * @param unscopedKeyframesSet the set of unscoped keyframes names (which can be
7946
+ * modified as a side effect)
7947
+ *
7948
+ * @returns the css rule modified with the scoped keyframes name.
7949
+ */
7950
+ _scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet) {
7951
+ return {
7952
+ ...rule,
7953
+ selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => {
7954
+ unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));
7955
+ return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;
7956
+ }),
7957
+ };
7958
+ }
7959
+ /**
7960
+ * Function used to scope a keyframes name (obtained from an animation declaration)
7961
+ * using an existing set of unscopedKeyframes names to discern if the scoping needs to be
7962
+ * performed (keyframes names of keyframes not defined in the component's css need not to be
7963
+ * scoped).
7964
+ *
7965
+ * @param keyframe the keyframes name to check.
7966
+ * @param scopeSelector the component's scope selector.
7967
+ * @param unscopedKeyframesSet the set of unscoped keyframes names.
7968
+ *
7969
+ * @returns the scoped name of the keyframe, or the original name is the name need not to be
7970
+ * scoped.
7971
+ */
7972
+ _scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet) {
7973
+ return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => {
7974
+ name = `${unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : ''}${name}`;
7975
+ return `${spaces1}${quote}${name}${quote}${spaces2}`;
7976
+ });
7977
+ }
7978
+ /**
7979
+ * Scope an animation rule so that the keyframes mentioned in such rule
7980
+ * are scoped if defined in the component's css and left untouched otherwise.
7981
+ *
7982
+ * It can scope values of both the 'animation' and 'animation-name' properties.
7983
+ *
7984
+ * @param rule css rule to scope.
7985
+ * @param scopeSelector the component's scope selector.
7986
+ * @param unscopedKeyframesSet the set of unscoped keyframes names.
7987
+ *
7988
+ * @returns the updated css rule.
7989
+ **/
7990
+ _scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {
7991
+ let content = rule.content.replace(/((?:^|\s+)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g, (_, start, animationDeclarations) => start +
7992
+ animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = '', quotedName, nonQuotedName) => {
7993
+ if (quotedName) {
7994
+ return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;
7995
+ }
7996
+ else {
7997
+ return animationKeywords.has(nonQuotedName) ?
7998
+ original :
7999
+ `${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName, scopeSelector, unscopedKeyframesSet)}`;
8000
+ }
8001
+ }));
8002
+ content = content.replace(/((?:^|\s+)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes.split(',')
8003
+ .map((keyframe) => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet))
8004
+ .join(',')}`);
8005
+ return { ...rule, content };
8006
+ }
7836
8007
  /*
7837
8008
  * Process styles to convert native ShadowDOM rules that will trip
7838
8009
  * up the css parser; we rely on decorating the stylesheet with inert rules.
@@ -7891,6 +8062,7 @@ class ShadowCss {
7891
8062
  cssText = this._convertColonHostContext(cssText);
7892
8063
  cssText = this._convertShadowDOMSelectors(cssText);
7893
8064
  if (scopeSelector) {
8065
+ cssText = this._scopeKeyframesRelatedCss(cssText, scopeSelector);
7894
8066
  cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);
7895
8067
  }
7896
8068
  cssText = cssText + '\n' + unscopedRules;
@@ -8262,11 +8434,14 @@ function extractCommentsWithHash(input) {
8262
8434
  return input.match(_commentWithHashRe) || [];
8263
8435
  }
8264
8436
  const BLOCK_PLACEHOLDER = '%BLOCK%';
8265
- const QUOTE_PLACEHOLDER = '%QUOTED%';
8266
8437
  const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
8267
- const _quotedRe = /%QUOTED%/g;
8268
8438
  const CONTENT_PAIRS = new Map([['{', '}']]);
8269
- const QUOTE_PAIRS = new Map([[`"`, `"`], [`'`, `'`]]);
8439
+ const COMMA_IN_PLACEHOLDER = '%COMMA_IN_PLACEHOLDER%';
8440
+ const SEMI_IN_PLACEHOLDER = '%SEMI_IN_PLACEHOLDER%';
8441
+ const COLON_IN_PLACEHOLDER = '%COLON_IN_PLACEHOLDER%';
8442
+ const _cssCommaInPlaceholderReGlobal = new RegExp(COMMA_IN_PLACEHOLDER, 'g');
8443
+ const _cssSemiInPlaceholderReGlobal = new RegExp(SEMI_IN_PLACEHOLDER, 'g');
8444
+ const _cssColonInPlaceholderReGlobal = new RegExp(COLON_IN_PLACEHOLDER, 'g');
8270
8445
  class CssRule {
8271
8446
  constructor(selector, content) {
8272
8447
  this.selector = selector;
@@ -8274,12 +8449,10 @@ class CssRule {
8274
8449
  }
8275
8450
  }
8276
8451
  function processRules(input, ruleCallback) {
8277
- const inputWithEscapedQuotes = escapeBlocks(input, QUOTE_PAIRS, QUOTE_PLACEHOLDER);
8278
- const inputWithEscapedBlocks = escapeBlocks(inputWithEscapedQuotes.escapedString, CONTENT_PAIRS, BLOCK_PLACEHOLDER);
8452
+ const escaped = escapeInStrings(input);
8453
+ const inputWithEscapedBlocks = escapeBlocks(escaped, CONTENT_PAIRS, BLOCK_PLACEHOLDER);
8279
8454
  let nextBlockIndex = 0;
8280
- let nextQuoteIndex = 0;
8281
- return inputWithEscapedBlocks.escapedString
8282
- .replace(_ruleRe, (...m) => {
8455
+ const escapedResult = inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
8283
8456
  const selector = m[2];
8284
8457
  let content = '';
8285
8458
  let suffix = m[4];
@@ -8291,8 +8464,8 @@ function processRules(input, ruleCallback) {
8291
8464
  }
8292
8465
  const rule = ruleCallback(new CssRule(selector, content));
8293
8466
  return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
8294
- })
8295
- .replace(_quotedRe, () => inputWithEscapedQuotes.blocks[nextQuoteIndex++]);
8467
+ });
8468
+ return unescapeInStrings(escapedResult);
8296
8469
  }
8297
8470
  class StringWithEscapedBlocks {
8298
8471
  constructor(escapedString, blocks) {
@@ -8343,6 +8516,112 @@ function escapeBlocks(input, charPairs, placeholder) {
8343
8516
  }
8344
8517
  return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);
8345
8518
  }
8519
+ /**
8520
+ * Object containing as keys characters that should be substituted by placeholders
8521
+ * when found in strings during the css text parsing, and as values the respective
8522
+ * placeholders
8523
+ */
8524
+ const ESCAPE_IN_STRING_MAP = {
8525
+ ';': SEMI_IN_PLACEHOLDER,
8526
+ ',': COMMA_IN_PLACEHOLDER,
8527
+ ':': COLON_IN_PLACEHOLDER
8528
+ };
8529
+ /**
8530
+ * Parse the provided css text and inside strings (meaning, inside pairs of unescaped single or
8531
+ * double quotes) replace specific characters with their respective placeholders as indicated
8532
+ * by the `ESCAPE_IN_STRING_MAP` map.
8533
+ *
8534
+ * For example convert the text
8535
+ * `animation: "my-anim:at\"ion" 1s;`
8536
+ * to
8537
+ * `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;`
8538
+ *
8539
+ * This is necessary in order to remove the meaning of some characters when found inside strings
8540
+ * (for example `;` indicates the end of a css declaration, `,` the sequence of values and `:` the
8541
+ * division between property and value during a declaration, none of these meanings apply when such
8542
+ * characters are within strings and so in order to prevent parsing issues they need to be replaced
8543
+ * with placeholder text for the duration of the css manipulation process).
8544
+ *
8545
+ * @param input the original css text.
8546
+ *
8547
+ * @returns the css text with specific characters in strings replaced by placeholders.
8548
+ **/
8549
+ function escapeInStrings(input) {
8550
+ let result = input;
8551
+ let currentQuoteChar = null;
8552
+ for (let i = 0; i < result.length; i++) {
8553
+ const char = result[i];
8554
+ if (char === '\\') {
8555
+ i++;
8556
+ }
8557
+ else {
8558
+ if (currentQuoteChar !== null) {
8559
+ // index i is inside a quoted sub-string
8560
+ if (char === currentQuoteChar) {
8561
+ currentQuoteChar = null;
8562
+ }
8563
+ else {
8564
+ const placeholder = ESCAPE_IN_STRING_MAP[char];
8565
+ if (placeholder) {
8566
+ result = `${result.substr(0, i)}${placeholder}${result.substr(i + 1)}`;
8567
+ i += placeholder.length - 1;
8568
+ }
8569
+ }
8570
+ }
8571
+ else if (char === '\'' || char === '"') {
8572
+ currentQuoteChar = char;
8573
+ }
8574
+ }
8575
+ }
8576
+ return result;
8577
+ }
8578
+ /**
8579
+ * Replace in a string all occurrences of keys in the `ESCAPE_IN_STRING_MAP` map with their
8580
+ * original representation, this is simply used to revert the changes applied by the
8581
+ * escapeInStrings function.
8582
+ *
8583
+ * For example it reverts the text:
8584
+ * `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;`
8585
+ * to it's original form of:
8586
+ * `animation: "my-anim:at\"ion" 1s;`
8587
+ *
8588
+ * Note: For the sake of simplicity this function does not check that the placeholders are
8589
+ * actually inside strings as it would anyway be extremely unlikely to find them outside of strings.
8590
+ *
8591
+ * @param input the css text containing the placeholders.
8592
+ *
8593
+ * @returns the css text without the placeholders.
8594
+ */
8595
+ function unescapeInStrings(input) {
8596
+ let result = input.replace(_cssCommaInPlaceholderReGlobal, ',');
8597
+ result = result.replace(_cssSemiInPlaceholderReGlobal, ';');
8598
+ result = result.replace(_cssColonInPlaceholderReGlobal, ':');
8599
+ return result;
8600
+ }
8601
+ /**
8602
+ * Unescape all quotes present in a string, but only if the string was actually already
8603
+ * quoted.
8604
+ *
8605
+ * This generates a "canonical" representation of strings which can be used to match strings
8606
+ * which would otherwise only differ because of differently escaped quotes.
8607
+ *
8608
+ * For example it converts the string (assumed to be quoted):
8609
+ * `this \\"is\\" a \\'\\\\'test`
8610
+ * to:
8611
+ * `this "is" a '\\\\'test`
8612
+ * (note that the latter backslashes are not removed as they are not actually escaping the single
8613
+ * quote)
8614
+ *
8615
+ *
8616
+ * @param input the string possibly containing escaped quotes.
8617
+ * @param isQuoted boolean indicating whether the string was quoted inside a bigger string (if not
8618
+ * then it means that it doesn't represent an inner string and thus no unescaping is required)
8619
+ *
8620
+ * @returns the string in the "canonical" representation without escaped quotes.
8621
+ */
8622
+ function unescapeQuotes(str, isQuoted) {
8623
+ return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, '$1');
8624
+ }
8346
8625
  /**
8347
8626
  * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors`
8348
8627
  * to create a selector that matches the same as `:host-context()`.
@@ -19397,10 +19676,10 @@ class CompilerFacadeImpl {
19397
19676
  internalType: new WrappedNodeExpr(facade.type),
19398
19677
  typeArgumentCount: facade.typeArgumentCount,
19399
19678
  providedIn: computeProvidedIn(facade.providedIn),
19400
- useClass: convertToProviderExpression(facade, USE_CLASS),
19401
- useFactory: wrapExpression(facade, USE_FACTORY),
19402
- useValue: convertToProviderExpression(facade, USE_VALUE),
19403
- useExisting: convertToProviderExpression(facade, USE_EXISTING),
19679
+ useClass: convertToProviderExpression(facade, 'useClass'),
19680
+ useFactory: wrapExpression(facade, 'useFactory'),
19681
+ useValue: convertToProviderExpression(facade, 'useValue'),
19682
+ useExisting: convertToProviderExpression(facade, 'useExisting'),
19404
19683
  deps: facade.deps?.map(convertR3DependencyMetadata),
19405
19684
  },
19406
19685
  /* resolveForwardRefs */ true);
@@ -19413,10 +19692,10 @@ class CompilerFacadeImpl {
19413
19692
  internalType: new WrappedNodeExpr(facade.type),
19414
19693
  typeArgumentCount: 0,
19415
19694
  providedIn: computeProvidedIn(facade.providedIn),
19416
- useClass: convertToProviderExpression(facade, USE_CLASS),
19417
- useFactory: wrapExpression(facade, USE_FACTORY),
19418
- useValue: convertToProviderExpression(facade, USE_VALUE),
19419
- useExisting: convertToProviderExpression(facade, USE_EXISTING),
19695
+ useClass: convertToProviderExpression(facade, 'useClass'),
19696
+ useFactory: wrapExpression(facade, 'useFactory'),
19697
+ useValue: convertToProviderExpression(facade, 'useValue'),
19698
+ useExisting: convertToProviderExpression(facade, 'useExisting'),
19420
19699
  deps: facade.deps?.map(convertR3DeclareDependencyMetadata),
19421
19700
  },
19422
19701
  /* resolveForwardRefs */ true);
@@ -19556,10 +19835,6 @@ class CompilerFacadeImpl {
19556
19835
  return res['$def'];
19557
19836
  }
19558
19837
  }
19559
- const USE_CLASS = Object.keys({ useClass: null })[0];
19560
- const USE_FACTORY = Object.keys({ useFactory: null })[0];
19561
- const USE_VALUE = Object.keys({ useValue: null })[0];
19562
- const USE_EXISTING = Object.keys({ useExisting: null })[0];
19563
19838
  function convertToR3QueryMetadata(facade) {
19564
19839
  return {
19565
19840
  ...facade,
@@ -19885,7 +20160,7 @@ function publishFacade(global) {
19885
20160
  * Use of this source code is governed by an MIT-style license that can be
19886
20161
  * found in the LICENSE file at https://angular.io/license
19887
20162
  */
19888
- const VERSION = new Version('14.0.0-next.14');
20163
+ const VERSION = new Version('14.0.0-next.15');
19889
20164
 
19890
20165
  /**
19891
20166
  * @license
@@ -21918,7 +22193,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21918
22193
  function compileDeclareClassMetadata(metadata) {
21919
22194
  const definitionMap = new DefinitionMap();
21920
22195
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21921
- definitionMap.set('version', literal('14.0.0-next.14'));
22196
+ definitionMap.set('version', literal('14.0.0-next.15'));
21922
22197
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21923
22198
  definitionMap.set('type', metadata.type);
21924
22199
  definitionMap.set('decorators', metadata.decorators);
@@ -22035,7 +22310,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
22035
22310
  function createDirectiveDefinitionMap(meta) {
22036
22311
  const definitionMap = new DefinitionMap();
22037
22312
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
22038
- definitionMap.set('version', literal('14.0.0-next.14'));
22313
+ definitionMap.set('version', literal('14.0.0-next.15'));
22039
22314
  // e.g. `type: MyDirective`
22040
22315
  definitionMap.set('type', meta.internalType);
22041
22316
  if (meta.isStandalone) {
@@ -22249,7 +22524,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22249
22524
  function compileDeclareFactoryFunction(meta) {
22250
22525
  const definitionMap = new DefinitionMap();
22251
22526
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22252
- definitionMap.set('version', literal('14.0.0-next.14'));
22527
+ definitionMap.set('version', literal('14.0.0-next.15'));
22253
22528
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22254
22529
  definitionMap.set('type', meta.internalType);
22255
22530
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22291,7 +22566,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22291
22566
  function createInjectableDefinitionMap(meta) {
22292
22567
  const definitionMap = new DefinitionMap();
22293
22568
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22294
- definitionMap.set('version', literal('14.0.0-next.14'));
22569
+ definitionMap.set('version', literal('14.0.0-next.15'));
22295
22570
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22296
22571
  definitionMap.set('type', meta.internalType);
22297
22572
  // Only generate providedIn property if it has a non-null value
@@ -22349,7 +22624,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22349
22624
  function createInjectorDefinitionMap(meta) {
22350
22625
  const definitionMap = new DefinitionMap();
22351
22626
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22352
- definitionMap.set('version', literal('14.0.0-next.14'));
22627
+ definitionMap.set('version', literal('14.0.0-next.15'));
22353
22628
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22354
22629
  definitionMap.set('type', meta.internalType);
22355
22630
  definitionMap.set('providers', meta.providers);
@@ -22386,7 +22661,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22386
22661
  function createNgModuleDefinitionMap(meta) {
22387
22662
  const definitionMap = new DefinitionMap();
22388
22663
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22389
- definitionMap.set('version', literal('14.0.0-next.14'));
22664
+ definitionMap.set('version', literal('14.0.0-next.15'));
22390
22665
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22391
22666
  definitionMap.set('type', meta.internalType);
22392
22667
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22444,7 +22719,7 @@ function compileDeclarePipeFromMetadata(meta) {
22444
22719
  function createPipeDefinitionMap(meta) {
22445
22720
  const definitionMap = new DefinitionMap();
22446
22721
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22447
- definitionMap.set('version', literal('14.0.0-next.14'));
22722
+ definitionMap.set('version', literal('14.0.0-next.15'));
22448
22723
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22449
22724
  // e.g. `type: MyPipe`
22450
22725
  definitionMap.set('type', meta.internalType);