@angular-eslint/bundled-angular-compiler 14.3.1-alpha.0 → 15.0.0-alpha.0

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 (2) hide show
  1. package/dist/index.js +567 -118
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.2.11
2
+ * @license Angular v15.0.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2922,6 +2922,7 @@ Identifiers.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', m
2922
2922
  Identifiers.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE };
2923
2923
  Identifiers.StandaloneFeature = { name: 'ɵɵStandaloneFeature', moduleName: CORE };
2924
2924
  Identifiers.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };
2925
+ Identifiers.HostDirectivesFeature = { name: 'ɵɵHostDirectivesFeature', moduleName: CORE };
2925
2926
  Identifiers.listener = { name: 'ɵɵlistener', moduleName: CORE };
2926
2927
  Identifiers.getInheritedFactory = {
2927
2928
  name: 'ɵɵgetInheritedFactory',
@@ -2936,6 +2937,7 @@ Identifiers.sanitizeUrl = { name: 'ɵɵsanitizeUrl', moduleName: CORE };
2936
2937
  Identifiers.sanitizeUrlOrResourceUrl = { name: 'ɵɵsanitizeUrlOrResourceUrl', moduleName: CORE };
2937
2938
  Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE };
2938
2939
  Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };
2940
+ Identifiers.validateIframeAttribute = { name: 'ɵɵvalidateIframeAttribute', moduleName: CORE };
2939
2941
 
2940
2942
  /**
2941
2943
  * @license
@@ -7588,8 +7590,119 @@ class BuiltinFunctionCall extends Call {
7588
7590
  * Use of this source code is governed by an MIT-style license that can be
7589
7591
  * found in the LICENSE file at https://angular.io/license
7590
7592
  */
7593
+ // =================================================================================================
7594
+ // =================================================================================================
7595
+ // =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
7596
+ // =================================================================================================
7597
+ // =================================================================================================
7598
+ //
7599
+ // DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!
7600
+ // Reach out to mprobst for details.
7601
+ //
7602
+ // =================================================================================================
7603
+ /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
7604
+ let _SECURITY_SCHEMA;
7605
+ function SECURITY_SCHEMA() {
7606
+ if (!_SECURITY_SCHEMA) {
7607
+ _SECURITY_SCHEMA = {};
7608
+ // Case is insignificant below, all element and attribute names are lower-cased for lookup.
7609
+ registerContext(SecurityContext.HTML, [
7610
+ 'iframe|srcdoc',
7611
+ '*|innerHTML',
7612
+ '*|outerHTML',
7613
+ ]);
7614
+ registerContext(SecurityContext.STYLE, ['*|style']);
7615
+ // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
7616
+ registerContext(SecurityContext.URL, [
7617
+ '*|formAction',
7618
+ 'area|href',
7619
+ 'area|ping',
7620
+ 'audio|src',
7621
+ 'a|href',
7622
+ 'a|ping',
7623
+ 'blockquote|cite',
7624
+ 'body|background',
7625
+ 'del|cite',
7626
+ 'form|action',
7627
+ 'img|src',
7628
+ 'input|src',
7629
+ 'ins|cite',
7630
+ 'q|cite',
7631
+ 'source|src',
7632
+ 'track|src',
7633
+ 'video|poster',
7634
+ 'video|src',
7635
+ ]);
7636
+ registerContext(SecurityContext.RESOURCE_URL, [
7637
+ 'applet|code',
7638
+ 'applet|codebase',
7639
+ 'base|href',
7640
+ 'embed|src',
7641
+ 'frame|src',
7642
+ 'head|profile',
7643
+ 'html|manifest',
7644
+ 'iframe|src',
7645
+ 'link|href',
7646
+ 'media|src',
7647
+ 'object|codebase',
7648
+ 'object|data',
7649
+ 'script|src',
7650
+ ]);
7651
+ }
7652
+ return _SECURITY_SCHEMA;
7653
+ }
7654
+ function registerContext(ctx, specs) {
7655
+ for (const spec of specs)
7656
+ _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
7657
+ }
7591
7658
  /**
7592
- * This file is a port of shadowCSS from webcomponents.js to TypeScript.
7659
+ * The set of security-sensitive attributes of an `<iframe>` that *must* be
7660
+ * applied as a static attribute only. This ensures that all security-sensitive
7661
+ * attributes are taken into account while creating an instance of an `<iframe>`
7662
+ * at runtime.
7663
+ *
7664
+ * Note: avoid using this set directly, use the `isIframeSecuritySensitiveAttr` function
7665
+ * in the code instead.
7666
+ */
7667
+ const IFRAME_SECURITY_SENSITIVE_ATTRS = new Set(['sandbox', 'allow', 'allowfullscreen', 'referrerpolicy', 'csp', 'fetchpriority']);
7668
+ /**
7669
+ * Checks whether a given attribute name might represent a security-sensitive
7670
+ * attribute of an <iframe>.
7671
+ */
7672
+ function isIframeSecuritySensitiveAttr(attrName) {
7673
+ // The `setAttribute` DOM API is case-insensitive, so we lowercase the value
7674
+ // before checking it against a known security-sensitive attributes.
7675
+ return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
7676
+ }
7677
+
7678
+ /**
7679
+ * @license
7680
+ * Copyright Google LLC All Rights Reserved.
7681
+ *
7682
+ * Use of this source code is governed by an MIT-style license that can be
7683
+ * found in the LICENSE file at https://angular.io/license
7684
+ */
7685
+ /**
7686
+ * The following set contains all keywords that can be used in the animation css shorthand
7687
+ * property and is used during the scoping of keyframes to make sure such keywords
7688
+ * are not modified.
7689
+ */
7690
+ const animationKeywords = new Set([
7691
+ // global values
7692
+ 'inherit', 'initial', 'revert', 'unset',
7693
+ // animation-direction
7694
+ 'alternate', 'alternate-reverse', 'normal', 'reverse',
7695
+ // animation-fill-mode
7696
+ 'backwards', 'both', 'forwards', 'none',
7697
+ // animation-play-state
7698
+ 'paused', 'running',
7699
+ // animation-timing-function
7700
+ 'ease', 'ease-in', 'ease-in-out', 'ease-out', 'linear', 'step-start', 'step-end',
7701
+ // `steps()` function
7702
+ 'end', 'jump-both', 'jump-end', 'jump-none', 'jump-start', 'start'
7703
+ ]);
7704
+ /**
7705
+ * The following class is a port of shadowCSS from webcomponents.js to TypeScript.
7593
7706
  *
7594
7707
  * Please make sure to keep to edits in sync with the source file.
7595
7708
  *
@@ -7715,6 +7828,21 @@ class BuiltinFunctionCall extends Call {
7715
7828
  class ShadowCss {
7716
7829
  constructor() {
7717
7830
  this.strictStyling = true;
7831
+ /**
7832
+ * Regular expression used to extrapolate the possible keyframes from an
7833
+ * animation declaration (with possibly multiple animation definitions)
7834
+ *
7835
+ * The regular expression can be divided in three parts
7836
+ * - (^|\s+)
7837
+ * simply captures how many (if any) leading whitespaces are present
7838
+ * - (?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))
7839
+ * captures two different possible keyframes, ones which are quoted or ones which are valid css
7840
+ * idents (custom properties excluded)
7841
+ * - (?=[,\s;]|$)
7842
+ * simply matches the end of the possible keyframe, valid endings are: a comma, a space, a
7843
+ * semicolon or the end of the string
7844
+ */
7845
+ this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
7718
7846
  }
