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