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

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.1
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 v15.0.0-next.0
2
+ * @license Angular v15.0.0-next.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -14785,42 +14785,42 @@ const SCHEMA = [
14785
14785
  'time^[HTMLElement]|dateTime',
14786
14786
  ':svg:cursor^:svg:|',
14787
14787
  ];
14788
- const _ATTR_TO_PROP = {
14788
+ const _ATTR_TO_PROP = new Map(Object.entries({
14789
14789
  'class': 'className',
14790
14790
  'for': 'htmlFor',
14791
14791
  'formaction': 'formAction',
14792
14792
  'innerHtml': 'innerHTML',
14793
14793
  'readonly': 'readOnly',
14794
14794
  'tabindex': 'tabIndex',
14795
- };
14795
+ }));
14796
14796
  // Invert _ATTR_TO_PROP.
14797
- const _PROP_TO_ATTR = Object.keys(_ATTR_TO_PROP).reduce((inverted, attr) => {
14798
- inverted[_ATTR_TO_PROP[attr]] = attr;
14797
+ const _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce((inverted, [propertyName, attributeName]) => {
14798
+ inverted.set(propertyName, attributeName);
14799
14799
  return inverted;
14800
- }, {});
14800
+ }, new Map());
14801
14801
  class DomElementSchemaRegistry extends ElementSchemaRegistry {
14802
14802
  constructor() {
14803
14803
  super();
14804
- this._schema = {};
14804
+ this._schema = new Map();
14805
14805
  // We don't allow binding to events for security reasons. Allowing event bindings would almost
14806
14806
  // certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema.
14807
- this._eventSchema = {};
14807
+ this._eventSchema = new Map;
14808
14808
  SCHEMA.forEach(encodedType => {
14809
- const type = {};
14809
+ const type = new Map();
14810
14810
  const events = new Set();
14811
14811
  const [strType, strProperties] = encodedType.split('|');
14812
14812
  const properties = strProperties.split(',');
14813
14813
  const [typeNames, superName] = strType.split('^');
14814
14814
  typeNames.split(',').forEach(tag => {
14815
- this._schema[tag.toLowerCase()] = type;
14816
- this._eventSchema[tag.toLowerCase()] = events;
14815
+ this._schema.set(tag.toLowerCase(), type);
14816
+ this._eventSchema.set(tag.toLowerCase(), events);
14817
14817
  });
14818
- const superType = superName && this._schema[superName.toLowerCase()];
14818
+ const superType = superName && this._schema.get(superName.toLowerCase());
14819
14819
  if (superType) {
14820
- Object.keys(superType).forEach((prop) => {
14821
- type[prop] = superType[prop];
14822
- });
14823
- for (const superEvent of this._eventSchema[superName.toLowerCase()]) {
14820
+ for (const [prop, value] of superType) {
14821
+ type.set(prop, value);
14822
+ }
14823
+ for (const superEvent of this._eventSchema.get(superName.toLowerCase())) {
14824
14824
  events.add(superEvent);
14825
14825
  }
14826
14826
  }
@@ -14831,16 +14831,16 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14831
14831
  events.add(property.substring(1));
14832
14832
  break;
14833
14833
  case '!':
14834
- type[property.substring(1)] = BOOLEAN;
14834
+ type.set(property.substring(1), BOOLEAN);
14835
14835
  break;
14836
14836
  case '#':
14837
- type[property.substring(1)] = NUMBER;
14837
+ type.set(property.substring(1), NUMBER);
14838
14838
  break;
14839
14839
  case '%':
14840
- type[property.substring(1)] = OBJECT;
14840
+ type.set(property.substring(1), OBJECT);
14841
14841
  break;
14842
14842
  default:
14843
- type[property] = STRING;
14843
+ type.set(property, STRING);
14844
14844
  }
14845
14845
  }
14846
14846
  });
@@ -14860,8 +14860,8 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14860
14860
  return true;
14861
14861
  }
14862
14862
  }
14863
- const elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
14864
- return !!elementProperties[propName];
14863
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
14864
+ return elementProperties.has(propName);
14865
14865
  }
14866
14866
  hasElement(tagName, schemaMetas) {
14867
14867
  if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {
@@ -14876,7 +14876,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14876
14876
  return true;
14877
14877
  }
14878
14878
  }
14879
- return !!this._schema[tagName.toLowerCase()];
14879
+ return this._schema.has(tagName.toLowerCase());
14880
14880
  }