7719
7847
  /*
7720
7848
  * Shim some cssText with the given selector. Returns cssText that can
@@ -7735,6 +7863,140 @@ class ShadowCss {
7735
7863
  cssText = this._insertPolyfillDirectivesInCssText(cssText);
7736
7864
  return this._insertPolyfillRulesInCssText(cssText);
7737
7865
  }
7866
+ /**
7867
+ * Process styles to add scope to keyframes.
7868
+ *
7869
+ * Modify both the names of the keyframes defined in the component styles and also the css
7870
+ * animation rules using them.
7871
+ *
7872
+ * Animation rules using keyframes defined elsewhere are not modified to allow for globally
7873
+ * defined keyframes.
7874
+ *
7875
+ * For example, we convert this css:
7876
+ *
7877
+ * ```
7878
+ * .box {
7879
+ * animation: box-animation 1s forwards;
7880
+ * }
7881
+ *
7882
+ * @keyframes box-animation {
7883
+ * to {
7884
+ * background-color: green;
7885
+ * }
7886
+ * }
7887
+ * ```
7888
+ *
7889
+ * to this:
7890
+ *
7891
+ * ```
7892
+ * .box {
7893
+ * animation: scopeName_box-animation 1s forwards;
7894
+ * }
7895
+ *
7896
+ * @keyframes scopeName_box-animation {
7897
+ * to {
7898
+ * background-color: green;
7899
+ * }
7900
+ * }
7901
+ * ```
7902
+ *
7903
+ * @param cssText the component's css text that needs to be scoped.
7904
+ * @param scopeSelector the component's scope selector.
7905
+ *
7906
+ * @returns the scoped css text.
7907
+ */
7908
+ _scopeKeyframesRelatedCss(cssText, scopeSelector) {
7909
+ const unscopedKeyframesSet = new Set();
7910
+ const scopedKeyframesCssText = processRules(cssText, rule => this._scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet));
7911
+ return processRules(scopedKeyframesCssText, rule => this._scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet));
7912
+ }
7913
+ /**
7914
+ * Scopes local keyframes names, returning the updated css rule and it also
7915
+ * adds the original keyframe name to a provided set to collect all keyframes names
7916
+ * so that it can later be used to scope the animation rules.
7917
+ *
7918
+ * For example, it takes a rule such as:
7919
+ *
7920
+ * ```
7921
+ * @keyframes box-animation {
7922
+ * to {
7923
+ * background-color: green;
7924
+ * }
7925
+ * }
7926
+ * ```
7927
+ *
7928
+ * and returns:
7929
+ *
7930
+ * ```
7931
+ * @keyframes scopeName_box-animation {
7932
+ * to {
7933
+ * background-color: green;
7934
+ * }
7935
+ * }
7936
+ * ```
7937
+ * and as a side effect it adds "box-animation" to the `unscopedKeyframesSet` set
7938
+ *
7939
+ * @param cssRule the css rule to process.
7940
+ * @param scopeSelector the component's scope selector.
7941
+ * @param unscopedKeyframesSet the set of unscoped keyframes names (which can be
7942
+ * modified as a side effect)
7943
+ *
7944
+ * @returns the css rule modified with the scoped keyframes name.
7945
+ */
7946
+ _scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet) {
7947
+ return Object.assign(Object.assign({}, rule), { selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => {
7948
+ unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));
7949
+ return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;
7950
+ }) });
7951
+ }
7952
+ /**
7953
+ * Function used to scope a keyframes name (obtained from an animation declaration)
7954
+ * using an existing set of unscopedKeyframes names to discern if the scoping needs to be
7955
+ * performed (keyframes names of keyframes not defined in the component's css need not to be
7956
+ * scoped).
7957
+ *
7958
+ * @param keyframe the keyframes name to check.
7959
+ * @param scopeSelector the component's scope selector.
7960
+ * @param unscopedKeyframesSet the set of unscoped keyframes names.
7961
+ *
7962
+ * @returns the scoped name of the keyframe, or the original name is the name need not to be
7963
+ * scoped.
7964
+ */
7965
+ _scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet) {
7966
+ return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => {
7967
+ name = `${unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : ''}${name}`;
7968
+ return `${spaces1}${quote}${name}${quote}${spaces2}`;
7969
+ });
7970
+ }
7971
+ /**
7972
+ * Scope an animation rule so that the keyframes mentioned in such rule
7973
+ * are scoped if defined in the component's css and left untouched otherwise.
7974
+ *
7975
+ * It can scope values of both the 'animation' and 'animation-name' properties.
7976
+ *
7977
+ * @param rule css rule to scope.
7978
+ * @param scopeSelector the component's scope selector.
7979
+ * @param unscopedKeyframesSet the set of unscoped keyframes names.
7980
+ *
7981
+ * @returns the updated css rule.
7982
+ **/
7983
+ _scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {
7984
+ let content = rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation(?:\s*):(?:\s*))([^;]+)/g, (_, start, animationDeclarations) => start +
7985
+ animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = '', quotedName, nonQuotedName) => {
7986
+ if (quotedName) {
7987
+ return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`;
7988
+ }
7989
+ else {
7990
+ return animationKeywords.has(nonQuotedName) ?
7991
+ original :
7992
+ `${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName, scopeSelector, unscopedKeyframesSet)}`;
7993
+ }
7994
+ }));
7995
+ content = content.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes.split(',')
7996
+ .map((keyframe) => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet))
7997
+ .join(',')}`);
7998
+ return Object.assign(Object.assign({}, rule), { content });
7999
+ }
7738
8000
  /*
7739
8001
  * Process styles to convert native ShadowDOM rules that will trip
7740
8002
  * up the css parser; we rely on decorating the stylesheet with inert rules.
@@ -7793,6 +8055,7 @@ class ShadowCss {
7793
8055
  cssText = this._convertColonHostContext(cssText);
7794
8056
  cssText = this._convertShadowDOMSelectors(cssText);
7795
8057
  if (scopeSelector) {
8058
+ cssText = this._scopeKeyframesRelatedCss(cssText, scopeSelector);
7796
8059
  cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector);
7797
8060
  }
7798
8061
  cssText = cssText + '\n' + unscopedRules;
@@ -8165,11 +8428,14 @@ function extractCommentsWithHash(input) {
8165
8428
  return input.match(_commentWithHashRe) || [];
8166
8429
  }
8167
8430
  const BLOCK_PLACEHOLDER = '%BLOCK%';
8168
- const QUOTE_PLACEHOLDER = '%QUOTED%';
8169
8431
  const _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
8170
- const _quotedRe = /%QUOTED%/g;
8171
8432
  const CONTENT_PAIRS = new Map([['{', '}']]);
8172
- const QUOTE_PAIRS = new Map([[`"`, `"`], [`'`, `'`]]);
8433
+ const COMMA_IN_PLACEHOLDER = '%COMMA_IN_PLACEHOLDER%';
8434
+ const SEMI_IN_PLACEHOLDER = '%SEMI_IN_PLACEHOLDER%';
8435
+ const COLON_IN_PLACEHOLDER = '%COLON_IN_PLACEHOLDER%';
8436
+ const _cssCommaInPlaceholderReGlobal = new RegExp(COMMA_IN_PLACEHOLDER, 'g');
8437
+ const _cssSemiInPlaceholderReGlobal = new RegExp(SEMI_IN_PLACEHOLDER, 'g');
8438
+ const _cssColonInPlaceholderReGlobal = new RegExp(COLON_IN_PLACEHOLDER, 'g');
8173
8439
  class CssRule {
8174
8440
  constructor(selector, content) {
8175
8441
  this.selector = selector;
@@ -8177,12 +8443,10 @@ class CssRule {
8177
8443
  }
8178
8444
  }
8179
8445
  function processRules(input, ruleCallback) {
8180
- const inputWithEscapedQuotes = escapeBlocks(input, QUOTE_PAIRS, QUOTE_PLACEHOLDER);
8181
- const inputWithEscapedBlocks = escapeBlocks(inputWithEscapedQuotes.escapedString, CONTENT_PAIRS, BLOCK_PLACEHOLDER);
8446
+ const escaped = escapeInStrings(input);
8447
+ const inputWithEscapedBlocks = escapeBlocks(escaped, CONTENT_PAIRS, BLOCK_PLACEHOLDER);
8182
8448
  let nextBlockIndex = 0;
8183
- let nextQuoteIndex = 0;
8184
- return inputWithEscapedBlocks.escapedString
8185
- .replace(_ruleRe, (...m) => {
8449
+ const escapedResult = inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
8186
8450
  const selector = m[2];
8187
8451
  let content = '';
8188
8452
  let suffix = m[4];
@@ -8194,8 +8458,8 @@ function processRules(input, ruleCallback) {
8194
8458
  }
8195
8459
  const rule = ruleCallback(new CssRule(selector, content));
8196
8460
  return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
8197
- })
8198
- .replace(_quotedRe, () => inputWithEscapedQuotes.blocks[nextQuoteIndex++]);
8461
+ });
8462
+ return unescapeInStrings(escapedResult);
8199
8463
  }
8200
8464
  class StringWithEscapedBlocks {
8201
8465
  constructor(escapedString, blocks) {
@@ -8246,6 +8510,112 @@ function escapeBlocks(input, charPairs, placeholder) {
8246
8510
  }
8247
8511
  return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks);
8248
8512
  }
8513
+ /**
8514
+ * Object containing as keys characters that should be substituted by placeholders
8515
+ * when found in strings during the css text parsing, and as values the respective
8516
+ * placeholders
8517
+ */
8518
+ const ESCAPE_IN_STRING_MAP = {
8519
+ ';': SEMI_IN_PLACEHOLDER,
8520
+ ',': COMMA_IN_PLACEHOLDER,
8521
+ ':': COLON_IN_PLACEHOLDER
8522
+ };
8523
+ /**
8524
+ * Parse the provided css text and inside strings (meaning, inside pairs of unescaped single or
8525
+ * double quotes) replace specific characters with their respective placeholders as indicated
8526
+ * by the `ESCAPE_IN_STRING_MAP` map.
8527
+ *
8528
+ * For example convert the text
8529
+ * `animation: "my-anim:at\"ion" 1s;`
8530
+ * to
8531
+ * `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;`
8532
+ *
8533
+ * This is necessary in order to remove the meaning of some characters when found inside strings
8534
+ * (for example `;` indicates the end of a css declaration, `,` the sequence of values and `:` the
8535
+ * division between property and value during a declaration, none of these meanings apply when such
8536
+ * characters are within strings and so in order to prevent parsing issues they need to be replaced
8537
+ * with placeholder text for the duration of the css manipulation process).
8538
+ *
8539
+ * @param input the original css text.
8540
+ *
8541
+ * @returns the css text with specific characters in strings replaced by placeholders.
8542
+ **/
8543
+ function escapeInStrings(input) {
8544
+ let result = input;
8545
+ let currentQuoteChar = null;
8546
+ for (let i = 0; i < result.length; i++) {
8547
+ const char = result[i];
8548
+ if (char === '\\') {
8549
+ i++;
8550
+ }
8551
+ else {
8552
+ if (currentQuoteChar !== null) {
8553
+ // index i is inside a quoted sub-string
8554
+ if (char === currentQuoteChar) {
8555
+ currentQuoteChar = null;
8556
+ }
8557
+ else {
8558
+ const placeholder = ESCAPE_IN_STRING_MAP[char];
8559
+ if (placeholder) {
8560
+ result = `${result.substr(0, i)}${placeholder}${result.substr(i + 1)}`;
8561
+ i += placeholder.length - 1;
8562
+ }
8563
+ }
8564
+ }
8565
+ else if (char === '\'' || char === '"') {
8566
+ currentQuoteChar = char;
8567
+ }
8568
+ }
8569
+ }
8570
+ return result;
8571
+ }
8572
+ /**
8573
+ * Replace in a string all occurrences of keys in the `ESCAPE_IN_STRING_MAP` map with their
8574
+ * original representation, this is simply used to revert the changes applied by the
8575
+ * escapeInStrings function.
8576
+ *
8577
+ * For example it reverts the text:
8578
+ * `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;`
8579
+ * to it's original form of:
8580
+ * `animation: "my-anim:at\"ion" 1s;`
8581
+ *
8582
+ * Note: For the sake of simplicity this function does not check that the placeholders are
8583
+ * actually inside strings as it would anyway be extremely unlikely to find them outside of strings.
8584
+ *
8585
+ * @param input the css text containing the placeholders.
8586
+ *
8587
+ * @returns the css text without the placeholders.
8588
+ */
8589
+ function unescapeInStrings(input) {
8590
+ let result = input.replace(_cssCommaInPlaceholderReGlobal, ',');
8591
+ result = result.replace(_cssSemiInPlaceholderReGlobal, ';');
8592
+ result = result.replace(_cssColonInPlaceholderReGlobal, ':');
8593
+ return result;
8594
+ }
8595
+ /**
8596
+ * Unescape all quotes present in a string, but only if the string was actually already
8597
+ * quoted.
8598
+ *
8599
+ * This generates a "canonical" representation of strings which can be used to match strings
8600
+ * which would otherwise only differ because of differently escaped quotes.
8601
+ *
8602
+ * For example it converts the string (assumed to be quoted):
8603
+ * `this \\"is\\" a \\'\\\\'test`
8604
+ * to:
8605
+ * `this "is" a '\\\\'test`
8606
+ * (note that the latter backslashes are not removed as they are not actually escaping the single
8607
+ * quote)
8608
+ *
8609
+ *
8610
+ * @param input the string possibly containing escaped quotes.
8611
+ * @param isQuoted boolean indicating whether the string was quoted inside a bigger string (if not
8612
+ * then it means that it doesn't represent an inner string and thus no unescaping is required)
8613
+ *
8614
+ * @returns the string in the "canonical" representation without escaped quotes.
8615
+ */
8616
+ function unescapeQuotes(str, isQuoted) {
8617
+ return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, '$1');
8618
+ }
8249
8619
  /**
8250
8620
  * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors`
8251
8621
  * to create a selector that matches the same as `:host-context()`.
@@ -14386,70 +14756,7 @@ function mapLiteral(obj, quoted = false) {
14386
14756
  * Use of this source code is governed by an MIT-style license that can be
14387
14757
  * found in the LICENSE file at https://angular.io/license
14388
14758
  */
