@stencil/core 5.0.0-alpha.1 → 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-B1nuvCd2.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-LX4_RKKd.mjs → compiler-D6iP7Bzb.mjs} +1391 -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-SxQIOCZE.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 -192
- 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 -192
- package/dist/runtime/server/runner.d.mts +1 -17
- package/dist/runtime/server/runner.mjs +12 -368
- package/dist/{runtime-CF9DJtSu.js → runtime-BBCnuprF.js} +103 -192
- 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-CaCgjw-f.mjs → validation-Byxie0Uk.mjs} +28 -24
- package/package.json +9 -13
- package/dist/serialize-BkYHk7Mi.mjs +0 -766
- 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,98 +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
|
-
* Deserialize a value from a string that was serialized earlier.
|
|
2622
|
-
* @param {string} value - The string to deserialize.
|
|
2623
|
-
* @returns {unknown} The deserialized value.
|
|
2624
|
-
* @deprecated will be removed in v5. Use `@AttrDeserialize()` decorator instead.
|
|
2625
|
-
*/
|
|
2626
|
-
function deserializeProperty(value) {
|
|
2627
|
-
if (typeof value !== "string" || !value.startsWith("serialized:")) return value;
|
|
2628
|
-
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(11))));
|
|
2629
|
-
}
|
|
2630
|
-
//#endregion
|
|
2631
2541
|
//#region src/runtime/parse-property-value.ts
|
|
2632
2542
|
/**
|
|
2633
2543
|
* Parse a new property value for a given property type.
|
|
@@ -2654,14 +2564,6 @@ function deserializeProperty(value) {
|
|
|
2654
2564
|
* @returns the parsed/coerced value
|
|
2655
2565
|
*/
|
|
2656
2566
|
const parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
2657
|
-
/**
|
|
2658
|
-
* Allow hydrate parameters that contain a complex non-serialized values.
|
|
2659
|
-
* This is SSR-specific and should only run during hydration.
|
|
2660
|
-
*/
|
|
2661
|
-
if ((BUILD$1.hydrateClientSide || BUILD$1.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith("serialized:")) {
|
|
2662
|
-
propValue = deserializeProperty(propValue);
|
|
2663
|
-
return propValue;
|
|
2664
|
-
}
|
|
2665
2567
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2666
2568
|
/**
|
|
2667
2569
|
* ensure this value is of the correct prop type
|
|
@@ -2690,9 +2592,6 @@ const parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
2690
2592
|
return propValue;
|
|
2691
2593
|
};
|
|
2692
2594
|
//#endregion
|
|
2693
|
-
//#region src/runtime/element.ts
|
|
2694
|
-
const getElement = (ref) => BUILD$1.lazyLoad ? getHostRef(ref)?.$hostElement$ : ref;
|
|
2695
|
-
//#endregion
|
|
2696
2595
|
//#region src/runtime/event-emitter.ts
|
|
2697
2596
|
const createEvent = (ref, name, flags) => {
|
|
2698
2597
|
const elm = getElement(ref);
|
|
@@ -3045,7 +2944,10 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
3045
2944
|
const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
3046
2945
|
let containerElm = BUILD$1.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
3047
2946
|
let childNode;
|
|
3048
|
-
if (BUILD$1.shadowDom && containerElm.
|
|
2947
|
+
if (BUILD$1.shadowDom && containerElm.tagName === hostTagName) {
|
|
2948
|
+
const shadow = getShadowRoot(containerElm);
|
|
2949
|
+
if (shadow) containerElm = shadow;
|
|
2950
|
+
}
|
|
3049
2951
|
if (parentVNode.$tag$ === "template") containerElm = containerElm.content;
|
|
3050
2952
|
for (; startIdx <= endIdx; ++startIdx) if (vnodes[startIdx]) {
|
|
3051
2953
|
childNode = createElm(null, parentVNode, startIdx);
|
|
@@ -3395,7 +3297,8 @@ const insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
|
3395
3297
|
if (BUILD$1.slotRelocation) {
|
|
3396
3298
|
if (BUILD$1.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
3397
3299
|
else if (typeof newNode["s-sn"] === "string") {
|
|
3398
|
-
|
|
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);
|
|
3399
3302
|
parent.insertBefore(newNode, reference);
|
|
3400
3303
|
const { slotNode } = findSlotFromSlottedNode(newNode);
|
|
3401
3304
|
if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
|
|
@@ -3484,7 +3387,7 @@ render() {
|
|
|
3484
3387
|
rootVnode.$tag$ = null;
|
|
3485
3388
|
rootVnode.$flags$ |= VNODE_FLAGS.isHost;
|
|
3486
3389
|
hostRef.$vnode$ = rootVnode;
|
|
3487
|
-
rootVnode.$elm$ = oldVNode.$elm$ = BUILD$1.shadowDom ? hostElm
|
|
3390
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD$1.shadowDom ? getShadowRoot(hostElm) || hostElm : hostElm;
|
|
3488
3391
|
if (BUILD$1.scoped || BUILD$1.shadowDom) scopeId = hostElm["s-sc"];
|
|
3489
3392
|
useNativeShadowDom = supportsShadow && !!(cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) && !(cmpMeta.$flags$ & CMP_FLAGS.shadowNeedsScopedCss);
|
|
3490
3393
|
if (BUILD$1.slotRelocation) {
|
|
@@ -3639,13 +3542,13 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
3639
3542
|
}
|
|
3640
3543
|
if (hostRef.$fetchedCbList$.length) hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
|
|
3641
3544
|
}
|
|
3642
|
-
emitLifecycleEvent(elm, "componentWillLoad");
|
|
3545
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillLoad");
|
|
3643
3546
|
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
3644
3547
|
} else {
|
|
3645
|
-
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
3548
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillUpdate");
|
|
3646
3549
|
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
3647
3550
|
}
|
|
3648
|
-
emitLifecycleEvent(elm, "componentWillRender");
|
|
3551
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentWillRender");
|
|
3649
3552
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
3650
3553
|
endSchedule();
|
|
3651
3554
|
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
@@ -3780,14 +3683,14 @@ const postUpdateComponent = (hostRef) => {
|
|
|
3780
3683
|
if (BUILD$1.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnRender;
|
|
3781
3684
|
safeCall(instance, "componentDidRender", void 0, elm);
|
|
3782
3685
|
if (BUILD$1.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnRender;
|
|
3783
|
-
emitLifecycleEvent(elm, "componentDidRender");
|
|
3686
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidRender");
|
|
3784
3687
|
if (!(hostRef.$flags$ & HOST_FLAGS.hasLoadedComponent)) {
|
|
3785
3688
|
hostRef.$flags$ |= HOST_FLAGS.hasLoadedComponent;
|
|
3786
3689
|
if (BUILD$1.asyncLoading && BUILD$1.cssAnnotations) addHydratedFlag(elm);
|
|
3787
3690
|
if (BUILD$1.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnDidLoad;
|
|
3788
3691
|
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
3789
3692
|
if (BUILD$1.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnDidLoad;
|
|
3790
|
-
emitLifecycleEvent(elm, "componentDidLoad");
|
|
3693
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidLoad");
|
|
3791
3694
|
if (BUILD$1.propChangeCallback) hostRef.$flags$ |= HOST_FLAGS.isWatchReady;
|
|
3792
3695
|
endPostUpdate();
|
|
3793
3696
|
if (BUILD$1.asyncLoading) {
|
|
@@ -3798,7 +3701,7 @@ const postUpdateComponent = (hostRef) => {
|
|
|
3798
3701
|
if (BUILD$1.isDev) hostRef.$flags$ |= HOST_FLAGS.devOnRender;
|
|
3799
3702
|
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
3800
3703
|
if (BUILD$1.isDev) hostRef.$flags$ &= ~HOST_FLAGS.devOnRender;
|
|
3801
|
-
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
3704
|
+
if (BUILD$1.lifecycleDOMEvents) emitLifecycleEvent(elm, "componentDidUpdate");
|
|
3802
3705
|
endPostUpdate();
|
|
3803
3706
|
}
|
|
3804
3707
|
if (BUILD$1.method && BUILD$1.lazyLoad) hostRef.$onInstanceResolve$(elm);
|
|
@@ -4221,7 +4124,6 @@ const connectedCallback = (elm) => {
|
|
|
4221
4124
|
if (!hostRef) return;
|
|
4222
4125
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
4223
4126
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
4224
|
-
if (BUILD$1.hostListenerTargetParent) addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
4225
4127
|
if (!(hostRef.$flags$ & HOST_FLAGS.hasConnected)) {
|
|
4226
4128
|
hostRef.$flags$ |= HOST_FLAGS.hasConnected;
|
|
4227
4129
|
let hostId;
|
|
@@ -4229,7 +4131,8 @@ const connectedCallback = (elm) => {
|
|
|
4229
4131
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
4230
4132
|
if (hostId) {
|
|
4231
4133
|
if (BUILD$1.shadowDom && supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) {
|
|
4232
|
-
const
|
|
4134
|
+
const shadowRoot = getShadowRoot(elm);
|
|
4135
|
+
const scopeId = BUILD$1.mode ? addStyle(shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(shadowRoot, cmpMeta);
|
|
4233
4136
|
elm.classList.remove(scopeId + "-h", scopeId + "-s");
|
|
4234
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);
|
|
4235
4138
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
@@ -4268,7 +4171,7 @@ const connectedCallback = (elm) => {
|
|
|
4268
4171
|
if (BUILD$1.initializeNextTick) nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
4269
4172
|
else initializeComponent(elm, hostRef, cmpMeta);
|
|
4270
4173
|
} else {
|
|
4271
|
-
addHostEventListeners(elm, hostRef, cmpMeta.$listeners
|
|
4174
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
4272
4175
|
if (hostRef?.$lazyInstance$) fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
4273
4176
|
else if (hostRef?.$onReadyPromise$) hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
|
|
4274
4177
|
}
|
|
@@ -4329,14 +4232,18 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4329
4232
|
}
|
|
4330
4233
|
if (BUILD$1.reflect) cmpMeta.$attrsToReflect$ = [];
|
|
4331
4234
|
if (BUILD$1.shadowDom && !supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) cmpMeta.$flags$ |= CMP_FLAGS.needsShadowDomShim;
|
|
4332
|
-
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);
|
|
4333
4236
|
else {
|
|
4334
|
-
if (BUILD$1.slotChildNodesFix) patchChildSlotNodes(Cstr.prototype);
|
|
4335
|
-
if (BUILD$1.cloneNodeFix) patchCloneNode(Cstr.prototype);
|
|
4336
|
-
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
|
+
}
|
|
4337
4244
|
if (BUILD$1.scopedSlotTextContentFix && cmpMeta.$flags$ & CMP_FLAGS.scopedCssEncapsulation) patchTextContent(Cstr.prototype);
|
|
4338
4245
|
}
|
|
4339
|
-
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);
|
|
4340
4247
|
if (BUILD$1.hydrateClientSide && BUILD$1.shadowDom) hydrateScopedToShadow();
|
|
4341
4248
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
4342
4249
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
@@ -4352,7 +4259,7 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4352
4259
|
if (!this.__hasHostListenerAttached) {
|
|
4353
4260
|
const hostRef = getHostRef(this);
|
|
4354
4261
|
if (!hostRef) return;
|
|
4355
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners
|
|
4262
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
4356
4263
|
this.__hasHostListenerAttached = true;
|
|
4357
4264
|
}
|
|
4358
4265
|
connectedCallback(this);
|
|
@@ -4364,8 +4271,13 @@ const proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4364
4271
|
},
|
|
4365
4272
|
__attachShadow() {
|
|
4366
4273
|
if (supportsShadow) {
|
|
4367
|
-
|
|
4368
|
-
|
|
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
|
+
}
|
|
4369
4281
|
} else this.shadowRoot = this;
|
|
4370
4282
|
}
|
|
4371
4283
|
});
|
|
@@ -4461,7 +4373,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4461
4373
|
cmpMeta.$deserializers$ = compactMeta[6] ?? {};
|
|
4462
4374
|
}
|
|
4463
4375
|
if (BUILD$1.shadowDom && !supportsShadow && cmpMeta.$flags$ & CMP_FLAGS.shadowDomEncapsulation) cmpMeta.$flags$ |= CMP_FLAGS.needsShadowDomShim;
|
|
4464
|
-
const tagName =
|
|
4376
|
+
const tagName = transformTag(cmpMeta.$tagName$);
|
|
4465
4377
|
const HostElement = class extends HTMLElement {
|
|
4466
4378
|
["s-p"];
|
|
4467
4379
|
["s-rc"];
|
|
@@ -4488,7 +4400,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4488
4400
|
*/
|
|
4489
4401
|
if (!this.hasRegisteredEventListeners) {
|
|
4490
4402
|
this.hasRegisteredEventListeners = true;
|
|
4491
|
-
addHostEventListeners(this, hostRef, cmpMeta.$listeners
|
|
4403
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
4492
4404
|
}
|
|
4493
4405
|
if (appLoadFallback) {
|
|
4494
4406
|
clearTimeout(appLoadFallback);
|
|
@@ -4520,14 +4432,18 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4520
4432
|
return getHostRef(this)?.$onReadyPromise$;
|
|
4521
4433
|
}
|
|
4522
4434
|
};
|
|
4523
|
-
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);
|
|
4524
4436
|
else {
|
|
4525
|
-
if (BUILD$1.slotChildNodesFix) patchChildSlotNodes(HostElement.prototype);
|
|
4526
|
-
if (BUILD$1.cloneNodeFix) patchCloneNode(HostElement.prototype);
|
|
4527
|
-
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
|
+
}
|
|
4528
4444
|
if (BUILD$1.scopedSlotTextContentFix && cmpMeta.$flags$ & CMP_FLAGS.scopedCssEncapsulation) patchTextContent(HostElement.prototype);
|
|
4529
4445
|
}
|
|
4530
|
-
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);
|
|
4531
4447
|
if (BUILD$1.formAssociated && cmpMeta.$flags$ & CMP_FLAGS.formAssociated) HostElement.formAssociated = true;
|
|
4532
4448
|
if (BUILD$1.hotModuleReplacement) HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
4533
4449
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
@@ -4559,18 +4475,14 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
4559
4475
|
const Fragment = (_, children) => children;
|
|
4560
4476
|
//#endregion
|
|
4561
4477
|
//#region src/runtime/host-listener.ts
|
|
4562
|
-
const addHostEventListeners = (elm, hostRef, listeners
|
|
4563
|
-
if (BUILD$1.hostListener && listeners && win.document) {
|
|
4564
|
-
|
|
4565
|
-
|
|
4566
|
-
|
|
4567
|
-
|
|
4568
|
-
|
|
4569
|
-
|
|
4570
|
-
plt.ael(target, name, handler, opts);
|
|
4571
|
-
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
4572
|
-
});
|
|
4573
|
-
}
|
|
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
|
+
});
|
|
4574
4486
|
};
|
|
4575
4487
|
const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
4576
4488
|
try {
|
|
@@ -4585,7 +4497,6 @@ const getHostListenerTarget = (doc, elm, flags) => {
|
|
|
4585
4497
|
if (BUILD$1.hostListenerTargetDocument && flags & LISTENER_FLAGS.TargetDocument) return doc;
|
|
4586
4498
|
if (BUILD$1.hostListenerTargetWindow && flags & LISTENER_FLAGS.TargetWindow) return win;
|
|
4587
4499
|
if (BUILD$1.hostListenerTargetBody && flags & LISTENER_FLAGS.TargetBody) return doc.body;
|
|
4588
|
-
if (BUILD$1.hostListenerTargetParent && flags & LISTENER_FLAGS.TargetParent && elm.parentElement) return elm.parentElement;
|
|
4589
4500
|
return elm;
|
|
4590
4501
|
};
|
|
4591
4502
|
const hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
@@ -4863,4 +4774,4 @@ const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, in
|
|
|
4863
4774
|
}
|
|
4864
4775
|
};
|
|
4865
4776
|
//#endregion
|
|
4866
|
-
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;
|