@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.
- package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2020/src/render3/partial/directive.mjs +1 -1
- package/esm2020/src/render3/partial/factory.mjs +1 -1
- package/esm2020/src/render3/partial/injectable.mjs +1 -1
- package/esm2020/src/render3/partial/injector.mjs +1 -1
- package/esm2020/src/render3/partial/ng_module.mjs +1 -1
- package/esm2020/src/render3/partial/pipe.mjs +1 -1
- package/esm2020/src/schema/dom_element_schema_registry.mjs +28 -28
- package/esm2020/src/schema/dom_security_schema.mjs +19 -5
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +55 -40
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +54 -40
- package/fesm2020/compiler.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
package/fesm2015/testing.mjs
CHANGED
package/fesm2020/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.0-next.
|
|
2
|
+
* @license Angular v15.0.0-next.2
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -14526,10 +14526,24 @@ function SECURITY_SCHEMA() {
|
|
|
14526
14526
|
registerContext(SecurityContext.STYLE, ['*|style']);
|
|
14527
14527
|
// NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them.
|
|
14528
14528
|
registerContext(SecurityContext.URL, [
|
|
14529
|
-
'*|formAction',
|
|
14530
|
-
'
|
|
14531
|
-
'
|
|
14532
|
-
'
|
|
14529
|
+
'*|formAction',
|
|
14530
|
+
'area|href',
|
|
14531
|
+
'area|ping',
|
|
14532
|
+
'audio|src',
|
|
14533
|
+
'a|href',
|
|
14534
|
+
'a|ping',
|
|
14535
|
+
'blockquote|cite',
|
|
14536
|
+
'body|background',
|
|
14537
|
+
'del|cite',
|
|
14538
|
+
'form|action',
|
|
14539
|
+
'img|src',
|
|
14540
|
+
'input|src',
|
|
14541
|
+
'ins|cite',
|
|
14542
|
+
'q|cite',
|
|
14543
|
+
'source|src',
|
|
14544
|
+
'track|src',
|
|
14545
|
+
'video|poster',
|
|
14546
|
+
'video|src',
|
|
14533
14547
|
]);
|
|
14534
14548
|
registerContext(SecurityContext.RESOURCE_URL, [
|
|
14535
14549
|
'applet|code',
|
|
@@ -14785,42 +14799,42 @@ const SCHEMA = [
|
|
|
14785
14799
|
'time^[HTMLElement]|dateTime',
|
|
14786
14800
|
':svg:cursor^:svg:|',
|
|
14787
14801
|
];
|
|
14788
|
-
const _ATTR_TO_PROP = {
|
|
14802
|
+
const _ATTR_TO_PROP = new Map(Object.entries({
|
|
14789
14803
|
'class': 'className',
|
|
14790
14804
|
'for': 'htmlFor',
|
|
14791
14805
|
'formaction': 'formAction',
|
|
14792
14806
|
'innerHtml': 'innerHTML',
|
|
14793
14807
|
'readonly': 'readOnly',
|
|
14794
14808
|
'tabindex': 'tabIndex',
|
|
14795
|
-
};
|
|
14809
|
+
}));
|
|
14796
14810
|
// Invert _ATTR_TO_PROP.
|
|
14797
|
-
const _PROP_TO_ATTR =
|
|
14798
|
-
inverted
|
|
14811
|
+
const _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce((inverted, [propertyName, attributeName]) => {
|
|
14812
|
+
inverted.set(propertyName, attributeName);
|
|
14799
14813
|
return inverted;
|
|
14800
|
-
},
|
|
14814
|
+
}, new Map());
|
|
14801
14815
|
class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
14802
14816
|
constructor() {
|
|
14803
14817
|
super();
|
|
14804
|
-
this._schema =
|
|
14818
|
+
this._schema = new Map();
|
|
14805
14819
|
// We don't allow binding to events for security reasons. Allowing event bindings would almost
|
|
14806
14820
|
// certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema.
|
|
14807
|
-
this._eventSchema =
|
|
14821
|
+
this._eventSchema = new Map;
|
|
14808
14822
|
SCHEMA.forEach(encodedType => {
|
|
14809
|
-
const type =
|
|
14823
|
+
const type = new Map();
|
|
14810
14824
|
const events = new Set();
|
|
14811
14825
|
const [strType, strProperties] = encodedType.split('|');
|
|
14812
14826
|
const properties = strProperties.split(',');
|
|
14813
14827
|
const [typeNames, superName] = strType.split('^');
|
|
14814
14828
|
typeNames.split(',').forEach(tag => {
|
|
14815
|
-
this._schema
|
|
14816
|
-
this._eventSchema
|
|
14829
|
+
this._schema.set(tag.toLowerCase(), type);
|
|
14830
|
+
this._eventSchema.set(tag.toLowerCase(), events);
|
|
14817
14831
|
});
|
|
14818
|
-
const superType = superName && this._schema
|
|
14832
|
+
const superType = superName && this._schema.get(superName.toLowerCase());
|
|
14819
14833
|
if (superType) {
|
|
14820
|
-
|
|
14821
|
-
type
|
|
14822
|
-
}
|
|
14823
|
-
for (const superEvent of this._eventSchema
|
|
14834
|
+
for (const [prop, value] of superType) {
|
|
14835
|
+
type.set(prop, value);
|
|
14836
|
+
}
|
|
14837
|
+
for (const superEvent of this._eventSchema.get(superName.toLowerCase())) {
|
|
14824
14838
|
events.add(superEvent);
|
|
14825
14839
|
}
|
|
14826
14840
|
}
|
|
@@ -14831,16 +14845,16 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14831
14845
|
events.add(property.substring(1));
|
|
14832
14846
|
break;
|
|
14833
14847
|
case '!':
|
|
14834
|
-
type
|
|
14848
|
+
type.set(property.substring(1), BOOLEAN);
|
|
14835
14849
|
break;
|
|
14836
14850
|
case '#':
|
|
14837
|
-
type
|
|
14851
|
+
type.set(property.substring(1), NUMBER);
|
|
14838
14852
|
break;
|
|
14839
14853
|
case '%':
|
|
14840
|
-
type
|
|
14854
|
+
type.set(property.substring(1), OBJECT);
|
|
14841
14855
|
break;
|
|
14842
14856
|
default:
|
|
14843
|
-
type
|
|
14857
|
+
type.set(property, STRING);
|
|
14844
14858
|
}
|
|
14845
14859
|
}
|
|
14846
14860
|
});
|
|
@@ -14860,8 +14874,8 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14860
14874
|
return true;
|
|
14861
14875
|
}
|
|
14862
14876
|
}
|
|
14863
|
-
const elementProperties = this._schema
|
|
14864
|
-
return
|
|
14877
|
+
const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
|
|
14878
|
+
return elementProperties.has(propName);
|
|
14865
14879
|
}
|
|
14866
14880
|
hasElement(tagName, schemaMetas) {
|
|
14867
14881
|
if (schemaMetas.some((schema) => schema.name === NO_ERRORS_SCHEMA.name)) {
|
|
@@ -14876,7 +14890,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14876
14890
|
return true;
|
|
14877
14891
|
}
|
|
14878
14892
|
}
|
|
14879
|
-
return
|
|
14893
|
+
return this._schema.has(tagName.toLowerCase());
|
|
14880
14894
|
}
|
|
14881
14895
|
/**
|
|
14882
14896
|
* securityContext returns the security context for the given property on the given DOM tag.
|
|
@@ -14905,7 +14919,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14905
14919
|
return ctx ? ctx : SecurityContext.NONE;
|
|
14906
14920
|
}
|
|
14907
14921
|
getMappedPropName(propName) {
|
|
14908
|
-
return _ATTR_TO_PROP
|
|
14922
|
+
return _ATTR_TO_PROP.get(propName) ?? propName;
|
|
14909
14923
|
}
|
|
14910
14924
|
getDefaultComponentElementName() {
|
|
14911
14925
|
return 'ng-component';
|
|
@@ -14933,15 +14947,15 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
|
|
|
14933
14947
|
}
|
|
14934
14948
|
}
|
|
14935
14949
|
allKnownElementNames() {
|
|
14936
|
-
return
|
|
14950
|
+
return Array.from(this._schema.keys());
|
|
14937
14951
|
}
|
|
14938
14952
|
allKnownAttributesOfElement(tagName) {
|
|
14939
|
-
const elementProperties = this._schema
|
|
14953
|
+
const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
|
|
14940
14954
|
// Convert properties to attributes.
|
|
14941
|
-
return
|
|
14955
|
+
return Array.from(elementProperties.keys()).map(prop => _PROP_TO_ATTR.get(prop) ?? prop);
|
|
14942
14956
|
}
|
|
14943
14957
|
allKnownEventsOfElement(tagName) {
|
|
14944
|
-
return Array.from(this._eventSchema
|
|
14958
|
+
return Array.from(this._eventSchema.get(tagName.toLowerCase()) ?? []);
|
|
14945
14959
|
}
|
|
14946
14960
|
normalizeAnimationStyleProperty(propName) {
|
|
14947
14961
|
return dashCaseToCamelCase(propName);
|
|
@@ -19994,7 +20008,7 @@ function publishFacade(global) {
|
|
|
19994
20008
|
* Use of this source code is governed by an MIT-style license that can be
|
|
19995
20009
|
* found in the LICENSE file at https://angular.io/license
|
|
19996
20010
|
*/
|
|
19997
|
-
const VERSION = new Version('15.0.0-next.
|
|
20011
|
+
const VERSION = new Version('15.0.0-next.2');
|
|
19998
20012
|
|
|
19999
20013
|
/**
|
|
20000
20014
|
* @license
|
|
@@ -22027,7 +22041,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
22027
22041
|
function compileDeclareClassMetadata(metadata) {
|
|
22028
22042
|
const definitionMap = new DefinitionMap();
|
|
22029
22043
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
22030
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22044
|
+
definitionMap.set('version', literal('15.0.0-next.2'));
|
|
22031
22045
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22032
22046
|
definitionMap.set('type', metadata.type);
|
|
22033
22047
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -22144,7 +22158,7 @@ function compileDeclareDirectiveFromMetadata(meta) {
|
|
|
22144
22158
|
function createDirectiveDefinitionMap(meta) {
|
|
22145
22159
|
const definitionMap = new DefinitionMap();
|
|
22146
22160
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
22147
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22161
|
+
definitionMap.set('version', literal('15.0.0-next.2'));
|
|
22148
22162
|
// e.g. `type: MyDirective`
|
|
22149
22163
|
definitionMap.set('type', meta.internalType);
|
|
22150
22164
|
if (meta.isStandalone) {
|
|
@@ -22383,7 +22397,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22383
22397
|
function compileDeclareFactoryFunction(meta) {
|
|
22384
22398
|
const definitionMap = new DefinitionMap();
|
|
22385
22399
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22386
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22400
|
+
definitionMap.set('version', literal('15.0.0-next.2'));
|
|
22387
22401
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22388
22402
|
definitionMap.set('type', meta.internalType);
|
|
22389
22403
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -22425,7 +22439,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22425
22439
|
function createInjectableDefinitionMap(meta) {
|
|
22426
22440
|
const definitionMap = new DefinitionMap();
|
|
22427
22441
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22428
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22442
|
+
definitionMap.set('version', literal('15.0.0-next.2'));
|
|
22429
22443
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22430
22444
|
definitionMap.set('type', meta.internalType);
|
|
22431
22445
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -22483,7 +22497,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22483
22497
|
function createInjectorDefinitionMap(meta) {
|
|
22484
22498
|
const definitionMap = new DefinitionMap();
|
|
22485
22499
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22486
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22500
|
+
definitionMap.set('version', literal('15.0.0-next.2'));
|
|
22487
22501
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22488
22502
|
definitionMap.set('type', meta.internalType);
|
|
22489
22503
|
definitionMap.set('providers', meta.providers);
|
|
@@ -22520,7 +22534,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22520
22534
|
function createNgModuleDefinitionMap(meta) {
|
|
22521
22535
|
const definitionMap = new DefinitionMap();
|
|
22522
22536
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22523
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22537
|
+
definitionMap.set('version', literal('15.0.0-next.2'));
|
|
22524
22538
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22525
22539
|
definitionMap.set('type', meta.internalType);
|
|
22526
22540
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -22578,7 +22592,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22578
22592
|
function createPipeDefinitionMap(meta) {
|
|
22579
22593
|
const definitionMap = new DefinitionMap();
|
|
22580
22594
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22581
|
-
definitionMap.set('version', literal('15.0.0-next.
|
|
22595
|
+
definitionMap.set('version', literal('15.0.0-next.2'));
|
|
22582
22596
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22583
22597
|
// e.g. `type: MyPipe`
|
|
22584
22598
|
definitionMap.set('type', meta.internalType);
|