@stencil/core 5.0.0-alpha.2 → 5.0.0-alpha.3
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/dist/{client-DucyoZT4.mjs → client-CSm3x5ke.mjs} +81 -60
- package/dist/compiler/index.d.mts +3 -3
- package/dist/compiler/index.mjs +2 -2
- package/dist/compiler/utils/index.d.mts +2 -2
- package/dist/compiler/utils/index.mjs +3 -3
- package/dist/{compiler-DyK1_szo.mjs → compiler-D6iP7Bzb.mjs} +1390 -1631
- package/dist/declarations/stencil-public-compiler.d.ts +4031 -2
- package/dist/declarations/stencil-public-compiler.js +0 -1
- package/dist/declarations/stencil-public-docs.d.ts +494 -1
- package/dist/declarations/stencil-public-runtime.d.ts +1943 -2
- package/dist/{index-fIuYTL9f.d.mts → index-CXHCTQNt.d.mts} +14 -2
- package/dist/{index-BONzXKJt.d.ts → index-CyrGY82h.d.ts} +5 -7
- package/dist/{index-CHjZtib0.d.ts → index-hS-KBdAP.d.ts} +1 -1
- package/dist/{index-D-LlB2nw.d.mts → index-tUR6pD3J.d.mts} +145 -809
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +2 -2
- package/dist/{jsx-runtime-DBzBJLKk.d.ts → jsx-runtime-DlDkTqps.d.ts} +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/{node-BWBQAh8C.mjs → node-Bg-mO5dw.mjs} +3 -14
- package/dist/regular-expression-D5pGVpCu.mjs +415 -0
- package/dist/runtime/app-data/index.d.ts +1 -1
- package/dist/runtime/app-data/index.js +1 -2
- package/dist/runtime/client/index.d.ts +14 -4
- package/dist/runtime/client/index.js +103 -205
- package/dist/runtime/index.d.ts +16 -4
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/server/index.d.mts +1 -3
- package/dist/runtime/server/index.mjs +103 -205
- package/dist/runtime/server/runner.d.mts +1 -17
- package/dist/runtime/server/runner.mjs +12 -394
- package/dist/{runtime-CqlPYKjW.js → runtime-BBCnuprF.js} +103 -205
- package/dist/sys/node/index.d.mts +1 -1
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.mjs +2 -2
- package/dist/testing/index.d.mts +3 -3
- package/dist/testing/index.mjs +18 -17
- package/dist/{validation-BR7tMYEv.mjs → validation-Byxie0Uk.mjs} +28 -24
- package/package.json +9 -13
- package/dist/serialize-o-Sj1lvg.mjs +0 -792
- package/dist/stencil-public-compiler-C_X1iolo.d.ts +0 -4455
- package/dist/stencil-public-runtime-DlV8o7-z.d.ts +0 -1845
|
@@ -36,8 +36,7 @@ const LISTENER_FLAGS = {
|
|
|
36
36
|
Capture: 2,
|
|
37
37
|
TargetDocument: 4,
|
|
38
38
|
TargetWindow: 8,
|
|
39
|
-
TargetBody: 16
|
|
40
|
-
TargetParent: 32
|
|
39
|
+
TargetBody: 16
|
|
41
40
|
};
|
|
42
41
|
const HOST_FLAGS = {
|
|
43
42
|
hasConnected: 1,
|
|
@@ -73,7 +72,12 @@ const CMP_FLAGS = {
|
|
|
73
72
|
shadowNeedsScopedCss: 128,
|
|
74
73
|
hasSlot: 256,
|
|
75
74
|
hasModernPropertyDecls: 512,
|
|
76
|
-
shadowSlotAssignmentManual: 1024
|
|
75
|
+
shadowSlotAssignmentManual: 1024,
|
|
76
|
+
shadowModeClosed: 2048,
|
|
77
|
+
patchChildren: 4096,
|
|
78
|
+
patchClone: 8192,
|
|
79
|
+
patchInsert: 16384,
|
|
80
|
+
patchAll: 32768
|
|
77
81
|
};
|
|
78
82
|
/**
|
|
79
83
|
* Namespaces
|
|
@@ -104,38 +108,6 @@ const NODE_TYPES = {
|
|
|
104
108
|
DOCUMENT_FRAGMENT_NODE: 11,
|
|
105
109
|
NOTATION_NODE: 12
|
|
106
110
|
};
|
|
107
|
-
/**
|
|
108
|
-
* Represents a primitive type.
|
|
109
|
-
* Described in https://w3c.github.io/webdriver-bidi/#type-script-PrimitiveProtocolValue.
|
|
110
|
-
*/
|
|
111
|
-
const PrimitiveType = {
|
|
112
|
-
Undefined: "undefined",
|
|
113
|
-
Null: "null",
|
|
114
|
-
String: "string",
|
|
115
|
-
Number: "number",
|
|
116
|
-
SpecialNumber: "number",
|
|
117
|
-
Boolean: "boolean",
|
|
118
|
-
BigInt: "bigint"
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Represents a non-primitive type.
|
|
122
|
-
* Described in https://w3c.github.io/webdriver-bidi/#type-script-RemoteValue.
|
|
123
|
-
* @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead.
|
|
124
|
-
*/
|
|
125
|
-
const NonPrimitiveType = {
|
|
126
|
-
Array: "array",
|
|
127
|
-
Date: "date",
|
|
128
|
-
Map: "map",
|
|
129
|
-
Object: "object",
|
|
130
|
-
RegularExpression: "regexp",
|
|
131
|
-
Set: "set",
|
|
132
|
-
Channel: "channel",
|
|
133
|
-
Symbol: "symbol"
|
|
134
|
-
};
|
|
135
|
-
/** @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead. */
|
|
136
|
-
const TYPE_CONSTANT = "type";
|
|
137
|
-
/** @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead. */
|
|
138
|
-
const VALUE_CONSTANT = "value";
|
|
139
111
|
//#endregion
|
|
140
112
|
//#region src/utils/get-prop-descriptor.ts
|
|
141
113
|
/**
|
|
@@ -270,7 +242,7 @@ const cmpModules = /* @__PURE__ */ new Map();
|
|
|
270
242
|
* where here in the source code it must be like this, so that an undesirable
|
|
271
243
|
* transformation that Esbuild would otherwise carry out doesn't occur, but we
|
|
272
244
|
* actually need to then manually edit the bundled Esbuild code later on to fix
|
|
273
|
-
* that. We do this with plugins in the Esbuild and
|
|
245
|
+
* that. We do this with plugins in the Esbuild and Rolldown bundles which
|
|
274
246
|
* include this file.
|
|
275
247
|
*/
|
|
276
248
|
const MODULE_IMPORT_PREFIX = "./";
|
|
@@ -476,12 +448,14 @@ function createStyleSheetIfNeededAndSupported(styles) {
|
|
|
476
448
|
//#region src/utils/shadow-root.ts
|
|
477
449
|
let globalStyleSheet;
|
|
478
450
|
function createShadowRoot(cmpMeta) {
|
|
479
|
-
const
|
|
451
|
+
const isClosed = BUILD.shadowModeClosed && !!(cmpMeta.$flags$ & CMP_FLAGS.shadowModeClosed);
|
|
452
|
+
const opts = { mode: isClosed ? "closed" : "open" };
|
|
480
453
|
if (BUILD.shadowDelegatesFocus) opts.delegatesFocus = !!(cmpMeta.$flags$ & CMP_FLAGS.shadowDelegatesFocus);
|
|
481
454
|
if (BUILD.shadowSlotAssignmentManual) {
|
|
482
455
|
if (!!(cmpMeta.$flags$ & CMP_FLAGS.shadowSlotAssignmentManual)) opts.slotAssignment = "manual";
|
|
483
456
|
}
|
|
484
457
|
const shadowRoot = this.attachShadow(opts);
|
|
458
|
+
if (BUILD.shadowModeClosed && isClosed) this.__shadowRoot = shadowRoot;
|
|
485
459
|
if (globalStyleSheet === void 0) globalStyleSheet = createStyleSheetIfNeededAndSupported("") ?? null;
|
|
486
460
|
if (globalStyleSheet) if (supportsMutableAdoptedStyleSheets) shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
|
|
487
461
|
else shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
|
|
@@ -1127,6 +1101,24 @@ function internalCall(node, method) {
|
|
|
1127
1101
|
}
|
|
1128
1102
|
}
|
|
1129
1103
|
//#endregion
|
|
1104
|
+
//#region src/runtime/element.ts
|
|
1105
|
+
const getElement = (ref) => BUILD.lazyLoad ? getHostRef(ref)?.$hostElement$ : ref;
|
|
1106
|
+
/**
|
|
1107
|
+
* Get the shadow root for a Stencil component's host element.
|
|
1108
|
+
* This works for both open and closed shadow DOM modes.
|
|
1109
|
+
*
|
|
1110
|
+
* For closed shadow DOM, `element.shadowRoot` returns `null` by design,
|
|
1111
|
+
* but Stencil stores the reference internally so components can still
|
|
1112
|
+
* access their own shadow root.
|
|
1113
|
+
*
|
|
1114
|
+
* @param element The host element (from @Element() decorator)
|
|
1115
|
+
* @returns The shadow root, or null if no shadow root exists
|
|
1116
|
+
*/
|
|
1117
|
+
const getShadowRoot = (element) => {
|
|
1118
|
+
if (BUILD.shadowModeClosed && element.__shadowRoot) return element.__shadowRoot;
|
|
1119
|
+
return element.shadowRoot;
|
|
1120
|
+
};
|
|
1121
|
+
//#endregion
|
|
1130
1122
|
//#region src/runtime/profile.ts
|
|
1131
1123
|
let i = 0;
|
|
1132
1124
|
const createTime = (fnName, tagName = "") => {
|
|
@@ -1303,7 +1295,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1303
1295
|
if (!BUILD.attachStyles || !win.document) return scopeId;
|
|
1304
1296
|
let style = styles.get(scopeId);
|
|
1305
1297
|
if (cmpMeta.$flags$ & CMP_FLAGS.hasSlotRelocation) style = getStyleWithSlotCss(style);
|
|
1306
|
-
|
|
1298
|
+
const isClosedShadowSSR = BUILD.hydrateServerSide && BUILD.shadowModeClosed && cmpMeta.$flags$ & CMP_FLAGS.shadowNeedsScopedCss && cmpMeta.$flags$ & CMP_FLAGS.shadowModeClosed;
|
|
1299
|
+
if (styleContainerNode.nodeType !== NODE_TYPE.DocumentFragment && !isClosedShadowSSR) styleContainerNode = win.document;
|
|
1307
1300
|
if (style) {
|
|
1308
1301
|
if (typeof style === "string") {
|
|
1309
1302
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -1353,7 +1346,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1353
1346
|
/**
|
|
1354
1347
|
* attach styles at the beginning of a shadow root node if we render shadow components
|
|
1355
1348
|
*/
|
|
1356
|
-
if (cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) styleContainerNode.
|
|
1349
|
+
if (cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) if (isClosedShadowSSR) styleContainerNode.prepend(styleElm);
|
|
1350
|
+
else styleContainerNode.insertBefore(styleElm, null);
|
|
1357
1351
|
if (appliedStyles) appliedStyles.add(scopeId);
|
|
1358
1352
|
}
|
|
1359
1353
|
} else if (BUILD.constructableCSS) {
|
|
@@ -1388,7 +1382,12 @@ const attachStyles = (hostRef) => {
|
|
|
1388
1382
|
const elm = hostRef.$hostElement$;
|
|
1389
1383
|
const flags = cmpMeta.$flags$;
|
|
1390
1384
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1391
|
-
|
|
1385
|
+
let styleContainerNode;
|
|
1386
|
+
const shadowRoot = BUILD.shadowDom && supportsShadow ? getShadowRoot(elm) : null;
|
|
1387
|
+
if (shadowRoot) styleContainerNode = shadowRoot;
|
|
1388
|
+
else if (BUILD.hydrateServerSide && BUILD.shadowModeClosed && flags & CMP_FLAGS.shadowNeedsScopedCss && flags & CMP_FLAGS.shadowModeClosed) styleContainerNode = elm;
|
|
1389
|
+
else styleContainerNode = elm.getRootNode();
|
|
1390
|
+
const scopeId = addStyle(styleContainerNode, cmpMeta, hostRef.$modeName$);
|
|
1392
1391
|
if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & CMP_FLAGS.needsScopedEncapsulation) {
|
|
1393
1392
|
elm["s-sc"] = scopeId;
|
|
1394
1393
|
elm.classList.add(scopeId + "-h");
|
|
@@ -1626,7 +1625,7 @@ const validateInputProperties = (inputElm) => {
|
|
|
1626
1625
|
*/
|
|
1627
1626
|
const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1628
1627
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1629
|
-
const shadowRoot = hostElm
|
|
1628
|
+
const shadowRoot = getShadowRoot(hostElm);
|
|
1630
1629
|
const childRenderNodes = [];
|
|
1631
1630
|
const slotNodes = [];
|
|
1632
1631
|
const slottedNodes = [];
|
|
@@ -1707,7 +1706,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1707
1706
|
}
|
|
1708
1707
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
|
|
1709
1708
|
if (slottedItem.node.parentElement?.shadowRoot && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) slottedItem.node.removeAttribute("slot");
|
|
1710
|
-
if (BUILD.experimentalSlotFixes) patchSlottedNode(slottedItem.node);
|
|
1709
|
+
if (BUILD.experimentalSlotFixes || BUILD.patchAll && hostRef.$cmpMeta$.$flags$ & CMP_FLAGS.patchAll) patchSlottedNode(slottedItem.node);
|
|
1711
1710
|
}
|
|
1712
1711
|
currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
|
|
1713
1712
|
}
|
|
@@ -2029,9 +2028,12 @@ const _polyfillHost = "-shadowcsshost";
|
|
|
2029
2028
|
const _polyfillSlotted = "-shadowcssslotted";
|
|
2030
2029
|
const _polyfillHostContext = "-shadowcsscontext";
|
|
2031
2030
|
const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2031
|
+
let _cssColonHostRe;
|
|
2032
|
+
let _cssColonHostContextRe;
|
|
2033
|
+
let _cssColonSlottedRe;
|
|
2034
|
+
const getCssColonHostRe = () => _cssColonHostRe ??= new RegExp("(" + _polyfillHost + _parenSuffix, "gim");
|
|
2035
|
+
const getCssColonHostContextRe = () => _cssColonHostContextRe ??= new RegExp("(" + _polyfillHostContext + _parenSuffix, "gim");
|
|
2036
|
+
const getCssColonSlottedRe = () => _cssColonSlottedRe ??= new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim");
|
|
2035
2037
|
const _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
|
|
2036
2038
|
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
2037
2039
|
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
@@ -2191,7 +2193,7 @@ const colonHostPartReplacer = (host, part, suffix) => {
|
|
|
2191
2193
|
return host + part.replace(_polyfillHost, "") + suffix;
|
|
2192
2194
|
};
|
|
2193
2195
|
const convertColonHost = (cssText) => {
|
|
2194
|
-
return convertColonRule(cssText,
|
|
2196
|
+
return convertColonRule(cssText, getCssColonHostRe(), colonHostPartReplacer);
|
|
2195
2197
|
};
|
|
2196
2198
|
const colonHostContextPartReplacer = (host, part, suffix) => {
|
|
2197
2199
|
if (part.indexOf(_polyfillHost) > -1) return colonHostPartReplacer(host, part, suffix);
|
|
@@ -2200,7 +2202,7 @@ const colonHostContextPartReplacer = (host, part, suffix) => {
|
|
|
2200
2202
|
const convertColonSlotted = (cssText, slotScopeId) => {
|
|
2201
2203
|
const slotClass = "." + slotScopeId + " > ";
|
|
2202
2204
|
const selectors = [];
|
|
2203
|
-
cssText = cssText.replace(
|
|
2205
|
+
cssText = cssText.replace(getCssColonSlottedRe(), (...m) => {
|
|
2204
2206
|
if (m[2]) {
|
|
2205
2207
|
const compound = m[2].trim();
|
|
2206
2208
|
const suffix = m[3];
|
|
@@ -2229,7 +2231,7 @@ const convertColonSlotted = (cssText, slotScopeId) => {
|
|
|
2229
2231
|
};
|
|
2230
2232
|
};
|
|
2231
2233
|
const convertColonHostContext = (cssText) => {
|
|
2232
|
-
return convertColonRule(cssText,
|
|
2234
|
+
return convertColonRule(cssText, getCssColonHostContextRe(), colonHostContextPartReplacer);
|
|
2233
2235
|
};
|
|
2234
2236
|
const convertShadowDOMSelectors = (cssText) => {
|
|
2235
2237
|
return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, " "), cssText);
|
|
@@ -2418,111 +2420,6 @@ const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) =>
|
|
|
2418
2420
|
const setMode = (handler) => modeResolutionChain.push(handler);
|
|
2419
2421
|
const getMode = (ref) => getHostRef(ref)?.$modeName$;
|
|
2420
2422
|
//#endregion
|
|
2421
|
-
//#region src/utils/remote-value.ts
|
|
2422
|
-
/**
|
|
2423
|
-
* RemoteValue class for deserializing LocalValue serialized objects back into their original form
|
|
2424
|
-
* @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead.
|
|
2425
|
-
*/
|
|
2426
|
-
var RemoteValue = class RemoteValue {
|
|
2427
|
-
/**
|
|
2428
|
-
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
2429
|
-
*
|
|
2430
|
-
* @param serialized The serialized LocalValue object
|
|
2431
|
-
* @returns The original JavaScript value/object
|
|
2432
|
-
*/
|
|
2433
|
-
static fromLocalValue(serialized) {
|
|
2434
|
-
const type = serialized[TYPE_CONSTANT];
|
|
2435
|
-
const value = "value" in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
2436
|
-
switch (type) {
|
|
2437
|
-
case PrimitiveType.String: return value;
|
|
2438
|
-
case PrimitiveType.Boolean: return value;
|
|
2439
|
-
case PrimitiveType.BigInt: return BigInt(value);
|
|
2440
|
-
case PrimitiveType.Undefined: return;
|
|
2441
|
-
case PrimitiveType.Null: return null;
|
|
2442
|
-
case PrimitiveType.Number:
|
|
2443
|
-
if (value === "NaN") return NaN;
|
|
2444
|
-
if (value === "-0") return -0;
|
|
2445
|
-
if (value === "Infinity") return Infinity;
|
|
2446
|
-
if (value === "-Infinity") return -Infinity;
|
|
2447
|
-
return value;
|
|
2448
|
-
case NonPrimitiveType.Array: return value.map((item) => RemoteValue.fromLocalValue(item));
|
|
2449
|
-
case NonPrimitiveType.Date: return new Date(value);
|
|
2450
|
-
case NonPrimitiveType.Map:
|
|
2451
|
-
const map = /* @__PURE__ */ new Map();
|
|
2452
|
-
for (const [key, val] of value) {
|
|
2453
|
-
const deserializedKey = typeof key === "object" && key !== null ? RemoteValue.fromLocalValue(key) : key;
|
|
2454
|
-
const deserializedValue = RemoteValue.fromLocalValue(val);
|
|
2455
|
-
map.set(deserializedKey, deserializedValue);
|
|
2456
|
-
}
|
|
2457
|
-
return map;
|
|
2458
|
-
case NonPrimitiveType.Object:
|
|
2459
|
-
const obj = {};
|
|
2460
|
-
for (const [key, val] of value) obj[key] = RemoteValue.fromLocalValue(val);
|
|
2461
|
-
return obj;
|
|
2462
|
-
case NonPrimitiveType.RegularExpression:
|
|
2463
|
-
const { pattern, flags } = value;
|
|
2464
|
-
return new RegExp(pattern, flags);
|
|
2465
|
-
case NonPrimitiveType.Set:
|
|
2466
|
-
const set = /* @__PURE__ */ new Set();
|
|
2467
|
-
for (const item of value) set.add(RemoteValue.fromLocalValue(item));
|
|
2468
|
-
return set;
|
|
2469
|
-
case NonPrimitiveType.Symbol: return Symbol(value);
|
|
2470
|
-
default: throw new Error(`Unsupported type: ${type}`);
|
|
2471
|
-
}
|
|
2472
|
-
}
|
|
2473
|
-
/**
|
|
2474
|
-
* Utility method to deserialize multiple LocalValues at once
|
|
2475
|
-
*
|
|
2476
|
-
* @param serializedValues Array of serialized LocalValue objects
|
|
2477
|
-
* @returns Array of deserialized JavaScript values
|
|
2478
|
-
*/
|
|
2479
|
-
static fromLocalValueArray(serializedValues) {
|
|
2480
|
-
return serializedValues.map((value) => RemoteValue.fromLocalValue(value));
|
|
2481
|
-
}
|
|
2482
|
-
/**
|
|
2483
|
-
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
2484
|
-
*
|
|
2485
|
-
* @param obj Object to verify
|
|
2486
|
-
* @returns boolean indicating if the object has LocalValue structure
|
|
2487
|
-
*/
|
|
2488
|
-
static isLocalValueObject(obj) {
|
|
2489
|
-
if (typeof obj !== "object" || obj === null) return false;
|
|
2490
|
-
if (!obj.hasOwnProperty("type")) return false;
|
|
2491
|
-
const type = obj[TYPE_CONSTANT];
|
|
2492
|
-
if (!Object.values({
|
|
2493
|
-
...PrimitiveType,
|
|
2494
|
-
...NonPrimitiveType
|
|
2495
|
-
}).includes(type)) return false;
|
|
2496
|
-
if (type !== PrimitiveType.Null && type !== PrimitiveType.Undefined) return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
2497
|
-
return true;
|
|
2498
|
-
}
|
|
2499
|
-
};
|
|
2500
|
-
//#endregion
|
|
2501
|
-
//#region src/utils/serialize.ts
|
|
2502
|
-
/**
|
|
2503
|
-
* Unicode-safe base64 decoding that handles characters outside Latin1 range.
|
|
2504
|
-
* Unlike atob(), this properly decodes Unicode characters including emoji,
|
|
2505
|
-
* CJK characters, and currency symbols like €.
|
|
2506
|
-
* @param {string} base64 - The base64 string to decode.
|
|
2507
|
-
* @returns {string} Decoded string.
|
|
2508
|
-
*/
|
|
2509
|
-
function decodeBase64Unicode(base64) {
|
|
2510
|
-
const binary = atob(base64);
|
|
2511
|
-
const bytes = new Uint8Array(binary.length);
|
|
2512
|
-
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
2513
|
-
return new TextDecoder().decode(bytes);
|
|
2514
|
-
}
|
|
2515
|
-
/**
|
|
2516
|
-
* Deserialize a value from a string that was serialized earlier.
|
|
2517
|
-
* @param {string} value - The string to deserialize.
|
|
2518
|
-
* @returns {unknown} The deserialized value.
|
|
2519
|
-
* @deprecated will be removed in v5. Use `@AttrDeserialize()` decorator instead.
|
|
2520
|
-
*/
|
|
2521
|
-
function deserializeProperty(value) {
|
|
2522
|
-
if (typeof value !== "string" || !value.startsWith("serialized:")) return value;
|
|
2523
|
-
return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(11))));
|
|
2524
|
-
}
|
|
2525
|
-
//#endregion
|
|
2526
2423
|
//#region src/runtime/parse-property-value.ts
|
|
2527
2424
|
/**
|
|
2528
2425
|
* Parse a new property value for a given property type.
|
|
@@ -2549,14 +2446,6 @@ function deserializeProperty(value) {
|
|
|
2549
2446
|
* @returns the parsed/coerced value
|
|
2550
2447
|
*/
|
|
2551
2448
|
const parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
2552
|
-
/**
|
|
2553
|
-
* Allow hydrate parameters that contain a complex non-serialized values.
|
|
2554
|
-
* This is SSR-specific and should only run during hydration.
|
|
2555
|
-
*/
|
|
2556
|
-
if ((BUILD.hydrateClientSide || BUILD.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith("serialized:")) {
|
|
2557
|
-
propValue = deserializeProperty(propValue);
|
|
2558
|
-
return propValue;
|
|
2559
|
-
}
|
|
2560
2449
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2561
2450
|
/**
|
|
2562
2451
|
* ensure this value is of the correct prop type
|
|
@@ -2585,9 +2474,6 @@ const parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
2585
2474
|
return propValue;
|
|
2586
2475
|
};
|
|
2587
2476
|
//#endregion
|
|
2588
|
-
//#region src/runtime/element.ts
|
|
2589
|
-
const getElement = (ref) => BUILD.lazyLoad ? getHostRef(ref)?.$hostElement$ : ref;
|
|
2590
|
-
//#endregion
|
|
2591
2477
|
//#region src/runtime/event-emitter.ts
|
|
2592
2478
|
const createEvent = (ref, name, flags) => {
|
|
2593
2479
|
const elm = getElement(ref);
|
|
@@ -2940,7 +2826,10 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
2940
2826
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
2941
2827
|
let containerElm = BUILD.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
2942
2828
|
let childNode;
|
|
2943
|
-
if (BUILD.shadowDom && containerElm.
|
|
2829
|
+
if (BUILD.shadowDom && containerElm.tagName === hostTagName) {
|
|
2830
|
+
const shadow = getShadowRoot(containerElm);
|
|
2831
|
+
if (shadow) containerElm = shadow;
|
|
2832
|
+
}
|
|
2944
2833
|
if (parentVNode.$tag$ === "template") containerElm = containerElm.content;
|
|
2945
2834
|
for (; startIdx <= endIdx; ++startIdx) if (vnodes[startIdx]) {
|
|
2946
2835
|
childNode = createElm(null, parentVNode, startIdx);
|
|
@@ -3290,7 +3179,8 @@ const insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
|
3290
3179
|
if (BUILD.slotRelocation) {
|
|
3291
3180
|
if (BUILD.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
3292
3181
|
else if (typeof newNode["s-sn"] === "string") {
|
|
3293
|
-
|
|
3182
|
+
const hostElm = newNode["s-hn"] && parent.closest?.(newNode["s-hn"]);
|
|
3183
|
+
if ((BUILD.experimentalSlotFixes || BUILD.patchAll && !!(hostElm && getHostRef(hostElm)?.$cmpMeta$.$flags$ & CMP_FLAGS.patchAll)) && parent.getRootNode().nodeType !== NODE_TYPES.DOCUMENT_FRAGMENT_NODE) patchParentNode(newNode);
|
|
3294
3184
|
parent.insertBefore(newNode, reference);
|
|
3295
3185
|
const { slotNode } = findSlotFromSlottedNode(newNode);
|
|
3296
3186
|
if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
|
|
@@ -3379,7 +3269,7 @@ render() {
|
|
|
3379
3269
|
rootVnode.$tag$ = null;
|
|
3380
3270
|
rootVnode.$flags$ |= VNODE_FLAGS.isHost;
|
|
3381
3271
|
hostRef.$vnode$ = rootVnode;
|
|
3382
|
-
rootVnode.$elm$ = oldVNode.$elm$ = BUILD.shadowDom ? hostElm
|
|
3272
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD.shadowDom ? getShadowRoot(hostElm) || hostElm : hostElm;
|
|
3383
3273
|
if (BUILD.scoped || BUILD.shadowDom) scopeId = hostElm["s-sc"];
|
|
3384
3274
|
useNativeShadowDom = supportsShadow && !!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && !(cmpMeta.$flags$ & CMP_FLAGS.shadowNeedsScopedCss);
|
|
3385
3275
|
if (BUILD.slotRelocation) {
|
|
@@ -3534,13 +3424,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
3534
3424
|
}
|
|
3535
3425
|
if (hostRef.$fetchedCbList$.length) hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
3536
3426
|
}
|
|
3537
|
-
emitLifecycleEvent(elm, "componentWillLoad");
|
|
3427
|
+
if (BUILD.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillLoad");
|
|
3538
3428
|
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
3539
3429
|
} else {
|
|
3540
|
-
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
3430
|
+
if (BUILD.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillUpdate");
|
|
3541
3431
|
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
3542
3432
|
}
|
|
3543
|
-
emitLifecycleEvent(elm, "componentWillRender");
|
|
3433
|
+
if (BUILD.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillRender");
|
|
3544
3434
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
3545
3435
|
endSchedule();
|
|
3546
3436
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
@@ -3675,14 +3565,14 @@ const postUpdateComponent = (hostRef) => {
|
|
|
3675
3565
|
if (BUILD.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnRender;
|
|
3676
3566
|
safeCall(instance, "componentDidRender", void 0, elm);
|
|
3677
3567
|
if (BUILD.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnRender;
|
|
3678
|
-
emitLifecycleEvent(elm, "componentDidRender");
|
|
3568
|
+
if (BUILD.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidRender");
|
|
3679
3569
|
if (!(hostRef.$flags$ & HOST_FLAGS.hasLoadedComponent)) {
|
|
3680
3570
|
hostRef.$flags$ |= HOST_FLAGS.hasLoadedComponent;
|
|
3681
3571
|
if (BUILD.asyncLoading && BUILD.cssAnnotations) addHydratedFlag(elm);
|
|
3682
3572
|
if (BUILD.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnDidLoad;
|
|
3683
3573
|
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
3684
3574
|
if (BUILD.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnDidLoad;
|
|
3685
|
-
emitLifecycleEvent(elm, "componentDidLoad");
|
|
3575
|
+
if (BUILD.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidLoad");
|
|
3686
3576
|
if (BUILD.propChangeCallback) hostRef.$flags$ |= HOST_FLAGS.isWatchReady;
|
|
3687
3577
|
endPostUpdate();
|
|
3688
3578
|
if (BUILD.asyncLoading) {
|
|
@@ -3693,7 +3583,7 @@ const postUpdateComponent = (hostRef) => {
|
|
|
3693
3583
|
if (BUILD.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnRender;
|
|
3694
3584
|
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
3695
3585
|
if (BUILD.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnRender;
|
|
3696
|
-
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
3586
|
+
if (BUILD.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidUpdate");
|
|
3697
3587
|
endPostUpdate();
|
|
3698
3588
|
}
|
|
3699
3589
|
if (BUILD.method && BUILD.lazyLoad) hostRef.$onInstanceResolve$(elm);
|
|
@@ -4116,7 +4006,6 @@ const connectedCallback = (elm) => {
|
|
|
4116
4006
|
if (!hostRef) return;
|
|
4117
4007
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
4118
4008
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
4119
|
-
if (BUILD.hostListenerTargetParent) addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
4120
4009
|
if (!(hostRef.$flags$ & HOST_FLAGS.hasConnected)) {
|
|
4121
4010
|
hostRef.$flags$ |= HOST_FLAGS.hasConnected;
|
|
4122
4011
|
let hostId;
|
|
@@ -4124,7 +4013,8 @@ const connectedCallback = (elm) => {
|
|
|
4124
4013
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
4125
4014
|
if (hostId) {
|
|
4126
4015
|
if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) {
|
|
4127
|
-
const
|
|
4016
|
+
const shadowRoot = getShadowRoot(elm);
|
|
4017
|
+
const scopeId = BUILD.mode ? addStyle(shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(shadowRoot, cmpMeta);
|
|
4128
4018
|
elm.classList.remove(scopeId + "-h", scopeId + "-s");
|
|
4129
4019
|
} else if (BUILD.scoped && cmpMeta.$flags$ & CMP_FLAGS.scopedCssEncapsulation) elm["s-sc"] = getScopeId(cmpMeta, BUILD.mode ? elm.getAttribute("s-mode") : void 0);
|
|
4130
4020
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
@@ -4163,7 +4053,7 @@ const connectedCallback = (elm) => {
|
|
|
4163
4053
|
if (BUILD.initializeNextTick) nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
4164
4054
|
else initializeComponent(elm, hostRef, cmpMeta);
|
|
4165
4055
|
} else {
|
|
4166
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
4056
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
4167
4057
|
if (hostRef?.$lazyInstance$) fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
4168
4058
|
else if (hostRef?.$onReadyPromise$) hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
4169
4059
|
}
|
|
@@ -4224,14 +4114,18 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4224
4114
|
}
|
|
4225
4115
|
if (BUILD.reflect) cmpMeta.$attrsToReflect$ = [];
|
|
4226
4116
|
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) cmpMeta.$flags$ |= CMP_FLAGS.needsShadowDomShim;
|
|
4227
|
-
if (!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && cmpMeta.$flags$ & CMP_FLAGS.hasSlot) if (BUILD.experimentalSlotFixes) patchPseudoShadowDom(Cstr.prototype);
|
|
4117
|
+
if (!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && cmpMeta.$flags$ & CMP_FLAGS.hasSlot) if (BUILD.experimentalSlotFixes || BUILD.patchAll && cmpMeta.$flags$ & CMP_FLAGS.patchAll) patchPseudoShadowDom(Cstr.prototype);
|
|
4228
4118
|
else {
|
|
4229
|
-
if (BUILD.slotChildNodesFix) patchChildSlotNodes(Cstr.prototype);
|
|
4230
|
-
if (BUILD.cloneNodeFix) patchCloneNode(Cstr.prototype);
|
|
4231
|
-
if (BUILD.appendChildSlotFix
|
|
4119
|
+
if (BUILD.slotChildNodesFix || BUILD.patchChildren && cmpMeta.$flags$ & CMP_FLAGS.patchChildren) patchChildSlotNodes(Cstr.prototype);
|
|
4120
|
+
if (BUILD.cloneNodeFix || BUILD.patchClone && cmpMeta.$flags$ & CMP_FLAGS.patchClone) patchCloneNode(Cstr.prototype);
|
|
4121
|
+
if (BUILD.appendChildSlotFix || BUILD.patchInsert && cmpMeta.$flags$ & CMP_FLAGS.patchInsert) {
|
|
4122
|
+
patchSlotAppendChild(Cstr.prototype);
|
|
4123
|
+
patchInsertBefore(Cstr.prototype);
|
|
4124
|
+
patchSlotRemoveChild(Cstr.prototype);
|
|
4125
|
+
}
|
|
4232
4126
|
if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & CMP_FLAGS.scopedCssEncapsulation) patchTextContent(Cstr.prototype);
|
|
4233
4127
|
}
|
|
4234
|
-
else if (BUILD.cloneNodeFix) patchCloneNode(Cstr.prototype);
|
|
4128
|
+
else if (BUILD.cloneNodeFix || BUILD.patchClone && cmpMeta.$flags$ & CMP_FLAGS.patchClone) patchCloneNode(Cstr.prototype);
|
|
4235
4129
|
if (BUILD.hydrateClientSide && BUILD.shadowDom) hydrateScopedToShadow();
|
|
4236
4130
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
4237
4131
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
@@ -4247,7 +4141,7 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4247
4141
|
if (!this.__hasHostListenerAttached) {
|
|
4248
4142
|
const hostRef = getHostRef(this);
|
|
4249
4143
|
if (!hostRef) return;
|
|
4250
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners
|
|
4144
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
4251
4145
|
this.__hasHostListenerAttached = true;
|
|
4252
4146
|
}
|
|
4253
4147
|
connectedCallback(this);
|
|
@@ -4259,8 +4153,13 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4259
4153
|
},
|
|
4260
4154
|
__attachShadow() {
|
|
4261
4155
|
if (supportsShadow) {
|
|
4262
|
-
|
|
4263
|
-
|
|
4156
|
+
const isClosed = BUILD.shadowModeClosed && !!(cmpMeta.$flags$ & CMP_FLAGS.shadowModeClosed);
|
|
4157
|
+
let existingRoot = this.shadowRoot;
|
|
4158
|
+
if (BUILD.shadowModeClosed && isClosed) existingRoot = this.__shadowRoot ?? null;
|
|
4159
|
+
if (!existingRoot) createShadowRoot.call(this, cmpMeta);
|
|
4160
|
+
else if (BUILD.shadowModeClosed && isClosed) {
|
|
4161
|
+
if (existingRoot.mode !== "closed") throw new Error(`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${existingRoot.mode} but expected closed.`);
|
|
4162
|
+
}
|
|
4264
4163
|
} else this.shadowRoot = this;
|
|
4265
4164
|
}
|
|
4266
4165
|
});
|
|
@@ -4356,7 +4255,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4356
4255
|
cmpMeta.$deserializers$ = compactMeta[6] ?? {};
|
|
4357
4256
|
}
|
|
4358
4257
|
if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) cmpMeta.$flags$ |= CMP_FLAGS.needsShadowDomShim;
|
|
4359
|
-
const tagName =
|
|
4258
|
+
const tagName = transformTag(cmpMeta.$tagName$);
|
|
4360
4259
|
const HostElement = class extends HTMLElement {
|
|
4361
4260
|
["s-p"];
|
|
4362
4261
|
["s-rc"];
|
|
@@ -4383,7 +4282,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4383
4282
|
*/
|
|
4384
4283
|
if (!this.hasRegisteredEventListeners) {
|
|
4385
4284
|
this.hasRegisteredEventListeners = true;
|
|
4386
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners
|
|
4285
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
4387
4286
|
}
|
|
4388
4287
|
if (appLoadFallback) {
|
|
4389
4288
|
clearTimeout(appLoadFallback);
|
|
@@ -4415,14 +4314,18 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4415
4314
|
return getHostRef(this)?.$onReadyPromise$;
|
|
4416
4315
|
}
|
|
4417
4316
|
};
|
|
4418
|
-
if (!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && cmpMeta.$flags$ & CMP_FLAGS.hasSlot) if (BUILD.experimentalSlotFixes) patchPseudoShadowDom(HostElement.prototype);
|
|
4317
|
+
if (!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && cmpMeta.$flags$ & CMP_FLAGS.hasSlot) if (BUILD.experimentalSlotFixes || BUILD.patchAll && cmpMeta.$flags$ & CMP_FLAGS.patchAll) patchPseudoShadowDom(HostElement.prototype);
|
|
4419
4318
|
else {
|
|
4420
|
-
if (BUILD.slotChildNodesFix) patchChildSlotNodes(HostElement.prototype);
|
|
4421
|
-
if (BUILD.cloneNodeFix) patchCloneNode(HostElement.prototype);
|
|
4422
|
-
if (BUILD.appendChildSlotFix
|
|
4319
|
+
if (BUILD.slotChildNodesFix || BUILD.patchChildren && cmpMeta.$flags$ & CMP_FLAGS.patchChildren) patchChildSlotNodes(HostElement.prototype);
|
|
4320
|
+
if (BUILD.cloneNodeFix || BUILD.patchClone && cmpMeta.$flags$ & CMP_FLAGS.patchClone) patchCloneNode(HostElement.prototype);
|
|
4321
|
+
if (BUILD.appendChildSlotFix || BUILD.patchInsert && cmpMeta.$flags$ & CMP_FLAGS.patchInsert) {
|
|
4322
|
+
patchSlotAppendChild(HostElement.prototype);
|
|
4323
|
+
patchInsertBefore(HostElement.prototype);
|
|
4324
|
+
patchSlotRemoveChild(HostElement.prototype);
|
|
4325
|
+
}
|
|
4423
4326
|
if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & CMP_FLAGS.scopedCssEncapsulation) patchTextContent(HostElement.prototype);
|
|
4424
4327
|
}
|
|
4425
|
-
else if (BUILD.cloneNodeFix) patchCloneNode(HostElement.prototype);
|
|
4328
|
+
else if (BUILD.cloneNodeFix || BUILD.patchClone && cmpMeta.$flags$ & CMP_FLAGS.patchClone) patchCloneNode(HostElement.prototype);
|
|
4426
4329
|
if (BUILD.formAssociated && cmpMeta.$flags$ & CMP_FLAGS.formAssociated) HostElement.formAssociated = true;
|
|
4427
4330
|
if (BUILD.hotModuleReplacement) HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
4428
4331
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
@@ -4454,18 +4357,14 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4454
4357
|
const Fragment = (_, children) => children;
|
|
4455
4358
|
//#endregion
|
|
4456
4359
|
//#region src/runtime/host-listener.ts
|
|
4457
|
-
const addHostEventListeners = (elm, hostRef, listeners
|
|
4458
|
-
if (BUILD.hostListener && listeners && win.document) {
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
plt.ael(target, name, handler, opts);
|
|
4466
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
4467
|
-
});
|
|
4468
|
-
}
|
|
4360
|
+
const addHostEventListeners = (elm, hostRef, listeners) => {
|
|
4361
|
+
if (BUILD.hostListener && listeners && win.document) listeners.map(([flags, name, method]) => {
|
|
4362
|
+
const target = BUILD.hostListenerTarget ? getHostListenerTarget(win.document, elm, flags) : elm;
|
|
4363
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
4364
|
+
const opts = hostListenerOpts(flags);
|
|
4365
|
+
plt.ael(target, name, handler, opts);
|
|
4366
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
4367
|
+
});
|
|
4469
4368
|
};
|
|
4470
4369
|
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
4471
4370
|
try {
|
|
@@ -4480,7 +4379,6 @@ const getHostListenerTarget = (doc, elm, flags) => {
|
|
|
4480
4379
|
if (BUILD.hostListenerTargetDocument && flags & LISTENER_FLAGS.TargetDocument) return doc;
|
|
4481
4380
|
if (BUILD.hostListenerTargetWindow && flags & LISTENER_FLAGS.TargetWindow) return win;
|
|
4482
4381
|
if (BUILD.hostListenerTargetBody && flags & LISTENER_FLAGS.TargetBody) return doc.body;
|
|
4483
|
-
if (BUILD.hostListenerTargetParent && flags & LISTENER_FLAGS.TargetParent && elm.parentElement) return elm.parentElement;
|
|
4484
4382
|
return elm;
|
|
4485
4383
|
};
|
|
4486
4384
|
const hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
@@ -4758,4 +4656,4 @@ const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, in
|
|
|
4758
4656
|
}
|
|
4759
4657
|
};
|
|
4760
4658
|
//#endregion
|
|
4761
|
-
export {
|
|
4659
|
+
export { h as A, postUpdateComponent as C, getMode as D, parsePropertyValue as E, HYDRATED_STYLE_ID as F, getShadowRoot as M, getAssetPath as N, setMode as O, setAssetPath as P, getRenderingRef as S, createEvent as T, connectedCallback as _, transformTag as a, setValue as b, setNonce as c, Fragment as d, bootstrapLazy as f, disconnectedCallback as g, proxyCustomElement as h, setTagTransformer as i, getElement as j, Host as k, Mixin as l, forceModeUpdate as m, jsx as n, render as o, defineCustomElement as p, jsxs as r, setPlatformOptions as s, insertVdomAnnotations as t, addHostEventListeners as u, proxyComponent as v, renderVdom as w, forceUpdate as x, getValue as y };
|
package/dist/sys/node/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-
|
|
1
|
+
import { n as setupNodeProcess, r as createNodeLogger, t as createNodeSys } from "../../node-Bg-mO5dw.mjs";
|
|
2
2
|
export { createNodeLogger, createNodeSys, setupNodeProcess };
|
package/dist/sys/node/worker.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as createWorkerMessageHandler } from "../../compiler-
|
|
2
|
-
import { t as createNodeSys } from "../../node-
|
|
1
|
+
import { l as createWorkerMessageHandler } from "../../compiler-D6iP7Bzb.mjs";
|
|
2
|
+
import { t as createNodeSys } from "../../node-Bg-mO5dw.mjs";
|
|
3
3
|
//#region src/sys/node/node-worker-thread.ts
|
|
4
4
|
/**
|
|
5
5
|
* Initialize a worker thread, setting up various machinery for managing
|
package/dist/testing/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as ComponentCompilerMeta,
|
|
2
|
-
import { c as getMode, d as Fragment, f as createEvent, g as
|
|
1
|
+
import { B as ComponentCompilerMeta, E as CompilerCtx, Qr as Logger, Rr as Diagnostic, Tt as HostRef, Wt as NewSpecPageOptions, Yr as LoadConfigInit, Zr as LogLevel, a as BuildCtx, ca as RafCallback, da as UserBuildConditionals, ei as LoggerTimeSpan, gr as CompilerSystem, mn as RuntimeRef, na as ValidatedConfig, oa as ErrorHandler, pt as ComponentRuntimeMeta, ta as UnvalidatedConfig, wt as HostElement, yn as SpecPage, zt as Module } from "../index-tUR6pD3J.mjs";
|
|
2
|
+
import { _ as Env, c as getMode, d as Fragment, f as createEvent, g as setAssetPath, h as getAssetPath, i as getRenderingRef, n as h, p as getElement, r as forceUpdate, t as Host, u as Mixin } from "../index-CXHCTQNt.mjs";
|
|
3
3
|
import { Mock } from "vitest";
|
|
4
4
|
|
|
5
5
|
//#region src/testing/testing-logger.d.ts
|
|
@@ -206,4 +206,4 @@ declare function readTask(cb: RafCallback): void;
|
|
|
206
206
|
//#region src/testing/platform/index.d.ts
|
|
207
207
|
declare const setMode: (handler: (elm: any) => string | undefined | null) => void;
|
|
208
208
|
//#endregion
|
|
209
|
-
export { Build, Env, Fragment, Host, Mixin, type SpecPage,
|
|
209
|
+
export { Build, Env, Fragment, Host, Mixin, type SpecPage, createEvent, createTestingSystem, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, h, mockBuildCtx, mockCompilerCtx, mockCompilerSystem, mockComponentMeta, mockConfig, mockDocument, mockLoadConfigInit, mockLogger, mockModule, mockValidatedConfig, mockWindow, newSpecPage, readTask, registerHost, registerInstance, setAssetPath, setErrorHandler, setMode, setupConsoleMocker, shuffleArray, writeTask };
|