@angular/compiler 15.2.0-next.3 → 15.2.0-rc.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.
- 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/shadow_css.mjs +13 -48
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +21 -56
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +21 -56
- 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/esm2020/src/version.mjs
CHANGED
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
* Entry point for all public APIs of the compiler package.
|
|
12
12
|
*/
|
|
13
13
|
import { Version } from './util';
|
|
14
|
-
export const VERSION = new Version('15.2.0-
|
|
14
|
+
export const VERSION = new Version('15.2.0-rc.0');
|
|
15
15
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVIOzs7O0dBSUc7QUFFSCxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sUUFBUSxDQUFDO0FBRS9CLE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSBjb21waWxlciBwYWNrYWdlLlxuICovXG5cbmltcG9ydCB7VmVyc2lvbn0gZnJvbSAnLi91dGlsJztcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ==
|
package/fesm2015/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.2.0-
|
|
2
|
+
* @license Angular v15.2.0-rc.0
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7428,9 +7428,8 @@ const animationKeywords = new Set([
|
|
|
7428
7428
|
'end', 'jump-both', 'jump-end', 'jump-none', 'jump-start', 'start'
|
|
7429
7429
|
]);
|
|
7430
7430
|
/**
|
|
7431
|
-
* The following class
|
|
7432
|
-
*
|
|
7433
|
-
* Please make sure to keep to edits in sync with the source file.
|
|
7431
|
+
* The following class has its origin from a port of shadowCSS from webcomponents.js to TypeScript.
|
|
7432
|
+
* It has since diverge in many ways to tailor Angular's needs.
|
|
7434
7433
|
*
|
|
7435
7434
|
* Source:
|
|
7436
7435
|
* https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
|
|
@@ -7470,28 +7469,8 @@ const animationKeywords = new Set([
|
|
|
7470
7469
|
}
|
|
7471
7470
|
|
|
7472
7471
|
* encapsulation: Styles defined within ShadowDOM, apply only to
|
|
7473
|
-
dom inside the ShadowDOM.
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
By default, rules are prefixed with the host element tag name
|
|
7477
|
-
as a descendant selector. This ensures styling does not leak out of the 'top'
|
|
7478
|
-
of the element's ShadowDOM. For example,
|
|
7479
|
-
|
|
7480
|
-
div {
|
|
7481
|
-
font-weight: bold;
|
|
7482
|
-
}
|
|
7483
|
-
|
|
7484
|
-
becomes:
|
|
7485
|
-
|
|
7486
|
-
x-foo div {
|
|
7487
|
-
font-weight: bold;
|
|
7488
|
-
}
|
|
7489
|
-
|
|
7490
|
-
becomes:
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
Alternatively, if WebComponents.ShadowCSS.strictStyling is set to true then
|
|
7494
|
-
selectors are scoped by adding an attribute selector suffix to each
|
|
7472
|
+
dom inside the ShadowDOM.
|
|
7473
|
+
The selectors are scoped by adding an attribute selector suffix to each
|
|
7495
7474
|
simple selector that contains the host element tag name. Each element
|
|
7496
7475
|
in the element's ShadowDOM template is also given the scope attribute.
|
|
7497
7476
|
Thus, these rules match only elements that have the scope attribute.
|
|
@@ -7553,8 +7532,6 @@ const animationKeywords = new Set([
|
|
|
7553
7532
|
*/
|
|
7554
7533
|
class ShadowCss {
|
|
7555
7534
|
constructor() {
|
|
7556
|
-
// TODO: Is never re-assigned, could be removed.
|
|
7557
|
-
this.strictStyling = true;
|
|
7558
7535
|
/**
|
|
7559
7536
|
* Regular expression used to extrapolate the possible keyframes from an
|
|
7560
7537
|
* animation declaration (with possibly multiple animation definitions)
|
|
@@ -7572,12 +7549,10 @@ class ShadowCss {
|
|
|
7572
7549
|
this._animationDeclarationKeyframesRe = /(^|\s+)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g;
|
|
7573
7550
|
}
|
|
7574
7551
|
/*
|
|
7575
|
-
* Shim some cssText with the given selector. Returns cssText that can
|
|
7576
|
-
* be included in the document via WebComponents.ShadowCSS.addCssToDocument(css).
|
|
7552
|
+
* Shim some cssText with the given selector. Returns cssText that can be included in the document
|
|
7577
7553
|
*
|
|
7578
|
-
*
|
|
7579
|
-
*
|
|
7580
|
-
* - hostSelector is the attribute added to the host itself.
|
|
7554
|
+
* The selector is the attribute added to all elements inside the host,
|
|
7555
|
+
* The hostSelector is the attribute added to the host itself.
|
|
7581
7556
|
*/
|
|
7582
7557
|
shimCssText(cssText, selector, hostSelector = '') {
|
|
7583
7558
|
const commentsWithHash = extractCommentsWithHash(cssText);
|
|
@@ -7739,7 +7714,6 @@ class ShadowCss {
|
|
|
7739
7714
|
*
|
|
7740
7715
|
**/
|
|
7741
7716
|
_insertPolyfillDirectivesInCssText(cssText) {
|
|
7742
|
-
// Difference with webcomponents.js: does not handle comments
|
|
7743
7717
|
return cssText.replace(_cssContentNextSelectorRe, function (...m) {
|
|
7744
7718
|
return m[2] + '{';
|
|
7745
7719
|
});
|
|
@@ -7760,7 +7734,6 @@ class ShadowCss {
|
|
|
7760
7734
|
*
|
|
7761
7735
|
**/
|
|
7762
7736
|
_insertPolyfillRulesInCssText(cssText) {
|
|
7763
|
-
// Difference with webcomponents.js: does not handle comments
|
|
7764
7737
|
return cssText.replace(_cssContentRuleRe, (...m) => {
|
|
7765
7738
|
const rule = m[0].replace(m[1], '').replace(m[2], '');
|
|
7766
7739
|
return m[4] + rule;
|
|
@@ -7804,7 +7777,6 @@ class ShadowCss {
|
|
|
7804
7777
|
*
|
|
7805
7778
|
**/
|
|
7806
7779
|
_extractUnscopedRulesFromCssText(cssText) {
|
|
7807
|
-
// Difference with webcomponents.js: does not handle comments
|
|
7808
7780
|
let r = '';
|
|
7809
7781
|
let m;
|
|
7810
7782
|
_cssContentUnscopedRuleRe.lastIndex = 0;
|
|
@@ -7921,8 +7893,7 @@ class ShadowCss {
|
|
|
7921
7893
|
let selector = rule.selector;
|
|
7922
7894
|
let content = rule.content;
|
|
7923
7895
|
if (rule.selector[0] !== '@') {
|
|
7924
|
-
selector =
|
|
7925
|
-
this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
|
|
7896
|
+
selector = this._scopeSelector(rule.selector, scopeSelector, hostSelector);
|
|
7926
7897
|
}
|
|
7927
7898
|
else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
|
|
7928
7899
|
rule.selector.startsWith('@document') || rule.selector.startsWith('@layer') ||
|
|
@@ -7963,16 +7934,14 @@ class ShadowCss {
|
|
|
7963
7934
|
return new CssRule(selector, rule.content);
|
|
7964
7935
|
});
|
|
7965
7936
|
}
|
|
7966
|
-
_scopeSelector(selector, scopeSelector, hostSelector
|
|
7937
|
+
_scopeSelector(selector, scopeSelector, hostSelector) {
|
|
7967
7938
|
return selector.split(',')
|
|
7968
7939
|
.map(part => part.trim().split(_shadowDeepSelectors))
|
|
7969
7940
|
.map((deepParts) => {
|
|
7970
7941
|
const [shallowPart, ...otherParts] = deepParts;
|
|
7971
7942
|
const applyScope = (shallowPart) => {
|
|
7972
7943
|
if (this._selectorNeedsScoping(shallowPart, scopeSelector)) {
|
|
7973
|
-
return
|
|
7974
|
-
this._applyStrictSelectorScope(shallowPart, scopeSelector, hostSelector) :
|
|
7975
|
-
this._applySelectorScope(shallowPart, scopeSelector, hostSelector);
|
|
7944
|
+
return this._applySelectorScope(shallowPart, scopeSelector, hostSelector);
|
|
7976
7945
|
}
|
|
7977
7946
|
else {
|
|
7978
7947
|
return shallowPart;
|
|
@@ -7992,16 +7961,12 @@ class ShadowCss {
|
|
|
7992
7961
|
scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]');
|
|
7993
7962
|
return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm');
|
|
7994
7963
|
}
|
|
7995
|
-
_applySelectorScope(selector, scopeSelector, hostSelector) {
|
|
7996
|
-
// Difference from webcomponents.js: scopeSelector could not be an array
|
|
7997
|
-
return this._applySimpleSelectorScope(selector, scopeSelector, hostSelector);
|
|
7998
|
-
}
|
|
7999
7964
|
// scope via name and [is=name]
|
|
8000
7965
|
_applySimpleSelectorScope(selector, scopeSelector, hostSelector) {
|
|
8001
7966
|
// In Android browser, the lastIndex is not reset when the regex is used in String.replace()
|
|
8002
7967
|
_polyfillHostRe.lastIndex = 0;
|
|
8003
7968
|
if (_polyfillHostRe.test(selector)) {
|
|
8004
|
-
const replaceBy =
|
|
7969
|
+
const replaceBy = `[${hostSelector}]`;
|
|
8005
7970
|
return selector
|
|
8006
7971
|
.replace(_polyfillHostNoCombinatorRe, (hnc, selector) => {
|
|
8007
7972
|
return selector.replace(/([^:]*)(:*)(.*)/, (_, before, colon, after) => {
|
|
@@ -8014,7 +7979,7 @@ class ShadowCss {
|
|
|
8014
7979
|
}
|
|
8015
7980
|
// return a selector with [name] suffix on each simple selector
|
|
8016
7981
|
// e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */
|
|
8017
|
-
|
|
7982
|
+
_applySelectorScope(selector, scopeSelector, hostSelector) {
|
|
8018
7983
|
var _a;
|
|
8019
7984
|
const isRe = /\[is=([^\]]*)\]/g;
|
|
8020
7985
|
scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
|
|
@@ -19881,7 +19846,7 @@ function publishFacade(global) {
|
|
|
19881
19846
|
* @description
|
|
19882
19847
|
* Entry point for all public APIs of the compiler package.
|
|
19883
19848
|
*/
|
|
19884
|
-
const VERSION = new Version('15.2.0-
|
|
19849
|
+
const VERSION = new Version('15.2.0-rc.0');
|
|
19885
19850
|
|
|
19886
19851
|
class CompilerConfig {
|
|
19887
19852
|
constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, useJit = true, missingTranslation = null, preserveWhitespaces, strictInjectionParameters } = {}) {
|
|
@@ -21807,7 +21772,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
21807
21772
|
function compileDeclareClassMetadata(metadata) {
|
|
21808
21773
|
const definitionMap = new DefinitionMap();
|
|
21809
21774
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
21810
|
-
definitionMap.set('version', literal('15.2.0-
|
|
21775
|
+
definitionMap.set('version', literal('15.2.0-rc.0'));
|
|
21811
21776
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
21812
21777
|
definitionMap.set('type', metadata.type);
|
|
21813
21778
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -21911,7 +21876,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
21911
21876
|
var _a;
|
|
21912
21877
|
const definitionMap = new DefinitionMap();
|
|
21913
21878
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
21914
|
-
definitionMap.set('version', literal('15.2.0-
|
|
21879
|
+
definitionMap.set('version', literal('15.2.0-rc.0'));
|
|
21915
21880
|
// e.g. `type: MyDirective`
|
|
21916
21881
|
definitionMap.set('type', meta.internalType);
|
|
21917
21882
|
if (meta.isStandalone) {
|
|
@@ -22136,7 +22101,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22136
22101
|
function compileDeclareFactoryFunction(meta) {
|
|
22137
22102
|
const definitionMap = new DefinitionMap();
|
|
22138
22103
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22139
|
-
definitionMap.set('version', literal('15.2.0-
|
|
22104
|
+
definitionMap.set('version', literal('15.2.0-rc.0'));
|
|
22140
22105
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22141
22106
|
definitionMap.set('type', meta.internalType);
|
|
22142
22107
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -22171,7 +22136,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22171
22136
|
function createInjectableDefinitionMap(meta) {
|
|
22172
22137
|
const definitionMap = new DefinitionMap();
|
|
22173
22138
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22174
|
-
definitionMap.set('version', literal('15.2.0-
|
|
22139
|
+
definitionMap.set('version', literal('15.2.0-rc.0'));
|
|
22175
22140
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22176
22141
|
definitionMap.set('type', meta.internalType);
|
|
22177
22142
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -22222,7 +22187,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22222
22187
|
function createInjectorDefinitionMap(meta) {
|
|
22223
22188
|
const definitionMap = new DefinitionMap();
|
|
22224
22189
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22225
|
-
definitionMap.set('version', literal('15.2.0-
|
|
22190
|
+
definitionMap.set('version', literal('15.2.0-rc.0'));
|
|
22226
22191
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22227
22192
|
definitionMap.set('type', meta.internalType);
|
|
22228
22193
|
definitionMap.set('providers', meta.providers);
|
|
@@ -22252,7 +22217,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22252
22217
|
function createNgModuleDefinitionMap(meta) {
|
|
22253
22218
|
const definitionMap = new DefinitionMap();
|
|
22254
22219
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22255
|
-
definitionMap.set('version', literal('15.2.0-
|
|
22220
|
+
definitionMap.set('version', literal('15.2.0-rc.0'));
|
|
22256
22221
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22257
22222
|
definitionMap.set('type', meta.internalType);
|
|
22258
22223
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -22303,7 +22268,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22303
22268
|
function createPipeDefinitionMap(meta) {
|
|
22304
22269
|
const definitionMap = new DefinitionMap();
|
|
22305
22270
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22306
|
-
definitionMap.set('version', literal('15.2.0-
|
|
22271
|
+
definitionMap.set('version', literal('15.2.0-rc.0'));
|
|
22307
22272
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22308
22273
|
// e.g. `type: MyPipe`
|
|
22309
22274
|
definitionMap.set('type', meta.internalType);
|