@rindo/core 4.22.3 → 4.23.1
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/rindo.js +1730 -158
- 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/client/index.js +1506 -1161
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +1468 -1156
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +53 -39
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +72 -3
- package/internal/rindo-public-docs.d.ts +8 -0
- package/internal/testing/index.js +1478 -1166
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +20 -9
- package/mock-doc/index.js +20 -9
- package/mock-doc/package.json +1 -1
- package/package.json +2 -2
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +13 -13
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +12 -3
- package/testing/package.json +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Rindo Client Platform v4.
|
|
2
|
+
Rindo Client Platform v4.23.1 | MIT Licensed | https://rindojs.web.app
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -18,9 +18,21 @@ var Build = {
|
|
|
18
18
|
|
|
19
19
|
// src/client/client-host-ref.ts
|
|
20
20
|
import { BUILD as BUILD2 } from "@rindo/core/internal/app-data";
|
|
21
|
+
|
|
22
|
+
// src/utils/constants.ts
|
|
23
|
+
var EMPTY_OBJ = {};
|
|
24
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
25
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
26
|
+
|
|
27
|
+
// src/client/client-host-ref.ts
|
|
21
28
|
var hostRefs = BUILD2.hotModuleReplacement ? window.__RINDO_HOSTREFS__ || (window.__RINDO_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
|
|
22
29
|
var getHostRef = (ref) => hostRefs.get(ref);
|
|
23
|
-
var registerInstance = (lazyInstance, hostRef) =>
|
|
30
|
+
var registerInstance = (lazyInstance, hostRef) => {
|
|
31
|
+
hostRefs.set(hostRef.$lazyInstance$ = lazyInstance, hostRef);
|
|
32
|
+
if (BUILD2.modernPropertyDecls && (BUILD2.state || BUILD2.prop)) {
|
|
33
|
+
reWireGetterSetter(lazyInstance, hostRef);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
24
36
|
var registerHost = (hostElement, cmpMeta) => {
|
|
25
37
|
const hostRef = {
|
|
26
38
|
$flags$: 0,
|
|
@@ -39,9 +51,35 @@ var registerHost = (hostElement, cmpMeta) => {
|
|
|
39
51
|
hostElement["s-p"] = [];
|
|
40
52
|
hostElement["s-rc"] = [];
|
|
41
53
|
}
|
|
42
|
-
|
|
54
|
+
const ref = hostRefs.set(hostElement, hostRef);
|
|
55
|
+
if (!BUILD2.lazyLoad && BUILD2.modernPropertyDecls && (BUILD2.state || BUILD2.prop)) {
|
|
56
|
+
reWireGetterSetter(hostElement, hostRef);
|
|
57
|
+
}
|
|
58
|
+
return ref;
|
|
43
59
|
};
|
|
44
60
|
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
61
|
+
var reWireGetterSetter = (instance, hostRef) => {
|
|
62
|
+
var _a;
|
|
63
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
64
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
65
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
66
|
+
if (BUILD2.state && BUILD2.prop && (memberFlags & 2048 /* Getter */) === 0 && (memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
67
|
+
const ogValue = instance[memberName];
|
|
68
|
+
const lazyDescriptor = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(instance), memberName);
|
|
69
|
+
Object.defineProperty(instance, memberName, {
|
|
70
|
+
get() {
|
|
71
|
+
return lazyDescriptor.get.call(this);
|
|
72
|
+
},
|
|
73
|
+
set(newValue) {
|
|
74
|
+
lazyDescriptor.set.call(this, newValue);
|
|
75
|
+
},
|
|
76
|
+
configurable: true,
|
|
77
|
+
enumerable: true
|
|
78
|
+
});
|
|
79
|
+
instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
};
|
|
45
83
|
|
|
46
84
|
// src/client/client-load-module.ts
|
|
47
85
|
import { BUILD as BUILD4 } from "@rindo/core/internal/app-data";
|
|
@@ -105,6 +143,7 @@ var CONTENT_REF_ID = "r";
|
|
|
105
143
|
var ORG_LOCATION_ID = "o";
|
|
106
144
|
var SLOT_NODE_ID = "s";
|
|
107
145
|
var TEXT_NODE_ID = "t";
|
|
146
|
+
var COMMENT_NODE_ID = "c";
|
|
108
147
|
var HYDRATE_ID = "s-id";
|
|
109
148
|
var HYDRATED_STYLE_ID = "sty-id";
|
|
110
149
|
var HYDRATE_CHILD_ID = "c-id";
|
|
@@ -242,7 +281,7 @@ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
|
242
281
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
243
282
|
|
|
244
283
|
// src/client/index.ts
|
|
245
|
-
import { BUILD as
|
|
284
|
+
import { BUILD as BUILD28, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
|
|
246
285
|
|
|
247
286
|
// src/runtime/asset-path.ts
|
|
248
287
|
var getAssetPath = (path) => {
|
|
@@ -252,15 +291,10 @@ var getAssetPath = (path) => {
|
|
|
252
291
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
253
292
|
|
|
254
293
|
// src/runtime/bootstrap-custom-element.ts
|
|
255
|
-
import { BUILD as
|
|
256
|
-
|
|
257
|
-
// src/utils/constants.ts
|
|
258
|
-
var EMPTY_OBJ = {};
|
|
259
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
260
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
294
|
+
import { BUILD as BUILD25 } from "@rindo/core/internal/app-data";
|
|
261
295
|
|
|
262
296
|
// src/utils/helpers.ts
|
|
263
|
-
var isDef = (v) => v != null;
|
|
297
|
+
var isDef = (v) => v != null && v !== void 0;
|
|
264
298
|
var isComplexType = (o) => {
|
|
265
299
|
o = typeof o;
|
|
266
300
|
return o === "object" || o === "function";
|
|
@@ -322,96 +356,119 @@ var unwrapErr = (result) => {
|
|
|
322
356
|
};
|
|
323
357
|
|
|
324
358
|
// src/runtime/connected-callback.ts
|
|
325
|
-
import { BUILD as
|
|
359
|
+
import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
|
|
326
360
|
|
|
327
361
|
// src/runtime/client-hydrate.ts
|
|
328
|
-
import { BUILD as
|
|
362
|
+
import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
|
|
329
363
|
|
|
330
|
-
// src/runtime/
|
|
364
|
+
// src/runtime/dom-extras.ts
|
|
365
|
+
import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
|
|
366
|
+
|
|
367
|
+
// src/runtime/slot-polyfill-utils.ts
|
|
331
368
|
import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
if (
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
369
|
+
var updateFallbackSlotVisibility = (elm) => {
|
|
370
|
+
const childNodes = elm.__childNodes || elm.childNodes;
|
|
371
|
+
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
372
|
+
getHostSlotNodes(childNodes, elm.tagName).forEach((slotNode) => {
|
|
373
|
+
var _a;
|
|
374
|
+
if (slotNode.nodeType === 1 /* ElementNode */ && slotNode.tagName === "SLOT-FB") {
|
|
375
|
+
if ((_a = getHostSlotChildNodes(slotNode, slotNode["s-sn"], false)) == null ? void 0 : _a.length) {
|
|
376
|
+
slotNode.hidden = true;
|
|
377
|
+
} else {
|
|
378
|
+
slotNode.hidden = false;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
for (const childNode of childNodes) {
|
|
384
|
+
if (childNode.nodeType === 1 /* ElementNode */ && (childNode.__childNodes || childNode.childNodes).length) {
|
|
385
|
+
updateFallbackSlotVisibility(childNode);
|
|
386
|
+
}
|
|
342
387
|
}
|
|
343
388
|
};
|
|
344
|
-
var
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
389
|
+
var getSlottedChildNodes = (childNodes) => {
|
|
390
|
+
const result = [];
|
|
391
|
+
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
392
|
+
const slottedNode = childNodes[i2]["s-nr"];
|
|
393
|
+
if (slottedNode && slottedNode.isConnected) {
|
|
394
|
+
result.push(slottedNode);
|
|
348
395
|
}
|
|
349
|
-
return () => {
|
|
350
|
-
if (performance.getEntriesByName(measureText, "measure").length === 0) {
|
|
351
|
-
performance.measure(measureText, key);
|
|
352
|
-
}
|
|
353
|
-
};
|
|
354
|
-
} else {
|
|
355
|
-
return () => {
|
|
356
|
-
return;
|
|
357
|
-
};
|
|
358
396
|
}
|
|
397
|
+
return result;
|
|
359
398
|
};
|
|
360
|
-
var
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
399
|
+
var getHostSlotNodes = (childNodes, hostName, slotName) => {
|
|
400
|
+
let i2 = 0;
|
|
401
|
+
let slottedNodes = [];
|
|
402
|
+
let childNode;
|
|
403
|
+
for (; i2 < childNodes.length; i2++) {
|
|
404
|
+
childNode = childNodes[i2];
|
|
405
|
+
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
|
|
406
|
+
slottedNodes.push(childNode);
|
|
407
|
+
if (typeof slotName !== "undefined") return slottedNodes;
|
|
408
|
+
}
|
|
409
|
+
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
364
410
|
}
|
|
365
|
-
|
|
366
|
-
const hostElement = hostRef.$hostElement$;
|
|
367
|
-
return {
|
|
368
|
-
renderCount: hostRef.$renderCount$,
|
|
369
|
-
flags: {
|
|
370
|
-
hasRendered: !!(flags & 2 /* hasRendered */),
|
|
371
|
-
hasConnected: !!(flags & 1 /* hasConnected */),
|
|
372
|
-
isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
|
|
373
|
-
isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
|
|
374
|
-
isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
|
|
375
|
-
hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
|
|
376
|
-
hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
|
|
377
|
-
isWatchReady: !!(flags & 128 /* isWatchReady */),
|
|
378
|
-
isListenReady: !!(flags & 256 /* isListenReady */),
|
|
379
|
-
needsRerender: !!(flags & 512 /* needsRerender */)
|
|
380
|
-
},
|
|
381
|
-
instanceValues: hostRef.$instanceValues$,
|
|
382
|
-
ancestorComponent: hostRef.$ancestorComponent$,
|
|
383
|
-
hostElement,
|
|
384
|
-
lazyInstance: hostRef.$lazyInstance$,
|
|
385
|
-
vnode: hostRef.$vnode$,
|
|
386
|
-
modeName: hostRef.$modeName$,
|
|
387
|
-
onReadyPromise: hostRef.$onReadyPromise$,
|
|
388
|
-
onReadyResolve: hostRef.$onReadyResolve$,
|
|
389
|
-
onInstancePromise: hostRef.$onInstancePromise$,
|
|
390
|
-
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
391
|
-
onRenderResolve: hostRef.$onRenderResolve$,
|
|
392
|
-
queuedListeners: hostRef.$queuedListeners$,
|
|
393
|
-
rmListeners: hostRef.$rmListeners$,
|
|
394
|
-
["s-id"]: hostElement["s-id"],
|
|
395
|
-
["s-cr"]: hostElement["s-cr"],
|
|
396
|
-
["s-lr"]: hostElement["s-lr"],
|
|
397
|
-
["s-p"]: hostElement["s-p"],
|
|
398
|
-
["s-rc"]: hostElement["s-rc"],
|
|
399
|
-
["s-sc"]: hostElement["s-sc"]
|
|
400
|
-
};
|
|
411
|
+
return slottedNodes;
|
|
401
412
|
};
|
|
402
|
-
var
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
+
var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
|
|
414
|
+
const childNodes = [];
|
|
415
|
+
if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
|
|
416
|
+
while ((node = node.nextSibling) && node["s-sn"] === slotName) {
|
|
417
|
+
childNodes.push(node);
|
|
418
|
+
}
|
|
419
|
+
return childNodes;
|
|
420
|
+
};
|
|
421
|
+
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
422
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
423
|
+
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
424
|
+
return true;
|
|
425
|
+
}
|
|
426
|
+
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
if (nodeToRelocate["s-sn"] === slotName) {
|
|
432
|
+
return true;
|
|
433
|
+
}
|
|
434
|
+
return slotName === "";
|
|
435
|
+
};
|
|
436
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
437
|
+
let slottedNodeLocation;
|
|
438
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
439
|
+
slottedNodeLocation = newChild["s-ol"];
|
|
440
|
+
} else {
|
|
441
|
+
slottedNodeLocation = document.createTextNode("");
|
|
442
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
443
|
+
}
|
|
444
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
445
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
446
|
+
const appendMethod = prepend ? parent.__prepend || parent.prepend : parent.__appendChild || parent.appendChild;
|
|
447
|
+
if (typeof position !== "undefined") {
|
|
448
|
+
if (BUILD7.hydrateClientSide) {
|
|
449
|
+
slottedNodeLocation["s-oo"] = position;
|
|
450
|
+
const childNodes = parent.__childNodes || parent.childNodes;
|
|
451
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
452
|
+
childNodes.forEach((n) => {
|
|
453
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
454
|
+
});
|
|
455
|
+
slotRelocateNodes.sort((a, b) => {
|
|
456
|
+
if (!a["s-oo"] || a["s-oo"] < b["s-oo"]) return -1;
|
|
457
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
458
|
+
return 0;
|
|
459
|
+
});
|
|
460
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
461
|
+
}
|
|
462
|
+
} else {
|
|
463
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
413
464
|
}
|
|
465
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
466
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
414
467
|
};
|
|
468
|
+
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
469
|
+
|
|
470
|
+
// src/runtime/vdom/vdom-render.ts
|
|
471
|
+
import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
|
|
415
472
|
|
|
416
473
|
// src/runtime/vdom/h.ts
|
|
417
474
|
import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
|
|
@@ -553,416 +610,58 @@ var validateInputProperties = (inputElm) => {
|
|
|
553
610
|
}
|
|
554
611
|
};
|
|
555
612
|
|
|
556
|
-
// src/runtime/
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
node["s-ol"] = orgLocationNode;
|
|
581
|
-
node["s-ol"]["s-nr"] = node;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
585
|
-
});
|
|
586
|
-
if (BUILD9.shadowDom && shadowRoot) {
|
|
587
|
-
shadowRootNodes.map((shadowRootNode) => {
|
|
588
|
-
if (shadowRootNode) {
|
|
589
|
-
shadowRoot.appendChild(shadowRootNode);
|
|
613
|
+
// src/runtime/vdom/update-element.ts
|
|
614
|
+
import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
|
|
615
|
+
|
|
616
|
+
// src/runtime/vdom/set-accessor.ts
|
|
617
|
+
import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
|
|
618
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
619
|
+
if (oldValue !== newValue) {
|
|
620
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
621
|
+
let ln = memberName.toLowerCase();
|
|
622
|
+
if (BUILD9.vdomClass && memberName === "class") {
|
|
623
|
+
const classList = elm.classList;
|
|
624
|
+
const oldClasses = parseClassList(oldValue);
|
|
625
|
+
let newClasses = parseClassList(newValue);
|
|
626
|
+
if (elm["s-si"]) {
|
|
627
|
+
newClasses.push(elm["s-si"]);
|
|
628
|
+
oldClasses.forEach((c) => {
|
|
629
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
630
|
+
});
|
|
631
|
+
newClasses = [...new Set(newClasses)];
|
|
632
|
+
classList.add(...newClasses);
|
|
633
|
+
delete elm["s-si"];
|
|
634
|
+
} else {
|
|
635
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
636
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
590
637
|
}
|
|
591
|
-
})
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
602
|
-
if (childNodeType) {
|
|
603
|
-
childIdSplt = childNodeType.split(".");
|
|
604
|
-
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
605
|
-
childVNode = {
|
|
606
|
-
$flags$: 0,
|
|
607
|
-
$hostId$: childIdSplt[0],
|
|
608
|
-
$nodeId$: childIdSplt[1],
|
|
609
|
-
$depth$: childIdSplt[2],
|
|
610
|
-
$index$: childIdSplt[3],
|
|
611
|
-
$tag$: node.tagName.toLowerCase(),
|
|
612
|
-
$elm$: node,
|
|
613
|
-
$attrs$: null,
|
|
614
|
-
$children$: null,
|
|
615
|
-
$key$: null,
|
|
616
|
-
$name$: null,
|
|
617
|
-
$text$: null
|
|
618
|
-
};
|
|
619
|
-
childRenderNodes.push(childVNode);
|
|
620
|
-
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
621
|
-
if (!parentVNode.$children$) {
|
|
622
|
-
parentVNode.$children$ = [];
|
|
638
|
+
} else if (BUILD9.vdomStyle && memberName === "style") {
|
|
639
|
+
if (BUILD9.updatable) {
|
|
640
|
+
for (const prop in oldValue) {
|
|
641
|
+
if (!newValue || newValue[prop] == null) {
|
|
642
|
+
if (!BUILD9.hydrateServerSide && prop.includes("-")) {
|
|
643
|
+
elm.style.removeProperty(prop);
|
|
644
|
+
} else {
|
|
645
|
+
elm.style[prop] = "";
|
|
646
|
+
}
|
|
647
|
+
}
|
|
623
648
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
if (
|
|
627
|
-
|
|
649
|
+
}
|
|
650
|
+
for (const prop in newValue) {
|
|
651
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
652
|
+
if (!BUILD9.hydrateServerSide && prop.includes("-")) {
|
|
653
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
654
|
+
} else {
|
|
655
|
+
elm.style[prop] = newValue[prop];
|
|
656
|
+
}
|
|
628
657
|
}
|
|
629
658
|
}
|
|
630
|
-
}
|
|
631
|
-
if (
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
parentVNode,
|
|
635
|
-
childRenderNodes,
|
|
636
|
-
slotNodes,
|
|
637
|
-
shadowRootNodes,
|
|
638
|
-
hostElm,
|
|
639
|
-
node.shadowRoot.childNodes[i2],
|
|
640
|
-
hostId
|
|
641
|
-
);
|
|
659
|
+
} else if (BUILD9.vdomKey && memberName === "key") {
|
|
660
|
+
} else if (BUILD9.vdomRef && memberName === "ref") {
|
|
661
|
+
if (newValue) {
|
|
662
|
+
newValue(elm);
|
|
642
663
|
}
|
|
643
|
-
}
|
|
644
|
-
for (i2 = node.childNodes.length - 1; i2 >= 0; i2--) {
|
|
645
|
-
clientHydrate(
|
|
646
|
-
parentVNode,
|
|
647
|
-
childRenderNodes,
|
|
648
|
-
slotNodes,
|
|
649
|
-
shadowRootNodes,
|
|
650
|
-
hostElm,
|
|
651
|
-
node.childNodes[i2],
|
|
652
|
-
hostId
|
|
653
|
-
);
|
|
654
|
-
}
|
|
655
|
-
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
656
|
-
childIdSplt = node.nodeValue.split(".");
|
|
657
|
-
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
658
|
-
childNodeType = childIdSplt[0];
|
|
659
|
-
childVNode = {
|
|
660
|
-
$flags$: 0,
|
|
661
|
-
$hostId$: childIdSplt[1],
|
|
662
|
-
$nodeId$: childIdSplt[2],
|
|
663
|
-
$depth$: childIdSplt[3],
|
|
664
|
-
$index$: childIdSplt[4],
|
|
665
|
-
$elm$: node,
|
|
666
|
-
$attrs$: null,
|
|
667
|
-
$children$: null,
|
|
668
|
-
$key$: null,
|
|
669
|
-
$name$: null,
|
|
670
|
-
$tag$: null,
|
|
671
|
-
$text$: null
|
|
672
|
-
};
|
|
673
|
-
if (childNodeType === TEXT_NODE_ID) {
|
|
674
|
-
childVNode.$elm$ = node.nextSibling;
|
|
675
|
-
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
676
|
-
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
677
|
-
childRenderNodes.push(childVNode);
|
|
678
|
-
node.remove();
|
|
679
|
-
if (!parentVNode.$children$) {
|
|
680
|
-
parentVNode.$children$ = [];
|
|
681
|
-
}
|
|
682
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
683
|
-
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
684
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
} else if (childVNode.$hostId$ === hostId) {
|
|
688
|
-
if (childNodeType === SLOT_NODE_ID) {
|
|
689
|
-
childVNode.$tag$ = "slot";
|
|
690
|
-
if (childIdSplt[5]) {
|
|
691
|
-
node["s-sn"] = childVNode.$name$ = childIdSplt[5];
|
|
692
|
-
} else {
|
|
693
|
-
node["s-sn"] = "";
|
|
694
|
-
}
|
|
695
|
-
node["s-sr"] = true;
|
|
696
|
-
if (BUILD9.shadowDom && shadowRootNodes) {
|
|
697
|
-
childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
698
|
-
if (childVNode.$name$) {
|
|
699
|
-
childVNode.$elm$.setAttribute("name", childVNode.$name$);
|
|
700
|
-
}
|
|
701
|
-
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
702
|
-
node.remove();
|
|
703
|
-
if (childVNode.$depth$ === "0") {
|
|
704
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
slotNodes.push(childVNode);
|
|
708
|
-
if (!parentVNode.$children$) {
|
|
709
|
-
parentVNode.$children$ = [];
|
|
710
|
-
}
|
|
711
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
712
|
-
} else if (childNodeType === CONTENT_REF_ID) {
|
|
713
|
-
if (BUILD9.shadowDom && shadowRootNodes) {
|
|
714
|
-
node.remove();
|
|
715
|
-
} else if (BUILD9.slotRelocation) {
|
|
716
|
-
hostElm["s-cr"] = node;
|
|
717
|
-
node["s-cn"] = true;
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
}
|
|
722
|
-
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
723
|
-
const vnode = newVNode(null, node.textContent);
|
|
724
|
-
vnode.$elm$ = node;
|
|
725
|
-
vnode.$index$ = "0";
|
|
726
|
-
parentVNode.$children$ = [vnode];
|
|
727
|
-
}
|
|
728
|
-
};
|
|
729
|
-
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
730
|
-
if (node.nodeType === 1 /* ElementNode */) {
|
|
731
|
-
let i2 = 0;
|
|
732
|
-
if (node.shadowRoot) {
|
|
733
|
-
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
734
|
-
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
735
|
-
}
|
|
736
|
-
}
|
|
737
|
-
for (i2 = 0; i2 < node.childNodes.length; i2++) {
|
|
738
|
-
initializeDocumentHydrate(node.childNodes[i2], orgLocNodes);
|
|
739
|
-
}
|
|
740
|
-
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
741
|
-
const childIdSplt = node.nodeValue.split(".");
|
|
742
|
-
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
743
|
-
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
744
|
-
node.nodeValue = "";
|
|
745
|
-
node["s-en"] = childIdSplt[3];
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
};
|
|
749
|
-
|
|
750
|
-
// src/runtime/initialize-component.ts
|
|
751
|
-
import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
|
|
752
|
-
|
|
753
|
-
// src/runtime/mode.ts
|
|
754
|
-
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
755
|
-
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
756
|
-
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
757
|
-
|
|
758
|
-
// src/runtime/proxy-component.ts
|
|
759
|
-
import { BUILD as BUILD19 } from "@rindo/core/internal/app-data";
|
|
760
|
-
|
|
761
|
-
// src/runtime/set-value.ts
|
|
762
|
-
import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
|
|
763
|
-
|
|
764
|
-
// src/runtime/parse-property-value.ts
|
|
765
|
-
import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
|
|
766
|
-
var parsePropertyValue = (propValue, propType) => {
|
|
767
|
-
if (propValue != null && !isComplexType(propValue)) {
|
|
768
|
-
if (BUILD10.propBoolean && propType & 4 /* Boolean */) {
|
|
769
|
-
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
770
|
-
}
|
|
771
|
-
if (BUILD10.propNumber && propType & 2 /* Number */) {
|
|
772
|
-
return parseFloat(propValue);
|
|
773
|
-
}
|
|
774
|
-
if (BUILD10.propString && propType & 1 /* String */) {
|
|
775
|
-
return String(propValue);
|
|
776
|
-
}
|
|
777
|
-
return propValue;
|
|
778
|
-
}
|
|
779
|
-
return propValue;
|
|
780
|
-
};
|
|
781
|
-
|
|
782
|
-
// src/runtime/update-component.ts
|
|
783
|
-
import { BUILD as BUILD17, NAMESPACE } from "@rindo/core/internal/app-data";
|
|
784
|
-
|
|
785
|
-
// src/runtime/event-emitter.ts
|
|
786
|
-
import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
|
|
787
|
-
|
|
788
|
-
// src/runtime/element.ts
|
|
789
|
-
import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
|
|
790
|
-
var getElement = (ref) => BUILD11.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
791
|
-
|
|
792
|
-
// src/runtime/event-emitter.ts
|
|
793
|
-
var createEvent = (ref, name, flags) => {
|
|
794
|
-
const elm = getElement(ref);
|
|
795
|
-
return {
|
|
796
|
-
emit: (detail) => {
|
|
797
|
-
if (BUILD12.isDev && !elm.isConnected) {
|
|
798
|
-
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
799
|
-
}
|
|
800
|
-
return emitEvent(elm, name, {
|
|
801
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
802
|
-
composed: !!(flags & 2 /* Composed */),
|
|
803
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
804
|
-
detail
|
|
805
|
-
});
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
};
|
|
809
|
-
var emitEvent = (elm, name, opts) => {
|
|
810
|
-
const ev = plt.ce(name, opts);
|
|
811
|
-
elm.dispatchEvent(ev);
|
|
812
|
-
return ev;
|
|
813
|
-
};
|
|
814
|
-
|
|
815
|
-
// src/runtime/styles.ts
|
|
816
|
-
import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
|
|
817
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
818
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
819
|
-
let style = styles.get(scopeId2);
|
|
820
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
821
|
-
style = style || new CSSStyleSheet();
|
|
822
|
-
if (typeof style === "string") {
|
|
823
|
-
style = cssText;
|
|
824
|
-
} else {
|
|
825
|
-
style.replaceSync(cssText);
|
|
826
|
-
}
|
|
827
|
-
} else {
|
|
828
|
-
style = cssText;
|
|
829
|
-
}
|
|
830
|
-
styles.set(scopeId2, style);
|
|
831
|
-
};
|
|
832
|
-
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
833
|
-
var _a;
|
|
834
|
-
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
835
|
-
const style = styles.get(scopeId2);
|
|
836
|
-
if (!BUILD13.attachStyles) {
|
|
837
|
-
return scopeId2;
|
|
838
|
-
}
|
|
839
|
-
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
840
|
-
if (style) {
|
|
841
|
-
if (typeof style === "string") {
|
|
842
|
-
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
843
|
-
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
844
|
-
let styleElm;
|
|
845
|
-
if (!appliedStyles) {
|
|
846
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
847
|
-
}
|
|
848
|
-
if (!appliedStyles.has(scopeId2)) {
|
|
849
|
-
if (BUILD13.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
850
|
-
styleElm.innerHTML = style;
|
|
851
|
-
} else {
|
|
852
|
-
styleElm = doc.createElement("style");
|
|
853
|
-
styleElm.innerHTML = style;
|
|
854
|
-
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
855
|
-
if (nonce != null) {
|
|
856
|
-
styleElm.setAttribute("nonce", nonce);
|
|
857
|
-
}
|
|
858
|
-
if ((BUILD13.hydrateServerSide || BUILD13.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
859
|
-
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
860
|
-
}
|
|
861
|
-
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
862
|
-
if (styleContainerNode.nodeName === "HEAD") {
|
|
863
|
-
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
864
|
-
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
865
|
-
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
866
|
-
} else if ("host" in styleContainerNode) {
|
|
867
|
-
if (supportsConstructableStylesheets) {
|
|
868
|
-
const stylesheet = new CSSStyleSheet();
|
|
869
|
-
stylesheet.replaceSync(style);
|
|
870
|
-
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
871
|
-
} else {
|
|
872
|
-
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
873
|
-
if (existingStyleContainer) {
|
|
874
|
-
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
875
|
-
} else {
|
|
876
|
-
styleContainerNode.prepend(styleElm);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
} else {
|
|
880
|
-
styleContainerNode.append(styleElm);
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
|
-
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
884
|
-
styleContainerNode.insertBefore(styleElm, null);
|
|
885
|
-
}
|
|
886
|
-
}
|
|
887
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
888
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
889
|
-
}
|
|
890
|
-
if (appliedStyles) {
|
|
891
|
-
appliedStyles.add(scopeId2);
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
} else if (BUILD13.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
895
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
return scopeId2;
|
|
899
|
-
};
|
|
900
|
-
var attachStyles = (hostRef) => {
|
|
901
|
-
const cmpMeta = hostRef.$cmpMeta$;
|
|
902
|
-
const elm = hostRef.$hostElement$;
|
|
903
|
-
const flags = cmpMeta.$flags$;
|
|
904
|
-
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
905
|
-
const scopeId2 = addStyle(
|
|
906
|
-
BUILD13.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
907
|
-
cmpMeta,
|
|
908
|
-
hostRef.$modeName$
|
|
909
|
-
);
|
|
910
|
-
if ((BUILD13.shadowDom || BUILD13.scoped) && BUILD13.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
911
|
-
elm["s-sc"] = scopeId2;
|
|
912
|
-
elm.classList.add(scopeId2 + "-h");
|
|
913
|
-
if (BUILD13.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
914
|
-
elm.classList.add(scopeId2 + "-s");
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
endAttachStyles();
|
|
918
|
-
};
|
|
919
|
-
var getScopeId = (cmp, mode) => "sc-" + (BUILD13.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
920
|
-
|
|
921
|
-
// src/runtime/vdom/vdom-render.ts
|
|
922
|
-
import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
|
|
923
|
-
|
|
924
|
-
// src/runtime/vdom/update-element.ts
|
|
925
|
-
import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
|
|
926
|
-
|
|
927
|
-
// src/runtime/vdom/set-accessor.ts
|
|
928
|
-
import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
|
|
929
|
-
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
930
|
-
if (oldValue !== newValue) {
|
|
931
|
-
let isProp = isMemberInElement(elm, memberName);
|
|
932
|
-
let ln = memberName.toLowerCase();
|
|
933
|
-
if (BUILD14.vdomClass && memberName === "class") {
|
|
934
|
-
const classList = elm.classList;
|
|
935
|
-
const oldClasses = parseClassList(oldValue);
|
|
936
|
-
const newClasses = parseClassList(newValue);
|
|
937
|
-
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
938
|
-
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
939
|
-
} else if (BUILD14.vdomStyle && memberName === "style") {
|
|
940
|
-
if (BUILD14.updatable) {
|
|
941
|
-
for (const prop in oldValue) {
|
|
942
|
-
if (!newValue || newValue[prop] == null) {
|
|
943
|
-
if (!BUILD14.hydrateServerSide && prop.includes("-")) {
|
|
944
|
-
elm.style.removeProperty(prop);
|
|
945
|
-
} else {
|
|
946
|
-
elm.style[prop] = "";
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
for (const prop in newValue) {
|
|
952
|
-
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
953
|
-
if (!BUILD14.hydrateServerSide && prop.includes("-")) {
|
|
954
|
-
elm.style.setProperty(prop, newValue[prop]);
|
|
955
|
-
} else {
|
|
956
|
-
elm.style[prop] = newValue[prop];
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
} else if (BUILD14.vdomKey && memberName === "key") {
|
|
961
|
-
} else if (BUILD14.vdomRef && memberName === "ref") {
|
|
962
|
-
if (newValue) {
|
|
963
|
-
newValue(elm);
|
|
964
|
-
}
|
|
965
|
-
} else if (BUILD14.vdomListener && (BUILD14.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
664
|
+
} else if (BUILD9.vdomListener && (BUILD9.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
966
665
|
if (memberName[2] === "-") {
|
|
967
666
|
memberName = memberName.slice(3);
|
|
968
667
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -980,7 +679,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
980
679
|
plt.ael(elm, memberName, newValue, capture);
|
|
981
680
|
}
|
|
982
681
|
}
|
|
983
|
-
} else if (
|
|
682
|
+
} else if (BUILD9.vdomPropOrAttr) {
|
|
984
683
|
const isComplex = isComplexType(newValue);
|
|
985
684
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
986
685
|
try {
|
|
@@ -1002,7 +701,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1002
701
|
}
|
|
1003
702
|
}
|
|
1004
703
|
let xlink = false;
|
|
1005
|
-
if (
|
|
704
|
+
if (BUILD9.vdomXlink) {
|
|
1006
705
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
1007
706
|
memberName = ln;
|
|
1008
707
|
xlink = true;
|
|
@@ -1010,7 +709,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1010
709
|
}
|
|
1011
710
|
if (newValue == null || newValue === false) {
|
|
1012
711
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
1013
|
-
if (
|
|
712
|
+
if (BUILD9.vdomXlink && xlink) {
|
|
1014
713
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
1015
714
|
} else {
|
|
1016
715
|
elm.removeAttribute(memberName);
|
|
@@ -1018,7 +717,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1018
717
|
}
|
|
1019
718
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
1020
719
|
newValue = newValue === true ? "" : newValue;
|
|
1021
|
-
if (
|
|
720
|
+
if (BUILD9.vdomXlink && xlink) {
|
|
1022
721
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
1023
722
|
} else {
|
|
1024
723
|
elm.setAttribute(memberName, newValue);
|
|
@@ -1028,7 +727,15 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
1028
727
|
}
|
|
1029
728
|
};
|
|
1030
729
|
var parseClassListRegex = /\s/;
|
|
1031
|
-
var parseClassList = (value) =>
|
|
730
|
+
var parseClassList = (value) => {
|
|
731
|
+
if (typeof value === "object" && "baseVal" in value) {
|
|
732
|
+
value = value.baseVal;
|
|
733
|
+
}
|
|
734
|
+
if (!value) {
|
|
735
|
+
return [];
|
|
736
|
+
}
|
|
737
|
+
return value.split(parseClassListRegex);
|
|
738
|
+
};
|
|
1032
739
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
1033
740
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
1034
741
|
|
|
@@ -1037,7 +744,7 @@ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
|
1037
744
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
1038
745
|
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || EMPTY_OBJ;
|
|
1039
746
|
const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
|
|
1040
|
-
if (
|
|
747
|
+
if (BUILD10.updatable) {
|
|
1041
748
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
1042
749
|
if (!(memberName in newVnodeAttrs)) {
|
|
1043
750
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -1066,19 +773,16 @@ var useNativeShadowDom = false;
|
|
|
1066
773
|
var checkSlotFallbackVisibility = false;
|
|
1067
774
|
var checkSlotRelocate = false;
|
|
1068
775
|
var isSvgMode = false;
|
|
1069
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
776
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
1070
777
|
var _a;
|
|
1071
778
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
1072
779
|
let i2 = 0;
|
|
1073
780
|
let elm;
|
|
1074
781
|
let childNode;
|
|
1075
782
|
let oldVNode;
|
|
1076
|
-
if (
|
|
783
|
+
if (BUILD11.slotRelocation && !useNativeShadowDom) {
|
|
1077
784
|
checkSlotRelocate = true;
|
|
1078
785
|
if (newVNode2.$tag$ === "slot") {
|
|
1079
|
-
if (scopeId) {
|
|
1080
|
-
parentElm.classList.add(scopeId + "-s");
|
|
1081
|
-
}
|
|
1082
786
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
1083
787
|
// slot element has fallback content
|
|
1084
788
|
// still create an element that "mocks" the slot element
|
|
@@ -1091,48 +795,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1091
795
|
);
|
|
1092
796
|
}
|
|
1093
797
|
}
|
|
1094
|
-
if (
|
|
798
|
+
if (BUILD11.isDev && newVNode2.$elm$) {
|
|
1095
799
|
consoleDevError(
|
|
1096
800
|
`The JSX ${newVNode2.$text$ !== null ? `"${newVNode2.$text$}" text` : `"${newVNode2.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://rindojs.web.app/docs/templating-jsx#avoid-shared-jsx-nodes`
|
|
1097
801
|
);
|
|
1098
802
|
}
|
|
1099
|
-
if (
|
|
803
|
+
if (BUILD11.vdomText && newVNode2.$text$ !== null) {
|
|
1100
804
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1101
|
-
} else if (
|
|
1102
|
-
elm = newVNode2.$elm$ =
|
|
805
|
+
} else if (BUILD11.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
806
|
+
elm = newVNode2.$elm$ = BUILD11.isDebug || BUILD11.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
1103
807
|
} else {
|
|
1104
|
-
if (
|
|
808
|
+
if (BUILD11.svg && !isSvgMode) {
|
|
1105
809
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1106
810
|
}
|
|
1107
|
-
elm = newVNode2.$elm$ =
|
|
811
|
+
elm = newVNode2.$elm$ = BUILD11.svg ? doc.createElementNS(
|
|
1108
812
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
1109
|
-
!useNativeShadowDom &&
|
|
813
|
+
!useNativeShadowDom && BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1110
814
|
) : doc.createElement(
|
|
1111
|
-
!useNativeShadowDom &&
|
|
815
|
+
!useNativeShadowDom && BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1112
816
|
);
|
|
1113
|
-
if (
|
|
817
|
+
if (BUILD11.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1114
818
|
isSvgMode = false;
|
|
1115
819
|
}
|
|
1116
|
-
if (
|
|
820
|
+
if (BUILD11.vdomAttribute) {
|
|
1117
821
|
updateElement(null, newVNode2, isSvgMode);
|
|
1118
822
|
}
|
|
1119
|
-
|
|
1120
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
1121
|
-
if (!isElementWithinShadowRoot && BUILD16.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
823
|
+
if (BUILD11.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
1122
824
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
1123
825
|
}
|
|
1124
|
-
if (BUILD16.scoped) {
|
|
1125
|
-
updateElementScopeIds(elm, parentElm);
|
|
1126
|
-
}
|
|
1127
826
|
if (newVNode2.$children$) {
|
|
1128
827
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
1129
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
828
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
1130
829
|
if (childNode) {
|
|
1131
830
|
elm.appendChild(childNode);
|
|
1132
831
|
}
|
|
1133
832
|
}
|
|
1134
833
|
}
|
|
1135
|
-
if (
|
|
834
|
+
if (BUILD11.svg) {
|
|
1136
835
|
if (newVNode2.$tag$ === "svg") {
|
|
1137
836
|
isSvgMode = false;
|
|
1138
837
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -1141,7 +840,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1141
840
|
}
|
|
1142
841
|
}
|
|
1143
842
|
elm["s-hn"] = hostTagName;
|
|
1144
|
-
if (
|
|
843
|
+
if (BUILD11.slotRelocation) {
|
|
1145
844
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
1146
845
|
elm["s-sr"] = true;
|
|
1147
846
|
elm["s-cr"] = contentRef;
|
|
@@ -1149,12 +848,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
1149
848
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1150
849
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
1151
850
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
1152
|
-
if (
|
|
851
|
+
if (BUILD11.experimentalSlotFixes) {
|
|
1153
852
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
1154
853
|
} else {
|
|
1155
854
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
1156
855
|
}
|
|
1157
856
|
}
|
|
857
|
+
if (BUILD11.scoped) {
|
|
858
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
859
|
+
}
|
|
1158
860
|
}
|
|
1159
861
|
}
|
|
1160
862
|
return elm;
|
|
@@ -1163,8 +865,12 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1163
865
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1164
866
|
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
1165
867
|
if (host != null) {
|
|
1166
|
-
const contentRefNode = Array.from(host.childNodes).find(
|
|
1167
|
-
|
|
868
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
869
|
+
(ref) => ref["s-cr"]
|
|
870
|
+
);
|
|
871
|
+
const childNodeArray = Array.from(
|
|
872
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
873
|
+
);
|
|
1168
874
|
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
1169
875
|
if (childNode["s-sh"] != null) {
|
|
1170
876
|
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
@@ -1177,8 +883,8 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
1177
883
|
};
|
|
1178
884
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1179
885
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1180
|
-
const oldSlotChildNodes = Array.from(parentElm.childNodes);
|
|
1181
|
-
if (parentElm["s-sr"] &&
|
|
886
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
887
|
+
if (parentElm["s-sr"] && BUILD11.experimentalSlotFixes) {
|
|
1182
888
|
let node = parentElm;
|
|
1183
889
|
while (node = node.nextSibling) {
|
|
1184
890
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -1189,7 +895,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1189
895
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
1190
896
|
const childNode = oldSlotChildNodes[i2];
|
|
1191
897
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
1192
|
-
insertBefore(
|
|
898
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
1193
899
|
childNode["s-ol"].remove();
|
|
1194
900
|
childNode["s-ol"] = void 0;
|
|
1195
901
|
childNode["s-sh"] = void 0;
|
|
@@ -1202,17 +908,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
1202
908
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1203
909
|
};
|
|
1204
910
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1205
|
-
let containerElm =
|
|
911
|
+
let containerElm = BUILD11.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
1206
912
|
let childNode;
|
|
1207
|
-
if (
|
|
913
|
+
if (BUILD11.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1208
914
|
containerElm = containerElm.shadowRoot;
|
|
1209
915
|
}
|
|
1210
916
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
1211
917
|
if (vnodes[startIdx]) {
|
|
1212
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
918
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
1213
919
|
if (childNode) {
|
|
1214
920
|
vnodes[startIdx].$elm$ = childNode;
|
|
1215
|
-
insertBefore(containerElm, childNode,
|
|
921
|
+
insertBefore(containerElm, childNode, BUILD11.slotRelocation ? referenceNode(before) : before);
|
|
1216
922
|
}
|
|
1217
923
|
}
|
|
1218
924
|
}
|
|
@@ -1224,7 +930,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
1224
930
|
const elm = vnode.$elm$;
|
|
1225
931
|
nullifyVNodeRefs(vnode);
|
|
1226
932
|
if (elm) {
|
|
1227
|
-
if (
|
|
933
|
+
if (BUILD11.slotRelocation) {
|
|
1228
934
|
checkSlotFallbackVisibility = true;
|
|
1229
935
|
if (elm["s-ol"]) {
|
|
1230
936
|
elm["s-ol"].remove();
|
|
@@ -1268,7 +974,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1268
974
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
1269
975
|
newEndVnode = newCh[--newEndIdx];
|
|
1270
976
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1271
|
-
if (
|
|
977
|
+
if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1272
978
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1273
979
|
}
|
|
1274
980
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -1276,7 +982,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1276
982
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
1277
983
|
newEndVnode = newCh[--newEndIdx];
|
|
1278
984
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1279
|
-
if (
|
|
985
|
+
if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1280
986
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1281
987
|
}
|
|
1282
988
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -1285,7 +991,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1285
991
|
newStartVnode = newCh[++newStartIdx];
|
|
1286
992
|
} else {
|
|
1287
993
|
idxInOld = -1;
|
|
1288
|
-
if (
|
|
994
|
+
if (BUILD11.vdomKey) {
|
|
1289
995
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1290
996
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1291
997
|
idxInOld = i2;
|
|
@@ -1293,10 +999,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1293
999
|
}
|
|
1294
1000
|
}
|
|
1295
1001
|
}
|
|
1296
|
-
if (
|
|
1002
|
+
if (BUILD11.vdomKey && idxInOld >= 0) {
|
|
1297
1003
|
elmToMove = oldCh[idxInOld];
|
|
1298
1004
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1299
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
1005
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
1300
1006
|
} else {
|
|
1301
1007
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
1302
1008
|
oldCh[idxInOld] = void 0;
|
|
@@ -1304,12 +1010,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1304
1010
|
}
|
|
1305
1011
|
newStartVnode = newCh[++newStartIdx];
|
|
1306
1012
|
} else {
|
|
1307
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
1013
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
1308
1014
|
newStartVnode = newCh[++newStartIdx];
|
|
1309
1015
|
}
|
|
1310
1016
|
if (node) {
|
|
1311
|
-
if (
|
|
1312
|
-
insertBefore(
|
|
1017
|
+
if (BUILD11.slotRelocation) {
|
|
1018
|
+
insertBefore(
|
|
1019
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1020
|
+
node,
|
|
1021
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1022
|
+
);
|
|
1313
1023
|
} else {
|
|
1314
1024
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
1315
1025
|
}
|
|
@@ -1325,35 +1035,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
1325
1035
|
newStartIdx,
|
|
1326
1036
|
newEndIdx
|
|
1327
1037
|
);
|
|
1328
|
-
} else if (
|
|
1038
|
+
} else if (BUILD11.updatable && newStartIdx > newEndIdx) {
|
|
1329
1039
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1330
1040
|
}
|
|
1331
1041
|
};
|
|
1332
1042
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1333
1043
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1334
|
-
if (
|
|
1335
|
-
if (
|
|
1336
|
-
// The component gets hydrated and no VDOM has been initialized.
|
|
1337
|
-
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
1338
|
-
"$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
|
|
1339
|
-
// hydration comments to be removed
|
|
1340
|
-
leftVNode.$elm$.nodeType !== 8
|
|
1341
|
-
) {
|
|
1342
|
-
return false;
|
|
1343
|
-
}
|
|
1044
|
+
if (BUILD11.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
1344
1045
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
1345
1046
|
}
|
|
1346
|
-
if (
|
|
1047
|
+
if (BUILD11.vdomKey && !isInitialRender) {
|
|
1347
1048
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
1348
1049
|
}
|
|
1050
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1051
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1052
|
+
}
|
|
1349
1053
|
return true;
|
|
1350
1054
|
}
|
|
1351
1055
|
return false;
|
|
1352
1056
|
};
|
|
1353
|
-
var referenceNode = (node) =>
|
|
1354
|
-
return node && node["s-ol"] || node;
|
|
1355
|
-
};
|
|
1356
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
1057
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
1357
1058
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
1358
1059
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
1359
1060
|
const oldChildren = oldVNode.$children$;
|
|
@@ -1361,13 +1062,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1361
1062
|
const tag = newVNode2.$tag$;
|
|
1362
1063
|
const text = newVNode2.$text$;
|
|
1363
1064
|
let defaultHolder;
|
|
1364
|
-
if (!
|
|
1365
|
-
if (
|
|
1065
|
+
if (!BUILD11.vdomText || text === null) {
|
|
1066
|
+
if (BUILD11.svg) {
|
|
1366
1067
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1367
1068
|
}
|
|
1368
|
-
if (
|
|
1369
|
-
if (
|
|
1370
|
-
if (
|
|
1069
|
+
if (BUILD11.vdomAttribute || BUILD11.reflect) {
|
|
1070
|
+
if (BUILD11.slot && tag === "slot" && !useNativeShadowDom) {
|
|
1071
|
+
if (BUILD11.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
1371
1072
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1372
1073
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1373
1074
|
}
|
|
@@ -1375,67 +1076,41 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1375
1076
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1376
1077
|
}
|
|
1377
1078
|
}
|
|
1378
|
-
if (
|
|
1079
|
+
if (BUILD11.updatable && oldChildren !== null && newChildren !== null) {
|
|
1379
1080
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1380
1081
|
} else if (newChildren !== null) {
|
|
1381
|
-
if (
|
|
1082
|
+
if (BUILD11.updatable && BUILD11.vdomText && oldVNode.$text$ !== null) {
|
|
1382
1083
|
elm.textContent = "";
|
|
1383
1084
|
}
|
|
1384
1085
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1385
1086
|
} else if (
|
|
1386
1087
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1387
|
-
!isInitialRender &&
|
|
1088
|
+
!isInitialRender && BUILD11.updatable && oldChildren !== null
|
|
1388
1089
|
) {
|
|
1389
1090
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1390
1091
|
}
|
|
1391
|
-
if (
|
|
1092
|
+
if (BUILD11.svg && isSvgMode && tag === "svg") {
|
|
1392
1093
|
isSvgMode = false;
|
|
1393
1094
|
}
|
|
1394
|
-
} else if (
|
|
1095
|
+
} else if (BUILD11.vdomText && BUILD11.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
1395
1096
|
defaultHolder.parentNode.textContent = text;
|
|
1396
|
-
} else if (
|
|
1097
|
+
} else if (BUILD11.vdomText && oldVNode.$text$ !== text) {
|
|
1397
1098
|
elm.data = text;
|
|
1398
1099
|
}
|
|
1399
1100
|
};
|
|
1400
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
1401
|
-
const childNodes = elm.childNodes;
|
|
1402
|
-
for (const childNode of childNodes) {
|
|
1403
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1404
|
-
if (childNode["s-sr"]) {
|
|
1405
|
-
const slotName = childNode["s-sn"];
|
|
1406
|
-
childNode.hidden = false;
|
|
1407
|
-
for (const siblingNode of childNodes) {
|
|
1408
|
-
if (siblingNode !== childNode) {
|
|
1409
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
1410
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
1411
|
-
childNode.hidden = true;
|
|
1412
|
-
break;
|
|
1413
|
-
}
|
|
1414
|
-
} else {
|
|
1415
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
1416
|
-
childNode.hidden = true;
|
|
1417
|
-
break;
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
}
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
updateFallbackSlotVisibility(childNode);
|
|
1424
|
-
}
|
|
1425
|
-
}
|
|
1426
|
-
};
|
|
1427
1101
|
var relocateNodes = [];
|
|
1428
1102
|
var markSlotContentForRelocation = (elm) => {
|
|
1429
1103
|
let node;
|
|
1430
1104
|
let hostContentNodes;
|
|
1431
1105
|
let j;
|
|
1432
|
-
|
|
1106
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1107
|
+
for (const childNode of children) {
|
|
1433
1108
|
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1434
|
-
hostContentNodes = node.parentNode.childNodes;
|
|
1109
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1435
1110
|
const slotName = childNode["s-sn"];
|
|
1436
1111
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1437
1112
|
node = hostContentNodes[j];
|
|
1438
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!
|
|
1113
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD11.experimentalSlotFixes || !node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1439
1114
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1440
1115
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1441
1116
|
checkSlotFallbackVisibility = true;
|
|
@@ -1473,60 +1148,40 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1473
1148
|
}
|
|
1474
1149
|
}
|
|
1475
1150
|
};
|
|
1476
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1477
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1478
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
1479
|
-
return true;
|
|
1480
|
-
}
|
|
1481
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
1482
|
-
return true;
|
|
1483
|
-
}
|
|
1484
|
-
return false;
|
|
1485
|
-
}
|
|
1486
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
1487
|
-
return true;
|
|
1488
|
-
}
|
|
1489
|
-
return slotName === "";
|
|
1490
|
-
};
|
|
1491
1151
|
var nullifyVNodeRefs = (vNode) => {
|
|
1492
|
-
if (
|
|
1152
|
+
if (BUILD11.vdomRef) {
|
|
1493
1153
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1494
1154
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1495
1155
|
}
|
|
1496
1156
|
};
|
|
1497
1157
|
var insertBefore = (parent, newNode, reference) => {
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
updateElementScopeIds(newNode, parent);
|
|
1158
|
+
if (BUILD11.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
|
|
1159
|
+
addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
|
|
1501
1160
|
}
|
|
1161
|
+
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1502
1162
|
return inserted;
|
|
1503
1163
|
};
|
|
1504
|
-
|
|
1505
|
-
const scopeIds = [];
|
|
1506
|
-
if (element) {
|
|
1507
|
-
scopeIds.push(
|
|
1508
|
-
...element["s-scs"] || [],
|
|
1509
|
-
element["s-si"],
|
|
1510
|
-
element["s-sc"],
|
|
1511
|
-
...findScopeIds(element.parentElement)
|
|
1512
|
-
);
|
|
1513
|
-
}
|
|
1514
|
-
return scopeIds;
|
|
1515
|
-
};
|
|
1516
|
-
var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
1164
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
1517
1165
|
var _a;
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1166
|
+
let scopeId2;
|
|
1167
|
+
if (reference && typeof slotNode["s-sn"] === "string" && !!slotNode["s-sr"] && reference.parentNode && reference.parentNode["s-sc"] && (scopeId2 = slotNode["s-si"] || reference.parentNode["s-sc"])) {
|
|
1168
|
+
const scopeName = slotNode["s-sn"];
|
|
1169
|
+
const hostName = slotNode["s-hn"];
|
|
1170
|
+
(_a = newParent.classList) == null ? void 0 : _a.add(scopeId2 + "-s");
|
|
1171
|
+
if (oldParent && oldParent.classList.contains(scopeId2 + "-s")) {
|
|
1172
|
+
let child = (oldParent.__childNodes || oldParent.childNodes)[0];
|
|
1173
|
+
let found = false;
|
|
1174
|
+
while (child) {
|
|
1175
|
+
if (child["s-sn"] !== scopeName && child["s-hn"] === hostName && !!child["s-sr"]) {
|
|
1176
|
+
found = true;
|
|
1177
|
+
break;
|
|
1525
1178
|
}
|
|
1179
|
+
child = child.nextSibling;
|
|
1526
1180
|
}
|
|
1181
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
1527
1182
|
}
|
|
1528
1183
|
}
|
|
1529
|
-
}
|
|
1184
|
+
}
|
|
1530
1185
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1531
1186
|
var _a, _b, _c, _d, _e;
|
|
1532
1187
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -1534,7 +1189,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1534
1189
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1535
1190
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1536
1191
|
hostTagName = hostElm.tagName;
|
|
1537
|
-
if (
|
|
1192
|
+
if (BUILD11.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1538
1193
|
throw new Error(`The <Host> must be the single root component.
|
|
1539
1194
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1540
1195
|
|
|
@@ -1548,7 +1203,7 @@ render() {
|
|
|
1548
1203
|
}
|
|
1549
1204
|
`);
|
|
1550
1205
|
}
|
|
1551
|
-
if (
|
|
1206
|
+
if (BUILD11.reflect && cmpMeta.$attrsToReflect$) {
|
|
1552
1207
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1553
1208
|
cmpMeta.$attrsToReflect$.map(
|
|
1554
1209
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1564,24 +1219,24 @@ render() {
|
|
|
1564
1219
|
rootVnode.$tag$ = null;
|
|
1565
1220
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1566
1221
|
hostRef.$vnode$ = rootVnode;
|
|
1567
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1568
|
-
if (
|
|
1222
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD11.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
1223
|
+
if (BUILD11.scoped || BUILD11.shadowDom) {
|
|
1569
1224
|
scopeId = hostElm["s-sc"];
|
|
1570
1225
|
}
|
|
1571
1226
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1572
|
-
if (
|
|
1227
|
+
if (BUILD11.slotRelocation) {
|
|
1573
1228
|
contentRef = hostElm["s-cr"];
|
|
1574
1229
|
checkSlotFallbackVisibility = false;
|
|
1575
1230
|
}
|
|
1576
1231
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1577
|
-
if (
|
|
1232
|
+
if (BUILD11.slotRelocation) {
|
|
1578
1233
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1579
1234
|
if (checkSlotRelocate) {
|
|
1580
1235
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1581
1236
|
for (const relocateData of relocateNodes) {
|
|
1582
1237
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1583
1238
|
if (!nodeToRelocate["s-ol"]) {
|
|
1584
|
-
const orgLocationNode =
|
|
1239
|
+
const orgLocationNode = BUILD11.isDebug || BUILD11.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
1585
1240
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1586
1241
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1587
1242
|
}
|
|
@@ -1592,7 +1247,7 @@ render() {
|
|
|
1592
1247
|
if (slotRefNode) {
|
|
1593
1248
|
const parentNodeRef = slotRefNode.parentNode;
|
|
1594
1249
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1595
|
-
if (!
|
|
1250
|
+
if (!BUILD11.hydrateServerSide && (!BUILD11.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
1596
1251
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1597
1252
|
while (orgLocationNode) {
|
|
1598
1253
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -1611,11 +1266,11 @@ render() {
|
|
|
1611
1266
|
}
|
|
1612
1267
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1613
1268
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1614
|
-
if (!
|
|
1269
|
+
if (!BUILD11.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1615
1270
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1616
1271
|
}
|
|
1617
1272
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1618
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1273
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1619
1274
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1620
1275
|
}
|
|
1621
1276
|
}
|
|
@@ -1631,53 +1286,1000 @@ render() {
|
|
|
1631
1286
|
}
|
|
1632
1287
|
}
|
|
1633
1288
|
}
|
|
1634
|
-
if (checkSlotFallbackVisibility) {
|
|
1635
|
-
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1636
|
-
}
|
|
1637
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1638
|
-
relocateNodes.length = 0;
|
|
1289
|
+
if (checkSlotFallbackVisibility) {
|
|
1290
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1291
|
+
}
|
|
1292
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1293
|
+
relocateNodes.length = 0;
|
|
1294
|
+
}
|
|
1295
|
+
if (BUILD11.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1296
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1297
|
+
for (const childNode of children) {
|
|
1298
|
+
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1299
|
+
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1300
|
+
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
1301
|
+
}
|
|
1302
|
+
childNode.hidden = true;
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
}
|
|
1306
|
+
contentRef = void 0;
|
|
1307
|
+
};
|
|
1308
|
+
var slotReferenceDebugNode = (slotVNode) => doc.createComment(
|
|
1309
|
+
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1310
|
+
);
|
|
1311
|
+
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1312
|
+
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1313
|
+
);
|
|
1314
|
+
|
|
1315
|
+
// src/runtime/dom-extras.ts
|
|
1316
|
+
var patchPseudoShadowDom = (hostElementPrototype) => {
|
|
1317
|
+
patchCloneNode(hostElementPrototype);
|
|
1318
|
+
patchSlotAppendChild(hostElementPrototype);
|
|
1319
|
+
patchSlotAppend(hostElementPrototype);
|
|
1320
|
+
patchSlotPrepend(hostElementPrototype);
|
|
1321
|
+
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
1322
|
+
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
1323
|
+
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
1324
|
+
patchTextContent(hostElementPrototype);
|
|
1325
|
+
patchChildSlotNodes(hostElementPrototype);
|
|
1326
|
+
patchSlotRemoveChild(hostElementPrototype);
|
|
1327
|
+
};
|
|
1328
|
+
var patchCloneNode = (HostElementPrototype) => {
|
|
1329
|
+
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
1330
|
+
HostElementPrototype.cloneNode = function(deep) {
|
|
1331
|
+
const srcNode = this;
|
|
1332
|
+
const isShadowDom = BUILD12.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
1333
|
+
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
1334
|
+
if (BUILD12.slot && !isShadowDom && deep) {
|
|
1335
|
+
let i2 = 0;
|
|
1336
|
+
let slotted, nonRindoNode;
|
|
1337
|
+
const rindoPrivates = [
|
|
1338
|
+
"s-id",
|
|
1339
|
+
"s-cr",
|
|
1340
|
+
"s-lr",
|
|
1341
|
+
"s-rc",
|
|
1342
|
+
"s-sc",
|
|
1343
|
+
"s-p",
|
|
1344
|
+
"s-cn",
|
|
1345
|
+
"s-sr",
|
|
1346
|
+
"s-sn",
|
|
1347
|
+
"s-hn",
|
|
1348
|
+
"s-ol",
|
|
1349
|
+
"s-nr",
|
|
1350
|
+
"s-si",
|
|
1351
|
+
"s-rf",
|
|
1352
|
+
"s-scs"
|
|
1353
|
+
];
|
|
1354
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1355
|
+
for (; i2 < childNodes.length; i2++) {
|
|
1356
|
+
slotted = childNodes[i2]["s-nr"];
|
|
1357
|
+
nonRindoNode = rindoPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
1358
|
+
if (slotted) {
|
|
1359
|
+
if (BUILD12.appendChildSlotFix && clonedNode.__appendChild) {
|
|
1360
|
+
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
1361
|
+
} else {
|
|
1362
|
+
clonedNode.appendChild(slotted.cloneNode(true));
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
if (nonRindoNode) {
|
|
1366
|
+
clonedNode.appendChild(childNodes[i2].cloneNode(true));
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
}
|
|
1370
|
+
return clonedNode;
|
|
1371
|
+
};
|
|
1372
|
+
};
|
|
1373
|
+
var patchSlotAppendChild = (HostElementPrototype) => {
|
|
1374
|
+
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
1375
|
+
HostElementPrototype.appendChild = function(newChild) {
|
|
1376
|
+
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1377
|
+
const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
|
|
1378
|
+
if (slotNode) {
|
|
1379
|
+
addSlotRelocateNode(newChild, slotNode);
|
|
1380
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
1381
|
+
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
1382
|
+
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
1383
|
+
updateFallbackSlotVisibility(this);
|
|
1384
|
+
return insertedNode;
|
|
1385
|
+
}
|
|
1386
|
+
return this.__appendChild(newChild);
|
|
1387
|
+
};
|
|
1388
|
+
};
|
|
1389
|
+
var patchSlotRemoveChild = (ElementPrototype) => {
|
|
1390
|
+
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
1391
|
+
ElementPrototype.removeChild = function(toRemove) {
|
|
1392
|
+
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
1393
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1394
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
1395
|
+
if (slotNode && toRemove.isConnected) {
|
|
1396
|
+
toRemove.remove();
|
|
1397
|
+
updateFallbackSlotVisibility(this);
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
return this.__removeChild(toRemove);
|
|
1402
|
+
};
|
|
1403
|
+
};
|
|
1404
|
+
var patchSlotPrepend = (HostElementPrototype) => {
|
|
1405
|
+
HostElementPrototype.__prepend = HostElementPrototype.prepend;
|
|
1406
|
+
HostElementPrototype.prepend = function(...newChildren) {
|
|
1407
|
+
newChildren.forEach((newChild) => {
|
|
1408
|
+
if (typeof newChild === "string") {
|
|
1409
|
+
newChild = this.ownerDocument.createTextNode(newChild);
|
|
1410
|
+
}
|
|
1411
|
+
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1412
|
+
const childNodes = this.__childNodes || this.childNodes;
|
|
1413
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
|
|
1414
|
+
if (slotNode) {
|
|
1415
|
+
addSlotRelocateNode(newChild, slotNode, true);
|
|
1416
|
+
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
1417
|
+
const appendAfter = slotChildNodes[0];
|
|
1418
|
+
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
1419
|
+
}
|
|
1420
|
+
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
1421
|
+
newChild.hidden = true;
|
|
1422
|
+
}
|
|
1423
|
+
return HostElementPrototype.__prepend(newChild);
|
|
1424
|
+
});
|
|
1425
|
+
};
|
|
1426
|
+
};
|
|
1427
|
+
var patchSlotAppend = (HostElementPrototype) => {
|
|
1428
|
+
HostElementPrototype.__append = HostElementPrototype.append;
|
|
1429
|
+
HostElementPrototype.append = function(...newChildren) {
|
|
1430
|
+
newChildren.forEach((newChild) => {
|
|
1431
|
+
if (typeof newChild === "string") {
|
|
1432
|
+
newChild = this.ownerDocument.createTextNode(newChild);
|
|
1433
|
+
}
|
|
1434
|
+
this.appendChild(newChild);
|
|
1435
|
+
});
|
|
1436
|
+
};
|
|
1437
|
+
};
|
|
1438
|
+
var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
1439
|
+
const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
|
|
1440
|
+
HostElementPrototype.insertAdjacentHTML = function(position, text) {
|
|
1441
|
+
if (position !== "afterbegin" && position !== "beforeend") {
|
|
1442
|
+
return originalInsertAdjacentHtml.call(this, position, text);
|
|
1443
|
+
}
|
|
1444
|
+
const container = this.ownerDocument.createElement("_");
|
|
1445
|
+
let node;
|
|
1446
|
+
container.innerHTML = text;
|
|
1447
|
+
if (position === "afterbegin") {
|
|
1448
|
+
while (node = container.firstChild) {
|
|
1449
|
+
this.prepend(node);
|
|
1450
|
+
}
|
|
1451
|
+
} else if (position === "beforeend") {
|
|
1452
|
+
while (node = container.firstChild) {
|
|
1453
|
+
this.append(node);
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
};
|
|
1458
|
+
var patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
1459
|
+
HostElementPrototype.insertAdjacentText = function(position, text) {
|
|
1460
|
+
this.insertAdjacentHTML(position, text);
|
|
1461
|
+
};
|
|
1462
|
+
};
|
|
1463
|
+
var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
1464
|
+
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
1465
|
+
HostElementPrototype.insertAdjacentElement = function(position, element) {
|
|
1466
|
+
if (position !== "afterbegin" && position !== "beforeend") {
|
|
1467
|
+
return originalInsertAdjacentElement.call(this, position, element);
|
|
1468
|
+
}
|
|
1469
|
+
if (position === "afterbegin") {
|
|
1470
|
+
this.prepend(element);
|
|
1471
|
+
return element;
|
|
1472
|
+
} else if (position === "beforeend") {
|
|
1473
|
+
this.append(element);
|
|
1474
|
+
return element;
|
|
1475
|
+
}
|
|
1476
|
+
return element;
|
|
1477
|
+
};
|
|
1478
|
+
};
|
|
1479
|
+
var patchTextContent = (hostElementPrototype) => {
|
|
1480
|
+
patchHostOriginalAccessor("textContent", hostElementPrototype);
|
|
1481
|
+
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
1482
|
+
get: function() {
|
|
1483
|
+
let text = "";
|
|
1484
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
1485
|
+
childNodes.forEach((node) => text += node.textContent || "");
|
|
1486
|
+
return text;
|
|
1487
|
+
},
|
|
1488
|
+
set: function(value) {
|
|
1489
|
+
const childNodes = this.__childNodes ? this.childNodes : getSlottedChildNodes(this.childNodes);
|
|
1490
|
+
childNodes.forEach((node) => {
|
|
1491
|
+
if (node["s-ol"]) node["s-ol"].remove();
|
|
1492
|
+
node.remove();
|
|
1493
|
+
});
|
|
1494
|
+
this.insertAdjacentHTML("beforeend", value);
|
|
1495
|
+
}
|
|
1496
|
+
});
|
|
1497
|
+
};
|
|
1498
|
+
var patchChildSlotNodes = (elm) => {
|
|
1499
|
+
class FakeNodeList extends Array {
|
|
1500
|
+
item(n) {
|
|
1501
|
+
return this[n];
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
patchHostOriginalAccessor("children", elm);
|
|
1505
|
+
Object.defineProperty(elm, "children", {
|
|
1506
|
+
get() {
|
|
1507
|
+
return this.childNodes.filter((n) => n.nodeType === 1);
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
Object.defineProperty(elm, "childElementCount", {
|
|
1511
|
+
get() {
|
|
1512
|
+
return this.children.length;
|
|
1513
|
+
}
|
|
1514
|
+
});
|
|
1515
|
+
patchHostOriginalAccessor("firstChild", elm);
|
|
1516
|
+
Object.defineProperty(elm, "firstChild", {
|
|
1517
|
+
get() {
|
|
1518
|
+
return this.childNodes[0];
|
|
1519
|
+
}
|
|
1520
|
+
});
|
|
1521
|
+
patchHostOriginalAccessor("lastChild", elm);
|
|
1522
|
+
Object.defineProperty(elm, "lastChild", {
|
|
1523
|
+
get() {
|
|
1524
|
+
return this.childNodes[this.childNodes.length - 1];
|
|
1525
|
+
}
|
|
1526
|
+
});
|
|
1527
|
+
patchHostOriginalAccessor("childNodes", elm);
|
|
1528
|
+
Object.defineProperty(elm, "childNodes", {
|
|
1529
|
+
get() {
|
|
1530
|
+
var _a, _b;
|
|
1531
|
+
if (!plt.$flags$ || !((_a = getHostRef(this)) == null ? void 0 : _a.$flags$) || (plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && ((_b = getHostRef(this)) == null ? void 0 : _b.$flags$) & 2 /* hasRendered */) {
|
|
1532
|
+
const result = new FakeNodeList();
|
|
1533
|
+
const nodes = getSlottedChildNodes(this.__childNodes);
|
|
1534
|
+
result.push(...nodes);
|
|
1535
|
+
return result;
|
|
1536
|
+
}
|
|
1537
|
+
return FakeNodeList.from(this.__childNodes);
|
|
1538
|
+
}
|
|
1539
|
+
});
|
|
1540
|
+
};
|
|
1541
|
+
var patchNextPrev = (node) => {
|
|
1542
|
+
if (!node || node.__nextSibling || !globalThis.Node) return;
|
|
1543
|
+
patchNextSibling(node);
|
|
1544
|
+
patchPreviousSibling(node);
|
|
1545
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
1546
|
+
patchNextElementSibling(node);
|
|
1547
|
+
patchPreviousElementSibling(node);
|
|
1548
|
+
}
|
|
1549
|
+
};
|
|
1550
|
+
var patchNextSibling = (node) => {
|
|
1551
|
+
if (!node || node.__nextSibling) return;
|
|
1552
|
+
patchHostOriginalAccessor("nextSibling", node);
|
|
1553
|
+
Object.defineProperty(node, "nextSibling", {
|
|
1554
|
+
get: function() {
|
|
1555
|
+
var _a;
|
|
1556
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
1557
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1558
|
+
if (parentNodes && index > -1) {
|
|
1559
|
+
return parentNodes[index + 1];
|
|
1560
|
+
}
|
|
1561
|
+
return this.__nextSibling;
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
};
|
|
1565
|
+
var patchNextElementSibling = (element) => {
|
|
1566
|
+
if (!element || element.__nextElementSibling) return;
|
|
1567
|
+
patchHostOriginalAccessor("nextElementSibling", element);
|
|
1568
|
+
Object.defineProperty(element, "nextElementSibling", {
|
|
1569
|
+
get: function() {
|
|
1570
|
+
var _a;
|
|
1571
|
+
const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
1572
|
+
const index = parentEles == null ? void 0 : parentEles.indexOf(this);
|
|
1573
|
+
if (parentEles && index > -1) {
|
|
1574
|
+
return parentEles[index + 1];
|
|
1575
|
+
}
|
|
1576
|
+
return this.__nextElementSibling;
|
|
1577
|
+
}
|
|
1578
|
+
});
|
|
1579
|
+
};
|
|
1580
|
+
var patchPreviousSibling = (node) => {
|
|
1581
|
+
if (!node || node.__previousSibling) return;
|
|
1582
|
+
patchHostOriginalAccessor("previousSibling", node);
|
|
1583
|
+
Object.defineProperty(node, "previousSibling", {
|
|
1584
|
+
get: function() {
|
|
1585
|
+
var _a;
|
|
1586
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
1587
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1588
|
+
if (parentNodes && index > -1) {
|
|
1589
|
+
return parentNodes[index - 1];
|
|
1590
|
+
}
|
|
1591
|
+
return this.__previousSibling;
|
|
1592
|
+
}
|
|
1593
|
+
});
|
|
1594
|
+
};
|
|
1595
|
+
var patchPreviousElementSibling = (element) => {
|
|
1596
|
+
if (!element || element.__previousElementSibling) return;
|
|
1597
|
+
patchHostOriginalAccessor("previousElementSibling", element);
|
|
1598
|
+
Object.defineProperty(element, "previousElementSibling", {
|
|
1599
|
+
get: function() {
|
|
1600
|
+
var _a;
|
|
1601
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
1602
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1603
|
+
if (parentNodes && index > -1) {
|
|
1604
|
+
return parentNodes[index - 1];
|
|
1605
|
+
}
|
|
1606
|
+
return this.__previousElementSibling;
|
|
1607
|
+
}
|
|
1608
|
+
});
|
|
1609
|
+
};
|
|
1610
|
+
var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
|
|
1611
|
+
var validNodesPatches = [
|
|
1612
|
+
"childNodes",
|
|
1613
|
+
"firstChild",
|
|
1614
|
+
"lastChild",
|
|
1615
|
+
"nextSibling",
|
|
1616
|
+
"previousSibling",
|
|
1617
|
+
"textContent"
|
|
1618
|
+
];
|
|
1619
|
+
function patchHostOriginalAccessor(accessorName, node) {
|
|
1620
|
+
let accessor;
|
|
1621
|
+
if (validElementPatches.includes(accessorName)) {
|
|
1622
|
+
accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
|
|
1623
|
+
} else if (validNodesPatches.includes(accessorName)) {
|
|
1624
|
+
accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
|
|
1625
|
+
}
|
|
1626
|
+
if (!accessor) {
|
|
1627
|
+
accessor = Object.getOwnPropertyDescriptor(node, accessorName);
|
|
1628
|
+
}
|
|
1629
|
+
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
// src/runtime/profile.ts
|
|
1633
|
+
import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
|
|
1634
|
+
var i = 0;
|
|
1635
|
+
var createTime = (fnName, tagName = "") => {
|
|
1636
|
+
if (BUILD13.profile && performance.mark) {
|
|
1637
|
+
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
1638
|
+
performance.mark(key);
|
|
1639
|
+
return () => performance.measure(`[Rindo] ${fnName}() <${tagName}>`, key);
|
|
1640
|
+
} else {
|
|
1641
|
+
return () => {
|
|
1642
|
+
return;
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
};
|
|
1646
|
+
var uniqueTime = (key, measureText) => {
|
|
1647
|
+
if (BUILD13.profile && performance.mark) {
|
|
1648
|
+
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
1649
|
+
performance.mark(key);
|
|
1650
|
+
}
|
|
1651
|
+
return () => {
|
|
1652
|
+
if (performance.getEntriesByName(measureText, "measure").length === 0) {
|
|
1653
|
+
performance.measure(measureText, key);
|
|
1654
|
+
}
|
|
1655
|
+
};
|
|
1656
|
+
} else {
|
|
1657
|
+
return () => {
|
|
1658
|
+
return;
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
};
|
|
1662
|
+
var inspect = (ref) => {
|
|
1663
|
+
const hostRef = getHostRef(ref);
|
|
1664
|
+
if (!hostRef) {
|
|
1665
|
+
return void 0;
|
|
1666
|
+
}
|
|
1667
|
+
const flags = hostRef.$flags$;
|
|
1668
|
+
const hostElement = hostRef.$hostElement$;
|
|
1669
|
+
return {
|
|
1670
|
+
renderCount: hostRef.$renderCount$,
|
|
1671
|
+
flags: {
|
|
1672
|
+
hasRendered: !!(flags & 2 /* hasRendered */),
|
|
1673
|
+
hasConnected: !!(flags & 1 /* hasConnected */),
|
|
1674
|
+
isWaitingForChildren: !!(flags & 4 /* isWaitingForChildren */),
|
|
1675
|
+
isConstructingInstance: !!(flags & 8 /* isConstructingInstance */),
|
|
1676
|
+
isQueuedForUpdate: !!(flags & 16 /* isQueuedForUpdate */),
|
|
1677
|
+
hasInitializedComponent: !!(flags & 32 /* hasInitializedComponent */),
|
|
1678
|
+
hasLoadedComponent: !!(flags & 64 /* hasLoadedComponent */),
|
|
1679
|
+
isWatchReady: !!(flags & 128 /* isWatchReady */),
|
|
1680
|
+
isListenReady: !!(flags & 256 /* isListenReady */),
|
|
1681
|
+
needsRerender: !!(flags & 512 /* needsRerender */)
|
|
1682
|
+
},
|
|
1683
|
+
instanceValues: hostRef.$instanceValues$,
|
|
1684
|
+
ancestorComponent: hostRef.$ancestorComponent$,
|
|
1685
|
+
hostElement,
|
|
1686
|
+
lazyInstance: hostRef.$lazyInstance$,
|
|
1687
|
+
vnode: hostRef.$vnode$,
|
|
1688
|
+
modeName: hostRef.$modeName$,
|
|
1689
|
+
onReadyPromise: hostRef.$onReadyPromise$,
|
|
1690
|
+
onReadyResolve: hostRef.$onReadyResolve$,
|
|
1691
|
+
onInstancePromise: hostRef.$onInstancePromise$,
|
|
1692
|
+
onInstanceResolve: hostRef.$onInstanceResolve$,
|
|
1693
|
+
onRenderResolve: hostRef.$onRenderResolve$,
|
|
1694
|
+
queuedListeners: hostRef.$queuedListeners$,
|
|
1695
|
+
rmListeners: hostRef.$rmListeners$,
|
|
1696
|
+
["s-id"]: hostElement["s-id"],
|
|
1697
|
+
["s-cr"]: hostElement["s-cr"],
|
|
1698
|
+
["s-lr"]: hostElement["s-lr"],
|
|
1699
|
+
["s-p"]: hostElement["s-p"],
|
|
1700
|
+
["s-rc"]: hostElement["s-rc"],
|
|
1701
|
+
["s-sc"]: hostElement["s-sc"]
|
|
1702
|
+
};
|
|
1703
|
+
};
|
|
1704
|
+
var installDevTools = () => {
|
|
1705
|
+
if (BUILD13.devTools) {
|
|
1706
|
+
const rindo = win.rindo = win.rindo || {};
|
|
1707
|
+
const originalInspect = rindo.inspect;
|
|
1708
|
+
rindo.inspect = (ref) => {
|
|
1709
|
+
let result = inspect(ref);
|
|
1710
|
+
if (!result && typeof originalInspect === "function") {
|
|
1711
|
+
result = originalInspect(ref);
|
|
1712
|
+
}
|
|
1713
|
+
return result;
|
|
1714
|
+
};
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
// src/runtime/client-hydrate.ts
|
|
1719
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1720
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
1721
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
1722
|
+
const childRenderNodes = [];
|
|
1723
|
+
const slotNodes = [];
|
|
1724
|
+
const slottedNodes = [];
|
|
1725
|
+
const shadowRootNodes = BUILD14.shadowDom && shadowRoot ? [] : null;
|
|
1726
|
+
const vnode = newVNode(tagName, null);
|
|
1727
|
+
vnode.$elm$ = hostElm;
|
|
1728
|
+
let scopeId2;
|
|
1729
|
+
if (BUILD14.scoped) {
|
|
1730
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1731
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
1732
|
+
scopeId2 = hostElm["s-sc"];
|
|
1733
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
1734
|
+
} else if (hostElm["s-sc"]) {
|
|
1735
|
+
delete hostElm["s-sc"];
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
if (!plt.$orgLocNodes$) {
|
|
1739
|
+
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1740
|
+
}
|
|
1741
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
1742
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
1743
|
+
hostRef.$vnode$ = clientHydrate(
|
|
1744
|
+
vnode,
|
|
1745
|
+
childRenderNodes,
|
|
1746
|
+
slotNodes,
|
|
1747
|
+
shadowRootNodes,
|
|
1748
|
+
hostElm,
|
|
1749
|
+
hostElm,
|
|
1750
|
+
hostId,
|
|
1751
|
+
slottedNodes
|
|
1752
|
+
);
|
|
1753
|
+
let crIndex = 0;
|
|
1754
|
+
const crLength = childRenderNodes.length;
|
|
1755
|
+
let childRenderNode;
|
|
1756
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
1757
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
1758
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
1759
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
1760
|
+
const node = childRenderNode.$elm$;
|
|
1761
|
+
if (!shadowRoot) {
|
|
1762
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
1763
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
1764
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
1765
|
+
}
|
|
1766
|
+
}
|
|
1767
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
1768
|
+
if (childRenderNode.$children$) {
|
|
1769
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
1770
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
1771
|
+
childRenderNode.$children$.forEach((c) => {
|
|
1772
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
1773
|
+
});
|
|
1774
|
+
}
|
|
1775
|
+
} else {
|
|
1776
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1780
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1781
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
1782
|
+
}
|
|
1783
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
1784
|
+
if (!shadowRoot) {
|
|
1785
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
1786
|
+
}
|
|
1787
|
+
}
|
|
1788
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1789
|
+
}
|
|
1790
|
+
const hosts = [];
|
|
1791
|
+
const snLen = slottedNodes.length;
|
|
1792
|
+
let snIndex = 0;
|
|
1793
|
+
let slotGroup;
|
|
1794
|
+
let snGroupIdx;
|
|
1795
|
+
let snGroupLen;
|
|
1796
|
+
let slottedItem;
|
|
1797
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
1798
|
+
slotGroup = slottedNodes[snIndex];
|
|
1799
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
1800
|
+
snGroupLen = slotGroup.length;
|
|
1801
|
+
snGroupIdx = 0;
|
|
1802
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
1803
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
1804
|
+
if (!hosts[slottedItem.hostId]) {
|
|
1805
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
1806
|
+
}
|
|
1807
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
1808
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
1809
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1810
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
1811
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1812
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
1813
|
+
} else {
|
|
1814
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1815
|
+
}
|
|
1816
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1817
|
+
if (BUILD14.experimentalSlotFixes) {
|
|
1818
|
+
patchNextPrev(slottedItem.node);
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
1822
|
+
hostEle.appendChild(slottedItem.node);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
if (BUILD14.scoped && scopeId2 && slotNodes.length) {
|
|
1827
|
+
slotNodes.forEach((slot) => {
|
|
1828
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
if (BUILD14.shadowDom && shadowRoot) {
|
|
1832
|
+
let rnIdex = 0;
|
|
1833
|
+
const rnLen = shadowRootNodes.length;
|
|
1834
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
1835
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
1836
|
+
}
|
|
1837
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
1838
|
+
if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
|
|
1839
|
+
node.parentNode.removeChild(node);
|
|
1840
|
+
}
|
|
1841
|
+
});
|
|
1842
|
+
}
|
|
1843
|
+
hostRef.$hostElement$ = hostElm;
|
|
1844
|
+
endHydrate();
|
|
1845
|
+
};
|
|
1846
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
1847
|
+
let childNodeType;
|
|
1848
|
+
let childIdSplt;
|
|
1849
|
+
let childVNode;
|
|
1850
|
+
let i2;
|
|
1851
|
+
const scopeId2 = hostElm["s-sc"];
|
|
1852
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
1853
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
1854
|
+
if (childNodeType) {
|
|
1855
|
+
childIdSplt = childNodeType.split(".");
|
|
1856
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
1857
|
+
childVNode = createSimpleVNode({
|
|
1858
|
+
$flags$: 0,
|
|
1859
|
+
$hostId$: childIdSplt[0],
|
|
1860
|
+
$nodeId$: childIdSplt[1],
|
|
1861
|
+
$depth$: childIdSplt[2],
|
|
1862
|
+
$index$: childIdSplt[3],
|
|
1863
|
+
$tag$: node.tagName.toLowerCase(),
|
|
1864
|
+
$elm$: node,
|
|
1865
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
1866
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
1867
|
+
$attrs$: { class: node.className || "" }
|
|
1868
|
+
});
|
|
1869
|
+
childRenderNodes.push(childVNode);
|
|
1870
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
1871
|
+
if (!parentVNode.$children$) {
|
|
1872
|
+
parentVNode.$children$ = [];
|
|
1873
|
+
}
|
|
1874
|
+
if (BUILD14.scoped && scopeId2) {
|
|
1875
|
+
node["s-si"] = scopeId2;
|
|
1876
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
1877
|
+
}
|
|
1878
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
1879
|
+
if (typeof slotName === "string") {
|
|
1880
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
1881
|
+
addSlot(
|
|
1882
|
+
slotName,
|
|
1883
|
+
childIdSplt[2],
|
|
1884
|
+
childVNode,
|
|
1885
|
+
node,
|
|
1886
|
+
parentVNode,
|
|
1887
|
+
childRenderNodes,
|
|
1888
|
+
slotNodes,
|
|
1889
|
+
shadowRootNodes,
|
|
1890
|
+
slottedNodes
|
|
1891
|
+
);
|
|
1892
|
+
if (BUILD14.scoped && scopeId2) {
|
|
1893
|
+
node.classList.add(scopeId2);
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
1897
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
1898
|
+
}
|
|
1899
|
+
if (childVNode.$index$ !== void 0) {
|
|
1900
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1901
|
+
}
|
|
1902
|
+
parentVNode = childVNode;
|
|
1903
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1904
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1905
|
+
}
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
if (node.shadowRoot) {
|
|
1909
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
1910
|
+
clientHydrate(
|
|
1911
|
+
parentVNode,
|
|
1912
|
+
childRenderNodes,
|
|
1913
|
+
slotNodes,
|
|
1914
|
+
shadowRootNodes,
|
|
1915
|
+
hostElm,
|
|
1916
|
+
node.shadowRoot.childNodes[i2],
|
|
1917
|
+
hostId,
|
|
1918
|
+
slottedNodes
|
|
1919
|
+
);
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
1923
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
1924
|
+
clientHydrate(
|
|
1925
|
+
parentVNode,
|
|
1926
|
+
childRenderNodes,
|
|
1927
|
+
slotNodes,
|
|
1928
|
+
shadowRootNodes,
|
|
1929
|
+
hostElm,
|
|
1930
|
+
nonShadowNodes[i2],
|
|
1931
|
+
hostId,
|
|
1932
|
+
slottedNodes
|
|
1933
|
+
);
|
|
1934
|
+
}
|
|
1935
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
1936
|
+
childIdSplt = node.nodeValue.split(".");
|
|
1937
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
1938
|
+
childNodeType = childIdSplt[0];
|
|
1939
|
+
childVNode = createSimpleVNode({
|
|
1940
|
+
$hostId$: childIdSplt[1],
|
|
1941
|
+
$nodeId$: childIdSplt[2],
|
|
1942
|
+
$depth$: childIdSplt[3],
|
|
1943
|
+
$index$: childIdSplt[4] || "0",
|
|
1944
|
+
$elm$: node,
|
|
1945
|
+
$attrs$: null,
|
|
1946
|
+
$children$: null,
|
|
1947
|
+
$key$: null,
|
|
1948
|
+
$name$: null,
|
|
1949
|
+
$tag$: null,
|
|
1950
|
+
$text$: null
|
|
1951
|
+
});
|
|
1952
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
1953
|
+
childVNode.$elm$ = node.nextSibling;
|
|
1954
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
1955
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
1956
|
+
childRenderNodes.push(childVNode);
|
|
1957
|
+
node.remove();
|
|
1958
|
+
if (hostId === childVNode.$hostId$) {
|
|
1959
|
+
if (!parentVNode.$children$) {
|
|
1960
|
+
parentVNode.$children$ = [];
|
|
1961
|
+
}
|
|
1962
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1963
|
+
}
|
|
1964
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1965
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1966
|
+
}
|
|
1967
|
+
}
|
|
1968
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
1969
|
+
childVNode.$elm$ = node.nextSibling;
|
|
1970
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
1971
|
+
childRenderNodes.push(childVNode);
|
|
1972
|
+
node.remove();
|
|
1973
|
+
}
|
|
1974
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
1975
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
1976
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
1977
|
+
addSlot(
|
|
1978
|
+
slotName,
|
|
1979
|
+
childIdSplt[2],
|
|
1980
|
+
childVNode,
|
|
1981
|
+
node,
|
|
1982
|
+
parentVNode,
|
|
1983
|
+
childRenderNodes,
|
|
1984
|
+
slotNodes,
|
|
1985
|
+
shadowRootNodes,
|
|
1986
|
+
slottedNodes
|
|
1987
|
+
);
|
|
1988
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1989
|
+
if (BUILD14.shadowDom && shadowRootNodes) {
|
|
1990
|
+
node.remove();
|
|
1991
|
+
} else if (BUILD14.slotRelocation) {
|
|
1992
|
+
hostElm["s-cr"] = node;
|
|
1993
|
+
node["s-cn"] = true;
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
1999
|
+
const vnode = newVNode(null, node.textContent);
|
|
2000
|
+
vnode.$elm$ = node;
|
|
2001
|
+
vnode.$index$ = "0";
|
|
2002
|
+
parentVNode.$children$ = [vnode];
|
|
2003
|
+
}
|
|
2004
|
+
return parentVNode;
|
|
2005
|
+
};
|
|
2006
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
2007
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
2008
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
2009
|
+
if (componentId) {
|
|
2010
|
+
orgLocNodes.set(componentId, node);
|
|
2011
|
+
}
|
|
2012
|
+
let i2 = 0;
|
|
2013
|
+
if (node.shadowRoot) {
|
|
2014
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
2015
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
2016
|
+
}
|
|
2017
|
+
}
|
|
2018
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
2019
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
2020
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
2021
|
+
}
|
|
2022
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
2023
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
2024
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
2025
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
2026
|
+
node.nodeValue = "";
|
|
2027
|
+
node["s-en"] = childIdSplt[3];
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
var createSimpleVNode = (vnode) => {
|
|
2032
|
+
const defaultVNode = {
|
|
2033
|
+
$flags$: 0,
|
|
2034
|
+
$hostId$: null,
|
|
2035
|
+
$nodeId$: null,
|
|
2036
|
+
$depth$: null,
|
|
2037
|
+
$index$: "0",
|
|
2038
|
+
$elm$: null,
|
|
2039
|
+
$attrs$: null,
|
|
2040
|
+
$children$: null,
|
|
2041
|
+
$key$: null,
|
|
2042
|
+
$name$: null,
|
|
2043
|
+
$tag$: null,
|
|
2044
|
+
$text$: null
|
|
2045
|
+
};
|
|
2046
|
+
return { ...defaultVNode, ...vnode };
|
|
2047
|
+
};
|
|
2048
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
2049
|
+
node["s-sr"] = true;
|
|
2050
|
+
childVNode.$name$ = slotName || null;
|
|
2051
|
+
childVNode.$tag$ = "slot";
|
|
2052
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
2053
|
+
if (BUILD14.shadowDom && shadowRootNodes) {
|
|
2054
|
+
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
2055
|
+
if (childVNode.$name$) {
|
|
2056
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
2057
|
+
}
|
|
2058
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
2059
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
2060
|
+
} else {
|
|
2061
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
2062
|
+
}
|
|
2063
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
2064
|
+
node.remove();
|
|
2065
|
+
if (childVNode.$depth$ === "0") {
|
|
2066
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
2067
|
+
}
|
|
2068
|
+
} else {
|
|
2069
|
+
const slot = childVNode.$elm$;
|
|
2070
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
2071
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
2072
|
+
if (shouldMove) {
|
|
2073
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
2074
|
+
}
|
|
2075
|
+
childRenderNodes.push(childVNode);
|
|
2076
|
+
}
|
|
2077
|
+
slotNodes.push(childVNode);
|
|
2078
|
+
if (!parentVNode.$children$) {
|
|
2079
|
+
parentVNode.$children$ = [];
|
|
2080
|
+
}
|
|
2081
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
2082
|
+
}
|
|
2083
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
2084
|
+
let slottedNode = slotNode.nextSibling;
|
|
2085
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
2086
|
+
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 */))) {
|
|
2087
|
+
slottedNode["s-sn"] = slotName;
|
|
2088
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
2089
|
+
slottedNode = slottedNode.nextSibling;
|
|
2090
|
+
}
|
|
2091
|
+
};
|
|
2092
|
+
|
|
2093
|
+
// src/runtime/initialize-component.ts
|
|
2094
|
+
import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
|
|
2095
|
+
|
|
2096
|
+
// src/runtime/mode.ts
|
|
2097
|
+
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
2098
|
+
var setMode = (handler) => modeResolutionChain.push(handler);
|
|
2099
|
+
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
2100
|
+
|
|
2101
|
+
// src/runtime/proxy-component.ts
|
|
2102
|
+
import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
|
|
2103
|
+
|
|
2104
|
+
// src/runtime/set-value.ts
|
|
2105
|
+
import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
|
|
2106
|
+
|
|
2107
|
+
// src/runtime/parse-property-value.ts
|
|
2108
|
+
import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
|
|
2109
|
+
var parsePropertyValue = (propValue, propType) => {
|
|
2110
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
2111
|
+
if (BUILD15.propBoolean && propType & 4 /* Boolean */) {
|
|
2112
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
2113
|
+
}
|
|
2114
|
+
if (BUILD15.propNumber && propType & 2 /* Number */) {
|
|
2115
|
+
return parseFloat(propValue);
|
|
2116
|
+
}
|
|
2117
|
+
if (BUILD15.propString && propType & 1 /* String */) {
|
|
2118
|
+
return String(propValue);
|
|
2119
|
+
}
|
|
2120
|
+
return propValue;
|
|
2121
|
+
}
|
|
2122
|
+
return propValue;
|
|
2123
|
+
};
|
|
2124
|
+
|
|
2125
|
+
// src/runtime/update-component.ts
|
|
2126
|
+
import { BUILD as BUILD19, NAMESPACE } from "@rindo/core/internal/app-data";
|
|
2127
|
+
|
|
2128
|
+
// src/runtime/event-emitter.ts
|
|
2129
|
+
import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
|
|
2130
|
+
|
|
2131
|
+
// src/runtime/element.ts
|
|
2132
|
+
import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
|
|
2133
|
+
var getElement = (ref) => BUILD16.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
2134
|
+
|
|
2135
|
+
// src/runtime/event-emitter.ts
|
|
2136
|
+
var createEvent = (ref, name, flags) => {
|
|
2137
|
+
const elm = getElement(ref);
|
|
2138
|
+
return {
|
|
2139
|
+
emit: (detail) => {
|
|
2140
|
+
if (BUILD17.isDev && !elm.isConnected) {
|
|
2141
|
+
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
2142
|
+
}
|
|
2143
|
+
return emitEvent(elm, name, {
|
|
2144
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
2145
|
+
composed: !!(flags & 2 /* Composed */),
|
|
2146
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
2147
|
+
detail
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
};
|
|
2151
|
+
};
|
|
2152
|
+
var emitEvent = (elm, name, opts) => {
|
|
2153
|
+
const ev = plt.ce(name, opts);
|
|
2154
|
+
elm.dispatchEvent(ev);
|
|
2155
|
+
return ev;
|
|
2156
|
+
};
|
|
2157
|
+
|
|
2158
|
+
// src/runtime/styles.ts
|
|
2159
|
+
import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
|
|
2160
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2161
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2162
|
+
let style = styles.get(scopeId2);
|
|
2163
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
2164
|
+
style = style || new CSSStyleSheet();
|
|
2165
|
+
if (typeof style === "string") {
|
|
2166
|
+
style = cssText;
|
|
2167
|
+
} else {
|
|
2168
|
+
style.replaceSync(cssText);
|
|
2169
|
+
}
|
|
2170
|
+
} else {
|
|
2171
|
+
style = cssText;
|
|
2172
|
+
}
|
|
2173
|
+
styles.set(scopeId2, style);
|
|
2174
|
+
};
|
|
2175
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
2176
|
+
var _a;
|
|
2177
|
+
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
2178
|
+
const style = styles.get(scopeId2);
|
|
2179
|
+
if (!BUILD18.attachStyles) {
|
|
2180
|
+
return scopeId2;
|
|
2181
|
+
}
|
|
2182
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
2183
|
+
if (style) {
|
|
2184
|
+
if (typeof style === "string") {
|
|
2185
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
2186
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
2187
|
+
let styleElm;
|
|
2188
|
+
if (!appliedStyles) {
|
|
2189
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2190
|
+
}
|
|
2191
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
2192
|
+
if (BUILD18.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2193
|
+
styleElm.innerHTML = style;
|
|
2194
|
+
} else {
|
|
2195
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
2196
|
+
styleElm.innerHTML = style;
|
|
2197
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
2198
|
+
if (nonce != null) {
|
|
2199
|
+
styleElm.setAttribute("nonce", nonce);
|
|
2200
|
+
}
|
|
2201
|
+
if ((BUILD18.hydrateServerSide || BUILD18.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2202
|
+
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2203
|
+
}
|
|
2204
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
2205
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
2206
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
2207
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
2208
|
+
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
2209
|
+
} else if ("host" in styleContainerNode) {
|
|
2210
|
+
if (supportsConstructableStylesheets) {
|
|
2211
|
+
const stylesheet = new CSSStyleSheet();
|
|
2212
|
+
stylesheet.replaceSync(style);
|
|
2213
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
2214
|
+
} else {
|
|
2215
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
2216
|
+
if (existingStyleContainer) {
|
|
2217
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
2218
|
+
} else {
|
|
2219
|
+
styleContainerNode.prepend(styleElm);
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
} else {
|
|
2223
|
+
styleContainerNode.append(styleElm);
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
2227
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
2228
|
+
}
|
|
2229
|
+
}
|
|
2230
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2231
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
2232
|
+
}
|
|
2233
|
+
if (appliedStyles) {
|
|
2234
|
+
appliedStyles.add(scopeId2);
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
} else if (BUILD18.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2238
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2239
|
+
}
|
|
1639
2240
|
}
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
2241
|
+
return scopeId2;
|
|
2242
|
+
};
|
|
2243
|
+
var attachStyles = (hostRef) => {
|
|
2244
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
2245
|
+
const elm = hostRef.$hostElement$;
|
|
2246
|
+
const flags = cmpMeta.$flags$;
|
|
2247
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2248
|
+
const scopeId2 = addStyle(
|
|
2249
|
+
BUILD18.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2250
|
+
cmpMeta,
|
|
2251
|
+
hostRef.$modeName$
|
|
2252
|
+
);
|
|
2253
|
+
if ((BUILD18.shadowDom || BUILD18.scoped) && BUILD18.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
2254
|
+
elm["s-sc"] = scopeId2;
|
|
2255
|
+
elm.classList.add(scopeId2 + "-h");
|
|
1649
2256
|
}
|
|
1650
|
-
|
|
2257
|
+
endAttachStyles();
|
|
1651
2258
|
};
|
|
1652
|
-
var
|
|
1653
|
-
`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
|
|
1654
|
-
);
|
|
1655
|
-
var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
|
|
1656
|
-
`org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
|
|
1657
|
-
);
|
|
2259
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD18.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
1658
2260
|
|
|
1659
2261
|
// src/runtime/update-component.ts
|
|
1660
2262
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1661
|
-
if (
|
|
2263
|
+
if (BUILD19.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1662
2264
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
1663
2265
|
}
|
|
1664
2266
|
};
|
|
1665
2267
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
1666
|
-
if (
|
|
2268
|
+
if (BUILD19.taskQueue && BUILD19.updatable) {
|
|
1667
2269
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
1668
2270
|
}
|
|
1669
|
-
if (
|
|
2271
|
+
if (BUILD19.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
1670
2272
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
1671
2273
|
return;
|
|
1672
2274
|
}
|
|
1673
2275
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
1674
2276
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
1675
|
-
return
|
|
2277
|
+
return BUILD19.taskQueue ? writeTask(dispatch) : dispatch();
|
|
1676
2278
|
};
|
|
1677
2279
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
1678
2280
|
const elm = hostRef.$hostElement$;
|
|
1679
2281
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
1680
|
-
const instance =
|
|
2282
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1681
2283
|
if (!instance) {
|
|
1682
2284
|
throw new Error(
|
|
1683
2285
|
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Rindo runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://rindojs.web.app/docs/custom-elements#externalruntime`
|
|
@@ -1685,7 +2287,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1685
2287
|
}
|
|
1686
2288
|
let maybePromise;
|
|
1687
2289
|
if (isInitialLoad) {
|
|
1688
|
-
if (
|
|
2290
|
+
if (BUILD19.lazyLoad && BUILD19.hostListener) {
|
|
1689
2291
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
1690
2292
|
if (hostRef.$queuedListeners$) {
|
|
1691
2293
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -1693,17 +2295,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
1693
2295
|
}
|
|
1694
2296
|
}
|
|
1695
2297
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
1696
|
-
if (
|
|
2298
|
+
if (BUILD19.cmpWillLoad) {
|
|
1697
2299
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
1698
2300
|
}
|
|
1699
2301
|
} else {
|
|
1700
2302
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
1701
|
-
if (
|
|
2303
|
+
if (BUILD19.cmpWillUpdate) {
|
|
1702
2304
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
1703
2305
|
}
|
|
1704
2306
|
}
|
|
1705
2307
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
1706
|
-
if (
|
|
2308
|
+
if (BUILD19.cmpWillRender) {
|
|
1707
2309
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
1708
2310
|
}
|
|
1709
2311
|
endSchedule();
|
|
@@ -1719,23 +2321,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1719
2321
|
const elm = hostRef.$hostElement$;
|
|
1720
2322
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
1721
2323
|
const rc = elm["s-rc"];
|
|
1722
|
-
if (
|
|
2324
|
+
if (BUILD19.style && isInitialLoad) {
|
|
1723
2325
|
attachStyles(hostRef);
|
|
1724
2326
|
}
|
|
1725
2327
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
1726
|
-
if (
|
|
2328
|
+
if (BUILD19.isDev) {
|
|
1727
2329
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1728
2330
|
}
|
|
1729
|
-
if (
|
|
2331
|
+
if (BUILD19.hydrateServerSide) {
|
|
1730
2332
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
1731
2333
|
} else {
|
|
1732
2334
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1733
2335
|
}
|
|
1734
|
-
if (
|
|
2336
|
+
if (BUILD19.isDev) {
|
|
1735
2337
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
1736
2338
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1737
2339
|
}
|
|
1738
|
-
if (
|
|
2340
|
+
if (BUILD19.hydrateServerSide) {
|
|
1739
2341
|
try {
|
|
1740
2342
|
serverSideConnected(elm);
|
|
1741
2343
|
if (isInitialLoad) {
|
|
@@ -1749,13 +2351,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1749
2351
|
consoleError(e, elm);
|
|
1750
2352
|
}
|
|
1751
2353
|
}
|
|
1752
|
-
if (
|
|
2354
|
+
if (BUILD19.asyncLoading && rc) {
|
|
1753
2355
|
rc.map((cb) => cb());
|
|
1754
2356
|
elm["s-rc"] = void 0;
|
|
1755
2357
|
}
|
|
1756
2358
|
endRender();
|
|
1757
2359
|
endUpdate();
|
|
1758
|
-
if (
|
|
2360
|
+
if (BUILD19.asyncLoading) {
|
|
1759
2361
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
1760
2362
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1761
2363
|
if (childrenPromises.length === 0) {
|
|
@@ -1771,10 +2373,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
1771
2373
|
};
|
|
1772
2374
|
var renderingRef = null;
|
|
1773
2375
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1774
|
-
const allRenderFn =
|
|
1775
|
-
const lazyLoad =
|
|
1776
|
-
const taskQueue =
|
|
1777
|
-
const updatable =
|
|
2376
|
+
const allRenderFn = BUILD19.allRenderFn ? true : false;
|
|
2377
|
+
const lazyLoad = BUILD19.lazyLoad ? true : false;
|
|
2378
|
+
const taskQueue = BUILD19.taskQueue ? true : false;
|
|
2379
|
+
const updatable = BUILD19.updatable ? true : false;
|
|
1778
2380
|
try {
|
|
1779
2381
|
renderingRef = instance;
|
|
1780
2382
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -1784,9 +2386,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1784
2386
|
if (updatable || lazyLoad) {
|
|
1785
2387
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1786
2388
|
}
|
|
1787
|
-
if (
|
|
1788
|
-
if (
|
|
1789
|
-
if (
|
|
2389
|
+
if (BUILD19.hasRenderFn || BUILD19.reflect) {
|
|
2390
|
+
if (BUILD19.vdomRender || BUILD19.reflect) {
|
|
2391
|
+
if (BUILD19.hydrateServerSide) {
|
|
1790
2392
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
1791
2393
|
} else {
|
|
1792
2394
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -1811,57 +2413,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1811
2413
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1812
2414
|
const elm = hostRef.$hostElement$;
|
|
1813
2415
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1814
|
-
const instance =
|
|
2416
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1815
2417
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1816
|
-
if (
|
|
1817
|
-
if (
|
|
2418
|
+
if (BUILD19.cmpDidRender) {
|
|
2419
|
+
if (BUILD19.isDev) {
|
|
1818
2420
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1819
2421
|
}
|
|
1820
2422
|
safeCall(instance, "componentDidRender");
|
|
1821
|
-
if (
|
|
2423
|
+
if (BUILD19.isDev) {
|
|
1822
2424
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1823
2425
|
}
|
|
1824
2426
|
}
|
|
1825
2427
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
1826
2428
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1827
2429
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1828
|
-
if (
|
|
2430
|
+
if (BUILD19.asyncLoading && BUILD19.cssAnnotations) {
|
|
1829
2431
|
addHydratedFlag(elm);
|
|
1830
2432
|
}
|
|
1831
|
-
if (
|
|
1832
|
-
if (
|
|
2433
|
+
if (BUILD19.cmpDidLoad) {
|
|
2434
|
+
if (BUILD19.isDev) {
|
|
1833
2435
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
1834
2436
|
}
|
|
1835
2437
|
safeCall(instance, "componentDidLoad");
|
|
1836
|
-
if (
|
|
2438
|
+
if (BUILD19.isDev) {
|
|
1837
2439
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
1838
2440
|
}
|
|
1839
2441
|
}
|
|
1840
2442
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
1841
2443
|
endPostUpdate();
|
|
1842
|
-
if (
|
|
2444
|
+
if (BUILD19.asyncLoading) {
|
|
1843
2445
|
hostRef.$onReadyResolve$(elm);
|
|
1844
2446
|
if (!ancestorComponent) {
|
|
1845
2447
|
appDidLoad(tagName);
|
|
1846
2448
|
}
|
|
1847
2449
|
}
|
|
1848
2450
|
} else {
|
|
1849
|
-
if (
|
|
1850
|
-
if (
|
|
2451
|
+
if (BUILD19.cmpDidUpdate) {
|
|
2452
|
+
if (BUILD19.isDev) {
|
|
1851
2453
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
1852
2454
|
}
|
|
1853
2455
|
safeCall(instance, "componentDidUpdate");
|
|
1854
|
-
if (
|
|
2456
|
+
if (BUILD19.isDev) {
|
|
1855
2457
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
1856
2458
|
}
|
|
1857
2459
|
}
|
|
1858
2460
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
1859
2461
|
endPostUpdate();
|
|
1860
2462
|
}
|
|
1861
|
-
if (
|
|
2463
|
+
if (BUILD19.method && BUILD19.lazyLoad) {
|
|
1862
2464
|
hostRef.$onInstanceResolve$(elm);
|
|
1863
2465
|
}
|
|
1864
|
-
if (
|
|
2466
|
+
if (BUILD19.asyncLoading) {
|
|
1865
2467
|
if (hostRef.$onRenderResolve$) {
|
|
1866
2468
|
hostRef.$onRenderResolve$();
|
|
1867
2469
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -1873,7 +2475,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1873
2475
|
}
|
|
1874
2476
|
};
|
|
1875
2477
|
var forceUpdate = (ref) => {
|
|
1876
|
-
if (
|
|
2478
|
+
if (BUILD19.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
1877
2479
|
const hostRef = getHostRef(ref);
|
|
1878
2480
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
1879
2481
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -1884,14 +2486,14 @@ var forceUpdate = (ref) => {
|
|
|
1884
2486
|
return false;
|
|
1885
2487
|
};
|
|
1886
2488
|
var appDidLoad = (who) => {
|
|
1887
|
-
if (
|
|
2489
|
+
if (BUILD19.cssAnnotations) {
|
|
1888
2490
|
addHydratedFlag(doc.documentElement);
|
|
1889
2491
|
}
|
|
1890
|
-
if (
|
|
2492
|
+
if (BUILD19.asyncQueue) {
|
|
1891
2493
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
1892
2494
|
}
|
|
1893
2495
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1894
|
-
if (
|
|
2496
|
+
if (BUILD19.profile && performance.measure) {
|
|
1895
2497
|
performance.measure(`[Rindo] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
1896
2498
|
}
|
|
1897
2499
|
};
|
|
@@ -1906,7 +2508,7 @@ var safeCall = (instance, method, arg) => {
|
|
|
1906
2508
|
return void 0;
|
|
1907
2509
|
};
|
|
1908
2510
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
1909
|
-
if (
|
|
2511
|
+
if (BUILD19.lifecycleDOMEvents) {
|
|
1910
2512
|
emitEvent(elm, "rindo_" + lifecycleName, {
|
|
1911
2513
|
bubbles: true,
|
|
1912
2514
|
composed: true,
|
|
@@ -1918,7 +2520,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
1918
2520
|
};
|
|
1919
2521
|
var addHydratedFlag = (elm) => {
|
|
1920
2522
|
var _a, _b;
|
|
1921
|
-
return
|
|
2523
|
+
return BUILD19.hydratedClass ? elm.classList.add((_a = BUILD19.hydratedSelectorName) != null ? _a : "hydrated") : BUILD19.hydratedAttribute ? elm.setAttribute((_b = BUILD19.hydratedSelectorName) != null ? _b : "hydrated", "") : void 0;
|
|
1922
2524
|
};
|
|
1923
2525
|
var serverSideConnected = (elm) => {
|
|
1924
2526
|
const children = elm.children;
|
|
@@ -1937,21 +2539,21 @@ var serverSideConnected = (elm) => {
|
|
|
1937
2539
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1938
2540
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1939
2541
|
const hostRef = getHostRef(ref);
|
|
1940
|
-
if (
|
|
2542
|
+
if (BUILD20.lazyLoad && !hostRef) {
|
|
1941
2543
|
throw new Error(
|
|
1942
2544
|
`Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Rindo runtime. This usually happens when integrating a 3rd party Rindo component with another Rindo component or application.`
|
|
1943
2545
|
);
|
|
1944
2546
|
}
|
|
1945
|
-
const elm =
|
|
2547
|
+
const elm = BUILD20.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
1946
2548
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1947
2549
|
const flags = hostRef.$flags$;
|
|
1948
|
-
const instance =
|
|
2550
|
+
const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
1949
2551
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
1950
2552
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1951
2553
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1952
|
-
if ((!
|
|
2554
|
+
if ((!BUILD20.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
1953
2555
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
1954
|
-
if (
|
|
2556
|
+
if (BUILD20.isDev) {
|
|
1955
2557
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
1956
2558
|
consoleDevWarn(
|
|
1957
2559
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -1974,8 +2576,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1974
2576
|
);
|
|
1975
2577
|
}
|
|
1976
2578
|
}
|
|
1977
|
-
if (!
|
|
1978
|
-
if (
|
|
2579
|
+
if (!BUILD20.lazyLoad || instance) {
|
|
2580
|
+
if (BUILD20.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
1979
2581
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1980
2582
|
if (watchMethods) {
|
|
1981
2583
|
watchMethods.map((watchMethodName) => {
|
|
@@ -1987,8 +2589,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
1987
2589
|
});
|
|
1988
2590
|
}
|
|
1989
2591
|
}
|
|
1990
|
-
if (
|
|
1991
|
-
if (
|
|
2592
|
+
if (BUILD20.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2593
|
+
if (BUILD20.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
1992
2594
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
1993
2595
|
return;
|
|
1994
2596
|
}
|
|
@@ -2003,59 +2605,105 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2003
2605
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2004
2606
|
var _a, _b;
|
|
2005
2607
|
const prototype = Cstr.prototype;
|
|
2006
|
-
if (
|
|
2608
|
+
if (BUILD21.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2007
2609
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2008
2610
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2009
2611
|
Object.defineProperty(prototype, cbName, {
|
|
2010
2612
|
value(...args) {
|
|
2011
2613
|
const hostRef = getHostRef(this);
|
|
2012
|
-
const instance =
|
|
2614
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2013
2615
|
if (!instance) {
|
|
2014
2616
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2015
2617
|
const cb = asyncInstance[cbName];
|
|
2016
2618
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2017
2619
|
});
|
|
2018
2620
|
} else {
|
|
2019
|
-
const cb =
|
|
2621
|
+
const cb = BUILD21.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2020
2622
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2021
2623
|
}
|
|
2022
2624
|
}
|
|
2023
2625
|
});
|
|
2024
2626
|
});
|
|
2025
2627
|
}
|
|
2026
|
-
if (
|
|
2027
|
-
if (
|
|
2628
|
+
if (BUILD21.member && cmpMeta.$members$ || BUILD21.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2629
|
+
if (BUILD21.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2028
2630
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2029
2631
|
}
|
|
2030
2632
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2031
2633
|
members.map(([memberName, [memberFlags]]) => {
|
|
2032
|
-
if ((
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2634
|
+
if ((BUILD21.prop || BUILD21.state) && (memberFlags & 31 /* Prop */ || (!BUILD21.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2635
|
+
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2636
|
+
Object.defineProperty(prototype, memberName, {
|
|
2637
|
+
get() {
|
|
2638
|
+
return getValue(this, memberName);
|
|
2639
|
+
},
|
|
2640
|
+
set(newValue) {
|
|
2641
|
+
if (BUILD21.isDev) {
|
|
2642
|
+
const ref = getHostRef(this);
|
|
2643
|
+
if (
|
|
2644
|
+
// we are proxying the instance (not element)
|
|
2645
|
+
(flags & 1 /* isElementConstructor */) === 0 && // the element is not constructing
|
|
2646
|
+
(ref && ref.$flags$ & 8 /* isConstructingInstance */) === 0 && // the member is a prop
|
|
2647
|
+
(memberFlags & 31 /* Prop */) !== 0 && // the member is not mutable
|
|
2648
|
+
(memberFlags & 1024 /* Mutable */) === 0
|
|
2649
|
+
) {
|
|
2650
|
+
consoleDevWarn(
|
|
2651
|
+
`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.
|
|
2049
2652
|
More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
2050
|
-
|
|
2653
|
+
);
|
|
2654
|
+
}
|
|
2051
2655
|
}
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
})
|
|
2058
|
-
|
|
2656
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
2657
|
+
},
|
|
2658
|
+
configurable: true,
|
|
2659
|
+
enumerable: true
|
|
2660
|
+
});
|
|
2661
|
+
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2662
|
+
if (BUILD21.lazyLoad) {
|
|
2663
|
+
Object.defineProperty(prototype, memberName, {
|
|
2664
|
+
get() {
|
|
2665
|
+
const ref = getHostRef(this);
|
|
2666
|
+
const instance = BUILD21.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2667
|
+
if (!instance) return;
|
|
2668
|
+
return instance[memberName];
|
|
2669
|
+
},
|
|
2670
|
+
configurable: true,
|
|
2671
|
+
enumerable: true
|
|
2672
|
+
});
|
|
2673
|
+
}
|
|
2674
|
+
if (memberFlags & 4096 /* Setter */) {
|
|
2675
|
+
const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
|
|
2676
|
+
Object.defineProperty(prototype, memberName, {
|
|
2677
|
+
set(newValue) {
|
|
2678
|
+
const ref = getHostRef(this);
|
|
2679
|
+
if (origSetter) {
|
|
2680
|
+
const currentValue = ref.$hostElement$[memberName];
|
|
2681
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2682
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2683
|
+
}
|
|
2684
|
+
origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
|
|
2685
|
+
setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
|
|
2686
|
+
return;
|
|
2687
|
+
}
|
|
2688
|
+
if (!ref) return;
|
|
2689
|
+
const setterSetVal = () => {
|
|
2690
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
2691
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
2692
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
2693
|
+
}
|
|
2694
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
|
|
2695
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
2696
|
+
};
|
|
2697
|
+
if (ref.$lazyInstance$) {
|
|
2698
|
+
setterSetVal();
|
|
2699
|
+
} else {
|
|
2700
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
2701
|
+
}
|
|
2702
|
+
}
|
|
2703
|
+
});
|
|
2704
|
+
}
|
|
2705
|
+
}
|
|
2706
|
+
} else if (BUILD21.lazyLoad && BUILD21.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2059
2707
|
Object.defineProperty(prototype, memberName, {
|
|
2060
2708
|
value(...args) {
|
|
2061
2709
|
var _a2;
|
|
@@ -2068,13 +2716,13 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2068
2716
|
});
|
|
2069
2717
|
}
|
|
2070
2718
|
});
|
|
2071
|
-
if (
|
|
2719
|
+
if (BUILD21.observeAttribute && (!BUILD21.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2072
2720
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2073
2721
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2074
2722
|
plt.jmp(() => {
|
|
2075
2723
|
var _a2;
|
|
2076
2724
|
const propName = attrNameToPropName.get(attrName);
|
|
2077
|
-
if (this.hasOwnProperty(propName)) {
|
|
2725
|
+
if (this.hasOwnProperty(propName) && BUILD21.lazyLoad) {
|
|
2078
2726
|
newValue = this[propName];
|
|
2079
2727
|
delete this[propName];
|
|
2080
2728
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -2084,8 +2732,8 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2084
2732
|
const hostRef = getHostRef(this);
|
|
2085
2733
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2086
2734
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2087
|
-
const elm =
|
|
2088
|
-
const instance =
|
|
2735
|
+
const elm = BUILD21.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2736
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2089
2737
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2090
2738
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2091
2739
|
if (instance[callbackName] != null) {
|
|
@@ -2095,7 +2743,10 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2095
2743
|
}
|
|
2096
2744
|
return;
|
|
2097
2745
|
}
|
|
2098
|
-
|
|
2746
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
2747
|
+
if (!propDesc.get || !!propDesc.set) {
|
|
2748
|
+
this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
2749
|
+
}
|
|
2099
2750
|
});
|
|
2100
2751
|
};
|
|
2101
2752
|
Cstr.observedAttributes = Array.from(
|
|
@@ -2105,7 +2756,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2105
2756
|
var _a2;
|
|
2106
2757
|
const attrName = m[1] || propName;
|
|
2107
2758
|
attrNameToPropName.set(attrName, propName);
|
|
2108
|
-
if (
|
|
2759
|
+
if (BUILD21.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2109
2760
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2110
2761
|
}
|
|
2111
2762
|
return attrName;
|
|
@@ -2123,7 +2774,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2123
2774
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2124
2775
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2125
2776
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2126
|
-
if ((
|
|
2777
|
+
if ((BUILD22.lazyLoad || BUILD22.hydrateClientSide) && bundleId) {
|
|
2127
2778
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2128
2779
|
if (CstrImport && "then" in CstrImport) {
|
|
2129
2780
|
const endLoad = uniqueTime(
|
|
@@ -2138,15 +2789,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2138
2789
|
if (!Cstr) {
|
|
2139
2790
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2140
2791
|
}
|
|
2141
|
-
if (
|
|
2142
|
-
if (
|
|
2792
|
+
if (BUILD22.member && !Cstr.isProxied) {
|
|
2793
|
+
if (BUILD22.watchCallback) {
|
|
2143
2794
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2144
2795
|
}
|
|
2145
2796
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2146
2797
|
Cstr.isProxied = true;
|
|
2147
2798
|
}
|
|
2148
2799
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2149
|
-
if (
|
|
2800
|
+
if (BUILD22.member) {
|
|
2150
2801
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2151
2802
|
}
|
|
2152
2803
|
try {
|
|
@@ -2154,10 +2805,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2154
2805
|
} catch (e) {
|
|
2155
2806
|
consoleError(e);
|
|
2156
2807
|
}
|
|
2157
|
-
if (
|
|
2808
|
+
if (BUILD22.member) {
|
|
2158
2809
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2159
2810
|
}
|
|
2160
|
-
if (
|
|
2811
|
+
if (BUILD22.watchCallback) {
|
|
2161
2812
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2162
2813
|
}
|
|
2163
2814
|
endNewInstance();
|
|
@@ -2167,24 +2818,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2167
2818
|
const cmpTag = elm.localName;
|
|
2168
2819
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2169
2820
|
}
|
|
2170
|
-
if (
|
|
2821
|
+
if (BUILD22.style && Cstr && Cstr.style) {
|
|
2171
2822
|
let style;
|
|
2172
2823
|
if (typeof Cstr.style === "string") {
|
|
2173
2824
|
style = Cstr.style;
|
|
2174
|
-
} else if (
|
|
2825
|
+
} else if (BUILD22.mode && typeof Cstr.style !== "string") {
|
|
2175
2826
|
hostRef.$modeName$ = computeMode(elm);
|
|
2176
2827
|
if (hostRef.$modeName$) {
|
|
2177
2828
|
style = Cstr.style[hostRef.$modeName$];
|
|
2178
2829
|
}
|
|
2179
|
-
if (
|
|
2830
|
+
if (BUILD22.hydrateServerSide && hostRef.$modeName$) {
|
|
2180
2831
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2181
2832
|
}
|
|
2182
2833
|
}
|
|
2183
2834
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2184
2835
|
if (!styles.has(scopeId2)) {
|
|
2185
2836
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2186
|
-
if (!
|
|
2187
|
-
|
|
2837
|
+
if (!BUILD22.hydrateServerSide && BUILD22.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
|
|
2838
|
+
BUILD22.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2188
2839
|
style = await import("./shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2189
2840
|
}
|
|
2190
2841
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2194,14 +2845,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2194
2845
|
}
|
|
2195
2846
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2196
2847
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2197
|
-
if (
|
|
2848
|
+
if (BUILD22.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2198
2849
|
ancestorComponent["s-rc"].push(schedule);
|
|
2199
2850
|
} else {
|
|
2200
2851
|
schedule();
|
|
2201
2852
|
}
|
|
2202
2853
|
};
|
|
2203
2854
|
var fireConnectedCallback = (instance) => {
|
|
2204
|
-
if (
|
|
2855
|
+
if (BUILD22.lazyLoad && BUILD22.connectedCallback) {
|
|
2205
2856
|
safeCall(instance, "connectedCallback");
|
|
2206
2857
|
}
|
|
2207
2858
|
};
|
|
@@ -2212,38 +2863,41 @@ var connectedCallback = (elm) => {
|
|
|
2212
2863
|
const hostRef = getHostRef(elm);
|
|
2213
2864
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2214
2865
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2215
|
-
if (
|
|
2866
|
+
if (BUILD23.hostListenerTargetParent) {
|
|
2216
2867
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2217
2868
|
}
|
|
2218
2869
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2219
2870
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2220
2871
|
let hostId;
|
|
2221
|
-
if (
|
|
2872
|
+
if (BUILD23.hydrateClientSide) {
|
|
2222
2873
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2223
2874
|
if (hostId) {
|
|
2224
|
-
if (
|
|
2225
|
-
const scopeId2 =
|
|
2875
|
+
if (BUILD23.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2876
|
+
const scopeId2 = BUILD23.mode ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute("s-mode")) : addStyle(elm.shadowRoot, cmpMeta);
|
|
2226
2877
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2878
|
+
} else if (BUILD23.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2879
|
+
const scopeId2 = getScopeId(cmpMeta, BUILD23.mode ? elm.getAttribute("s-mode") : void 0);
|
|
2880
|
+
elm["s-sc"] = scopeId2;
|
|
2227
2881
|
}
|
|
2228
2882
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2229
2883
|
}
|
|
2230
2884
|
}
|
|
2231
|
-
if (
|
|
2232
|
-
if (
|
|
2885
|
+
if (BUILD23.slotRelocation && !hostId) {
|
|
2886
|
+
if (BUILD23.hydrateServerSide || (BUILD23.slot || BUILD23.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
|
|
2233
2887
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2234
2888
|
setContentReference(elm);
|
|
2235
2889
|
}
|
|
2236
2890
|
}
|
|
2237
|
-
if (
|
|
2891
|
+
if (BUILD23.asyncLoading) {
|
|
2238
2892
|
let ancestorComponent = elm;
|
|
2239
2893
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2240
|
-
if (
|
|
2894
|
+
if (BUILD23.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2241
2895
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2242
2896
|
break;
|
|
2243
2897
|
}
|
|
2244
2898
|
}
|
|
2245
2899
|
}
|
|
2246
|
-
if (
|
|
2900
|
+
if (BUILD23.prop && !BUILD23.hydrateServerSide && cmpMeta.$members$) {
|
|
2247
2901
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2248
2902
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2249
2903
|
const value = elm[memberName];
|
|
@@ -2252,7 +2906,7 @@ var connectedCallback = (elm) => {
|
|
|
2252
2906
|
}
|
|
2253
2907
|
});
|
|
2254
2908
|
}
|
|
2255
|
-
if (
|
|
2909
|
+
if (BUILD23.initializeNextTick) {
|
|
2256
2910
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2257
2911
|
} else {
|
|
2258
2912
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2270,32 +2924,32 @@ var connectedCallback = (elm) => {
|
|
|
2270
2924
|
};
|
|
2271
2925
|
var setContentReference = (elm) => {
|
|
2272
2926
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2273
|
-
|
|
2927
|
+
BUILD23.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2274
2928
|
);
|
|
2275
2929
|
contentRefElm["s-cn"] = true;
|
|
2276
2930
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2277
2931
|
};
|
|
2278
2932
|
|
|
2279
2933
|
// src/runtime/disconnected-callback.ts
|
|
2280
|
-
import { BUILD as
|
|
2934
|
+
import { BUILD as BUILD24 } from "@rindo/core/internal/app-data";
|
|
2281
2935
|
var disconnectInstance = (instance) => {
|
|
2282
|
-
if (
|
|
2936
|
+
if (BUILD24.lazyLoad && BUILD24.disconnectedCallback) {
|
|
2283
2937
|
safeCall(instance, "disconnectedCallback");
|
|
2284
2938
|
}
|
|
2285
|
-
if (
|
|
2939
|
+
if (BUILD24.cmpDidUnload) {
|
|
2286
2940
|
safeCall(instance, "componentDidUnload");
|
|
2287
2941
|
}
|
|
2288
2942
|
};
|
|
2289
2943
|
var disconnectedCallback = async (elm) => {
|
|
2290
2944
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2291
2945
|
const hostRef = getHostRef(elm);
|
|
2292
|
-
if (
|
|
2946
|
+
if (BUILD24.hostListener) {
|
|
2293
2947
|
if (hostRef.$rmListeners$) {
|
|
2294
2948
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2295
2949
|
hostRef.$rmListeners$ = void 0;
|
|
2296
2950
|
}
|
|
2297
2951
|
}
|
|
2298
|
-
if (!
|
|
2952
|
+
if (!BUILD24.lazyLoad) {
|
|
2299
2953
|
disconnectInstance(elm);
|
|
2300
2954
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2301
2955
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
@@ -2305,325 +2959,6 @@ var disconnectedCallback = async (elm) => {
|
|
|
2305
2959
|
}
|
|
2306
2960
|
};
|
|
2307
2961
|
|
|
2308
|
-
// src/runtime/dom-extras.ts
|
|
2309
|
-
import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
|
|
2310
|
-
var patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
|
|
2311
|
-
patchCloneNode(hostElementPrototype);
|
|
2312
|
-
patchSlotAppendChild(hostElementPrototype);
|
|
2313
|
-
patchSlotAppend(hostElementPrototype);
|
|
2314
|
-
patchSlotPrepend(hostElementPrototype);
|
|
2315
|
-
patchSlotInsertAdjacentElement(hostElementPrototype);
|
|
2316
|
-
patchSlotInsertAdjacentHTML(hostElementPrototype);
|
|
2317
|
-
patchSlotInsertAdjacentText(hostElementPrototype);
|
|
2318
|
-
patchTextContent(hostElementPrototype);
|
|
2319
|
-
patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
|
|
2320
|
-
patchSlotRemoveChild(hostElementPrototype);
|
|
2321
|
-
};
|
|
2322
|
-
var patchCloneNode = (HostElementPrototype) => {
|
|
2323
|
-
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
2324
|
-
HostElementPrototype.cloneNode = function(deep) {
|
|
2325
|
-
const srcNode = this;
|
|
2326
|
-
const isShadowDom = BUILD23.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
2327
|
-
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
2328
|
-
if (BUILD23.slot && !isShadowDom && deep) {
|
|
2329
|
-
let i2 = 0;
|
|
2330
|
-
let slotted, nonRindoNode;
|
|
2331
|
-
const rindoPrivates = [
|
|
2332
|
-
"s-id",
|
|
2333
|
-
"s-cr",
|
|
2334
|
-
"s-lr",
|
|
2335
|
-
"s-rc",
|
|
2336
|
-
"s-sc",
|
|
2337
|
-
"s-p",
|
|
2338
|
-
"s-cn",
|
|
2339
|
-
"s-sr",
|
|
2340
|
-
"s-sn",
|
|
2341
|
-
"s-hn",
|
|
2342
|
-
"s-ol",
|
|
2343
|
-
"s-nr",
|
|
2344
|
-
"s-si",
|
|
2345
|
-
"s-rf",
|
|
2346
|
-
"s-scs"
|
|
2347
|
-
];
|
|
2348
|
-
for (; i2 < srcNode.childNodes.length; i2++) {
|
|
2349
|
-
slotted = srcNode.childNodes[i2]["s-nr"];
|
|
2350
|
-
nonRindoNode = rindoPrivates.every((privateField) => !srcNode.childNodes[i2][privateField]);
|
|
2351
|
-
if (slotted) {
|
|
2352
|
-
if (BUILD23.appendChildSlotFix && clonedNode.__appendChild) {
|
|
2353
|
-
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
2354
|
-
} else {
|
|
2355
|
-
clonedNode.appendChild(slotted.cloneNode(true));
|
|
2356
|
-
}
|
|
2357
|
-
}
|
|
2358
|
-
if (nonRindoNode) {
|
|
2359
|
-
clonedNode.appendChild(srcNode.childNodes[i2].cloneNode(true));
|
|
2360
|
-
}
|
|
2361
|
-
}
|
|
2362
|
-
}
|
|
2363
|
-
return clonedNode;
|
|
2364
|
-
};
|
|
2365
|
-
};
|
|
2366
|
-
var patchSlotAppendChild = (HostElementPrototype) => {
|
|
2367
|
-
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
2368
|
-
HostElementPrototype.appendChild = function(newChild) {
|
|
2369
|
-
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2370
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
2371
|
-
if (slotNode) {
|
|
2372
|
-
const slotPlaceholder = document.createTextNode("");
|
|
2373
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2374
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2375
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2376
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2377
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2378
|
-
const appendAfter = slotChildNodes[slotChildNodes.length - 1];
|
|
2379
|
-
const insertedNode = insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
2380
|
-
updateFallbackSlotVisibility(this);
|
|
2381
|
-
return insertedNode;
|
|
2382
|
-
}
|
|
2383
|
-
return this.__appendChild(newChild);
|
|
2384
|
-
};
|
|
2385
|
-
};
|
|
2386
|
-
var patchSlotRemoveChild = (ElementPrototype) => {
|
|
2387
|
-
ElementPrototype.__removeChild = ElementPrototype.removeChild;
|
|
2388
|
-
ElementPrototype.removeChild = function(toRemove) {
|
|
2389
|
-
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
2390
|
-
const slotNode = getHostSlotNode(this.childNodes, toRemove["s-sn"], this.tagName);
|
|
2391
|
-
if (slotNode) {
|
|
2392
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove["s-sn"]);
|
|
2393
|
-
const existingNode = slotChildNodes.find((n) => n === toRemove);
|
|
2394
|
-
if (existingNode) {
|
|
2395
|
-
existingNode.remove();
|
|
2396
|
-
updateFallbackSlotVisibility(this);
|
|
2397
|
-
return;
|
|
2398
|
-
}
|
|
2399
|
-
}
|
|
2400
|
-
}
|
|
2401
|
-
return this.__removeChild(toRemove);
|
|
2402
|
-
};
|
|
2403
|
-
};
|
|
2404
|
-
var patchSlotPrepend = (HostElementPrototype) => {
|
|
2405
|
-
const originalPrepend = HostElementPrototype.prepend;
|
|
2406
|
-
HostElementPrototype.prepend = function(...newChildren) {
|
|
2407
|
-
newChildren.forEach((newChild) => {
|
|
2408
|
-
if (typeof newChild === "string") {
|
|
2409
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2410
|
-
}
|
|
2411
|
-
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
2412
|
-
const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
|
|
2413
|
-
if (slotNode) {
|
|
2414
|
-
const slotPlaceholder = document.createTextNode("");
|
|
2415
|
-
slotPlaceholder["s-nr"] = newChild;
|
|
2416
|
-
slotNode["s-cr"].parentNode.__appendChild(slotPlaceholder);
|
|
2417
|
-
newChild["s-ol"] = slotPlaceholder;
|
|
2418
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
2419
|
-
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
2420
|
-
const appendAfter = slotChildNodes[0];
|
|
2421
|
-
return insertBefore(appendAfter.parentNode, newChild, appendAfter.nextSibling);
|
|
2422
|
-
}
|
|
2423
|
-
if (newChild.nodeType === 1 && !!newChild.getAttribute("slot")) {
|
|
2424
|
-
newChild.hidden = true;
|
|
2425
|
-
}
|
|
2426
|
-
return originalPrepend.call(this, newChild);
|
|
2427
|
-
});
|
|
2428
|
-
};
|
|
2429
|
-
};
|
|
2430
|
-
var patchSlotAppend = (HostElementPrototype) => {
|
|
2431
|
-
HostElementPrototype.append = function(...newChildren) {
|
|
2432
|
-
newChildren.forEach((newChild) => {
|
|
2433
|
-
if (typeof newChild === "string") {
|
|
2434
|
-
newChild = this.ownerDocument.createTextNode(newChild);
|
|
2435
|
-
}
|
|
2436
|
-
this.appendChild(newChild);
|
|
2437
|
-
});
|
|
2438
|
-
};
|
|
2439
|
-
};
|
|
2440
|
-
var patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
|
|
2441
|
-
const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
|
|
2442
|
-
HostElementPrototype.insertAdjacentHTML = function(position, text) {
|
|
2443
|
-
if (position !== "afterbegin" && position !== "beforeend") {
|
|
2444
|
-
return originalInsertAdjacentHtml.call(this, position, text);
|
|
2445
|
-
}
|
|
2446
|
-
const container = this.ownerDocument.createElement("_");
|
|
2447
|
-
let node;
|
|
2448
|
-
container.innerHTML = text;
|
|
2449
|
-
if (position === "afterbegin") {
|
|
2450
|
-
while (node = container.firstChild) {
|
|
2451
|
-
this.prepend(node);
|
|
2452
|
-
}
|
|
2453
|
-
} else if (position === "beforeend") {
|
|
2454
|
-
while (node = container.firstChild) {
|
|
2455
|
-
this.append(node);
|
|
2456
|
-
}
|
|
2457
|
-
}
|
|
2458
|
-
};
|
|
2459
|
-
};
|
|
2460
|
-
var patchSlotInsertAdjacentText = (HostElementPrototype) => {
|
|
2461
|
-
HostElementPrototype.insertAdjacentText = function(position, text) {
|
|
2462
|
-
this.insertAdjacentHTML(position, text);
|
|
2463
|
-
};
|
|
2464
|
-
};
|
|
2465
|
-
var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
2466
|
-
const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
|
|
2467
|
-
HostElementPrototype.insertAdjacentElement = function(position, element) {
|
|
2468
|
-
if (position !== "afterbegin" && position !== "beforeend") {
|
|
2469
|
-
return originalInsertAdjacentElement.call(this, position, element);
|
|
2470
|
-
}
|
|
2471
|
-
if (position === "afterbegin") {
|
|
2472
|
-
this.prepend(element);
|
|
2473
|
-
return element;
|
|
2474
|
-
} else if (position === "beforeend") {
|
|
2475
|
-
this.append(element);
|
|
2476
|
-
return element;
|
|
2477
|
-
}
|
|
2478
|
-
return element;
|
|
2479
|
-
};
|
|
2480
|
-
};
|
|
2481
|
-
var patchTextContent = (hostElementPrototype) => {
|
|
2482
|
-
const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, "textContent");
|
|
2483
|
-
Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
2484
|
-
if (BUILD23.experimentalScopedSlotChanges) {
|
|
2485
|
-
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2486
|
-
// To mimic shadow root behavior, we need to return the text content of all
|
|
2487
|
-
// nodes in a slot reference node
|
|
2488
|
-
get() {
|
|
2489
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
2490
|
-
const textContent = slotRefNodes.map((node) => {
|
|
2491
|
-
var _a, _b;
|
|
2492
|
-
const text = [];
|
|
2493
|
-
let slotContent = node.nextSibling;
|
|
2494
|
-
while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
|
|
2495
|
-
if (slotContent.nodeType === 3 /* TEXT_NODE */ || slotContent.nodeType === 1 /* ELEMENT_NODE */) {
|
|
2496
|
-
text.push((_b = (_a = slotContent.textContent) == null ? void 0 : _a.trim()) != null ? _b : "");
|
|
2497
|
-
}
|
|
2498
|
-
slotContent = slotContent.nextSibling;
|
|
2499
|
-
}
|
|
2500
|
-
return text.filter((ref) => ref !== "").join(" ");
|
|
2501
|
-
}).filter((text) => text !== "").join(" ");
|
|
2502
|
-
return " " + textContent + " ";
|
|
2503
|
-
},
|
|
2504
|
-
// To mimic shadow root behavior, we need to overwrite all nodes in a slot
|
|
2505
|
-
// reference node. If a default slot reference node exists, the text content will be
|
|
2506
|
-
// placed there. Otherwise, the new text node will be hidden
|
|
2507
|
-
set(value) {
|
|
2508
|
-
const slotRefNodes = getAllChildSlotNodes(this.childNodes);
|
|
2509
|
-
slotRefNodes.forEach((node) => {
|
|
2510
|
-
let slotContent = node.nextSibling;
|
|
2511
|
-
while (slotContent && slotContent["s-sn"] === node["s-sn"]) {
|
|
2512
|
-
const tmp = slotContent;
|
|
2513
|
-
slotContent = slotContent.nextSibling;
|
|
2514
|
-
tmp.remove();
|
|
2515
|
-
}
|
|
2516
|
-
if (node["s-sn"] === "") {
|
|
2517
|
-
const textNode = this.ownerDocument.createTextNode(value);
|
|
2518
|
-
textNode["s-sn"] = "";
|
|
2519
|
-
insertBefore(node.parentElement, textNode, node.nextSibling);
|
|
2520
|
-
} else {
|
|
2521
|
-
node.remove();
|
|
2522
|
-
}
|
|
2523
|
-
});
|
|
2524
|
-
}
|
|
2525
|
-
});
|
|
2526
|
-
} else {
|
|
2527
|
-
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
2528
|
-
get() {
|
|
2529
|
-
var _a;
|
|
2530
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2531
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2532
|
-
return slotNode.nextSibling.textContent;
|
|
2533
|
-
} else if (slotNode) {
|
|
2534
|
-
return slotNode.textContent;
|
|
2535
|
-
} else {
|
|
2536
|
-
return this.__textContent;
|
|
2537
|
-
}
|
|
2538
|
-
},
|
|
2539
|
-
set(value) {
|
|
2540
|
-
var _a;
|
|
2541
|
-
const slotNode = getHostSlotNode(this.childNodes, "", this.tagName);
|
|
2542
|
-
if (((_a = slotNode == null ? void 0 : slotNode.nextSibling) == null ? void 0 : _a.nodeType) === 3 /* TEXT_NODE */) {
|
|
2543
|
-
slotNode.nextSibling.textContent = value;
|
|
2544
|
-
} else if (slotNode) {
|
|
2545
|
-
slotNode.textContent = value;
|
|
2546
|
-
} else {
|
|
2547
|
-
this.__textContent = value;
|
|
2548
|
-
const contentRefElm = this["s-cr"];
|
|
2549
|
-
if (contentRefElm) {
|
|
2550
|
-
insertBefore(this, contentRefElm, this.firstChild);
|
|
2551
|
-
}
|
|
2552
|
-
}
|
|
2553
|
-
}
|
|
2554
|
-
});
|
|
2555
|
-
}
|
|
2556
|
-
};
|
|
2557
|
-
var patchChildSlotNodes = (elm, cmpMeta) => {
|
|
2558
|
-
class FakeNodeList extends Array {
|
|
2559
|
-
item(n) {
|
|
2560
|
-
return this[n];
|
|
2561
|
-
}
|
|
2562
|
-
}
|
|
2563
|
-
if (cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2564
|
-
const childNodesFn = elm.__lookupGetter__("childNodes");
|
|
2565
|
-
Object.defineProperty(elm, "children", {
|
|
2566
|
-
get() {
|
|
2567
|
-
return this.childNodes.map((n) => n.nodeType === 1);
|
|
2568
|
-
}
|
|
2569
|
-
});
|
|
2570
|
-
Object.defineProperty(elm, "childElementCount", {
|
|
2571
|
-
get() {
|
|
2572
|
-
return elm.children.length;
|
|
2573
|
-
}
|
|
2574
|
-
});
|
|
2575
|
-
Object.defineProperty(elm, "childNodes", {
|
|
2576
|
-
get() {
|
|
2577
|
-
const childNodes = childNodesFn.call(this);
|
|
2578
|
-
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0 && getHostRef(this).$flags$ & 2 /* hasRendered */) {
|
|
2579
|
-
const result = new FakeNodeList();
|
|
2580
|
-
for (let i2 = 0; i2 < childNodes.length; i2++) {
|
|
2581
|
-
const slot = childNodes[i2]["s-nr"];
|
|
2582
|
-
if (slot) {
|
|
2583
|
-
result.push(slot);
|
|
2584
|
-
}
|
|
2585
|
-
}
|
|
2586
|
-
return result;
|
|
2587
|
-
}
|
|
2588
|
-
return FakeNodeList.from(childNodes);
|
|
2589
|
-
}
|
|
2590
|
-
});
|
|
2591
|
-
}
|
|
2592
|
-
};
|
|
2593
|
-
var getAllChildSlotNodes = (childNodes) => {
|
|
2594
|
-
const slotRefNodes = [];
|
|
2595
|
-
for (const childNode of Array.from(childNodes)) {
|
|
2596
|
-
if (childNode["s-sr"]) {
|
|
2597
|
-
slotRefNodes.push(childNode);
|
|
2598
|
-
}
|
|
2599
|
-
slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
|
|
2600
|
-
}
|
|
2601
|
-
return slotRefNodes;
|
|
2602
|
-
};
|
|
2603
|
-
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
2604
|
-
var getHostSlotNode = (childNodes, slotName, hostName) => {
|
|
2605
|
-
let i2 = 0;
|
|
2606
|
-
let childNode;
|
|
2607
|
-
for (; i2 < childNodes.length; i2++) {
|
|
2608
|
-
childNode = childNodes[i2];
|
|
2609
|
-
if (childNode["s-sr"] && childNode["s-sn"] === slotName && childNode["s-hn"] === hostName) {
|
|
2610
|
-
return childNode;
|
|
2611
|
-
}
|
|
2612
|
-
childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
|
|
2613
|
-
if (childNode) {
|
|
2614
|
-
return childNode;
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
return null;
|
|
2618
|
-
};
|
|
2619
|
-
var getHostSlotChildNodes = (n, slotName) => {
|
|
2620
|
-
const childNodes = [n];
|
|
2621
|
-
while ((n = n.nextSibling) && n["s-sn"] === slotName) {
|
|
2622
|
-
childNodes.push(n);
|
|
2623
|
-
}
|
|
2624
|
-
return childNodes;
|
|
2625
|
-
};
|
|
2626
|
-
|
|
2627
2962
|
// src/runtime/bootstrap-custom-element.ts
|
|
2628
2963
|
var defineCustomElement = (Cstr, compactMeta) => {
|
|
2629
2964
|
customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
|
|
@@ -2633,67 +2968,67 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2633
2968
|
$flags$: compactMeta[0],
|
|
2634
2969
|
$tagName$: compactMeta[1]
|
|
2635
2970
|
};
|
|
2636
|
-
if (
|
|
2971
|
+
if (BUILD25.member) {
|
|
2637
2972
|
cmpMeta.$members$ = compactMeta[2];
|
|
2638
2973
|
}
|
|
2639
|
-
if (
|
|
2974
|
+
if (BUILD25.hostListener) {
|
|
2640
2975
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2641
2976
|
}
|
|
2642
|
-
if (
|
|
2977
|
+
if (BUILD25.watchCallback) {
|
|
2643
2978
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2644
2979
|
}
|
|
2645
|
-
if (
|
|
2980
|
+
if (BUILD25.reflect) {
|
|
2646
2981
|
cmpMeta.$attrsToReflect$ = [];
|
|
2647
2982
|
}
|
|
2648
|
-
if (
|
|
2983
|
+
if (BUILD25.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2649
2984
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2650
2985
|
}
|
|
2651
|
-
if (
|
|
2652
|
-
if (
|
|
2653
|
-
patchPseudoShadowDom(Cstr.prototype
|
|
2986
|
+
if (BUILD25.experimentalSlotFixes) {
|
|
2987
|
+
if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2988
|
+
patchPseudoShadowDom(Cstr.prototype);
|
|
2654
2989
|
}
|
|
2655
2990
|
} else {
|
|
2656
|
-
if (
|
|
2657
|
-
patchChildSlotNodes(Cstr.prototype
|
|
2991
|
+
if (BUILD25.slotChildNodesFix) {
|
|
2992
|
+
patchChildSlotNodes(Cstr.prototype);
|
|
2658
2993
|
}
|
|
2659
|
-
if (
|
|
2994
|
+
if (BUILD25.cloneNodeFix) {
|
|
2660
2995
|
patchCloneNode(Cstr.prototype);
|
|
2661
2996
|
}
|
|
2662
|
-
if (
|
|
2997
|
+
if (BUILD25.appendChildSlotFix) {
|
|
2663
2998
|
patchSlotAppendChild(Cstr.prototype);
|
|
2664
2999
|
}
|
|
2665
|
-
if (
|
|
3000
|
+
if (BUILD25.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2666
3001
|
patchTextContent(Cstr.prototype);
|
|
2667
3002
|
}
|
|
2668
3003
|
}
|
|
2669
3004
|
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
2670
3005
|
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
2671
|
-
let hasHostListenerAttached = false;
|
|
2672
3006
|
Object.assign(Cstr.prototype, {
|
|
3007
|
+
__hasHostListenerAttached: false,
|
|
2673
3008
|
__registerHost() {
|
|
2674
3009
|
registerHost(this, cmpMeta);
|
|
2675
3010
|
},
|
|
2676
3011
|
connectedCallback() {
|
|
2677
|
-
if (!
|
|
3012
|
+
if (!this.__hasHostListenerAttached) {
|
|
2678
3013
|
const hostRef = getHostRef(this);
|
|
2679
3014
|
addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
|
|
2680
|
-
|
|
3015
|
+
this.__hasHostListenerAttached = true;
|
|
2681
3016
|
}
|
|
2682
3017
|
connectedCallback(this);
|
|
2683
|
-
if (
|
|
3018
|
+
if (BUILD25.connectedCallback && originalConnectedCallback) {
|
|
2684
3019
|
originalConnectedCallback.call(this);
|
|
2685
3020
|
}
|
|
2686
3021
|
},
|
|
2687
3022
|
disconnectedCallback() {
|
|
2688
3023
|
disconnectedCallback(this);
|
|
2689
|
-
if (
|
|
3024
|
+
if (BUILD25.disconnectedCallback && originalDisconnectedCallback) {
|
|
2690
3025
|
originalDisconnectedCallback.call(this);
|
|
2691
3026
|
}
|
|
2692
3027
|
},
|
|
2693
3028
|
__attachShadow() {
|
|
2694
3029
|
if (supportsShadow) {
|
|
2695
3030
|
if (!this.shadowRoot) {
|
|
2696
|
-
if (
|
|
3031
|
+
if (BUILD25.shadowDelegatesFocus) {
|
|
2697
3032
|
this.attachShadow({
|
|
2698
3033
|
mode: "open",
|
|
2699
3034
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -2717,7 +3052,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2717
3052
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
2718
3053
|
};
|
|
2719
3054
|
var forceModeUpdate = (elm) => {
|
|
2720
|
-
if (
|
|
3055
|
+
if (BUILD25.style && BUILD25.mode && !BUILD25.lazyLoad) {
|
|
2721
3056
|
const mode = computeMode(elm);
|
|
2722
3057
|
const hostRef = getHostRef(elm);
|
|
2723
3058
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -2740,7 +3075,7 @@ var forceModeUpdate = (elm) => {
|
|
|
2740
3075
|
};
|
|
2741
3076
|
|
|
2742
3077
|
// src/runtime/bootstrap-lazy.ts
|
|
2743
|
-
import { BUILD as
|
|
3078
|
+
import { BUILD as BUILD26 } from "@rindo/core/internal/app-data";
|
|
2744
3079
|
|
|
2745
3080
|
// src/runtime/hmr-component.ts
|
|
2746
3081
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -2752,7 +3087,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
2752
3087
|
// src/runtime/bootstrap-lazy.ts
|
|
2753
3088
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2754
3089
|
var _a;
|
|
2755
|
-
if (
|
|
3090
|
+
if (BUILD26.profile && performance.mark) {
|
|
2756
3091
|
performance.mark("st:app:start");
|
|
2757
3092
|
}
|
|
2758
3093
|
installDevTools();
|
|
@@ -2768,12 +3103,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2768
3103
|
let isBootstrapping = true;
|
|
2769
3104
|
Object.assign(plt, options);
|
|
2770
3105
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
2771
|
-
if (
|
|
3106
|
+
if (BUILD26.asyncQueue) {
|
|
2772
3107
|
if (options.syncQueue) {
|
|
2773
3108
|
plt.$flags$ |= 4 /* queueSync */;
|
|
2774
3109
|
}
|
|
2775
3110
|
}
|
|
2776
|
-
if (
|
|
3111
|
+
if (BUILD26.hydrateClientSide) {
|
|
2777
3112
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2778
3113
|
}
|
|
2779
3114
|
let hasSlotRelocation = false;
|
|
@@ -2789,22 +3124,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2789
3124
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2790
3125
|
hasSlotRelocation = true;
|
|
2791
3126
|
}
|
|
2792
|
-
if (
|
|
3127
|
+
if (BUILD26.member) {
|
|
2793
3128
|
cmpMeta.$members$ = compactMeta[2];
|
|
2794
3129
|
}
|
|
2795
|
-
if (
|
|
3130
|
+
if (BUILD26.hostListener) {
|
|
2796
3131
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2797
3132
|
}
|
|
2798
|
-
if (
|
|
3133
|
+
if (BUILD26.reflect) {
|
|
2799
3134
|
cmpMeta.$attrsToReflect$ = [];
|
|
2800
3135
|
}
|
|
2801
|
-
if (
|
|
3136
|
+
if (BUILD26.watchCallback) {
|
|
2802
3137
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
2803
3138
|
}
|
|
2804
|
-
if (
|
|
3139
|
+
if (BUILD26.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2805
3140
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2806
3141
|
}
|
|
2807
|
-
const tagName =
|
|
3142
|
+
const tagName = BUILD26.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
2808
3143
|
const HostElement = class extends HTMLElement {
|
|
2809
3144
|
// RindoLazyHost
|
|
2810
3145
|
constructor(self) {
|
|
@@ -2812,10 +3147,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2812
3147
|
this.hasRegisteredEventListeners = false;
|
|
2813
3148
|
self = this;
|
|
2814
3149
|
registerHost(self, cmpMeta);
|
|
2815
|
-
if (
|
|
3150
|
+
if (BUILD26.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2816
3151
|
if (supportsShadow) {
|
|
2817
3152
|
if (!self.shadowRoot) {
|
|
2818
|
-
if (
|
|
3153
|
+
if (BUILD26.shadowDelegatesFocus) {
|
|
2819
3154
|
self.attachShadow({
|
|
2820
3155
|
mode: "open",
|
|
2821
3156
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -2830,7 +3165,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2830
3165
|
);
|
|
2831
3166
|
}
|
|
2832
3167
|
}
|
|
2833
|
-
} else if (!
|
|
3168
|
+
} else if (!BUILD26.hydrateServerSide && !("shadowRoot" in self)) {
|
|
2834
3169
|
self.shadowRoot = self;
|
|
2835
3170
|
}
|
|
2836
3171
|
}
|
|
@@ -2858,28 +3193,28 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2858
3193
|
return getHostRef(this).$onReadyPromise$;
|
|
2859
3194
|
}
|
|
2860
3195
|
};
|
|
2861
|
-
if (
|
|
2862
|
-
if (
|
|
2863
|
-
patchPseudoShadowDom(HostElement.prototype
|
|
3196
|
+
if (BUILD26.experimentalSlotFixes) {
|
|
3197
|
+
if (BUILD26.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3198
|
+
patchPseudoShadowDom(HostElement.prototype);
|
|
2864
3199
|
}
|
|
2865
3200
|
} else {
|
|
2866
|
-
if (
|
|
2867
|
-
patchChildSlotNodes(HostElement.prototype
|
|
3201
|
+
if (BUILD26.slotChildNodesFix) {
|
|
3202
|
+
patchChildSlotNodes(HostElement.prototype);
|
|
2868
3203
|
}
|
|
2869
|
-
if (
|
|
3204
|
+
if (BUILD26.cloneNodeFix) {
|
|
2870
3205
|
patchCloneNode(HostElement.prototype);
|
|
2871
3206
|
}
|
|
2872
|
-
if (
|
|
3207
|
+
if (BUILD26.appendChildSlotFix) {
|
|
2873
3208
|
patchSlotAppendChild(HostElement.prototype);
|
|
2874
3209
|
}
|
|
2875
|
-
if (
|
|
3210
|
+
if (BUILD26.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2876
3211
|
patchTextContent(HostElement.prototype);
|
|
2877
3212
|
}
|
|
2878
3213
|
}
|
|
2879
|
-
if (
|
|
3214
|
+
if (BUILD26.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
2880
3215
|
HostElement.formAssociated = true;
|
|
2881
3216
|
}
|
|
2882
|
-
if (
|
|
3217
|
+
if (BUILD26.hotModuleReplacement) {
|
|
2883
3218
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
2884
3219
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
2885
3220
|
};
|
|
@@ -2898,7 +3233,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2898
3233
|
if (hasSlotRelocation) {
|
|
2899
3234
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
2900
3235
|
}
|
|
2901
|
-
if (
|
|
3236
|
+
if (BUILD26.invisiblePrehydration && (BUILD26.hydratedClass || BUILD26.hydratedAttribute)) {
|
|
2902
3237
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
2903
3238
|
}
|
|
2904
3239
|
if (dataStyles.innerHTML.length) {
|
|
@@ -2914,7 +3249,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2914
3249
|
if (deferredConnectedCallbacks.length) {
|
|
2915
3250
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
2916
3251
|
} else {
|
|
2917
|
-
if (
|
|
3252
|
+
if (BUILD26.profile) {
|
|
2918
3253
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
2919
3254
|
} else {
|
|
2920
3255
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -2927,10 +3262,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2927
3262
|
var Fragment = (_, children) => children;
|
|
2928
3263
|
|
|
2929
3264
|
// src/runtime/host-listener.ts
|
|
2930
|
-
import { BUILD as
|
|
3265
|
+
import { BUILD as BUILD27 } from "@rindo/core/internal/app-data";
|
|
2931
3266
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
2932
|
-
if (
|
|
2933
|
-
if (
|
|
3267
|
+
if (BUILD27.hostListener && listeners) {
|
|
3268
|
+
if (BUILD27.hostListenerTargetParent) {
|
|
2934
3269
|
if (attachParentListeners) {
|
|
2935
3270
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
2936
3271
|
} else {
|
|
@@ -2938,7 +3273,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
2938
3273
|
}
|
|
2939
3274
|
}
|
|
2940
3275
|
listeners.map(([flags, name, method]) => {
|
|
2941
|
-
const target =
|
|
3276
|
+
const target = BUILD27.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
2942
3277
|
const handler = hostListenerProxy(hostRef, method);
|
|
2943
3278
|
const opts = hostListenerOpts(flags);
|
|
2944
3279
|
plt.ael(target, name, handler, opts);
|
|
@@ -2949,7 +3284,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
2949
3284
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
2950
3285
|
var _a;
|
|
2951
3286
|
try {
|
|
2952
|
-
if (
|
|
3287
|
+
if (BUILD27.lazyLoad) {
|
|
2953
3288
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
2954
3289
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
2955
3290
|
} else {
|
|
@@ -2963,10 +3298,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
2963
3298
|
}
|
|
2964
3299
|
};
|
|
2965
3300
|
var getHostListenerTarget = (elm, flags) => {
|
|
2966
|
-
if (
|
|
2967
|
-
if (
|
|
2968
|
-
if (
|
|
2969
|
-
if (
|
|
3301
|
+
if (BUILD27.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
3302
|
+
if (BUILD27.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
3303
|
+
if (BUILD27.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
3304
|
+
if (BUILD27.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
2970
3305
|
return elm.parentElement;
|
|
2971
3306
|
return elm;
|
|
2972
3307
|
};
|
|
@@ -3002,6 +3337,9 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
|
3002
3337
|
childId = `${hostId}.${nodeId}`;
|
|
3003
3338
|
if (nodeRef.nodeType === 1 /* ElementNode */) {
|
|
3004
3339
|
nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3340
|
+
if (typeof nodeRef["s-sn"] === "string" && !nodeRef.getAttribute("slot")) {
|
|
3341
|
+
nodeRef.setAttribute("s-sn", nodeRef["s-sn"]);
|
|
3342
|
+
}
|
|
3005
3343
|
} else if (nodeRef.nodeType === 3 /* TextNode */) {
|
|
3006
3344
|
if (hostId === 0) {
|
|
3007
3345
|
const textContent = (_a = nodeRef.nodeValue) == null ? void 0 : _a.trim();
|
|
@@ -3013,6 +3351,10 @@ var insertVdomAnnotations = (doc2, staticComponents) => {
|
|
|
3013
3351
|
const commentBeforeTextNode = doc2.createComment(childId);
|
|
3014
3352
|
commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
|
|
3015
3353
|
insertBefore(nodeRef.parentNode, commentBeforeTextNode, nodeRef);
|
|
3354
|
+
} else if (nodeRef.nodeType === 8 /* CommentNode */) {
|
|
3355
|
+
const commentBeforeTextNode = doc2.createComment(childId);
|
|
3356
|
+
commentBeforeTextNode.nodeValue = `${COMMENT_NODE_ID}.${childId}`;
|
|
3357
|
+
nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
|
|
3016
3358
|
}
|
|
3017
3359
|
}
|
|
3018
3360
|
let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
|
|
@@ -3093,6 +3435,9 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
3093
3435
|
childElm["s-node-id"] = nodeId;
|
|
3094
3436
|
if (childElm.nodeType === 1 /* ElementNode */) {
|
|
3095
3437
|
childElm.setAttribute(HYDRATE_CHILD_ID, childId);
|
|
3438
|
+
if (typeof childElm["s-sn"] === "string" && !childElm.getAttribute("slot")) {
|
|
3439
|
+
childElm.setAttribute("s-sn", childElm["s-sn"]);
|
|
3440
|
+
}
|
|
3096
3441
|
} else if (childElm.nodeType === 3 /* TextNode */) {
|
|
3097
3442
|
const parentNode = childElm.parentNode;
|
|
3098
3443
|
const nodeName = parentNode == null ? void 0 : parentNode.nodeName;
|
|
@@ -3116,7 +3461,7 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
3116
3461
|
}
|
|
3117
3462
|
};
|
|
3118
3463
|
export {
|
|
3119
|
-
|
|
3464
|
+
BUILD28 as BUILD,
|
|
3120
3465
|
Build,
|
|
3121
3466
|
Env,
|
|
3122
3467
|
Fragment,
|