@rindo/core 4.23.0 → 4.23.2
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 +125 -133
- 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 +637 -462
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +602 -460
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +31 -23
- package/internal/package.json +1 -1
- package/internal/rindo-private.d.ts +60 -4
- package/internal/testing/index.js +601 -458
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +7 -2
- package/mock-doc/index.js +7 -2
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +1 -1
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +2 -1
- package/testing/package.json +1 -1
package/internal/client/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Rindo Client Platform v4.23.
|
|
2
|
+
Rindo Client Platform v4.23.2 | 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 SVG_NS = "http://www.w3.org/2000/svg";
|
|
24
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
25
|
+
|
|
26
|
+
// src/client/client-host-ref.ts
|
|
21
27
|
var hostRefs = BUILD2.hotModuleReplacement ? window.__RINDO_HOSTREFS__ || (window.__RINDO_HOSTREFS__ = /* @__PURE__ */ new WeakMap()) : /* @__PURE__ */ new WeakMap();
|
|
28
|
+
var deleteHostRef = (ref) => hostRefs.delete(ref);
|
|
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";
|
|
@@ -243,7 +281,7 @@ var readTask = /* @__PURE__ */ queueTask(queueDomReads, false);
|
|
|
243
281
|
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
244
282
|
|
|
245
283
|
// src/client/index.ts
|
|
246
|
-
import { BUILD as
|
|
284
|
+
import { BUILD as BUILD28, Env, NAMESPACE as NAMESPACE2 } from "@rindo/core/internal/app-data";
|
|
247
285
|
|
|
248
286
|
// src/runtime/asset-path.ts
|
|
249
287
|
var getAssetPath = (path) => {
|
|
@@ -253,15 +291,10 @@ var getAssetPath = (path) => {
|
|
|
253
291
|
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
254
292
|
|
|
255
293
|
// src/runtime/bootstrap-custom-element.ts
|
|
256
|
-
import { BUILD as
|
|
257
|
-
|
|
258
|
-
// src/utils/constants.ts
|
|
259
|
-
var EMPTY_OBJ = {};
|
|
260
|
-
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
261
|
-
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
294
|
+
import { BUILD as BUILD25 } from "@rindo/core/internal/app-data";
|
|
262
295
|
|
|
263
296
|
// src/utils/helpers.ts
|
|
264
|
-
var isDef = (v) => v != null;
|
|
297
|
+
var isDef = (v) => v != null && v !== void 0;
|
|
265
298
|
var isComplexType = (o) => {
|
|
266
299
|
o = typeof o;
|
|
267
300
|
return o === "object" || o === "function";
|
|
@@ -323,19 +356,122 @@ var unwrapErr = (result) => {
|
|
|
323
356
|
};
|
|
324
357
|
|
|
325
358
|
// src/runtime/connected-callback.ts
|
|
326
|
-
import { BUILD as
|
|
359
|
+
import { BUILD as BUILD23 } from "@rindo/core/internal/app-data";
|
|
327
360
|
|
|
328
361
|
// src/runtime/client-hydrate.ts
|
|
329
|
-
import { BUILD as
|
|
362
|
+
import { BUILD as BUILD14 } from "@rindo/core/internal/app-data";
|
|
330
363
|
|
|
331
364
|
// src/runtime/dom-extras.ts
|
|
332
|
-
import { BUILD as
|
|
365
|
+
import { BUILD as BUILD12 } from "@rindo/core/internal/app-data";
|
|
366
|
+
|
|
367
|
+
// src/runtime/slot-polyfill-utils.ts
|
|
368
|
+
import { BUILD as BUILD7 } from "@rindo/core/internal/app-data";
|
|
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
|
+
}
|
|
387
|
+
}
|
|
388
|
+
};
|
|
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);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
return result;
|
|
398
|
+
};
|
|
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)];
|
|
410
|
+
}
|
|
411
|
+
return slottedNodes;
|
|
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);
|
|
464
|
+
}
|
|
465
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
466
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
467
|
+
};
|
|
468
|
+
var getSlotName = (node) => node["s-sn"] || node.nodeType === 1 && node.getAttribute("slot") || "";
|
|
333
469
|
|
|
334
470
|
// src/runtime/vdom/vdom-render.ts
|
|
335
|
-
import { BUILD as
|
|
471
|
+
import { BUILD as BUILD11 } from "@rindo/core/internal/app-data";
|
|
336
472
|
|
|
337
473
|
// src/runtime/vdom/h.ts
|
|
338
|
-
import { BUILD as
|
|
474
|
+
import { BUILD as BUILD8 } from "@rindo/core/internal/app-data";
|
|
339
475
|
var h = (nodeName, vnodeData, ...children) => {
|
|
340
476
|
let child = null;
|
|
341
477
|
let key = null;
|
|
@@ -351,7 +487,7 @@ var h = (nodeName, vnodeData, ...children) => {
|
|
|
351
487
|
} else if (child != null && typeof child !== "boolean") {
|
|
352
488
|
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
353
489
|
child = String(child);
|
|
354
|
-
} else if (
|
|
490
|
+
} else if (BUILD8.isDev && typeof nodeName !== "function" && child.$flags$ === void 0) {
|
|
355
491
|
consoleDevError(`vNode passed as children has unexpected type.
|
|
356
492
|
Make sure it's using the correct h() function.
|
|
357
493
|
Empty objects can also be the cause, look for JSX comments that became objects.`);
|
|
@@ -367,28 +503,28 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
367
503
|
};
|
|
368
504
|
walk(children);
|
|
369
505
|
if (vnodeData) {
|
|
370
|
-
if (
|
|
506
|
+
if (BUILD8.isDev && nodeName === "input") {
|
|
371
507
|
validateInputProperties(vnodeData);
|
|
372
508
|
}
|
|
373
|
-
if (
|
|
509
|
+
if (BUILD8.vdomKey && vnodeData.key) {
|
|
374
510
|
key = vnodeData.key;
|
|
375
511
|
}
|
|
376
|
-
if (
|
|
512
|
+
if (BUILD8.slotRelocation && vnodeData.name) {
|
|
377
513
|
slotName = vnodeData.name;
|
|
378
514
|
}
|
|
379
|
-
if (
|
|
515
|
+
if (BUILD8.vdomClass) {
|
|
380
516
|
const classData = vnodeData.className || vnodeData.class;
|
|
381
517
|
if (classData) {
|
|
382
518
|
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
383
519
|
}
|
|
384
520
|
}
|
|
385
521
|
}
|
|
386
|
-
if (
|
|
522
|
+
if (BUILD8.isDev && vNodeChildren.some(isHost)) {
|
|
387
523
|
consoleDevError(`The <Host> must be the single root component. Make sure:
|
|
388
524
|
- You are NOT using hostData() and <Host> in the same component.
|
|
389
525
|
- <Host> is used once, and it's the single root component of the render() function.`);
|
|
390
526
|
}
|
|
391
|
-
if (
|
|
527
|
+
if (BUILD8.vdomFunctional && typeof nodeName === "function") {
|
|
392
528
|
return nodeName(
|
|
393
529
|
vnodeData === null ? {} : vnodeData,
|
|
394
530
|
vNodeChildren,
|
|
@@ -400,10 +536,10 @@ Empty objects can also be the cause, look for JSX comments that became objects.`
|
|
|
400
536
|
if (vNodeChildren.length > 0) {
|
|
401
537
|
vnode.$children$ = vNodeChildren;
|
|
402
538
|
}
|
|
403
|
-
if (
|
|
539
|
+
if (BUILD8.vdomKey) {
|
|
404
540
|
vnode.$key$ = key;
|
|
405
541
|
}
|
|
406
|
-
if (
|
|
542
|
+
if (BUILD8.slotRelocation) {
|
|
407
543
|
vnode.$name$ = slotName;
|
|
408
544
|
}
|
|
409
545
|
return vnode;
|
|
@@ -416,13 +552,13 @@ var newVNode = (tag, text) => {
|
|
|
416
552
|
$elm$: null,
|
|
417
553
|
$children$: null
|
|
418
554
|
};
|
|
419
|
-
if (
|
|
555
|
+
if (BUILD8.vdomAttribute) {
|
|
420
556
|
vnode.$attrs$ = null;
|
|
421
557
|
}
|
|
422
|
-
if (
|
|
558
|
+
if (BUILD8.vdomKey) {
|
|
423
559
|
vnode.$key$ = null;
|
|
424
560
|
}
|
|
425
|
-
if (
|
|
561
|
+
if (BUILD8.slotRelocation) {
|
|
426
562
|
vnode.$name$ = null;
|
|
427
563
|
}
|
|
428
564
|
return vnode;
|
|
@@ -475,28 +611,35 @@ var validateInputProperties = (inputElm) => {
|
|
|
475
611
|
};
|
|
476
612
|
|
|
477
613
|
// src/runtime/vdom/update-element.ts
|
|
478
|
-
import { BUILD as
|
|
614
|
+
import { BUILD as BUILD10 } from "@rindo/core/internal/app-data";
|
|
479
615
|
|
|
480
616
|
// src/runtime/vdom/set-accessor.ts
|
|
481
|
-
import { BUILD as
|
|
617
|
+
import { BUILD as BUILD9 } from "@rindo/core/internal/app-data";
|
|
482
618
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
483
619
|
if (oldValue !== newValue) {
|
|
484
620
|
let isProp = isMemberInElement(elm, memberName);
|
|
485
621
|
let ln = memberName.toLowerCase();
|
|
486
|
-
if (
|
|
622
|
+
if (BUILD9.vdomClass && memberName === "class") {
|
|
487
623
|
const classList = elm.classList;
|
|
488
624
|
const oldClasses = parseClassList(oldValue);
|
|
489
|
-
|
|
490
|
-
if (elm["s-si"]
|
|
625
|
+
let newClasses = parseClassList(newValue);
|
|
626
|
+
if (elm["s-si"]) {
|
|
491
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)));
|
|
492
637
|
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
} else if (BUILD8.vdomStyle && memberName === "style") {
|
|
496
|
-
if (BUILD8.updatable) {
|
|
638
|
+
} else if (BUILD9.vdomStyle && memberName === "style") {
|
|
639
|
+
if (BUILD9.updatable) {
|
|
497
640
|
for (const prop in oldValue) {
|
|
498
641
|
if (!newValue || newValue[prop] == null) {
|
|
499
|
-
if (!
|
|
642
|
+
if (!BUILD9.hydrateServerSide && prop.includes("-")) {
|
|
500
643
|
elm.style.removeProperty(prop);
|
|
501
644
|
} else {
|
|
502
645
|
elm.style[prop] = "";
|
|
@@ -506,19 +649,19 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
506
649
|
}
|
|
507
650
|
for (const prop in newValue) {
|
|
508
651
|
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
509
|
-
if (!
|
|
652
|
+
if (!BUILD9.hydrateServerSide && prop.includes("-")) {
|
|
510
653
|
elm.style.setProperty(prop, newValue[prop]);
|
|
511
654
|
} else {
|
|
512
655
|
elm.style[prop] = newValue[prop];
|
|
513
656
|
}
|
|
514
657
|
}
|
|
515
658
|
}
|
|
516
|
-
} else if (
|
|
517
|
-
} else if (
|
|
659
|
+
} else if (BUILD9.vdomKey && memberName === "key") {
|
|
660
|
+
} else if (BUILD9.vdomRef && memberName === "ref") {
|
|
518
661
|
if (newValue) {
|
|
519
662
|
newValue(elm);
|
|
520
663
|
}
|
|
521
|
-
} else if (
|
|
664
|
+
} else if (BUILD9.vdomListener && (BUILD9.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
522
665
|
if (memberName[2] === "-") {
|
|
523
666
|
memberName = memberName.slice(3);
|
|
524
667
|
} else if (isMemberInElement(win, ln)) {
|
|
@@ -536,7 +679,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
536
679
|
plt.ael(elm, memberName, newValue, capture);
|
|
537
680
|
}
|
|
538
681
|
}
|
|
539
|
-
} else if (
|
|
682
|
+
} else if (BUILD9.vdomPropOrAttr) {
|
|
540
683
|
const isComplex = isComplexType(newValue);
|
|
541
684
|
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
542
685
|
try {
|
|
@@ -558,7 +701,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
558
701
|
}
|
|
559
702
|
}
|
|
560
703
|
let xlink = false;
|
|
561
|
-
if (
|
|
704
|
+
if (BUILD9.vdomXlink) {
|
|
562
705
|
if (ln !== (ln = ln.replace(/^xlink\:?/, ""))) {
|
|
563
706
|
memberName = ln;
|
|
564
707
|
xlink = true;
|
|
@@ -566,7 +709,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
566
709
|
}
|
|
567
710
|
if (newValue == null || newValue === false) {
|
|
568
711
|
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
569
|
-
if (
|
|
712
|
+
if (BUILD9.vdomXlink && xlink) {
|
|
570
713
|
elm.removeAttributeNS(XLINK_NS, memberName);
|
|
571
714
|
} else {
|
|
572
715
|
elm.removeAttribute(memberName);
|
|
@@ -574,7 +717,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
574
717
|
}
|
|
575
718
|
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
576
719
|
newValue = newValue === true ? "" : newValue;
|
|
577
|
-
if (
|
|
720
|
+
if (BUILD9.vdomXlink && xlink) {
|
|
578
721
|
elm.setAttributeNS(XLINK_NS, memberName, newValue);
|
|
579
722
|
} else {
|
|
580
723
|
elm.setAttribute(memberName, newValue);
|
|
@@ -584,16 +727,24 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
|
584
727
|
}
|
|
585
728
|
};
|
|
586
729
|
var parseClassListRegex = /\s/;
|
|
587
|
-
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
|
+
};
|
|
588
739
|
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
589
740
|
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
590
741
|
|
|
591
742
|
// src/runtime/vdom/update-element.ts
|
|
592
743
|
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
593
744
|
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
594
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ ||
|
|
595
|
-
const newVnodeAttrs = newVnode.$attrs$ ||
|
|
596
|
-
if (
|
|
745
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
746
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
747
|
+
if (BUILD10.updatable) {
|
|
597
748
|
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
598
749
|
if (!(memberName in newVnodeAttrs)) {
|
|
599
750
|
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
@@ -622,19 +773,16 @@ var useNativeShadowDom = false;
|
|
|
622
773
|
var checkSlotFallbackVisibility = false;
|
|
623
774
|
var checkSlotRelocate = false;
|
|
624
775
|
var isSvgMode = false;
|
|
625
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex
|
|
776
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
626
777
|
var _a;
|
|
627
778
|
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
628
779
|
let i2 = 0;
|
|
629
780
|
let elm;
|
|
630
781
|
let childNode;
|
|
631
782
|
let oldVNode;
|
|
632
|
-
if (
|
|
783
|
+
if (BUILD11.slotRelocation && !useNativeShadowDom) {
|
|
633
784
|
checkSlotRelocate = true;
|
|
634
785
|
if (newVNode2.$tag$ === "slot") {
|
|
635
|
-
if (scopeId) {
|
|
636
|
-
parentElm.classList.add(scopeId + "-s");
|
|
637
|
-
}
|
|
638
786
|
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
639
787
|
// slot element has fallback content
|
|
640
788
|
// still create an element that "mocks" the slot element
|
|
@@ -647,48 +795,43 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
647
795
|
);
|
|
648
796
|
}
|
|
649
797
|
}
|
|
650
|
-
if (
|
|
798
|
+
if (BUILD11.isDev && newVNode2.$elm$) {
|
|
651
799
|
consoleDevError(
|
|
652
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`
|
|
653
801
|
);
|
|
654
802
|
}
|
|
655
|
-
if (
|
|
803
|
+
if (BUILD11.vdomText && newVNode2.$text$ !== null) {
|
|
656
804
|
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
657
|
-
} else if (
|
|
658
|
-
elm = newVNode2.$elm$ =
|
|
805
|
+
} else if (BUILD11.slotRelocation && newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
806
|
+
elm = newVNode2.$elm$ = BUILD11.isDebug || BUILD11.hydrateServerSide ? slotReferenceDebugNode(newVNode2) : doc.createTextNode("");
|
|
659
807
|
} else {
|
|
660
|
-
if (
|
|
808
|
+
if (BUILD11.svg && !isSvgMode) {
|
|
661
809
|
isSvgMode = newVNode2.$tag$ === "svg";
|
|
662
810
|
}
|
|
663
|
-
elm = newVNode2.$elm$ =
|
|
811
|
+
elm = newVNode2.$elm$ = BUILD11.svg ? doc.createElementNS(
|
|
664
812
|
isSvgMode ? SVG_NS : HTML_NS,
|
|
665
|
-
!useNativeShadowDom &&
|
|
813
|
+
!useNativeShadowDom && BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
666
814
|
) : doc.createElement(
|
|
667
|
-
!useNativeShadowDom &&
|
|
815
|
+
!useNativeShadowDom && BUILD11.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
668
816
|
);
|
|
669
|
-
if (
|
|
817
|
+
if (BUILD11.svg && isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
670
818
|
isSvgMode = false;
|
|
671
819
|
}
|
|
672
|
-
if (
|
|
820
|
+
if (BUILD11.vdomAttribute) {
|
|
673
821
|
updateElement(null, newVNode2, isSvgMode);
|
|
674
822
|
}
|
|
675
|
-
|
|
676
|
-
const isElementWithinShadowRoot = !rootNode.querySelector("body");
|
|
677
|
-
if (!isElementWithinShadowRoot && BUILD10.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
823
|
+
if (BUILD11.scoped && isDef(scopeId) && elm["s-si"] !== scopeId) {
|
|
678
824
|
elm.classList.add(elm["s-si"] = scopeId);
|
|
679
825
|
}
|
|
680
|
-
if (BUILD10.scoped) {
|
|
681
|
-
updateElementScopeIds(elm, parentElm);
|
|
682
|
-
}
|
|
683
826
|
if (newVNode2.$children$) {
|
|
684
827
|
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
685
|
-
childNode = createElm(oldParentVNode, newVNode2, i2
|
|
828
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
686
829
|
if (childNode) {
|
|
687
830
|
elm.appendChild(childNode);
|
|
688
831
|
}
|
|
689
832
|
}
|
|
690
833
|
}
|
|
691
|
-
if (
|
|
834
|
+
if (BUILD11.svg) {
|
|
692
835
|
if (newVNode2.$tag$ === "svg") {
|
|
693
836
|
isSvgMode = false;
|
|
694
837
|
} else if (elm.tagName === "foreignObject") {
|
|
@@ -697,7 +840,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
697
840
|
}
|
|
698
841
|
}
|
|
699
842
|
elm["s-hn"] = hostTagName;
|
|
700
|
-
if (
|
|
843
|
+
if (BUILD11.slotRelocation) {
|
|
701
844
|
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
702
845
|
elm["s-sr"] = true;
|
|
703
846
|
elm["s-cr"] = contentRef;
|
|
@@ -705,12 +848,15 @@ var createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
|
|
|
705
848
|
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
706
849
|
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
707
850
|
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
708
|
-
if (
|
|
851
|
+
if (BUILD11.experimentalSlotFixes) {
|
|
709
852
|
relocateToHostRoot(oldParentVNode.$elm$);
|
|
710
853
|
} else {
|
|
711
854
|
putBackInOriginalLocation(oldParentVNode.$elm$, false);
|
|
712
855
|
}
|
|
713
856
|
}
|
|
857
|
+
if (BUILD11.scoped) {
|
|
858
|
+
addRemoveSlotScopedClass(contentRef, elm, newParentVNode.$elm$, oldParentVNode == null ? void 0 : oldParentVNode.$elm$);
|
|
859
|
+
}
|
|
714
860
|
}
|
|
715
861
|
}
|
|
716
862
|
return elm;
|
|
@@ -738,7 +884,7 @@ var relocateToHostRoot = (parentElm) => {
|
|
|
738
884
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
739
885
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
740
886
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
741
|
-
if (parentElm["s-sr"] &&
|
|
887
|
+
if (parentElm["s-sr"] && BUILD11.experimentalSlotFixes) {
|
|
742
888
|
let node = parentElm;
|
|
743
889
|
while (node = node.nextSibling) {
|
|
744
890
|
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
@@ -749,7 +895,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
749
895
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
750
896
|
const childNode = oldSlotChildNodes[i2];
|
|
751
897
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
752
|
-
insertBefore(
|
|
898
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
753
899
|
childNode["s-ol"].remove();
|
|
754
900
|
childNode["s-ol"] = void 0;
|
|
755
901
|
childNode["s-sh"] = void 0;
|
|
@@ -762,17 +908,17 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
762
908
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
763
909
|
};
|
|
764
910
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
765
|
-
let containerElm =
|
|
911
|
+
let containerElm = BUILD11.slotRelocation && parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
766
912
|
let childNode;
|
|
767
|
-
if (
|
|
913
|
+
if (BUILD11.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
768
914
|
containerElm = containerElm.shadowRoot;
|
|
769
915
|
}
|
|
770
916
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
771
917
|
if (vnodes[startIdx]) {
|
|
772
|
-
childNode = createElm(null, parentVNode, startIdx
|
|
918
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
773
919
|
if (childNode) {
|
|
774
920
|
vnodes[startIdx].$elm$ = childNode;
|
|
775
|
-
insertBefore(containerElm, childNode,
|
|
921
|
+
insertBefore(containerElm, childNode, BUILD11.slotRelocation ? referenceNode(before) : before);
|
|
776
922
|
}
|
|
777
923
|
}
|
|
778
924
|
}
|
|
@@ -784,7 +930,7 @@ var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
|
784
930
|
const elm = vnode.$elm$;
|
|
785
931
|
nullifyVNodeRefs(vnode);
|
|
786
932
|
if (elm) {
|
|
787
|
-
if (
|
|
933
|
+
if (BUILD11.slotRelocation) {
|
|
788
934
|
checkSlotFallbackVisibility = true;
|
|
789
935
|
if (elm["s-ol"]) {
|
|
790
936
|
elm["s-ol"].remove();
|
|
@@ -828,7 +974,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
828
974
|
oldEndVnode = oldCh[--oldEndIdx];
|
|
829
975
|
newEndVnode = newCh[--newEndIdx];
|
|
830
976
|
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
831
|
-
if (
|
|
977
|
+
if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
832
978
|
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
833
979
|
}
|
|
834
980
|
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
@@ -836,7 +982,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
836
982
|
oldStartVnode = oldCh[++oldStartIdx];
|
|
837
983
|
newEndVnode = newCh[--newEndIdx];
|
|
838
984
|
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
839
|
-
if (
|
|
985
|
+
if (BUILD11.slotRelocation && (oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
840
986
|
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
841
987
|
}
|
|
842
988
|
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
@@ -845,7 +991,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
845
991
|
newStartVnode = newCh[++newStartIdx];
|
|
846
992
|
} else {
|
|
847
993
|
idxInOld = -1;
|
|
848
|
-
if (
|
|
994
|
+
if (BUILD11.vdomKey) {
|
|
849
995
|
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
850
996
|
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
851
997
|
idxInOld = i2;
|
|
@@ -853,10 +999,10 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
853
999
|
}
|
|
854
1000
|
}
|
|
855
1001
|
}
|
|
856
|
-
if (
|
|
1002
|
+
if (BUILD11.vdomKey && idxInOld >= 0) {
|
|
857
1003
|
elmToMove = oldCh[idxInOld];
|
|
858
1004
|
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
859
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld
|
|
1005
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
860
1006
|
} else {
|
|
861
1007
|
patch(elmToMove, newStartVnode, isInitialRender);
|
|
862
1008
|
oldCh[idxInOld] = void 0;
|
|
@@ -864,12 +1010,16 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
864
1010
|
}
|
|
865
1011
|
newStartVnode = newCh[++newStartIdx];
|
|
866
1012
|
} else {
|
|
867
|
-
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx
|
|
1013
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
868
1014
|
newStartVnode = newCh[++newStartIdx];
|
|
869
1015
|
}
|
|
870
1016
|
if (node) {
|
|
871
|
-
if (
|
|
872
|
-
insertBefore(
|
|
1017
|
+
if (BUILD11.slotRelocation) {
|
|
1018
|
+
insertBefore(
|
|
1019
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1020
|
+
node,
|
|
1021
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1022
|
+
);
|
|
873
1023
|
} else {
|
|
874
1024
|
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
875
1025
|
}
|
|
@@ -885,35 +1035,26 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
|
|
|
885
1035
|
newStartIdx,
|
|
886
1036
|
newEndIdx
|
|
887
1037
|
);
|
|
888
|
-
} else if (
|
|
1038
|
+
} else if (BUILD11.updatable && newStartIdx > newEndIdx) {
|
|
889
1039
|
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
890
1040
|
}
|
|
891
1041
|
};
|
|
892
1042
|
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
893
1043
|
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
894
|
-
if (
|
|
895
|
-
if (
|
|
896
|
-
// The component gets hydrated and no VDOM has been initialized.
|
|
897
|
-
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
898
|
-
"$nodeId$" in leftVNode && isInitialRender && // `leftNode` is not from type HTMLComment which would cause many
|
|
899
|
-
// hydration comments to be removed
|
|
900
|
-
leftVNode.$elm$.nodeType !== 8
|
|
901
|
-
) {
|
|
902
|
-
return false;
|
|
903
|
-
}
|
|
1044
|
+
if (BUILD11.slotRelocation && leftVNode.$tag$ === "slot") {
|
|
904
1045
|
return leftVNode.$name$ === rightVNode.$name$;
|
|
905
1046
|
}
|
|
906
|
-
if (
|
|
1047
|
+
if (BUILD11.vdomKey && !isInitialRender) {
|
|
907
1048
|
return leftVNode.$key$ === rightVNode.$key$;
|
|
908
1049
|
}
|
|
1050
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1051
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1052
|
+
}
|
|
909
1053
|
return true;
|
|
910
1054
|
}
|
|
911
1055
|
return false;
|
|
912
1056
|
};
|
|
913
|
-
var referenceNode = (node) =>
|
|
914
|
-
return node && node["s-ol"] || node;
|
|
915
|
-
};
|
|
916
|
-
var parentReferenceNode = (node) => (node["s-ol"] ? node["s-ol"] : node).parentNode;
|
|
1057
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
917
1058
|
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
918
1059
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
919
1060
|
const oldChildren = oldVNode.$children$;
|
|
@@ -921,13 +1062,13 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
921
1062
|
const tag = newVNode2.$tag$;
|
|
922
1063
|
const text = newVNode2.$text$;
|
|
923
1064
|
let defaultHolder;
|
|
924
|
-
if (!
|
|
925
|
-
if (
|
|
1065
|
+
if (!BUILD11.vdomText || text === null) {
|
|
1066
|
+
if (BUILD11.svg) {
|
|
926
1067
|
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
927
1068
|
}
|
|
928
|
-
if (
|
|
929
|
-
if (
|
|
930
|
-
if (
|
|
1069
|
+
if (BUILD11.vdomAttribute || BUILD11.reflect) {
|
|
1070
|
+
if (BUILD11.slot && tag === "slot" && !useNativeShadowDom) {
|
|
1071
|
+
if (BUILD11.experimentalSlotFixes && oldVNode.$name$ !== newVNode2.$name$) {
|
|
931
1072
|
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
932
1073
|
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
933
1074
|
}
|
|
@@ -935,55 +1076,28 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
935
1076
|
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
936
1077
|
}
|
|
937
1078
|
}
|
|
938
|
-
if (
|
|
1079
|
+
if (BUILD11.updatable && oldChildren !== null && newChildren !== null) {
|
|
939
1080
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
940
1081
|
} else if (newChildren !== null) {
|
|
941
|
-
if (
|
|
1082
|
+
if (BUILD11.updatable && BUILD11.vdomText && oldVNode.$text$ !== null) {
|
|
942
1083
|
elm.textContent = "";
|
|
943
1084
|
}
|
|
944
1085
|
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
945
1086
|
} else if (
|
|
946
1087
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
947
|
-
!isInitialRender &&
|
|
1088
|
+
!isInitialRender && BUILD11.updatable && oldChildren !== null
|
|
948
1089
|
) {
|
|
949
1090
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
950
1091
|
}
|
|
951
|
-
if (
|
|
1092
|
+
if (BUILD11.svg && isSvgMode && tag === "svg") {
|
|
952
1093
|
isSvgMode = false;
|
|
953
1094
|
}
|
|
954
|
-
} else if (
|
|
1095
|
+
} else if (BUILD11.vdomText && BUILD11.slotRelocation && (defaultHolder = elm["s-cr"])) {
|
|
955
1096
|
defaultHolder.parentNode.textContent = text;
|
|
956
|
-
} else if (
|
|
1097
|
+
} else if (BUILD11.vdomText && oldVNode.$text$ !== text) {
|
|
957
1098
|
elm.data = text;
|
|
958
1099
|
}
|
|
959
1100
|
};
|
|
960
|
-
var updateFallbackSlotVisibility = (elm) => {
|
|
961
|
-
const childNodes = elm.__childNodes || elm.childNodes;
|
|
962
|
-
for (const childNode of childNodes) {
|
|
963
|
-
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
964
|
-
if (childNode["s-sr"]) {
|
|
965
|
-
const slotName = childNode["s-sn"];
|
|
966
|
-
childNode.hidden = false;
|
|
967
|
-
for (const siblingNode of childNodes) {
|
|
968
|
-
if (siblingNode !== childNode) {
|
|
969
|
-
if (siblingNode["s-hn"] !== childNode["s-hn"] || slotName !== "") {
|
|
970
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ && (slotName === siblingNode.getAttribute("slot") || slotName === siblingNode["s-sn"]) || siblingNode.nodeType === 3 /* TextNode */ && slotName === siblingNode["s-sn"]) {
|
|
971
|
-
childNode.hidden = true;
|
|
972
|
-
break;
|
|
973
|
-
}
|
|
974
|
-
} else if (slotName === siblingNode["s-sn"]) {
|
|
975
|
-
if (siblingNode.nodeType === 1 /* ElementNode */ || siblingNode.nodeType === 3 /* TextNode */ && siblingNode.textContent.trim() !== "") {
|
|
976
|
-
childNode.hidden = true;
|
|
977
|
-
break;
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
updateFallbackSlotVisibility(childNode);
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
};
|
|
987
1101
|
var relocateNodes = [];
|
|
988
1102
|
var markSlotContentForRelocation = (elm) => {
|
|
989
1103
|
let node;
|
|
@@ -996,7 +1110,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
996
1110
|
const slotName = childNode["s-sn"];
|
|
997
1111
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
998
1112
|
node = hostContentNodes[j];
|
|
999
|
-
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"])) {
|
|
1000
1114
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1001
1115
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1002
1116
|
checkSlotFallbackVisibility = true;
|
|
@@ -1034,60 +1148,40 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1034
1148
|
}
|
|
1035
1149
|
}
|
|
1036
1150
|
};
|
|
1037
|
-
var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
1038
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1039
|
-
if (nodeToRelocate.getAttribute("slot") === null && slotName === "") {
|
|
1040
|
-
return true;
|
|
1041
|
-
}
|
|
1042
|
-
if (nodeToRelocate.getAttribute("slot") === slotName) {
|
|
1043
|
-
return true;
|
|
1044
|
-
}
|
|
1045
|
-
return false;
|
|
1046
|
-
}
|
|
1047
|
-
if (nodeToRelocate["s-sn"] === slotName) {
|
|
1048
|
-
return true;
|
|
1049
|
-
}
|
|
1050
|
-
return slotName === "";
|
|
1051
|
-
};
|
|
1052
1151
|
var nullifyVNodeRefs = (vNode) => {
|
|
1053
|
-
if (
|
|
1152
|
+
if (BUILD11.vdomRef) {
|
|
1054
1153
|
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1055
1154
|
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1056
1155
|
}
|
|
1057
1156
|
};
|
|
1058
1157
|
var insertBefore = (parent, newNode, reference) => {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
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);
|
|
1062
1160
|
}
|
|
1161
|
+
const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1063
1162
|
return inserted;
|
|
1064
1163
|
};
|
|
1065
|
-
|
|
1066
|
-
const scopeIds = [];
|
|
1067
|
-
if (element) {
|
|
1068
|
-
scopeIds.push(
|
|
1069
|
-
...element["s-scs"] || [],
|
|
1070
|
-
element["s-si"],
|
|
1071
|
-
element["s-sc"],
|
|
1072
|
-
...findScopeIds(element.parentElement)
|
|
1073
|
-
);
|
|
1074
|
-
}
|
|
1075
|
-
return scopeIds;
|
|
1076
|
-
};
|
|
1077
|
-
var updateElementScopeIds = (element, parent, iterateChildNodes = false) => {
|
|
1164
|
+
function addRemoveSlotScopedClass(reference, slotNode, newParent, oldParent) {
|
|
1078
1165
|
var _a;
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
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;
|
|
1086
1178
|
}
|
|
1179
|
+
child = child.nextSibling;
|
|
1087
1180
|
}
|
|
1181
|
+
if (!found) oldParent.classList.remove(scopeId2 + "-s");
|
|
1088
1182
|
}
|
|
1089
1183
|
}
|
|
1090
|
-
}
|
|
1184
|
+
}
|
|
1091
1185
|
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1092
1186
|
var _a, _b, _c, _d, _e;
|
|
1093
1187
|
const hostElm = hostRef.$hostElement$;
|
|
@@ -1095,7 +1189,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1095
1189
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1096
1190
|
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1097
1191
|
hostTagName = hostElm.tagName;
|
|
1098
|
-
if (
|
|
1192
|
+
if (BUILD11.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
1099
1193
|
throw new Error(`The <Host> must be the single root component.
|
|
1100
1194
|
Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
|
|
1101
1195
|
|
|
@@ -1109,7 +1203,7 @@ render() {
|
|
|
1109
1203
|
}
|
|
1110
1204
|
`);
|
|
1111
1205
|
}
|
|
1112
|
-
if (
|
|
1206
|
+
if (BUILD11.reflect && cmpMeta.$attrsToReflect$) {
|
|
1113
1207
|
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
1114
1208
|
cmpMeta.$attrsToReflect$.map(
|
|
1115
1209
|
([propName, attribute]) => rootVnode.$attrs$[attribute] = hostElm[propName]
|
|
@@ -1125,24 +1219,24 @@ render() {
|
|
|
1125
1219
|
rootVnode.$tag$ = null;
|
|
1126
1220
|
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1127
1221
|
hostRef.$vnode$ = rootVnode;
|
|
1128
|
-
rootVnode.$elm$ = oldVNode.$elm$ =
|
|
1129
|
-
if (
|
|
1222
|
+
rootVnode.$elm$ = oldVNode.$elm$ = BUILD11.shadowDom ? hostElm.shadowRoot || hostElm : hostElm;
|
|
1223
|
+
if (BUILD11.scoped || BUILD11.shadowDom) {
|
|
1130
1224
|
scopeId = hostElm["s-sc"];
|
|
1131
1225
|
}
|
|
1132
1226
|
useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1133
|
-
if (
|
|
1227
|
+
if (BUILD11.slotRelocation) {
|
|
1134
1228
|
contentRef = hostElm["s-cr"];
|
|
1135
1229
|
checkSlotFallbackVisibility = false;
|
|
1136
1230
|
}
|
|
1137
1231
|
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1138
|
-
if (
|
|
1232
|
+
if (BUILD11.slotRelocation) {
|
|
1139
1233
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1140
1234
|
if (checkSlotRelocate) {
|
|
1141
1235
|
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1142
1236
|
for (const relocateData of relocateNodes) {
|
|
1143
1237
|
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1144
1238
|
if (!nodeToRelocate["s-ol"]) {
|
|
1145
|
-
const orgLocationNode =
|
|
1239
|
+
const orgLocationNode = BUILD11.isDebug || BUILD11.hydrateServerSide ? originalLocationDebugNode(nodeToRelocate) : doc.createTextNode("");
|
|
1146
1240
|
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1147
1241
|
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1148
1242
|
}
|
|
@@ -1153,7 +1247,7 @@ render() {
|
|
|
1153
1247
|
if (slotRefNode) {
|
|
1154
1248
|
const parentNodeRef = slotRefNode.parentNode;
|
|
1155
1249
|
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1156
|
-
if (!
|
|
1250
|
+
if (!BUILD11.hydrateServerSide && (!BUILD11.experimentalSlotFixes || insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
1157
1251
|
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1158
1252
|
while (orgLocationNode) {
|
|
1159
1253
|
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
@@ -1172,11 +1266,11 @@ render() {
|
|
|
1172
1266
|
}
|
|
1173
1267
|
if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
|
|
1174
1268
|
if (nodeToRelocate !== insertBeforeNode) {
|
|
1175
|
-
if (!
|
|
1269
|
+
if (!BUILD11.experimentalSlotFixes && !nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
|
|
1176
1270
|
nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
|
|
1177
1271
|
}
|
|
1178
1272
|
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1179
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1273
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1180
1274
|
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1181
1275
|
}
|
|
1182
1276
|
}
|
|
@@ -1198,7 +1292,7 @@ render() {
|
|
|
1198
1292
|
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1199
1293
|
relocateNodes.length = 0;
|
|
1200
1294
|
}
|
|
1201
|
-
if (
|
|
1295
|
+
if (BUILD11.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1202
1296
|
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1203
1297
|
for (const childNode of children) {
|
|
1204
1298
|
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
@@ -1235,9 +1329,9 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
1235
1329
|
const orgCloneNode = HostElementPrototype.cloneNode;
|
|
1236
1330
|
HostElementPrototype.cloneNode = function(deep) {
|
|
1237
1331
|
const srcNode = this;
|
|
1238
|
-
const isShadowDom =
|
|
1332
|
+
const isShadowDom = BUILD12.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
|
|
1239
1333
|
const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
|
|
1240
|
-
if (
|
|
1334
|
+
if (BUILD12.slot && !isShadowDom && deep) {
|
|
1241
1335
|
let i2 = 0;
|
|
1242
1336
|
let slotted, nonRindoNode;
|
|
1243
1337
|
const rindoPrivates = [
|
|
@@ -1262,7 +1356,7 @@ var patchCloneNode = (HostElementPrototype) => {
|
|
|
1262
1356
|
slotted = childNodes[i2]["s-nr"];
|
|
1263
1357
|
nonRindoNode = rindoPrivates.every((privateField) => !childNodes[i2][privateField]);
|
|
1264
1358
|
if (slotted) {
|
|
1265
|
-
if (
|
|
1359
|
+
if (BUILD12.appendChildSlotFix && clonedNode.__appendChild) {
|
|
1266
1360
|
clonedNode.__appendChild(slotted.cloneNode(true));
|
|
1267
1361
|
} else {
|
|
1268
1362
|
clonedNode.appendChild(slotted.cloneNode(true));
|
|
@@ -1280,7 +1374,7 @@ var patchSlotAppendChild = (HostElementPrototype) => {
|
|
|
1280
1374
|
HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
|
|
1281
1375
|
HostElementPrototype.appendChild = function(newChild) {
|
|
1282
1376
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1283
|
-
const slotNode =
|
|
1377
|
+
const slotNode = getHostSlotNodes(this.__childNodes || this.childNodes, this.tagName, slotName)[0];
|
|
1284
1378
|
if (slotNode) {
|
|
1285
1379
|
addSlotRelocateNode(newChild, slotNode);
|
|
1286
1380
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
@@ -1297,7 +1391,7 @@ var patchSlotRemoveChild = (ElementPrototype) => {
|
|
|
1297
1391
|
ElementPrototype.removeChild = function(toRemove) {
|
|
1298
1392
|
if (toRemove && typeof toRemove["s-sn"] !== "undefined") {
|
|
1299
1393
|
const childNodes = this.__childNodes || this.childNodes;
|
|
1300
|
-
const slotNode =
|
|
1394
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, toRemove["s-sn"]);
|
|
1301
1395
|
if (slotNode && toRemove.isConnected) {
|
|
1302
1396
|
toRemove.remove();
|
|
1303
1397
|
updateFallbackSlotVisibility(this);
|
|
@@ -1316,7 +1410,7 @@ var patchSlotPrepend = (HostElementPrototype) => {
|
|
|
1316
1410
|
}
|
|
1317
1411
|
const slotName = newChild["s-sn"] = getSlotName(newChild);
|
|
1318
1412
|
const childNodes = this.__childNodes || this.childNodes;
|
|
1319
|
-
const slotNode =
|
|
1413
|
+
const slotNode = getHostSlotNodes(childNodes, this.tagName, slotName)[0];
|
|
1320
1414
|
if (slotNode) {
|
|
1321
1415
|
addSlotRelocateNode(newChild, slotNode, true);
|
|
1322
1416
|
const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
|
|
@@ -1383,11 +1477,7 @@ var patchSlotInsertAdjacentElement = (HostElementPrototype) => {
|
|
|
1383
1477
|
};
|
|
1384
1478
|
};
|
|
1385
1479
|
var patchTextContent = (hostElementPrototype) => {
|
|
1386
|
-
|
|
1387
|
-
if (!descriptor) {
|
|
1388
|
-
descriptor = Object.getOwnPropertyDescriptor(hostElementPrototype, "textContent");
|
|
1389
|
-
}
|
|
1390
|
-
if (descriptor) Object.defineProperty(hostElementPrototype, "__textContent", descriptor);
|
|
1480
|
+
patchHostOriginalAccessor("textContent", hostElementPrototype);
|
|
1391
1481
|
Object.defineProperty(hostElementPrototype, "textContent", {
|
|
1392
1482
|
get: function() {
|
|
1393
1483
|
let text = "";
|
|
@@ -1411,16 +1501,7 @@ var patchChildSlotNodes = (elm) => {
|
|
|
1411
1501
|
return this[n];
|
|
1412
1502
|
}
|
|
1413
1503
|
}
|
|
1414
|
-
|
|
1415
|
-
if (!childNodesFn) {
|
|
1416
|
-
childNodesFn = Object.getOwnPropertyDescriptor(elm, "childNodes");
|
|
1417
|
-
}
|
|
1418
|
-
if (childNodesFn) Object.defineProperty(elm, "__childNodes", childNodesFn);
|
|
1419
|
-
let childrenFn = Object.getOwnPropertyDescriptor(Element.prototype, "children");
|
|
1420
|
-
if (!childrenFn) {
|
|
1421
|
-
childrenFn = Object.getOwnPropertyDescriptor(elm, "children");
|
|
1422
|
-
}
|
|
1423
|
-
if (childrenFn) Object.defineProperty(elm, "__children", childrenFn);
|
|
1504
|
+
patchHostOriginalAccessor("children", elm);
|
|
1424
1505
|
Object.defineProperty(elm, "children", {
|
|
1425
1506
|
get() {
|
|
1426
1507
|
return this.childNodes.filter((n) => n.nodeType === 1);
|
|
@@ -1431,7 +1512,19 @@ var patchChildSlotNodes = (elm) => {
|
|
|
1431
1512
|
return this.children.length;
|
|
1432
1513
|
}
|
|
1433
1514
|
});
|
|
1434
|
-
|
|
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);
|
|
1435
1528
|
Object.defineProperty(elm, "childNodes", {
|
|
1436
1529
|
get() {
|
|
1437
1530
|
var _a, _b;
|
|
@@ -1445,77 +1538,102 @@ var patchChildSlotNodes = (elm) => {
|
|
|
1445
1538
|
}
|
|
1446
1539
|
});
|
|
1447
1540
|
};
|
|
1448
|
-
var
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
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);
|
|
1455
1548
|
}
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
1470
|
-
return 0;
|
|
1471
|
-
});
|
|
1472
|
-
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
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;
|
|
1473
1562
|
}
|
|
1474
|
-
}
|
|
1475
|
-
appendMethod.call(parent, slottedNodeLocation);
|
|
1476
|
-
}
|
|
1477
|
-
newChild["s-ol"] = slottedNodeLocation;
|
|
1478
|
-
newChild["s-sh"] = slotNode["s-hn"];
|
|
1563
|
+
});
|
|
1479
1564
|
};
|
|
1480
|
-
var
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
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;
|
|
1486
1577
|
}
|
|
1487
|
-
}
|
|
1488
|
-
return result;
|
|
1578
|
+
});
|
|
1489
1579
|
};
|
|
1490
|
-
var
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
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;
|
|
1498
1592
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
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;
|
|
1502
1607
|
}
|
|
1503
|
-
}
|
|
1504
|
-
return null;
|
|
1608
|
+
});
|
|
1505
1609
|
};
|
|
1506
|
-
var
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
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);
|
|
1510
1625
|
}
|
|
1511
|
-
|
|
1512
|
-
|
|
1626
|
+
if (!accessor) {
|
|
1627
|
+
accessor = Object.getOwnPropertyDescriptor(node, accessorName);
|
|
1628
|
+
}
|
|
1629
|
+
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
1630
|
+
}
|
|
1513
1631
|
|
|
1514
1632
|
// src/runtime/profile.ts
|
|
1515
|
-
import { BUILD as
|
|
1633
|
+
import { BUILD as BUILD13 } from "@rindo/core/internal/app-data";
|
|
1516
1634
|
var i = 0;
|
|
1517
1635
|
var createTime = (fnName, tagName = "") => {
|
|
1518
|
-
if (
|
|
1636
|
+
if (BUILD13.profile && performance.mark) {
|
|
1519
1637
|
const key = `st:${fnName}:${tagName}:${i++}`;
|
|
1520
1638
|
performance.mark(key);
|
|
1521
1639
|
return () => performance.measure(`[Rindo] ${fnName}() <${tagName}>`, key);
|
|
@@ -1526,7 +1644,7 @@ var createTime = (fnName, tagName = "") => {
|
|
|
1526
1644
|
}
|
|
1527
1645
|
};
|
|
1528
1646
|
var uniqueTime = (key, measureText) => {
|
|
1529
|
-
if (
|
|
1647
|
+
if (BUILD13.profile && performance.mark) {
|
|
1530
1648
|
if (performance.getEntriesByName(key, "mark").length === 0) {
|
|
1531
1649
|
performance.mark(key);
|
|
1532
1650
|
}
|
|
@@ -1584,7 +1702,7 @@ var inspect = (ref) => {
|
|
|
1584
1702
|
};
|
|
1585
1703
|
};
|
|
1586
1704
|
var installDevTools = () => {
|
|
1587
|
-
if (
|
|
1705
|
+
if (BUILD13.devTools) {
|
|
1588
1706
|
const rindo = win.rindo = win.rindo || {};
|
|
1589
1707
|
const originalInspect = rindo.inspect;
|
|
1590
1708
|
rindo.inspect = (ref) => {
|
|
@@ -1604,9 +1722,19 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1604
1722
|
const childRenderNodes = [];
|
|
1605
1723
|
const slotNodes = [];
|
|
1606
1724
|
const slottedNodes = [];
|
|
1607
|
-
const shadowRootNodes =
|
|
1725
|
+
const shadowRootNodes = BUILD14.shadowDom && shadowRoot ? [] : null;
|
|
1608
1726
|
const vnode = newVNode(tagName, null);
|
|
1609
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
|
+
}
|
|
1610
1738
|
if (!plt.$orgLocNodes$) {
|
|
1611
1739
|
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1612
1740
|
}
|
|
@@ -1636,6 +1764,18 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1636
1764
|
node["s-cr"] = hostElm["s-cr"];
|
|
1637
1765
|
}
|
|
1638
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
|
+
}
|
|
1639
1779
|
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
1640
1780
|
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
1641
1781
|
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
@@ -1648,8 +1788,8 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1648
1788
|
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1649
1789
|
}
|
|
1650
1790
|
const hosts = [];
|
|
1651
|
-
let snIndex = 0;
|
|
1652
1791
|
const snLen = slottedNodes.length;
|
|
1792
|
+
let snIndex = 0;
|
|
1653
1793
|
let slotGroup;
|
|
1654
1794
|
let snGroupIdx;
|
|
1655
1795
|
let snGroupLen;
|
|
@@ -1671,17 +1811,24 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1671
1811
|
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1672
1812
|
slottedItem.slot["s-cr"] = hostEle;
|
|
1673
1813
|
} else {
|
|
1674
|
-
|
|
1675
|
-
slottedItem.slot["s-cr"] = hostChildren[0];
|
|
1814
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1676
1815
|
}
|
|
1677
1816
|
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1817
|
+
if (BUILD14.experimentalSlotFixes) {
|
|
1818
|
+
patchNextPrev(slottedItem.node);
|
|
1819
|
+
}
|
|
1678
1820
|
}
|
|
1679
1821
|
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
1680
1822
|
hostEle.appendChild(slottedItem.node);
|
|
1681
1823
|
}
|
|
1682
1824
|
}
|
|
1683
1825
|
}
|
|
1684
|
-
if (
|
|
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) {
|
|
1685
1832
|
let rnIdex = 0;
|
|
1686
1833
|
const rnLen = shadowRootNodes.length;
|
|
1687
1834
|
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
@@ -1715,15 +1862,19 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1715
1862
|
$index$: childIdSplt[3],
|
|
1716
1863
|
$tag$: node.tagName.toLowerCase(),
|
|
1717
1864
|
$elm$: node,
|
|
1718
|
-
// If we don't add the initial classes to the VNode, the first `vdom-render.ts`
|
|
1719
|
-
//
|
|
1720
|
-
$attrs$: { class: node.className }
|
|
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 || "" }
|
|
1721
1868
|
});
|
|
1722
1869
|
childRenderNodes.push(childVNode);
|
|
1723
1870
|
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
1724
1871
|
if (!parentVNode.$children$) {
|
|
1725
1872
|
parentVNode.$children$ = [];
|
|
1726
1873
|
}
|
|
1874
|
+
if (BUILD14.scoped && scopeId2) {
|
|
1875
|
+
node["s-si"] = scopeId2;
|
|
1876
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
1877
|
+
}
|
|
1727
1878
|
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
1728
1879
|
if (typeof slotName === "string") {
|
|
1729
1880
|
if (childVNode.$tag$ === "slot-fb") {
|
|
@@ -1738,6 +1889,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1738
1889
|
shadowRootNodes,
|
|
1739
1890
|
slottedNodes
|
|
1740
1891
|
);
|
|
1892
|
+
if (BUILD14.scoped && scopeId2) {
|
|
1893
|
+
node.classList.add(scopeId2);
|
|
1894
|
+
}
|
|
1741
1895
|
}
|
|
1742
1896
|
childVNode.$elm$["s-sn"] = slotName;
|
|
1743
1897
|
childVNode.$elm$.removeAttribute("s-sn");
|
|
@@ -1745,7 +1899,6 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1745
1899
|
if (childVNode.$index$ !== void 0) {
|
|
1746
1900
|
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1747
1901
|
}
|
|
1748
|
-
if (scopeId2) node["s-si"] = scopeId2;
|
|
1749
1902
|
parentVNode = childVNode;
|
|
1750
1903
|
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1751
1904
|
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
@@ -1820,8 +1973,7 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1820
1973
|
}
|
|
1821
1974
|
} else if (childVNode.$hostId$ === hostId) {
|
|
1822
1975
|
if (childNodeType === SLOT_NODE_ID) {
|
|
1823
|
-
|
|
1824
|
-
const slotName = node["s-sn"] = childVNode.$name$ = childIdSplt[5] || "";
|
|
1976
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
1825
1977
|
addSlot(
|
|
1826
1978
|
slotName,
|
|
1827
1979
|
childIdSplt[2],
|
|
@@ -1834,9 +1986,9 @@ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes,
|
|
|
1834
1986
|
slottedNodes
|
|
1835
1987
|
);
|
|
1836
1988
|
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1837
|
-
if (
|
|
1989
|
+
if (BUILD14.shadowDom && shadowRootNodes) {
|
|
1838
1990
|
node.remove();
|
|
1839
|
-
} else if (
|
|
1991
|
+
} else if (BUILD14.slotRelocation) {
|
|
1840
1992
|
hostElm["s-cr"] = node;
|
|
1841
1993
|
node["s-cn"] = true;
|
|
1842
1994
|
}
|
|
@@ -1895,8 +2047,10 @@ var createSimpleVNode = (vnode) => {
|
|
|
1895
2047
|
};
|
|
1896
2048
|
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1897
2049
|
node["s-sr"] = true;
|
|
2050
|
+
childVNode.$name$ = slotName || null;
|
|
2051
|
+
childVNode.$tag$ = "slot";
|
|
1898
2052
|
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1899
|
-
if (
|
|
2053
|
+
if (BUILD14.shadowDom && shadowRootNodes) {
|
|
1900
2054
|
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
1901
2055
|
if (childVNode.$name$) {
|
|
1902
2056
|
childVNode.$elm$.setAttribute("name", slotName);
|
|
@@ -1937,7 +2091,7 @@ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) =>
|
|
|
1937
2091
|
};
|
|
1938
2092
|
|
|
1939
2093
|
// src/runtime/initialize-component.ts
|
|
1940
|
-
import { BUILD as
|
|
2094
|
+
import { BUILD as BUILD22 } from "@rindo/core/internal/app-data";
|
|
1941
2095
|
|
|
1942
2096
|
// src/runtime/mode.ts
|
|
1943
2097
|
var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
|
|
@@ -1945,22 +2099,22 @@ var setMode = (handler) => modeResolutionChain.push(handler);
|
|
|
1945
2099
|
var getMode = (ref) => getHostRef(ref).$modeName$;
|
|
1946
2100
|
|
|
1947
2101
|
// src/runtime/proxy-component.ts
|
|
1948
|
-
import { BUILD as
|
|
2102
|
+
import { BUILD as BUILD21 } from "@rindo/core/internal/app-data";
|
|
1949
2103
|
|
|
1950
2104
|
// src/runtime/set-value.ts
|
|
1951
|
-
import { BUILD as
|
|
2105
|
+
import { BUILD as BUILD20 } from "@rindo/core/internal/app-data";
|
|
1952
2106
|
|
|
1953
2107
|
// src/runtime/parse-property-value.ts
|
|
1954
|
-
import { BUILD as
|
|
2108
|
+
import { BUILD as BUILD15 } from "@rindo/core/internal/app-data";
|
|
1955
2109
|
var parsePropertyValue = (propValue, propType) => {
|
|
1956
2110
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1957
|
-
if (
|
|
2111
|
+
if (BUILD15.propBoolean && propType & 4 /* Boolean */) {
|
|
1958
2112
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1959
2113
|
}
|
|
1960
|
-
if (
|
|
2114
|
+
if (BUILD15.propNumber && propType & 2 /* Number */) {
|
|
1961
2115
|
return parseFloat(propValue);
|
|
1962
2116
|
}
|
|
1963
|
-
if (
|
|
2117
|
+
if (BUILD15.propString && propType & 1 /* String */) {
|
|
1964
2118
|
return String(propValue);
|
|
1965
2119
|
}
|
|
1966
2120
|
return propValue;
|
|
@@ -1969,21 +2123,21 @@ var parsePropertyValue = (propValue, propType) => {
|
|
|
1969
2123
|
};
|
|
1970
2124
|
|
|
1971
2125
|
// src/runtime/update-component.ts
|
|
1972
|
-
import { BUILD as
|
|
2126
|
+
import { BUILD as BUILD19, NAMESPACE } from "@rindo/core/internal/app-data";
|
|
1973
2127
|
|
|
1974
2128
|
// src/runtime/event-emitter.ts
|
|
1975
|
-
import { BUILD as
|
|
2129
|
+
import { BUILD as BUILD17 } from "@rindo/core/internal/app-data";
|
|
1976
2130
|
|
|
1977
2131
|
// src/runtime/element.ts
|
|
1978
|
-
import { BUILD as
|
|
1979
|
-
var getElement = (ref) =>
|
|
2132
|
+
import { BUILD as BUILD16 } from "@rindo/core/internal/app-data";
|
|
2133
|
+
var getElement = (ref) => BUILD16.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
|
|
1980
2134
|
|
|
1981
2135
|
// src/runtime/event-emitter.ts
|
|
1982
2136
|
var createEvent = (ref, name, flags) => {
|
|
1983
2137
|
const elm = getElement(ref);
|
|
1984
2138
|
return {
|
|
1985
2139
|
emit: (detail) => {
|
|
1986
|
-
if (
|
|
2140
|
+
if (BUILD17.isDev && !elm.isConnected) {
|
|
1987
2141
|
consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
|
|
1988
2142
|
}
|
|
1989
2143
|
return emitEvent(elm, name, {
|
|
@@ -2002,7 +2156,7 @@ var emitEvent = (elm, name, opts) => {
|
|
|
2002
2156
|
};
|
|
2003
2157
|
|
|
2004
2158
|
// src/runtime/styles.ts
|
|
2005
|
-
import { BUILD as
|
|
2159
|
+
import { BUILD as BUILD18 } from "@rindo/core/internal/app-data";
|
|
2006
2160
|
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
2007
2161
|
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
2008
2162
|
let style = styles.get(scopeId2);
|
|
@@ -2022,7 +2176,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2022
2176
|
var _a;
|
|
2023
2177
|
const scopeId2 = getScopeId(cmpMeta, mode);
|
|
2024
2178
|
const style = styles.get(scopeId2);
|
|
2025
|
-
if (!
|
|
2179
|
+
if (!BUILD18.attachStyles) {
|
|
2026
2180
|
return scopeId2;
|
|
2027
2181
|
}
|
|
2028
2182
|
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
@@ -2035,16 +2189,16 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2035
2189
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
2036
2190
|
}
|
|
2037
2191
|
if (!appliedStyles.has(scopeId2)) {
|
|
2038
|
-
if (
|
|
2192
|
+
if (BUILD18.hydrateClientSide && styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
2039
2193
|
styleElm.innerHTML = style;
|
|
2040
2194
|
} else {
|
|
2041
|
-
styleElm = doc.createElement("style");
|
|
2195
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
2042
2196
|
styleElm.innerHTML = style;
|
|
2043
2197
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
2044
2198
|
if (nonce != null) {
|
|
2045
2199
|
styleElm.setAttribute("nonce", nonce);
|
|
2046
2200
|
}
|
|
2047
|
-
if ((
|
|
2201
|
+
if ((BUILD18.hydrateServerSide || BUILD18.hotModuleReplacement) && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2048
2202
|
styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
|
|
2049
2203
|
}
|
|
2050
2204
|
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
@@ -2080,7 +2234,7 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
2080
2234
|
appliedStyles.add(scopeId2);
|
|
2081
2235
|
}
|
|
2082
2236
|
}
|
|
2083
|
-
} else if (
|
|
2237
|
+
} else if (BUILD18.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
2084
2238
|
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
2085
2239
|
}
|
|
2086
2240
|
}
|
|
@@ -2092,43 +2246,40 @@ var attachStyles = (hostRef) => {
|
|
|
2092
2246
|
const flags = cmpMeta.$flags$;
|
|
2093
2247
|
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
2094
2248
|
const scopeId2 = addStyle(
|
|
2095
|
-
|
|
2249
|
+
BUILD18.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
2096
2250
|
cmpMeta,
|
|
2097
2251
|
hostRef.$modeName$
|
|
2098
2252
|
);
|
|
2099
|
-
if ((
|
|
2253
|
+
if ((BUILD18.shadowDom || BUILD18.scoped) && BUILD18.cssAnnotations && flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
2100
2254
|
elm["s-sc"] = scopeId2;
|
|
2101
2255
|
elm.classList.add(scopeId2 + "-h");
|
|
2102
|
-
if (BUILD17.scoped && flags & 2 /* scopedCssEncapsulation */) {
|
|
2103
|
-
elm.classList.add(scopeId2 + "-s");
|
|
2104
|
-
}
|
|
2105
2256
|
}
|
|
2106
2257
|
endAttachStyles();
|
|
2107
2258
|
};
|
|
2108
|
-
var getScopeId = (cmp, mode) => "sc-" + (
|
|
2259
|
+
var getScopeId = (cmp, mode) => "sc-" + (BUILD18.mode && mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
|
|
2109
2260
|
|
|
2110
2261
|
// src/runtime/update-component.ts
|
|
2111
2262
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
2112
|
-
if (
|
|
2263
|
+
if (BUILD19.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
2113
2264
|
ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
|
|
2114
2265
|
}
|
|
2115
2266
|
};
|
|
2116
2267
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
2117
|
-
if (
|
|
2268
|
+
if (BUILD19.taskQueue && BUILD19.updatable) {
|
|
2118
2269
|
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
2119
2270
|
}
|
|
2120
|
-
if (
|
|
2271
|
+
if (BUILD19.asyncLoading && hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
2121
2272
|
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
2122
2273
|
return;
|
|
2123
2274
|
}
|
|
2124
2275
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
2125
2276
|
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
2126
|
-
return
|
|
2277
|
+
return BUILD19.taskQueue ? writeTask(dispatch) : dispatch();
|
|
2127
2278
|
};
|
|
2128
2279
|
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
2129
2280
|
const elm = hostRef.$hostElement$;
|
|
2130
2281
|
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
2131
|
-
const instance =
|
|
2282
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2132
2283
|
if (!instance) {
|
|
2133
2284
|
throw new Error(
|
|
2134
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`
|
|
@@ -2136,7 +2287,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2136
2287
|
}
|
|
2137
2288
|
let maybePromise;
|
|
2138
2289
|
if (isInitialLoad) {
|
|
2139
|
-
if (
|
|
2290
|
+
if (BUILD19.lazyLoad && BUILD19.hostListener) {
|
|
2140
2291
|
hostRef.$flags$ |= 256 /* isListenReady */;
|
|
2141
2292
|
if (hostRef.$queuedListeners$) {
|
|
2142
2293
|
hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
|
|
@@ -2144,17 +2295,17 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
|
2144
2295
|
}
|
|
2145
2296
|
}
|
|
2146
2297
|
emitLifecycleEvent(elm, "componentWillLoad");
|
|
2147
|
-
if (
|
|
2298
|
+
if (BUILD19.cmpWillLoad) {
|
|
2148
2299
|
maybePromise = safeCall(instance, "componentWillLoad");
|
|
2149
2300
|
}
|
|
2150
2301
|
} else {
|
|
2151
2302
|
emitLifecycleEvent(elm, "componentWillUpdate");
|
|
2152
|
-
if (
|
|
2303
|
+
if (BUILD19.cmpWillUpdate) {
|
|
2153
2304
|
maybePromise = safeCall(instance, "componentWillUpdate");
|
|
2154
2305
|
}
|
|
2155
2306
|
}
|
|
2156
2307
|
emitLifecycleEvent(elm, "componentWillRender");
|
|
2157
|
-
if (
|
|
2308
|
+
if (BUILD19.cmpWillRender) {
|
|
2158
2309
|
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
|
|
2159
2310
|
}
|
|
2160
2311
|
endSchedule();
|
|
@@ -2170,23 +2321,23 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2170
2321
|
const elm = hostRef.$hostElement$;
|
|
2171
2322
|
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
2172
2323
|
const rc = elm["s-rc"];
|
|
2173
|
-
if (
|
|
2324
|
+
if (BUILD19.style && isInitialLoad) {
|
|
2174
2325
|
attachStyles(hostRef);
|
|
2175
2326
|
}
|
|
2176
2327
|
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
2177
|
-
if (
|
|
2328
|
+
if (BUILD19.isDev) {
|
|
2178
2329
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2179
2330
|
}
|
|
2180
|
-
if (
|
|
2331
|
+
if (BUILD19.hydrateServerSide) {
|
|
2181
2332
|
await callRender(hostRef, instance, elm, isInitialLoad);
|
|
2182
2333
|
} else {
|
|
2183
2334
|
callRender(hostRef, instance, elm, isInitialLoad);
|
|
2184
2335
|
}
|
|
2185
|
-
if (
|
|
2336
|
+
if (BUILD19.isDev) {
|
|
2186
2337
|
hostRef.$renderCount$ = hostRef.$renderCount$ === void 0 ? 1 : hostRef.$renderCount$ + 1;
|
|
2187
2338
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2188
2339
|
}
|
|
2189
|
-
if (
|
|
2340
|
+
if (BUILD19.hydrateServerSide) {
|
|
2190
2341
|
try {
|
|
2191
2342
|
serverSideConnected(elm);
|
|
2192
2343
|
if (isInitialLoad) {
|
|
@@ -2200,13 +2351,13 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2200
2351
|
consoleError(e, elm);
|
|
2201
2352
|
}
|
|
2202
2353
|
}
|
|
2203
|
-
if (
|
|
2354
|
+
if (BUILD19.asyncLoading && rc) {
|
|
2204
2355
|
rc.map((cb) => cb());
|
|
2205
2356
|
elm["s-rc"] = void 0;
|
|
2206
2357
|
}
|
|
2207
2358
|
endRender();
|
|
2208
2359
|
endUpdate();
|
|
2209
|
-
if (
|
|
2360
|
+
if (BUILD19.asyncLoading) {
|
|
2210
2361
|
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
2211
2362
|
const postUpdate = () => postUpdateComponent(hostRef);
|
|
2212
2363
|
if (childrenPromises.length === 0) {
|
|
@@ -2222,10 +2373,10 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
2222
2373
|
};
|
|
2223
2374
|
var renderingRef = null;
|
|
2224
2375
|
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
2225
|
-
const allRenderFn =
|
|
2226
|
-
const lazyLoad =
|
|
2227
|
-
const taskQueue =
|
|
2228
|
-
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;
|
|
2229
2380
|
try {
|
|
2230
2381
|
renderingRef = instance;
|
|
2231
2382
|
instance = allRenderFn ? instance.render() : instance.render && instance.render();
|
|
@@ -2235,9 +2386,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
2235
2386
|
if (updatable || lazyLoad) {
|
|
2236
2387
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
2237
2388
|
}
|
|
2238
|
-
if (
|
|
2239
|
-
if (
|
|
2240
|
-
if (
|
|
2389
|
+
if (BUILD19.hasRenderFn || BUILD19.reflect) {
|
|
2390
|
+
if (BUILD19.vdomRender || BUILD19.reflect) {
|
|
2391
|
+
if (BUILD19.hydrateServerSide) {
|
|
2241
2392
|
return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
|
|
2242
2393
|
} else {
|
|
2243
2394
|
renderVdom(hostRef, instance, isInitialLoad);
|
|
@@ -2262,57 +2413,57 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2262
2413
|
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
2263
2414
|
const elm = hostRef.$hostElement$;
|
|
2264
2415
|
const endPostUpdate = createTime("postUpdate", tagName);
|
|
2265
|
-
const instance =
|
|
2416
|
+
const instance = BUILD19.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2266
2417
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2267
|
-
if (
|
|
2268
|
-
if (
|
|
2418
|
+
if (BUILD19.cmpDidRender) {
|
|
2419
|
+
if (BUILD19.isDev) {
|
|
2269
2420
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2270
2421
|
}
|
|
2271
2422
|
safeCall(instance, "componentDidRender");
|
|
2272
|
-
if (
|
|
2423
|
+
if (BUILD19.isDev) {
|
|
2273
2424
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2274
2425
|
}
|
|
2275
2426
|
}
|
|
2276
2427
|
emitLifecycleEvent(elm, "componentDidRender");
|
|
2277
2428
|
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
2278
2429
|
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
2279
|
-
if (
|
|
2430
|
+
if (BUILD19.asyncLoading && BUILD19.cssAnnotations) {
|
|
2280
2431
|
addHydratedFlag(elm);
|
|
2281
2432
|
}
|
|
2282
|
-
if (
|
|
2283
|
-
if (
|
|
2433
|
+
if (BUILD19.cmpDidLoad) {
|
|
2434
|
+
if (BUILD19.isDev) {
|
|
2284
2435
|
hostRef.$flags$ |= 2048 /* devOnDidLoad */;
|
|
2285
2436
|
}
|
|
2286
2437
|
safeCall(instance, "componentDidLoad");
|
|
2287
|
-
if (
|
|
2438
|
+
if (BUILD19.isDev) {
|
|
2288
2439
|
hostRef.$flags$ &= ~2048 /* devOnDidLoad */;
|
|
2289
2440
|
}
|
|
2290
2441
|
}
|
|
2291
2442
|
emitLifecycleEvent(elm, "componentDidLoad");
|
|
2292
2443
|
endPostUpdate();
|
|
2293
|
-
if (
|
|
2444
|
+
if (BUILD19.asyncLoading) {
|
|
2294
2445
|
hostRef.$onReadyResolve$(elm);
|
|
2295
2446
|
if (!ancestorComponent) {
|
|
2296
2447
|
appDidLoad(tagName);
|
|
2297
2448
|
}
|
|
2298
2449
|
}
|
|
2299
2450
|
} else {
|
|
2300
|
-
if (
|
|
2301
|
-
if (
|
|
2451
|
+
if (BUILD19.cmpDidUpdate) {
|
|
2452
|
+
if (BUILD19.isDev) {
|
|
2302
2453
|
hostRef.$flags$ |= 1024 /* devOnRender */;
|
|
2303
2454
|
}
|
|
2304
2455
|
safeCall(instance, "componentDidUpdate");
|
|
2305
|
-
if (
|
|
2456
|
+
if (BUILD19.isDev) {
|
|
2306
2457
|
hostRef.$flags$ &= ~1024 /* devOnRender */;
|
|
2307
2458
|
}
|
|
2308
2459
|
}
|
|
2309
2460
|
emitLifecycleEvent(elm, "componentDidUpdate");
|
|
2310
2461
|
endPostUpdate();
|
|
2311
2462
|
}
|
|
2312
|
-
if (
|
|
2463
|
+
if (BUILD19.method && BUILD19.lazyLoad) {
|
|
2313
2464
|
hostRef.$onInstanceResolve$(elm);
|
|
2314
2465
|
}
|
|
2315
|
-
if (
|
|
2466
|
+
if (BUILD19.asyncLoading) {
|
|
2316
2467
|
if (hostRef.$onRenderResolve$) {
|
|
2317
2468
|
hostRef.$onRenderResolve$();
|
|
2318
2469
|
hostRef.$onRenderResolve$ = void 0;
|
|
@@ -2324,7 +2475,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
2324
2475
|
}
|
|
2325
2476
|
};
|
|
2326
2477
|
var forceUpdate = (ref) => {
|
|
2327
|
-
if (
|
|
2478
|
+
if (BUILD19.updatable && (Build.isBrowser || Build.isTesting)) {
|
|
2328
2479
|
const hostRef = getHostRef(ref);
|
|
2329
2480
|
const isConnected = hostRef.$hostElement$.isConnected;
|
|
2330
2481
|
if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
@@ -2335,14 +2486,14 @@ var forceUpdate = (ref) => {
|
|
|
2335
2486
|
return false;
|
|
2336
2487
|
};
|
|
2337
2488
|
var appDidLoad = (who) => {
|
|
2338
|
-
if (
|
|
2489
|
+
if (BUILD19.cssAnnotations) {
|
|
2339
2490
|
addHydratedFlag(doc.documentElement);
|
|
2340
2491
|
}
|
|
2341
|
-
if (
|
|
2492
|
+
if (BUILD19.asyncQueue) {
|
|
2342
2493
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2343
2494
|
}
|
|
2344
2495
|
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
2345
|
-
if (
|
|
2496
|
+
if (BUILD19.profile && performance.measure) {
|
|
2346
2497
|
performance.measure(`[Rindo] ${NAMESPACE} initial load (by ${who})`, "st:app:start");
|
|
2347
2498
|
}
|
|
2348
2499
|
};
|
|
@@ -2357,7 +2508,7 @@ var safeCall = (instance, method, arg) => {
|
|
|
2357
2508
|
return void 0;
|
|
2358
2509
|
};
|
|
2359
2510
|
var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
2360
|
-
if (
|
|
2511
|
+
if (BUILD19.lifecycleDOMEvents) {
|
|
2361
2512
|
emitEvent(elm, "rindo_" + lifecycleName, {
|
|
2362
2513
|
bubbles: true,
|
|
2363
2514
|
composed: true,
|
|
@@ -2369,7 +2520,7 @@ var emitLifecycleEvent = (elm, lifecycleName) => {
|
|
|
2369
2520
|
};
|
|
2370
2521
|
var addHydratedFlag = (elm) => {
|
|
2371
2522
|
var _a, _b;
|
|
2372
|
-
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;
|
|
2373
2524
|
};
|
|
2374
2525
|
var serverSideConnected = (elm) => {
|
|
2375
2526
|
const children = elm.children;
|
|
@@ -2388,21 +2539,21 @@ var serverSideConnected = (elm) => {
|
|
|
2388
2539
|
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
2389
2540
|
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
2390
2541
|
const hostRef = getHostRef(ref);
|
|
2391
|
-
if (
|
|
2542
|
+
if (BUILD20.lazyLoad && !hostRef) {
|
|
2392
2543
|
throw new Error(
|
|
2393
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.`
|
|
2394
2545
|
);
|
|
2395
2546
|
}
|
|
2396
|
-
const elm =
|
|
2547
|
+
const elm = BUILD20.lazyLoad ? hostRef.$hostElement$ : ref;
|
|
2397
2548
|
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
2398
2549
|
const flags = hostRef.$flags$;
|
|
2399
|
-
const instance =
|
|
2550
|
+
const instance = BUILD20.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2400
2551
|
newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
|
|
2401
2552
|
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
2402
2553
|
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
2403
|
-
if ((!
|
|
2554
|
+
if ((!BUILD20.lazyLoad || !(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
|
|
2404
2555
|
hostRef.$instanceValues$.set(propName, newVal);
|
|
2405
|
-
if (
|
|
2556
|
+
if (BUILD20.isDev) {
|
|
2406
2557
|
if (hostRef.$flags$ & 1024 /* devOnRender */) {
|
|
2407
2558
|
consoleDevWarn(
|
|
2408
2559
|
`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,
|
|
@@ -2425,8 +2576,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2425
2576
|
);
|
|
2426
2577
|
}
|
|
2427
2578
|
}
|
|
2428
|
-
if (!
|
|
2429
|
-
if (
|
|
2579
|
+
if (!BUILD20.lazyLoad || instance) {
|
|
2580
|
+
if (BUILD20.watchCallback && cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
|
|
2430
2581
|
const watchMethods = cmpMeta.$watchers$[propName];
|
|
2431
2582
|
if (watchMethods) {
|
|
2432
2583
|
watchMethods.map((watchMethodName) => {
|
|
@@ -2438,8 +2589,8 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2438
2589
|
});
|
|
2439
2590
|
}
|
|
2440
2591
|
}
|
|
2441
|
-
if (
|
|
2442
|
-
if (
|
|
2592
|
+
if (BUILD20.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
|
|
2593
|
+
if (BUILD20.cmpShouldUpdate && instance.componentShouldUpdate) {
|
|
2443
2594
|
if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
|
|
2444
2595
|
return;
|
|
2445
2596
|
}
|
|
@@ -2454,40 +2605,40 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
|
2454
2605
|
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
2455
2606
|
var _a, _b;
|
|
2456
2607
|
const prototype = Cstr.prototype;
|
|
2457
|
-
if (
|
|
2608
|
+
if (BUILD21.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */ && flags & 1 /* isElementConstructor */) {
|
|
2458
2609
|
FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => {
|
|
2459
2610
|
const originalFormAssociatedCallback = prototype[cbName];
|
|
2460
2611
|
Object.defineProperty(prototype, cbName, {
|
|
2461
2612
|
value(...args) {
|
|
2462
2613
|
const hostRef = getHostRef(this);
|
|
2463
|
-
const instance =
|
|
2614
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : this;
|
|
2464
2615
|
if (!instance) {
|
|
2465
2616
|
hostRef.$onReadyPromise$.then((asyncInstance) => {
|
|
2466
2617
|
const cb = asyncInstance[cbName];
|
|
2467
2618
|
typeof cb === "function" && cb.call(asyncInstance, ...args);
|
|
2468
2619
|
});
|
|
2469
2620
|
} else {
|
|
2470
|
-
const cb =
|
|
2621
|
+
const cb = BUILD21.lazyLoad ? instance[cbName] : originalFormAssociatedCallback;
|
|
2471
2622
|
typeof cb === "function" && cb.call(instance, ...args);
|
|
2472
2623
|
}
|
|
2473
2624
|
}
|
|
2474
2625
|
});
|
|
2475
2626
|
});
|
|
2476
2627
|
}
|
|
2477
|
-
if (
|
|
2478
|
-
if (
|
|
2628
|
+
if (BUILD21.member && cmpMeta.$members$ || BUILD21.watchCallback && (cmpMeta.$watchers$ || Cstr.watchers)) {
|
|
2629
|
+
if (BUILD21.watchCallback && Cstr.watchers && !cmpMeta.$watchers$) {
|
|
2479
2630
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2480
2631
|
}
|
|
2481
2632
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
2482
2633
|
members.map(([memberName, [memberFlags]]) => {
|
|
2483
|
-
if ((
|
|
2634
|
+
if ((BUILD21.prop || BUILD21.state) && (memberFlags & 31 /* Prop */ || (!BUILD21.lazyLoad || flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
2484
2635
|
if ((memberFlags & 2048 /* Getter */) === 0) {
|
|
2485
2636
|
Object.defineProperty(prototype, memberName, {
|
|
2486
2637
|
get() {
|
|
2487
2638
|
return getValue(this, memberName);
|
|
2488
2639
|
},
|
|
2489
2640
|
set(newValue) {
|
|
2490
|
-
if (
|
|
2641
|
+
if (BUILD21.isDev) {
|
|
2491
2642
|
const ref = getHostRef(this);
|
|
2492
2643
|
if (
|
|
2493
2644
|
// we are proxying the instance (not element)
|
|
@@ -2508,11 +2659,11 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2508
2659
|
enumerable: true
|
|
2509
2660
|
});
|
|
2510
2661
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
2511
|
-
if (
|
|
2662
|
+
if (BUILD21.lazyLoad) {
|
|
2512
2663
|
Object.defineProperty(prototype, memberName, {
|
|
2513
2664
|
get() {
|
|
2514
2665
|
const ref = getHostRef(this);
|
|
2515
|
-
const instance =
|
|
2666
|
+
const instance = BUILD21.lazyLoad && ref ? ref.$lazyInstance$ : prototype;
|
|
2516
2667
|
if (!instance) return;
|
|
2517
2668
|
return instance[memberName];
|
|
2518
2669
|
},
|
|
@@ -2552,7 +2703,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2552
2703
|
});
|
|
2553
2704
|
}
|
|
2554
2705
|
}
|
|
2555
|
-
} else if (
|
|
2706
|
+
} else if (BUILD21.lazyLoad && BUILD21.method && flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
2556
2707
|
Object.defineProperty(prototype, memberName, {
|
|
2557
2708
|
value(...args) {
|
|
2558
2709
|
var _a2;
|
|
@@ -2565,13 +2716,13 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2565
2716
|
});
|
|
2566
2717
|
}
|
|
2567
2718
|
});
|
|
2568
|
-
if (
|
|
2719
|
+
if (BUILD21.observeAttribute && (!BUILD21.lazyLoad || flags & 1 /* isElementConstructor */)) {
|
|
2569
2720
|
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
2570
2721
|
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
2571
2722
|
plt.jmp(() => {
|
|
2572
2723
|
var _a2;
|
|
2573
2724
|
const propName = attrNameToPropName.get(attrName);
|
|
2574
|
-
if (this.hasOwnProperty(propName)) {
|
|
2725
|
+
if (this.hasOwnProperty(propName) && BUILD21.lazyLoad) {
|
|
2575
2726
|
newValue = this[propName];
|
|
2576
2727
|
delete this[propName];
|
|
2577
2728
|
} else if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
@@ -2581,8 +2732,8 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2581
2732
|
const hostRef = getHostRef(this);
|
|
2582
2733
|
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
2583
2734
|
if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
|
|
2584
|
-
const elm =
|
|
2585
|
-
const instance =
|
|
2735
|
+
const elm = BUILD21.lazyLoad ? hostRef.$hostElement$ : this;
|
|
2736
|
+
const instance = BUILD21.lazyLoad ? hostRef.$lazyInstance$ : elm;
|
|
2586
2737
|
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
2587
2738
|
entry == null ? void 0 : entry.forEach((callbackName) => {
|
|
2588
2739
|
if (instance[callbackName] != null) {
|
|
@@ -2605,7 +2756,7 @@ More information: https://rindojs.web.app/docs/properties#prop-mutability`
|
|
|
2605
2756
|
var _a2;
|
|
2606
2757
|
const attrName = m[1] || propName;
|
|
2607
2758
|
attrNameToPropName.set(attrName, propName);
|
|
2608
|
-
if (
|
|
2759
|
+
if (BUILD21.reflect && m[0] & 512 /* ReflectAttr */) {
|
|
2609
2760
|
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
2610
2761
|
}
|
|
2611
2762
|
return attrName;
|
|
@@ -2623,7 +2774,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2623
2774
|
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
2624
2775
|
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
2625
2776
|
const bundleId = cmpMeta.$lazyBundleId$;
|
|
2626
|
-
if ((
|
|
2777
|
+
if ((BUILD22.lazyLoad || BUILD22.hydrateClientSide) && bundleId) {
|
|
2627
2778
|
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
2628
2779
|
if (CstrImport && "then" in CstrImport) {
|
|
2629
2780
|
const endLoad = uniqueTime(
|
|
@@ -2638,15 +2789,15 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2638
2789
|
if (!Cstr) {
|
|
2639
2790
|
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
2640
2791
|
}
|
|
2641
|
-
if (
|
|
2642
|
-
if (
|
|
2792
|
+
if (BUILD22.member && !Cstr.isProxied) {
|
|
2793
|
+
if (BUILD22.watchCallback) {
|
|
2643
2794
|
cmpMeta.$watchers$ = Cstr.watchers;
|
|
2644
2795
|
}
|
|
2645
2796
|
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
2646
2797
|
Cstr.isProxied = true;
|
|
2647
2798
|
}
|
|
2648
2799
|
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
2649
|
-
if (
|
|
2800
|
+
if (BUILD22.member) {
|
|
2650
2801
|
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
2651
2802
|
}
|
|
2652
2803
|
try {
|
|
@@ -2654,10 +2805,10 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2654
2805
|
} catch (e) {
|
|
2655
2806
|
consoleError(e);
|
|
2656
2807
|
}
|
|
2657
|
-
if (
|
|
2808
|
+
if (BUILD22.member) {
|
|
2658
2809
|
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
2659
2810
|
}
|
|
2660
|
-
if (
|
|
2811
|
+
if (BUILD22.watchCallback) {
|
|
2661
2812
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
2662
2813
|
}
|
|
2663
2814
|
endNewInstance();
|
|
@@ -2667,24 +2818,24 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2667
2818
|
const cmpTag = elm.localName;
|
|
2668
2819
|
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
2669
2820
|
}
|
|
2670
|
-
if (
|
|
2821
|
+
if (BUILD22.style && Cstr && Cstr.style) {
|
|
2671
2822
|
let style;
|
|
2672
2823
|
if (typeof Cstr.style === "string") {
|
|
2673
2824
|
style = Cstr.style;
|
|
2674
|
-
} else if (
|
|
2825
|
+
} else if (BUILD22.mode && typeof Cstr.style !== "string") {
|
|
2675
2826
|
hostRef.$modeName$ = computeMode(elm);
|
|
2676
2827
|
if (hostRef.$modeName$) {
|
|
2677
2828
|
style = Cstr.style[hostRef.$modeName$];
|
|
2678
2829
|
}
|
|
2679
|
-
if (
|
|
2830
|
+
if (BUILD22.hydrateServerSide && hostRef.$modeName$) {
|
|
2680
2831
|
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
2681
2832
|
}
|
|
2682
2833
|
}
|
|
2683
2834
|
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
2684
2835
|
if (!styles.has(scopeId2)) {
|
|
2685
2836
|
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
2686
|
-
if (!
|
|
2687
|
-
|
|
2837
|
+
if (!BUILD22.hydrateServerSide && BUILD22.shadowDom && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
|
|
2838
|
+
BUILD22.shadowDomShim && cmpMeta.$flags$ & 8 /* needsShadowDomShim */) {
|
|
2688
2839
|
style = await import("./shadow-css.js").then((m) => m.scopeCss(style, scopeId2));
|
|
2689
2840
|
}
|
|
2690
2841
|
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
@@ -2694,14 +2845,14 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
2694
2845
|
}
|
|
2695
2846
|
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
2696
2847
|
const schedule = () => scheduleUpdate(hostRef, true);
|
|
2697
|
-
if (
|
|
2848
|
+
if (BUILD22.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
2698
2849
|
ancestorComponent["s-rc"].push(schedule);
|
|
2699
2850
|
} else {
|
|
2700
2851
|
schedule();
|
|
2701
2852
|
}
|
|
2702
2853
|
};
|
|
2703
2854
|
var fireConnectedCallback = (instance) => {
|
|
2704
|
-
if (
|
|
2855
|
+
if (BUILD22.lazyLoad && BUILD22.connectedCallback) {
|
|
2705
2856
|
safeCall(instance, "connectedCallback");
|
|
2706
2857
|
}
|
|
2707
2858
|
};
|
|
@@ -2712,41 +2863,41 @@ var connectedCallback = (elm) => {
|
|
|
2712
2863
|
const hostRef = getHostRef(elm);
|
|
2713
2864
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2714
2865
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
2715
|
-
if (
|
|
2866
|
+
if (BUILD23.hostListenerTargetParent) {
|
|
2716
2867
|
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
|
|
2717
2868
|
}
|
|
2718
2869
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
2719
2870
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2720
2871
|
let hostId;
|
|
2721
|
-
if (
|
|
2872
|
+
if (BUILD23.hydrateClientSide) {
|
|
2722
2873
|
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2723
2874
|
if (hostId) {
|
|
2724
|
-
if (
|
|
2725
|
-
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);
|
|
2726
2877
|
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2727
|
-
} else if (
|
|
2728
|
-
const scopeId2 = getScopeId(cmpMeta,
|
|
2878
|
+
} else if (BUILD23.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2879
|
+
const scopeId2 = getScopeId(cmpMeta, BUILD23.mode ? elm.getAttribute("s-mode") : void 0);
|
|
2729
2880
|
elm["s-sc"] = scopeId2;
|
|
2730
2881
|
}
|
|
2731
2882
|
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2732
2883
|
}
|
|
2733
2884
|
}
|
|
2734
|
-
if (
|
|
2735
|
-
if (
|
|
2885
|
+
if (BUILD23.slotRelocation && !hostId) {
|
|
2886
|
+
if (BUILD23.hydrateServerSide || (BUILD23.slot || BUILD23.shadowDom) && // TODO(RINDO-854): Remove code related to legacy shadowDomShim field
|
|
2736
2887
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
2737
2888
|
setContentReference(elm);
|
|
2738
2889
|
}
|
|
2739
2890
|
}
|
|
2740
|
-
if (
|
|
2891
|
+
if (BUILD23.asyncLoading) {
|
|
2741
2892
|
let ancestorComponent = elm;
|
|
2742
2893
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
2743
|
-
if (
|
|
2894
|
+
if (BUILD23.hydrateClientSide && ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
2744
2895
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
2745
2896
|
break;
|
|
2746
2897
|
}
|
|
2747
2898
|
}
|
|
2748
2899
|
}
|
|
2749
|
-
if (
|
|
2900
|
+
if (BUILD23.prop && !BUILD23.hydrateServerSide && cmpMeta.$members$) {
|
|
2750
2901
|
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
2751
2902
|
if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
|
|
2752
2903
|
const value = elm[memberName];
|
|
@@ -2755,7 +2906,7 @@ var connectedCallback = (elm) => {
|
|
|
2755
2906
|
}
|
|
2756
2907
|
});
|
|
2757
2908
|
}
|
|
2758
|
-
if (
|
|
2909
|
+
if (BUILD23.initializeNextTick) {
|
|
2759
2910
|
nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
|
|
2760
2911
|
} else {
|
|
2761
2912
|
initializeComponent(elm, hostRef, cmpMeta);
|
|
@@ -2773,32 +2924,32 @@ var connectedCallback = (elm) => {
|
|
|
2773
2924
|
};
|
|
2774
2925
|
var setContentReference = (elm) => {
|
|
2775
2926
|
const contentRefElm = elm["s-cr"] = doc.createComment(
|
|
2776
|
-
|
|
2927
|
+
BUILD23.isDebug ? `content-ref (host=${elm.localName})` : ""
|
|
2777
2928
|
);
|
|
2778
2929
|
contentRefElm["s-cn"] = true;
|
|
2779
2930
|
insertBefore(elm, contentRefElm, elm.firstChild);
|
|
2780
2931
|
};
|
|
2781
2932
|
|
|
2782
2933
|
// src/runtime/disconnected-callback.ts
|
|
2783
|
-
import { BUILD as
|
|
2934
|
+
import { BUILD as BUILD24 } from "@rindo/core/internal/app-data";
|
|
2784
2935
|
var disconnectInstance = (instance) => {
|
|
2785
|
-
if (
|
|
2936
|
+
if (BUILD24.lazyLoad && BUILD24.disconnectedCallback) {
|
|
2786
2937
|
safeCall(instance, "disconnectedCallback");
|
|
2787
2938
|
}
|
|
2788
|
-
if (
|
|
2939
|
+
if (BUILD24.cmpDidUnload) {
|
|
2789
2940
|
safeCall(instance, "componentDidUnload");
|
|
2790
2941
|
}
|
|
2791
2942
|
};
|
|
2792
2943
|
var disconnectedCallback = async (elm) => {
|
|
2793
2944
|
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
2794
2945
|
const hostRef = getHostRef(elm);
|
|
2795
|
-
if (
|
|
2946
|
+
if (BUILD24.hostListener) {
|
|
2796
2947
|
if (hostRef.$rmListeners$) {
|
|
2797
2948
|
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
2798
2949
|
hostRef.$rmListeners$ = void 0;
|
|
2799
2950
|
}
|
|
2800
2951
|
}
|
|
2801
|
-
if (!
|
|
2952
|
+
if (!BUILD24.lazyLoad) {
|
|
2802
2953
|
disconnectInstance(elm);
|
|
2803
2954
|
} else if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
|
|
2804
2955
|
disconnectInstance(hostRef.$lazyInstance$);
|
|
@@ -2806,6 +2957,12 @@ var disconnectedCallback = async (elm) => {
|
|
|
2806
2957
|
hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
|
|
2807
2958
|
}
|
|
2808
2959
|
}
|
|
2960
|
+
if (rootAppliedStyles.has(elm)) {
|
|
2961
|
+
rootAppliedStyles.delete(elm);
|
|
2962
|
+
}
|
|
2963
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
2964
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
2965
|
+
}
|
|
2809
2966
|
};
|
|
2810
2967
|
|
|
2811
2968
|
// src/runtime/bootstrap-custom-element.ts
|
|
@@ -2817,36 +2974,36 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2817
2974
|
$flags$: compactMeta[0],
|
|
2818
2975
|
$tagName$: compactMeta[1]
|
|
2819
2976
|
};
|
|
2820
|
-
if (
|
|
2977
|
+
if (BUILD25.member) {
|
|
2821
2978
|
cmpMeta.$members$ = compactMeta[2];
|
|
2822
2979
|
}
|
|
2823
|
-
if (
|
|
2980
|
+
if (BUILD25.hostListener) {
|
|
2824
2981
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2825
2982
|
}
|
|
2826
|
-
if (
|
|
2983
|
+
if (BUILD25.watchCallback) {
|
|
2827
2984
|
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
2828
2985
|
}
|
|
2829
|
-
if (
|
|
2986
|
+
if (BUILD25.reflect) {
|
|
2830
2987
|
cmpMeta.$attrsToReflect$ = [];
|
|
2831
2988
|
}
|
|
2832
|
-
if (
|
|
2989
|
+
if (BUILD25.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2833
2990
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2834
2991
|
}
|
|
2835
|
-
if (
|
|
2836
|
-
if (
|
|
2992
|
+
if (BUILD25.experimentalSlotFixes) {
|
|
2993
|
+
if (BUILD25.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2837
2994
|
patchPseudoShadowDom(Cstr.prototype);
|
|
2838
2995
|
}
|
|
2839
2996
|
} else {
|
|
2840
|
-
if (
|
|
2997
|
+
if (BUILD25.slotChildNodesFix) {
|
|
2841
2998
|
patchChildSlotNodes(Cstr.prototype);
|
|
2842
2999
|
}
|
|
2843
|
-
if (
|
|
3000
|
+
if (BUILD25.cloneNodeFix) {
|
|
2844
3001
|
patchCloneNode(Cstr.prototype);
|
|
2845
3002
|
}
|
|
2846
|
-
if (
|
|
3003
|
+
if (BUILD25.appendChildSlotFix) {
|
|
2847
3004
|
patchSlotAppendChild(Cstr.prototype);
|
|
2848
3005
|
}
|
|
2849
|
-
if (
|
|
3006
|
+
if (BUILD25.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2850
3007
|
patchTextContent(Cstr.prototype);
|
|
2851
3008
|
}
|
|
2852
3009
|
}
|
|
@@ -2864,20 +3021,30 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2864
3021
|
this.__hasHostListenerAttached = true;
|
|
2865
3022
|
}
|
|
2866
3023
|
connectedCallback(this);
|
|
2867
|
-
if (
|
|
3024
|
+
if (BUILD25.connectedCallback && originalConnectedCallback) {
|
|
2868
3025
|
originalConnectedCallback.call(this);
|
|
2869
3026
|
}
|
|
2870
3027
|
},
|
|
2871
3028
|
disconnectedCallback() {
|
|
2872
3029
|
disconnectedCallback(this);
|
|
2873
|
-
if (
|
|
3030
|
+
if (BUILD25.disconnectedCallback && originalDisconnectedCallback) {
|
|
2874
3031
|
originalDisconnectedCallback.call(this);
|
|
2875
3032
|
}
|
|
3033
|
+
plt.raf(() => {
|
|
3034
|
+
var _a;
|
|
3035
|
+
const hostRef = getHostRef(this);
|
|
3036
|
+
if (((_a = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
3037
|
+
delete hostRef.$vnode$;
|
|
3038
|
+
}
|
|
3039
|
+
if (this instanceof Node && !this.isConnected) {
|
|
3040
|
+
deleteHostRef(this);
|
|
3041
|
+
}
|
|
3042
|
+
});
|
|
2876
3043
|
},
|
|
2877
3044
|
__attachShadow() {
|
|
2878
3045
|
if (supportsShadow) {
|
|
2879
3046
|
if (!this.shadowRoot) {
|
|
2880
|
-
if (
|
|
3047
|
+
if (BUILD25.shadowDelegatesFocus) {
|
|
2881
3048
|
this.attachShadow({
|
|
2882
3049
|
mode: "open",
|
|
2883
3050
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -2901,7 +3068,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
2901
3068
|
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
2902
3069
|
};
|
|
2903
3070
|
var forceModeUpdate = (elm) => {
|
|
2904
|
-
if (
|
|
3071
|
+
if (BUILD25.style && BUILD25.mode && !BUILD25.lazyLoad) {
|
|
2905
3072
|
const mode = computeMode(elm);
|
|
2906
3073
|
const hostRef = getHostRef(elm);
|
|
2907
3074
|
if (hostRef.$modeName$ !== mode) {
|
|
@@ -2924,7 +3091,7 @@ var forceModeUpdate = (elm) => {
|
|
|
2924
3091
|
};
|
|
2925
3092
|
|
|
2926
3093
|
// src/runtime/bootstrap-lazy.ts
|
|
2927
|
-
import { BUILD as
|
|
3094
|
+
import { BUILD as BUILD26 } from "@rindo/core/internal/app-data";
|
|
2928
3095
|
|
|
2929
3096
|
// src/runtime/hmr-component.ts
|
|
2930
3097
|
var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
@@ -2936,7 +3103,7 @@ var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
|
|
|
2936
3103
|
// src/runtime/bootstrap-lazy.ts
|
|
2937
3104
|
var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
2938
3105
|
var _a;
|
|
2939
|
-
if (
|
|
3106
|
+
if (BUILD26.profile && performance.mark) {
|
|
2940
3107
|
performance.mark("st:app:start");
|
|
2941
3108
|
}
|
|
2942
3109
|
installDevTools();
|
|
@@ -2952,12 +3119,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2952
3119
|
let isBootstrapping = true;
|
|
2953
3120
|
Object.assign(plt, options);
|
|
2954
3121
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", doc.baseURI).href;
|
|
2955
|
-
if (
|
|
3122
|
+
if (BUILD26.asyncQueue) {
|
|
2956
3123
|
if (options.syncQueue) {
|
|
2957
3124
|
plt.$flags$ |= 4 /* queueSync */;
|
|
2958
3125
|
}
|
|
2959
3126
|
}
|
|
2960
|
-
if (
|
|
3127
|
+
if (BUILD26.hydrateClientSide) {
|
|
2961
3128
|
plt.$flags$ |= 2 /* appLoaded */;
|
|
2962
3129
|
}
|
|
2963
3130
|
let hasSlotRelocation = false;
|
|
@@ -2973,22 +3140,22 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2973
3140
|
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
2974
3141
|
hasSlotRelocation = true;
|
|
2975
3142
|
}
|
|
2976
|
-
if (
|
|
3143
|
+
if (BUILD26.member) {
|
|
2977
3144
|
cmpMeta.$members$ = compactMeta[2];
|
|
2978
3145
|
}
|
|
2979
|
-
if (
|
|
3146
|
+
if (BUILD26.hostListener) {
|
|
2980
3147
|
cmpMeta.$listeners$ = compactMeta[3];
|
|
2981
3148
|
}
|
|
2982
|
-
if (
|
|
3149
|
+
if (BUILD26.reflect) {
|
|
2983
3150
|
cmpMeta.$attrsToReflect$ = [];
|
|
2984
3151
|
}
|
|
2985
|
-
if (
|
|
3152
|
+
if (BUILD26.watchCallback) {
|
|
2986
3153
|
cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
|
|
2987
3154
|
}
|
|
2988
|
-
if (
|
|
3155
|
+
if (BUILD26.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2989
3156
|
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
2990
3157
|
}
|
|
2991
|
-
const tagName =
|
|
3158
|
+
const tagName = BUILD26.transformTagName && options.transformTagName ? options.transformTagName(cmpMeta.$tagName$) : cmpMeta.$tagName$;
|
|
2992
3159
|
const HostElement = class extends HTMLElement {
|
|
2993
3160
|
// RindoLazyHost
|
|
2994
3161
|
constructor(self) {
|
|
@@ -2996,10 +3163,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
2996
3163
|
this.hasRegisteredEventListeners = false;
|
|
2997
3164
|
self = this;
|
|
2998
3165
|
registerHost(self, cmpMeta);
|
|
2999
|
-
if (
|
|
3166
|
+
if (BUILD26.shadowDom && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
3000
3167
|
if (supportsShadow) {
|
|
3001
3168
|
if (!self.shadowRoot) {
|
|
3002
|
-
if (
|
|
3169
|
+
if (BUILD26.shadowDelegatesFocus) {
|
|
3003
3170
|
self.attachShadow({
|
|
3004
3171
|
mode: "open",
|
|
3005
3172
|
delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
|
|
@@ -3014,7 +3181,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3014
3181
|
);
|
|
3015
3182
|
}
|
|
3016
3183
|
}
|
|
3017
|
-
} else if (!
|
|
3184
|
+
} else if (!BUILD26.hydrateServerSide && !("shadowRoot" in self)) {
|
|
3018
3185
|
self.shadowRoot = self;
|
|
3019
3186
|
}
|
|
3020
3187
|
}
|
|
@@ -3037,33 +3204,40 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3037
3204
|
}
|
|
3038
3205
|
disconnectedCallback() {
|
|
3039
3206
|
plt.jmp(() => disconnectedCallback(this));
|
|
3207
|
+
plt.raf(() => {
|
|
3208
|
+
var _a3;
|
|
3209
|
+
const hostRef = getHostRef(this);
|
|
3210
|
+
if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
|
|
3211
|
+
delete hostRef.$vnode$.$elm$;
|
|
3212
|
+
}
|
|
3213
|
+
});
|
|
3040
3214
|
}
|
|
3041
3215
|
componentOnReady() {
|
|
3042
3216
|
return getHostRef(this).$onReadyPromise$;
|
|
3043
3217
|
}
|
|
3044
3218
|
};
|
|
3045
|
-
if (
|
|
3046
|
-
if (
|
|
3219
|
+
if (BUILD26.experimentalSlotFixes) {
|
|
3220
|
+
if (BUILD26.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3047
3221
|
patchPseudoShadowDom(HostElement.prototype);
|
|
3048
3222
|
}
|
|
3049
3223
|
} else {
|
|
3050
|
-
if (
|
|
3224
|
+
if (BUILD26.slotChildNodesFix) {
|
|
3051
3225
|
patchChildSlotNodes(HostElement.prototype);
|
|
3052
3226
|
}
|
|
3053
|
-
if (
|
|
3227
|
+
if (BUILD26.cloneNodeFix) {
|
|
3054
3228
|
patchCloneNode(HostElement.prototype);
|
|
3055
3229
|
}
|
|
3056
|
-
if (
|
|
3230
|
+
if (BUILD26.appendChildSlotFix) {
|
|
3057
3231
|
patchSlotAppendChild(HostElement.prototype);
|
|
3058
3232
|
}
|
|
3059
|
-
if (
|
|
3233
|
+
if (BUILD26.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
3060
3234
|
patchTextContent(HostElement.prototype);
|
|
3061
3235
|
}
|
|
3062
3236
|
}
|
|
3063
|
-
if (
|
|
3237
|
+
if (BUILD26.formAssociated && cmpMeta.$flags$ & 64 /* formAssociated */) {
|
|
3064
3238
|
HostElement.formAssociated = true;
|
|
3065
3239
|
}
|
|
3066
|
-
if (
|
|
3240
|
+
if (BUILD26.hotModuleReplacement) {
|
|
3067
3241
|
HostElement.prototype["s-hmr"] = function(hmrVersionId) {
|
|
3068
3242
|
hmrStart(this, cmpMeta, hmrVersionId);
|
|
3069
3243
|
};
|
|
@@ -3082,7 +3256,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3082
3256
|
if (hasSlotRelocation) {
|
|
3083
3257
|
dataStyles.textContent += SLOT_FB_CSS;
|
|
3084
3258
|
}
|
|
3085
|
-
if (
|
|
3259
|
+
if (BUILD26.invisiblePrehydration && (BUILD26.hydratedClass || BUILD26.hydratedAttribute)) {
|
|
3086
3260
|
dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
|
|
3087
3261
|
}
|
|
3088
3262
|
if (dataStyles.innerHTML.length) {
|
|
@@ -3098,7 +3272,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3098
3272
|
if (deferredConnectedCallbacks.length) {
|
|
3099
3273
|
deferredConnectedCallbacks.map((host) => host.connectedCallback());
|
|
3100
3274
|
} else {
|
|
3101
|
-
if (
|
|
3275
|
+
if (BUILD26.profile) {
|
|
3102
3276
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30, "timeout"));
|
|
3103
3277
|
} else {
|
|
3104
3278
|
plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
|
|
@@ -3111,10 +3285,10 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
3111
3285
|
var Fragment = (_, children) => children;
|
|
3112
3286
|
|
|
3113
3287
|
// src/runtime/host-listener.ts
|
|
3114
|
-
import { BUILD as
|
|
3288
|
+
import { BUILD as BUILD27 } from "@rindo/core/internal/app-data";
|
|
3115
3289
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
3116
|
-
if (
|
|
3117
|
-
if (
|
|
3290
|
+
if (BUILD27.hostListener && listeners) {
|
|
3291
|
+
if (BUILD27.hostListenerTargetParent) {
|
|
3118
3292
|
if (attachParentListeners) {
|
|
3119
3293
|
listeners = listeners.filter(([flags]) => flags & 32 /* TargetParent */);
|
|
3120
3294
|
} else {
|
|
@@ -3122,7 +3296,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3122
3296
|
}
|
|
3123
3297
|
}
|
|
3124
3298
|
listeners.map(([flags, name, method]) => {
|
|
3125
|
-
const target =
|
|
3299
|
+
const target = BUILD27.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
|
|
3126
3300
|
const handler = hostListenerProxy(hostRef, method);
|
|
3127
3301
|
const opts = hostListenerOpts(flags);
|
|
3128
3302
|
plt.ael(target, name, handler, opts);
|
|
@@ -3133,7 +3307,7 @@ var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =>
|
|
|
3133
3307
|
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
3134
3308
|
var _a;
|
|
3135
3309
|
try {
|
|
3136
|
-
if (
|
|
3310
|
+
if (BUILD27.lazyLoad) {
|
|
3137
3311
|
if (hostRef.$flags$ & 256 /* isListenReady */) {
|
|
3138
3312
|
(_a = hostRef.$lazyInstance$) == null ? void 0 : _a[methodName](ev);
|
|
3139
3313
|
} else {
|
|
@@ -3147,10 +3321,10 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
3147
3321
|
}
|
|
3148
3322
|
};
|
|
3149
3323
|
var getHostListenerTarget = (elm, flags) => {
|
|
3150
|
-
if (
|
|
3151
|
-
if (
|
|
3152
|
-
if (
|
|
3153
|
-
if (
|
|
3324
|
+
if (BUILD27.hostListenerTargetDocument && flags & 4 /* TargetDocument */) return doc;
|
|
3325
|
+
if (BUILD27.hostListenerTargetWindow && flags & 8 /* TargetWindow */) return win;
|
|
3326
|
+
if (BUILD27.hostListenerTargetBody && flags & 16 /* TargetBody */) return doc.body;
|
|
3327
|
+
if (BUILD27.hostListenerTargetParent && flags & 32 /* TargetParent */ && elm.parentElement)
|
|
3154
3328
|
return elm.parentElement;
|
|
3155
3329
|
return elm;
|
|
3156
3330
|
};
|
|
@@ -3310,7 +3484,7 @@ var insertChildVNodeAnnotations = (doc2, vnodeChild, cmpData, hostId, depth, ind
|
|
|
3310
3484
|
}
|
|
3311
3485
|
};
|
|
3312
3486
|
export {
|
|
3313
|
-
|
|
3487
|
+
BUILD28 as BUILD,
|
|
3314
3488
|
Build,
|
|
3315
3489
|
Env,
|
|
3316
3490
|
Fragment,
|
|
@@ -3329,6 +3503,7 @@ export {
|
|
|
3329
3503
|
consoleError,
|
|
3330
3504
|
createEvent,
|
|
3331
3505
|
defineCustomElement,
|
|
3506
|
+
deleteHostRef,
|
|
3332
3507
|
disconnectedCallback,
|
|
3333
3508
|
doc,
|
|
3334
3509
|
forceModeUpdate,
|