14881
14881
  /**
14882
14882
  * securityContext returns the security context for the given property on the given DOM tag.
@@ -14905,7 +14905,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14905
14905
  return ctx ? ctx : SecurityContext.NONE;
14906
14906
  }
14907
14907
  getMappedPropName(propName) {
14908
- return _ATTR_TO_PROP[propName] || propName;
14908
+ return _ATTR_TO_PROP.get(propName) ?? propName;
14909
14909
  }
14910
14910
  getDefaultComponentElementName() {
14911
14911
  return 'ng-component';
@@ -14933,15 +14933,15 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
14933
14933
  }
14934
14934
  }
14935
14935
  allKnownElementNames() {
14936
- return Object.keys(this._schema);
14936
+ return Array.from(this._schema.keys());
14937
14937
  }
14938
14938
  allKnownAttributesOfElement(tagName) {
14939
- const elementProperties = this._schema[tagName.toLowerCase()] || this._schema['unknown'];
14939
+ const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
14940
14940
  // Convert properties to attributes.
14941
- return Object.keys(elementProperties).map(prop => _PROP_TO_ATTR[prop] ?? prop);
14941
+ return Array.from(elementProperties.keys()).map(prop => _PROP_TO_ATTR.get(prop) ?? prop);
14942
14942
  }
14943
14943
  allKnownEventsOfElement(tagName) {
14944
- return Array.from(this._eventSchema[tagName.toLowerCase()] ?? []);
14944
+ return Array.from(this._eventSchema.get(tagName.toLowerCase()) ?? []);
14945
14945
  }
14946
14946
  normalizeAnimationStyleProperty(propName) {
14947
14947
  return dashCaseToCamelCase(propName);
@@ -19994,7 +19994,7 @@ function publishFacade(global) {
19994
19994
  * Use of this source code is governed by an MIT-style license that can be
19995
19995
  * found in the LICENSE file at https://angular.io/license
19996
19996
  */
19997
- const VERSION = new Version('15.0.0-next.0');
19997
+ const VERSION = new Version('15.0.0-next.1');
19998
19998
 
19999
19999
  /**
20000
20000
  * @license
@@ -22027,7 +22027,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
22027
22027
  function compileDeclareClassMetadata(metadata) {
22028
22028
  const definitionMap = new DefinitionMap();
22029
22029
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
22030
- definitionMap.set('version', literal('15.0.0-next.0'));
22030
+ definitionMap.set('version', literal('15.0.0-next.1'));
22031
22031
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22032
22032
  definitionMap.set('type', metadata.type);
22033
22033
  definitionMap.set('decorators', metadata.decorators);
@@ -22144,7 +22144,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
22144
22144
  function createDirectiveDefinitionMap(meta) {
22145
22145
  const definitionMap = new DefinitionMap();
22146
22146
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
22147
- definitionMap.set('version', literal('15.0.0-next.0'));
22147
+ definitionMap.set('version', literal('15.0.0-next.1'));
22148
22148
  // e.g. `type: MyDirective`
22149
22149
  definitionMap.set('type', meta.internalType);
22150
22150
  if (meta.isStandalone) {
@@ -22383,7 +22383,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22383
22383
  function compileDeclareFactoryFunction(meta) {
22384
22384
  const definitionMap = new DefinitionMap();
22385
22385
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22386
- definitionMap.set('version', literal('15.0.0-next.0'));
22386
+ definitionMap.set('version', literal('15.0.0-next.1'));
22387
22387
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22388
22388
  definitionMap.set('type', meta.internalType);
22389
22389
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22425,7 +22425,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22425
22425
  function createInjectableDefinitionMap(meta) {
22426
22426
  const definitionMap = new DefinitionMap();
22427
22427
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22428
- definitionMap.set('version', literal('15.0.0-next.0'));
22428
+ definitionMap.set('version', literal('15.0.0-next.1'));
22429
22429
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22430
22430
  definitionMap.set('type', meta.internalType);
22431
22431
  // Only generate providedIn property if it has a non-null value
@@ -22483,7 +22483,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22483
22483
  function createInjectorDefinitionMap(meta) {
22484
22484
  const definitionMap = new DefinitionMap();
22485
22485
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22486
- definitionMap.set('version', literal('15.0.0-next.0'));
22486
+ definitionMap.set('version', literal('15.0.0-next.1'));
22487
22487
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22488
22488
  definitionMap.set('type', meta.internalType);
22489
22489
  definitionMap.set('providers', meta.providers);
@@ -22520,7 +22520,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22520
22520
  function createNgModuleDefinitionMap(meta) {
22521
22521
  const definitionMap = new DefinitionMap();
22522
22522
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22523
- definitionMap.set('version', literal('15.0.0-next.0'));
22523
+ definitionMap.set('version', literal('15.0.0-next.1'));
22524
22524
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22525
22525
  definitionMap.set('type', meta.internalType);
22526
22526
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22578,7 +22578,7 @@ function compileDeclarePipeFromMetadata(meta) {
22578
22578
  function createPipeDefinitionMap(meta) {
22579
22579
  const definitionMap = new DefinitionMap();
22580
22580
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22581
- definitionMap.set('version', literal('15.0.0-next.0'));
22581
+ definitionMap.set('version', literal('15.0.0-next.1'));
22582
22582
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22583
22583
  // e.g. `type: MyPipe`
22584
22584
  definitionMap.set('type', meta.internalType);