@angular/compiler 18.0.0-rc.0 → 18.0.0-rc.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.
- package/esm2022/src/render3/partial/class_metadata.mjs +2 -2
- package/esm2022/src/render3/partial/directive.mjs +1 -1
- package/esm2022/src/render3/partial/factory.mjs +1 -1
- package/esm2022/src/render3/partial/injectable.mjs +1 -1
- package/esm2022/src/render3/partial/injector.mjs +1 -1
- package/esm2022/src/render3/partial/ng_module.mjs +1 -1
- package/esm2022/src/render3/partial/pipe.mjs +1 -1
- package/esm2022/src/schema/dom_element_schema_registry.mjs +31 -1
- package/esm2022/src/shadow_css.mjs +14 -9
- package/esm2022/src/version.mjs +1 -1
- package/fesm2022/compiler.mjs +53 -18
- 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 v18.0.0-rc.
|
|
2
|
+
* @license Angular v18.0.0-rc.1
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7659,8 +7659,8 @@ class ShadowCss {
|
|
|
7659
7659
|
}
|
|
7660
7660
|
_scopeSelector(selector, scopeSelector, hostSelector) {
|
|
7661
7661
|
return selector
|
|
7662
|
-
.split(
|
|
7663
|
-
.map((part) => part.
|
|
7662
|
+
.split(/ ?, ?/)
|
|
7663
|
+
.map((part) => part.split(_shadowDeepSelectors))
|
|
7664
7664
|
.map((deepParts) => {
|
|
7665
7665
|
const [shallowPart, ...otherParts] = deepParts;
|
|
7666
7666
|
const applyScope = (shallowPart) => {
|
|
@@ -7710,9 +7710,9 @@ class ShadowCss {
|
|
|
7710
7710
|
const _scopeSelectorPart = (p) => {
|
|
7711
7711
|
let scopedP = p.trim();
|
|
7712
7712
|
if (!scopedP) {
|
|
7713
|
-
return
|
|
7713
|
+
return p;
|
|
7714
7714
|
}
|
|
7715
|
-
if (p.
|
|
7715
|
+
if (p.includes(_polyfillHostNoCombinator)) {
|
|
7716
7716
|
scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector);
|
|
7717
7717
|
}
|
|
7718
7718
|
else {
|
|
@@ -7744,12 +7744,17 @@ class ShadowCss {
|
|
|
7744
7744
|
// - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
|
|
7745
7745
|
// - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
|
|
7746
7746
|
// `:host-context(tag)`)
|
|
7747
|
-
const hasHost = selector.
|
|
7747
|
+
const hasHost = selector.includes(_polyfillHostNoCombinator);
|
|
7748
7748
|
// Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
|
|
7749
7749
|
let shouldScope = !hasHost;
|
|
7750
7750
|
while ((res = sep.exec(selector)) !== null) {
|
|
7751
7751
|
const separator = res[1];
|
|
7752
|
-
|
|
7752
|
+
// Do not trim the selector, as otherwise this will break sourcemaps
|
|
7753
|
+
// when they are defined on multiple lines
|
|
7754
|
+
// Example:
|
|
7755
|
+
// div,
|
|
7756
|
+
// p { color: red}
|
|
7757
|
+
const part = selector.slice(startIndex, res.index);
|
|
7753
7758
|
// A space following an escaped hex value and followed by another hex character
|
|
7754
7759
|
// (ie: ".\fc ber" for ".über") is not a separator between 2 selectors
|
|
7755
7760
|
// also keep in mind that backslashes are replaced by a placeholder by SafeSelector
|
|
@@ -7757,13 +7762,13 @@ class ShadowCss {
|
|
|
7757
7762
|
if (part.match(/__esc-ph-(\d+)__/) && selector[res.index + 1]?.match(/[a-fA-F\d]/)) {
|
|
7758
7763
|
continue;
|
|
7759
7764
|
}
|
|
7760
|
-
shouldScope = shouldScope || part.
|
|
7765
|
+
shouldScope = shouldScope || part.includes(_polyfillHostNoCombinator);
|
|
7761
7766
|
const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
|
|
7762
7767
|
scopedSelector += `${scopedPart} ${separator} `;
|
|
7763
7768
|
startIndex = sep.lastIndex;
|
|
7764
7769
|
}
|
|
7765
7770
|
const part = selector.substring(startIndex);
|
|
7766
|
-
shouldScope = shouldScope || part.
|
|
7771
|
+
shouldScope = shouldScope || part.includes(_polyfillHostNoCombinator);
|
|
7767
7772
|
scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
|
|
7768
7773
|
// replace the placeholders with their original values
|
|
7769
7774
|
return safeContent.restore(scopedSelector);
|
|
@@ -14684,6 +14689,36 @@ const SCHEMA = [
|
|
|
14684
14689
|
'summary^[HTMLElement]|',
|
|
14685
14690
|
'time^[HTMLElement]|dateTime',
|
|
14686
14691
|
':svg:cursor^:svg:|',
|
|
14692
|
+
':math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex',
|
|
14693
|
+
':math:math^:math:|',
|
|
14694
|
+
':math:maction^:math:|',
|
|
14695
|
+
':math:menclose^:math:|',
|
|
14696
|
+
':math:merror^:math:|',
|
|
14697
|
+
':math:mfenced^:math:|',
|
|
14698
|
+
':math:mfrac^:math:|',
|
|
14699
|
+
':math:mi^:math:|',
|
|
14700
|
+
':math:mmultiscripts^:math:|',
|
|
14701
|
+
':math:mn^:math:|',
|
|
14702
|
+
':math:mo^:math:|',
|
|
14703
|
+
':math:mover^:math:|',
|
|
14704
|
+
':math:mpadded^:math:|',
|
|
14705
|
+
':math:mphantom^:math:|',
|
|
14706
|
+
':math:mroot^:math:|',
|
|
14707
|
+
':math:mrow^:math:|',
|
|
14708
|
+
':math:ms^:math:|',
|
|
14709
|
+
':math:mspace^:math:|',
|
|
14710
|
+
':math:msqrt^:math:|',
|
|
14711
|
+
':math:mstyle^:math:|',
|
|
14712
|
+
':math:msub^:math:|',
|
|
14713
|
+
':math:msubsup^:math:|',
|
|
14714
|
+
':math:msup^:math:|',
|
|
14715
|
+
':math:mtable^:math:|',
|
|
14716
|
+
':math:mtd^:math:|',
|
|
14717
|
+
':math:mtext^:math:|',
|
|
14718
|
+
':math:mtr^:math:|',
|
|
14719
|
+
':math:munder^:math:|',
|
|
14720
|
+
':math:munderover^:math:|',
|
|
14721
|
+
':math:semantics^:math:|',
|
|
14687
14722
|
];
|
|
14688
14723
|
const _ATTR_TO_PROP = new Map(Object.entries({
|
|
14689
14724
|
'class': 'className',
|
|
@@ -29021,7 +29056,7 @@ function publishFacade(global) {
|
|
|
29021
29056
|
* @description
|
|
29022
29057
|
* Entry point for all public APIs of the compiler package.
|
|
29023
29058
|
*/
|
|
29024
|
-
const VERSION = new Version('18.0.0-rc.
|
|
29059
|
+
const VERSION = new Version('18.0.0-rc.1');
|
|
29025
29060
|
|
|
29026
29061
|
class CompilerConfig {
|
|
29027
29062
|
constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters, } = {}) {
|
|
@@ -30652,7 +30687,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
30652
30687
|
function compileDeclareClassMetadata(metadata) {
|
|
30653
30688
|
const definitionMap = new DefinitionMap();
|
|
30654
30689
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
30655
|
-
definitionMap.set('version', literal('18.0.0-rc.
|
|
30690
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
30656
30691
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30657
30692
|
definitionMap.set('type', metadata.type);
|
|
30658
30693
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -30670,7 +30705,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
30670
30705
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
30671
30706
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
30672
30707
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
30673
|
-
definitionMap.set('version', literal('18.0.0-rc.
|
|
30708
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
30674
30709
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30675
30710
|
definitionMap.set('type', metadata.type);
|
|
30676
30711
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -30765,7 +30800,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
30765
30800
|
const definitionMap = new DefinitionMap();
|
|
30766
30801
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
30767
30802
|
definitionMap.set('minVersion', literal(minVersion));
|
|
30768
|
-
definitionMap.set('version', literal('18.0.0-rc.
|
|
30803
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
30769
30804
|
// e.g. `type: MyDirective`
|
|
30770
30805
|
definitionMap.set('type', meta.type.value);
|
|
30771
30806
|
if (meta.isStandalone) {
|
|
@@ -31187,7 +31222,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
31187
31222
|
function compileDeclareFactoryFunction(meta) {
|
|
31188
31223
|
const definitionMap = new DefinitionMap();
|
|
31189
31224
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
31190
|
-
definitionMap.set('version', literal('18.0.0-rc.
|
|
31225
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31191
31226
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31192
31227
|
definitionMap.set('type', meta.type.value);
|
|
31193
31228
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -31222,7 +31257,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
31222
31257
|
function createInjectableDefinitionMap(meta) {
|
|
31223
31258
|
const definitionMap = new DefinitionMap();
|
|
31224
31259
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
31225
|
-
definitionMap.set('version', literal('18.0.0-rc.
|
|
31260
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31226
31261
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31227
31262
|
definitionMap.set('type', meta.type.value);
|
|
31228
31263
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -31273,7 +31308,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
31273
31308
|
function createInjectorDefinitionMap(meta) {
|
|
31274
31309
|
const definitionMap = new DefinitionMap();
|
|
31275
31310
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
31276
|
-
definitionMap.set('version', literal('18.0.0-rc.
|
|
31311
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31277
31312
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31278
31313
|
definitionMap.set('type', meta.type.value);
|
|
31279
31314
|
definitionMap.set('providers', meta.providers);
|
|
@@ -31306,7 +31341,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
31306
31341
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
31307
31342
|
}
|
|
31308
31343
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
31309
|
-
definitionMap.set('version', literal('18.0.0-rc.
|
|
31344
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31310
31345
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31311
31346
|
definitionMap.set('type', meta.type.value);
|
|
31312
31347
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -31357,7 +31392,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
31357
31392
|
function createPipeDefinitionMap(meta) {
|
|
31358
31393
|
const definitionMap = new DefinitionMap();
|
|
31359
31394
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
31360
|
-
definitionMap.set('version', literal('18.0.0-rc.
|
|
31395
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31361
31396
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31362
31397
|
// e.g. `type: MyPipe`
|
|
31363
31398
|
definitionMap.set('type', meta.type.value);
|