@angular/compiler 15.0.0-next.0 → 15.0.0-next.2

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-next.0
2
+ * @license Angular v15.0.0-next.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -14520,10 +14520,24 @@ function SECURITY_SCHEMA() {
14520
14520
  registerContext(SecurityContext.STYLE, ['*|style']);
14521
14521
  // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
14522
14522
  registerContext(SecurityContext.URL, [
14523
- '*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href',
14524
- 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action',
14525
- 'img|src', 'img|srcset', 'input|src', 'ins|cite', 'q|cite',
14526
- 'source|src', 'source|srcset', 'track|src', 'video|poster', 'video|src',
14523
+ '*|formAction',
14524
+ 'area|href',
14525
+ 'area|ping',
14526
+ 'audio|src',
14527
+ 'a|href',
14528
+ 'a|ping',
14529
+ 'blockquote|cite',
14530
+ 'body|background',
14531
+ 'del|cite',
14532
+ 'form|action',
14533
+ 'img|src',
14534
+ 'input|src',
14535
+ 'ins|cite',
14536
+ 'q|cite',
14537
+ 'source|src',
14538
+ 'track|src',
14539
+ 'video|poster',
14540
+ 'video|src',
14527
14541
  ]);
14528
14542
  registerContext(SecurityContext.RESOURCE_URL, [
14529
14543
  'applet|code',
@@ -14779,42 +14793,42 @@ const SCHEMA = [
14779
14793
  'time^[HTMLElement]|dateTime',
14780
14794
  ':svg:cursor^:svg:|',
14781
14795
  ];
14782
- const _ATTR_TO_PROP = {
14796
+ const _ATTR_TO_PROP = new Map(Object.entries({
14783
14797
  'class': 'className',
14784
14798
  'for': 'htmlFor',
14785
14799
  'formaction': 'formAction',
14786
14800
  'innerHtml': 'innerHTML',
14787
14801
  'readonly': 'readOnly',
14788
14802
  'tabindex': 'tabIndex',
14789
- };
14803
+ }));
14790
14804
  // Invert _ATTR_TO_PROP.
14791
- const _PROP_TO_ATTR = Object.keys(_ATTR_TO_PROP).reduce((inverted, attr) => {
14792
- inverted[_ATTR_TO_PROP[attr]] = attr;
14805
+ const _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce((inverted, [propertyName, attributeName]) => {
14806
+ inverted.set(propertyName, attributeName);
14793
14807
  return inverted;
14794
- }, {});
14808
+ }, new Map());
14795
14809
  class DomElementSchemaRegistry extends ElementSchemaRegistry {
14796
14810
  constructor() {
14797
14811
  super();
14798
- this._schema = {};
14812
+ this._schema = new Map();
14799
14813
  // We don't allow binding to events for security reasons. Allowing event bindings would almost
14800
14814
  // certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema.
14801
- this._eventSchema = {};
14815
+ this._eventSchema = new Map;
14802
14816
  SCHEMA.forEach(encodedType => {
14803
- const type = {};
14817
+ const type = new Map();
14804
14818
  const events = new Set();
14805
14819
  const [strType, strProperties] = encodedType.split('|');
14806
14820
  const properties = strProperties.split(',');
14807
14821
  const [typeNames, superName] = strType.split('^');
14808
14822
  typeNames.split(',').forEach(tag => {
14809
- this._schema[tag.toLowerCase()] = type;
14810
- this._eventSchema[tag.toLowerCase()] = events;
14823
+ this._schema.set(tag.toLowerCase(), type);
14824
+ this._eventSchema.set(tag.toLowerCase(), events);
14811
14825
  });
14812
- const superType = superName && this._schema[superName.toLowerCase()];
14826
+ const superType = superName && this._schema.get(superName.toLowerCase());
14813
14827
  if (superType) {
14814
- Object.keys(superType).forEach((prop) => {
14815
- type[prop] = superType[prop];
14816
- });
14817
- for (const superEvent of this._eventSchema[superName.toLowerCase()]) {
14828
+ for (const [prop, value] of superType) {
14829
+ type.set(prop, value);
14830
+ }
14831
+ for (const superEvent of this._eventSchema.get(superName.toLowerCase())) {
14818
14832
  events.add(superEvent);
14819
14833
  }
14820
14834
  }
@@ -14825,16 +14839,16 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14825
14839
  events.add(property.substring(1));
14826
14840
  break;
14827
14841
  case '!':
14828
- type[property.substring(1)] = BOOLEAN;
14842
+ type.set(property.substring(1), BOOLEAN);
14829
14843
  break;
14830
14844
  case '#':
14831
- type[property.substring(1)] = NUMBER;
14845
+ type.set(property.substring(1), NUMBER);
14832
14846
  break;
14833
14847
  case '%':
14834
- type[property.substring(1)] = OBJECT;
14848
+ type.set(property.substring(1), OBJECT);
14835
14849
  break;
14836
14850
  default:
14837
- type[property] = STRING;
14851
+ type.set(property, STRING);
14838
14852
  }
14839
14853
  }
14840
14854
  });
@@ -14854,8 +14868,8 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14854
14868
  return true;
14855
14869
  }
14856
14870
  }
14857
- const elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
14858
- return !!elementProperties[propName];
14871
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
14872
+ return elementProperties.has(propName);
14859
14873
  }
14860
14874
  hasElement(tagName, schemaMetas) {
14861
14875
  if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {
@@ -14870,7 +14884,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14870
14884
  return true;
14871
14885
  }
14872
14886
  }
14873
- return !!this._schema[tagName.toLowerCase()];
14887
+ return this._schema.has(tagName.toLowerCase());
14874
14888
  }
