@tanstack/query-devtools 5.0.0-alpha.87 → 5.0.0-alpha.89
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/build/Devtools/{QPWQM7BG.js → 4VMGNIF2.js} +8 -8
- package/build/Devtools/{RZF5MSB2.jsx → AZTKLNIS.jsx} +8 -8
- package/build/Devtools/{QBS7PB6D.js → MUGBGUTD.js} +8 -8
- package/build/Devtools/{OYHFZDAP.jsx → PI4AXB4J.jsx} +8 -8
- package/build/chunk/{LOJK4LQB.jsx → 2N7SLCC6.jsx} +93 -58
- package/build/chunk/{MZOCHHZD.js → C5UID3AG.js} +180 -103
- package/build/chunk/{DFC6JMPR.jsx → KC3COQO2.jsx} +93 -58
- package/build/chunk/{YHTPXJWR.js → QGJD3TIO.js} +180 -103
- package/build/dev.cjs +199 -122
- package/build/dev.js +2 -2
- package/build/dev.jsx +2 -2
- package/build/index.cjs +199 -122
- package/build/index.js +2 -2
- package/build/index.jsx +2 -2
- package/package.json +7 -9
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
// ../../node_modules/.pnpm/solid-js@1.
|
|
2
|
-
var sharedConfig = {
|
|
1
|
+
// ../../node_modules/.pnpm/solid-js@1.7.8/node_modules/solid-js/dist/solid.js
|
|
2
|
+
var sharedConfig = {
|
|
3
|
+
context: void 0,
|
|
4
|
+
registry: void 0
|
|
5
|
+
};
|
|
3
6
|
function setHydrateContext(context) {
|
|
4
7
|
sharedConfig.context = context;
|
|
5
8
|
}
|
|
@@ -90,7 +93,8 @@ function createEffect(fn, value, options) {
|
|
|
90
93
|
const c = createComputation(fn, value, false, STALE), s = SuspenseContext && lookup(Owner, SuspenseContext.id);
|
|
91
94
|
if (s)
|
|
92
95
|
c.suspense = s;
|
|
93
|
-
|
|
96
|
+
if (!options || !options.render)
|
|
97
|
+
c.user = true;
|
|
94
98
|
Effects ? Effects.push(c) : updateComputation(c);
|
|
95
99
|
}
|
|
96
100
|
function createMemo(fn, value, options) {
|
|
@@ -134,7 +138,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
134
138
|
function loadEnd(p, v, error2, key) {
|
|
135
139
|
if (pr === p) {
|
|
136
140
|
pr = null;
|
|
137
|
-
resolved = true;
|
|
141
|
+
key !== void 0 && (resolved = true);
|
|
138
142
|
if ((p === initP || v === initP) && options.onHydrated)
|
|
139
143
|
queueMicrotask(() => options.onHydrated(key, {
|
|
140
144
|
value: v
|
|
@@ -156,7 +160,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
156
160
|
runUpdates(() => {
|
|
157
161
|
if (err === void 0)
|
|
158
162
|
setValue(() => v);
|
|
159
|
-
setState(err !== void 0 ? "errored" : "ready");
|
|
163
|
+
setState(err !== void 0 ? "errored" : resolved ? "ready" : "unresolved");
|
|
160
164
|
setError(err);
|
|
161
165
|
for (const c of contexts.keys())
|
|
162
166
|
c.decrement();
|
|
@@ -343,8 +347,8 @@ function children(fn) {
|
|
|
343
347
|
var SuspenseContext;
|
|
344
348
|
function readSignal() {
|
|
345
349
|
const runningTransition = Transition && Transition.running;
|
|
346
|
-
if (this.sources && (
|
|
347
|
-
if (
|
|
350
|
+
if (this.sources && (runningTransition ? this.tState : this.state)) {
|
|
351
|
+
if ((runningTransition ? this.tState : this.state) === STALE)
|
|
348
352
|
updateComputation(this);
|
|
349
353
|
else {
|
|
350
354
|
const updates = Updates;
|
|
@@ -394,7 +398,7 @@ function writeSignal(node, value, isComp) {
|
|
|
394
398
|
const TransitionRunning = Transition && Transition.running;
|
|
395
399
|
if (TransitionRunning && Transition.disposed.has(o))
|
|
396
400
|
continue;
|
|
397
|
-
if (TransitionRunning
|
|
401
|
+
if (TransitionRunning ? !o.tState : !o.state) {
|
|
398
402
|
if (o.pure)
|
|
399
403
|
Updates.push(o);
|
|
400
404
|
else
|
|
@@ -402,10 +406,10 @@ function writeSignal(node, value, isComp) {
|
|
|
402
406
|
if (o.observers)
|
|
403
407
|
markDownstream(o);
|
|
404
408
|
}
|
|
405
|
-
if (TransitionRunning)
|
|
406
|
-
o.tState = STALE;
|
|
407
|
-
else
|
|
409
|
+
if (!TransitionRunning)
|
|
408
410
|
o.state = STALE;
|
|
411
|
+
else
|
|
412
|
+
o.tState = STALE;
|
|
409
413
|
}
|
|
410
414
|
if (Updates.length > 1e6) {
|
|
411
415
|
Updates = [];
|
|
@@ -518,9 +522,9 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
518
522
|
}
|
|
519
523
|
function runTop(node) {
|
|
520
524
|
const runningTransition = Transition && Transition.running;
|
|
521
|
-
if (
|
|
525
|
+
if ((runningTransition ? node.tState : node.state) === 0)
|
|
522
526
|
return;
|
|
523
|
-
if (
|
|
527
|
+
if ((runningTransition ? node.tState : node.state) === PENDING)
|
|
524
528
|
return lookUpstream(node);
|
|
525
529
|
if (node.suspense && untrack(node.suspense.inFallback))
|
|
526
530
|
return node.suspense.effects.push(node);
|
|
@@ -528,7 +532,7 @@ function runTop(node) {
|
|
|
528
532
|
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
529
533
|
if (runningTransition && Transition.disposed.has(node))
|
|
530
534
|
return;
|
|
531
|
-
if (
|
|
535
|
+
if (runningTransition ? node.tState : node.state)
|
|
532
536
|
ancestors.push(node);
|
|
533
537
|
}
|
|
534
538
|
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
@@ -540,9 +544,9 @@ function runTop(node) {
|
|
|
540
544
|
return;
|
|
541
545
|
}
|
|
542
546
|
}
|
|
543
|
-
if (
|
|
547
|
+
if ((runningTransition ? node.tState : node.state) === STALE) {
|
|
544
548
|
updateComputation(node);
|
|
545
|
-
} else if (
|
|
549
|
+
} else if ((runningTransition ? node.tState : node.state) === PENDING) {
|
|
546
550
|
const updates = Updates;
|
|
547
551
|
Updates = null;
|
|
548
552
|
runUpdates(() => lookUpstream(node, ancestors[0]), false);
|
|
@@ -656,8 +660,18 @@ function runUserEffects(queue) {
|
|
|
656
660
|
else
|
|
657
661
|
queue[userLength++] = e;
|
|
658
662
|
}
|
|
659
|
-
if (sharedConfig.context)
|
|
663
|
+
if (sharedConfig.context) {
|
|
664
|
+
if (sharedConfig.count) {
|
|
665
|
+
sharedConfig.effects || (sharedConfig.effects = []);
|
|
666
|
+
sharedConfig.effects.push(...queue.slice(0, userLength));
|
|
667
|
+
return;
|
|
668
|
+
} else if (sharedConfig.effects) {
|
|
669
|
+
queue = [...sharedConfig.effects, ...queue];
|
|
670
|
+
userLength += sharedConfig.effects.length;
|
|
671
|
+
delete sharedConfig.effects;
|
|
672
|
+
}
|
|
660
673
|
setHydrateContext();
|
|
674
|
+
}
|
|
661
675
|
for (i = 0; i < userLength; i++)
|
|
662
676
|
runTop(queue[i]);
|
|
663
677
|
}
|
|
@@ -670,10 +684,11 @@ function lookUpstream(node, ignore) {
|
|
|
670
684
|
for (let i = 0; i < node.sources.length; i += 1) {
|
|
671
685
|
const source = node.sources[i];
|
|
672
686
|
if (source.sources) {
|
|
673
|
-
|
|
687
|
+
const state = runningTransition ? source.tState : source.state;
|
|
688
|
+
if (state === STALE) {
|
|
674
689
|
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
|
|
675
690
|
runTop(source);
|
|
676
|
-
} else if (
|
|
691
|
+
} else if (state === PENDING)
|
|
677
692
|
lookUpstream(source, ignore);
|
|
678
693
|
}
|
|
679
694
|
}
|
|
@@ -682,7 +697,7 @@ function markDownstream(node) {
|
|
|
682
697
|
const runningTransition = Transition && Transition.running;
|
|
683
698
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
684
699
|
const o = node.observers[i];
|
|
685
|
-
if (
|
|
700
|
+
if (runningTransition ? !o.tState : !o.state) {
|
|
686
701
|
if (runningTransition)
|
|
687
702
|
o.tState = PENDING;
|
|
688
703
|
else
|
|
@@ -712,18 +727,18 @@ function cleanNode(node) {
|
|
|
712
727
|
}
|
|
713
728
|
if (Transition && Transition.running && node.pure) {
|
|
714
729
|
if (node.tOwned) {
|
|
715
|
-
for (i =
|
|
730
|
+
for (i = node.tOwned.length - 1; i >= 0; i--)
|
|
716
731
|
cleanNode(node.tOwned[i]);
|
|
717
732
|
delete node.tOwned;
|
|
718
733
|
}
|
|
719
734
|
reset(node, true);
|
|
720
735
|
} else if (node.owned) {
|
|
721
|
-
for (i =
|
|
736
|
+
for (i = node.owned.length - 1; i >= 0; i--)
|
|
722
737
|
cleanNode(node.owned[i]);
|
|
723
738
|
node.owned = null;
|
|
724
739
|
}
|
|
725
740
|
if (node.cleanups) {
|
|
726
|
-
for (i =
|
|
741
|
+
for (i = node.cleanups.length - 1; i >= 0; i--)
|
|
727
742
|
node.cleanups[i]();
|
|
728
743
|
node.cleanups = null;
|
|
729
744
|
}
|
|
@@ -744,28 +759,34 @@ function reset(node, top) {
|
|
|
744
759
|
}
|
|
745
760
|
}
|
|
746
761
|
function castError(err) {
|
|
747
|
-
if (err instanceof Error
|
|
762
|
+
if (err instanceof Error)
|
|
748
763
|
return err;
|
|
749
|
-
return new Error("Unknown error"
|
|
764
|
+
return new Error(typeof err === "string" ? err : "Unknown error", {
|
|
765
|
+
cause: err
|
|
766
|
+
});
|
|
750
767
|
}
|
|
751
|
-
function runErrors(fns,
|
|
752
|
-
|
|
753
|
-
f
|
|
768
|
+
function runErrors(err, fns, owner) {
|
|
769
|
+
try {
|
|
770
|
+
for (const f of fns)
|
|
771
|
+
f(err);
|
|
772
|
+
} catch (e) {
|
|
773
|
+
handleError(e, owner && owner.owner || null);
|
|
774
|
+
}
|
|
754
775
|
}
|
|
755
|
-
function handleError(err) {
|
|
756
|
-
|
|
757
|
-
const
|
|
776
|
+
function handleError(err, owner = Owner) {
|
|
777
|
+
const fns = ERROR && lookup(owner, ERROR);
|
|
778
|
+
const error = castError(err);
|
|
758
779
|
if (!fns)
|
|
759
|
-
throw
|
|
780
|
+
throw error;
|
|
760
781
|
if (Effects)
|
|
761
782
|
Effects.push({
|
|
762
783
|
fn() {
|
|
763
|
-
runErrors(fns,
|
|
784
|
+
runErrors(error, fns, owner);
|
|
764
785
|
},
|
|
765
786
|
state: STALE
|
|
766
787
|
});
|
|
767
788
|
else
|
|
768
|
-
runErrors(fns,
|
|
789
|
+
runErrors(error, fns, owner);
|
|
769
790
|
}
|
|
770
791
|
function lookup(owner, key) {
|
|
771
792
|
return owner ? owner.context && owner.context[key] !== void 0 ? owner.context[key] : lookup(owner.owner, key) : void 0;
|
|
@@ -992,6 +1013,13 @@ var propTraps = {
|
|
|
992
1013
|
function resolveSource(s) {
|
|
993
1014
|
return !(s = typeof s === "function" ? s() : s) ? {} : s;
|
|
994
1015
|
}
|
|
1016
|
+
function resolveSources() {
|
|
1017
|
+
for (let i = 0, length = this.length; i < length; ++i) {
|
|
1018
|
+
const v = this[i]();
|
|
1019
|
+
if (v !== void 0)
|
|
1020
|
+
return v;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
995
1023
|
function mergeProps(...sources) {
|
|
996
1024
|
let proxy = false;
|
|
997
1025
|
for (let i = 0; i < sources.length; i++) {
|
|
@@ -1024,22 +1052,41 @@ function mergeProps(...sources) {
|
|
|
1024
1052
|
}, propTraps);
|
|
1025
1053
|
}
|
|
1026
1054
|
const target = {};
|
|
1055
|
+
const sourcesMap = {};
|
|
1056
|
+
const defined = /* @__PURE__ */ new Set();
|
|
1027
1057
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1058
|
+
const source = sources[i];
|
|
1059
|
+
if (!source)
|
|
1060
|
+
continue;
|
|
1061
|
+
const sourceKeys = Object.getOwnPropertyNames(source);
|
|
1062
|
+
for (let i2 = 0, length = sourceKeys.length; i2 < length; i2++) {
|
|
1063
|
+
const key = sourceKeys[i2];
|
|
1064
|
+
if (key === "__proto__" || key === "constructor")
|
|
1065
|
+
continue;
|
|
1066
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
1067
|
+
if (!defined.has(key)) {
|
|
1068
|
+
if (desc.get) {
|
|
1069
|
+
defined.add(key);
|
|
1070
|
+
Object.defineProperty(target, key, {
|
|
1071
|
+
enumerable: true,
|
|
1072
|
+
configurable: true,
|
|
1073
|
+
get: resolveSources.bind(sourcesMap[key] = [desc.get.bind(source)])
|
|
1074
|
+
});
|
|
1075
|
+
} else {
|
|
1076
|
+
if (desc.value !== void 0)
|
|
1077
|
+
defined.add(key);
|
|
1078
|
+
target[key] = desc.value;
|
|
1079
|
+
}
|
|
1080
|
+
} else {
|
|
1081
|
+
const sources2 = sourcesMap[key];
|
|
1082
|
+
if (sources2) {
|
|
1083
|
+
if (desc.get) {
|
|
1084
|
+
sources2.push(desc.get.bind(source));
|
|
1085
|
+
} else if (desc.value !== void 0) {
|
|
1086
|
+
sources2.push(() => desc.value);
|
|
1041
1087
|
}
|
|
1042
|
-
})
|
|
1088
|
+
} else if (target[key] === void 0)
|
|
1089
|
+
target[key] = desc.value;
|
|
1043
1090
|
}
|
|
1044
1091
|
}
|
|
1045
1092
|
}
|
|
@@ -1052,8 +1099,11 @@ function lazy(fn) {
|
|
|
1052
1099
|
const ctx = sharedConfig.context;
|
|
1053
1100
|
if (ctx) {
|
|
1054
1101
|
const [s, set] = createSignal();
|
|
1102
|
+
sharedConfig.count || (sharedConfig.count = 0);
|
|
1103
|
+
sharedConfig.count++;
|
|
1055
1104
|
(p || (p = fn())).then((mod) => {
|
|
1056
1105
|
setHydrateContext(ctx);
|
|
1106
|
+
sharedConfig.count--;
|
|
1057
1107
|
set(() => mod.default);
|
|
1058
1108
|
setHydrateContext();
|
|
1059
1109
|
});
|
|
@@ -1078,6 +1128,7 @@ function lazy(fn) {
|
|
|
1078
1128
|
wrap.preload = () => p || ((p = fn()).then((mod) => comp = () => mod.default), p);
|
|
1079
1129
|
return wrap;
|
|
1080
1130
|
}
|
|
1131
|
+
var narrowedError = (name) => `Stale read from <${name}>.`;
|
|
1081
1132
|
function For(props) {
|
|
1082
1133
|
const fallback = "fallback" in props && {
|
|
1083
1134
|
fallback: () => props.fallback
|
|
@@ -1091,26 +1142,27 @@ function Index(props) {
|
|
|
1091
1142
|
return createMemo(indexArray(() => props.each, props.children, fallback || void 0));
|
|
1092
1143
|
}
|
|
1093
1144
|
function Show(props) {
|
|
1094
|
-
let strictEqual = false;
|
|
1095
1145
|
const keyed = props.keyed;
|
|
1096
1146
|
const condition = createMemo(() => props.when, void 0, {
|
|
1097
|
-
equals: (a, b) =>
|
|
1147
|
+
equals: (a, b) => keyed ? a === b : !a === !b
|
|
1098
1148
|
});
|
|
1099
1149
|
return createMemo(() => {
|
|
1100
1150
|
const c = condition();
|
|
1101
1151
|
if (c) {
|
|
1102
1152
|
const child = props.children;
|
|
1103
1153
|
const fn = typeof child === "function" && child.length > 0;
|
|
1104
|
-
|
|
1105
|
-
|
|
1154
|
+
return fn ? untrack(() => child(keyed ? c : () => {
|
|
1155
|
+
if (!untrack(condition))
|
|
1156
|
+
throw narrowedError("Show");
|
|
1157
|
+
return props.when;
|
|
1158
|
+
})) : child;
|
|
1106
1159
|
}
|
|
1107
1160
|
return props.fallback;
|
|
1108
1161
|
}, void 0, void 0);
|
|
1109
1162
|
}
|
|
1110
1163
|
function Switch(props) {
|
|
1111
|
-
let strictEqual = false;
|
|
1112
1164
|
let keyed = false;
|
|
1113
|
-
const equals = (a, b) => a[0] === b[0] && (
|
|
1165
|
+
const equals = (a, b) => a[0] === b[0] && (keyed ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
1114
1166
|
const conditions = children(() => props.children), evalConditions = createMemo(() => {
|
|
1115
1167
|
let conds = conditions();
|
|
1116
1168
|
if (!Array.isArray(conds))
|
|
@@ -1132,15 +1184,18 @@ function Switch(props) {
|
|
|
1132
1184
|
return props.fallback;
|
|
1133
1185
|
const c = cond.children;
|
|
1134
1186
|
const fn = typeof c === "function" && c.length > 0;
|
|
1135
|
-
|
|
1136
|
-
|
|
1187
|
+
return fn ? untrack(() => c(keyed ? when : () => {
|
|
1188
|
+
if (untrack(evalConditions)[0] !== index)
|
|
1189
|
+
throw narrowedError("Match");
|
|
1190
|
+
return cond.when;
|
|
1191
|
+
})) : c;
|
|
1137
1192
|
}, void 0, void 0);
|
|
1138
1193
|
}
|
|
1139
1194
|
function Match(props) {
|
|
1140
1195
|
return props;
|
|
1141
1196
|
}
|
|
1142
1197
|
|
|
1143
|
-
// ../../node_modules/.pnpm/solid-js@1.
|
|
1198
|
+
// ../../node_modules/.pnpm/solid-js@1.7.8/node_modules/solid-js/web/dist/web.js
|
|
1144
1199
|
var booleans = ["allowfullscreen", "async", "autofocus", "autoplay", "checked", "controls", "default", "disabled", "formnovalidate", "hidden", "indeterminate", "ismap", "loop", "multiple", "muted", "nomodule", "novalidate", "open", "playsinline", "readonly", "required", "reversed", "seamless", "selected"];
|
|
1145
1200
|
var Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
1146
1201
|
var ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
@@ -1150,12 +1205,33 @@ var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null),
|
|
|
1150
1205
|
});
|
|
1151
1206
|
var PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
1152
1207
|
class: "className",
|
|
1153
|
-
formnovalidate:
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1208
|
+
formnovalidate: {
|
|
1209
|
+
$: "formNoValidate",
|
|
1210
|
+
BUTTON: 1,
|
|
1211
|
+
INPUT: 1
|
|
1212
|
+
},
|
|
1213
|
+
ismap: {
|
|
1214
|
+
$: "isMap",
|
|
1215
|
+
IMG: 1
|
|
1216
|
+
},
|
|
1217
|
+
nomodule: {
|
|
1218
|
+
$: "noModule",
|
|
1219
|
+
SCRIPT: 1
|
|
1220
|
+
},
|
|
1221
|
+
playsinline: {
|
|
1222
|
+
$: "playsInline",
|
|
1223
|
+
VIDEO: 1
|
|
1224
|
+
},
|
|
1225
|
+
readonly: {
|
|
1226
|
+
$: "readOnly",
|
|
1227
|
+
INPUT: 1,
|
|
1228
|
+
TEXTAREA: 1
|
|
1229
|
+
}
|
|
1158
1230
|
});
|
|
1231
|
+
function getPropAlias(prop, tagName) {
|
|
1232
|
+
const a = PropAliases[prop];
|
|
1233
|
+
return typeof a === "object" ? a[tagName] ? a["$"] : void 0 : a;
|
|
1234
|
+
}
|
|
1159
1235
|
var 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"]);
|
|
1160
1236
|
var SVGNamespace = {
|
|
1161
1237
|
xlink: "http://www.w3.org/1999/xlink",
|
|
@@ -1229,18 +1305,16 @@ function render(code, element, init, options = {}) {
|
|
|
1229
1305
|
element.textContent = "";
|
|
1230
1306
|
};
|
|
1231
1307
|
}
|
|
1232
|
-
function template(html,
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
node = node.firstChild;
|
|
1243
|
-
return node;
|
|
1308
|
+
function template(html, isCE, isSVG) {
|
|
1309
|
+
let node;
|
|
1310
|
+
const create = () => {
|
|
1311
|
+
const t = document.createElement("template");
|
|
1312
|
+
t.innerHTML = html;
|
|
1313
|
+
return isSVG ? t.content.firstChild.firstChild : t.content.firstChild;
|
|
1314
|
+
};
|
|
1315
|
+
const fn = isCE ? () => untrack(() => document.importNode(node || (node = create()), true)) : () => (node || (node = create())).cloneNode(true);
|
|
1316
|
+
fn.cloneNode = fn;
|
|
1317
|
+
return fn;
|
|
1244
1318
|
}
|
|
1245
1319
|
function delegateEvents(eventNames, document2 = window.document) {
|
|
1246
1320
|
const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set());
|
|
@@ -1372,7 +1446,7 @@ function toggleClassKey(node, key, value) {
|
|
|
1372
1446
|
node.classList.toggle(classNames[i], value);
|
|
1373
1447
|
}
|
|
1374
1448
|
function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
1375
|
-
let isCE, isProp, isChildProp;
|
|
1449
|
+
let isCE, isProp, isChildProp, propAlias, forceProp;
|
|
1376
1450
|
if (prop === "style")
|
|
1377
1451
|
return style(node, value, prev);
|
|
1378
1452
|
if (prop === "classList")
|
|
@@ -1401,13 +1475,19 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
1401
1475
|
addEventListener(node, name, value, delegate);
|
|
1402
1476
|
delegate && delegateEvents([name]);
|
|
1403
1477
|
}
|
|
1404
|
-
} else if (
|
|
1478
|
+
} else if (prop.slice(0, 5) === "attr:") {
|
|
1479
|
+
setAttribute(node, prop.slice(5), value);
|
|
1480
|
+
} else if ((forceProp = prop.slice(0, 5) === "prop:") || (isChildProp = ChildProperties.has(prop)) || !isSVG && ((propAlias = getPropAlias(prop, node.tagName)) || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
|
|
1481
|
+
if (forceProp) {
|
|
1482
|
+
prop = prop.slice(5);
|
|
1483
|
+
isProp = true;
|
|
1484
|
+
}
|
|
1405
1485
|
if (prop === "class" || prop === "className")
|
|
1406
1486
|
className(node, value);
|
|
1407
1487
|
else if (isCE && !isProp && !isChildProp)
|
|
1408
1488
|
node[toPropertyName(prop)] = value;
|
|
1409
1489
|
else
|
|
1410
|
-
node[
|
|
1490
|
+
node[propAlias || prop] = value;
|
|
1411
1491
|
} else {
|
|
1412
1492
|
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
1413
1493
|
if (ns)
|
|
@@ -1432,17 +1512,8 @@ function eventHandler(e) {
|
|
|
1432
1512
|
return node || document;
|
|
1433
1513
|
}
|
|
1434
1514
|
});
|
|
1435
|
-
if (sharedConfig.registry && !sharedConfig.done)
|
|
1436
|
-
sharedConfig.done = true;
|
|
1437
|
-
document.querySelectorAll("[id^=pl-]").forEach((elem) => {
|
|
1438
|
-
while (elem && elem.nodeType !== 8 && elem.nodeValue !== "pl-" + e) {
|
|
1439
|
-
let x = elem.nextSibling;
|
|
1440
|
-
elem.remove();
|
|
1441
|
-
elem = x;
|
|
1442
|
-
}
|
|
1443
|
-
elem && elem.remove();
|
|
1444
|
-
});
|
|
1445
|
-
}
|
|
1515
|
+
if (sharedConfig.registry && !sharedConfig.done)
|
|
1516
|
+
sharedConfig.done = _$HY.done = true;
|
|
1446
1517
|
while (node) {
|
|
1447
1518
|
const handler = node[key];
|
|
1448
1519
|
if (handler && !node.disabled) {
|
|
@@ -1455,8 +1526,18 @@ function eventHandler(e) {
|
|
|
1455
1526
|
}
|
|
1456
1527
|
}
|
|
1457
1528
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
1458
|
-
if (sharedConfig.context
|
|
1459
|
-
current = [...parent.childNodes];
|
|
1529
|
+
if (sharedConfig.context) {
|
|
1530
|
+
!current && (current = [...parent.childNodes]);
|
|
1531
|
+
let cleaned = [];
|
|
1532
|
+
for (let i = 0; i < current.length; i++) {
|
|
1533
|
+
const node = current[i];
|
|
1534
|
+
if (node.nodeType === 8 && node.data.slice(0, 2) === "!$")
|
|
1535
|
+
node.remove();
|
|
1536
|
+
else
|
|
1537
|
+
cleaned.push(node);
|
|
1538
|
+
}
|
|
1539
|
+
current = cleaned;
|
|
1540
|
+
}
|
|
1460
1541
|
while (typeof current === "function")
|
|
1461
1542
|
current = current();
|
|
1462
1543
|
if (value === current)
|
|
@@ -1522,7 +1603,7 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
1522
1603
|
appendNodes(parent, array);
|
|
1523
1604
|
}
|
|
1524
1605
|
current = array;
|
|
1525
|
-
} else if (value
|
|
1606
|
+
} else if (value.nodeType) {
|
|
1526
1607
|
if (sharedConfig.context && value.parentNode)
|
|
1527
1608
|
return current = multi ? [value] : value;
|
|
1528
1609
|
if (Array.isArray(current)) {
|
|
@@ -1541,14 +1622,14 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
1541
1622
|
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
1542
1623
|
let dynamic = false;
|
|
1543
1624
|
for (let i = 0, len = array.length; i < len; i++) {
|
|
1544
|
-
let item = array[i], prev = current && current[i];
|
|
1545
|
-
if (item
|
|
1546
|
-
normalized.push(item);
|
|
1547
|
-
} else if (item == null || item === true || item === false)
|
|
1625
|
+
let item = array[i], prev = current && current[i], t;
|
|
1626
|
+
if (item == null || item === true || item === false)
|
|
1548
1627
|
;
|
|
1549
|
-
else if (
|
|
1628
|
+
else if ((t = typeof item) === "object" && item.nodeType) {
|
|
1629
|
+
normalized.push(item);
|
|
1630
|
+
} else if (Array.isArray(item)) {
|
|
1550
1631
|
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
1551
|
-
} else if (
|
|
1632
|
+
} else if (t === "function") {
|
|
1552
1633
|
if (unwrap) {
|
|
1553
1634
|
while (typeof item === "function")
|
|
1554
1635
|
item = item();
|
|
@@ -1559,13 +1640,9 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
1559
1640
|
}
|
|
1560
1641
|
} else {
|
|
1561
1642
|
const value = String(item);
|
|
1562
|
-
if (
|
|
1563
|
-
if (prev && prev.nodeType === 8)
|
|
1564
|
-
normalized.push(prev);
|
|
1565
|
-
} else if (prev && prev.nodeType === 3) {
|
|
1566
|
-
prev.data = value;
|
|
1643
|
+
if (prev && prev.nodeType === 3 && prev.data === value)
|
|
1567
1644
|
normalized.push(prev);
|
|
1568
|
-
|
|
1645
|
+
else
|
|
1569
1646
|
normalized.push(document.createTextNode(value));
|
|
1570
1647
|
}
|
|
1571
1648
|
}
|