@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Platform v4.35.3-dev.
|
|
2
|
+
Stencil Hydrate 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) => {
|
|
@@ -293,7 +293,7 @@ var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") ||
|
|
|
293
293
|
import { BUILD as BUILD19 } from "@stencil/core/internal/app-data";
|
|
294
294
|
|
|
295
295
|
// src/runtime/client-hydrate.ts
|
|
296
|
-
import { BUILD as
|
|
296
|
+
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
297
297
|
|
|
298
298
|
// src/runtime/dom-extras.ts
|
|
299
299
|
import { BUILD as BUILD4 } from "@stencil/core/internal/app-data";
|
|
@@ -927,133 +927,8 @@ var installDevTools = () => {
|
|
|
927
927
|
}
|
|
928
928
|
};
|
|
929
929
|
|
|
930
|
-
// src/runtime/styles.ts
|
|
931
|
-
import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
|
|
932
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
933
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
934
|
-
let style = styles.get(scopeId2);
|
|
935
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
936
|
-
style = style || new CSSStyleSheet();
|
|
937
|
-
if (typeof style === "string") {
|
|
938
|
-
style = cssText;
|
|
939
|
-
} else {
|
|
940
|
-
style.replaceSync(cssText);
|
|
941
|
-
}
|
|
942
|
-
} else {
|
|
943
|
-
style = cssText;
|
|
944
|
-
}
|
|
945
|
-
styles.set(scopeId2, style);
|
|
946
|
-
};
|
|
947
|
-
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
948
|
-
var _a;
|
|
949
|
-
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
950
|
-
const style = styles.get(scopeId2);
|
|
951
|
-
if (!BUILD6.attachStyles || !win.document) {
|
|
952
|
-
return scopeId2;
|
|
953
|
-
}
|
|
954
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
955
|
-
if (style) {
|
|
956
|
-
if (typeof style === "string") {
|
|
957
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
958
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
959
|
-
let styleElm;
|
|
960
|
-
if (!appliedStyles) {
|
|
961
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
962
|
-
}
|
|
963
|
-
if (!appliedStyles.has(scopeId2)) {
|
|
964
|
-
if (BUILD6.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
965
|
-
styleElm.innerHTML = style;
|
|
966
|
-
} else {
|
|
967
|
-
styleElm = win.document.createElement("style");
|
|
968
|
-
styleElm.innerHTML = style;
|
|
969
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
970
|
-
if (nonce != null) {
|
|
971
|
-
styleElm.setAttribute("nonce", nonce);
|
|
972
|
-
}
|
|
973
|
-
if ((BUILD6.hydrateServerSide || BUILD6.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
|
|
974
|
-
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
975
|
-
}
|
|
976
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
977
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
978
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
979
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
980
|
-
styleContainerNode.insertBefore(
|
|
981
|
-
styleElm,
|
|
982
|
-
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
983
|
-
);
|
|
984
|
-
} else if ("host" in styleContainerNode) {
|
|
985
|
-
if (supportsConstructableStylesheets) {
|
|
986
|
-
const stylesheet = new CSSStyleSheet();
|
|
987
|
-
stylesheet.replaceSync(style);
|
|
988
|
-
if (supportsMutableAdoptedStyleSheets) {
|
|
989
|
-
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
990
|
-
} else {
|
|
991
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
992
|
-
}
|
|
993
|
-
} else {
|
|
994
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
995
|
-
if (existingStyleContainer) {
|
|
996
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
997
|
-
} else {
|
|
998
|
-
styleContainerNode.prepend(styleElm);
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
} else {
|
|
1002
|
-
styleContainerNode.append(styleElm);
|
|
1003
|
-
}
|
|
1004
|
-
}
|
|
1005
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1006
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1010
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
1011
|
-
}
|
|
1012
|
-
if (appliedStyles) {
|
|
1013
|
-
appliedStyles.add(scopeId2);
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
} else if (BUILD6.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
1017
|
-
if (supportsMutableAdoptedStyleSheets) {
|
|
1018
|
-
styleContainerNode.adoptedStyleSheets.push(style);
|
|
1019
|
-
} else {
|
|
1020
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
1021
|
-
}
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
return scopeId2;
|
|
1025
|
-
};
|
|
1026
|
-
var attachStyles = (hostRef) => {
|
|
1027
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
1028
|
-
const elm = hostRef.$hostElement$;
|
|
1029
|
-
const flags = cmpMeta.$flags$;
|
|
1030
|
-
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
1031
|
-
const scopeId2 = addStyle(
|
|
1032
|
-
BUILD6.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
1033
|
-
cmpMeta,
|
|
1034
|
-
hostRef.$modeName$
|
|
1035
|
-
);
|
|
1036
|
-
if ((BUILD6.shadowDom || BUILD6.scoped) && BUILD6.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
|
|
1037
|
-
elm["s-sc"] = scopeId2;
|
|
1038
|
-
elm.classList.add(scopeId2 + "-h");
|
|
1039
|
-
}
|
|
1040
|
-
endAttachStyles();
|
|
1041
|
-
};
|
|
1042
|
-
var getScopeId = (cmp, mode) => "sc-" + (BUILD6.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1043
|
-
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
1044
|
-
var hydrateScopedToShadow = () => {
|
|
1045
|
-
if (!win.document) {
|
|
1046
|
-
return;
|
|
1047
|
-
}
|
|
1048
|
-
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1049
|
-
let i2 = 0;
|
|
1050
|
-
for (; i2 < styles2.length; i2++) {
|
|
1051
|
-
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
1052
|
-
}
|
|
1053
|
-
};
|
|
1054
|
-
|
|
1055
930
|
// src/runtime/vdom/h.ts
|
|
1056
|
-
import { BUILD as
|
|
931
|
+
import { BUILD as BUILD6 } from "@stencil/core/internal/app-data";
|
|
1057
932
|
var h = (nodeName, vnodeData, ...children) => {
|
|
1058
933
|
let child = null;
|
|
1059
934
|
let key = null;
|
|
@@ -1069,7 +944,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
1069
944
|
} else if (child != null && typeof child !== "boolean") {
|
|
1070
945
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
1071
946
|
child = String(child);
|
|
1072
|
-
} else if (
|
|
947
|
+
} else if (BUILD6.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
1073
948
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
1074
949
|
Make sure it's using the correct h() function.
|
|
1075
950
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -1085,28 +960,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
1085
960
|
};
|
|
1086
961
|
walk(children);
|
|
1087
962
|
if (vnodeData) {
|
|
1088
|
-
if (
|
|
963
|
+
if (BUILD6.isDev && nodeName === "input") {
|
|
1089
964
|
validateInputProperties(vnodeData);
|
|
1090
965
|
}
|
|
1091
|
-
if (
|
|
966
|
+
if (BUILD6.vdomKey && vnodeData.key) {
|
|
1092
967
|
key = vnodeData.key;
|
|
1093
968
|
}
|
|
1094
|
-
if (
|
|
969
|
+
if (BUILD6.slotRelocation && vnodeData.name) {
|
|
1095
970
|
slotName = vnodeData.name;
|
|
1096
971
|
}
|
|
1097
|
-
if (
|
|
972
|
+
if (BUILD6.vdomClass) {
|
|
1098
973
|
const classData = vnodeData.className || vnodeData.class;
|
|
1099
974
|
if (classData) {
|
|
1100
975
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
1101
976
|
}
|
|
1102
977
|
}
|
|
1103
978
|
}
|
|
1104
|
-
if (
|
|
979
|
+
if (BUILD6.isDev && vNodeChildren.some(isHost)) {
|
|
1105
980
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
1106
981
|
- You are NOT using hostData() and <Host> in the same component.
|
|
1107
982
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
1108
983
|
}
|
|
1109
|
-
if (
|
|
984
|
+
if (BUILD6.vdomFunctional && typeof nodeName === "function") {
|
|
1110
985
|
return nodeName(
|
|
1111
986
|
vnodeData === null ? {} : vnodeData,
|
|
1112
987
|
vNodeChildren,
|
|
@@ -1118,10 +993,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
1118
993
|
if (vNodeChildren.length > 0) {
|
|
1119
994
|
vnode.$children$ = vNodeChildren;
|
|
1120
995
|
}
|
|
1121
|
-
if (
|
|
996
|
+
if (BUILD6.vdomKey) {
|
|
1122
997
|
vnode.$key$ = key;
|
|
1123
998
|
}
|
|
1124
|
-
if (
|
|
999
|
+
if (BUILD6.slotRelocation) {
|
|
1125
1000
|
vnode.$name$ = slotName;
|
|
1126
1001
|
}
|
|
1127
1002
|
return vnode;
|
|
@@ -1134,13 +1009,13 @@ var newVNode = (tag, text) => {
|
|
|
1134
1009
|
$elm$: null,
|
|
1135
1010
|
$children$: null
|
|
1136
1011
|
};
|
|
1137
|
-
if (
|
|
1012
|
+
if (BUILD6.vdomAttribute) {
|
|
1138
1013
|
vnode.$attrs$ = null;
|
|
1139
1014
|
}
|
|
1140
|
-
if (
|
|
1015
|
+
if (BUILD6.vdomKey) {
|
|
1141
1016
|
vnode.$key$ = null;
|
|
1142
1017
|
}
|
|
1143
|
-
if (
|
|
1018
|
+
if (BUILD6.slotRelocation) {
|
|
1144
1019
|
vnode.$name$ = null;
|
|
1145
1020
|
}
|
|
1146
1021
|
return vnode;
|
|
@@ -1194,18 +1069,18 @@ var validateInputProperties = (inputElm) => {
|
|
|
1194
1069
|
|
|
1195
1070
|
// src/runtime/client-hydrate.ts
|
|
1196
1071
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1197
|
-
var _a
|
|
1072
|
+
var _a;
|
|
1198
1073
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1199
1074
|
const shadowRoot = hostElm.shadowRoot;
|
|
1200
1075
|
const childRenderNodes = [];
|
|
1201
1076
|
const slotNodes = [];
|
|
1202
1077
|
const slottedNodes = [];
|
|
1203
|
-
const shadowRootNodes =
|
|
1078
|
+
const shadowRootNodes = BUILD7.shadowDom && shadowRoot ? [] : null;
|
|
1204
1079
|
const vnode = newVNode(tagName, null);
|
|
1205
1080
|
vnode.$elm$ = hostElm;
|
|
1206
1081
|
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
1207
1082
|
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
1208
|
-
var _a2,
|
|
1083
|
+
var _a2, _b;
|
|
1209
1084
|
if (!(memberFlags & 31 /* Prop */)) {
|
|
1210
1085
|
return;
|
|
1211
1086
|
}
|
|
@@ -1215,13 +1090,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1215
1090
|
const attrPropVal = parsePropertyValue(
|
|
1216
1091
|
attrVal,
|
|
1217
1092
|
memberFlags,
|
|
1218
|
-
|
|
1093
|
+
BUILD7.formAssociated && !!(((_a2 = hostRef.$cmpMeta$) == null ? void 0 : _a2.$flags$) & 64 /* formAssociated */)
|
|
1219
1094
|
);
|
|
1220
|
-
(
|
|
1095
|
+
(_b = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _b.set(memberName, attrPropVal);
|
|
1221
1096
|
}
|
|
1222
1097
|
});
|
|
1223
1098
|
let scopeId2;
|
|
1224
|
-
if (
|
|
1099
|
+
if (BUILD7.scoped) {
|
|
1225
1100
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1226
1101
|
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1227
1102
|
scopeId2 = hostElm["s-sc"];
|
|
@@ -1258,16 +1133,6 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1258
1133
|
if (childRenderNode.$tag$ === "slot") {
|
|
1259
1134
|
node["s-cr"] = hostElm["s-cr"];
|
|
1260
1135
|
}
|
|
1261
|
-
} else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && !childRenderNode.$elm$.shadowRoot) {
|
|
1262
|
-
const cmpMeta = getHostRef(childRenderNode.$elm$);
|
|
1263
|
-
const scopeId3 = getScopeId(
|
|
1264
|
-
cmpMeta.$cmpMeta$,
|
|
1265
|
-
BUILD8.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
|
|
1266
|
-
);
|
|
1267
|
-
const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
|
|
1268
|
-
if (styleSheet) {
|
|
1269
|
-
hostElm.shadowRoot.append(styleSheet.cloneNode(true));
|
|
1270
|
-
}
|
|
1271
1136
|
}
|
|
1272
1137
|
if (childRenderNode.$tag$ === "slot") {
|
|
1273
1138
|
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
@@ -1283,7 +1148,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1283
1148
|
}
|
|
1284
1149
|
}
|
|
1285
1150
|
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1286
|
-
if (
|
|
1151
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1287
1152
|
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
1288
1153
|
}
|
|
1289
1154
|
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
@@ -1291,9 +1156,7 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1291
1156
|
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
1292
1157
|
}
|
|
1293
1158
|
}
|
|
1294
|
-
|
|
1295
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1296
|
-
}
|
|
1159
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1297
1160
|
}
|
|
1298
1161
|
const hosts = [];
|
|
1299
1162
|
const snLen = slottedNodes.length;
|
|
@@ -1315,16 +1178,14 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1315
1178
|
if (!hosts[slottedItem.hostId]) continue;
|
|
1316
1179
|
const hostEle = hosts[slottedItem.hostId];
|
|
1317
1180
|
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1324
|
-
}
|
|
1181
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
1182
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1183
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
1184
|
+
} else {
|
|
1185
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1325
1186
|
}
|
|
1326
1187
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1327
|
-
if (
|
|
1188
|
+
if (BUILD7.experimentalSlotFixes) {
|
|
1328
1189
|
patchSlottedNode(slottedItem.node);
|
|
1329
1190
|
}
|
|
1330
1191
|
}
|
|
@@ -1333,12 +1194,12 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1333
1194
|
}
|
|
1334
1195
|
}
|
|
1335
1196
|
}
|
|
1336
|
-
if (
|
|
1197
|
+
if (BUILD7.scoped && scopeId2 && slotNodes.length) {
|
|
1337
1198
|
slotNodes.forEach((slot) => {
|
|
1338
1199
|
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1339
1200
|
});
|
|
1340
1201
|
}
|
|
1341
|
-
if (
|
|
1202
|
+
if (BUILD7.shadowDom && shadowRoot && !shadowRoot.childNodes.length) {
|
|
1342
1203
|
let rnIdex = 0;
|
|
1343
1204
|
const rnLen = shadowRootNodes.length;
|
|
1344
1205
|
if (rnLen) {
|
|
@@ -1349,13 +1210,14 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1349
1210
|
if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
|
|
1350
1211
|
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
1351
1212
|
node.removeAttribute("hidden");
|
|
1352
|
-
} else if (node.nodeType === 8 /* CommentNode */
|
|
1213
|
+
} else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
1353
1214
|
node.parentNode.removeChild(node);
|
|
1354
1215
|
}
|
|
1355
1216
|
}
|
|
1356
1217
|
});
|
|
1357
1218
|
}
|
|
1358
1219
|
}
|
|
1220
|
+
plt.$orgLocNodes$.delete(hostElm["s-id"]);
|
|
1359
1221
|
hostRef.$hostElement$ = hostElm;
|
|
1360
1222
|
endHydrate();
|
|
1361
1223
|
};
|
|
@@ -1387,7 +1249,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1387
1249
|
if (!parentVNode.$children$) {
|
|
1388
1250
|
parentVNode.$children$ = [];
|
|
1389
1251
|
}
|
|
1390
|
-
if (
|
|
1252
|
+
if (BUILD7.scoped && scopeId2) {
|
|
1391
1253
|
node["s-si"] = scopeId2;
|
|
1392
1254
|
childVNode.$attrs$.class += " " + scopeId2;
|
|
1393
1255
|
}
|
|
@@ -1405,7 +1267,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1405
1267
|
shadowRootNodes,
|
|
1406
1268
|
slottedNodes
|
|
1407
1269
|
);
|
|
1408
|
-
if (
|
|
1270
|
+
if (BUILD7.scoped && scopeId2) {
|
|
1409
1271
|
node.classList.add(scopeId2);
|
|
1410
1272
|
}
|
|
1411
1273
|
}
|
|
@@ -1502,9 +1364,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1502
1364
|
slottedNodes
|
|
1503
1365
|
);
|
|
1504
1366
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1505
|
-
if (
|
|
1367
|
+
if (BUILD7.shadowDom && shadowRootNodes) {
|
|
1506
1368
|
node.remove();
|
|
1507
|
-
} else if (
|
|
1369
|
+
} else if (BUILD7.slotRelocation) {
|
|
1508
1370
|
hostElm["s-cr"] = node;
|
|
1509
1371
|
node["s-cn"] = true;
|
|
1510
1372
|
}
|
|
@@ -1517,7 +1379,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1517
1379
|
vnode.$index$ = "0";
|
|
1518
1380
|
parentVNode.$children$ = [vnode];
|
|
1519
1381
|
} else {
|
|
1520
|
-
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()
|
|
1382
|
+
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
1521
1383
|
node.remove();
|
|
1522
1384
|
}
|
|
1523
1385
|
}
|
|
@@ -1570,15 +1432,15 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
|
|
|
1570
1432
|
childVNode.$name$ = slotName || null;
|
|
1571
1433
|
childVNode.$tag$ = "slot";
|
|
1572
1434
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1573
|
-
if (
|
|
1435
|
+
if (BUILD7.shadowDom && shadowRootNodes && win.document) {
|
|
1574
1436
|
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
1575
1437
|
if (childVNode.$name$) {
|
|
1576
1438
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
1577
1439
|
}
|
|
1578
|
-
if (
|
|
1579
|
-
|
|
1440
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
1441
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1580
1442
|
} else {
|
|
1581
|
-
|
|
1443
|
+
node.parentNode.insertBefore(slot, node);
|
|
1582
1444
|
}
|
|
1583
1445
|
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
1584
1446
|
node.remove();
|
|
@@ -1604,7 +1466,7 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
|
|
|
1604
1466
|
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1605
1467
|
let slottedNode = slotNode.nextSibling;
|
|
1606
1468
|
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1607
|
-
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */
|
|
1469
|
+
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 */))) {
|
|
1608
1470
|
slottedNode["s-sn"] = slotName;
|
|
1609
1471
|
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1610
1472
|
slottedNode = slottedNode.nextSibling;
|
|
@@ -2039,31 +1901,31 @@ import { BUILD as BUILD17 } from "@stencil/core/internal/app-data";
|
|
|
2039
1901
|
import { BUILD as BUILD16 } from "@stencil/core/internal/app-data";
|
|
2040
1902
|
|
|
2041
1903
|
// src/runtime/parse-property-value.ts
|
|
2042
|
-
import { BUILD as
|
|
1904
|
+
import { BUILD as BUILD8 } from "@stencil/core/internal/app-data";
|
|
2043
1905
|
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
2044
|
-
if ((
|
|
1906
|
+
if ((BUILD8.hydrateClientSide || BUILD8.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
2045
1907
|
try {
|
|
2046
1908
|
propValue = JSON.parse(propValue);
|
|
2047
1909
|
return propValue;
|
|
2048
1910
|
} catch (e) {
|
|
2049
1911
|
}
|
|
2050
1912
|
}
|
|
2051
|
-
if ((
|
|
1913
|
+
if ((BUILD8.hydrateClientSide || BUILD8.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
2052
1914
|
propValue = deserializeProperty(propValue);
|
|
2053
1915
|
return propValue;
|
|
2054
1916
|
}
|
|
2055
1917
|
if (propValue != null && !isComplexType(propValue)) {
|
|
2056
|
-
if (
|
|
2057
|
-
if (
|
|
1918
|
+
if (BUILD8.propBoolean && propType & 4 /* Boolean */) {
|
|
1919
|
+
if (BUILD8.formAssociated && isFormAssociated && typeof propValue === "string") {
|
|
2058
1920
|
return propValue === "" || !!propValue;
|
|
2059
1921
|
} else {
|
|
2060
1922
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2061
1923
|
}
|
|
2062
1924
|
}
|
|
2063
|
-
if (
|
|
1925
|
+
if (BUILD8.propNumber && propType & 2 /* Number */) {
|
|
2064
1926
|
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
2065
1927
|
}
|
|
2066
|
-
if (
|
|
1928
|
+
if (BUILD8.propString && propType & 1 /* String */) {
|
|
2067
1929
|
return String(propValue);
|
|
2068
1930
|
}
|
|
2069
1931
|
return propValue;
|
|
@@ -2075,18 +1937,18 @@ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
|
2075
1937
|
import { BUILD as BUILD15, NAMESPACE } from "@stencil/core/internal/app-data";
|
|
2076
1938
|
|
|
2077
1939
|
// src/runtime/event-emitter.ts
|
|
2078
|
-
import { BUILD as
|
|
1940
|
+
import { BUILD as BUILD10 } from "@stencil/core/internal/app-data";
|
|
2079
1941
|
|
|
2080
1942
|
// src/runtime/element.ts
|
|
2081
|
-
import { BUILD as
|
|
2082
|
-
var getElement = (ref) =>
|
|
1943
|
+
import { BUILD as BUILD9 } from "@stencil/core/internal/app-data";
|
|
1944
|
+
var getElement = (ref) => BUILD9.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
2083
1945
|
|
|
2084
1946
|
// src/runtime/event-emitter.ts
|
|
2085
1947
|
var createEvent = (ref, name, flags) => {
|
|
2086
1948
|
const elm = getElement(ref);
|
|
2087
1949
|
return {
|
|
2088
1950
|
emit: (detail) => {
|
|
2089
|
-
if (
|
|
1951
|
+
if (BUILD10.isDev && !elm.isConnected) {
|
|
2090
1952
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
2091
1953
|
}
|
|
2092
1954
|
return emitEvent(elm, name, {
|
|
@@ -2104,6 +1966,131 @@ var emitEvent = (elm, name, opts) => {
|
|
|
2104
1966
|
return ev;
|
|
2105
1967
|
};
|
|
2106
1968
|
|
|
1969
|
+
// src/runtime/styles.ts
|
|
1970
|
+
import { BUILD as BUILD11 } from "@stencil/core/internal/app-data";
|
|
1971
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
1972
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
1973
|
+
let style = styles.get(scopeId2);
|
|
1974
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
1975
|
+
style = style || new CSSStyleSheet();
|
|
1976
|
+
if (typeof style === "string") {
|
|
1977
|
+
style = cssText;
|
|
1978
|
+
} else {
|
|
1979
|
+
style.replaceSync(cssText);
|
|
1980
|
+
}
|
|
1981
|
+
} else {
|
|
1982
|
+
style = cssText;
|
|
1983
|
+
}
|
|
1984
|
+
styles.set(scopeId2, style);
|
|
1985
|
+
};
|
|
1986
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
1987
|
+
var _a;
|
|
1988
|
+
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
1989
|
+
const style = styles.get(scopeId2);
|
|
1990
|
+
if (!BUILD11.attachStyles || !win.document) {
|
|
1991
|
+
return scopeId2;
|
|
1992
|
+
}
|
|
1993
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
1994
|
+
if (style) {
|
|
1995
|
+
if (typeof style === "string") {
|
|
1996
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
1997
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
1998
|
+
let styleElm;
|
|
1999
|
+
if (!appliedStyles) {
|
|
2000
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2001
|
+
}
|
|
2002
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
2003
|
+
if (BUILD11.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2004
|
+
styleElm.innerHTML = style;
|
|
2005
|
+
} else {
|
|
2006
|
+
styleElm = win.document.createElement("style");
|
|
2007
|
+
styleElm.innerHTML = style;
|
|
2008
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
2009
|
+
if (nonce != null) {
|
|
2010
|
+
styleElm.setAttribute("nonce", nonce);
|
|
2011
|
+
}
|
|
2012
|
+
if ((BUILD11.hydrateServerSide || BUILD11.hotModuleReplacement) && (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */ || cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */)) {
|
|
2013
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2014
|
+
}
|
|
2015
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2016
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
2017
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
2018
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
2019
|
+
styleContainerNode.insertBefore(
|
|
2020
|
+
styleElm,
|
|
2021
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
2022
|
+
);
|
|
2023
|
+
} else if ("host" in styleContainerNode) {
|
|
2024
|
+
if (supportsConstructableStylesheets) {
|
|
2025
|
+
const stylesheet = new CSSStyleSheet();
|
|
2026
|
+
stylesheet.replaceSync(style);
|
|
2027
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2028
|
+
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
2029
|
+
} else {
|
|
2030
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
2031
|
+
}
|
|
2032
|
+
} else {
|
|
2033
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2034
|
+
if (existingStyleContainer) {
|
|
2035
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
2036
|
+
} else {
|
|
2037
|
+
styleContainerNode.prepend(styleElm);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
} else {
|
|
2041
|
+
styleContainerNode.append(styleElm);
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2044
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2045
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2049
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
2050
|
+
}
|
|
2051
|
+
if (appliedStyles) {
|
|
2052
|
+
appliedStyles.add(scopeId2);
|
|
2053
|
+
}
|
|
2054
|
+
}
|
|
2055
|
+
} else if (BUILD11.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2056
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
2057
|
+
styleContainerNode.adoptedStyleSheets.push(style);
|
|
2058
|
+
} else {
|
|
2059
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
return scopeId2;
|
|
2064
|
+
};
|
|
2065
|
+
var attachStyles = (hostRef) => {
|
|
2066
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
2067
|
+
const elm = hostRef.$hostElement$;
|
|
2068
|
+
const flags = cmpMeta.$flags$;
|
|
2069
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2070
|
+
const scopeId2 = addStyle(
|
|
2071
|
+
BUILD11.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2072
|
+
cmpMeta,
|
|
2073
|
+
hostRef.$modeName$
|
|
2074
|
+
);
|
|
2075
|
+
if ((BUILD11.shadowDom || BUILD11.scoped) && BUILD11.cssAnnotations && flags & 10 /* needsScopedEncapsulation */) {
|
|
2076
|
+
elm["s-sc"] = scopeId2;
|
|
2077
|
+
elm.classList.add(scopeId2 + "-h");
|
|
2078
|
+
}
|
|
2079
|
+
endAttachStyles();
|
|
2080
|
+
};
|
|
2081
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD11.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
2082
|
+
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
2083
|
+
var hydrateScopedToShadow = () => {
|
|
2084
|
+
if (!win.document) {
|
|
2085
|
+
return;
|
|
2086
|
+
}
|
|
2087
|
+
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
2088
|
+
let i2 = 0;
|
|
2089
|
+
for (; i2 < styles2.length; i2++) {
|
|
2090
|
+
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
2091
|
+
}
|
|
2092
|
+
};
|
|
2093
|
+
|
|
2107
2094
|
// src/runtime/vdom/vdom-render.ts
|
|
2108
2095
|
import { BUILD as BUILD14 } from "@stencil/core/internal/app-data";
|
|
2109
2096
|
|
|
@@ -2122,13 +2109,12 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
2122
2109
|
const classList = elm.classList;
|
|
2123
2110
|
const oldClasses = parseClassList(oldValue);
|
|
2124
2111
|
let newClasses = parseClassList(newValue);
|
|
2125
|
-
if (BUILD12.hydrateClientSide &&
|
|
2126
|
-
|
|
2127
|
-
newClasses.push(scopeId2);
|
|
2112
|
+
if (BUILD12.hydrateClientSide && elm["s-si"] && initialRender) {
|
|
2113
|
+
newClasses.push(elm["s-si"]);
|
|
2128
2114
|
oldClasses.forEach((c) => {
|
|
2129
|
-
if (c.startsWith(
|
|
2115
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
2130
2116
|
});
|
|
2131
|
-
newClasses = [...new Set(newClasses)]
|
|
2117
|
+
newClasses = [...new Set(newClasses)];
|
|
2132
2118
|
classList.add(...newClasses);
|
|
2133
2119
|
} else {
|
|
2134
2120
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
@@ -3079,16 +3065,10 @@ var forceUpdate = (ref) => {
|
|
|
3079
3065
|
return false;
|
|
3080
3066
|
};
|
|
3081
3067
|
var appDidLoad = (who) => {
|
|
3082
|
-
var _a;
|
|
3083
3068
|
if (BUILD15.asyncQueue) {
|
|
3084
3069
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
3085
3070
|
}
|
|
3086
3071
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
3087
|
-
if (BUILD15.hydrateClientSide) {
|
|
3088
|
-
if ((_a = plt.$orgLocNodes$) == null ? void 0 : _a.size) {
|
|
3089
|
-
plt.$orgLocNodes$.clear();
|
|
3090
|
-
}
|
|
3091
|
-
}
|
|
3092
3072
|
if (BUILD15.profile && performance.measure) {
|
|
3093
3073
|
performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
3094
3074
|
}
|
|
@@ -3520,11 +3500,6 @@ var connectedCallback = (elm) => {
|
|
|
3520
3500
|
if (BUILD19.hydrateServerSide || (BUILD19.slot || BUILD19.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
3521
3501
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
3522
3502
|
setContentReference(elm);
|
|
3523
|
-
} else if (BUILD19.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
|
|
3524
|
-
const commendPlaceholder = elm.firstChild;
|
|
3525
|
-
if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
|
|
3526
|
-
elm.removeChild(commendPlaceholder);
|
|
3527
|
-
}
|
|
3528
3503
|
}
|
|
3529
3504
|
}
|
|
3530
3505
|
if (BUILD19.asyncLoading) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "4.35.3-dev.
|
|
3
|
+
"version": "4.35.3-dev.1752161791.11e6f9d",
|
|
4
4
|
"description": "Stencil internal hydrate platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|