@angular/compiler 18.0.0-next.6 → 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/i18n/serializers/xmb.mjs +11 -2
- 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/template/pipeline/src/ingest.mjs +4 -2
- package/esm2022/src/version.mjs +1 -1
- package/fesm2022/compiler.mjs +66 -20
- package/fesm2022/compiler.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
package/esm2022/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('18.0.0-
|
|
14
|
+
export const VERSION = new Version('18.0.0-rc.1');
|
|
15
15
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbXBpbGVyL3NyYy92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVIOzs7O0dBSUc7QUFFSCxPQUFPLEVBQUMsT0FBTyxFQUFDLE1BQU0sUUFBUSxDQUFDO0FBRS9CLE1BQU0sQ0FBQyxNQUFNLE9BQU8sR0FBRyxJQUFJLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBAbGljZW5zZVxuICogQ29weXJpZ2h0IEdvb2dsZSBMTEMgQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbiAqXG4gKiBVc2Ugb2YgdGhpcyBzb3VyY2UgY29kZSBpcyBnb3Zlcm5lZCBieSBhbiBNSVQtc3R5bGUgbGljZW5zZSB0aGF0IGNhbiBiZVxuICogZm91bmQgaW4gdGhlIExJQ0VOU0UgZmlsZSBhdCBodHRwczovL2FuZ3VsYXIuaW8vbGljZW5zZVxuICovXG5cbi8qKlxuICogQG1vZHVsZVxuICogQGRlc2NyaXB0aW9uXG4gKiBFbnRyeSBwb2ludCBmb3IgYWxsIHB1YmxpYyBBUElzIG9mIHRoZSBjb21waWxlciBwYWNrYWdlLlxuICovXG5cbmltcG9ydCB7VmVyc2lvbn0gZnJvbSAnLi91dGlsJztcblxuZXhwb3J0IGNvbnN0IFZFUlNJT04gPSBuZXcgVmVyc2lvbignMC4wLjAtUExBQ0VIT0xERVInKTtcbiJdfQ==
|
package/fesm2022/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v18.0.0-
|
|
2
|
+
* @license Angular v18.0.0-rc.1
|
|
3
3
|
* (c) 2010-2024 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -5608,6 +5608,14 @@ function escapeXml(text) {
|
|
|
5608
5608
|
return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text);
|
|
5609
5609
|
}
|
|
5610
5610
|
|
|
5611
|
+
/**
|
|
5612
|
+
* Defines the `handler` value on the serialized XMB, indicating that Angular
|
|
5613
|
+
* generated the bundle. This is useful for analytics in Translation Console.
|
|
5614
|
+
*
|
|
5615
|
+
* NOTE: Keep in sync with
|
|
5616
|
+
* packages/localize/tools/src/extract/translation_files/xmb_translation_serializer.ts.
|
|
5617
|
+
*/
|
|
5618
|
+
const _XMB_HANDLER = 'angular';
|
|
5611
5619
|
const _MESSAGES_TAG = 'messagebundle';
|
|
5612
5620
|
const _MESSAGE_TAG = 'msg';
|
|
5613
5621
|
const _PLACEHOLDER_TAG$3 = 'ph';
|
|
@@ -5636,7 +5644,8 @@ class Xmb extends Serializer {
|
|
|
5636
5644
|
write(messages, locale) {
|
|
5637
5645
|
const exampleVisitor = new ExampleVisitor();
|
|
5638
5646
|
const visitor = new _Visitor$1();
|
|
5639
|
-
|
|
5647
|
+
const rootNode = new Tag(_MESSAGES_TAG);
|
|
5648
|
+
rootNode.attrs['handler'] = _XMB_HANDLER;
|
|
5640
5649
|
messages.forEach((message) => {
|
|
5641
5650
|
const attrs = { id: message.id };
|
|
5642
5651
|
if (message.description) {
|
|
@@ -7650,8 +7659,8 @@ class ShadowCss {
|
|
|
7650
7659
|
}
|
|
7651
7660
|
_scopeSelector(selector, scopeSelector, hostSelector) {
|
|
7652
7661
|
return selector
|
|
7653
|
-
.split(
|
|
7654
|
-
.map((part) => part.
|
|
7662
|
+
.split(/ ?, ?/)
|
|
7663
|
+
.map((part) => part.split(_shadowDeepSelectors))
|
|
7655
7664
|
.map((deepParts) => {
|
|
7656
7665
|
const [shallowPart, ...otherParts] = deepParts;
|
|
7657
7666
|
const applyScope = (shallowPart) => {
|
|
@@ -7701,9 +7710,9 @@ class ShadowCss {
|
|
|
7701
7710
|
const _scopeSelectorPart = (p) => {
|
|
7702
7711
|
let scopedP = p.trim();
|
|
7703
7712
|
if (!scopedP) {
|
|
7704
|
-
return
|
|
7713
|
+
return p;
|
|
7705
7714
|
}
|
|
7706
|
-
if (p.
|
|
7715
|
+
if (p.includes(_polyfillHostNoCombinator)) {
|
|
7707
7716
|
scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector);
|
|
7708
7717
|
}
|
|
7709
7718
|
else {
|
|
@@ -7735,12 +7744,17 @@ class ShadowCss {
|
|
|
7735
7744
|
// - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything)
|
|
7736
7745
|
// - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a
|
|
7737
7746
|
// `:host-context(tag)`)
|
|
7738
|
-
const hasHost = selector.
|
|
7747
|
+
const hasHost = selector.includes(_polyfillHostNoCombinator);
|
|
7739
7748
|
// Only scope parts after the first `-shadowcsshost-no-combinator` when it is present
|
|
7740
7749
|
let shouldScope = !hasHost;
|
|
7741
7750
|
while ((res = sep.exec(selector)) !== null) {
|
|
7742
7751
|
const separator = res[1];
|
|
7743
|
-
|
|
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);
|
|
7744
7758
|
// A space following an escaped hex value and followed by another hex character
|
|
7745
7759
|
// (ie: ".\fc ber" for ".über") is not a separator between 2 selectors
|
|
7746
7760
|
// also keep in mind that backslashes are replaced by a placeholder by SafeSelector
|
|
@@ -7748,13 +7762,13 @@ class ShadowCss {
|
|
|
7748
7762
|
if (part.match(/__esc-ph-(\d+)__/) && selector[res.index + 1]?.match(/[a-fA-F\d]/)) {
|
|
7749
7763
|
continue;
|
|
7750
7764
|
}
|
|
7751
|
-
shouldScope = shouldScope || part.
|
|
7765
|
+
shouldScope = shouldScope || part.includes(_polyfillHostNoCombinator);
|
|
7752
7766
|
const scopedPart = shouldScope ? _scopeSelectorPart(part) : part;
|
|
7753
7767
|
scopedSelector += `${scopedPart} ${separator} `;
|
|
7754
7768
|
startIndex = sep.lastIndex;
|
|
7755
7769
|
}
|
|
7756
7770
|
const part = selector.substring(startIndex);
|
|
7757
|
-
shouldScope = shouldScope || part.
|
|
7771
|
+
shouldScope = shouldScope || part.includes(_polyfillHostNoCombinator);
|
|
7758
7772
|
scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
|
|
7759
7773
|
// replace the placeholders with their original values
|
|
7760
7774
|
return safeContent.restore(scopedSelector);
|
|
@@ -14675,6 +14689,36 @@ const SCHEMA = [
|
|
|
14675
14689
|
'summary^[HTMLElement]|',
|
|
14676
14690
|
'time^[HTMLElement]|dateTime',
|
|
14677
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:|',
|
|
14678
14722
|
];
|
|
14679
14723
|
const _ATTR_TO_PROP = new Map(Object.entries({
|
|
14680
14724
|
'class': 'className',
|
|
@@ -23907,14 +23951,16 @@ function ingestContent(unit, content) {
|
|
|
23907
23951
|
if (content.i18n !== undefined && !(content.i18n instanceof TagPlaceholder)) {
|
|
23908
23952
|
throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
|
|
23909
23953
|
}
|
|
23910
|
-
const id = unit.job.allocateXrefId();
|
|
23911
23954
|
let fallbackView = null;
|
|
23912
23955
|
// Don't capture default content that's only made up of empty text nodes and comments.
|
|
23956
|
+
// Note that we process the default content before the projection in order to match the
|
|
23957
|
+
// insertion order at runtime.
|
|
23913
23958
|
if (content.children.some((child) => !(child instanceof Comment$1) &&
|
|
23914
23959
|
(!(child instanceof Text$3) || child.value.trim().length > 0))) {
|
|
23915
23960
|
fallbackView = unit.job.allocateView(unit.xref);
|
|
23916
23961
|
ingestNodes(fallbackView, content.children);
|
|
23917
23962
|
}
|
|
23963
|
+
const id = unit.job.allocateXrefId();
|
|
23918
23964
|
const op = createProjectionOp(id, content.selector, content.i18n, fallbackView?.xref ?? null, content.sourceSpan);
|
|
23919
23965
|
for (const attr of content.attributes) {
|
|
23920
23966
|
const securityContext = domSchema.securityContext(content.name, attr.name, true);
|
|
@@ -29010,7 +29056,7 @@ function publishFacade(global) {
|
|
|
29010
29056
|
* @description
|
|
29011
29057
|
* Entry point for all public APIs of the compiler package.
|
|
29012
29058
|
*/
|
|
29013
|
-
const VERSION = new Version('18.0.0-
|
|
29059
|
+
const VERSION = new Version('18.0.0-rc.1');
|
|
29014
29060
|
|
|
29015
29061
|
class CompilerConfig {
|
|
29016
29062
|
constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, preserveWhitespaces, strictInjectionParameters, } = {}) {
|
|
@@ -30641,7 +30687,7 @@ const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0';
|
|
|
30641
30687
|
function compileDeclareClassMetadata(metadata) {
|
|
30642
30688
|
const definitionMap = new DefinitionMap();
|
|
30643
30689
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
30644
|
-
definitionMap.set('version', literal('18.0.0-
|
|
30690
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
30645
30691
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30646
30692
|
definitionMap.set('type', metadata.type);
|
|
30647
30693
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -30659,7 +30705,7 @@ function compileComponentDeclareClassMetadata(metadata, dependencies) {
|
|
|
30659
30705
|
callbackReturnDefinitionMap.set('ctorParameters', metadata.ctorParameters ?? literal(null));
|
|
30660
30706
|
callbackReturnDefinitionMap.set('propDecorators', metadata.propDecorators ?? literal(null));
|
|
30661
30707
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION));
|
|
30662
|
-
definitionMap.set('version', literal('18.0.0-
|
|
30708
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
30663
30709
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
30664
30710
|
definitionMap.set('type', metadata.type);
|
|
30665
30711
|
definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies));
|
|
@@ -30754,7 +30800,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
30754
30800
|
const definitionMap = new DefinitionMap();
|
|
30755
30801
|
const minVersion = getMinimumVersionForPartialOutput(meta);
|
|
30756
30802
|
definitionMap.set('minVersion', literal(minVersion));
|
|
30757
|
-
definitionMap.set('version', literal('18.0.0-
|
|
30803
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
30758
30804
|
// e.g. `type: MyDirective`
|
|
30759
30805
|
definitionMap.set('type', meta.type.value);
|
|
30760
30806
|
if (meta.isStandalone) {
|
|
@@ -31176,7 +31222,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
31176
31222
|
function compileDeclareFactoryFunction(meta) {
|
|
31177
31223
|
const definitionMap = new DefinitionMap();
|
|
31178
31224
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
31179
|
-
definitionMap.set('version', literal('18.0.0-
|
|
31225
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31180
31226
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31181
31227
|
definitionMap.set('type', meta.type.value);
|
|
31182
31228
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -31211,7 +31257,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
31211
31257
|
function createInjectableDefinitionMap(meta) {
|
|
31212
31258
|
const definitionMap = new DefinitionMap();
|
|
31213
31259
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
31214
|
-
definitionMap.set('version', literal('18.0.0-
|
|
31260
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31215
31261
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31216
31262
|
definitionMap.set('type', meta.type.value);
|
|
31217
31263
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -31262,7 +31308,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
31262
31308
|
function createInjectorDefinitionMap(meta) {
|
|
31263
31309
|
const definitionMap = new DefinitionMap();
|
|
31264
31310
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
31265
|
-
definitionMap.set('version', literal('18.0.0-
|
|
31311
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31266
31312
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31267
31313
|
definitionMap.set('type', meta.type.value);
|
|
31268
31314
|
definitionMap.set('providers', meta.providers);
|
|
@@ -31295,7 +31341,7 @@ function createNgModuleDefinitionMap(meta) {
|
|
|
31295
31341
|
throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path');
|
|
31296
31342
|
}
|
|
31297
31343
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
31298
|
-
definitionMap.set('version', literal('18.0.0-
|
|
31344
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31299
31345
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31300
31346
|
definitionMap.set('type', meta.type.value);
|
|
31301
31347
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -31346,7 +31392,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
31346
31392
|
function createPipeDefinitionMap(meta) {
|
|
31347
31393
|
const definitionMap = new DefinitionMap();
|
|
31348
31394
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
31349
|
-
definitionMap.set('version', literal('18.0.0-
|
|
31395
|
+
definitionMap.set('version', literal('18.0.0-rc.1'));
|
|
31350
31396
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
31351
31397
|
// e.g. `type: MyPipe`
|
|
31352
31398
|
definitionMap.set('type', meta.type.value);
|