@penn-libraries/web 0.3.0-dev.4 → 0.3.0
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/cjs/{index-B6Rjt_WH.js → index-B6HF5D3u.js} +652 -8
- package/dist/cjs/index-B6HF5D3u.js.map +1 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/pennlibs-banner.cjs.entry.js +2 -2
- package/dist/cjs/pennlibs-banner.cjs.entry.js.map +1 -1
- package/dist/cjs/pennlibs-banner.entry.cjs.js.map +1 -1
- package/dist/cjs/pennlibs-chat.pennlibs-fallback-img.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.cjs.js.map +1 -0
- package/dist/cjs/{pennlibs-chat_5.cjs.entry.js → pennlibs-chat_6.cjs.entry.js} +33 -14
- package/dist/cjs/pennlibs-chat_6.cjs.entry.js.map +1 -0
- package/dist/cjs/web.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/pennlibs-banner/pennlibs-banner.css +1 -1
- package/dist/collection/components/pennlibs-fallback-img/assets/simplified-shield.webp +0 -0
- package/dist/collection/components/pennlibs-fallback-img/pennlibs-fallback-img.css +16 -0
- package/dist/collection/components/pennlibs-fallback-img/pennlibs-fallback-img.js +21 -0
- package/dist/collection/components/pennlibs-fallback-img/pennlibs-fallback-img.js.map +1 -0
- package/dist/collection/components/pennlibs-footer/pennlibs-footer.css +6 -2
- package/dist/collection/components/pennlibs-footer/pennlibs-footer.js +3 -32
- package/dist/collection/components/pennlibs-footer/pennlibs-footer.js.map +1 -1
- package/dist/collection/components/pennlibs-header/pennlibs-header.css +10 -10
- package/dist/collection/components/pennlibs-header/pennlibs-header.js +46 -14
- package/dist/collection/components/pennlibs-header/pennlibs-header.js.map +1 -1
- package/dist/collection/components/pennlibs-hero/pennlibs-hero.css +1 -1
- package/dist/collection/components/pennlibs-hero/pennlibs-hero.js +8 -1
- package/dist/collection/components/pennlibs-hero/pennlibs-hero.js.map +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +1 -1
- package/dist/components/pennlibs-banner.js +1 -1
- package/dist/components/pennlibs-banner.js.map +1 -1
- package/dist/components/{pennlibs-colors.d.ts → pennlibs-fallback-img.d.ts} +4 -4
- package/dist/components/pennlibs-fallback-img.js +38 -0
- package/dist/components/pennlibs-fallback-img.js.map +1 -0
- package/dist/components/pennlibs-footer.js +4 -7
- package/dist/components/pennlibs-footer.js.map +1 -1
- package/dist/components/pennlibs-header.js +9 -3
- package/dist/components/pennlibs-header.js.map +1 -1
- package/dist/components/pennlibs-hero.js +2 -2
- package/dist/components/pennlibs-hero.js.map +1 -1
- package/dist/docs.d.ts +443 -0
- package/dist/docs.json +311 -0
- package/dist/esm/{index-BQRdy1TQ.js → index-BAQIT3Vo.js} +652 -8
- package/dist/esm/index-BAQIT3Vo.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/pennlibs-banner.entry.js +2 -2
- package/dist/esm/pennlibs-banner.entry.js.map +1 -1
- package/dist/esm/pennlibs-chat.pennlibs-fallback-img.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.js.map +1 -0
- package/dist/esm/{pennlibs-chat_5.entry.js → pennlibs-chat_6.entry.js} +33 -15
- package/dist/esm/{pennlibs-chat.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.js.map → pennlibs-chat_6.entry.js.map} +1 -1
- package/dist/esm/web.js +3 -3
- package/dist/types/components/pennlibs-fallback-img/pennlibs-fallback-img.d.ts +3 -0
- package/dist/types/components/pennlibs-footer/pennlibs-footer.d.ts +0 -10
- package/dist/types/components/pennlibs-header/pennlibs-header.d.ts +29 -8
- package/dist/types/components/pennlibs-hero/pennlibs-hero.d.ts +7 -0
- package/dist/types/components.d.ts +94 -62
- package/dist/web/assets/simplified-shield.webp +0 -0
- package/dist/web/index.esm.js +1 -1
- package/dist/web/{p-BQRdy1TQ.js → p-BAQIT3Vo.js} +652 -8
- package/dist/web/p-BAQIT3Vo.js.map +1 -0
- package/dist/web/{p-a24d914e.entry.js → p-b9fe301b.entry.js} +33 -15
- package/dist/web/{pennlibs-chat.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.esm.js.map → p-b9fe301b.entry.js.map} +1 -1
- package/dist/web/{p-dac033ee.entry.js → p-bb31e5e2.entry.js} +3 -3
- package/dist/web/p-bb31e5e2.entry.js.map +1 -0
- package/dist/web/pennlibs-banner.entry.esm.js.map +1 -1
- package/dist/web/pennlibs-chat.pennlibs-fallback-img.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.esm.js.map +1 -0
- package/dist/web/web.css +18 -11
- package/dist/web/web.esm.js +3 -3
- package/hydrate/index.d.ts +271 -0
- package/hydrate/index.js +19573 -0
- package/hydrate/index.mjs +19565 -0
- package/hydrate/package.json +12 -0
- package/package.json +12 -8
- package/dist/cjs/index-B6Rjt_WH.js.map +0 -1
- package/dist/cjs/pennlibs-chat.pennlibs-feedback.pennlibs-footer.pennlibs-header.pennlibs-hero.entry.cjs.js.map +0 -1
- package/dist/cjs/pennlibs-chat_5.cjs.entry.js.map +0 -1
- package/dist/cjs/pennlibs-colors.cjs.entry.js +0 -20
- package/dist/cjs/pennlibs-colors.cjs.entry.js.map +0 -1
- package/dist/cjs/pennlibs-colors.entry.cjs.js.map +0 -1
- package/dist/collection/components/pennlibs-colors/pennlibs-colors.css +0 -51
- package/dist/collection/components/pennlibs-colors/pennlibs-colors.js +0 -46
- package/dist/collection/components/pennlibs-colors/pennlibs-colors.js.map +0 -1
- package/dist/components/pennlibs-colors.js +0 -38
- package/dist/components/pennlibs-colors.js.map +0 -1
- package/dist/esm/index-BQRdy1TQ.js.map +0 -1
- package/dist/esm/pennlibs-chat_5.entry.js.map +0 -1
- package/dist/esm/pennlibs-colors.entry.js +0 -18
- package/dist/esm/pennlibs-colors.entry.js.map +0 -1
- package/dist/types/components/pennlibs-colors/pennlibs-colors.d.ts +0 -13
- package/dist/web/p-2edaa432.entry.js +0 -18
- package/dist/web/p-2edaa432.entry.js.map +0 -1
- package/dist/web/p-BQRdy1TQ.js.map +0 -1
- package/dist/web/p-a24d914e.entry.js.map +0 -1
- package/dist/web/p-dac033ee.entry.js.map +0 -1
- package/dist/web/pennlibs-colors.entry.esm.js.map +0 -1
|
@@ -13,6 +13,30 @@ var __export = (target, all) => {
|
|
|
13
13
|
// src/utils/constants.ts
|
|
14
14
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
15
15
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
16
|
+
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
17
|
+
PrimitiveType2["Undefined"] = "undefined";
|
|
18
|
+
PrimitiveType2["Null"] = "null";
|
|
19
|
+
PrimitiveType2["String"] = "string";
|
|
20
|
+
PrimitiveType2["Number"] = "number";
|
|
21
|
+
PrimitiveType2["SpecialNumber"] = "number";
|
|
22
|
+
PrimitiveType2["Boolean"] = "boolean";
|
|
23
|
+
PrimitiveType2["BigInt"] = "bigint";
|
|
24
|
+
return PrimitiveType2;
|
|
25
|
+
})(PrimitiveType || {});
|
|
26
|
+
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
27
|
+
NonPrimitiveType2["Array"] = "array";
|
|
28
|
+
NonPrimitiveType2["Date"] = "date";
|
|
29
|
+
NonPrimitiveType2["Map"] = "map";
|
|
30
|
+
NonPrimitiveType2["Object"] = "object";
|
|
31
|
+
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
32
|
+
NonPrimitiveType2["Set"] = "set";
|
|
33
|
+
NonPrimitiveType2["Channel"] = "channel";
|
|
34
|
+
NonPrimitiveType2["Symbol"] = "symbol";
|
|
35
|
+
return NonPrimitiveType2;
|
|
36
|
+
})(NonPrimitiveType || {});
|
|
37
|
+
var TYPE_CONSTANT = "type";
|
|
38
|
+
var VALUE_CONSTANT = "value";
|
|
39
|
+
var SERIALIZED_PREFIX = "serialized:";
|
|
16
40
|
|
|
17
41
|
// src/client/client-host-ref.ts
|
|
18
42
|
var getHostRef = (ref) => {
|
|
@@ -78,7 +102,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
78
102
|
|
|
79
103
|
// src/client/client-style.ts
|
|
80
104
|
var styles = /* @__PURE__ */ new Map();
|
|
105
|
+
|
|
106
|
+
// src/runtime/runtime-constants.ts
|
|
107
|
+
var CONTENT_REF_ID = "r";
|
|
108
|
+
var ORG_LOCATION_ID = "o";
|
|
109
|
+
var SLOT_NODE_ID = "s";
|
|
110
|
+
var TEXT_NODE_ID = "t";
|
|
111
|
+
var COMMENT_NODE_ID = "c";
|
|
112
|
+
var HYDRATE_ID = "s-id";
|
|
81
113
|
var HYDRATED_STYLE_ID = "sty-id";
|
|
114
|
+
var HYDRATE_CHILD_ID = "c-id";
|
|
82
115
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
83
116
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
84
117
|
var win = typeof window !== "undefined" ? window : {};
|
|
@@ -158,6 +191,101 @@ var escapeRegExpSpecialCharacters = (text) => {
|
|
|
158
191
|
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
159
192
|
};
|
|
160
193
|
|
|
194
|
+
// src/utils/remote-value.ts
|
|
195
|
+
var RemoteValue = class _RemoteValue {
|
|
196
|
+
/**
|
|
197
|
+
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
198
|
+
*
|
|
199
|
+
* @param serialized The serialized LocalValue object
|
|
200
|
+
* @returns The original JavaScript value/object
|
|
201
|
+
*/
|
|
202
|
+
static fromLocalValue(serialized) {
|
|
203
|
+
const type = serialized[TYPE_CONSTANT];
|
|
204
|
+
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
205
|
+
switch (type) {
|
|
206
|
+
case "string" /* String */:
|
|
207
|
+
return value;
|
|
208
|
+
case "boolean" /* Boolean */:
|
|
209
|
+
return value;
|
|
210
|
+
case "bigint" /* BigInt */:
|
|
211
|
+
return BigInt(value);
|
|
212
|
+
case "undefined" /* Undefined */:
|
|
213
|
+
return void 0;
|
|
214
|
+
case "null" /* Null */:
|
|
215
|
+
return null;
|
|
216
|
+
case "number" /* Number */:
|
|
217
|
+
if (value === "NaN") return NaN;
|
|
218
|
+
if (value === "-0") return -0;
|
|
219
|
+
if (value === "Infinity") return Infinity;
|
|
220
|
+
if (value === "-Infinity") return -Infinity;
|
|
221
|
+
return value;
|
|
222
|
+
case "array" /* Array */:
|
|
223
|
+
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
224
|
+
case "date" /* Date */:
|
|
225
|
+
return new Date(value);
|
|
226
|
+
case "map" /* Map */:
|
|
227
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
228
|
+
for (const [key, val] of value) {
|
|
229
|
+
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
230
|
+
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
231
|
+
map2.set(deserializedKey, deserializedValue);
|
|
232
|
+
}
|
|
233
|
+
return map2;
|
|
234
|
+
case "object" /* Object */:
|
|
235
|
+
const obj = {};
|
|
236
|
+
for (const [key, val] of value) {
|
|
237
|
+
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
238
|
+
}
|
|
239
|
+
return obj;
|
|
240
|
+
case "regexp" /* RegularExpression */:
|
|
241
|
+
const { pattern, flags } = value;
|
|
242
|
+
return new RegExp(pattern, flags);
|
|
243
|
+
case "set" /* Set */:
|
|
244
|
+
const set = /* @__PURE__ */ new Set();
|
|
245
|
+
for (const item of value) {
|
|
246
|
+
set.add(_RemoteValue.fromLocalValue(item));
|
|
247
|
+
}
|
|
248
|
+
return set;
|
|
249
|
+
case "symbol" /* Symbol */:
|
|
250
|
+
return Symbol(value);
|
|
251
|
+
default:
|
|
252
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Utility method to deserialize multiple LocalValues at once
|
|
257
|
+
*
|
|
258
|
+
* @param serializedValues Array of serialized LocalValue objects
|
|
259
|
+
* @returns Array of deserialized JavaScript values
|
|
260
|
+
*/
|
|
261
|
+
static fromLocalValueArray(serializedValues) {
|
|
262
|
+
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
266
|
+
*
|
|
267
|
+
* @param obj Object to verify
|
|
268
|
+
* @returns boolean indicating if the object has LocalValue structure
|
|
269
|
+
*/
|
|
270
|
+
static isLocalValueObject(obj) {
|
|
271
|
+
if (typeof obj !== "object" || obj === null) {
|
|
272
|
+
return false;
|
|
273
|
+
}
|
|
274
|
+
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
277
|
+
const type = obj[TYPE_CONSTANT];
|
|
278
|
+
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
279
|
+
if (!hasTypeProperty) {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
283
|
+
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
284
|
+
}
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
|
|
161
289
|
// src/utils/result.ts
|
|
162
290
|
var result_exports = {};
|
|
163
291
|
__export(result_exports, {
|
|
@@ -206,6 +334,90 @@ var unwrapErr = (result) => {
|
|
|
206
334
|
throw result.value;
|
|
207
335
|
}
|
|
208
336
|
};
|
|
337
|
+
|
|
338
|
+
// src/utils/serialize.ts
|
|
339
|
+
function deserializeProperty(value) {
|
|
340
|
+
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
341
|
+
return value;
|
|
342
|
+
}
|
|
343
|
+
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
344
|
+
}
|
|
345
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
346
|
+
const result = [];
|
|
347
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
348
|
+
const slottedNode = childNodes[i2]["s-nr"] || void 0;
|
|
349
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
350
|
+
result.push(slottedNode);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return result;
|
|
354
|
+
};
|
|
355
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
356
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
const slottedNodeLocation = document.createTextNode("");
|
|
360
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
361
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
362
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
363
|
+
const appendMethod = internalCall(parent, "appendChild");
|
|
364
|
+
if (typeof position !== "undefined") {
|
|
365
|
+
slottedNodeLocation["s-oo"] = position;
|
|
366
|
+
const childNodes = internalCall(parent, "childNodes");
|
|
367
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
368
|
+
childNodes.forEach((n) => {
|
|
369
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
370
|
+
});
|
|
371
|
+
slotRelocateNodes.sort((a, b) => {
|
|
372
|
+
if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
|
|
373
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
374
|
+
return 0;
|
|
375
|
+
});
|
|
376
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
377
|
+
} else {
|
|
378
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
379
|
+
}
|
|
380
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
381
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
382
|
+
};
|
|
383
|
+
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
384
|
+
function patchSlotNode(node) {
|
|
385
|
+
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
386
|
+
const assignedFactory = (elementsOnly) => (function(opts) {
|
|
387
|
+
const toReturn = [];
|
|
388
|
+
const slotName = this["s-sn"];
|
|
389
|
+
if (opts == null ? void 0 : opts.flatten) {
|
|
390
|
+
console.error(`
|
|
391
|
+
Flattening is not supported for Stencil non-shadow slots.
|
|
392
|
+
You can use \`.childNodes\` to nested slot fallback content.
|
|
393
|
+
If you have a particular use case, please open an issue on the Stencil repo.
|
|
394
|
+
`);
|
|
395
|
+
}
|
|
396
|
+
const parent = this["s-cr"].parentElement;
|
|
397
|
+
const slottedNodes = parent.__childNodes ? parent.childNodes : getSlottedChildNodes(parent.childNodes);
|
|
398
|
+
slottedNodes.forEach((n) => {
|
|
399
|
+
if (slotName === getSlotName(n)) {
|
|
400
|
+
toReturn.push(n);
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
if (elementsOnly) {
|
|
404
|
+
return toReturn.filter((n) => n.nodeType === 1 /* ElementNode */);
|
|
405
|
+
}
|
|
406
|
+
return toReturn;
|
|
407
|
+
}).bind(node);
|
|
408
|
+
node.assignedElements = assignedFactory(true);
|
|
409
|
+
node.assignedNodes = assignedFactory(false);
|
|
410
|
+
}
|
|
411
|
+
function internalCall(node, method) {
|
|
412
|
+
if ("__" + method in node) {
|
|
413
|
+
const toReturn = node["__" + method];
|
|
414
|
+
if (typeof toReturn !== "function") return toReturn;
|
|
415
|
+
return toReturn.bind(node);
|
|
416
|
+
} else {
|
|
417
|
+
if (typeof node[method] !== "function") return node[method];
|
|
418
|
+
return node[method].bind(node);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
209
421
|
var createTime = (fnName, tagName = "") => {
|
|
210
422
|
{
|
|
211
423
|
return () => {
|
|
@@ -321,6 +533,386 @@ var convertToPrivate = (node) => {
|
|
|
321
533
|
vnode.$name$ = node.vname;
|
|
322
534
|
return vnode;
|
|
323
535
|
};
|
|
536
|
+
|
|
537
|
+
// src/runtime/client-hydrate.ts
|
|
538
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
539
|
+
var _a;
|
|
540
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
541
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
542
|
+
const childRenderNodes = [];
|
|
543
|
+
const slotNodes = [];
|
|
544
|
+
const slottedNodes = [];
|
|
545
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
546
|
+
const vnode = newVNode(tagName, null);
|
|
547
|
+
vnode.$elm$ = hostElm;
|
|
548
|
+
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
549
|
+
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
550
|
+
var _a2;
|
|
551
|
+
if (!(memberFlags & 31 /* Prop */)) {
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
const attributeName = metaAttributeName || memberName;
|
|
555
|
+
const attrVal = hostElm.getAttribute(attributeName);
|
|
556
|
+
if (attrVal !== null) {
|
|
557
|
+
const attrPropVal = parsePropertyValue(attrVal, memberFlags);
|
|
558
|
+
(_a2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a2.set(memberName, attrPropVal);
|
|
559
|
+
}
|
|
560
|
+
});
|
|
561
|
+
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
562
|
+
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
563
|
+
}
|
|
564
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
565
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
566
|
+
hostRef.$vnode$ = clientHydrate(
|
|
567
|
+
vnode,
|
|
568
|
+
childRenderNodes,
|
|
569
|
+
slotNodes,
|
|
570
|
+
shadowRootNodes,
|
|
571
|
+
hostElm,
|
|
572
|
+
hostElm,
|
|
573
|
+
hostId,
|
|
574
|
+
slottedNodes
|
|
575
|
+
);
|
|
576
|
+
let crIndex = 0;
|
|
577
|
+
const crLength = childRenderNodes.length;
|
|
578
|
+
let childRenderNode;
|
|
579
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
580
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
581
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
582
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
583
|
+
const node = childRenderNode.$elm$;
|
|
584
|
+
if (!shadowRoot) {
|
|
585
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
586
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
587
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
591
|
+
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
592
|
+
if (childRenderNode.$children$) {
|
|
593
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
594
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
595
|
+
childRenderNode.$children$.forEach((c) => {
|
|
596
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
} else {
|
|
600
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
604
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
605
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
606
|
+
}
|
|
607
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
608
|
+
if (!shadowRoot) {
|
|
609
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
613
|
+
}
|
|
614
|
+
const hosts = [];
|
|
615
|
+
const snLen = slottedNodes.length;
|
|
616
|
+
let snIndex = 0;
|
|
617
|
+
let slotGroup;
|
|
618
|
+
let snGroupIdx;
|
|
619
|
+
let snGroupLen;
|
|
620
|
+
let slottedItem;
|
|
621
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
622
|
+
slotGroup = slottedNodes[snIndex];
|
|
623
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
624
|
+
snGroupLen = slotGroup.length;
|
|
625
|
+
snGroupIdx = 0;
|
|
626
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
627
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
628
|
+
if (!hosts[slottedItem.hostId]) {
|
|
629
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
630
|
+
}
|
|
631
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
632
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
633
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
634
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
635
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
636
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
637
|
+
} else {
|
|
638
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
639
|
+
}
|
|
640
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
641
|
+
}
|
|
642
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
643
|
+
hostEle.appendChild(slottedItem.node);
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
if (shadowRoot && !shadowRoot.childNodes.length) {
|
|
648
|
+
let rnIdex = 0;
|
|
649
|
+
const rnLen = shadowRootNodes.length;
|
|
650
|
+
if (rnLen) {
|
|
651
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
652
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
653
|
+
}
|
|
654
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
655
|
+
if (typeof node["s-sn"] !== "string") {
|
|
656
|
+
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
657
|
+
node.removeAttribute("hidden");
|
|
658
|
+
} else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
659
|
+
node.parentNode.removeChild(node);
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
plt.$orgLocNodes$.delete(hostElm["s-id"]);
|
|
666
|
+
hostRef.$hostElement$ = hostElm;
|
|
667
|
+
endHydrate();
|
|
668
|
+
};
|
|
669
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
670
|
+
let childNodeType;
|
|
671
|
+
let childIdSplt;
|
|
672
|
+
let childVNode;
|
|
673
|
+
let i2;
|
|
674
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
675
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
676
|
+
if (childNodeType) {
|
|
677
|
+
childIdSplt = childNodeType.split(".");
|
|
678
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
679
|
+
childVNode = createSimpleVNode({
|
|
680
|
+
$flags$: 0,
|
|
681
|
+
$hostId$: childIdSplt[0],
|
|
682
|
+
$nodeId$: childIdSplt[1],
|
|
683
|
+
$depth$: childIdSplt[2],
|
|
684
|
+
$index$: childIdSplt[3],
|
|
685
|
+
$tag$: node.tagName.toLowerCase(),
|
|
686
|
+
$elm$: node,
|
|
687
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
688
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
689
|
+
$attrs$: { class: node.className || "" }
|
|
690
|
+
});
|
|
691
|
+
childRenderNodes.push(childVNode);
|
|
692
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
693
|
+
if (!parentVNode.$children$) {
|
|
694
|
+
parentVNode.$children$ = [];
|
|
695
|
+
}
|
|
696
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
697
|
+
if (typeof slotName === "string") {
|
|
698
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
699
|
+
addSlot(
|
|
700
|
+
slotName,
|
|
701
|
+
childIdSplt[2],
|
|
702
|
+
childVNode,
|
|
703
|
+
node,
|
|
704
|
+
parentVNode,
|
|
705
|
+
childRenderNodes,
|
|
706
|
+
slotNodes,
|
|
707
|
+
shadowRootNodes,
|
|
708
|
+
slottedNodes
|
|
709
|
+
);
|
|
710
|
+
}
|
|
711
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
712
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
713
|
+
}
|
|
714
|
+
if (childVNode.$index$ !== void 0) {
|
|
715
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
716
|
+
}
|
|
717
|
+
parentVNode = childVNode;
|
|
718
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
719
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
if (node.shadowRoot) {
|
|
724
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
725
|
+
clientHydrate(
|
|
726
|
+
parentVNode,
|
|
727
|
+
childRenderNodes,
|
|
728
|
+
slotNodes,
|
|
729
|
+
shadowRootNodes,
|
|
730
|
+
hostElm,
|
|
731
|
+
node.shadowRoot.childNodes[i2],
|
|
732
|
+
hostId,
|
|
733
|
+
slottedNodes
|
|
734
|
+
);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
738
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
739
|
+
clientHydrate(
|
|
740
|
+
parentVNode,
|
|
741
|
+
childRenderNodes,
|
|
742
|
+
slotNodes,
|
|
743
|
+
shadowRootNodes,
|
|
744
|
+
hostElm,
|
|
745
|
+
nonShadowNodes[i2],
|
|
746
|
+
hostId,
|
|
747
|
+
slottedNodes
|
|
748
|
+
);
|
|
749
|
+
}
|
|
750
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
751
|
+
childIdSplt = node.nodeValue.split(".");
|
|
752
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
753
|
+
childNodeType = childIdSplt[0];
|
|
754
|
+
childVNode = createSimpleVNode({
|
|
755
|
+
$hostId$: childIdSplt[1],
|
|
756
|
+
$nodeId$: childIdSplt[2],
|
|
757
|
+
$depth$: childIdSplt[3],
|
|
758
|
+
$index$: childIdSplt[4] || "0",
|
|
759
|
+
$elm$: node,
|
|
760
|
+
$attrs$: null,
|
|
761
|
+
$children$: null,
|
|
762
|
+
$key$: null,
|
|
763
|
+
$name$: null,
|
|
764
|
+
$tag$: null,
|
|
765
|
+
$text$: null
|
|
766
|
+
});
|
|
767
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
768
|
+
childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
|
|
769
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
770
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
771
|
+
childRenderNodes.push(childVNode);
|
|
772
|
+
node.remove();
|
|
773
|
+
if (hostId === childVNode.$hostId$) {
|
|
774
|
+
if (!parentVNode.$children$) {
|
|
775
|
+
parentVNode.$children$ = [];
|
|
776
|
+
}
|
|
777
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
778
|
+
}
|
|
779
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
780
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
784
|
+
childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
|
|
785
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
786
|
+
childRenderNodes.push(childVNode);
|
|
787
|
+
node.remove();
|
|
788
|
+
}
|
|
789
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
790
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
791
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
792
|
+
addSlot(
|
|
793
|
+
slotName,
|
|
794
|
+
childIdSplt[2],
|
|
795
|
+
childVNode,
|
|
796
|
+
node,
|
|
797
|
+
parentVNode,
|
|
798
|
+
childRenderNodes,
|
|
799
|
+
slotNodes,
|
|
800
|
+
shadowRootNodes,
|
|
801
|
+
slottedNodes
|
|
802
|
+
);
|
|
803
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
804
|
+
if (shadowRootNodes) {
|
|
805
|
+
node.remove();
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
811
|
+
const vnode = newVNode(null, node.textContent);
|
|
812
|
+
vnode.$elm$ = node;
|
|
813
|
+
vnode.$index$ = "0";
|
|
814
|
+
parentVNode.$children$ = [vnode];
|
|
815
|
+
} else {
|
|
816
|
+
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
817
|
+
node.remove();
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
return parentVNode;
|
|
821
|
+
};
|
|
822
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
823
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
824
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
825
|
+
if (componentId) {
|
|
826
|
+
orgLocNodes.set(componentId, node);
|
|
827
|
+
}
|
|
828
|
+
let i2 = 0;
|
|
829
|
+
if (node.shadowRoot) {
|
|
830
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
831
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
835
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
836
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
837
|
+
}
|
|
838
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
839
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
840
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
841
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
842
|
+
node.nodeValue = "";
|
|
843
|
+
node["s-en"] = childIdSplt[3];
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
};
|
|
847
|
+
var createSimpleVNode = (vnode) => {
|
|
848
|
+
const defaultVNode = {
|
|
849
|
+
$flags$: 0,
|
|
850
|
+
$hostId$: null,
|
|
851
|
+
$nodeId$: null,
|
|
852
|
+
$depth$: null,
|
|
853
|
+
$index$: "0",
|
|
854
|
+
$elm$: null,
|
|
855
|
+
$attrs$: null,
|
|
856
|
+
$children$: null,
|
|
857
|
+
$key$: null,
|
|
858
|
+
$name$: null,
|
|
859
|
+
$tag$: null,
|
|
860
|
+
$text$: null
|
|
861
|
+
};
|
|
862
|
+
return { ...defaultVNode, ...vnode };
|
|
863
|
+
};
|
|
864
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
865
|
+
node["s-sr"] = true;
|
|
866
|
+
childVNode.$name$ = slotName || null;
|
|
867
|
+
childVNode.$tag$ = "slot";
|
|
868
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
869
|
+
if (shadowRootNodes && win.document) {
|
|
870
|
+
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
871
|
+
if (childVNode.$name$) {
|
|
872
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
873
|
+
}
|
|
874
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
875
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
876
|
+
} else {
|
|
877
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
878
|
+
}
|
|
879
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
880
|
+
node.remove();
|
|
881
|
+
if (childVNode.$depth$ === "0") {
|
|
882
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
883
|
+
}
|
|
884
|
+
} else {
|
|
885
|
+
const slot = childVNode.$elm$;
|
|
886
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
887
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
888
|
+
patchSlotNode(node);
|
|
889
|
+
if (shouldMove) {
|
|
890
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
891
|
+
}
|
|
892
|
+
childRenderNodes.push(childVNode);
|
|
893
|
+
}
|
|
894
|
+
slotNodes.push(childVNode);
|
|
895
|
+
if (!parentVNode.$children$) {
|
|
896
|
+
parentVNode.$children$ = [];
|
|
897
|
+
}
|
|
898
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
899
|
+
}
|
|
900
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
901
|
+
let slottedNode = slotNode.nextSibling;
|
|
902
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
903
|
+
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 */))) {
|
|
904
|
+
slottedNode["s-sn"] = slotName;
|
|
905
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
906
|
+
slottedNode = slottedNode.nextSibling;
|
|
907
|
+
}
|
|
908
|
+
};
|
|
909
|
+
var findCorrespondingNode = (node, type) => {
|
|
910
|
+
let sibling = node;
|
|
911
|
+
do {
|
|
912
|
+
sibling = sibling.nextSibling;
|
|
913
|
+
} while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
|
|
914
|
+
return sibling;
|
|
915
|
+
};
|
|
324
916
|
var createSupportsRuleRe = (selector) => {
|
|
325
917
|
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
326
918
|
return new RegExp(
|
|
@@ -334,6 +926,17 @@ createSupportsRuleRe("::slotted");
|
|
|
334
926
|
createSupportsRuleRe(":host");
|
|
335
927
|
createSupportsRuleRe(":host-context");
|
|
336
928
|
var parsePropertyValue = (propValue, propType) => {
|
|
929
|
+
if (typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
930
|
+
try {
|
|
931
|
+
propValue = JSON.parse(propValue);
|
|
932
|
+
return propValue;
|
|
933
|
+
} catch (e) {
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
937
|
+
propValue = deserializeProperty(propValue);
|
|
938
|
+
return propValue;
|
|
939
|
+
}
|
|
337
940
|
if (propValue != null && !isComplexType(propValue)) {
|
|
338
941
|
if (propType & 1 /* String */) {
|
|
339
942
|
return String(propValue);
|
|
@@ -395,7 +998,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
395
998
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
396
999
|
}
|
|
397
1000
|
if (!appliedStyles.has(scopeId2)) {
|
|
398
|
-
{
|
|
1001
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1002
|
+
styleElm.innerHTML = style;
|
|
1003
|
+
} else {
|
|
399
1004
|
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
400
1005
|
styleElm.innerHTML = style;
|
|
401
1006
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
@@ -459,6 +1064,17 @@ var attachStyles = (hostRef) => {
|
|
|
459
1064
|
endAttachStyles();
|
|
460
1065
|
};
|
|
461
1066
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
1067
|
+
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
1068
|
+
var hydrateScopedToShadow = () => {
|
|
1069
|
+
if (!win.document) {
|
|
1070
|
+
return;
|
|
1071
|
+
}
|
|
1072
|
+
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1073
|
+
let i2 = 0;
|
|
1074
|
+
for (; i2 < styles2.length; i2++) {
|
|
1075
|
+
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
1076
|
+
}
|
|
1077
|
+
};
|
|
462
1078
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
463
1079
|
if (oldValue === newValue) {
|
|
464
1080
|
return;
|
|
@@ -469,7 +1085,14 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
469
1085
|
const classList = elm.classList;
|
|
470
1086
|
const oldClasses = parseClassList(oldValue);
|
|
471
1087
|
let newClasses = parseClassList(newValue);
|
|
472
|
-
{
|
|
1088
|
+
if (elm["s-si"] && initialRender) {
|
|
1089
|
+
newClasses.push(elm["s-si"]);
|
|
1090
|
+
oldClasses.forEach((c) => {
|
|
1091
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
1092
|
+
});
|
|
1093
|
+
newClasses = [...new Set(newClasses)];
|
|
1094
|
+
classList.add(...newClasses);
|
|
1095
|
+
} else {
|
|
473
1096
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
474
1097
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
475
1098
|
}
|
|
@@ -578,7 +1201,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
578
1201
|
oldVnodeAttrs[memberName],
|
|
579
1202
|
void 0,
|
|
580
1203
|
isSvgMode2,
|
|
581
|
-
newVnode.$flags
|
|
1204
|
+
newVnode.$flags$,
|
|
1205
|
+
isInitialRender
|
|
1206
|
+
);
|
|
582
1207
|
}
|
|
583
1208
|
}
|
|
584
1209
|
}
|
|
@@ -589,7 +1214,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
589
1214
|
oldVnodeAttrs[memberName],
|
|
590
1215
|
newVnodeAttrs[memberName],
|
|
591
1216
|
isSvgMode2,
|
|
592
|
-
newVnode.$flags
|
|
1217
|
+
newVnode.$flags$,
|
|
1218
|
+
isInitialRender
|
|
1219
|
+
);
|
|
593
1220
|
}
|
|
594
1221
|
};
|
|
595
1222
|
function sortedAttrNames(attrNames) {
|
|
@@ -783,7 +1410,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
783
1410
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
784
1411
|
}
|
|
785
1412
|
{
|
|
786
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1413
|
+
updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
|
|
787
1414
|
}
|
|
788
1415
|
if (oldChildren !== null && newChildren !== null) {
|
|
789
1416
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -1216,10 +1843,21 @@ var connectedCallback = (elm) => {
|
|
|
1216
1843
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1217
1844
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1218
1845
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1846
|
+
let hostId;
|
|
1847
|
+
{
|
|
1848
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
1849
|
+
if (hostId) {
|
|
1850
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
1851
|
+
const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
|
|
1852
|
+
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
1853
|
+
}
|
|
1854
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1219
1857
|
{
|
|
1220
1858
|
let ancestorComponent = elm;
|
|
1221
1859
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1222
|
-
if (ancestorComponent["s-p"]) {
|
|
1860
|
+
if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1223
1861
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1224
1862
|
break;
|
|
1225
1863
|
}
|
|
@@ -1288,6 +1926,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1288
1926
|
let isBootstrapping = true;
|
|
1289
1927
|
Object.assign(plt, options);
|
|
1290
1928
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
1929
|
+
{
|
|
1930
|
+
plt.$flags$ |= 2 /* appLoaded */;
|
|
1931
|
+
}
|
|
1932
|
+
{
|
|
1933
|
+
hydrateScopedToShadow();
|
|
1934
|
+
}
|
|
1291
1935
|
let hasSlotRelocation = false;
|
|
1292
1936
|
lazyBundles.map((lazyBundle) => {
|
|
1293
1937
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1401,6 +2045,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1401
2045
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1402
2046
|
|
|
1403
2047
|
export { getElement as a, bootstrapLazy as b, createEvent as c, setAssetPath as d, getAssetPath as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
1404
|
-
//# sourceMappingURL=index-
|
|
2048
|
+
//# sourceMappingURL=index-BAQIT3Vo.js.map
|
|
1405
2049
|
|
|
1406
|
-
//# sourceMappingURL=index-
|
|
2050
|
+
//# sourceMappingURL=index-BAQIT3Vo.js.map
|