@angular/compiler 19.1.2 → 19.1.4
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/fesm2022/compiler.mjs +47 -14
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v19.1.
|
|
2
|
+
* @license Angular v19.1.4
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7794,6 +7794,36 @@ class ShadowCss {
|
|
|
7794
7794
|
* .foo<scopeName> .bar { ... }
|
|
7795
7795
|
*/
|
|
7796
7796
|
_convertColonHostContext(cssText) {
|
|
7797
|
+
const length = cssText.length;
|
|
7798
|
+
let parens = 0;
|
|
7799
|
+
let prev = 0;
|
|
7800
|
+
let result = '';
|
|
7801
|
+
// Splits up the selectors on their top-level commas, processes the :host-context in them
|
|
7802
|
+
// individually and stitches them back together. This ensures that individual selectors don't
|
|
7803
|
+
// affect each other.
|
|
7804
|
+
for (let i = 0; i < length; i++) {
|
|
7805
|
+
const char = cssText[i];
|
|
7806
|
+
// If we hit a comma and there are no open parentheses, take the current chunk and process it.
|
|
7807
|
+
if (char === ',' && parens === 0) {
|
|
7808
|
+
result += this._convertColonHostContextInSelectorPart(cssText.slice(prev, i)) + ',';
|
|
7809
|
+
prev = i + 1;
|
|
7810
|
+
continue;
|
|
7811
|
+
}
|
|
7812
|
+
// We've hit the end. Take everything since the last comma.
|
|
7813
|
+
if (i === length - 1) {
|
|
7814
|
+
result += this._convertColonHostContextInSelectorPart(cssText.slice(prev));
|
|
7815
|
+
break;
|
|
7816
|
+
}
|
|
7817
|
+
if (char === '(') {
|
|
7818
|
+
parens++;
|
|
7819
|
+
}
|
|
7820
|
+
else if (char === ')') {
|
|
7821
|
+
parens--;
|
|
7822
|
+
}
|
|
7823
|
+
}
|
|
7824
|
+
return result;
|
|
7825
|
+
}
|
|
7826
|
+
_convertColonHostContextInSelectorPart(cssText) {
|
|
7797
7827
|
return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => {
|
|
7798
7828
|
// We have captured a selector that contains a `:host-context` rule.
|
|
7799
7829
|
// For backward compatibility `:host-context` may contain a comma separated list of selectors.
|
|
@@ -8181,10 +8211,13 @@ const _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*([
|
|
|
8181
8211
|
const _polyfillHost = '-shadowcsshost';
|
|
8182
8212
|
// note: :host-context pre-processed to -shadowcsshostcontext.
|
|
8183
8213
|
const _polyfillHostContext = '-shadowcsscontext';
|
|
8184
|
-
const _parenSuffix = '(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))
|
|
8185
|
-
const _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix, 'gim');
|
|
8186
|
-
|
|
8187
|
-
|
|
8214
|
+
const _parenSuffix = '(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))';
|
|
8215
|
+
const _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix + '?([^,{]*)', 'gim');
|
|
8216
|
+
// note: :host-context patterns are terminated with `{`, as opposed to :host which
|
|
8217
|
+
// is both `{` and `,` because :host-context handles top-level commas differently.
|
|
8218
|
+
const _hostContextPattern = _polyfillHostContext + _parenSuffix + '?([^{]*)';
|
|
8219
|
+
const _cssColonHostContextReGlobal = new RegExp(`${_cssScopedPseudoFunctionPrefix}(${_hostContextPattern})`, 'gim');
|
|
8220
|
+
const _cssColonHostContextRe = new RegExp(_hostContextPattern, 'im');
|
|
8188
8221
|
const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator';
|
|
8189
8222
|
const _polyfillHostNoCombinatorOutsidePseudoFunction = new RegExp(`${_polyfillHostNoCombinator}(?![^(]*\\))`, 'g');
|
|
8190
8223
|
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s,]*)/;
|
|
@@ -30730,7 +30763,7 @@ function publishFacade(global) {
|
|
|
30730
30763
|
* @description
|
|
30731
30764
|
* Entry point for all public APIs of the compiler package.
|
|
30732
30765
|
*/
|
|
30733
|
-
const VERSION = new Version('19.1.
|
|
30766
|
+
const VERSION = new Version('19.1.4');
|
|
30734
30767
|
|
|
30735
30768
|
class CompilerConfig {
|
|
30736
30769
|
defaultEncapsulation;
|
|
@@ -32586,7 +32619,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
32586
32619
|
function compileDeclareClassMetadata(metadata) {
|
|
32587
32620
|
const definitionMap = new DefinitionMap();
|
|
32588
32621
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
32589
|
-
definitionMap.set('version', literal('19.1.
|
|
32622
|
+
definitionMap.set('version', literal('19.1.4'));
|
|
32590
32623
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
32591
32624
|
definitionMap.set('type', metadata.type);
|
|
32592
32625
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -32604,7 +32637,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
32604
32637
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
32605
32638
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
32606
32639
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
32607
|
-
definitionMap.set('version', literal('19.1.
|
|
32640
|
+
definitionMap.set('version', literal('19.1.4'));
|
|
32608
32641
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
32609
32642
|
definitionMap.set('type', metadata.type);
|
|
32610
32643
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -32699,7 +32732,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
32699
32732
|
const definitionMap = new DefinitionMap();
|
|
32700
32733
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
32701
32734
|
definitionMap.set('minVersion', literal(minVersion));
|
|
32702
|
-
definitionMap.set('version', literal('19.1.
|
|
32735
|
+
definitionMap.set('version', literal('19.1.4'));
|
|
32703
32736
|
// e.g. `type: MyDirective`
|
|
32704
32737
|
definitionMap.set('type', meta.type.value);
|
|
32705
32738
|
if (meta.isStandalone !== undefined) {
|
|
@@ -33118,7 +33151,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
33118
33151
|
function compileDeclareFactoryFunction(meta) {
|
|
33119
33152
|
const definitionMap = new DefinitionMap();
|
|
33120
33153
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
33121
|
-
definitionMap.set('version', literal('19.1.
|
|
33154
|
+
definitionMap.set('version', literal('19.1.4'));
|
|
33122
33155
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33123
33156
|
definitionMap.set('type', meta.type.value);
|
|
33124
33157
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -33153,7 +33186,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
33153
33186
|
function createInjectableDefinitionMap(meta) {
|
|
33154
33187
|
const definitionMap = new DefinitionMap();
|
|
33155
33188
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
33156
|
-
definitionMap.set('version', literal('19.1.
|
|
33189
|
+
definitionMap.set('version', literal('19.1.4'));
|
|
33157
33190
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33158
33191
|
definitionMap.set('type', meta.type.value);
|
|
33159
33192
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -33204,7 +33237,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
33204
33237
|
function createInjectorDefinitionMap(meta) {
|
|
33205
33238
|
const definitionMap = new DefinitionMap();
|
|
33206
33239
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
33207
|
-
definitionMap.set('version', literal('19.1.
|
|
33240
|
+
definitionMap.set('version', literal('19.1.4'));
|
|
33208
33241
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33209
33242
|
definitionMap.set('type', meta.type.value);
|
|
33210
33243
|
definitionMap.set('providers', meta.providers);
|
|
@@ -33237,7 +33270,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
33237
33270
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
33238
33271
|
}
|
|
33239
33272
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
33240
|
-
definitionMap.set('version', literal('19.1.
|
|
33273
|
+
definitionMap.set('version', literal('19.1.4'));
|
|
33241
33274
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33242
33275
|
definitionMap.set('type', meta.type.value);
|
|
33243
33276
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -33288,7 +33321,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
33288
33321
|
function createPipeDefinitionMap(meta) {
|
|
33289
33322
|
const definitionMap = new DefinitionMap();
|
|
33290
33323
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
33291
|
-
definitionMap.set('version', literal('19.1.
|
|
33324
|
+
definitionMap.set('version', literal('19.1.4'));
|
|
33292
33325
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
33293
33326
|
// e.g. `type: MyPipe`
|
|
33294
33327
|
definitionMap.set('type', meta.type.value);
|