@stencil/core 4.35.3-dev.1752123834.56fe6e3 → 4.35.3-dev.1752161791.11e6f9d
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/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +4 -4
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +183 -208
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +183 -208
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +9 -9
- package/internal/package.json +1 -1
- package/internal/testing/index.js +182 -207
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +14 -14
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Client Platform v4.35.3-dev.
|
|
2
|
+
Stencil Client Platform v4.35.3-dev.1752161791.11e6f9d | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -553,7 +553,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
|
|
|
553
553
|
import { BUILD as BUILD25 } from "@stencil/core/internal/app-data";
|
|
554
554
|
|
|
555
555
|
// src/runtime/client-hydrate.ts
|
|
556
|
-
import { BUILD as
|
|
556
|
+
import { BUILD as BUILD13 } from "@stencil/core/internal/app-data";
|
|
557
557
|
|
|
558
558
|
// src/runtime/dom-extras.ts
|
|
559
559
|
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
@@ -1160,133 +1160,8 @@ var installDevTools = () => {
|
|
|
1160
1160
|
}
|
|
1161
1161
|
};
|
|
1162
1162
|
|
|
1163
|
-
// src/runtime/styles.ts
|
|
1164
|
-
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
1165
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
1166
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
1167
|
-
let style = styles.get(scopeId2);
|
|
1168
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
1169
|
-
style = style || new CSSStyleSheet();
|
|
1170
|
-
if (typeof style === "string") {
|
|
1171
|
-
style = cssText;
|
|
1172
|
-
} else {
|
|
1173
|
-
style.replaceSync(cssText);
|
|
1174
|
-
}
|
|
1175
|
-
} else {
|
|
1176
|
-
style = cssText;
|
|
1177
|
-
}
|
|
1178
|
-
styles.set(scopeId2, style);
|
|
1179
|
-
};
|
|
1180
|
-
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
1181
|
-
var _a;
|
|
1182
|
-
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
1183
|
-
const style = styles.get(scopeId2);
|
|
1184
|
-
if (!BUILD12.attachStyles || !win.document) {
|
|
1185
|
-
return scopeId2;
|
|
1186
|
-
}
|
|
1187
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
1188
|
-
if (style) {
|
|
1189
|
-
if (typeof style === "string") {
|
|
1190
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
1191
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
1192
|
-
let styleElm;
|
|
1193
|
-
if (!appliedStyles) {
|
|
1194
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1195
|
-
}
|
|
1196
|
-
if (!appliedStyles.has(scopeId2)) {
|
|
1197
|
-
if (BUILD12.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1198
|
-
styleElm.innerHTML = style;
|
|
1199
|
-
} else {
|
|
1200
|
-
styleElm = win.document.createElement("style");
|
|
1201
|
-
styleElm.innerHTML = style;
|
|
1202
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
1203
|
-
if (nonce != null) {
|
|
1204
|
-
styleElm.setAttribute("nonce", nonce);
|
|
1205
|
-
}
|
|
1206
|
-
if ((BUILD12.hydrateServerSide || BUILD12.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
|
|
1207
|
-
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
1208
|
-
}
|
|
1209
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
1210
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
1211
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
1212
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
1213
|
-
styleContainerNode.insertBefore(
|
|
1214
|
-
styleElm,
|
|
1215
|
-
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
1216
|
-
);
|
|
1217
|
-
} else if ("host" in styleContainerNode) {
|
|
1218
|
-
if (supportsConstructableStylesheets) {
|
|
1219
|
-
const stylesheet = new CSSStyleSheet();
|
|
1220
|
-
stylesheet.replaceSync(style);
|
|
1221
|
-
if (supportsMutableAdoptedStyleSheets) {
|
|
1222
|
-
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
1223
|
-
} else {
|
|
1224
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
1225
|
-
}
|
|
1226
|
-
} else {
|
|
1227
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
1228
|
-
if (existingStyleContainer) {
|
|
1229
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
1230
|
-
} else {
|
|
1231
|
-
styleContainerNode.prepend(styleElm);
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
} else {
|
|
1235
|
-
styleContainerNode.append(styleElm);
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1239
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
1240
|
-
}
|
|
1241
|
-
}
|
|
1242
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1243
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
1244
|
-
}
|
|
1245
|
-
if (appliedStyles) {
|
|
1246
|
-
appliedStyles.add(scopeId2);
|
|
1247
|
-
}
|
|
1248
|
-
}
|
|
1249
|
-
} else if (BUILD12.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
1250
|
-
if (supportsMutableAdoptedStyleSheets) {
|
|
1251
|
-
styleContainerNode.adoptedStyleSheets.push(style);
|
|
1252
|
-
} else {
|
|
1253
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
}
|
|
1257
|
-
return scopeId2;
|
|
1258
|
-
};
|
|
1259
|
-
var attachStyles = (hostRef) => {
|
|
1260
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
1261
|
-
const elm = hostRef.$hostElement$;
|
|
1262
|
-
const flags = cmpMeta.$flags$;
|
|
1263
|
-
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1264
|
-
const scopeId2 = addStyle(
|
|
1265
|
-
BUILD12.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
1266
|
-
cmpMeta,
|
|
1267
|
-
hostRef.$modeName$
|
|
1268
|
-
);
|
|
1269
|
-
if ((BUILD12.shadowDom || BUILD12.scoped) && BUILD12.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
|
|
1270
|
-
elm["s-sc"] = scopeId2;
|
|
1271
|
-
elm.classList.add(scopeId2 + "-h");
|
|
1272
|
-
}
|
|
1273
|
-
endAttachStyles();
|
|
1274
|
-
};
|
|
1275
|
-
var getScopeId = (cmp, mode) => "sc-" + (BUILD12.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1276
|
-
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
1277
|
-
var hydrateScopedToShadow = () => {
|
|
1278
|
-
if (!win.document) {
|
|
1279
|
-
return;
|
|
1280
|
-
}
|
|
1281
|
-
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1282
|
-
let i2 = 0;
|
|
1283
|
-
for (; i2 < styles2.length; i2++) {
|
|
1284
|
-
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
1285
|
-
}
|
|
1286
|
-
};
|
|
1287
|
-
|
|
1288
1163
|
// src/runtime/vdom/h.ts
|
|
1289
|
-
import { BUILD as
|
|
1164
|
+
import { BUILD as BUILD12 } from "@stencil/core/internal/app-data";
|
|
1290
1165
|
var h = (nodeName, vnodeData, ...children) => {
|
|
1291
1166
|
let child = null;
|
|
1292
1167
|
let key = null;
|
|
@@ -1302,7 +1177,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
1302
1177
|
} else if (child != null && typeof child !== "boolean") {
|
|
1303
1178
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
1304
1179
|
child = String(child);
|
|
1305
|
-
} else if (
|
|
1180
|
+
} else if (BUILD12.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
1306
1181
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
1307
1182
|
Make sure it's using the correct h() function.
|
|
1308
1183
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -1318,28 +1193,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
1318
1193
|
};
|
|
1319
1194
|
walk(children);
|
|
1320
1195
|
if (vnodeData) {
|
|
1321
|
-
if (
|
|
1196
|
+
if (BUILD12.isDev && nodeName === "input") {
|
|
1322
1197
|
validateInputProperties(vnodeData);
|
|
1323
1198
|
}
|
|
1324
|
-
if (
|
|
1199
|
+
if (BUILD12.vdomKey && vnodeData.key) {
|
|
1325
1200
|
key = vnodeData.key;
|
|
1326
1201
|
}
|
|
1327
|
-
if (
|
|
1202
|
+
if (BUILD12.slotRelocation && vnodeData.name) {
|
|
1328
1203
|
slotName = vnodeData.name;
|
|
1329
1204
|
}
|
|
1330
|
-
if (
|
|
1205
|
+
if (BUILD12.vdomClass) {
|
|
1331
1206
|
const classData = vnodeData.className || vnodeData.class;
|
|
1332
1207
|
if (classData) {
|
|
1333
1208
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
1334
1209
|
}
|
|
1335
1210
|
}
|
|
1336
1211
|
}
|
|
1337
|
-
if (
|
|
1212
|
+
if (BUILD12.isDev && vNodeChildren.some(isHost)) {
|
|
1338
1213
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
1339
1214
|
- You are NOT using hostData() and <Host> in the same component.
|
|
1340
1215
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
1341
1216
|
}
|
|
1342
|
-
if (
|
|
1217
|
+
if (BUILD12.vdomFunctional && typeof nodeName === "function") {
|
|
1343
1218
|
return nodeName(
|
|
1344
1219
|
vnodeData === null ? {} : vnodeData,
|
|
1345
1220
|
vNodeChildren,
|
|
@@ -1351,10 +1226,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
1351
1226
|
if (vNodeChildren.length > 0) {
|
|
1352
1227
|
vnode.$children$ = vNodeChildren;
|
|
1353
1228
|
}
|
|
1354
|
-
if (
|
|
1229
|
+
if (BUILD12.vdomKey) {
|
|
1355
1230
|
vnode.$key$ = key;
|
|
1356
1231
|
}
|
|
1357
|
-
if (
|
|
1232
|
+
if (BUILD12.slotRelocation) {
|
|
1358
1233
|
vnode.$name$ = slotName;
|
|
1359
1234
|
}
|
|
1360
1235
|
return vnode;
|
|
@@ -1367,13 +1242,13 @@ var newVNode = (tag, text) => {
|
|
|
1367
1242
|
$elm$: null,
|
|
1368
1243
|
$children$: null
|
|
1369
1244
|
};
|
|
1370
|
-
if (
|
|
1245
|
+
if (BUILD12.vdomAttribute) {
|
|
1371
1246
|
vnode.$attrs$ = null;
|
|
1372
1247
|
}
|
|
1373
|
-
if (
|
|
1248
|
+
if (BUILD12.vdomKey) {
|
|
1374
1249
|
vnode.$key$ = null;
|
|
1375
1250
|
}
|
|
1376
|
-
if (
|
|
1251
|
+
if (BUILD12.slotRelocation) {
|
|
1377
1252
|
vnode.$name$ = null;
|
|
1378
1253
|
}
|
|
1379
1254
|
return vnode;
|
|
@@ -1427,18 +1302,18 @@ var validateInputProperties = (inputElm) => {
|
|
|
1427
1302
|
|
|
1428
1303
|
// src/runtime/client-hydrate.ts
|
|
1429
1304
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1430
|
-
var _a
|
|
1305
|
+
var _a;
|
|
1431
1306
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1432
1307
|
const shadowRoot = hostElm.shadowRoot;
|
|
1433
1308
|
const childRenderNodes = [];
|
|
1434
1309
|
const slotNodes = [];
|
|
1435
1310
|
const slottedNodes = [];
|
|
1436
|
-
const shadowRootNodes =
|
|
1311
|
+
const shadowRootNodes = BUILD13.shadowDom && shadowRoot ? [] : null;
|
|
1437
1312
|
const vnode = newVNode(tagName, null);
|
|
1438
1313
|
vnode.$elm$ = hostElm;
|
|
1439
1314
|
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
1440
1315
|
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
1441
|
-
var _a2,
|
|
1316
|
+
var _a2, _b;
|
|
1442
1317
|
if (!(memberFlags & 31 /* Prop */)) {
|
|
1443
1318
|
return;
|
|
1444
1319
|
}
|
|
@@ -1448,13 +1323,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1448
1323
|
const attrPropVal = parsePropertyValue(
|
|
1449
1324
|
attrVal,
|
|
1450
1325
|
memberFlags,
|
|
1451
|
-
|
|
1326
|
+
BUILD13.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
|
|
1452
1327
|
);
|
|
1453
|
-
(
|
|
1328
|
+
(_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
|
|
1454
1329
|
}
|
|
1455
1330
|
});
|
|
1456
1331
|
let scopeId2;
|
|
1457
|
-
if (
|
|
1332
|
+
if (BUILD13.scoped) {
|
|
1458
1333
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1459
1334
|
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1460
1335
|
scopeId2 = hostElm["s-sc"];
|
|
@@ -1491,16 +1366,6 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1491
1366
|
if (childRenderNode.$tag$ === "slot") {
|
|
1492
1367
|
node["s-cr"] = hostElm["s-cr"];
|
|
1493
1368
|
}
|
|
1494
|
-
} else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && !childRenderNode.$elm$.shadowRoot) {
|
|
1495
|
-
const cmpMeta = getHostRef(childRenderNode.$elm$);
|
|
1496
|
-
const scopeId3 = getScopeId(
|
|
1497
|
-
cmpMeta.$cmpMeta$,
|
|
1498
|
-
BUILD14.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
|
|
1499
|
-
);
|
|
1500
|
-
const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
|
|
1501
|
-
if (styleSheet) {
|
|
1502
|
-
hostElm.shadowRoot.append(styleSheet.cloneNode(true));
|
|
1503
|
-
}
|
|
1504
1369
|
}
|
|
1505
1370
|
if (childRenderNode.$tag$ === "slot") {
|
|
1506
1371
|
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
@@ -1516,7 +1381,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1516
1381
|
}
|
|
1517
1382
|
}
|
|
1518
1383
|
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1519
|
-
if (
|
|
1384
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1520
1385
|
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
1521
1386
|
}
|
|
1522
1387
|
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
@@ -1524,9 +1389,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1524
1389
|
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
1525
1390
|
}
|
|
1526
1391
|
}
|
|
1527
|
-
|
|
1528
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1529
|
-
}
|
|
1392
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1530
1393
|
}
|
|
1531
1394
|
const hosts = [];
|
|
1532
1395
|
const snLen = slottedNodes.length;
|
|
@@ -1548,16 +1411,14 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1548
1411
|
if (!hosts[slottedItem.hostId]) continue;
|
|
1549
1412
|
const hostEle = hosts[slottedItem.hostId];
|
|
1550
1413
|
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1557
|
-
}
|
|
1414
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
1415
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1416
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
1417
|
+
} else {
|
|
1418
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1558
1419
|
}
|
|
1559
1420
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1560
|
-
if (
|
|
1421
|
+
if (BUILD13.experimentalSlotFixes) {
|
|
1561
1422
|
patchSlottedNode(slottedItem.node);
|
|
1562
1423
|
}
|
|
1563
1424
|
}
|
|
@@ -1566,12 +1427,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1566
1427
|
}
|
|
1567
1428
|
}
|
|
1568
1429
|
}
|
|
1569
|
-
if (
|
|
1430
|
+
if (BUILD13.scoped && scopeId2 && slotNodes.length) {
|
|
1570
1431
|
slotNodes.forEach((slot) => {
|
|
1571
1432
|
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1572
1433
|
});
|
|
1573
1434
|
}
|
|
1574
|
-
if (
|
|
1435
|
+
if (BUILD13.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
|
|
1575
1436
|
let rnIdex = 0;
|
|
1576
1437
|
const rnLen = shadowRootNodes.length;
|
|
1577
1438
|
if (rnLen) {
|
|
@@ -1582,13 +1443,14 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1582
1443
|
if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
|
|
1583
1444
|
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
1584
1445
|
node.removeAttribute("hidden");
|
|
1585
|
-
} else if (node.nodeType === 8 /* CommentNode */
|
|
1446
|
+
} else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
1586
1447
|
node.parentNode.removeChild(node);
|
|
1587
1448
|
}
|
|
1588
1449
|
}
|
|
1589
1450
|
});
|
|
1590
1451
|
}
|
|
1591
1452
|
}
|
|
1453
|
+
plt.$orgLocNodes$.delete(hostElm["s-id"]);
|
|
1592
1454
|
hostRef.$hostElement$ = hostElm;
|
|
1593
1455
|
endHydrate();
|
|
1594
1456
|
};
|
|
@@ -1620,7 +1482,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1620
1482
|
if (!parentVNode.$children$) {
|
|
1621
1483
|
parentVNode.$children$ = [];
|
|
1622
1484
|
}
|
|
1623
|
-
if (
|
|
1485
|
+
if (BUILD13.scoped && scopeId2) {
|
|
1624
1486
|
node["s-si"] = scopeId2;
|
|
1625
1487
|
childVNode.$attrs$.class += " " + scopeId2;
|
|
1626
1488
|
}
|
|
@@ -1638,7 +1500,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1638
1500
|
shadowRootNodes,
|
|
1639
1501
|
slottedNodes
|
|
1640
1502
|
);
|
|
1641
|
-
if (
|
|
1503
|
+
if (BUILD13.scoped && scopeId2) {
|
|
1642
1504
|
node.classList.add(scopeId2);
|
|
1643
1505
|
}
|
|
1644
1506
|
}
|
|
@@ -1735,9 +1597,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1735
1597
|
slottedNodes
|
|
1736
1598
|
);
|
|
1737
1599
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1738
|
-
if (
|
|
1600
|
+
if (BUILD13.shadowDom && shadowRootNodes) {
|
|
1739
1601
|
node.remove();
|
|
1740
|
-
} else if (
|
|
1602
|
+
} else if (BUILD13.slotRelocation) {
|
|
1741
1603
|
hostElm["s-cr"] = node;
|
|
1742
1604
|
node["s-cn"] = true;
|
|
1743
1605
|
}
|
|
@@ -1750,7 +1612,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1750
1612
|
vnode.$index$ = "0";
|
|
1751
1613
|
parentVNode.$children$ = [vnode];
|
|
1752
1614
|
} else {
|
|
1753
|
-
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()
|
|
1615
|
+
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
1754
1616
|
node.remove();
|
|
1755
1617
|
}
|
|
1756
1618
|
}
|
|
@@ -1803,15 +1665,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
|
|
|
1803
1665
|
childVNode.$name$ = slotName || null;
|
|
1804
1666
|
childVNode.$tag$ = "slot";
|
|
1805
1667
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1806
|
-
if (
|
|
1668
|
+
if (BUILD13.shadowDom && shadowRootNodes && win.document) {
|
|
1807
1669
|
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
1808
1670
|
if (childVNode.$name$) {
|
|
1809
1671
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
1810
1672
|
}
|
|
1811
|
-
if (
|
|
1812
|
-
|
|
1673
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
1674
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1813
1675
|
} else {
|
|
1814
|
-
|
|
1676
|
+
node.parentNode.insertBefore(slot, node);
|
|
1815
1677
|
}
|
|
1816
1678
|
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
1817
1679
|
node.remove();
|
|
@@ -1837,7 +1699,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
|
|
|
1837
1699
|
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1838
1700
|
let slottedNode = slotNode.nextSibling;
|
|
1839
1701
|
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1840
|
-
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */
|
|
1702
|
+
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
1841
1703
|
slottedNode["s-sn"] = slotName;
|
|
1842
1704
|
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1843
1705
|
slottedNode = slottedNode.nextSibling;
|
|
@@ -2272,31 +2134,31 @@ import { BUILD as BUILD23 } from "@stencil/core/internal/app-data";
|
|
|
2272
2134
|
import { BUILD as BUILD22 } from "@stencil/core/internal/app-data";
|
|
2273
2135
|
|
|
2274
2136
|
// src/runtime/parse-property-value.ts
|
|
2275
|
-
import { BUILD as
|
|
2137
|
+
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
2276
2138
|
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
2277
|
-
if ((
|
|
2139
|
+
if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
2278
2140
|
try {
|
|
2279
2141
|
propValue = JSON.parse(propValue);
|
|
2280
2142
|
return propValue;
|
|
2281
2143
|
} catch (e) {
|
|
2282
2144
|
}
|
|
2283
2145
|
}
|
|
2284
|
-
if ((
|
|
2146
|
+
if ((BUILD14.hydrateClientSide || BUILD14.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
2285
2147
|
propValue = deserializeProperty(propValue);
|
|
2286
2148
|
return propValue;
|
|
2287
2149
|
}
|
|
2288
2150
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2289
|
-
if (
|
|
2290
|
-
if (
|
|
2151
|
+
if (BUILD14.propBoolean && propType & 4 /* Boolean */) {
|
|
2152
|
+
if (BUILD14.formAssociated && isFormAssociated && typeof propValue === "string") {
|
|
2291
2153
|
return propValue === "" || !!propValue;
|
|
2292
2154
|
} else {
|
|
2293
2155
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2294
2156
|
}
|
|
2295
2157
|
}
|
|
2296
|
-
if (
|
|
2158
|
+
if (BUILD14.propNumber && propType & 2 /* Number */) {
|
|
2297
2159
|
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
2298
2160
|
}
|
|
2299
|
-
if (
|
|
2161
|
+
if (BUILD14.propString && propType & 1 /* String */) {
|
|
2300
2162
|
return String(propValue);
|
|
2301
2163
|
}
|
|
2302
2164
|
return propValue;
|
|
@@ -2308,18 +2170,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
2308
2170
|
import { BUILD as BUILD21, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
2309
2171
|
|
|
2310
2172
|
// src/runtime/event-emitter.ts
|
|
2311
|
-
import { BUILD as
|
|
2173
|
+
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
2312
2174
|
|
|
2313
2175
|
// src/runtime/element.ts
|
|
2314
|
-
import { BUILD as
|
|
2315
|
-
var getElement = (ref) =>
|
|
2176
|
+
import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
2177
|
+
var getElement = (ref) => BUILD15.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
2316
2178
|
|
|
2317
2179
|
// src/runtime/event-emitter.ts
|
|
2318
2180
|
var createEvent = (ref, name, flags) => {
|
|
2319
2181
|
const elm = getElement(ref);
|
|
2320
2182
|
return {
|
|
2321
2183
|
emit: (detail) => {
|
|
2322
|
-
if (
|
|
2184
|
+
if (BUILD16.isDev && !elm.isConnected) {
|
|
2323
2185
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
2324
2186
|
}
|
|
2325
2187
|
return emitEvent(elm, name, {
|
|
@@ -2337,6 +2199,131 @@ var emitEvent = (elm, name, opts) => {
|
|
|
2337
2199
|
return ev;
|
|
2338
2200
|
};
|
|
2339
2201
|
|
|
2202
|
+
// src/runtime/styles.ts
|
|
2203
|
+
import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
|
|
2204
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2205
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2206
|
+
let style = styles.get(scopeId2);
|
|
2207
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
2208
|
+
style = style || new CSSStyleSheet();
|
|
2209
|
+
if (typeof style === "string") {
|
|
2210
|
+
style = cssText;
|
|
2211
|
+
} else {
|
|
2212
|
+
style.replaceSync(cssText);
|
|
2213
|
+
}
|
|
2214
|
+
} else {
|
|
2215
|
+
style = cssText;
|
|
2216
|
+
}
|
|
2217
|
+
styles.set(scopeId2, style);
|
|
2218
|
+
};
|
|
2219
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
2220
|
+
var _a;
|
|
2221
|
+
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
2222
|
+
const style = styles.get(scopeId2);
|
|
2223
|
+
if (!BUILD17.attachStyles || !win.document) {
|
|
2224
|
+
return scopeId2;
|
|
2225
|
+
}
|
|
2226
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
2227
|
+
if (style) {
|
|
2228
|
+
if (typeof style === "string") {
|
|
2229
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
2230
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
2231
|
+
let styleElm;
|
|
2232
|
+
if (!appliedStyles) {
|
|
2233
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2234
|
+
}
|
|
2235
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
2236
|
+
if (BUILD17.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2237
|
+
styleElm.innerHTML = style;
|
|
2238
|
+
} else {
|
|
2239
|
+
styleElm = win.document.createElement("style");
|
|
2240
|
+
styleElm.innerHTML = style;
|
|
2241
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
2242
|
+
if (nonce != null) {
|
|
2243
|
+
styleElm.setAttribute("nonce", nonce);
|
|
2244
|
+
}
|
|
2245
|
+
if ((BUILD17.hydrateServerSide || BUILD17.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
|
|
2246
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2247
|
+
}
|
|
2248
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2249
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
2250
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
2251
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
2252
|
+
styleContainerNode.insertBefore(
|
|
2253
|
+
styleElm,
|
|
2254
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
2255
|
+
);
|
|
2256
|
+
} else if ("host" in styleContainerNode) {
|
|
2257
|
+
if (supportsConstructableStylesheets) {
|
|
2258
|
+
const stylesheet = new CSSStyleSheet();
|
|
2259
|
+
stylesheet.replaceSync(style);
|
|
2260
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2261
|
+
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
2262
|
+
} else {
|
|
2263
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
2264
|
+
}
|
|
2265
|
+
} else {
|
|
2266
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2267
|
+
if (existingStyleContainer) {
|
|
2268
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
2269
|
+
} else {
|
|
2270
|
+
styleContainerNode.prepend(styleElm);
|
|
2271
|
+
}
|
|
2272
|
+
}
|
|
2273
|
+
} else {
|
|
2274
|
+
styleContainerNode.append(styleElm);
|
|
2275
|
+
}
|
|
2276
|
+
}
|
|
2277
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2278
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2282
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
2283
|
+
}
|
|
2284
|
+
if (appliedStyles) {
|
|
2285
|
+
appliedStyles.add(scopeId2);
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2288
|
+
} else if (BUILD17.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2289
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2290
|
+
styleContainerNode.adoptedStyleSheets.push(style);
|
|
2291
|
+
} else {
|
|
2292
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
return scopeId2;
|
|
2297
|
+
};
|
|
2298
|
+
var attachStyles = (hostRef) => {
|
|
2299
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
2300
|
+
const elm = hostRef.$hostElement$;
|
|
2301
|
+
const flags = cmpMeta.$flags$;
|
|
2302
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2303
|
+
const scopeId2 = addStyle(
|
|
2304
|
+
BUILD17.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2305
|
+
cmpMeta,
|
|
2306
|
+
hostRef.$modeName$
|
|
2307
|
+
);
|
|
2308
|
+
if ((BUILD17.shadowDom || BUILD17.scoped) && BUILD17.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
|
|
2309
|
+
elm["s-sc"] = scopeId2;
|
|
2310
|
+
elm.classList.add(scopeId2 + "-h");
|
|
2311
|
+
}
|
|
2312
|
+
endAttachStyles();
|
|
2313
|
+
};
|
|
2314
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD17.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
2315
|
+
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
2316
|
+
var hydrateScopedToShadow = () => {
|
|
2317
|
+
if (!win.document) {
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2320
|
+
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
2321
|
+
let i2 = 0;
|
|
2322
|
+
for (; i2 < styles2.length; i2++) {
|
|
2323
|
+
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
2324
|
+
}
|
|
2325
|
+
};
|
|
2326
|
+
|
|
2340
2327
|
// src/runtime/vdom/vdom-render.ts
|
|
2341
2328
|
import { BUILD as BUILD20 } from "@stencil/core/internal/app-data";
|
|
2342
2329
|
|
|
@@ -2355,13 +2342,12 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2355
2342
|
const classList = elm.classList;
|
|
2356
2343
|
const oldClasses = parseClassList(oldValue);
|
|
2357
2344
|
let newClasses = parseClassList(newValue);
|
|
2358
|
-
if (BUILD18.hydrateClientSide &&
|
|
2359
|
-
|
|
2360
|
-
newClasses.push(scopeId2);
|
|
2345
|
+
if (BUILD18.hydrateClientSide && elm["s-si"] && initialRender) {
|
|
2346
|
+
newClasses.push(elm["s-si"]);
|
|
2361
2347
|
oldClasses.forEach((c) => {
|
|
2362
|
-
if (c.startsWith(
|
|
2348
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
2363
2349
|
});
|
|
2364
|
-
newClasses = [...new Set(newClasses)]
|
|
2350
|
+
newClasses = [...new Set(newClasses)];
|
|
2365
2351
|
classList.add(...newClasses);
|
|
2366
2352
|
} else {
|
|
2367
2353
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
@@ -3312,16 +3298,10 @@ var forceUpdate = (ref) => {
|
|
|
3312
3298
|
return false;
|
|
3313
3299
|
};
|
|
3314
3300
|
var appDidLoad = (who) => {
|
|
3315
|
-
var _a;
|
|
3316
3301
|
if (BUILD21.asyncQueue) {
|
|
3317
3302
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
3318
3303
|
}
|
|
3319
3304
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
3320
|
-
if (BUILD21.hydrateClientSide) {
|
|
3321
|
-
if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
|
|
3322
|
-
plt.$orgLocNodes$.clear();
|
|
3323
|
-
}
|
|
3324
|
-
}
|
|
3325
3305
|
if (BUILD21.profile && performance.measure) {
|
|
3326
3306
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
3327
3307
|
}
|
|
@@ -3753,11 +3733,6 @@ var connectedCallback = (elm) => {
|
|
|
3753
3733
|
if (BUILD25.hydrateServerSide || (BUILD25.slot || BUILD25.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
3754
3734
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
3755
3735
|
setContentReference(elm);
|
|
3756
|
-
} else if (BUILD25.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
|
|
3757
|
-
const commendPlaceholder = elm.firstChild;
|
|
3758
|
-
if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
|
|
3759
|
-
elm.removeChild(commendPlaceholder);
|
|
3760
|
-
}
|
|
3761
3736
|
}
|
|
3762
3737
|
}
|
|
3763
3738
|
if (BUILD25.asyncLoading) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/client",
|
|
3
|
-
"version": "4.35.3-dev.
|
|
3
|
+
"version": "4.35.3-dev.1752161791.11e6f9d",
|
|
4
4
|
"description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"exports": "./index.js",
|