@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
|
@@ -124,8 +124,7 @@ const LISTENER_FLAGS = {
|
|
|
124
124
|
Capture: 2,
|
|
125
125
|
TargetDocument: 4,
|
|
126
126
|
TargetWindow: 8,
|
|
127
|
-
TargetBody: 16
|
|
128
|
-
TargetParent: 32
|
|
127
|
+
TargetBody: 16
|
|
129
128
|
};
|
|
130
129
|
const HOST_FLAGS = {
|
|
131
130
|
hasConnected: 1,
|
|
@@ -161,7 +160,12 @@ const CMP_FLAGS = {
|
|
|
161
160
|
shadowNeedsScopedCss: 128,
|
|
162
161
|
hasSlot: 256,
|
|
163
162
|
hasModernPropertyDecls: 512,
|
|
164
|
-
shadowSlotAssignmentManual: 1024
|
|
163
|
+
shadowSlotAssignmentManual: 1024,
|
|
164
|
+
shadowModeClosed: 2048,
|
|
165
|
+
patchChildren: 4096,
|
|
166
|
+
patchClone: 8192,
|
|
167
|
+
patchInsert: 16384,
|
|
168
|
+
patchAll: 32768
|
|
165
169
|
};
|
|
166
170
|
/**
|
|
167
171
|
* Namespaces
|
|
@@ -192,38 +196,6 @@ const NODE_TYPES = {
|
|
|
192
196
|
DOCUMENT_FRAGMENT_NODE: 11,
|
|
193
197
|
NOTATION_NODE: 12
|
|
194
198
|
};
|
|
195
|
-
/**
|
|
196
|
-
* Represents a primitive type.
|
|
197
|
-
* Described in https://w3c.github.io/webdriver-bidi/#type-script-PrimitiveProtocolValue.
|
|
198
|
-
*/
|
|
199
|
-
const PrimitiveType = {
|
|
200
|
-
Undefined: "undefined",
|
|
201
|
-
Null: "null",
|
|
202
|
-
String: "string",
|
|
203
|
-
Number: "number",
|
|
204
|
-
SpecialNumber: "number",
|
|
205
|
-
Boolean: "boolean",
|
|
206
|
-
BigInt: "bigint"
|
|
207
|
-
};
|
|
208
|
-
/**
|
|
209
|
-
* Represents a non-primitive type.
|
|
210
|
-
* Described in https://w3c.github.io/webdriver-bidi/#type-script-RemoteValue.
|
|
211
|
-
* @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead.
|
|
212
|
-
*/
|
|
213
|
-
const NonPrimitiveType = {
|
|
214
|
-
Array: "array",
|
|
215
|
-
Date: "date",
|
|
216
|
-
Map: "map",
|
|
217
|
-
Object: "object",
|
|
218
|
-
RegularExpression: "regexp",
|
|
219
|
-
Set: "set",
|
|
220
|
-
Channel: "channel",
|
|
221
|
-
Symbol: "symbol"
|
|
222
|
-
};
|
|
223
|
-
/** @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead. */
|
|
224
|
-
const TYPE_CONSTANT = "type";
|
|
225
|
-
/** @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead. */
|
|
226
|
-
const VALUE_CONSTANT = "value";
|
|
227
199
|
//#endregion
|
|
228
200
|
//#region src/utils/get-prop-descriptor.ts
|
|
229
201
|
/**
|
|
@@ -376,7 +348,7 @@ const cmpModules = /* @__PURE__ */ new Map();
|
|
|
376
348
|
* where here in the source code it must be like this, so that an undesirable
|
|
377
349
|
* transformation that Esbuild would otherwise carry out doesn't occur, but we
|
|
378
350
|
* actually need to then manually edit the bundled Esbuild code later on to fix
|
|
379
|
-
* that. We do this with plugins in the Esbuild and
|
|
351
|
+
* that. We do this with plugins in the Esbuild and Rolldown bundles which
|
|
380
352
|
* include this file.
|
|
381
353
|
*/
|
|
382
354
|
const MODULE_IMPORT_PREFIX = "./";
|
|
@@ -588,12 +560,14 @@ function createStyleSheetIfNeededAndSupported(styles) {
|
|
|
588
560
|
let globalStyleSheet;
|
|
589
561
|
const GLOBAL_STYLE_ID = "sc-global";
|
|
590
562
|
function createShadowRoot(cmpMeta) {
|
|
591
|
-
const
|
|
563
|
+
const isClosed = BUILD$1.shadowModeClosed && !!(cmpMeta.$flags$ & CMP_FLAGS.shadowModeClosed);
|
|
564
|
+
const opts = { mode: isClosed ? "closed" : "open" };
|
|
592
565
|
if (BUILD$1.shadowDelegatesFocus) opts.delegatesFocus = !!(cmpMeta.$flags$ & CMP_FLAGS.shadowDelegatesFocus);
|
|
593
566
|
if (BUILD$1.shadowSlotAssignmentManual) {
|
|
594
567
|
if (!!(cmpMeta.$flags$ & CMP_FLAGS.shadowSlotAssignmentManual)) opts.slotAssignment = "manual";
|
|
595
568
|
}
|
|
596
569
|
const shadowRoot = this.attachShadow(opts);
|
|
570
|
+
if (BUILD$1.shadowModeClosed && isClosed) this.__shadowRoot = shadowRoot;
|
|
597
571
|
if (globalStyleSheet === void 0) globalStyleSheet = createStyleSheetIfNeededAndSupported(globalStyles) ?? null;
|
|
598
572
|
if (globalStyleSheet) if (supportsMutableAdoptedStyleSheets) shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
|
|
599
573
|
else shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
|
|
@@ -1245,6 +1219,24 @@ function internalCall(node, method) {
|
|
|
1245
1219
|
}
|
|
1246
1220
|
}
|
|
1247
1221
|
//#endregion
|
|
1222
|
+
//#region src/runtime/element.ts
|
|
1223
|
+
const getElement = (ref) => BUILD$1.lazyLoad ? getHostRef(ref)?.$hostElement$ : ref;
|
|
1224
|
+
/**
|
|
1225
|
+
* Get the shadow root for a Stencil component's host element.
|
|
1226
|
+
* This works for both open and closed shadow DOM modes.
|
|
1227
|
+
*
|
|
1228
|
+
* For closed shadow DOM, `element.shadowRoot` returns `null` by design,
|
|
1229
|
+
* but Stencil stores the reference internally so components can still
|
|
1230
|
+
* access their own shadow root.
|
|
1231
|
+
*
|
|
1232
|
+
* @param element The host element (from @Element() decorator)
|
|
1233
|
+
* @returns The shadow root, or null if no shadow root exists
|
|
1234
|
+
*/
|
|
1235
|
+
const getShadowRoot = (element) => {
|
|
1236
|
+
if (BUILD$1.shadowModeClosed && element.__shadowRoot) return element.__shadowRoot;
|
|
1237
|
+
return element.shadowRoot;
|
|
1238
|
+
};
|
|
1239
|
+
//#endregion
|
|
1248
1240
|
//#region src/runtime/profile.ts
|
|
1249
1241
|
let i = 0;
|
|
1250
1242
|
const createTime = (fnName, tagName = "") => {
|
|
@@ -1421,7 +1413,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1421
1413
|
if (!BUILD$1.attachStyles || !win.document) return scopeId;
|
|
1422
1414
|
let style = styles.get(scopeId);
|
|
1423
1415
|
if (cmpMeta.$flags$ & CMP_FLAGS.hasSlotRelocation) style = getStyleWithSlotCss(style);
|
|
1424
|
-
|
|
1416
|
+
const isClosedShadowSSR = BUILD$1.hydrateServerSide && BUILD$1.shadowModeClosed && cmpMeta.$flags$ & CMP_FLAGS.shadowNeedsScopedCss && cmpMeta.$flags$ & CMP_FLAGS.shadowModeClosed;
|
|
1417
|
+
if (styleContainerNode.nodeType !== NODE_TYPE.DocumentFragment && !isClosedShadowSSR) styleContainerNode = win.document;
|
|
1425
1418
|
if (style) {
|
|
1426
1419
|
if (typeof style === "string") {
|
|
1427
1420
|
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
@@ -1471,7 +1464,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
1471
1464
|
/**
|
|
1472
1465
|
* attach styles at the beginning of a shadow root node if we render shadow components
|
|
1473
1466
|
*/
|
|
1474
|
-
if (cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) styleContainerNode.
|
|
1467
|
+
if (cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) if (isClosedShadowSSR) styleContainerNode.prepend(styleElm);
|
|
1468
|
+
else styleContainerNode.insertBefore(styleElm, null);
|
|
1475
1469
|
if (appliedStyles) appliedStyles.add(scopeId);
|
|
1476
1470
|
}
|
|
1477
1471
|
} else if (BUILD$1.constructableCSS) {
|
|
@@ -1506,7 +1500,12 @@ const attachStyles = (hostRef) => {
|
|
|
1506
1500
|
const elm = hostRef.$hostElement$;
|
|
1507
1501
|
const flags = cmpMeta.$flags$;
|
|
1508
1502
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1509
|
-
|
|
1503
|
+
let styleContainerNode;
|
|
1504
|
+
const shadowRoot = BUILD$1.shadowDom && supportsShadow ? getShadowRoot(elm) : null;
|
|
1505
|
+
if (shadowRoot) styleContainerNode = shadowRoot;
|
|
1506
|
+
else if (BUILD$1.hydrateServerSide && BUILD$1.shadowModeClosed && flags & CMP_FLAGS.shadowNeedsScopedCss && flags & CMP_FLAGS.shadowModeClosed) styleContainerNode = elm;
|
|
1507
|
+
else styleContainerNode = elm.getRootNode();
|
|
1508
|
+
const scopeId = addStyle(styleContainerNode, cmpMeta, hostRef.$modeName$);
|
|
1510
1509
|
if ((BUILD$1.shadowDom || BUILD$1.scoped) && BUILD$1.cssAnnotations && flags & CMP_FLAGS.needsScopedEncapsulation) {
|
|
1511
1510
|
elm["s-sc"] = scopeId;
|
|
1512
1511
|
elm.classList.add(scopeId + "-h");
|
|
@@ -1744,7 +1743,7 @@ const validateInputProperties = (inputElm) => {
|
|
|
1744
1743
|
*/
|
|
1745
1744
|
const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1746
1745
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1747
|
-
const shadowRoot = hostElm
|
|
1746
|
+
const shadowRoot = getShadowRoot(hostElm);
|
|
1748
1747
|
const childRenderNodes = [];
|
|
1749
1748
|
const slotNodes = [];
|
|
1750
1749
|
const slottedNodes = [];
|
|
@@ -1825,7 +1824,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1825
1824
|
}
|
|
1826
1825
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"] || currentPos);
|
|
1827
1826
|
if (slottedItem.node.parentElement?.shadowRoot && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) slottedItem.node.removeAttribute("slot");
|
|
1828
|
-
if (BUILD$1.experimentalSlotFixes) patchSlottedNode(slottedItem.node);
|
|
1827
|
+
if (BUILD$1.experimentalSlotFixes || BUILD$1.patchAll && hostRef.$cmpMeta$.$flags$ & CMP_FLAGS.patchAll) patchSlottedNode(slottedItem.node);
|
|
1829
1828
|
}
|
|
1830
1829
|
currentPos = (slottedItem.node["s-oo"] || currentPos) + 1;
|
|
1831
1830
|
}
|
|
@@ -2147,9 +2146,12 @@ const _polyfillHost = "-shadowcsshost";
|
|
|
2147
2146
|
const _polyfillSlotted = "-shadowcssslotted";
|
|
2148
2147
|
const _polyfillHostContext = "-shadowcsscontext";
|
|
2149
2148
|
const _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2149
|
+
let _cssColonHostRe;
|
|
2150
|
+
let _cssColonHostContextRe;
|
|
2151
|
+
let _cssColonSlottedRe;
|
|
2152
|
+
const getCssColonHostRe = () => _cssColonHostRe ??= new RegExp("(" + _polyfillHost + _parenSuffix, "gim");
|
|
2153
|
+
const getCssColonHostContextRe = () => _cssColonHostContextRe ??= new RegExp("(" + _polyfillHostContext + _parenSuffix, "gim");
|
|
2154
|
+
const getCssColonSlottedRe = () => _cssColonSlottedRe ??= new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim");
|
|
2153
2155
|
const _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
|
|
2154
2156
|
const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
2155
2157
|
const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
@@ -2309,7 +2311,7 @@ const colonHostPartReplacer = (host, part, suffix) => {
|
|
|
2309
2311
|
return host + part.replace(_polyfillHost, "") + suffix;
|
|
2310
2312
|
};
|
|
2311
2313
|
const convertColonHost = (cssText) => {
|
|
2312
|
-
return convertColonRule(cssText,
|
|
2314
|
+
return convertColonRule(cssText, getCssColonHostRe(), colonHostPartReplacer);
|
|
2313
2315
|
};
|
|
2314
2316
|
const colonHostContextPartReplacer = (host, part, suffix) => {
|
|
2315
2317
|
if (part.indexOf(_polyfillHost) > -1) return colonHostPartReplacer(host, part, suffix);
|
|
@@ -2318,7 +2320,7 @@ const colonHostContextPartReplacer = (host, part, suffix) => {
|
|
|
2318
2320
|
const convertColonSlotted = (cssText, slotScopeId) => {
|
|
2319
2321
|
const slotClass = "." + slotScopeId + " > ";
|
|
2320
2322
|
const selectors = [];
|
|
2321
|
-
cssText = cssText.replace(
|
|
2323
|
+
cssText = cssText.replace(getCssColonSlottedRe(), (...m) => {
|
|
2322
2324
|
if (m[2]) {
|
|
2323
2325
|
const compound = m[2].trim();
|
|
2324
2326
|
const suffix = m[3];
|
|
@@ -2347,7 +2349,7 @@ const convertColonSlotted = (cssText, slotScopeId) => {
|
|
|
2347
2349
|
};
|
|
2348
2350
|
};
|
|
2349
2351
|
const convertColonHostContext = (cssText) => {
|
|
2350
|
-
return convertColonRule(cssText,
|
|
2352
|
+
return convertColonRule(cssText, getCssColonHostContextRe(), colonHostContextPartReplacer);
|
|
2351
2353
|
};
|
|
2352
2354
|
const convertShadowDOMSelectors = (cssText) => {
|
|
2353
2355
|
return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, " "), cssText);
|
|
@@ -2536,111 +2538,6 @@ const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) =>
|
|
|
2536
2538
|
const setMode = (handler) => modeResolutionChain.push(handler);
|
|
2537
2539
|
const getMode = (ref) => getHostRef(ref)?.$modeName$;
|
|
2538
2540
|
//#endregion
|
|
2539
|
-
//#region src/utils/remote-value.ts
|
|
2540
|
-
/**
|
|
2541
|
-
* RemoteValue class for deserializing LocalValue serialized objects back into their original form
|
|
2542
|
-
* @deprecated will be removed in v5. Use `@AttrDeserialize()` / `@PropDeserialize()` decorators instead.
|
|
2543
|
-
*/
|
|
2544
|
-
var RemoteValue = class RemoteValue {
|
|
2545
|
-
/**
|
|
2546
|
-
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
2547
|
-
*
|
|
2548
|
-
* @param serialized The serialized LocalValue object
|
|
2549
|
-
* @returns The original JavaScript value/object
|
|
2550
|
-
*/
|
|
2551
|
-
static fromLocalValue(serialized) {
|
|
2552
|
-
const type = serialized[TYPE_CONSTANT];
|
|
2553
|
-
const value = "value" in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
2554
|
-
switch (type) {
|
|
2555
|
-
case PrimitiveType.String: return value;
|
|
2556
|
-
case PrimitiveType.Boolean: return value;
|
|
2557
|
-
case PrimitiveType.BigInt: return BigInt(value);
|
|
2558
|
-
case PrimitiveType.Undefined: return;
|
|
2559
|
-
case PrimitiveType.Null: return null;
|
|
2560
|
-
case PrimitiveType.Number:
|
|
2561
|
-
if (value === "NaN") return NaN;
|
|
2562
|
-
if (value === "-0") return -0;
|
|
2563
|
-
if (value === "Infinity") return Infinity;
|
|
2564
|
-
if (value === "-Infinity") return -Infinity;
|
|
2565
|
-
return value;
|
|
2566
|
-
case NonPrimitiveType.Array: return value.map((item) => RemoteValue.fromLocalValue(item));
|
|
2567
|
-
case NonPrimitiveType.Date: return new Date(value);
|
|
2568
|
-
case NonPrimitiveType.Map:
|
|
2569
|
-
const map = /* @__PURE__ */ new Map();
|
|
2570
|
-
for (const [key, val] of value) {
|
|
2571
|
-
const deserializedKey = typeof key === "object" && key !== null ? RemoteValue.fromLocalValue(key) : key;
|
|
2572
|
-
const deserializedValue = RemoteValue.fromLocalValue(val);
|
|
2573
|
-
map.set(deserializedKey, deserializedValue);
|
|
2574
|
-
}
|
|
2575
|
-
return map;
|
|
2576
|
-
case NonPrimitiveType.Object:
|
|
2577
|
-
const obj = {};
|
|
2578
|
-
for (const [key, val] of value) obj[key] = RemoteValue.fromLocalValue(val);
|
|
2579
|
-
return obj;
|
|
2580
|
-
case NonPrimitiveType.RegularExpression:
|
|
2581
|
-
const { pattern, flags } = value;
|
|
2582
|
-
return new RegExp(pattern, flags);
|
|
2583
|
-
case NonPrimitiveType.Set:
|
|
2584
|
-
const set = /* @__PURE__ */ new Set();
|
|
2585
|
-
for (const item of value) set.add(RemoteValue.fromLocalValue(item));
|
|
2586
|
-
return set;
|
|
2587
|
-
case NonPrimitiveType.Symbol: return Symbol(value);
|
|
2588
|
-
default: throw new Error(`Unsupported type: ${type}`);
|
|
2589
|
-
}
|
|
2590
|
-
}
|
|
2591
|
-
/**
|
|
2592
|
-
* Utility method to deserialize multiple LocalValues at once
|
|
2593
|
-
*
|
|
2594
|
-
* @param serializedValues Array of serialized LocalValue objects
|
|
2595
|
-
* @returns Array of deserialized JavaScript values
|
|
2596
|
-
*/
|
|
2597
|
-
static fromLocalValueArray(serializedValues) {
|
|
2598
|
-
return serializedValues.map((value) => RemoteValue.fromLocalValue(value));
|
|
2599
|
-
}
|
|
2600
|
-
/**
|
|
2601
|
-
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
2602
|
-
*
|
|
2603
|
-
* @param obj Object to verify
|
|
2604
|
-
* @returns boolean indicating if the object has LocalValue structure
|
|
2605
|
-
*/
|
|
2606
|
-
static isLocalValueObject(obj) {
|
|
2607
|
-
if (typeof obj !== "object" || obj === null) return false;
|
|
2608
|
-
if (!obj.hasOwnProperty("type")) return false;
|
|
2609
|
-
const type = obj[TYPE_CONSTANT];
|
|
2610
|
-
if (!Object.values({
|
|
2611
|
-
...PrimitiveType,
|
|
2612
|
-
...NonPrimitiveType
|
|
2613
|
-
}).includes(type)) return false;
|
|
2614
|
-
if (type !== PrimitiveType.Null && type !== PrimitiveType.Undefined) return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
2615
|
-
return true;
|
|
2616
|
-
}
|
|
2617
|
-
};
|
|
2618
|
-
//#endregion
|
|
2619
|
-
//#region src/utils/serialize.ts
|
|
2620
|
-
/**
|
|
2621
|
-
* Unicode-safe base64 decoding that handles characters outside Latin1 range.
|
|
2622
|
-
* Unlike atob(), this properly decodes Unicode characters including emoji,
|
|
2623
|
-
* CJK characters, and currency symbols like €.
|
|
2624
|
-
* @param {string} base64 - The base64 string to decode.
|
|
2625
|
-
* @returns {string} Decoded string.
|
|
2626
|
-
*/
|
|
2627
|
-
function decodeBase64Unicode(base64) {
|
|
2628
|
-
const binary = atob(base64);
|
|
2629
|
-
const bytes = new Uint8Array(binary.length);
|
|
2630
|
-
for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);
|
|
2631
|
-
return new TextDecoder().decode(bytes);
|
|
2632
|
-
}
|
|
2633
|
-
/**
|
|
2634
|
-
* Deserialize a value from a string that was serialized earlier.
|
|
2635
|
-
* @param {string} value - The string to deserialize.
|
|
2636
|
-
* @returns {unknown} The deserialized value.
|
|
2637
|
-
* @deprecated will be removed in v5. Use `@AttrDeserialize()` decorator instead.
|
|
2638
|
-
*/
|
|
2639
|
-
function deserializeProperty(value) {
|
|
2640
|
-
if (typeof value !== "string" || !value.startsWith("serialized:")) return value;
|
|
2641
|
-
return RemoteValue.fromLocalValue(JSON.parse(decodeBase64Unicode(value.slice(11))));
|
|
2642
|
-
}
|
|
2643
|
-
//#endregion
|
|
2644
2541
|
//#region src/runtime/parse-property-value.ts
|
|
2645
2542
|
/**
|
|
2646
2543
|
* Parse a new property value for a given property type.
|
|
@@ -2667,14 +2564,6 @@ function deserializeProperty(value) {
|
|
|
2667
2564
|
* @returns the parsed/coerced value
|
|
2668
2565
|
*/
|
|
2669
2566
|
const parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
2670
|
-
/**
|
|
2671
|
-
* Allow hydrate parameters that contain a complex non-serialized values.
|
|
2672
|
-
* This is SSR-specific and should only run during hydration.
|
|
2673
|
-
*/
|
|
2674
|
-
if ((BUILD$1.hydrateClientSide || BUILD$1.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith("serialized:")) {
|
|
2675
|
-
propValue = deserializeProperty(propValue);
|
|
2676
|
-
return propValue;
|
|
2677
|
-
}
|
|
2678
2567
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2679
2568
|
/**
|
|
2680
2569
|
* ensure this value is of the correct prop type
|
|
@@ -2703,9 +2592,6 @@ const parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
2703
2592
|
return propValue;
|
|
2704
2593
|
};
|
|
2705
2594
|
//#endregion
|
|
2706
|
-
//#region src/runtime/element.ts
|
|
2707
|
-
const getElement = (ref) => BUILD$1.lazyLoad ? getHostRef(ref)?.$hostElement$ : ref;
|
|
2708
|
-
//#endregion
|
|
2709
2595
|
//#region src/runtime/event-emitter.ts
|
|
2710
2596
|
const createEvent = (ref, name, flags) => {
|
|
2711
2597
|
const elm = getElement(ref);
|
|
@@ -3058,7 +2944,10 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
3058
2944
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
3059
2945
|
let containerElm = BUILD$1.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
3060
2946
|
let childNode;
|
|
3061
|
-
if (BUILD$1.shadowDom && containerElm.
|
|
2947
|
+
if (BUILD$1.shadowDom && containerElm.tagName === hostTagName) {
|
|
2948
|
+
const shadow = getShadowRoot(containerElm);
|
|
2949
|
+
if (shadow) containerElm = shadow;
|
|
2950
|
+
}
|
|
3062
2951
|
if (parentVNode.$tag$ === "template") containerElm = containerElm.content;
|
|
3063
2952
|
for (; startIdx <= endIdx; ++startIdx) if (vnodes[startIdx]) {
|
|
3064
2953
|
childNode = createElm(null, parentVNode, startIdx);
|
|
@@ -3408,7 +3297,8 @@ const insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
|
3408
3297
|
if (BUILD$1.slotRelocation) {
|
|
3409
3298
|
if (BUILD$1.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
3410
3299
|
else if (typeof newNode["s-sn"] === "string") {
|
|
3411
|
-
|
|
3300
|
+
const hostElm = newNode["s-hn"] && parent.closest?.(newNode["s-hn"]);
|
|
3301
|
+
if ((BUILD$1.experimentalSlotFixes || BUILD$1.patchAll && !!(hostElm && getHostRef(hostElm)?.$cmpMeta$.$flags$ & CMP_FLAGS.patchAll)) && parent.getRootNode().nodeType !== NODE_TYPES.DOCUMENT_FRAGMENT_NODE) patchParentNode(newNode);
|
|
3412
3302
|
parent.insertBefore(newNode, reference);
|
|
3413
3303
|
const { slotNode } = findSlotFromSlottedNode(newNode);
|
|
3414
3304
|
if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
|
|
@@ -3497,7 +3387,7 @@ render() {
|
|
|
3497
3387
|
rootVnode.$tag$ = null;
|
|
3498
3388
|
rootVnode.$flags$ |= VNODE_FLAGS.isHost;
|
|
3499
3389
|
hostRef.$vnode$ = rootVnode;
|
|
3500
|
-
rootVnode.$elm$ = oldVNode.$elm$ = BUILD$1.shadowDom ? hostElm
|
|
3390
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD$1.shadowDom ? getShadowRoot(hostElm) || hostElm : hostElm;
|
|
3501
3391
|
if (BUILD$1.scoped || BUILD$1.shadowDom) scopeId = hostElm["s-sc"];
|
|
3502
3392
|
useNativeShadowDom = supportsShadow && !!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && !(cmpMeta.$flags$ & CMP_FLAGS.shadowNeedsScopedCss);
|
|
3503
3393
|
if (BUILD$1.slotRelocation) {
|
|
@@ -3652,13 +3542,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
3652
3542
|
}
|
|
3653
3543
|
if (hostRef.$fetchedCbList$.length) hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
3654
3544
|
}
|
|
3655
|
-
emitLifecycleEvent(elm, "componentWillLoad");
|
|
3545
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillLoad");
|
|
3656
3546
|
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
3657
3547
|
} else {
|
|
3658
|
-
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
3548
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillUpdate");
|
|
3659
3549
|
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
3660
3550
|
}
|
|
3661
|
-
emitLifecycleEvent(elm, "componentWillRender");
|
|
3551
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillRender");
|
|
3662
3552
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
3663
3553
|
endSchedule();
|
|
3664
3554
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
@@ -3793,14 +3683,14 @@ const postUpdateComponent = (hostRef) => {
|
|
|
3793
3683
|
if (BUILD$1.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnRender;
|
|
3794
3684
|
safeCall(instance, "componentDidRender", void 0, elm);
|
|
3795
3685
|
if (BUILD$1.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnRender;
|
|
3796
|
-
emitLifecycleEvent(elm, "componentDidRender");
|
|
3686
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidRender");
|
|
3797
3687
|
if (!(hostRef.$flags$ & HOST_FLAGS.hasLoadedComponent)) {
|
|
3798
3688
|
hostRef.$flags$ |= HOST_FLAGS.hasLoadedComponent;
|
|
3799
3689
|
if (BUILD$1.asyncLoading && BUILD$1.cssAnnotations) addHydratedFlag(elm);
|
|
3800
3690
|
if (BUILD$1.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnDidLoad;
|
|
3801
3691
|
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
3802
3692
|
if (BUILD$1.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnDidLoad;
|
|
3803
|
-
emitLifecycleEvent(elm, "componentDidLoad");
|
|
3693
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidLoad");
|
|
3804
3694
|
if (BUILD$1.propChangeCallback) hostRef.$flags$ |= HOST_FLAGS.isWatchReady;
|
|
3805
3695
|
endPostUpdate();
|
|
3806
3696
|
if (BUILD$1.asyncLoading) {
|
|
@@ -3811,7 +3701,7 @@ const postUpdateComponent = (hostRef) => {
|
|
|
3811
3701
|
if (BUILD$1.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnRender;
|
|
3812
3702
|
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
3813
3703
|
if (BUILD$1.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnRender;
|
|
3814
|
-
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
3704
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidUpdate");
|
|
3815
3705
|
endPostUpdate();
|
|
3816
3706
|
}
|
|
3817
3707
|
if (BUILD$1.method && BUILD$1.lazyLoad) hostRef.$onInstanceResolve$(elm);
|
|
@@ -4234,7 +4124,6 @@ const connectedCallback = (elm) => {
|
|
|
4234
4124
|
if (!hostRef) return;
|
|
4235
4125
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
4236
4126
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
4237
|
-
if (BUILD$1.hostListenerTargetParent) addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
4238
4127
|
if (!(hostRef.$flags$ & HOST_FLAGS.hasConnected)) {
|
|
4239
4128
|
hostRef.$flags$ |= HOST_FLAGS.hasConnected;
|
|
4240
4129
|
let hostId;
|
|
@@ -4242,7 +4131,8 @@ const connectedCallback = (elm) => {
|
|
|
4242
4131
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
4243
4132
|
if (hostId) {
|
|
4244
4133
|
if (BUILD$1.shadowDom && supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) {
|
|
4245
|
-
const
|
|
4134
|
+
const shadowRoot = getShadowRoot(elm);
|
|
4135
|
+
const scopeId = BUILD$1.mode ? addStyle(shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(shadowRoot, cmpMeta);
|
|
4246
4136
|
elm.classList.remove(scopeId + "-h", scopeId + "-s");
|
|
4247
4137
|
} else if (BUILD$1.scoped && cmpMeta.$flags$ & CMP_FLAGS.scopedCssEncapsulation) elm["s-sc"] = getScopeId(cmpMeta, BUILD$1.mode ? elm.getAttribute("s-mode") : void 0);
|
|
4248
4138
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
@@ -4281,7 +4171,7 @@ const connectedCallback = (elm) => {
|
|
|
4281
4171
|
if (BUILD$1.initializeNextTick) nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
4282
4172
|
else initializeComponent(elm, hostRef, cmpMeta);
|
|
4283
4173
|
} else {
|
|
4284
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
4174
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
4285
4175
|
if (hostRef?.$lazyInstance$) fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
4286
4176
|
else if (hostRef?.$onReadyPromise$) hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
4287
4177
|
}
|
|
@@ -4342,14 +4232,18 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4342
4232
|
}
|
|
4343
4233
|
if (BUILD$1.reflect) cmpMeta.$attrsToReflect$ = [];
|
|
4344
4234
|
if (BUILD$1.shadowDom && !supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) cmpMeta.$flags$ |= CMP_FLAGS.needsShadowDomShim;
|
|
4345
|
-
if (!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && cmpMeta.$flags$ & CMP_FLAGS.hasSlot) if (BUILD$1.experimentalSlotFixes) patchPseudoShadowDom(Cstr.prototype);
|
|
4235
|
+
if (!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && cmpMeta.$flags$ & CMP_FLAGS.hasSlot) if (BUILD$1.experimentalSlotFixes || BUILD$1.patchAll && cmpMeta.$flags$ & CMP_FLAGS.patchAll) patchPseudoShadowDom(Cstr.prototype);
|
|
4346
4236
|
else {
|
|
4347
|
-
if (BUILD$1.slotChildNodesFix) patchChildSlotNodes(Cstr.prototype);
|
|
4348
|
-
if (BUILD$1.cloneNodeFix) patchCloneNode(Cstr.prototype);
|
|
4349
|
-
if (BUILD$1.appendChildSlotFix
|
|
4237
|
+
if (BUILD$1.slotChildNodesFix || BUILD$1.patchChildren && cmpMeta.$flags$ & CMP_FLAGS.patchChildren) patchChildSlotNodes(Cstr.prototype);
|
|
4238
|
+
if (BUILD$1.cloneNodeFix || BUILD$1.patchClone && cmpMeta.$flags$ & CMP_FLAGS.patchClone) patchCloneNode(Cstr.prototype);
|
|
4239
|
+
if (BUILD$1.appendChildSlotFix || BUILD$1.patchInsert && cmpMeta.$flags$ & CMP_FLAGS.patchInsert) {
|
|
4240
|
+
patchSlotAppendChild(Cstr.prototype);
|
|
4241
|
+
patchInsertBefore(Cstr.prototype);
|
|
4242
|
+
patchSlotRemoveChild(Cstr.prototype);
|
|
4243
|
+
}
|
|
4350
4244
|
if (BUILD$1.scopedSlotTextContentFix && cmpMeta.$flags$ & CMP_FLAGS.scopedCssEncapsulation) patchTextContent(Cstr.prototype);
|
|
4351
4245
|
}
|
|
4352
|
-
else if (BUILD$1.cloneNodeFix) patchCloneNode(Cstr.prototype);
|
|
4246
|
+
else if (BUILD$1.cloneNodeFix || BUILD$1.patchClone && cmpMeta.$flags$ & CMP_FLAGS.patchClone) patchCloneNode(Cstr.prototype);
|
|
4353
4247
|
if (BUILD$1.hydrateClientSide && BUILD$1.shadowDom) hydrateScopedToShadow();
|
|
4354
4248
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
4355
4249
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
@@ -4365,7 +4259,7 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4365
4259
|
if (!this.__hasHostListenerAttached) {
|
|
4366
4260
|
const hostRef = getHostRef(this);
|
|
4367
4261
|
if (!hostRef) return;
|
|
4368
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners
|
|
4262
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
4369
4263
|
this.__hasHostListenerAttached = true;
|
|
4370
4264
|
}
|
|
4371
4265
|
connectedCallback(this);
|
|
@@ -4377,8 +4271,13 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4377
4271
|
},
|
|
4378
4272
|
__attachShadow() {
|
|
4379
4273
|
if (supportsShadow) {
|
|
4380
|
-
|
|
4381
|
-
|
|
4274
|
+
const isClosed = BUILD$1.shadowModeClosed && !!(cmpMeta.$flags$ & CMP_FLAGS.shadowModeClosed);
|
|
4275
|
+
let existingRoot = this.shadowRoot;
|
|
4276
|
+
if (BUILD$1.shadowModeClosed && isClosed) existingRoot = this.__shadowRoot ?? null;
|
|
4277
|
+
if (!existingRoot) createShadowRoot.call(this, cmpMeta);
|
|
4278
|
+
else if (BUILD$1.shadowModeClosed && isClosed) {
|
|
4279
|
+
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.`);
|
|
4280
|
+
}
|
|
4382
4281
|
} else this.shadowRoot = this;
|
|
4383
4282
|
}
|
|
4384
4283
|
});
|
|
@@ -4474,7 +4373,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4474
4373
|
cmpMeta.$deserializers$ = compactMeta[6] ?? {};
|
|
4475
4374
|
}
|
|
4476
4375
|
if (BUILD$1.shadowDom && !supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) cmpMeta.$flags$ |= CMP_FLAGS.needsShadowDomShim;
|
|
4477
|
-
const tagName =
|
|
4376
|
+
const tagName = transformTag(cmpMeta.$tagName$);
|
|
4478
4377
|
const HostElement = class extends HTMLElement {
|
|
4479
4378
|
["s-p"];
|
|
4480
4379
|
["s-rc"];
|
|
@@ -4501,7 +4400,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4501
4400
|
*/
|
|
4502
4401
|
if (!this.hasRegisteredEventListeners) {
|
|
4503
4402
|
this.hasRegisteredEventListeners = true;
|
|
4504
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners
|
|
4403
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
4505
4404
|
}
|
|
4506
4405
|
if (appLoadFallback) {
|
|
4507
4406
|
clearTimeout(appLoadFallback);
|
|
@@ -4533,14 +4432,18 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4533
4432
|
return getHostRef(this)?.$onReadyPromise$;
|
|
4534
4433
|
}
|
|
4535
4434
|
};
|
|
4536
|
-
if (!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && cmpMeta.$flags$ & CMP_FLAGS.hasSlot) if (BUILD$1.experimentalSlotFixes) patchPseudoShadowDom(HostElement.prototype);
|
|
4435
|
+
if (!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && cmpMeta.$flags$ & CMP_FLAGS.hasSlot) if (BUILD$1.experimentalSlotFixes || BUILD$1.patchAll && cmpMeta.$flags$ & CMP_FLAGS.patchAll) patchPseudoShadowDom(HostElement.prototype);
|
|
4537
4436
|
else {
|
|
4538
|
-
if (BUILD$1.slotChildNodesFix) patchChildSlotNodes(HostElement.prototype);
|
|
4539
|
-
if (BUILD$1.cloneNodeFix) patchCloneNode(HostElement.prototype);
|
|
4540
|
-
if (BUILD$1.appendChildSlotFix
|
|
4437
|
+
if (BUILD$1.slotChildNodesFix || BUILD$1.patchChildren && cmpMeta.$flags$ & CMP_FLAGS.patchChildren) patchChildSlotNodes(HostElement.prototype);
|
|
4438
|
+
if (BUILD$1.cloneNodeFix || BUILD$1.patchClone && cmpMeta.$flags$ & CMP_FLAGS.patchClone) patchCloneNode(HostElement.prototype);
|
|
4439
|
+
if (BUILD$1.appendChildSlotFix || BUILD$1.patchInsert && cmpMeta.$flags$ & CMP_FLAGS.patchInsert) {
|
|
4440
|
+
patchSlotAppendChild(HostElement.prototype);
|
|
4441
|
+
patchInsertBefore(HostElement.prototype);
|
|
4442
|
+
patchSlotRemoveChild(HostElement.prototype);
|
|
4443
|
+
}
|
|
4541
4444
|
if (BUILD$1.scopedSlotTextContentFix && cmpMeta.$flags$ & CMP_FLAGS.scopedCssEncapsulation) patchTextContent(HostElement.prototype);
|
|
4542
4445
|
}
|
|
4543
|
-
else if (BUILD$1.cloneNodeFix) patchCloneNode(HostElement.prototype);
|
|
4446
|
+
else if (BUILD$1.cloneNodeFix || BUILD$1.patchClone && cmpMeta.$flags$ & CMP_FLAGS.patchClone) patchCloneNode(HostElement.prototype);
|
|
4544
4447
|
if (BUILD$1.formAssociated && cmpMeta.$flags$ & CMP_FLAGS.formAssociated) HostElement.formAssociated = true;
|
|
4545
4448
|
if (BUILD$1.hotModuleReplacement) HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
4546
4449
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
@@ -4572,18 +4475,14 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4572
4475
|
const Fragment = (_, children) => children;
|
|
4573
4476
|
//#endregion
|
|
4574
4477
|
//#region src/runtime/host-listener.ts
|
|
4575
|
-
const addHostEventListeners = (elm, hostRef, listeners
|
|
4576
|
-
if (BUILD$1.hostListener && listeners && win.document) {
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
plt.ael(target, name, handler, opts);
|
|
4584
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
4585
|
-
});
|
|
4586
|
-
}
|
|
4478
|
+
const addHostEventListeners = (elm, hostRef, listeners) => {
|
|
4479
|
+
if (BUILD$1.hostListener && listeners && win.document) listeners.map(([flags, name, method]) => {
|
|
4480
|
+
const target = BUILD$1.hostListenerTarget ? getHostListenerTarget(win.document, elm, flags) : elm;
|
|
4481
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
4482
|
+
const opts = hostListenerOpts(flags);
|
|
4483
|
+
plt.ael(target, name, handler, opts);
|
|
4484
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
4485
|
+
});
|
|
4587
4486
|
};
|
|
4588
4487
|
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
4589
4488
|
try {
|
|
@@ -4598,7 +4497,6 @@ const getHostListenerTarget = (doc, elm, flags) => {
|
|
|
4598
4497
|
if (BUILD$1.hostListenerTargetDocument && flags & LISTENER_FLAGS.TargetDocument) return doc;
|
|
4599
4498
|
if (BUILD$1.hostListenerTargetWindow && flags & LISTENER_FLAGS.TargetWindow) return win;
|
|
4600
4499
|
if (BUILD$1.hostListenerTargetBody && flags & LISTENER_FLAGS.TargetBody) return doc.body;
|
|
4601
|
-
if (BUILD$1.hostListenerTargetParent && flags & LISTENER_FLAGS.TargetParent && elm.parentElement) return elm.parentElement;
|
|
4602
4500
|
return elm;
|
|
4603
4501
|
};
|
|
4604
4502
|
const hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
@@ -4876,4 +4774,4 @@ const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, in
|
|
|
4876
4774
|
}
|
|
4877
4775
|
};
|
|
4878
4776
|
//#endregion
|
|
4879
|
-
export { AttachInternals, AttrDeserialize, BUILD, Build, Component, Element$1 as Element, Env, Event, Fragment, H, H as HTMLElement, HYDRATED_STYLE_ID, Host, Listen, Method, Mixin, NAMESPACE, Prop, PropSerialize, STENCIL_DEV_MODE, State, Watch, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getValue, h, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, render, renderVdom, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setScopedSSR, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, supportsShadow, transformTag, win, writeTask };
|
|
4777
|
+
export { AttachInternals, AttrDeserialize, BUILD, Build, Component, Element$1 as Element, Env, Event, Fragment, H, H as HTMLElement, HYDRATED_STYLE_ID, Host, Listen, Method, Mixin, NAMESPACE, Prop, PropSerialize, STENCIL_DEV_MODE, State, Watch, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, render, renderVdom, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setScopedSSR, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, supportsShadow, transformTag, win, writeTask };
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as ResolutionHandler, a as ComponentRuntimeMeta, c as HostRef, d as RenderNode, f as RuntimeRef, g as JSXBase, h as HTMLStencilElement, i as ComponentRuntimeHostListener, l as LazyBundlesRuntimeData, n as ChildType, o as ComponentRuntimeMetaCompact, p as CustomElementsDefineOptions, r as ComponentConstructor, s as HostElement, u as PlatformRuntime, v as TagTransformer, y as VNode } from "../index-
|
|
2
|
-
import { n as jsxs, r as Fragment, t as jsx } from "../jsx-runtime-
|
|
1
|
+
import { _ as ResolutionHandler, a as ComponentRuntimeMeta, c as HostRef, d as RenderNode, f as RuntimeRef, g as JSXBase, h as HTMLStencilElement, i as ComponentRuntimeHostListener, l as LazyBundlesRuntimeData, n as ChildType, o as ComponentRuntimeMetaCompact, p as CustomElementsDefineOptions, r as ComponentConstructor, s as HostElement, u as PlatformRuntime, v as TagTransformer, y as VNode } from "../index-CyrGY82h.js";
|
|
2
|
+
import { n as jsxs, r as Fragment, t as jsx } from "../jsx-runtime-DlDkTqps.js";
|
|
3
3
|
|
|
4
4
|
//#region src/runtime/asset-path.d.ts
|
|
5
5
|
declare const getAssetPath: (path: string) => string;
|
|
@@ -21,6 +21,18 @@ declare const disconnectedCallback: (elm: HostElement) => Promise<void>;
|
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/runtime/element.d.ts
|
|
23
23
|
declare const getElement: (ref: any) => HostElement;
|
|
24
|
+
/**
|
|
25
|
+
* Get the shadow root for a Stencil component's host element.
|
|
26
|
+
* This works for both open and closed shadow DOM modes.
|
|
27
|
+
*
|
|
28
|
+
* For closed shadow DOM, `element.shadowRoot` returns `null` by design,
|
|
29
|
+
* but Stencil stores the reference internally so components can still
|
|
30
|
+
* access their own shadow root.
|
|
31
|
+
*
|
|
32
|
+
* @param element The host element (from @Element() decorator)
|
|
33
|
+
* @returns The shadow root, or null if no shadow root exists
|
|
34
|
+
*/
|
|
35
|
+
declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
|
|
24
36
|
//#endregion
|
|
25
37
|
//#region src/runtime/event-emitter.d.ts
|
|
26
38
|
declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
|
|
@@ -28,7 +40,7 @@ declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
|
|
|
28
40
|
};
|
|
29
41
|
//#endregion
|
|
30
42
|
//#region src/runtime/host-listener.d.ts
|
|
31
|
-
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]
|
|
43
|
+
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
|
|
32
44
|
//#endregion
|
|
33
45
|
//#region src/runtime/mixin.d.ts
|
|
34
46
|
type Ctor<T = {}> = new (...args: any[]) => T;
|
|
@@ -179,4 +191,4 @@ declare const insertVdomAnnotations: (doc: Document, staticComponents: string[])
|
|
|
179
191
|
*/
|
|
180
192
|
declare const renderVdom: (hostRef: HostRef, renderFnResults: VNode | VNode[], isInitialLoad?: boolean) => void;
|
|
181
193
|
//#endregion
|
|
182
|
-
export { Fragment, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getValue, h, insertVdomAnnotations, jsx, jsxs, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, renderVdom, setAssetPath, setMode, setNonce, setPlatformOptions, setTagTransformer, setValue, transformTag };
|
|
194
|
+
export { Fragment, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, jsx, jsxs, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, renderVdom, setAssetPath, setMode, setNonce, setPlatformOptions, setTagTransformer, setValue, transformTag };
|
package/dist/runtime/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { Fragment, HYDRATED_STYLE_ID, Host, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getValue, h, insertVdomAnnotations, jsx, jsxs, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, renderVdom, setAssetPath, setMode, setNonce, setPlatformOptions, setTagTransformer, setValue, transformTag };
|
|
1
|
+
import { A as h, C as postUpdateComponent, D as getMode, E as parsePropertyValue, F as HYDRATED_STYLE_ID, M as getShadowRoot, N as getAssetPath, O as setMode, P as setAssetPath, S as getRenderingRef, T as createEvent, _ as connectedCallback, a as transformTag, b as setValue, c as setNonce, d as Fragment, f as bootstrapLazy, g as disconnectedCallback, h as proxyCustomElement, i as setTagTransformer, j as getElement, k as Host, l as Mixin, m as forceModeUpdate, n as jsx, o as render, p as defineCustomElement, r as jsxs, s as setPlatformOptions, t as insertVdomAnnotations, u as addHostEventListeners, v as proxyComponent, w as renderVdom, x as forceUpdate, y as getValue } from "../runtime-BBCnuprF.js";
|
|
2
|
+
export { Fragment, HYDRATED_STYLE_ID, Host, Mixin, addHostEventListeners, bootstrapLazy, connectedCallback, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, jsx, jsxs, parsePropertyValue, postUpdateComponent, proxyComponent, proxyCustomElement, render, renderVdom, setAssetPath, setMode, setNonce, setPlatformOptions, setTagTransformer, setValue, transformTag };
|
|
@@ -139,8 +139,6 @@ interface VNode {
|
|
|
139
139
|
interface CustomElementsDefineOptions {
|
|
140
140
|
exclude?: string[];
|
|
141
141
|
syncQueue?: boolean;
|
|
142
|
-
/** @deprecated in-favour of `setTagTransformer` and `transformTag` */
|
|
143
|
-
transformTagName?: (tagName: string) => string;
|
|
144
142
|
jmp?: (c: Function) => any;
|
|
145
143
|
raf?: (c: FrameRequestCallback) => number;
|
|
146
144
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
@@ -963,7 +961,7 @@ declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
|
|
|
963
961
|
declare const Fragment: FunctionalComponent;
|
|
964
962
|
//#endregion
|
|
965
963
|
//#region src/runtime/host-listener.d.ts
|
|
966
|
-
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]
|
|
964
|
+
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
|
|
967
965
|
//#endregion
|
|
968
966
|
//#region src/runtime/mixin.d.ts
|
|
969
967
|
type Ctor<T = {}> = new (...args: any[]) => T;
|