@solidjs/web 2.0.0-rc.21 → 2.0.0-rc.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.dev.js +403 -242
- package/dist/server.js +400 -241
- package/dist/server.observe.js +400 -241
- package/dist/web.dev.js +140 -100
- package/dist/web.js +118 -99
- package/dist/web.observe.js +118 -99
- package/frames/dist/client.dev.js +7 -2
- package/frames/dist/client.js +7 -2
- package/frames/dist/client.observe.js +7 -2
- package/frames/dist/server.dev.js +122 -62
- package/frames/dist/server.js +122 -62
- package/frames/dist/server.observe.js +122 -62
- package/frames/dist/wire.js +1 -1
- package/package.json +6 -5
- package/serialization/dist/serialization.js +5 -4
- package/serialization/types/index.d.ts +8 -1
- package/serialization/types/serializer.d.ts +8 -1
- package/server-functions/dist/client.dev.js +16 -7
- package/server-functions/dist/client.js +16 -7
- package/server-functions/dist/client.observe.js +16 -7
- package/server-functions/dist/server.dev.js +20 -38
- package/server-functions/dist/server.js +20 -38
- package/server-functions/dist/server.observe.js +20 -38
- package/types/client.d.ts +54 -2
- package/types/constants.d.ts +2 -1
- package/types/frames/frame-client.d.ts +2 -0
- package/types/frames/serializer.d.ts +8 -1
- package/types/frames/tree-rewrite.d.ts +7 -0
- package/types/serializer.d.ts +8 -1
- package/types/server-functions/shared.d.ts +3 -2
- package/types/server.d.ts +48 -7
- package/types/trace.d.ts +18 -0
package/dist/web.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { createRenderEffect, createMemo, enableHydration, $PROXY, untrack,
|
|
1
|
+
import { createRenderEffect, createMemo, enableHydration, $PROXY, untrack, runRefCallback, createRoot, getOwner, ROOT_ERROR_HOOK, flatten, flush, runWithOwner, setSwapHook, isHidden, createComponent, omit, createOwner, createSignal, createEffect } from 'solid-js';
|
|
2
2
|
export { Errored, For, Hydration, Loading, Match, NoHydration, Repeat, Reveal, Show, Switch, createComponent, dynamicComponent, getOwner, merge as mergeProps, untrack } from 'solid-js';
|
|
3
|
-
import { sharedConfig, enableServerComponentHydration,
|
|
3
|
+
import { sharedConfig, enableServerComponentHydration, hasStaticKeys, heldRead, viewOf, OmitView, sourceHas, SOURCE_OMIT, sourceGet, SOURCE_MEMO, SOURCE_PROXY, SOURCE_PLAIN, sourceKeys, resolvedTable, dynamicCore } from 'solid-js/internal';
|
|
4
|
+
export { heldRead } from 'solid-js/internal';
|
|
4
5
|
|
|
5
6
|
const DOMWithState = {
|
|
6
7
|
INPUT: {
|
|
@@ -32,6 +33,7 @@ const DOMWithState = {
|
|
|
32
33
|
};
|
|
33
34
|
const ChildProperties = /*#__PURE__*/new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
34
35
|
const $$SLOT = /*#__PURE__*/Symbol("slot");
|
|
36
|
+
const $$INDEX = /*#__PURE__*/Symbol("index");
|
|
35
37
|
const $$HOST = /*#__PURE__*/Symbol("host");
|
|
36
38
|
const DelegatedEvents = /*#__PURE__*/new Set(["beforeinput", "click", "dblclick", "contextmenu", "focusin", "focusout", "input", "keydown", "keyup", "mousedown", "mousemove", "mouseout", "mouseover", "mouseup", "pointerdown", "pointermove", "pointerout", "pointerover", "pointerup", "touchend", "touchmove", "touchstart"]);
|
|
37
39
|
const SVGElements = /*#__PURE__*/new Set([
|
|
@@ -71,32 +73,36 @@ function memo(fn) {
|
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
function reconcileArrays(parentNode, a, b, marker) {
|
|
74
|
-
let
|
|
75
|
-
|
|
76
|
+
let bLength = b.length,
|
|
77
|
+
aEnd = a.length,
|
|
78
|
+
bEnd = bLength,
|
|
79
|
+
aStart = 0,
|
|
80
|
+
bStart = 0,
|
|
81
|
+
stamped,
|
|
82
|
+
after,
|
|
83
|
+
index,
|
|
84
|
+
anchor;
|
|
85
|
+
while (aStart < aEnd && a[aStart] === b[bStart]) {
|
|
86
|
+
aStart++;
|
|
87
|
+
bStart++;
|
|
88
|
+
}
|
|
89
|
+
if (aStart === aEnd && bStart === bEnd) return;
|
|
90
|
+
const mv = parentNode.moveBefore && parentNode.isConnected;
|
|
76
91
|
const slot = marker || parentNode;
|
|
77
92
|
const insert = (n, ref) => {
|
|
78
|
-
|
|
93
|
+
mv && n.isConnected ? parentNode.moveBefore(n, ref) : parentNode.insertBefore(n, ref);
|
|
79
94
|
if (marker || n[$$SLOT]) n[$$SLOT] = slot;
|
|
80
95
|
};
|
|
81
|
-
if (!
|
|
96
|
+
if (!aEnd) {
|
|
82
97
|
for (const n of b) insert(n, marker);
|
|
83
98
|
return;
|
|
84
99
|
}
|
|
85
|
-
const isLive = n =>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return
|
|
100
|
+
const isLive = n => n && n.parentNode === parentNode && (!(n = n[$$SLOT]) || n === slot);
|
|
101
|
+
const ref = k => {
|
|
102
|
+
while (k < bLength && !isLive(b[k])) k++;
|
|
103
|
+
return b[k] || (after && after.parentNode !== parentNode ? marker || null : after);
|
|
89
104
|
};
|
|
90
|
-
|
|
91
|
-
aEnd = a.length,
|
|
92
|
-
bEnd = bLength,
|
|
93
|
-
aStart = 0,
|
|
94
|
-
bStart = 0,
|
|
95
|
-
tail = a[aEnd - 1],
|
|
96
|
-
after = isLive(tail) ? tail.nextSibling : marker || null,
|
|
97
|
-
map = null,
|
|
98
|
-
anchor,
|
|
99
|
-
anchorTag;
|
|
105
|
+
after = isLive(anchor = a[aEnd - 1]) ? anchor.nextSibling : marker || null;
|
|
100
106
|
while (aStart < aEnd || bStart < bEnd) {
|
|
101
107
|
if (a[aStart] === b[bStart]) {
|
|
102
108
|
aStart++;
|
|
@@ -108,52 +114,43 @@ function reconcileArrays(parentNode, a, b, marker) {
|
|
|
108
114
|
bEnd--;
|
|
109
115
|
}
|
|
110
116
|
if (aEnd === aStart) {
|
|
111
|
-
|
|
112
|
-
while (
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const n = a[aStart++];
|
|
118
|
-
if ((!map || !map.has(n)) && isLive(n)) n.remove();
|
|
119
|
-
}
|
|
120
|
-
} else if ((anchor = a[aStart]) === b[bEnd - 1] && b[bStart] === a[aEnd - 1] && anchor.parentNode === parentNode && (!(anchorTag = anchor[$$SLOT]) || anchorTag === slot)) {
|
|
117
|
+
anchor = ref(bEnd);
|
|
118
|
+
while (bStart < bEnd) insert(b[bStart++], anchor);
|
|
119
|
+
} else if (!isLive(anchor = a[aStart])) aStart++;
|
|
120
|
+
else if (b[bStart] === a[aEnd - 1] && (
|
|
121
|
+
anchor === b[bEnd - 1] ||
|
|
122
|
+
!stamped && anchor === b[bStart + 1] && a[aStart + 1] === b[bStart + 2])) {
|
|
121
123
|
do {
|
|
122
124
|
insert(a[--aEnd], anchor);
|
|
123
125
|
bStart++;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
+
} while (aStart < aEnd - 1 && bStart < bEnd && anchor === b[bEnd - 1] && b[bStart] === a[aEnd - 1]);
|
|
127
|
+
} else if (bStart < bEnd && anchor === b[bEnd - 1] && a[aStart + 1] !== b[bEnd - 2] && isLive(b[bStart]) && isLive(a[aEnd - 1])) {
|
|
128
|
+
insert(anchor, ref(bEnd));
|
|
129
|
+
aStart++;
|
|
130
|
+
bEnd--;
|
|
126
131
|
} else {
|
|
127
|
-
if (!
|
|
128
|
-
|
|
129
|
-
|
|
132
|
+
if (!stamped) {
|
|
133
|
+
stamped = 1;
|
|
134
|
+
for (index = bStart; index < bEnd;) b[index][$$INDEX] = index++;
|
|
130
135
|
}
|
|
131
|
-
if (
|
|
132
|
-
map = new Map();
|
|
133
|
-
let i = bStart;
|
|
134
|
-
while (i < bEnd) map.set(b[i], i++);
|
|
135
|
-
}
|
|
136
|
-
const index = map.get(a[aStart]);
|
|
137
|
-
if (index != null) {
|
|
136
|
+
if ((index = anchor[$$INDEX]) >= 0 && b[index] === anchor) {
|
|
138
137
|
if (bStart < index && index < bEnd) {
|
|
139
138
|
let i = aStart,
|
|
140
|
-
sequence = 1
|
|
141
|
-
|
|
142
|
-
while (++i < aEnd && i < bEnd) {
|
|
143
|
-
if ((t = map.get(a[i])) == null || t !== index + sequence) break;
|
|
144
|
-
sequence++;
|
|
145
|
-
}
|
|
139
|
+
sequence = 1;
|
|
140
|
+
while (++i < aEnd && i < bEnd && a[i] === b[index + sequence]) sequence++;
|
|
146
141
|
if (sequence > index - bStart) {
|
|
147
|
-
|
|
148
|
-
while (bStart < index) insert(b[bStart++], node);
|
|
142
|
+
while (bStart < index) insert(b[bStart++], anchor);
|
|
149
143
|
} else {
|
|
150
|
-
const newNode = b[bStart++]
|
|
151
|
-
|
|
152
|
-
|
|
144
|
+
const newNode = b[bStart++];
|
|
145
|
+
aStart++;
|
|
146
|
+
mv ? insert(newNode, anchor) : parentNode.replaceChild(newNode, anchor);
|
|
153
147
|
if (marker || newNode[$$SLOT]) newNode[$$SLOT] = slot;
|
|
154
148
|
}
|
|
155
149
|
} else aStart++;
|
|
156
|
-
} else
|
|
150
|
+
} else {
|
|
151
|
+
anchor.remove();
|
|
152
|
+
aStart++;
|
|
153
|
+
}
|
|
157
154
|
}
|
|
158
155
|
}
|
|
159
156
|
}
|
|
@@ -411,15 +408,22 @@ function render(code, element, init, options = {}) {
|
|
|
411
408
|
element.textContent = "";
|
|
412
409
|
};
|
|
413
410
|
}
|
|
411
|
+
let policy;
|
|
412
|
+
function setTrustedTypesPolicy(value) {
|
|
413
|
+
policy = value;
|
|
414
|
+
}
|
|
415
|
+
function trustedHTML(html) {
|
|
416
|
+
return policy ? policy.createHTML(html) : html;
|
|
417
|
+
}
|
|
414
418
|
function create(html, bypassGuard, flag) {
|
|
415
419
|
const t = document.createElement("template");
|
|
416
|
-
t.innerHTML = html;
|
|
420
|
+
t.innerHTML = policy ? policy.createHTML(html) : html;
|
|
417
421
|
const node = t.content.firstChild;
|
|
418
422
|
return flag === 2 ? node.firstChild : node;
|
|
419
423
|
}
|
|
420
424
|
function template(html, flag) {
|
|
421
425
|
let node;
|
|
422
|
-
const fn =
|
|
426
|
+
const fn = bypassGuard => (node || (node = create(html, bypassGuard, flag)), flag === 1 ? document.importNode(node, true) : node.cloneNode(true));
|
|
423
427
|
return fn;
|
|
424
428
|
}
|
|
425
429
|
function delegateEvents(eventNames) {
|
|
@@ -475,8 +479,7 @@ function getDelegatedRoot(node) {
|
|
|
475
479
|
}
|
|
476
480
|
}
|
|
477
481
|
const parentOf = node => node._$host || node.parentNode || node.host;
|
|
478
|
-
function findOwner(
|
|
479
|
-
let node = target;
|
|
482
|
+
function findOwner(node, state) {
|
|
480
483
|
let distance = 0;
|
|
481
484
|
while (node) {
|
|
482
485
|
if (state.owners.has(node)) return {
|
|
@@ -498,6 +501,9 @@ function setProperty(node, name, value) {
|
|
|
498
501
|
function setStatefulProperty(node, name, value) {
|
|
499
502
|
node[name] = value;
|
|
500
503
|
}
|
|
504
|
+
function strictHandler(fn) {
|
|
505
|
+
return fn();
|
|
506
|
+
}
|
|
501
507
|
let claimHandlers = null;
|
|
502
508
|
const claimAttributeSets = [];
|
|
503
509
|
const CLAIM_SEAM = Symbol.for("solid.element-claims");
|
|
@@ -577,7 +583,7 @@ function className(node, value, prev) {
|
|
|
577
583
|
return;
|
|
578
584
|
}
|
|
579
585
|
if (typeof value === "string") {
|
|
580
|
-
node._$classes = undefined;
|
|
586
|
+
if (node._$classes) node._$classes = undefined;
|
|
581
587
|
value !== prev && node.setAttribute("class", value);
|
|
582
588
|
return;
|
|
583
589
|
}
|
|
@@ -683,33 +689,42 @@ function setStyleProperty(node, name, value) {
|
|
|
683
689
|
function spread(node, props, skipChildren, skip, name, loc) {
|
|
684
690
|
const prevProps = {};
|
|
685
691
|
const owner = claimHandlers !== null && (node.localName === "a" || node.localName === "form") ? getOwner() : undefined;
|
|
692
|
+
let held = 0;
|
|
686
693
|
const apply = newProps => {
|
|
687
694
|
const r = newProps.ref;
|
|
688
695
|
if (r !== prevProps.ref && (typeof r === "function" || Array.isArray(r))) ref(() => r, node);
|
|
696
|
+
spreadHeld = held;
|
|
689
697
|
assign(node, newProps, true, prevProps, true);
|
|
698
|
+
spreadHeld = 0;
|
|
690
699
|
if (owner !== undefined) claimElement(node, owner);
|
|
691
700
|
};
|
|
701
|
+
const read = fn => () => {
|
|
702
|
+
const p = fn();
|
|
703
|
+
held = heldRead();
|
|
704
|
+
return p;
|
|
705
|
+
};
|
|
692
706
|
if (Array.isArray(props)) {
|
|
693
|
-
effect(() => collectSources({}, props, undefined, skip), apply);
|
|
707
|
+
effect(read(() => collectSources({}, props, undefined, skip)), apply);
|
|
694
708
|
if (!skipChildren && !(skip !== undefined && skip("children"))) insert(node, () => {
|
|
695
709
|
for (let i = props.length - 1; i >= 0; i--) {
|
|
696
710
|
const s = resolveSource(props[i]);
|
|
697
|
-
if (s
|
|
711
|
+
if (s && entryHas(s, "children")) return entryGet(s, "children");
|
|
698
712
|
}
|
|
699
713
|
});
|
|
700
714
|
return prevProps;
|
|
701
715
|
}
|
|
702
|
-
|
|
716
|
+
const collect = () => {
|
|
703
717
|
const source = resolveSource(props);
|
|
704
718
|
const newProps = {};
|
|
705
719
|
const table = resolvedTable(source);
|
|
706
720
|
if (table !== undefined) return collectTable(newProps, table, skip);
|
|
707
|
-
if (source
|
|
721
|
+
if (source) {
|
|
708
722
|
const view = viewOf(source);
|
|
709
723
|
if (view instanceof OmitView) collectProps(newProps, view, SOURCE_OMIT, skip);else if (view !== undefined) collectSources(newProps, view.sources, view.kinds, skip);else collectProps(newProps, source, $PROXY in source ? SOURCE_PROXY : SOURCE_PLAIN, skip);
|
|
710
724
|
}
|
|
711
725
|
return newProps;
|
|
712
|
-
}
|
|
726
|
+
};
|
|
727
|
+
effect(read(collect), apply);
|
|
713
728
|
if (!skipChildren && !(skip !== undefined && skip("children"))) {
|
|
714
729
|
if (typeof props !== "function" && props != null && hasStaticKeys(props)) {
|
|
715
730
|
const desc = Object.getOwnPropertyDescriptor(props, "children");
|
|
@@ -718,7 +733,7 @@ function spread(node, props, skipChildren, skip, name, loc) {
|
|
|
718
733
|
}
|
|
719
734
|
} else insert(node, () => {
|
|
720
735
|
const source = resolveSource(props);
|
|
721
|
-
return source
|
|
736
|
+
return source && entryHas(source, "children") ? entryGet(source, "children") : undefined;
|
|
722
737
|
});
|
|
723
738
|
}
|
|
724
739
|
return prevProps;
|
|
@@ -757,7 +772,7 @@ function pushEntry(resolved, kinds, s, kind) {
|
|
|
757
772
|
return;
|
|
758
773
|
}
|
|
759
774
|
s = resolveSource(s);
|
|
760
|
-
if (s
|
|
775
|
+
if (!s) return;
|
|
761
776
|
const view = viewOf(s);
|
|
762
777
|
if (view instanceof OmitView) {
|
|
763
778
|
resolved.push(view);
|
|
@@ -797,7 +812,7 @@ function applyRef(r, element) {
|
|
|
797
812
|
}
|
|
798
813
|
function ref(fn, element) {
|
|
799
814
|
const resolved = untrack(fn);
|
|
800
|
-
|
|
815
|
+
runRefCallback(() => applyRef(resolved, element));
|
|
801
816
|
}
|
|
802
817
|
function scope(fn) {
|
|
803
818
|
fn.$s = true;
|
|
@@ -808,6 +823,10 @@ const SCOPE_OPTIONS = {
|
|
|
808
823
|
};
|
|
809
824
|
let hydrationRt = null;
|
|
810
825
|
let selectInsert = null;
|
|
826
|
+
let hostRt = null;
|
|
827
|
+
function installHostTagging() {
|
|
828
|
+
hostRt = tagHost;
|
|
829
|
+
}
|
|
811
830
|
function installHydrationRuntime() {
|
|
812
831
|
hydrationRt = {
|
|
813
832
|
claimInitial(parent, multi, initial) {
|
|
@@ -818,8 +837,7 @@ function installHydrationRuntime() {
|
|
|
818
837
|
},
|
|
819
838
|
reclaimRegion(current, parent, marker) {
|
|
820
839
|
if (!sharedConfig.hydrating || current == null || !parent.isConnected) return current;
|
|
821
|
-
|
|
822
|
-
if (first == null || first.isConnected) return current;
|
|
840
|
+
if (Array.isArray(current) ? current.every(n => !n || n.isConnected) : current.isConnected) return current;
|
|
823
841
|
let nodes;
|
|
824
842
|
if (marker) {
|
|
825
843
|
nodes = [];
|
|
@@ -879,25 +897,23 @@ function claimChildNodes(parent) {
|
|
|
879
897
|
function isPlaceholderScaffolding(node, t) {
|
|
880
898
|
return t === 8 ? node.nodeValue.startsWith("pl-") : t === 1 && node.localName === "template" && node.id.startsWith("pl-");
|
|
881
899
|
}
|
|
882
|
-
function insert(parent, accessor, marker,
|
|
900
|
+
function insert(parent, accessor, marker, current, options) {
|
|
883
901
|
const multi = marker !== undefined;
|
|
884
|
-
|
|
885
|
-
if (
|
|
886
|
-
if (hydrationRt !== null) initial = hydrationRt.claimInitial(parent, multi, initial);
|
|
902
|
+
if (multi && !current) current = [];
|
|
903
|
+
if (hydrationRt !== null) current = hydrationRt.claimInitial(parent, multi, current);
|
|
887
904
|
if (typeof accessor !== "function") {
|
|
888
|
-
accessor = normalize(accessor,
|
|
905
|
+
accessor = normalize(accessor, current, multi, true);
|
|
889
906
|
if (typeof accessor !== "function") {
|
|
890
|
-
insertExpression(parent, accessor,
|
|
891
|
-
host &&
|
|
907
|
+
insertExpression(parent, accessor, current, marker);
|
|
908
|
+
hostRt !== null && options && options.host && hostRt(accessor, options.host);
|
|
892
909
|
return;
|
|
893
910
|
}
|
|
894
911
|
}
|
|
895
|
-
if (multi &&
|
|
912
|
+
if (multi && current.length === 0) {
|
|
896
913
|
const placeholder = document.createTextNode("");
|
|
897
914
|
parent.insertBefore(placeholder, marker);
|
|
898
|
-
|
|
915
|
+
current = [placeholder];
|
|
899
916
|
}
|
|
900
|
-
let current = initial;
|
|
901
917
|
let ran = false;
|
|
902
918
|
effect(() => {
|
|
903
919
|
if (hydrationRt !== null) current = hydrationRt.reclaimRegion(current, parent, marker);
|
|
@@ -911,13 +927,13 @@ function insert(parent, accessor, marker, initial, options) {
|
|
|
911
927
|
} : options;
|
|
912
928
|
effect(() => (hydrationRt !== null && (current = hydrationRt.reclaimRegion(current, parent, marker)), normalize(value, current, multi)), inner => {
|
|
913
929
|
current = insertExpression(parent, inner, current, marker);
|
|
914
|
-
host &&
|
|
930
|
+
hostRt !== null && options && options.host && hostRt(current, options.host);
|
|
915
931
|
}, innerOptions);
|
|
916
932
|
return INNER_OWNED;
|
|
917
933
|
}, value => {
|
|
918
934
|
if (value === INNER_OWNED) return;
|
|
919
935
|
current = insertExpression(parent, value, current, marker);
|
|
920
|
-
host &&
|
|
936
|
+
hostRt !== null && options && options.host && hostRt(current, options.host);
|
|
921
937
|
},
|
|
922
938
|
accessor.$s ? options ? {
|
|
923
939
|
...options,
|
|
@@ -1129,6 +1145,7 @@ function initHeadRegistry() {
|
|
|
1129
1145
|
headRegistrations = [];
|
|
1130
1146
|
headOwned = new Map();
|
|
1131
1147
|
headApplied = new Map();
|
|
1148
|
+
setSwapHook(scheduleHeadApply);
|
|
1132
1149
|
const t = document.querySelector("title");
|
|
1133
1150
|
headFallbackTitle = t ? t.hasAttribute("data-dh") ? t.getAttribute("data-dhf") : t.textContent : null;
|
|
1134
1151
|
if (globalThis._$HY) globalThis._$HY.h = applyServerHeadOps;
|
|
@@ -1179,7 +1196,7 @@ function flushHeadRegistry() {
|
|
|
1179
1196
|
return;
|
|
1180
1197
|
}
|
|
1181
1198
|
headScheduled = false;
|
|
1182
|
-
const winners = resolveHead(headRegistrations);
|
|
1199
|
+
const winners = resolveHead(headRegistrations.filter(r => !isHidden(r.node)));
|
|
1183
1200
|
for (const [identity, els] of headOwned) {
|
|
1184
1201
|
if (winners.has(identity)) continue;
|
|
1185
1202
|
headOwned.delete(identity);
|
|
@@ -1291,10 +1308,12 @@ function useHead(tags) {
|
|
|
1291
1308
|
initHeadRegistry();
|
|
1292
1309
|
const reg = {
|
|
1293
1310
|
seq: -1,
|
|
1294
|
-
tags: null
|
|
1311
|
+
tags: null,
|
|
1312
|
+
node: null
|
|
1295
1313
|
};
|
|
1296
1314
|
const uid = ++headUid;
|
|
1297
1315
|
effect(() => {
|
|
1316
|
+
reg.node = getOwner();
|
|
1298
1317
|
let list = typeof tags === "function" ? tags() : tags;
|
|
1299
1318
|
if (!Array.isArray(list)) list = [list];
|
|
1300
1319
|
const replaceable = [];
|
|
@@ -1616,10 +1635,11 @@ function flattenClassList(list, result) {
|
|
|
1616
1635
|
else if (typeof item !== "boolean" && (item || item === 0)) result[item] = true;
|
|
1617
1636
|
}
|
|
1618
1637
|
}
|
|
1638
|
+
let spreadHeld = 0;
|
|
1619
1639
|
function assignProp(node, prop, value, prev, skipRef, nodeName) {
|
|
1620
1640
|
if (prop === "style") return style(node, value, prev), value;
|
|
1621
1641
|
if (prop === "class") return className(node, value, prev), value;
|
|
1622
|
-
if (value === prev && DOMWithState[nodeName]?.[prop] !== 1) return prev;
|
|
1642
|
+
if (value === prev && (spreadHeld || DOMWithState[nodeName]?.[prop] !== 1)) return prev;
|
|
1623
1643
|
if (prop === "ref") {
|
|
1624
1644
|
if (!skipRef && value) ref(() => value, node);
|
|
1625
1645
|
return value;
|
|
@@ -1664,37 +1684,32 @@ function eventHandler(e, container, state) {
|
|
|
1664
1684
|
e[$$EVENT_OWNER] = owner;
|
|
1665
1685
|
let node = resumeNode || e.target;
|
|
1666
1686
|
const key = EVENT_KEY + e.type;
|
|
1667
|
-
const
|
|
1687
|
+
const define = (name, value) => Object.defineProperty(e, name, {
|
|
1668
1688
|
configurable: true,
|
|
1669
1689
|
value
|
|
1670
1690
|
});
|
|
1671
1691
|
const handleNode = () => {
|
|
1672
1692
|
const handler = node[key];
|
|
1673
1693
|
if (handler && !node.disabled) {
|
|
1694
|
+
define("currentTarget", node);
|
|
1674
1695
|
const data = node[`${key}Data`];
|
|
1675
1696
|
data !== undefined ? handler.call(node, data, e) : typeof handler === "function" ? handler.call(node, e) : handler.handleEvent(e);
|
|
1676
1697
|
if (e.cancelBubble) return;
|
|
1677
1698
|
}
|
|
1678
|
-
node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) &&
|
|
1699
|
+
node.host && typeof node.host !== "string" && !node.host._$host && node.contains(e.target) && define("target", node.host);
|
|
1679
1700
|
return true;
|
|
1680
1701
|
};
|
|
1681
1702
|
const atOwner = () => node === owner || node.parentNode === owner;
|
|
1682
1703
|
const walkUpTree = () => {
|
|
1683
1704
|
while (node && handleNode() && !atOwner()) node = parentOf(node);
|
|
1684
1705
|
};
|
|
1685
|
-
Object.defineProperty(e, "currentTarget", {
|
|
1686
|
-
configurable: true,
|
|
1687
|
-
get() {
|
|
1688
|
-
return node || owner;
|
|
1689
|
-
}
|
|
1690
|
-
});
|
|
1691
1706
|
if (resumeNode) {
|
|
1692
1707
|
if (resumeNode === e.target) node = parentOf(resumeNode);
|
|
1693
1708
|
if (node && node !== owner) walkUpTree();
|
|
1694
1709
|
} else if (e.composedPath) {
|
|
1695
1710
|
const path = e.composedPath();
|
|
1696
1711
|
if (path.length) {
|
|
1697
|
-
|
|
1712
|
+
define("target", path[0]);
|
|
1698
1713
|
for (let i = 0; i < path.length; i++) {
|
|
1699
1714
|
node = path[i];
|
|
1700
1715
|
if (!handleNode()) break;
|
|
@@ -1730,8 +1745,7 @@ function insertExpression(parent, value, current, marker) {
|
|
|
1730
1745
|
const tracked = [].concat(current ?? []);
|
|
1731
1746
|
if ([].concat(value).every(n => (n === tracked[0] && tracked.shift(), n?.parentNode === parent)) && !tracked.length) return value;
|
|
1732
1747
|
}
|
|
1733
|
-
const t = typeof value
|
|
1734
|
-
multi = marker !== undefined;
|
|
1748
|
+
const t = typeof value;
|
|
1735
1749
|
if (t === "string" || t === "number") {
|
|
1736
1750
|
const tc = typeof current;
|
|
1737
1751
|
if (tc === "string" || tc === "number") {
|
|
@@ -1746,7 +1760,7 @@ function insertExpression(parent, value, current, marker) {
|
|
|
1746
1760
|
cleanChildren(parent, current, marker);
|
|
1747
1761
|
} else if (value.nodeType) {
|
|
1748
1762
|
if (Array.isArray(current)) {
|
|
1749
|
-
cleanChildren(parent, current,
|
|
1763
|
+
cleanChildren(parent, current, marker ?? null, value);
|
|
1750
1764
|
} else if (current != null && current.nodeType) {
|
|
1751
1765
|
current.parentNode === parent ? parent.replaceChild(value, current) : parent.appendChild(value);
|
|
1752
1766
|
} else if (current != null && parent.firstChild) {
|
|
@@ -1763,7 +1777,8 @@ function insertExpression(parent, value, current, marker) {
|
|
|
1763
1777
|
if (t === "string" || t === "number") {
|
|
1764
1778
|
const prev = currentArray ? current[i] : undefined;
|
|
1765
1779
|
if (prev && prev.nodeType === 3) {
|
|
1766
|
-
|
|
1780
|
+
const last = prev._$d;
|
|
1781
|
+
if (last !== item && (last !== undefined || prev.data !== "" + item)) prev.data = prev._$d = item;
|
|
1767
1782
|
value[i] = prev;
|
|
1768
1783
|
} else value[i] = document.createTextNode(item);
|
|
1769
1784
|
}
|
|
@@ -1823,13 +1838,16 @@ function normalize(value, current, multi, doNotUnwrap) {
|
|
|
1823
1838
|
}
|
|
1824
1839
|
return value;
|
|
1825
1840
|
}
|
|
1841
|
+
function hostGetter() {
|
|
1842
|
+
return this[$$HOST]();
|
|
1843
|
+
}
|
|
1826
1844
|
function tagHost(value, host) {
|
|
1827
1845
|
if (Array.isArray(value)) {
|
|
1828
1846
|
for (let i = 0, len = value.length; i < len; i++) tagHost(value[i], host);
|
|
1829
1847
|
} else if (value && value.nodeType && value[$$HOST] !== host) {
|
|
1830
1848
|
value[$$HOST] = host;
|
|
1831
1849
|
Object.defineProperty(value, "_$host", {
|
|
1832
|
-
get:
|
|
1850
|
+
get: hostGetter,
|
|
1833
1851
|
configurable: true
|
|
1834
1852
|
});
|
|
1835
1853
|
}
|
|
@@ -2090,6 +2108,7 @@ function portalImpl(props) {
|
|
|
2090
2108
|
const m = untrack(mount);
|
|
2091
2109
|
m.appendChild(endMarker);
|
|
2092
2110
|
const dispose = runWithOwner(owner, () => createRoot(d => {
|
|
2111
|
+
installHostTagging();
|
|
2093
2112
|
insert(m, c, endMarker, undefined, {
|
|
2094
2113
|
host: () => treeMarker.parentNode
|
|
2095
2114
|
});
|
|
@@ -2175,4 +2194,4 @@ _moduleUrl) {
|
|
|
2175
2194
|
function httpStatus(_code, _text) {}
|
|
2176
2195
|
function httpHeader(_name, _value, _options) {}
|
|
2177
2196
|
|
|
2178
|
-
export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, REVALIDATE_ALL, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, configureServerErrors, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStatefulProperty, setStyleProperty, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, style, takeHydrationValue, template, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|
|
2197
|
+
export { ChildProperties, DOMElements, DOMWithState, DelegatedEvents, Dynamic, HREF, HydrationScript, MathMLElements, NULL_BODY_STATUSES, Namespaces, Portal, RESPONSE_HEADER_VALUE_LIMIT, REVALIDATE_ALL, REVALIDATE_HEADER, RawTextElements, RequestContext, ResponseEnvelope, SAFE_ERROR, SVGElements, VoidElements, acquireAsset, addEvent, applyRef, assign, claimElement, claimElementTree, className, clearFlashCookie, clientOnly, commitEventResponse, composeMiddleware, configureServerErrors, createRequestEvent, createResponseStub, createSSRResponse, delegateEvents, dispatchAsInteraction, dynamic, dynamicProperty, effect, escape, generateHydrationScript, getDelegatedRoot, getExpectedRedirectStatus, getFirstChild, getHydrationKey, getHydrationWriter, getNextElement, getNextMarker, getNextMatch, getNextSibling, getRequestEvent, getServerFunctionMetadata, getServerFunctionRPC, getTraceContext, hasFlashCookie, hasServerLinkState, httpHeader, httpStatus, hydrate, insert, installHostTagging, installHydrationRuntime, installServerComponentHydration, isDev, isHref, isResponseEnvelope, isSafeError, isServer, isServerFunction, markSafeError, memo, parseCookieHeader, readShallow, redirect, ref, registerDelegatedContainer, registerDelegatedRoot, registerElementClaim, reload, render, renderToStream, renderToString, reportRequestFailure, resolveSSRNode, respond, runHydrationEvents, scope, serializeCookie, setAttribute, setAttributeNS, setLinkClaim, setProperty, setStatefulProperty, setStyleProperty, setTrustedTypesPolicy, spread, ssr, ssrAttribute, ssrClassName, ssrElement, ssrElementAttribute, ssrGroup, ssrHydrationKey, ssrLinkClaim, ssrStyle, ssrStyleProperties, ssrStyleProperty, strictHandler, style, takeHydrationValue, template, trustedHTML, unregisterDelegatedContainer, unregisterDelegatedRoot, useHead, waitAsset, warmAsset };
|