14389
- // =================================================================================================
14390
- // =================================================================================================
14391
- // =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P ===========
14392
- // =================================================================================================
14393
- // =================================================================================================
14394
- //
14395
- // DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW!
14396
- // Reach out to mprobst for details.
14397
- //
14398
- // =================================================================================================
14399
- /** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */
14400
- let _SECURITY_SCHEMA;
14401
- function SECURITY_SCHEMA() {
14402
- if (!_SECURITY_SCHEMA) {
14403
- _SECURITY_SCHEMA = {};
14404
- // Case is insignificant below, all element and attribute names are lower-cased for lookup.
14405
- registerContext(SecurityContext.HTML, [
14406
- 'iframe|srcdoc',
14407
- '*|innerHTML',
14408
- '*|outerHTML',
14409
- ]);
14410
- registerContext(SecurityContext.STYLE, ['*|style']);
14411
- // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
14412
- registerContext(SecurityContext.URL, [
14413
- '*|formAction',
14414
- 'area|href',
14415
- 'area|ping',
14416
- 'audio|src',
14417
- 'a|href',
14418
- 'a|ping',
14419
- 'blockquote|cite',
14420
- 'body|background',
14421
- 'del|cite',
14422
- 'form|action',
14423
- 'img|src',
14424
- 'input|src',
14425
- 'ins|cite',
14426
- 'q|cite',
14427
- 'source|src',
14428
- 'track|src',
14429
- 'video|poster',
14430
- 'video|src',
14431
- ]);
14432
- registerContext(SecurityContext.RESOURCE_URL, [
14433
- 'applet|code',
14434
- 'applet|codebase',
14435
- 'base|href',
14436
- 'embed|src',
14437
- 'frame|src',
14438
- 'head|profile',
14439
- 'html|manifest',
14440
- 'iframe|src',
14441
- 'link|href',
14442
- 'media|src',
14443
- 'object|codebase',
14444
- 'object|data',
14445
- 'script|src',
14446
- ]);
14447
- }
14448
- return _SECURITY_SCHEMA;
14449
- }
14450
- function registerContext(ctx, specs) {
14451
- for (const spec of specs)
14452
- _SECURITY_SCHEMA[spec.toLowerCase()] = ctx;
14759
+ class ElementSchemaRegistry {
14453
14760
  }
14454
14761
 
14455
14762
  /**
@@ -14459,8 +14766,6 @@ function registerContext(ctx, specs) {
14459
14766
  * Use of this source code is governed by an MIT-style license that can be
14460
14767
  * found in the LICENSE file at https://angular.io/license
14461
14768
  */
14462
- class ElementSchemaRegistry {
14463
- }
14464
14769
  const BOOLEAN = 'boolean';
14465
14770
  const NUMBER = 'number';
14466
14771
  const STRING = 'string';
@@ -14520,13 +14825,13 @@ const OBJECT = 'object';
14520
14825
  //
14521
14826
  // =================================================================================================
14522
14827
  const SCHEMA = [
14523
- '[Element]|textContent,%classList,className,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*copy,*cut,*paste,*search,*selectstart,*webkitfullscreenchange,*webkitfullscreenerror,*wheel,outerHTML,#scrollLeft,#scrollTop,slot' +
14828
+ '[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' +
14524
14829
  /* added manually to avoid breaking changes */
14525
14830
  ',*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored',
14526
- '[HTMLElement]^[Element]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',
14527
- 'abbr,address,article,aside,b,bdi,bdo,cite,code,dd,dfn,dt,em,figcaption,figure,footer,header,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,contentEditable,dir,!draggable,!hidden,innerText,lang,*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,outerText,!spellcheck,%style,#tabIndex,title,!translate',
14528
- 'media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,src,%srcObject,#volume',
14529
- ':svg:^[HTMLElement]|*abort,*auxclick,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*cuechange,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*seeked,*seeking,*select,*show,*stalled,*submit,*suspend,*timeupdate,*toggle,*volumechange,*waiting,%style,#tabIndex',
14831
+ '[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,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',
14832
+ 'abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,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',
14833
+ 'media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume',
14834
+ ':svg:^[HTMLElement]|!autofocus,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,%style,#tabIndex',
14530
14835
  ':svg:graphics^:svg:|',
14531
14836
  ':svg:animation^:svg:|*begin,*end,*repeat',
14532
14837
  ':svg:geometry^:svg:|',
@@ -14534,16 +14839,17 @@ const SCHEMA = [
14534
14839
  ':svg:gradient^:svg:|',
14535
14840
  ':svg:textContent^:svg:graphics|',
14536
14841
  ':svg:textPositioning^:svg:textContent|',
14537
- 'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,rev,search,shape,target,text,type,username',
14538
- 'area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,search,shape,target,username',
14842
+ 'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username',
14843
+ 'area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username',
14539
14844
  'audio^media|',
14540
14845
  'br^[HTMLElement]|clear',
14541
14846
  'base^[HTMLElement]|href,target',
14542
- 'body^[HTMLElement]|aLink,background,bgColor,link,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',
14543
- 'button^[HTMLElement]|!autofocus,!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
14847
+ 'body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink',
14848
+ 'button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value',
14544
14849
  'canvas^[HTMLElement]|#height,#width',
14545
14850
  'content^[HTMLElement]|select',
14546
14851
  'dl^[HTMLElement]|!compact',
14852
+ 'data^[HTMLElement]|value',
14547
14853
  'datalist^[HTMLElement]|',
14548
14854
  'details^[HTMLElement]|!open',
14549
14855
  'dialog^[HTMLElement]|!open,returnValue',
@@ -14554,22 +14860,22 @@ const SCHEMA = [
14554
14860
  'font^[HTMLElement]|color,face,size',
14555
14861
  'form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target',
14556
14862
  'frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src',
14557
- 'frameset^[HTMLElement]|cols,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',
14863
+ 'frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows',
14558
14864
  'hr^[HTMLElement]|align,color,!noShade,size,width',
14559
14865
  'head^[HTMLElement]|',
14560
14866
  'h1,h2,h3,h4,h5,h6^[HTMLElement]|align',
14561
14867
  'html^[HTMLElement]|version',
14562
- 'iframe^[HTMLElement]|align,!allowFullscreen,frameBorder,height,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width',
14563
- 'img^[HTMLElement]|align,alt,border,%crossOrigin,#height,#hspace,!isMap,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width',
14564
- 'input^[HTMLElement]|accept,align,alt,autocapitalize,autocomplete,!autofocus,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',
14868
+ 'iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width',
14869
+ 'img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width',
14870
+ 'input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width',
14565
14871
  'li^[HTMLElement]|type,#value',
14566
14872
  'label^[HTMLElement]|htmlFor',
14567
14873
  'legend^[HTMLElement]|align',
14568
- 'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type',
14874
+ 'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type',
14569
14875
  'map^[HTMLElement]|name',
14570
14876
  'marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width',
14571
14877
  'menu^[HTMLElement]|!compact',
14572
- 'meta^[HTMLElement]|content,httpEquiv,name,scheme',
14878
+ 'meta^[HTMLElement]|content,httpEquiv,media,name,scheme',
14573
14879
  'meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value',
14574
14880
  'ins,del^[HTMLElement]|cite,dateTime',
14575
14881
  'ol^[HTMLElement]|!compact,!reversed,#start,type',
@@ -14583,11 +14889,10 @@ const SCHEMA = [
14583
14889
  'pre^[HTMLElement]|#width',
14584
14890
  'progress^[HTMLElement]|#max,#value',
14585
14891
  'q,blockquote,cite^[HTMLElement]|',
14586
- 'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,src,text,type',
14587
- 'select^[HTMLElement]|autocomplete,!autofocus,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
14588
- 'shadow^[HTMLElement]|',
14892
+ 'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type',
14893
+ 'select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value',
14589
14894
  'slot^[HTMLElement]|name',
14590
- 'source^[HTMLElement]|media,sizes,src,srcset,type',
14895
+ 'source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width',
14591
14896
  'span^[HTMLElement]|',
14592
14897
  'style^[HTMLElement]|!disabled,media,type',
14593
14898
  'caption^[HTMLElement]|align',
@@ -14597,12 +14902,13 @@ const SCHEMA = [
14597
14902
  'tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign',
14598
14903
  'tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign',
14599
14904
  'template^[HTMLElement]|',
14600
- 'textarea^[HTMLElement]|autocapitalize,autocomplete,!autofocus,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
14905
+ 'textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap',
14906
+ 'time^[HTMLElement]|dateTime',
14601
14907
  'title^[HTMLElement]|text',
14602
14908
  'track^[HTMLElement]|!default,kind,label,src,srclang',
14603
14909
  'ul^[HTMLElement]|!compact,type',
14604
14910
  'unknown^[HTMLElement]|',
14605
- 'video^media|#height,poster,#width',
14911
+ 'video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width',
14606
14912
  ':svg:a^:svg:graphics|',
14607
14913
  ':svg:animate^:svg:animation|',
14608
14914
  ':svg:animateMotion^:svg:animation|',
@@ -14641,7 +14947,7 @@ const SCHEMA = [
14641
14947
  ':svg:filter^:svg:|',
14642
14948
  ':svg:foreignObject^:svg:graphics|',
14643
14949
  ':svg:g^:svg:graphics|',
14644
- ':svg:image^:svg:graphics|',
14950
+ ':svg:image^:svg:graphics|decoding',
14645
14951
  ':svg:line^:svg:geometry|',
14646
14952
  ':svg:linearGradient^:svg:gradient|',
14647
14953
  ':svg:mpath^:svg:|',
@@ -17499,9 +17805,19 @@ class TemplateDefinitionBuilder {
17499
17805
  const params = [];
17500
17806
  const [attrNamespace, attrName] = splitNsName(input.name);
17501
17807
  const isAttributeBinding = inputType === 1 /* BindingType.Attribute */;
17502
- const sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
17503
- if (sanitizationRef)
17808
+ let sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
17809
+ if (!sanitizationRef) {
17810
+ // If there was no sanitization function found based on the security context
17811
+ // of an attribute/property - check whether this attribute/property is
17812
+ // one of the security-sensitive <iframe> attributes (and that the current
17813
+ // element is actually an <iframe>).
17814
+ if (isIframeElement(element.name) && isIframeSecuritySensitiveAttr(input.name)) {
17815
+ sanitizationRef = importExpr(Identifiers.validateIframeAttribute);
17816
+ }
17817
+ }
17818
+ if (sanitizationRef) {
17504
17819
  params.push(sanitizationRef);
17820
+ }
17505
17821
  if (attrNamespace) {
17506
17822
  const namespaceLiteral = literal(attrNamespace);
17507
17823
  if (sanitizationRef) {
@@ -18567,6 +18883,9 @@ function isSingleElementTemplate(children) {
18567
18883
  function isTextNode(node) {
18568
18884
  return node instanceof Text$3 || node instanceof BoundText || node instanceof Icu$1;
18569
18885
  }
18886
+ function isIframeElement(tagName) {
18887
+ return tagName.toLowerCase() === 'iframe';
18888
+ }
18570
18889
  function hasTextChildrenOnly(children) {
18571
18890
  return children.every(isTextNode);
18572
18891
  }
@@ -18689,6 +19008,7 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
18689
19008
  * Add features to the definition map.
18690
19009
  */
18691
19010
  function addFeatures(definitionMap, meta) {
19011
+ var _a;
18692
19012
  // e.g. `features: [NgOnChangesFeature]`
18693
19013
  const features = [];
18694
19014
  const providers = meta.providers;
@@ -18713,6 +19033,9 @@ function addFeatures(definitionMap, meta) {
18713
19033
  if (meta.hasOwnProperty('template') && meta.isStandalone) {
18714
19034
  features.push(importExpr(Identifiers.StandaloneFeature));
18715
19035
  }
19036
+ if ((_a = meta.hostDirectives) === null || _a === void 0 ? void 0 : _a.length) {
19037
+ features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
19038
+ }
18716
19039
  if (features.length) {
18717
19040
  definitionMap.set('features', literalArr(features));
18718
19041
  }
@@ -18825,6 +19148,7 @@ function createComponentType(meta) {
18825
19148
  const typeParams = createBaseDirectiveTypeParams(meta);
18826
19149
  typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));
18827
19150
  typeParams.push(expressionType(literal(meta.isStandalone)));
19151
+ typeParams.push(createHostDirectivesType(meta));
18828
19152
  return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams));
18829
19153
  }
18830
19154
  /**
@@ -18900,7 +19224,7 @@ function createContentQueriesFunction(queries, constantPool, name) {
18900
19224
  function stringAsType(str) {
18901
19225
  return expressionType(literal(str));
18902
19226
  }
18903
- function stringMapAsType(map) {
19227
+ function stringMapAsLiteralExpression(map) {
18904
19228
  const mapValues = Object.keys(map).map(key => {
18905
19229
  const value = Array.isArray(map[key]) ? map[key][0] : map[key];
18906
19230
  return {
@@ -18909,7 +19233,7 @@ function stringMapAsType(map) {
18909
19233
  quoted: true,
18910
19234
  };
18911
19235
  });
18912
- return expressionType(literalMap(mapValues));
19236
+ return literalMap(mapValues);
18913
19237
  }
18914
19238
  function stringArrayAsType(arr) {
18915
19239
  return arr.length > 0 ? expressionType(literalArr(arr.map(value => literal(value)))) :
@@ -18923,8 +19247,8 @@ function createBaseDirectiveTypeParams(meta) {
18923
19247
  typeWithParameters(meta.type.type, meta.typeArgumentCount),
18924
19248
  selectorForType !== null ? stringAsType(selectorForType) : NONE_TYPE,
18925
19249
  meta.exportAs !== null ? stringArrayAsType(meta.exportAs) : NONE_TYPE,
18926
- stringMapAsType(meta.inputs),
18927
- stringMapAsType(meta.outputs),
19250
+ expressionType(stringMapAsLiteralExpression(meta.inputs)),
19251
+ expressionType(stringMapAsLiteralExpression(meta.outputs)),
18928
19252
  stringArrayAsType(meta.queries.map(q => q.propertyName)),
18929
19253
  ];
18930
19254
  }
@@ -18938,6 +19262,7 @@ function createDirectiveType(meta) {
18938
19262
  // so that future fields align.
18939
19263
  typeParams.push(NONE_TYPE);
18940
19264
  typeParams.push(expressionType(literal(meta.isStandalone)));
19265
+ typeParams.push(createHostDirectivesType(meta));
18941
19266
  return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
18942
19267
  }
18943
19268
  // Define and update any view queries
@@ -19044,6 +19369,20 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
19044
19369
  if (sanitizerFn) {
19045
19370
  instructionParams.push(sanitizerFn);
19046
19371
  }
19372
+ else {
19373
+ // If there was no sanitization function found based on the security context
19374
+ // of an attribute/property binding - check whether this attribute/property is
19375
+ // one of the security-sensitive <iframe> attributes.
19376
+ // Note: for host bindings defined on a directive, we do not try to find all
19377
+ // possible places where it can be matched, so we can not determine whether
19378
+ // the host element is an <iframe>. In this case, if an attribute/binding
19379
+ // name is in the `IFRAME_SECURITY_SENSITIVE_ATTRS` set - append a validation
19380
+ // function, which would be invoked at runtime and would have access to the
19381
+ // underlying DOM element, check if it's an <iframe> and if so - runs extra checks.
19382
+ if (isIframeSecuritySensitiveAttr(bindingName)) {
19383
+ instructionParams.push(importExpr(Identifiers.validateIframeAttribute));
19384
+ }
19385
+ }
19047
19386
  updateVariables.push(...bindingExpr.stmts);
19048
19387
  if (instruction === Identifiers.hostProperty) {
19049
19388
  propertyBindings.push(instructionParams);
@@ -19241,6 +19580,69 @@ function compileStyles(styles, selector, hostSelector) {
19241
19580
  return shadowCss.shimCssText(style, selector, hostSelector);
19242
19581
  });
19243
19582
  }
19583
+ function createHostDirectivesType(meta) {
19584
+ var _a;
19585
+ if (!((_a = meta.hostDirectives) === null || _a === void 0 ? void 0 : _a.length)) {
19586
+ return NONE_TYPE;
19587
+ }
19588
+ return expressionType(literalArr(meta.hostDirectives.map(hostMeta => literalMap([
19589
+ { key: 'directive', value: typeofExpr(hostMeta.directive.type), quoted: false },
19590
+ { key: 'inputs', value: stringMapAsLiteralExpression(hostMeta.inputs || {}), quoted: false },
19591
+ { key: 'outputs', value: stringMapAsLiteralExpression(hostMeta.outputs || {}), quoted: false },
19592
+ ]))));
19593
+ }
19594
+ function createHostDirectivesFeatureArg(hostDirectives) {
19595
+ const expressions = [];
19596
+ let hasForwardRef = false;
19597
+ for (const current of hostDirectives) {
19598
+ // Use a shorthand if there are no inputs or outputs.
19599
+ if (!current.inputs && !current.outputs) {
19600
+ expressions.push(current.directive.type);
19601
+ }
19602
+ else {
19603
+ const keys = [{ key: 'directive', value: current.directive.type, quoted: false }];
19604
+ if (current.inputs) {
19605
+ const inputsLiteral = createHostDirectivesMappingArray(current.inputs);
19606
+ if (inputsLiteral) {
19607
+ keys.push({ key: 'inputs', value: inputsLiteral, quoted: false });
19608
+ }
19609
+ }
19610
+ if (current.outputs) {
19611
+ const outputsLiteral = createHostDirectivesMappingArray(current.outputs);
19612
+ if (outputsLiteral) {
19613
+ keys.push({ key: 'outputs', value: outputsLiteral, quoted: false });
19614
+ }
19615
+ }
19616
+ expressions.push(literalMap(keys));
19617
+ }
19618
+ if (current.isForwardReference) {
19619
+ hasForwardRef = true;
19620
+ }
19621
+ }
19622
+ // If there's a forward reference, we generate a `function() { return [HostDir] }`,
19623
+ // otherwise we can save some bytes by using a plain array, e.g. `[HostDir]`.
19624
+ return hasForwardRef ?
19625
+ new FunctionExpr([], [new ReturnStatement(literalArr(expressions))]) :
19626
+ literalArr(expressions);
19627
+ }
19628
+ /**
19629
+ * Converts an input/output mapping object literal into an array where the even keys are the
19630
+ * public name of the binding and the odd ones are the name it was aliased to. E.g.
19631
+ * `{inputOne: 'aliasOne', inputTwo: 'aliasTwo'}` will become
19632
+ * `['inputOne', 'aliasOne', 'inputTwo', 'aliasTwo']`.
19633
+ *
19634
+ * This conversion is necessary, because hosts bind to the public name of the host directive and
19635
+ * keeping the mapping in an object literal will break for apps using property renaming.
19636
+ */
19637
+ function createHostDirectivesMappingArray(mapping) {
19638
+ const elements = [];
19639
+ for (const publicName in mapping) {
19640
+ if (mapping.hasOwnProperty(publicName)) {
19641
+ elements.push(literal(publicName), literal(mapping[publicName]));
19642
+ }
19643
+ }
19644
+ return elements.length > 0 ? literalArr(elements) : null;
19645
+ }
19244
19646
 
19245
19647
  /**
19246
19648
  * @license
@@ -19490,7 +19892,7 @@ function convertDirectiveFacadeToMetadata(facade) {
19490
19892
  });
19491
19893
  }
19492
19894
  }
19493
- return Object.assign(Object.assign({}, facade), { typeArgumentCount: 0, typeSourceSpan: facade.typeSourceSpan, type: wrapReference(facade.type), internalType: new WrappedNodeExpr(facade.type), deps: null, host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host), inputs: Object.assign(Object.assign({}, inputsFromMetadata), inputsFromType), outputs: Object.assign(Object.assign({}, outputsFromMetadata), outputsFromType), queries: facade.queries.map(convertToR3QueryMetadata), providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null, viewQueries: facade.viewQueries.map(convertToR3QueryMetadata), fullInheritance: false });
19895
+ return Object.assign(Object.assign({}, facade), { typeArgumentCount: 0, typeSourceSpan: facade.typeSourceSpan, type: wrapReference(facade.type), internalType: new WrappedNodeExpr(facade.type), deps: null, host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host), inputs: Object.assign(Object.assign({}, inputsFromMetadata), inputsFromType), outputs: Object.assign(Object.assign({}, outputsFromMetadata), outputsFromType), queries: facade.queries.map(convertToR3QueryMetadata), providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null, viewQueries: facade.viewQueries.map(convertToR3QueryMetadata), fullInheritance: false, hostDirectives: convertHostDirectivesToMetadata(facade) });
19494
19896
  }
19495
19897
  function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
19496
19898
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
@@ -19514,6 +19916,7 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
19514
19916
  typeArgumentCount: 0,
19515
19917
  fullInheritance: false,
19516
19918
  isStandalone: (_j = declaration.isStandalone) !== null && _j !== void 0 ? _j : false,
19919
+ hostDirectives: convertHostDirectivesToMetadata(declaration),
19517
19920
  };
19518
19921
  }
19519
19922
  function convertHostDeclarationToMetadata(host = {}) {
@@ -19528,6 +19931,27 @@ function convertHostDeclarationToMetadata(host = {}) {
19528
19931
  },
19529
19932
  };
19530
19933
  }
19934
+ function convertHostDirectivesToMetadata(metadata) {
19935
+ var _a;
19936
+ if ((_a = metadata.hostDirectives) === null || _a === void 0 ? void 0 : _a.length) {
19937
+ return metadata.hostDirectives.map(hostDirective => {
19938
+ return typeof hostDirective === 'function' ?
19939
+ {
19940
+ directive: wrapReference(hostDirective),
19941
+ inputs: null,
19942
+ outputs: null,
19943
+ isForwardReference: false
19944
+ } :
19945
+ {
19946
+ directive: wrapReference(hostDirective.directive),
19947
+ isForwardReference: false,
19948
+ inputs: hostDirective.inputs ? parseInputOutputs(hostDirective.inputs) : null,
19949
+ outputs: hostDirective.outputs ? parseInputOutputs(hostDirective.outputs) : null,
19950
+ };
19951
+ });
19952
+ }
19953
+ return null;
19954
+ }
19531
19955
  function convertOpaqueValuesToExpressions(obj) {
19532
19956
  const result = {};
19533
19957
  for (const key of Object.keys(obj)) {
@@ -19746,7 +20170,7 @@ function publishFacade(global) {
19746
20170
  * Use of this source code is governed by an MIT-style license that can be
19747
20171
  * found in the LICENSE file at https://angular.io/license
19748
20172
  */
19749
- const VERSION = new Version('14.2.11');
20173
+ const VERSION = new Version('15.0.0');
19750
20174
 
19751
20175
  /**
19752
20176
  * @license
@@ -19756,10 +20180,9 @@ const VERSION = new Version('14.2.11');
19756
20180
  * found in the LICENSE file at https://angular.io/license
19757
20181
  */
19758
20182
  class CompilerConfig {
19759
- constructor({ defaultEncapsulation = exports.ViewEncapsulation.Emulated, useJit = true, jitDevMode = false, missingTranslation = null, preserveWhitespaces, strictInjectionParameters } = {}) {
20183
+ constructor({ defaultEncapsulation = exports.ViewEncapsulation.Emulated, useJit = true, missingTranslation = null, preserveWhitespaces, strictInjectionParameters } = {}) {
19760
20184
  this.defaultEncapsulation = defaultEncapsulation;
19761
20185
  this.useJit = !!useJit;
19762
- this.jitDevMode = !!jitDevMode;
19763
20186
  this.missingTranslation = missingTranslation;
19764
20187
  this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces));
19765
20188
  this.strictInjectionParameters = strictInjectionParameters === true;
@@ -21440,7 +21863,7 @@ class DirectiveBinder {
21440
21863
  const cssSelector = createCssSelector(elementName, getAttrsForDirectiveMatching(node));
21441
21864
  // Next, use the `SelectorMatcher` to get the list of directives on the node.
21442
21865
  const directives = [];
21443
- this.matcher.match(cssSelector, (_, directive) => directives.push(directive));
21866
+ this.matcher.match(cssSelector, (_selector, results) => directives.push(...results));
21444
21867
  if (directives.length > 0) {
21445
21868
  this.directives.set(node, directives);
21446
21869
  }
@@ -21773,7 +22196,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21773
22196
  function compileDeclareClassMetadata(metadata) {
21774
22197
  const definitionMap = new DefinitionMap();
21775
22198
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21776
- definitionMap.set('version', literal('14.2.11'));
22199
+ definitionMap.set('version', literal('15.0.0'));
21777
22200
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21778
22201
  definitionMap.set('type', metadata.type);
21779
22202
  definitionMap.set('decorators', metadata.decorators);
@@ -21888,9 +22311,10 @@ function compileDeclareDirectiveFromMetadata(meta) {
21888
22311
  * this logic for components, as they extend the directive metadata.
21889
22312
  */
21890
22313
  function createDirectiveDefinitionMap(meta) {
22314
+ var _a;
21891
22315
  const definitionMap = new DefinitionMap();
21892
22316
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21893
- definitionMap.set('version', literal('14.2.11'));
22317
+ definitionMap.set('version', literal('15.0.0'));
21894
22318
  // e.g. `type: MyDirective`
21895
22319
  definitionMap.set('type', meta.internalType);
21896
22320
  if (meta.isStandalone) {
@@ -21919,6 +22343,9 @@ function createDirectiveDefinitionMap(meta) {
21919
22343
  if (meta.lifecycle.usesOnChanges) {
21920
22344
  definitionMap.set('usesOnChanges', literal(true));
21921
22345
  }
22346
+ if ((_a = meta.hostDirectives) === null || _a === void 0 ? void 0 : _a.length) {
22347
+ definitionMap.set('hostDirectives', createHostDirectives(meta.hostDirectives));
22348
+ }
21922
22349
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21923
22350
  return definitionMap;
21924
22351
  }
@@ -21970,6 +22397,28 @@ function compileHostMetadata(meta) {
21970
22397
  return null;
21971
22398
  }
21972
22399
  }
22400
+ function createHostDirectives(hostDirectives) {
22401
+ const expressions = hostDirectives.map(current => {
22402
+ const keys = [{
22403
+ key: 'directive',
22404
+ value: current.isForwardReference ? generateForwardRef(current.directive.type) :
22405
+ current.directive.type,
22406
+ quoted: false
22407
+ }];
22408
+ const inputsLiteral = current.inputs ? createHostDirectivesMappingArray(current.inputs) : null;
22409
+ const outputsLiteral = current.outputs ? createHostDirectivesMappingArray(current.outputs) : null;
22410
+ if (inputsLiteral) {
22411
+ keys.push({ key: 'inputs', value: inputsLiteral, quoted: false });
22412
+ }
22413
+ if (outputsLiteral) {
22414
+ keys.push({ key: 'outputs', value: outputsLiteral, quoted: false });
22415
+ }
22416
+ return literalMap(keys);
22417
+ });
22418
+ // If there's a forward reference, we generate a `function() { return [{directive: HostDir}] }`,
22419
+ // otherwise we can save some bytes by using a plain array, e.g. `[{directive: HostDir}]`.
22420
+ return literalArr(expressions);
22421
+ }
21973
22422
 
21974
22423
  /**
21975
22424
  * @license
@@ -22101,7 +22550,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22101
22550
  function compileDeclareFactoryFunction(meta) {
22102
22551
  const definitionMap = new DefinitionMap();
22103
22552
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22104
- definitionMap.set('version', literal('14.2.11'));
22553
+ definitionMap.set('version', literal('15.0.0'));
22105
22554
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22106
22555
  definitionMap.set('type', meta.internalType);
22107
22556
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22143,7 +22592,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22143
22592
  function createInjectableDefinitionMap(meta) {
22144
22593
  const definitionMap = new DefinitionMap();
22145
22594
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22146
- definitionMap.set('version', literal('14.2.11'));
22595
+ definitionMap.set('version', literal('15.0.0'));
22147
22596
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22148
22597
  definitionMap.set('type', meta.internalType);
22149
22598
  // Only generate providedIn property if it has a non-null value
@@ -22201,7 +22650,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22201
22650
  function createInjectorDefinitionMap(meta) {
22202
22651
  const definitionMap = new DefinitionMap();
22203
22652
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22204
- definitionMap.set('version', literal('14.2.11'));
22653
+ definitionMap.set('version', literal('15.0.0'));
22205
22654
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22206
22655
  definitionMap.set('type', meta.internalType);
22207
22656
  definitionMap.set('providers', meta.providers);
@@ -22238,7 +22687,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22238
22687
  function createNgModuleDefinitionMap(meta) {
22239
22688
  const definitionMap = new DefinitionMap();
22240
22689
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22241
- definitionMap.set('version', literal('14.2.11'));
22690
+ definitionMap.set('version', literal('15.0.0'));
22242
22691
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22243
22692
  definitionMap.set('type', meta.internalType);
22244
22693
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22296,7 +22745,7 @@ function compileDeclarePipeFromMetadata(meta) {
22296
22745
  function createPipeDefinitionMap(meta) {
22297
22746
  const definitionMap = new DefinitionMap();
22298
22747
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22299
- definitionMap.set('version', literal('14.2.11'));
22748
+ definitionMap.set('version', literal('15.0.0'));
22300
22749
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22301
22750
  // e.g. `type: MyPipe`
22302
22751
  definitionMap.set('type', meta.internalType);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/bundled-angular-compiler",
3
- "version": "14.3.1-alpha.0+f71f236",
3
+ "version": "15.0.0-alpha.0",
4
4
  "description": "A CJS bundled version of @angular/compiler",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -15,5 +15,5 @@
15
15
  "package.json",
16
16
  "README.md"
17
17
  ],
18
- "gitHead": "f71f23652a74ebd2f650baeb3a91051db554c5d9"
18
+ "gitHead": "333fe1b4c189a5f4ecee216bd5360f428853f50d"
19
19
  }