14875
14889
  /**
14876
14890
  * securityContext returns the security context for the given property on the given DOM tag.
@@ -14899,7 +14913,8 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14899
14913
  return ctx ? ctx : SecurityContext.NONE;
14900
14914
  }
14901
14915
  getMappedPropName(propName) {
14902
- return _ATTR_TO_PROP[propName] || propName;
14916
+ var _a;
14917
+ return (_a = _ATTR_TO_PROP.get(propName)) !== null && _a !== void 0 ? _a : propName;
14903
14918
  }
14904
14919
  getDefaultComponentElementName() {
14905
14920
  return 'ng-component';
@@ -14927,16 +14942,16 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14927
14942
  }
14928
14943
  }
14929
14944
  allKnownElementNames() {
14930
- return Object.keys(this._schema);
14945
+ return Array.from(this._schema.keys());
14931
14946
  }
14932
14947
  allKnownAttributesOfElement(tagName) {
14933
- const elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
14948
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
14934
14949
  // Convert properties to attributes.
14935
- return Object.keys(elementProperties).map(prop => { var _a; return (_a = _PROP_TO_ATTR[prop]) !== null && _a !== void 0 ? _a : prop; });
14950
+ return Array.from(elementProperties.keys()).map(prop => { var _a; return (_a = _PROP_TO_ATTR.get(prop)) !== null && _a !== void 0 ? _a : prop; });
14936
14951
  }
14937
14952
  allKnownEventsOfElement(tagName) {
14938
14953
  var _a;
14939
- return Array.from((_a = this._eventSchema[tagName.toLowerCase()]) !== null && _a !== void 0 ? _a : []);
14954
+ return Array.from((_a = this._eventSchema.get(tagName.toLowerCase())) !== null && _a !== void 0 ? _a : []);
14940
14955
  }
14941
14956
  normalizeAnimationStyleProperty(propName) {
14942
14957
  return dashCaseToCamelCase(propName);
@@ -19954,7 +19969,7 @@ function publishFacade(global) {
19954
19969
  * Use of this source code is governed by an MIT-style license that can be
19955
19970
  * found in the LICENSE file at https://angular.io/license
19956
19971
  */
19957
- const VERSION = new Version('15.0.0-next.0');
19972
+ const VERSION = new Version('15.0.0-next.2');
19958
19973
 
19959
19974
  /**
19960
19975
  * @license
@@ -21981,7 +21996,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21981
21996
  function compileDeclareClassMetadata(metadata) {
21982
21997
  const definitionMap = new DefinitionMap();
21983
21998
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21984
- definitionMap.set('version', literal('15.0.0-next.0'));
21999
+ definitionMap.set('version', literal('15.0.0-next.2'));
21985
22000
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21986
22001
  definitionMap.set('type', metadata.type);
21987
22002
  definitionMap.set('decorators', metadata.decorators);
@@ -22099,7 +22114,7 @@ function createDirectiveDefinitionMap(meta) {
22099
22114
  var _a;
22100
22115
  const definitionMap = new DefinitionMap();
22101
22116
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
22102
- definitionMap.set('version', literal('15.0.0-next.0'));
22117
+ definitionMap.set('version', literal('15.0.0-next.2'));
22103
22118
  // e.g. `type: MyDirective`
22104
22119
  definitionMap.set('type', meta.internalType);
22105
22120
  if (meta.isStandalone) {
@@ -22338,7 +22353,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22338
22353
  function compileDeclareFactoryFunction(meta) {
22339
22354
  const definitionMap = new DefinitionMap();
22340
22355
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22341
- definitionMap.set('version', literal('15.0.0-next.0'));
22356
+ definitionMap.set('version', literal('15.0.0-next.2'));
22342
22357
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22343
22358
  definitionMap.set('type', meta.internalType);
22344
22359
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22380,7 +22395,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22380
22395
  function createInjectableDefinitionMap(meta) {
22381
22396
  const definitionMap = new DefinitionMap();
22382
22397
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22383
- definitionMap.set('version', literal('15.0.0-next.0'));
22398
+ definitionMap.set('version', literal('15.0.0-next.2'));
22384
22399
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22385
22400
  definitionMap.set('type', meta.internalType);
22386
22401
  // Only generate providedIn property if it has a non-null value
@@ -22438,7 +22453,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22438
22453
  function createInjectorDefinitionMap(meta) {
22439
22454
  const definitionMap = new DefinitionMap();
22440
22455
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22441
- definitionMap.set('version', literal('15.0.0-next.0'));
22456
+ definitionMap.set('version', literal('15.0.0-next.2'));
22442
22457
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22443
22458
  definitionMap.set('type', meta.internalType);
22444
22459
  definitionMap.set('providers', meta.providers);
@@ -22475,7 +22490,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22475
22490
  function createNgModuleDefinitionMap(meta) {
22476
22491
  const definitionMap = new DefinitionMap();
22477
22492
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22478
- definitionMap.set('version', literal('15.0.0-next.0'));
22493
+ definitionMap.set('version', literal('15.0.0-next.2'));
22479
22494
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22480
22495
  definitionMap.set('type', meta.internalType);
22481
22496
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22533,7 +22548,7 @@ function compileDeclarePipeFromMetadata(meta) {
22533
22548
  function createPipeDefinitionMap(meta) {
22534
22549
  const definitionMap = new DefinitionMap();
22535
22550
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22536
- definitionMap.set('version', literal('15.0.0-next.0'));
22551
+ definitionMap.set('version', literal('15.0.0-next.2'));
22537
22552
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22538
22553
  // e.g. `type: MyPipe`
22539
22554
  definitionMap.set('type', meta.internalType);