@tanstack/query-devtools 5.0.0-alpha.84 → 5.0.0-alpha.87
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/OYHFZDAP.jsx +6711 -0
- package/build/Devtools/QBS7PB6D.js +5885 -0
- package/build/Devtools/QPWQM7BG.js +6068 -0
- package/build/Devtools/RZF5MSB2.jsx +6637 -0
- package/build/chunk/DFC6JMPR.jsx +1280 -0
- package/build/chunk/LOJK4LQB.jsx +1280 -0
- package/{dist/esm/index-7c6d68e3.js → build/chunk/MZOCHHZD.js} +648 -416
- package/{dist/cjs/index-edbb2275.cjs → build/chunk/YHTPXJWR.js} +648 -446
- package/build/dev.cjs +8116 -0
- package/build/dev.js +99 -0
- package/build/dev.jsx +98 -0
- package/build/index.cjs +7940 -0
- package/build/index.d.cts +55 -0
- package/build/index.d.ts +55 -0
- package/build/index.js +99 -0
- package/build/index.jsx +98 -0
- package/package.json +24 -18
- package/src/Devtools.tsx +1 -3
- package/dist/cjs/Devtools-0f2840bd.cjs +0 -6766
- package/dist/cjs/Devtools-0f2840bd.cjs.map +0 -1
- package/dist/cjs/index-edbb2275.cjs.map +0 -1
- package/dist/cjs/index.cjs +0 -8
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/esm/Devtools-26de9f2c.js +0 -6758
- package/dist/esm/Devtools-26de9f2c.js.map +0 -1
- package/dist/esm/index-7c6d68e3.js.map +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/source/Context.js +0 -10
- package/dist/source/Devtools.jsx +0 -1512
- package/dist/source/Explorer.jsx +0 -264
- package/dist/source/fonts.js +0 -7
- package/dist/source/icons/index.jsx +0 -344
- package/dist/source/index.jsx +0 -88
- package/dist/source/theme.js +0 -304
- package/dist/source/utils.jsx +0 -77
- package/dist/types/Context.d.ts +0 -28
- package/dist/types/Devtools.d.ts +0 -22
- package/dist/types/Explorer.d.ts +0 -21
- package/dist/types/fonts.d.ts +0 -1
- package/dist/types/icons/index.d.ts +0 -11
- package/dist/types/index.d.ts +0 -29
- package/dist/types/theme.d.ts +0 -296
- package/dist/types/utils.d.ts +0 -23
|
@@ -1,41 +1,48 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/.pnpm/solid-js@1.6.13/node_modules/solid-js/dist/solid.js
|
|
2
|
+
var sharedConfig = {};
|
|
2
3
|
function setHydrateContext(context) {
|
|
3
4
|
sharedConfig.context = context;
|
|
4
5
|
}
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
function nextHydrateContext() {
|
|
7
|
+
return {
|
|
8
|
+
...sharedConfig.context,
|
|
9
|
+
id: `${sharedConfig.context.id}${sharedConfig.context.count++}-`,
|
|
10
|
+
count: 0
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
var equalFn = (a, b) => a === b;
|
|
14
|
+
var $PROXY = Symbol("solid-proxy");
|
|
15
|
+
var $TRACK = Symbol("solid-track");
|
|
16
|
+
var signalOptions = {
|
|
9
17
|
equals: equalFn
|
|
10
18
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
var ERROR = null;
|
|
20
|
+
var runEffects = runQueue;
|
|
21
|
+
var STALE = 1;
|
|
22
|
+
var PENDING = 2;
|
|
23
|
+
var UNOWNED = {
|
|
15
24
|
owned: null,
|
|
16
25
|
cleanups: null,
|
|
17
26
|
context: null,
|
|
18
27
|
owner: null
|
|
19
28
|
};
|
|
20
|
-
|
|
29
|
+
var NO_INIT = {};
|
|
21
30
|
var Owner = null;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
var Transition = null;
|
|
32
|
+
var Scheduler = null;
|
|
33
|
+
var ExternalSourceFactory = null;
|
|
34
|
+
var Listener = null;
|
|
35
|
+
var Updates = null;
|
|
36
|
+
var Effects = null;
|
|
37
|
+
var ExecCount = 0;
|
|
38
|
+
var [transPending, setTransPending] = /* @__PURE__ */ createSignal(false);
|
|
28
39
|
function createRoot(fn, detachedOwner) {
|
|
29
|
-
const listener = Listener,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
context: null,
|
|
36
|
-
owner: detachedOwner === undefined ? owner : detachedOwner
|
|
37
|
-
},
|
|
38
|
-
updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
|
|
40
|
+
const listener = Listener, owner = Owner, unowned = fn.length === 0, root = unowned ? UNOWNED : {
|
|
41
|
+
owned: null,
|
|
42
|
+
cleanups: null,
|
|
43
|
+
context: null,
|
|
44
|
+
owner: detachedOwner === void 0 ? owner : detachedOwner
|
|
45
|
+
}, updateFn = unowned ? fn : () => fn(() => untrack(() => cleanNode(root)));
|
|
39
46
|
Owner = root;
|
|
40
47
|
Listener = null;
|
|
41
48
|
try {
|
|
@@ -51,27 +58,38 @@ function createSignal(value, options) {
|
|
|
51
58
|
value,
|
|
52
59
|
observers: null,
|
|
53
60
|
observerSlots: null,
|
|
54
|
-
comparator: options.equals ||
|
|
61
|
+
comparator: options.equals || void 0
|
|
55
62
|
};
|
|
56
|
-
const setter =
|
|
57
|
-
if (typeof
|
|
58
|
-
|
|
63
|
+
const setter = (value2) => {
|
|
64
|
+
if (typeof value2 === "function") {
|
|
65
|
+
if (Transition && Transition.running && Transition.sources.has(s))
|
|
66
|
+
value2 = value2(s.tValue);
|
|
67
|
+
else
|
|
68
|
+
value2 = value2(s.value);
|
|
59
69
|
}
|
|
60
|
-
return writeSignal(s,
|
|
70
|
+
return writeSignal(s, value2);
|
|
61
71
|
};
|
|
62
72
|
return [readSignal.bind(s), setter];
|
|
63
73
|
}
|
|
64
74
|
function createComputed(fn, value, options) {
|
|
65
75
|
const c = createComputation(fn, value, true, STALE);
|
|
66
|
-
|
|
76
|
+
if (Scheduler && Transition && Transition.running)
|
|
77
|
+
Updates.push(c);
|
|
78
|
+
else
|
|
79
|
+
updateComputation(c);
|
|
67
80
|
}
|
|
68
81
|
function createRenderEffect(fn, value, options) {
|
|
69
82
|
const c = createComputation(fn, value, false, STALE);
|
|
70
|
-
|
|
83
|
+
if (Scheduler && Transition && Transition.running)
|
|
84
|
+
Updates.push(c);
|
|
85
|
+
else
|
|
86
|
+
updateComputation(c);
|
|
71
87
|
}
|
|
72
88
|
function createEffect(fn, value, options) {
|
|
73
89
|
runEffects = runUserEffects;
|
|
74
|
-
const c = createComputation(fn, value, false, STALE);
|
|
90
|
+
const c = createComputation(fn, value, false, STALE), s = SuspenseContext && lookup(Owner, SuspenseContext.id);
|
|
91
|
+
if (s)
|
|
92
|
+
c.suspense = s;
|
|
75
93
|
c.user = true;
|
|
76
94
|
Effects ? Effects.push(c) : updateComputation(c);
|
|
77
95
|
}
|
|
@@ -80,8 +98,12 @@ function createMemo(fn, value, options) {
|
|
|
80
98
|
const c = createComputation(fn, value, true, 0);
|
|
81
99
|
c.observers = null;
|
|
82
100
|
c.observerSlots = null;
|
|
83
|
-
c.comparator = options.equals ||
|
|
84
|
-
|
|
101
|
+
c.comparator = options.equals || void 0;
|
|
102
|
+
if (Scheduler && Transition && Transition.running) {
|
|
103
|
+
c.tState = STALE;
|
|
104
|
+
Updates.push(c);
|
|
105
|
+
} else
|
|
106
|
+
updateComputation(c);
|
|
85
107
|
return readSignal.bind(c);
|
|
86
108
|
}
|
|
87
109
|
function createResource(pSource, pFetcher, pOptions) {
|
|
@@ -97,55 +119,61 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
97
119
|
fetcher = pFetcher;
|
|
98
120
|
options = pOptions || {};
|
|
99
121
|
}
|
|
100
|
-
let pr = null,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
resolved = ("initialValue" in options),
|
|
105
|
-
dynamic = typeof source === "function" && createMemo(source);
|
|
106
|
-
const contexts = new Set(),
|
|
107
|
-
[value, setValue] = (options.storage || createSignal)(options.initialValue),
|
|
108
|
-
[error, setError] = createSignal(undefined),
|
|
109
|
-
[track, trigger] = createSignal(undefined, {
|
|
110
|
-
equals: false
|
|
111
|
-
}),
|
|
112
|
-
[state, setState] = createSignal(resolved ? "ready" : "unresolved");
|
|
122
|
+
let pr = null, initP = NO_INIT, id = null, loadedUnderTransition = false, scheduled = false, resolved = "initialValue" in options, dynamic = typeof source === "function" && createMemo(source);
|
|
123
|
+
const contexts = /* @__PURE__ */ new Set(), [value, setValue] = (options.storage || createSignal)(options.initialValue), [error, setError] = createSignal(void 0), [track, trigger] = createSignal(void 0, {
|
|
124
|
+
equals: false
|
|
125
|
+
}), [state, setState] = createSignal(resolved ? "ready" : "unresolved");
|
|
113
126
|
if (sharedConfig.context) {
|
|
114
127
|
id = `${sharedConfig.context.id}${sharedConfig.context.count++}`;
|
|
115
128
|
let v;
|
|
116
|
-
if (options.ssrLoadFrom === "initial")
|
|
129
|
+
if (options.ssrLoadFrom === "initial")
|
|
130
|
+
initP = options.initialValue;
|
|
131
|
+
else if (sharedConfig.load && (v = sharedConfig.load(id)))
|
|
132
|
+
initP = v[0];
|
|
117
133
|
}
|
|
118
|
-
function loadEnd(p, v,
|
|
134
|
+
function loadEnd(p, v, error2, key) {
|
|
119
135
|
if (pr === p) {
|
|
120
136
|
pr = null;
|
|
121
137
|
resolved = true;
|
|
122
|
-
if ((p === initP || v === initP) && options.onHydrated)
|
|
123
|
-
|
|
124
|
-
|
|
138
|
+
if ((p === initP || v === initP) && options.onHydrated)
|
|
139
|
+
queueMicrotask(() => options.onHydrated(key, {
|
|
140
|
+
value: v
|
|
141
|
+
}));
|
|
125
142
|
initP = NO_INIT;
|
|
126
|
-
|
|
143
|
+
if (Transition && p && loadedUnderTransition) {
|
|
144
|
+
Transition.promises.delete(p);
|
|
145
|
+
loadedUnderTransition = false;
|
|
146
|
+
runUpdates(() => {
|
|
147
|
+
Transition.running = true;
|
|
148
|
+
completeLoad(v, error2);
|
|
149
|
+
}, false);
|
|
150
|
+
} else
|
|
151
|
+
completeLoad(v, error2);
|
|
127
152
|
}
|
|
128
153
|
return v;
|
|
129
154
|
}
|
|
130
155
|
function completeLoad(v, err) {
|
|
131
156
|
runUpdates(() => {
|
|
132
|
-
if (err ===
|
|
133
|
-
|
|
157
|
+
if (err === void 0)
|
|
158
|
+
setValue(() => v);
|
|
159
|
+
setState(err !== void 0 ? "errored" : "ready");
|
|
134
160
|
setError(err);
|
|
135
|
-
for (const c of contexts.keys())
|
|
161
|
+
for (const c of contexts.keys())
|
|
162
|
+
c.decrement();
|
|
136
163
|
contexts.clear();
|
|
137
164
|
}, false);
|
|
138
165
|
}
|
|
139
166
|
function read() {
|
|
140
|
-
const c = SuspenseContext ,
|
|
141
|
-
|
|
142
|
-
err
|
|
143
|
-
if (err !== undefined && !pr) throw err;
|
|
167
|
+
const c = SuspenseContext && lookup(Owner, SuspenseContext.id), v = value(), err = error();
|
|
168
|
+
if (err !== void 0 && !pr)
|
|
169
|
+
throw err;
|
|
144
170
|
if (Listener && !Listener.user && c) {
|
|
145
171
|
createComputed(() => {
|
|
146
172
|
track();
|
|
147
173
|
if (pr) {
|
|
148
|
-
if (c.resolved
|
|
174
|
+
if (c.resolved && Transition && loadedUnderTransition)
|
|
175
|
+
Transition.promises.add(pr);
|
|
176
|
+
else if (!contexts.has(c)) {
|
|
149
177
|
c.increment();
|
|
150
178
|
contexts.add(c);
|
|
151
179
|
}
|
|
@@ -155,19 +183,23 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
155
183
|
return v;
|
|
156
184
|
}
|
|
157
185
|
function load(refetching = true) {
|
|
158
|
-
if (refetching !== false && scheduled)
|
|
186
|
+
if (refetching !== false && scheduled)
|
|
187
|
+
return;
|
|
159
188
|
scheduled = false;
|
|
160
|
-
const
|
|
161
|
-
|
|
189
|
+
const lookup2 = dynamic ? dynamic() : source;
|
|
190
|
+
loadedUnderTransition = Transition && Transition.running;
|
|
191
|
+
if (lookup2 == null || lookup2 === false) {
|
|
162
192
|
loadEnd(pr, untrack(value));
|
|
163
193
|
return;
|
|
164
194
|
}
|
|
165
|
-
|
|
195
|
+
if (Transition && pr)
|
|
196
|
+
Transition.promises.delete(pr);
|
|
197
|
+
const p = initP !== NO_INIT ? initP : untrack(() => fetcher(lookup2, {
|
|
166
198
|
value: value(),
|
|
167
199
|
refetching
|
|
168
200
|
}));
|
|
169
201
|
if (typeof p !== "object" || !(p && "then" in p)) {
|
|
170
|
-
loadEnd(pr, p,
|
|
202
|
+
loadEnd(pr, p, void 0, lookup2);
|
|
171
203
|
return p;
|
|
172
204
|
}
|
|
173
205
|
pr = p;
|
|
@@ -177,7 +209,7 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
177
209
|
setState(resolved ? "refreshing" : "pending");
|
|
178
210
|
trigger();
|
|
179
211
|
}, false);
|
|
180
|
-
return p.then(v => loadEnd(p, v,
|
|
212
|
+
return p.then((v) => loadEnd(p, v, void 0, lookup2), (e) => loadEnd(p, void 0, castError(e), lookup2));
|
|
181
213
|
}
|
|
182
214
|
Object.defineProperties(read, {
|
|
183
215
|
state: {
|
|
@@ -194,21 +226,27 @@ function createResource(pSource, pFetcher, pOptions) {
|
|
|
194
226
|
},
|
|
195
227
|
latest: {
|
|
196
228
|
get() {
|
|
197
|
-
if (!resolved)
|
|
229
|
+
if (!resolved)
|
|
230
|
+
return read();
|
|
198
231
|
const err = error();
|
|
199
|
-
if (err && !pr)
|
|
232
|
+
if (err && !pr)
|
|
233
|
+
throw err;
|
|
200
234
|
return value();
|
|
201
235
|
}
|
|
202
236
|
}
|
|
203
237
|
});
|
|
204
|
-
if (dynamic)
|
|
238
|
+
if (dynamic)
|
|
239
|
+
createComputed(() => load(false));
|
|
240
|
+
else
|
|
241
|
+
load(false);
|
|
205
242
|
return [read, {
|
|
206
243
|
refetch: load,
|
|
207
244
|
mutate: setValue
|
|
208
245
|
}];
|
|
209
246
|
}
|
|
210
247
|
function untrack(fn) {
|
|
211
|
-
if (Listener === null)
|
|
248
|
+
if (Listener === null)
|
|
249
|
+
return fn();
|
|
212
250
|
const listener = Listener;
|
|
213
251
|
Listener = null;
|
|
214
252
|
try {
|
|
@@ -221,15 +259,17 @@ function on(deps, fn, options) {
|
|
|
221
259
|
const isArray = Array.isArray(deps);
|
|
222
260
|
let prevInput;
|
|
223
261
|
let defer = options && options.defer;
|
|
224
|
-
return prevValue => {
|
|
262
|
+
return (prevValue) => {
|
|
225
263
|
let input;
|
|
226
264
|
if (isArray) {
|
|
227
265
|
input = Array(deps.length);
|
|
228
|
-
for (let i = 0; i < deps.length; i++)
|
|
229
|
-
|
|
266
|
+
for (let i = 0; i < deps.length; i++)
|
|
267
|
+
input[i] = deps[i]();
|
|
268
|
+
} else
|
|
269
|
+
input = deps();
|
|
230
270
|
if (defer) {
|
|
231
271
|
defer = false;
|
|
232
|
-
return
|
|
272
|
+
return void 0;
|
|
233
273
|
}
|
|
234
274
|
const result = untrack(() => fn(input, prevInput, prevValue));
|
|
235
275
|
prevInput = input;
|
|
@@ -240,19 +280,40 @@ function onMount(fn) {
|
|
|
240
280
|
createEffect(() => untrack(fn));
|
|
241
281
|
}
|
|
242
282
|
function onCleanup(fn) {
|
|
243
|
-
if (Owner === null)
|
|
283
|
+
if (Owner === null)
|
|
284
|
+
;
|
|
285
|
+
else if (Owner.cleanups === null)
|
|
286
|
+
Owner.cleanups = [fn];
|
|
287
|
+
else
|
|
288
|
+
Owner.cleanups.push(fn);
|
|
244
289
|
return fn;
|
|
245
290
|
}
|
|
246
291
|
function startTransition(fn) {
|
|
292
|
+
if (Transition && Transition.running) {
|
|
293
|
+
fn();
|
|
294
|
+
return Transition.done;
|
|
295
|
+
}
|
|
247
296
|
const l = Listener;
|
|
248
297
|
const o = Owner;
|
|
249
298
|
return Promise.resolve().then(() => {
|
|
250
299
|
Listener = l;
|
|
251
300
|
Owner = o;
|
|
252
301
|
let t;
|
|
302
|
+
if (Scheduler || SuspenseContext) {
|
|
303
|
+
t = Transition || (Transition = {
|
|
304
|
+
sources: /* @__PURE__ */ new Set(),
|
|
305
|
+
effects: [],
|
|
306
|
+
promises: /* @__PURE__ */ new Set(),
|
|
307
|
+
disposed: /* @__PURE__ */ new Set(),
|
|
308
|
+
queue: /* @__PURE__ */ new Set(),
|
|
309
|
+
running: true
|
|
310
|
+
});
|
|
311
|
+
t.done || (t.done = new Promise((res) => t.resolve = res));
|
|
312
|
+
t.running = true;
|
|
313
|
+
}
|
|
253
314
|
runUpdates(fn, false);
|
|
254
315
|
Listener = Owner = null;
|
|
255
|
-
return t ? t.done :
|
|
316
|
+
return t ? t.done : void 0;
|
|
256
317
|
});
|
|
257
318
|
}
|
|
258
319
|
function useTransition() {
|
|
@@ -268,22 +329,24 @@ function createContext(defaultValue, options) {
|
|
|
268
329
|
}
|
|
269
330
|
function useContext(context) {
|
|
270
331
|
let ctx;
|
|
271
|
-
return (ctx = lookup(Owner, context.id)) !==
|
|
332
|
+
return (ctx = lookup(Owner, context.id)) !== void 0 ? ctx : context.defaultValue;
|
|
272
333
|
}
|
|
273
334
|
function children(fn) {
|
|
274
|
-
const
|
|
275
|
-
const memo = createMemo(() => resolveChildren(
|
|
335
|
+
const children2 = createMemo(fn);
|
|
336
|
+
const memo = createMemo(() => resolveChildren(children2()));
|
|
276
337
|
memo.toArray = () => {
|
|
277
338
|
const c = memo();
|
|
278
339
|
return Array.isArray(c) ? c : c != null ? [c] : [];
|
|
279
340
|
};
|
|
280
341
|
return memo;
|
|
281
342
|
}
|
|
282
|
-
|
|
343
|
+
var SuspenseContext;
|
|
283
344
|
function readSignal() {
|
|
284
|
-
const runningTransition = Transition ;
|
|
285
|
-
if (this.sources && (this.state || runningTransition )) {
|
|
286
|
-
if (this.state === STALE || runningTransition
|
|
345
|
+
const runningTransition = Transition && Transition.running;
|
|
346
|
+
if (this.sources && (!runningTransition && this.state || runningTransition && this.tState)) {
|
|
347
|
+
if (!runningTransition && this.state === STALE || runningTransition && this.tState === STALE)
|
|
348
|
+
updateComputation(this);
|
|
349
|
+
else {
|
|
287
350
|
const updates = Updates;
|
|
288
351
|
Updates = null;
|
|
289
352
|
runUpdates(() => lookUpstream(this), false);
|
|
@@ -307,27 +370,47 @@ function readSignal() {
|
|
|
307
370
|
this.observerSlots.push(Listener.sources.length - 1);
|
|
308
371
|
}
|
|
309
372
|
}
|
|
373
|
+
if (runningTransition && Transition.sources.has(this))
|
|
374
|
+
return this.tValue;
|
|
310
375
|
return this.value;
|
|
311
376
|
}
|
|
312
377
|
function writeSignal(node, value, isComp) {
|
|
313
|
-
let current = node.value;
|
|
378
|
+
let current = Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value;
|
|
314
379
|
if (!node.comparator || !node.comparator(current, value)) {
|
|
315
|
-
|
|
380
|
+
if (Transition) {
|
|
381
|
+
const TransitionRunning = Transition.running;
|
|
382
|
+
if (TransitionRunning || !isComp && Transition.sources.has(node)) {
|
|
383
|
+
Transition.sources.add(node);
|
|
384
|
+
node.tValue = value;
|
|
385
|
+
}
|
|
386
|
+
if (!TransitionRunning)
|
|
387
|
+
node.value = value;
|
|
388
|
+
} else
|
|
389
|
+
node.value = value;
|
|
316
390
|
if (node.observers && node.observers.length) {
|
|
317
391
|
runUpdates(() => {
|
|
318
392
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
319
393
|
const o = node.observers[i];
|
|
320
394
|
const TransitionRunning = Transition && Transition.running;
|
|
321
|
-
if (TransitionRunning && Transition.disposed.has(o))
|
|
395
|
+
if (TransitionRunning && Transition.disposed.has(o))
|
|
396
|
+
continue;
|
|
322
397
|
if (TransitionRunning && !o.tState || !TransitionRunning && !o.state) {
|
|
323
|
-
if (o.pure)
|
|
324
|
-
|
|
398
|
+
if (o.pure)
|
|
399
|
+
Updates.push(o);
|
|
400
|
+
else
|
|
401
|
+
Effects.push(o);
|
|
402
|
+
if (o.observers)
|
|
403
|
+
markDownstream(o);
|
|
325
404
|
}
|
|
326
|
-
if (TransitionRunning)
|
|
405
|
+
if (TransitionRunning)
|
|
406
|
+
o.tState = STALE;
|
|
407
|
+
else
|
|
408
|
+
o.state = STALE;
|
|
327
409
|
}
|
|
328
|
-
if (Updates.length >
|
|
410
|
+
if (Updates.length > 1e6) {
|
|
329
411
|
Updates = [];
|
|
330
|
-
if (false)
|
|
412
|
+
if (false)
|
|
413
|
+
;
|
|
331
414
|
throw new Error();
|
|
332
415
|
}
|
|
333
416
|
}, false);
|
|
@@ -336,13 +419,22 @@ function writeSignal(node, value, isComp) {
|
|
|
336
419
|
return value;
|
|
337
420
|
}
|
|
338
421
|
function updateComputation(node) {
|
|
339
|
-
if (!node.fn)
|
|
422
|
+
if (!node.fn)
|
|
423
|
+
return;
|
|
340
424
|
cleanNode(node);
|
|
341
|
-
const owner = Owner,
|
|
342
|
-
listener = Listener,
|
|
343
|
-
time = ExecCount;
|
|
425
|
+
const owner = Owner, listener = Listener, time = ExecCount;
|
|
344
426
|
Listener = Owner = node;
|
|
345
|
-
runComputation(node, node.value, time);
|
|
427
|
+
runComputation(node, Transition && Transition.running && Transition.sources.has(node) ? node.tValue : node.value, time);
|
|
428
|
+
if (Transition && !Transition.running && Transition.sources.has(node)) {
|
|
429
|
+
queueMicrotask(() => {
|
|
430
|
+
runUpdates(() => {
|
|
431
|
+
Transition && (Transition.running = true);
|
|
432
|
+
Listener = Owner = node;
|
|
433
|
+
runComputation(node, node.tValue, time);
|
|
434
|
+
Listener = Owner = null;
|
|
435
|
+
}, false);
|
|
436
|
+
});
|
|
437
|
+
}
|
|
346
438
|
Listener = listener;
|
|
347
439
|
Owner = owner;
|
|
348
440
|
}
|
|
@@ -352,7 +444,11 @@ function runComputation(node, value, time) {
|
|
|
352
444
|
nextValue = node.fn(value);
|
|
353
445
|
} catch (err) {
|
|
354
446
|
if (node.pure) {
|
|
355
|
-
{
|
|
447
|
+
if (Transition && Transition.running) {
|
|
448
|
+
node.tState = STALE;
|
|
449
|
+
node.tOwned && node.tOwned.forEach(cleanNode);
|
|
450
|
+
node.tOwned = void 0;
|
|
451
|
+
} else {
|
|
356
452
|
node.state = STALE;
|
|
357
453
|
node.owned && node.owned.forEach(cleanNode);
|
|
358
454
|
node.owned = null;
|
|
@@ -363,15 +459,19 @@ function runComputation(node, value, time) {
|
|
|
363
459
|
}
|
|
364
460
|
if (!node.updatedAt || node.updatedAt <= time) {
|
|
365
461
|
if (node.updatedAt != null && "observers" in node) {
|
|
366
|
-
writeSignal(node, nextValue);
|
|
367
|
-
} else node.
|
|
462
|
+
writeSignal(node, nextValue, true);
|
|
463
|
+
} else if (Transition && Transition.running && node.pure) {
|
|
464
|
+
Transition.sources.add(node);
|
|
465
|
+
node.tValue = nextValue;
|
|
466
|
+
} else
|
|
467
|
+
node.value = nextValue;
|
|
368
468
|
node.updatedAt = time;
|
|
369
469
|
}
|
|
370
470
|
}
|
|
371
471
|
function createComputation(fn, init, pure, state = STALE, options) {
|
|
372
472
|
const c = {
|
|
373
473
|
fn,
|
|
374
|
-
state
|
|
474
|
+
state,
|
|
375
475
|
updatedAt: null,
|
|
376
476
|
owned: null,
|
|
377
477
|
sources: null,
|
|
@@ -382,27 +482,67 @@ function createComputation(fn, init, pure, state = STALE, options) {
|
|
|
382
482
|
context: null,
|
|
383
483
|
pure
|
|
384
484
|
};
|
|
385
|
-
if (
|
|
386
|
-
|
|
387
|
-
|
|
485
|
+
if (Transition && Transition.running) {
|
|
486
|
+
c.state = 0;
|
|
487
|
+
c.tState = state;
|
|
488
|
+
}
|
|
489
|
+
if (Owner === null)
|
|
490
|
+
;
|
|
491
|
+
else if (Owner !== UNOWNED) {
|
|
492
|
+
if (Transition && Transition.running && Owner.pure) {
|
|
493
|
+
if (!Owner.tOwned)
|
|
494
|
+
Owner.tOwned = [c];
|
|
495
|
+
else
|
|
496
|
+
Owner.tOwned.push(c);
|
|
497
|
+
} else {
|
|
498
|
+
if (!Owner.owned)
|
|
499
|
+
Owner.owned = [c];
|
|
500
|
+
else
|
|
501
|
+
Owner.owned.push(c);
|
|
388
502
|
}
|
|
389
503
|
}
|
|
504
|
+
if (ExternalSourceFactory) {
|
|
505
|
+
const [track, trigger] = createSignal(void 0, {
|
|
506
|
+
equals: false
|
|
507
|
+
});
|
|
508
|
+
const ordinary = ExternalSourceFactory(c.fn, trigger);
|
|
509
|
+
onCleanup(() => ordinary.dispose());
|
|
510
|
+
const triggerInTransition = () => startTransition(trigger).then(() => inTransition.dispose());
|
|
511
|
+
const inTransition = ExternalSourceFactory(c.fn, triggerInTransition);
|
|
512
|
+
c.fn = (x) => {
|
|
513
|
+
track();
|
|
514
|
+
return Transition && Transition.running ? inTransition.track(x) : ordinary.track(x);
|
|
515
|
+
};
|
|
516
|
+
}
|
|
390
517
|
return c;
|
|
391
518
|
}
|
|
392
519
|
function runTop(node) {
|
|
393
|
-
const runningTransition = Transition ;
|
|
394
|
-
if (node.state === 0 || runningTransition )
|
|
395
|
-
|
|
396
|
-
if (node.
|
|
520
|
+
const runningTransition = Transition && Transition.running;
|
|
521
|
+
if (!runningTransition && node.state === 0 || runningTransition && node.tState === 0)
|
|
522
|
+
return;
|
|
523
|
+
if (!runningTransition && node.state === PENDING || runningTransition && node.tState === PENDING)
|
|
524
|
+
return lookUpstream(node);
|
|
525
|
+
if (node.suspense && untrack(node.suspense.inFallback))
|
|
526
|
+
return node.suspense.effects.push(node);
|
|
397
527
|
const ancestors = [node];
|
|
398
528
|
while ((node = node.owner) && (!node.updatedAt || node.updatedAt < ExecCount)) {
|
|
399
|
-
if (
|
|
529
|
+
if (runningTransition && Transition.disposed.has(node))
|
|
530
|
+
return;
|
|
531
|
+
if (!runningTransition && node.state || runningTransition && node.tState)
|
|
532
|
+
ancestors.push(node);
|
|
400
533
|
}
|
|
401
534
|
for (let i = ancestors.length - 1; i >= 0; i--) {
|
|
402
535
|
node = ancestors[i];
|
|
403
|
-
if (
|
|
536
|
+
if (runningTransition) {
|
|
537
|
+
let top = node, prev = ancestors[i + 1];
|
|
538
|
+
while ((top = top.owner) && top !== prev) {
|
|
539
|
+
if (Transition.disposed.has(top))
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
if (!runningTransition && node.state === STALE || runningTransition && node.tState === STALE) {
|
|
404
544
|
updateComputation(node);
|
|
405
|
-
} else if (node.state === PENDING || runningTransition ) {
|
|
545
|
+
} else if (!runningTransition && node.state === PENDING || runningTransition && node.tState === PENDING) {
|
|
406
546
|
const updates = Updates;
|
|
407
547
|
Updates = null;
|
|
408
548
|
runUpdates(() => lookUpstream(node, ancestors[0]), false);
|
|
@@ -411,63 +551,146 @@ function runTop(node) {
|
|
|
411
551
|
}
|
|
412
552
|
}
|
|
413
553
|
function runUpdates(fn, init) {
|
|
414
|
-
if (Updates)
|
|
554
|
+
if (Updates)
|
|
555
|
+
return fn();
|
|
415
556
|
let wait = false;
|
|
416
|
-
if (!init)
|
|
417
|
-
|
|
557
|
+
if (!init)
|
|
558
|
+
Updates = [];
|
|
559
|
+
if (Effects)
|
|
560
|
+
wait = true;
|
|
561
|
+
else
|
|
562
|
+
Effects = [];
|
|
418
563
|
ExecCount++;
|
|
419
564
|
try {
|
|
420
565
|
const res = fn();
|
|
421
566
|
completeUpdates(wait);
|
|
422
567
|
return res;
|
|
423
568
|
} catch (err) {
|
|
424
|
-
if (!wait)
|
|
569
|
+
if (!wait)
|
|
570
|
+
Effects = null;
|
|
425
571
|
Updates = null;
|
|
426
572
|
handleError(err);
|
|
427
573
|
}
|
|
428
574
|
}
|
|
429
575
|
function completeUpdates(wait) {
|
|
430
576
|
if (Updates) {
|
|
431
|
-
|
|
577
|
+
if (Scheduler && Transition && Transition.running)
|
|
578
|
+
scheduleQueue(Updates);
|
|
579
|
+
else
|
|
580
|
+
runQueue(Updates);
|
|
432
581
|
Updates = null;
|
|
433
582
|
}
|
|
434
|
-
if (wait)
|
|
583
|
+
if (wait)
|
|
584
|
+
return;
|
|
585
|
+
let res;
|
|
586
|
+
if (Transition) {
|
|
587
|
+
if (!Transition.promises.size && !Transition.queue.size) {
|
|
588
|
+
const sources = Transition.sources;
|
|
589
|
+
const disposed = Transition.disposed;
|
|
590
|
+
Effects.push.apply(Effects, Transition.effects);
|
|
591
|
+
res = Transition.resolve;
|
|
592
|
+
for (const e2 of Effects) {
|
|
593
|
+
"tState" in e2 && (e2.state = e2.tState);
|
|
594
|
+
delete e2.tState;
|
|
595
|
+
}
|
|
596
|
+
Transition = null;
|
|
597
|
+
runUpdates(() => {
|
|
598
|
+
for (const d of disposed)
|
|
599
|
+
cleanNode(d);
|
|
600
|
+
for (const v of sources) {
|
|
601
|
+
v.value = v.tValue;
|
|
602
|
+
if (v.owned) {
|
|
603
|
+
for (let i = 0, len = v.owned.length; i < len; i++)
|
|
604
|
+
cleanNode(v.owned[i]);
|
|
605
|
+
}
|
|
606
|
+
if (v.tOwned)
|
|
607
|
+
v.owned = v.tOwned;
|
|
608
|
+
delete v.tValue;
|
|
609
|
+
delete v.tOwned;
|
|
610
|
+
v.tState = 0;
|
|
611
|
+
}
|
|
612
|
+
setTransPending(false);
|
|
613
|
+
}, false);
|
|
614
|
+
} else if (Transition.running) {
|
|
615
|
+
Transition.running = false;
|
|
616
|
+
Transition.effects.push.apply(Transition.effects, Effects);
|
|
617
|
+
Effects = null;
|
|
618
|
+
setTransPending(true);
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
435
622
|
const e = Effects;
|
|
436
623
|
Effects = null;
|
|
437
|
-
if (e.length)
|
|
624
|
+
if (e.length)
|
|
625
|
+
runUpdates(() => runEffects(e), false);
|
|
626
|
+
if (res)
|
|
627
|
+
res();
|
|
438
628
|
}
|
|
439
629
|
function runQueue(queue) {
|
|
440
|
-
for (let i = 0; i < queue.length; i++)
|
|
630
|
+
for (let i = 0; i < queue.length; i++)
|
|
631
|
+
runTop(queue[i]);
|
|
632
|
+
}
|
|
633
|
+
function scheduleQueue(queue) {
|
|
634
|
+
for (let i = 0; i < queue.length; i++) {
|
|
635
|
+
const item = queue[i];
|
|
636
|
+
const tasks = Transition.queue;
|
|
637
|
+
if (!tasks.has(item)) {
|
|
638
|
+
tasks.add(item);
|
|
639
|
+
Scheduler(() => {
|
|
640
|
+
tasks.delete(item);
|
|
641
|
+
runUpdates(() => {
|
|
642
|
+
Transition.running = true;
|
|
643
|
+
runTop(item);
|
|
644
|
+
}, false);
|
|
645
|
+
Transition && (Transition.running = false);
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
}
|
|
441
649
|
}
|
|
442
650
|
function runUserEffects(queue) {
|
|
443
|
-
let i,
|
|
444
|
-
userLength = 0;
|
|
651
|
+
let i, userLength = 0;
|
|
445
652
|
for (i = 0; i < queue.length; i++) {
|
|
446
653
|
const e = queue[i];
|
|
447
|
-
if (!e.user)
|
|
654
|
+
if (!e.user)
|
|
655
|
+
runTop(e);
|
|
656
|
+
else
|
|
657
|
+
queue[userLength++] = e;
|
|
448
658
|
}
|
|
449
|
-
if (sharedConfig.context)
|
|
450
|
-
|
|
659
|
+
if (sharedConfig.context)
|
|
660
|
+
setHydrateContext();
|
|
661
|
+
for (i = 0; i < userLength; i++)
|
|
662
|
+
runTop(queue[i]);
|
|
451
663
|
}
|
|
452
664
|
function lookUpstream(node, ignore) {
|
|
453
|
-
const runningTransition = Transition ;
|
|
454
|
-
|
|
665
|
+
const runningTransition = Transition && Transition.running;
|
|
666
|
+
if (runningTransition)
|
|
667
|
+
node.tState = 0;
|
|
668
|
+
else
|
|
669
|
+
node.state = 0;
|
|
455
670
|
for (let i = 0; i < node.sources.length; i += 1) {
|
|
456
671
|
const source = node.sources[i];
|
|
457
672
|
if (source.sources) {
|
|
458
|
-
if (source.state === STALE || runningTransition ) {
|
|
459
|
-
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
|
|
460
|
-
|
|
673
|
+
if (!runningTransition && source.state === STALE || runningTransition && source.tState === STALE) {
|
|
674
|
+
if (source !== ignore && (!source.updatedAt || source.updatedAt < ExecCount))
|
|
675
|
+
runTop(source);
|
|
676
|
+
} else if (!runningTransition && source.state === PENDING || runningTransition && source.tState === PENDING)
|
|
677
|
+
lookUpstream(source, ignore);
|
|
461
678
|
}
|
|
462
679
|
}
|
|
463
680
|
}
|
|
464
681
|
function markDownstream(node) {
|
|
465
|
-
const runningTransition = Transition ;
|
|
682
|
+
const runningTransition = Transition && Transition.running;
|
|
466
683
|
for (let i = 0; i < node.observers.length; i += 1) {
|
|
467
684
|
const o = node.observers[i];
|
|
468
|
-
if (!o.state || runningTransition ) {
|
|
469
|
-
|
|
470
|
-
|
|
685
|
+
if (!runningTransition && !o.state || runningTransition && !o.tState) {
|
|
686
|
+
if (runningTransition)
|
|
687
|
+
o.tState = PENDING;
|
|
688
|
+
else
|
|
689
|
+
o.state = PENDING;
|
|
690
|
+
if (o.pure)
|
|
691
|
+
Updates.push(o);
|
|
692
|
+
else
|
|
693
|
+
Effects.push(o);
|
|
471
694
|
o.observers && markDownstream(o);
|
|
472
695
|
}
|
|
473
696
|
}
|
|
@@ -476,12 +699,9 @@ function cleanNode(node) {
|
|
|
476
699
|
let i;
|
|
477
700
|
if (node.sources) {
|
|
478
701
|
while (node.sources.length) {
|
|
479
|
-
const source = node.sources.pop(),
|
|
480
|
-
index = node.sourceSlots.pop(),
|
|
481
|
-
obs = source.observers;
|
|
702
|
+
const source = node.sources.pop(), index = node.sourceSlots.pop(), obs = source.observers;
|
|
482
703
|
if (obs && obs.length) {
|
|
483
|
-
const n = obs.pop(),
|
|
484
|
-
s = source.observerSlots.pop();
|
|
704
|
+
const n = obs.pop(), s = source.observerSlots.pop();
|
|
485
705
|
if (index < obs.length) {
|
|
486
706
|
n.sourceSlots[s] = index;
|
|
487
707
|
obs[index] = n;
|
|
@@ -490,39 +710,78 @@ function cleanNode(node) {
|
|
|
490
710
|
}
|
|
491
711
|
}
|
|
492
712
|
}
|
|
493
|
-
if (node.
|
|
494
|
-
|
|
713
|
+
if (Transition && Transition.running && node.pure) {
|
|
714
|
+
if (node.tOwned) {
|
|
715
|
+
for (i = 0; i < node.tOwned.length; i++)
|
|
716
|
+
cleanNode(node.tOwned[i]);
|
|
717
|
+
delete node.tOwned;
|
|
718
|
+
}
|
|
719
|
+
reset(node, true);
|
|
720
|
+
} else if (node.owned) {
|
|
721
|
+
for (i = 0; i < node.owned.length; i++)
|
|
722
|
+
cleanNode(node.owned[i]);
|
|
495
723
|
node.owned = null;
|
|
496
724
|
}
|
|
497
725
|
if (node.cleanups) {
|
|
498
|
-
for (i = 0; i < node.cleanups.length; i++)
|
|
726
|
+
for (i = 0; i < node.cleanups.length; i++)
|
|
727
|
+
node.cleanups[i]();
|
|
499
728
|
node.cleanups = null;
|
|
500
729
|
}
|
|
501
|
-
|
|
730
|
+
if (Transition && Transition.running)
|
|
731
|
+
node.tState = 0;
|
|
732
|
+
else
|
|
733
|
+
node.state = 0;
|
|
502
734
|
node.context = null;
|
|
503
735
|
}
|
|
736
|
+
function reset(node, top) {
|
|
737
|
+
if (!top) {
|
|
738
|
+
node.tState = 0;
|
|
739
|
+
Transition.disposed.add(node);
|
|
740
|
+
}
|
|
741
|
+
if (node.owned) {
|
|
742
|
+
for (let i = 0; i < node.owned.length; i++)
|
|
743
|
+
reset(node.owned[i]);
|
|
744
|
+
}
|
|
745
|
+
}
|
|
504
746
|
function castError(err) {
|
|
505
|
-
if (err instanceof Error || typeof err === "string")
|
|
747
|
+
if (err instanceof Error || typeof err === "string")
|
|
748
|
+
return err;
|
|
506
749
|
return new Error("Unknown error");
|
|
507
750
|
}
|
|
751
|
+
function runErrors(fns, err) {
|
|
752
|
+
for (const f of fns)
|
|
753
|
+
f(err);
|
|
754
|
+
}
|
|
508
755
|
function handleError(err) {
|
|
509
756
|
err = castError(err);
|
|
510
|
-
|
|
757
|
+
const fns = ERROR && lookup(Owner, ERROR);
|
|
758
|
+
if (!fns)
|
|
759
|
+
throw err;
|
|
760
|
+
if (Effects)
|
|
761
|
+
Effects.push({
|
|
762
|
+
fn() {
|
|
763
|
+
runErrors(fns, err);
|
|
764
|
+
},
|
|
765
|
+
state: STALE
|
|
766
|
+
});
|
|
767
|
+
else
|
|
768
|
+
runErrors(fns, err);
|
|
511
769
|
}
|
|
512
770
|
function lookup(owner, key) {
|
|
513
|
-
return owner ? owner.context && owner.context[key] !==
|
|
771
|
+
return owner ? owner.context && owner.context[key] !== void 0 ? owner.context[key] : lookup(owner.owner, key) : void 0;
|
|
514
772
|
}
|
|
515
|
-
function resolveChildren(
|
|
516
|
-
if (typeof
|
|
517
|
-
|
|
773
|
+
function resolveChildren(children2) {
|
|
774
|
+
if (typeof children2 === "function" && !children2.length)
|
|
775
|
+
return resolveChildren(children2());
|
|
776
|
+
if (Array.isArray(children2)) {
|
|
518
777
|
const results = [];
|
|
519
|
-
for (let i = 0; i <
|
|
520
|
-
const result = resolveChildren(
|
|
778
|
+
for (let i = 0; i < children2.length; i++) {
|
|
779
|
+
const result = resolveChildren(children2[i]);
|
|
521
780
|
Array.isArray(result) ? results.push.apply(results, result) : results.push(result);
|
|
522
781
|
}
|
|
523
782
|
return results;
|
|
524
783
|
}
|
|
525
|
-
return
|
|
784
|
+
return children2;
|
|
526
785
|
}
|
|
527
786
|
function createProvider(id, options) {
|
|
528
787
|
return function provider(props) {
|
|
@@ -532,37 +791,23 @@ function createProvider(id, options) {
|
|
|
532
791
|
[id]: props.value
|
|
533
792
|
};
|
|
534
793
|
return children(() => props.children);
|
|
535
|
-
}),
|
|
794
|
+
}), void 0);
|
|
536
795
|
return res;
|
|
537
796
|
};
|
|
538
797
|
}
|
|
539
|
-
|
|
798
|
+
var FALLBACK = Symbol("fallback");
|
|
540
799
|
function dispose(d) {
|
|
541
|
-
for (let i = 0; i < d.length; i++)
|
|
800
|
+
for (let i = 0; i < d.length; i++)
|
|
801
|
+
d[i]();
|
|
542
802
|
}
|
|
543
803
|
function mapArray(list, mapFn, options = {}) {
|
|
544
|
-
let items = [],
|
|
545
|
-
mapped = [],
|
|
546
|
-
disposers = [],
|
|
547
|
-
len = 0,
|
|
548
|
-
indexes = mapFn.length > 1 ? [] : null;
|
|
804
|
+
let items = [], mapped = [], disposers = [], len = 0, indexes = mapFn.length > 1 ? [] : null;
|
|
549
805
|
onCleanup(() => dispose(disposers));
|
|
550
806
|
return () => {
|
|
551
|
-
let newItems = list() || [],
|
|
552
|
-
i,
|
|
553
|
-
j;
|
|
807
|
+
let newItems = list() || [], i, j;
|
|
554
808
|
newItems[$TRACK];
|
|
555
809
|
return untrack(() => {
|
|
556
|
-
let newLen = newItems.length,
|
|
557
|
-
newIndices,
|
|
558
|
-
newIndicesNext,
|
|
559
|
-
temp,
|
|
560
|
-
tempdisposers,
|
|
561
|
-
tempIndexes,
|
|
562
|
-
start,
|
|
563
|
-
end,
|
|
564
|
-
newEnd,
|
|
565
|
-
item;
|
|
810
|
+
let newLen = newItems.length, newIndices, newIndicesNext, temp, tempdisposers, tempIndexes, start, end, newEnd, item;
|
|
566
811
|
if (newLen === 0) {
|
|
567
812
|
if (len !== 0) {
|
|
568
813
|
dispose(disposers);
|
|
@@ -574,7 +819,7 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
574
819
|
}
|
|
575
820
|
if (options.fallback) {
|
|
576
821
|
items = [FALLBACK];
|
|
577
|
-
mapped[0] = createRoot(disposer => {
|
|
822
|
+
mapped[0] = createRoot((disposer) => {
|
|
578
823
|
disposers[0] = disposer;
|
|
579
824
|
return options.fallback();
|
|
580
825
|
});
|
|
@@ -591,30 +836,32 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
591
836
|
temp = new Array(newLen);
|
|
592
837
|
tempdisposers = new Array(newLen);
|
|
593
838
|
indexes && (tempIndexes = new Array(newLen));
|
|
594
|
-
for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)
|
|
839
|
+
for (start = 0, end = Math.min(len, newLen); start < end && items[start] === newItems[start]; start++)
|
|
840
|
+
;
|
|
595
841
|
for (end = len - 1, newEnd = newLen - 1; end >= start && newEnd >= start && items[end] === newItems[newEnd]; end--, newEnd--) {
|
|
596
842
|
temp[newEnd] = mapped[end];
|
|
597
843
|
tempdisposers[newEnd] = disposers[end];
|
|
598
844
|
indexes && (tempIndexes[newEnd] = indexes[end]);
|
|
599
845
|
}
|
|
600
|
-
newIndices = new Map();
|
|
846
|
+
newIndices = /* @__PURE__ */ new Map();
|
|
601
847
|
newIndicesNext = new Array(newEnd + 1);
|
|
602
848
|
for (j = newEnd; j >= start; j--) {
|
|
603
849
|
item = newItems[j];
|
|
604
850
|
i = newIndices.get(item);
|
|
605
|
-
newIndicesNext[j] = i ===
|
|
851
|
+
newIndicesNext[j] = i === void 0 ? -1 : i;
|
|
606
852
|
newIndices.set(item, j);
|
|
607
853
|
}
|
|
608
854
|
for (i = start; i <= end; i++) {
|
|
609
855
|
item = items[i];
|
|
610
856
|
j = newIndices.get(item);
|
|
611
|
-
if (j !==
|
|
857
|
+
if (j !== void 0 && j !== -1) {
|
|
612
858
|
temp[j] = mapped[i];
|
|
613
859
|
tempdisposers[j] = disposers[i];
|
|
614
860
|
indexes && (tempIndexes[j] = indexes[i]);
|
|
615
861
|
j = newIndicesNext[j];
|
|
616
862
|
newIndices.set(item, j);
|
|
617
|
-
} else
|
|
863
|
+
} else
|
|
864
|
+
disposers[i]();
|
|
618
865
|
}
|
|
619
866
|
for (j = start; j < newLen; j++) {
|
|
620
867
|
if (j in temp) {
|
|
@@ -624,7 +871,8 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
624
871
|
indexes[j] = tempIndexes[j];
|
|
625
872
|
indexes[j](j);
|
|
626
873
|
}
|
|
627
|
-
} else
|
|
874
|
+
} else
|
|
875
|
+
mapped[j] = createRoot(mapper);
|
|
628
876
|
}
|
|
629
877
|
mapped = mapped.slice(0, len = newLen);
|
|
630
878
|
items = newItems.slice(0);
|
|
@@ -643,12 +891,7 @@ function mapArray(list, mapFn, options = {}) {
|
|
|
643
891
|
};
|
|
644
892
|
}
|
|
645
893
|
function indexArray(list, mapFn, options = {}) {
|
|
646
|
-
let items = [],
|
|
647
|
-
mapped = [],
|
|
648
|
-
disposers = [],
|
|
649
|
-
signals = [],
|
|
650
|
-
len = 0,
|
|
651
|
-
i;
|
|
894
|
+
let items = [], mapped = [], disposers = [], signals = [], len = 0, i;
|
|
652
895
|
onCleanup(() => dispose(disposers));
|
|
653
896
|
return () => {
|
|
654
897
|
const newItems = list() || [];
|
|
@@ -665,7 +908,7 @@ function indexArray(list, mapFn, options = {}) {
|
|
|
665
908
|
}
|
|
666
909
|
if (options.fallback) {
|
|
667
910
|
items = [FALLBACK];
|
|
668
|
-
mapped[0] = createRoot(disposer => {
|
|
911
|
+
mapped[0] = createRoot((disposer) => {
|
|
669
912
|
disposers[0] = disposer;
|
|
670
913
|
return options.fallback();
|
|
671
914
|
});
|
|
@@ -702,19 +945,31 @@ function indexArray(list, mapFn, options = {}) {
|
|
|
702
945
|
}
|
|
703
946
|
};
|
|
704
947
|
}
|
|
948
|
+
var hydrationEnabled = false;
|
|
705
949
|
function createComponent(Comp, props) {
|
|
950
|
+
if (hydrationEnabled) {
|
|
951
|
+
if (sharedConfig.context) {
|
|
952
|
+
const c = sharedConfig.context;
|
|
953
|
+
setHydrateContext(nextHydrateContext());
|
|
954
|
+
const r = untrack(() => Comp(props || {}));
|
|
955
|
+
setHydrateContext(c);
|
|
956
|
+
return r;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
706
959
|
return untrack(() => Comp(props || {}));
|
|
707
960
|
}
|
|
708
961
|
function trueFn() {
|
|
709
962
|
return true;
|
|
710
963
|
}
|
|
711
|
-
|
|
964
|
+
var propTraps = {
|
|
712
965
|
get(_, property, receiver) {
|
|
713
|
-
if (property === $PROXY)
|
|
966
|
+
if (property === $PROXY)
|
|
967
|
+
return receiver;
|
|
714
968
|
return _.get(property);
|
|
715
969
|
},
|
|
716
970
|
has(_, property) {
|
|
717
|
-
if (property === $PROXY)
|
|
971
|
+
if (property === $PROXY)
|
|
972
|
+
return true;
|
|
718
973
|
return _.has(property);
|
|
719
974
|
},
|
|
720
975
|
set: trueFn,
|
|
@@ -749,18 +1004,21 @@ function mergeProps(...sources) {
|
|
|
749
1004
|
get(property) {
|
|
750
1005
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
751
1006
|
const v = resolveSource(sources[i])[property];
|
|
752
|
-
if (v !==
|
|
1007
|
+
if (v !== void 0)
|
|
1008
|
+
return v;
|
|
753
1009
|
}
|
|
754
1010
|
},
|
|
755
1011
|
has(property) {
|
|
756
1012
|
for (let i = sources.length - 1; i >= 0; i--) {
|
|
757
|
-
if (property in resolveSource(sources[i]))
|
|
1013
|
+
if (property in resolveSource(sources[i]))
|
|
1014
|
+
return true;
|
|
758
1015
|
}
|
|
759
1016
|
return false;
|
|
760
1017
|
},
|
|
761
1018
|
keys() {
|
|
762
1019
|
const keys = [];
|
|
763
|
-
for (let i = 0; i < sources.length; i++)
|
|
1020
|
+
for (let i = 0; i < sources.length; i++)
|
|
1021
|
+
keys.push(...Object.keys(resolveSource(sources[i])));
|
|
764
1022
|
return [...new Set(keys)];
|
|
765
1023
|
}
|
|
766
1024
|
}, propTraps);
|
|
@@ -770,13 +1028,15 @@ function mergeProps(...sources) {
|
|
|
770
1028
|
if (sources[i]) {
|
|
771
1029
|
const descriptors = Object.getOwnPropertyDescriptors(sources[i]);
|
|
772
1030
|
for (const key in descriptors) {
|
|
773
|
-
if (key in target)
|
|
1031
|
+
if (key in target)
|
|
1032
|
+
continue;
|
|
774
1033
|
Object.defineProperty(target, key, {
|
|
775
1034
|
enumerable: true,
|
|
776
1035
|
get() {
|
|
777
|
-
for (let
|
|
778
|
-
const v = (sources[
|
|
779
|
-
if (v !==
|
|
1036
|
+
for (let i2 = sources.length - 1; i2 >= 0; i2--) {
|
|
1037
|
+
const v = (sources[i2] || {})[key];
|
|
1038
|
+
if (v !== void 0)
|
|
1039
|
+
return v;
|
|
780
1040
|
}
|
|
781
1041
|
}
|
|
782
1042
|
});
|
|
@@ -788,24 +1048,26 @@ function mergeProps(...sources) {
|
|
|
788
1048
|
function lazy(fn) {
|
|
789
1049
|
let comp;
|
|
790
1050
|
let p;
|
|
791
|
-
const wrap = props => {
|
|
1051
|
+
const wrap = (props) => {
|
|
792
1052
|
const ctx = sharedConfig.context;
|
|
793
1053
|
if (ctx) {
|
|
794
1054
|
const [s, set] = createSignal();
|
|
795
|
-
(p || (p = fn())).then(mod => {
|
|
1055
|
+
(p || (p = fn())).then((mod) => {
|
|
796
1056
|
setHydrateContext(ctx);
|
|
797
1057
|
set(() => mod.default);
|
|
798
1058
|
setHydrateContext();
|
|
799
1059
|
});
|
|
800
1060
|
comp = s;
|
|
801
1061
|
} else if (!comp) {
|
|
802
|
-
const [s] = createResource(() => (p || (p = fn())).then(mod => mod.default));
|
|
1062
|
+
const [s] = createResource(() => (p || (p = fn())).then((mod) => mod.default));
|
|
803
1063
|
comp = s;
|
|
804
1064
|
}
|
|
805
1065
|
let Comp;
|
|
806
1066
|
return createMemo(() => (Comp = comp()) && untrack(() => {
|
|
807
|
-
if (false)
|
|
808
|
-
|
|
1067
|
+
if (false)
|
|
1068
|
+
;
|
|
1069
|
+
if (!ctx)
|
|
1070
|
+
return Comp(props);
|
|
809
1071
|
const c = sharedConfig.context;
|
|
810
1072
|
setHydrateContext(ctx);
|
|
811
1073
|
const r = Comp(props);
|
|
@@ -813,25 +1075,25 @@ function lazy(fn) {
|
|
|
813
1075
|
return r;
|
|
814
1076
|
}));
|
|
815
1077
|
};
|
|
816
|
-
wrap.preload = () => p || ((p = fn()).then(mod => comp = () => mod.default), p);
|
|
1078
|
+
wrap.preload = () => p || ((p = fn()).then((mod) => comp = () => mod.default), p);
|
|
817
1079
|
return wrap;
|
|
818
1080
|
}
|
|
819
1081
|
function For(props) {
|
|
820
1082
|
const fallback = "fallback" in props && {
|
|
821
1083
|
fallback: () => props.fallback
|
|
822
1084
|
};
|
|
823
|
-
return createMemo(mapArray(() => props.each, props.children, fallback ||
|
|
1085
|
+
return createMemo(mapArray(() => props.each, props.children, fallback || void 0));
|
|
824
1086
|
}
|
|
825
1087
|
function Index(props) {
|
|
826
1088
|
const fallback = "fallback" in props && {
|
|
827
1089
|
fallback: () => props.fallback
|
|
828
1090
|
};
|
|
829
|
-
return createMemo(indexArray(() => props.each, props.children, fallback ||
|
|
1091
|
+
return createMemo(indexArray(() => props.each, props.children, fallback || void 0));
|
|
830
1092
|
}
|
|
831
1093
|
function Show(props) {
|
|
832
1094
|
let strictEqual = false;
|
|
833
1095
|
const keyed = props.keyed;
|
|
834
|
-
const condition = createMemo(() => props.when,
|
|
1096
|
+
const condition = createMemo(() => props.when, void 0, {
|
|
835
1097
|
equals: (a, b) => strictEqual ? a === b : !a === !b
|
|
836
1098
|
});
|
|
837
1099
|
return createMemo(() => {
|
|
@@ -843,48 +1105,50 @@ function Show(props) {
|
|
|
843
1105
|
return fn ? untrack(() => child(c)) : child;
|
|
844
1106
|
}
|
|
845
1107
|
return props.fallback;
|
|
846
|
-
},
|
|
1108
|
+
}, void 0, void 0);
|
|
847
1109
|
}
|
|
848
1110
|
function Switch(props) {
|
|
849
1111
|
let strictEqual = false;
|
|
850
1112
|
let keyed = false;
|
|
851
1113
|
const equals = (a, b) => a[0] === b[0] && (strictEqual ? a[1] === b[1] : !a[1] === !b[1]) && a[2] === b[2];
|
|
852
|
-
const conditions = children(() => props.children),
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
1114
|
+
const conditions = children(() => props.children), evalConditions = createMemo(() => {
|
|
1115
|
+
let conds = conditions();
|
|
1116
|
+
if (!Array.isArray(conds))
|
|
1117
|
+
conds = [conds];
|
|
1118
|
+
for (let i = 0; i < conds.length; i++) {
|
|
1119
|
+
const c = conds[i].when;
|
|
1120
|
+
if (c) {
|
|
1121
|
+
keyed = !!conds[i].keyed;
|
|
1122
|
+
return [i, c, conds[i]];
|
|
862
1123
|
}
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
1124
|
+
}
|
|
1125
|
+
return [-1];
|
|
1126
|
+
}, void 0, {
|
|
1127
|
+
equals
|
|
1128
|
+
});
|
|
867
1129
|
return createMemo(() => {
|
|
868
1130
|
const [index, when, cond] = evalConditions();
|
|
869
|
-
if (index < 0)
|
|
1131
|
+
if (index < 0)
|
|
1132
|
+
return props.fallback;
|
|
870
1133
|
const c = cond.children;
|
|
871
1134
|
const fn = typeof c === "function" && c.length > 0;
|
|
872
1135
|
strictEqual = keyed || fn;
|
|
873
1136
|
return fn ? untrack(() => c(when)) : c;
|
|
874
|
-
},
|
|
1137
|
+
}, void 0, void 0);
|
|
875
1138
|
}
|
|
876
1139
|
function Match(props) {
|
|
877
1140
|
return props;
|
|
878
1141
|
}
|
|
879
1142
|
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
1143
|
+
// ../../node_modules/.pnpm/solid-js@1.6.13/node_modules/solid-js/web/dist/web.js
|
|
1144
|
+
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
|
+
var Properties = /* @__PURE__ */ new Set(["className", "value", "readOnly", "formNoValidate", "isMap", "noModule", "playsInline", ...booleans]);
|
|
1146
|
+
var ChildProperties = /* @__PURE__ */ new Set(["innerHTML", "textContent", "innerText", "children"]);
|
|
1147
|
+
var Aliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
884
1148
|
className: "class",
|
|
885
1149
|
htmlFor: "for"
|
|
886
1150
|
});
|
|
887
|
-
|
|
1151
|
+
var PropAliases = /* @__PURE__ */ Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
888
1152
|
class: "className",
|
|
889
1153
|
formnovalidate: "formNoValidate",
|
|
890
1154
|
ismap: "isMap",
|
|
@@ -892,19 +1156,13 @@ const PropAliases = /*#__PURE__*/Object.assign(Object.create(null), {
|
|
|
892
1156
|
playsinline: "playsInline",
|
|
893
1157
|
readonly: "readOnly"
|
|
894
1158
|
});
|
|
895
|
-
|
|
896
|
-
|
|
1159
|
+
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
|
+
var SVGNamespace = {
|
|
897
1161
|
xlink: "http://www.w3.org/1999/xlink",
|
|
898
1162
|
xml: "http://www.w3.org/XML/1998/namespace"
|
|
899
1163
|
};
|
|
900
1164
|
function reconcileArrays(parentNode, a, b) {
|
|
901
|
-
let bLength = b.length,
|
|
902
|
-
aEnd = a.length,
|
|
903
|
-
bEnd = bLength,
|
|
904
|
-
aStart = 0,
|
|
905
|
-
bStart = 0,
|
|
906
|
-
after = a[aEnd - 1].nextSibling,
|
|
907
|
-
map = null;
|
|
1165
|
+
let bLength = b.length, aEnd = a.length, bEnd = bLength, aStart = 0, bStart = 0, after = a[aEnd - 1].nextSibling, map = null;
|
|
908
1166
|
while (aStart < aEnd || bStart < bEnd) {
|
|
909
1167
|
if (a[aStart] === b[bStart]) {
|
|
910
1168
|
aStart++;
|
|
@@ -917,10 +1175,12 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
917
1175
|
}
|
|
918
1176
|
if (aEnd === aStart) {
|
|
919
1177
|
const node = bEnd < bLength ? bStart ? b[bStart - 1].nextSibling : b[bEnd - bStart] : after;
|
|
920
|
-
while (bStart < bEnd)
|
|
1178
|
+
while (bStart < bEnd)
|
|
1179
|
+
parentNode.insertBefore(b[bStart++], node);
|
|
921
1180
|
} else if (bEnd === bStart) {
|
|
922
1181
|
while (aStart < aEnd) {
|
|
923
|
-
if (!map || !map.has(a[aStart]))
|
|
1182
|
+
if (!map || !map.has(a[aStart]))
|
|
1183
|
+
a[aStart].remove();
|
|
924
1184
|
aStart++;
|
|
925
1185
|
}
|
|
926
1186
|
} else if (a[aStart] === b[bEnd - 1] && b[bStart] === a[aEnd - 1]) {
|
|
@@ -930,35 +1190,39 @@ function reconcileArrays(parentNode, a, b) {
|
|
|
930
1190
|
a[aEnd] = b[bEnd];
|
|
931
1191
|
} else {
|
|
932
1192
|
if (!map) {
|
|
933
|
-
map = new Map();
|
|
1193
|
+
map = /* @__PURE__ */ new Map();
|
|
934
1194
|
let i = bStart;
|
|
935
|
-
while (i < bEnd)
|
|
1195
|
+
while (i < bEnd)
|
|
1196
|
+
map.set(b[i], i++);
|
|
936
1197
|
}
|
|
937
1198
|
const index = map.get(a[aStart]);
|
|
938
1199
|
if (index != null) {
|
|
939
1200
|
if (bStart < index && index < bEnd) {
|
|
940
|
-
let i = aStart,
|
|
941
|
-
sequence = 1,
|
|
942
|
-
t;
|
|
1201
|
+
let i = aStart, sequence = 1, t;
|
|
943
1202
|
while (++i < aEnd && i < bEnd) {
|
|
944
|
-
if ((t = map.get(a[i])) == null || t !== index + sequence)
|
|
1203
|
+
if ((t = map.get(a[i])) == null || t !== index + sequence)
|
|
1204
|
+
break;
|
|
945
1205
|
sequence++;
|
|
946
1206
|
}
|
|
947
1207
|
if (sequence > index - bStart) {
|
|
948
1208
|
const node = a[aStart];
|
|
949
|
-
while (bStart < index)
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
1209
|
+
while (bStart < index)
|
|
1210
|
+
parentNode.insertBefore(b[bStart++], node);
|
|
1211
|
+
} else
|
|
1212
|
+
parentNode.replaceChild(b[bStart++], a[aStart++]);
|
|
1213
|
+
} else
|
|
1214
|
+
aStart++;
|
|
1215
|
+
} else
|
|
1216
|
+
a[aStart++].remove();
|
|
953
1217
|
}
|
|
954
1218
|
}
|
|
955
1219
|
}
|
|
956
|
-
|
|
1220
|
+
var $$EVENTS = "_$DX_DELEGATE";
|
|
957
1221
|
function render(code, element, init, options = {}) {
|
|
958
1222
|
let disposer;
|
|
959
|
-
createRoot(
|
|
960
|
-
disposer =
|
|
961
|
-
element === document ? code() : insert(element, code(), element.firstChild ? null :
|
|
1223
|
+
createRoot((dispose2) => {
|
|
1224
|
+
disposer = dispose2;
|
|
1225
|
+
element === document ? code() : insert(element, code(), element.firstChild ? null : void 0, init);
|
|
962
1226
|
}, options.owner);
|
|
963
1227
|
return () => {
|
|
964
1228
|
disposer();
|
|
@@ -968,65 +1232,83 @@ function render(code, element, init, options = {}) {
|
|
|
968
1232
|
function template(html, check, isSVG) {
|
|
969
1233
|
const t = document.createElement("template");
|
|
970
1234
|
t.innerHTML = html;
|
|
971
|
-
if (check && t.innerHTML.split("<").length - 1 !== check)
|
|
1235
|
+
if (check && t.innerHTML.split("<").length - 1 !== check)
|
|
1236
|
+
throw `The browser resolved template HTML does not match JSX input:
|
|
1237
|
+
${t.innerHTML}
|
|
1238
|
+
|
|
1239
|
+
${html}. Is your HTML properly formed?`;
|
|
972
1240
|
let node = t.content.firstChild;
|
|
973
|
-
if (isSVG)
|
|
1241
|
+
if (isSVG)
|
|
1242
|
+
node = node.firstChild;
|
|
974
1243
|
return node;
|
|
975
1244
|
}
|
|
976
|
-
function delegateEvents(eventNames,
|
|
977
|
-
const e =
|
|
1245
|
+
function delegateEvents(eventNames, document2 = window.document) {
|
|
1246
|
+
const e = document2[$$EVENTS] || (document2[$$EVENTS] = /* @__PURE__ */ new Set());
|
|
978
1247
|
for (let i = 0, l = eventNames.length; i < l; i++) {
|
|
979
1248
|
const name = eventNames[i];
|
|
980
1249
|
if (!e.has(name)) {
|
|
981
1250
|
e.add(name);
|
|
982
|
-
|
|
1251
|
+
document2.addEventListener(name, eventHandler);
|
|
983
1252
|
}
|
|
984
1253
|
}
|
|
985
1254
|
}
|
|
986
1255
|
function setAttribute(node, name, value) {
|
|
987
|
-
if (value == null)
|
|
1256
|
+
if (value == null)
|
|
1257
|
+
node.removeAttribute(name);
|
|
1258
|
+
else
|
|
1259
|
+
node.setAttribute(name, value);
|
|
988
1260
|
}
|
|
989
1261
|
function setAttributeNS(node, namespace, name, value) {
|
|
990
|
-
if (value == null)
|
|
1262
|
+
if (value == null)
|
|
1263
|
+
node.removeAttributeNS(namespace, name);
|
|
1264
|
+
else
|
|
1265
|
+
node.setAttributeNS(namespace, name, value);
|
|
991
1266
|
}
|
|
992
1267
|
function className(node, value) {
|
|
993
|
-
if (value == null)
|
|
1268
|
+
if (value == null)
|
|
1269
|
+
node.removeAttribute("class");
|
|
1270
|
+
else
|
|
1271
|
+
node.className = value;
|
|
994
1272
|
}
|
|
995
1273
|
function addEventListener(node, name, handler, delegate) {
|
|
996
1274
|
if (delegate) {
|
|
997
1275
|
if (Array.isArray(handler)) {
|
|
998
1276
|
node[`$$${name}`] = handler[0];
|
|
999
1277
|
node[`$$${name}Data`] = handler[1];
|
|
1000
|
-
} else
|
|
1278
|
+
} else
|
|
1279
|
+
node[`$$${name}`] = handler;
|
|
1001
1280
|
} else if (Array.isArray(handler)) {
|
|
1002
1281
|
const handlerFn = handler[0];
|
|
1003
|
-
node.addEventListener(name, handler[0] = e => handlerFn.call(node, handler[1], e));
|
|
1004
|
-
} else
|
|
1282
|
+
node.addEventListener(name, handler[0] = (e) => handlerFn.call(node, handler[1], e));
|
|
1283
|
+
} else
|
|
1284
|
+
node.addEventListener(name, handler);
|
|
1005
1285
|
}
|
|
1006
1286
|
function classList(node, value, prev = {}) {
|
|
1007
|
-
const classKeys = Object.keys(value || {}),
|
|
1008
|
-
prevKeys = Object.keys(prev);
|
|
1287
|
+
const classKeys = Object.keys(value || {}), prevKeys = Object.keys(prev);
|
|
1009
1288
|
let i, len;
|
|
1010
1289
|
for (i = 0, len = prevKeys.length; i < len; i++) {
|
|
1011
1290
|
const key = prevKeys[i];
|
|
1012
|
-
if (!key || key === "undefined" || value[key])
|
|
1291
|
+
if (!key || key === "undefined" || value[key])
|
|
1292
|
+
continue;
|
|
1013
1293
|
toggleClassKey(node, key, false);
|
|
1014
1294
|
delete prev[key];
|
|
1015
1295
|
}
|
|
1016
1296
|
for (i = 0, len = classKeys.length; i < len; i++) {
|
|
1017
|
-
const key = classKeys[i],
|
|
1018
|
-
|
|
1019
|
-
|
|
1297
|
+
const key = classKeys[i], classValue = !!value[key];
|
|
1298
|
+
if (!key || key === "undefined" || prev[key] === classValue || !classValue)
|
|
1299
|
+
continue;
|
|
1020
1300
|
toggleClassKey(node, key, true);
|
|
1021
1301
|
prev[key] = classValue;
|
|
1022
1302
|
}
|
|
1023
1303
|
return prev;
|
|
1024
1304
|
}
|
|
1025
1305
|
function style(node, value, prev) {
|
|
1026
|
-
if (!value)
|
|
1306
|
+
if (!value)
|
|
1307
|
+
return prev ? setAttribute(node, "style") : value;
|
|
1027
1308
|
const nodeStyle = node.style;
|
|
1028
|
-
if (typeof value === "string")
|
|
1029
|
-
|
|
1309
|
+
if (typeof value === "string")
|
|
1310
|
+
return nodeStyle.cssText = value;
|
|
1311
|
+
typeof prev === "string" && (nodeStyle.cssText = prev = void 0);
|
|
1030
1312
|
prev || (prev = {});
|
|
1031
1313
|
value || (value = {});
|
|
1032
1314
|
let v, s;
|
|
@@ -1056,21 +1338,25 @@ function use(fn, element, arg) {
|
|
|
1056
1338
|
return untrack(() => fn(element, arg));
|
|
1057
1339
|
}
|
|
1058
1340
|
function insert(parent, accessor, marker, initial) {
|
|
1059
|
-
if (marker !==
|
|
1060
|
-
|
|
1061
|
-
|
|
1341
|
+
if (marker !== void 0 && !initial)
|
|
1342
|
+
initial = [];
|
|
1343
|
+
if (typeof accessor !== "function")
|
|
1344
|
+
return insertExpression(parent, accessor, initial, marker);
|
|
1345
|
+
createRenderEffect((current) => insertExpression(parent, accessor(), current, marker), initial);
|
|
1062
1346
|
}
|
|
1063
1347
|
function assign(node, props, isSVG, skipChildren, prevProps = {}, skipRef = false) {
|
|
1064
1348
|
props || (props = {});
|
|
1065
1349
|
for (const prop in prevProps) {
|
|
1066
1350
|
if (!(prop in props)) {
|
|
1067
|
-
if (prop === "children")
|
|
1351
|
+
if (prop === "children")
|
|
1352
|
+
continue;
|
|
1068
1353
|
prevProps[prop] = assignProp(node, prop, null, prevProps[prop], isSVG, skipRef);
|
|
1069
1354
|
}
|
|
1070
1355
|
}
|
|
1071
1356
|
for (const prop in props) {
|
|
1072
1357
|
if (prop === "children") {
|
|
1073
|
-
if (!skipChildren)
|
|
1358
|
+
if (!skipChildren)
|
|
1359
|
+
insertExpression(node, props.children);
|
|
1074
1360
|
continue;
|
|
1075
1361
|
}
|
|
1076
1362
|
const value = props[prop];
|
|
@@ -1082,15 +1368,20 @@ function toPropertyName(name) {
|
|
|
1082
1368
|
}
|
|
1083
1369
|
function toggleClassKey(node, key, value) {
|
|
1084
1370
|
const classNames = key.trim().split(/\s+/);
|
|
1085
|
-
for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
|
|
1371
|
+
for (let i = 0, nameLen = classNames.length; i < nameLen; i++)
|
|
1372
|
+
node.classList.toggle(classNames[i], value);
|
|
1086
1373
|
}
|
|
1087
1374
|
function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
1088
1375
|
let isCE, isProp, isChildProp;
|
|
1089
|
-
if (prop === "style")
|
|
1090
|
-
|
|
1091
|
-
if (
|
|
1376
|
+
if (prop === "style")
|
|
1377
|
+
return style(node, value, prev);
|
|
1378
|
+
if (prop === "classList")
|
|
1379
|
+
return classList(node, value, prev);
|
|
1380
|
+
if (value === prev)
|
|
1381
|
+
return prev;
|
|
1092
1382
|
if (prop === "ref") {
|
|
1093
|
-
if (!skipRef)
|
|
1383
|
+
if (!skipRef)
|
|
1384
|
+
value(node);
|
|
1094
1385
|
} else if (prop.slice(0, 3) === "on:") {
|
|
1095
1386
|
const e = prop.slice(3);
|
|
1096
1387
|
prev && node.removeEventListener(e, prev);
|
|
@@ -1111,10 +1402,18 @@ function assignProp(node, prop, value, prev, isSVG, skipRef) {
|
|
|
1111
1402
|
delegate && delegateEvents([name]);
|
|
1112
1403
|
}
|
|
1113
1404
|
} else if ((isChildProp = ChildProperties.has(prop)) || !isSVG && (PropAliases[prop] || (isProp = Properties.has(prop))) || (isCE = node.nodeName.includes("-"))) {
|
|
1114
|
-
if (prop === "class" || prop === "className")
|
|
1405
|
+
if (prop === "class" || prop === "className")
|
|
1406
|
+
className(node, value);
|
|
1407
|
+
else if (isCE && !isProp && !isChildProp)
|
|
1408
|
+
node[toPropertyName(prop)] = value;
|
|
1409
|
+
else
|
|
1410
|
+
node[PropAliases[prop] || prop] = value;
|
|
1115
1411
|
} else {
|
|
1116
1412
|
const ns = isSVG && prop.indexOf(":") > -1 && SVGNamespace[prop.split(":")[0]];
|
|
1117
|
-
if (ns)
|
|
1413
|
+
if (ns)
|
|
1414
|
+
setAttributeNS(node, ns, prop, value);
|
|
1415
|
+
else
|
|
1416
|
+
setAttribute(node, Aliases[prop] || prop, value);
|
|
1118
1417
|
}
|
|
1119
1418
|
return value;
|
|
1120
1419
|
}
|
|
@@ -1135,7 +1434,7 @@ function eventHandler(e) {
|
|
|
1135
1434
|
});
|
|
1136
1435
|
if (sharedConfig.registry && !sharedConfig.done) {
|
|
1137
1436
|
sharedConfig.done = true;
|
|
1138
|
-
document.querySelectorAll("[id^=pl-]").forEach(elem => {
|
|
1437
|
+
document.querySelectorAll("[id^=pl-]").forEach((elem) => {
|
|
1139
1438
|
while (elem && elem.nodeType !== 8 && elem.nodeValue !== "pl-" + e) {
|
|
1140
1439
|
let x = elem.nextSibling;
|
|
1141
1440
|
elem.remove();
|
|
@@ -1148,40 +1447,49 @@ function eventHandler(e) {
|
|
|
1148
1447
|
const handler = node[key];
|
|
1149
1448
|
if (handler && !node.disabled) {
|
|
1150
1449
|
const data = node[`${key}Data`];
|
|
1151
|
-
data !==
|
|
1152
|
-
if (e.cancelBubble)
|
|
1450
|
+
data !== void 0 ? handler.call(node, data, e) : handler.call(node, e);
|
|
1451
|
+
if (e.cancelBubble)
|
|
1452
|
+
return;
|
|
1153
1453
|
}
|
|
1154
1454
|
node = node._$host || node.parentNode || node.host;
|
|
1155
1455
|
}
|
|
1156
1456
|
}
|
|
1157
1457
|
function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
1158
|
-
if (sharedConfig.context && !current)
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1458
|
+
if (sharedConfig.context && !current)
|
|
1459
|
+
current = [...parent.childNodes];
|
|
1460
|
+
while (typeof current === "function")
|
|
1461
|
+
current = current();
|
|
1462
|
+
if (value === current)
|
|
1463
|
+
return current;
|
|
1464
|
+
const t = typeof value, multi = marker !== void 0;
|
|
1163
1465
|
parent = multi && current[0] && current[0].parentNode || parent;
|
|
1164
1466
|
if (t === "string" || t === "number") {
|
|
1165
|
-
if (sharedConfig.context)
|
|
1166
|
-
|
|
1467
|
+
if (sharedConfig.context)
|
|
1468
|
+
return current;
|
|
1469
|
+
if (t === "number")
|
|
1470
|
+
value = value.toString();
|
|
1167
1471
|
if (multi) {
|
|
1168
1472
|
let node = current[0];
|
|
1169
1473
|
if (node && node.nodeType === 3) {
|
|
1170
1474
|
node.data = value;
|
|
1171
|
-
} else
|
|
1475
|
+
} else
|
|
1476
|
+
node = document.createTextNode(value);
|
|
1172
1477
|
current = cleanChildren(parent, current, marker, node);
|
|
1173
1478
|
} else {
|
|
1174
1479
|
if (current !== "" && typeof current === "string") {
|
|
1175
1480
|
current = parent.firstChild.data = value;
|
|
1176
|
-
} else
|
|
1481
|
+
} else
|
|
1482
|
+
current = parent.textContent = value;
|
|
1177
1483
|
}
|
|
1178
1484
|
} else if (value == null || t === "boolean") {
|
|
1179
|
-
if (sharedConfig.context)
|
|
1485
|
+
if (sharedConfig.context)
|
|
1486
|
+
return current;
|
|
1180
1487
|
current = cleanChildren(parent, current, marker);
|
|
1181
1488
|
} else if (t === "function") {
|
|
1182
1489
|
createRenderEffect(() => {
|
|
1183
1490
|
let v = value();
|
|
1184
|
-
while (typeof v === "function")
|
|
1491
|
+
while (typeof v === "function")
|
|
1492
|
+
v = v();
|
|
1185
1493
|
current = insertExpression(parent, v, current, marker);
|
|
1186
1494
|
});
|
|
1187
1495
|
return () => current;
|
|
@@ -1193,47 +1501,57 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
|
|
|
1193
1501
|
return () => current;
|
|
1194
1502
|
}
|
|
1195
1503
|
if (sharedConfig.context) {
|
|
1196
|
-
if (!array.length)
|
|
1504
|
+
if (!array.length)
|
|
1505
|
+
return current;
|
|
1197
1506
|
for (let i = 0; i < array.length; i++) {
|
|
1198
|
-
if (array[i].parentNode)
|
|
1507
|
+
if (array[i].parentNode)
|
|
1508
|
+
return current = array;
|
|
1199
1509
|
}
|
|
1200
1510
|
}
|
|
1201
1511
|
if (array.length === 0) {
|
|
1202
1512
|
current = cleanChildren(parent, current, marker);
|
|
1203
|
-
if (multi)
|
|
1513
|
+
if (multi)
|
|
1514
|
+
return current;
|
|
1204
1515
|
} else if (currentArray) {
|
|
1205
1516
|
if (current.length === 0) {
|
|
1206
1517
|
appendNodes(parent, array, marker);
|
|
1207
|
-
} else
|
|
1518
|
+
} else
|
|
1519
|
+
reconcileArrays(parent, current, array);
|
|
1208
1520
|
} else {
|
|
1209
1521
|
current && cleanChildren(parent);
|
|
1210
1522
|
appendNodes(parent, array);
|
|
1211
1523
|
}
|
|
1212
1524
|
current = array;
|
|
1213
1525
|
} else if (value instanceof Node) {
|
|
1214
|
-
if (sharedConfig.context && value.parentNode)
|
|
1526
|
+
if (sharedConfig.context && value.parentNode)
|
|
1527
|
+
return current = multi ? [value] : value;
|
|
1215
1528
|
if (Array.isArray(current)) {
|
|
1216
|
-
if (multi)
|
|
1529
|
+
if (multi)
|
|
1530
|
+
return current = cleanChildren(parent, current, marker, value);
|
|
1217
1531
|
cleanChildren(parent, current, null, value);
|
|
1218
1532
|
} else if (current == null || current === "" || !parent.firstChild) {
|
|
1219
1533
|
parent.appendChild(value);
|
|
1220
|
-
} else
|
|
1534
|
+
} else
|
|
1535
|
+
parent.replaceChild(value, parent.firstChild);
|
|
1221
1536
|
current = value;
|
|
1222
|
-
} else
|
|
1537
|
+
} else
|
|
1538
|
+
;
|
|
1223
1539
|
return current;
|
|
1224
1540
|
}
|
|
1225
1541
|
function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
1226
1542
|
let dynamic = false;
|
|
1227
1543
|
for (let i = 0, len = array.length; i < len; i++) {
|
|
1228
|
-
let item = array[i],
|
|
1229
|
-
prev = current && current[i];
|
|
1544
|
+
let item = array[i], prev = current && current[i];
|
|
1230
1545
|
if (item instanceof Node) {
|
|
1231
1546
|
normalized.push(item);
|
|
1232
|
-
} else if (item == null || item === true || item === false)
|
|
1547
|
+
} else if (item == null || item === true || item === false)
|
|
1548
|
+
;
|
|
1549
|
+
else if (Array.isArray(item)) {
|
|
1233
1550
|
dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
|
|
1234
1551
|
} else if (typeof item === "function") {
|
|
1235
1552
|
if (unwrap) {
|
|
1236
|
-
while (typeof item === "function")
|
|
1553
|
+
while (typeof item === "function")
|
|
1554
|
+
item = item();
|
|
1237
1555
|
dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
|
|
1238
1556
|
} else {
|
|
1239
1557
|
normalized.push(item);
|
|
@@ -1242,20 +1560,24 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
|
|
|
1242
1560
|
} else {
|
|
1243
1561
|
const value = String(item);
|
|
1244
1562
|
if (value === "<!>") {
|
|
1245
|
-
if (prev && prev.nodeType === 8)
|
|
1563
|
+
if (prev && prev.nodeType === 8)
|
|
1564
|
+
normalized.push(prev);
|
|
1246
1565
|
} else if (prev && prev.nodeType === 3) {
|
|
1247
1566
|
prev.data = value;
|
|
1248
1567
|
normalized.push(prev);
|
|
1249
|
-
} else
|
|
1568
|
+
} else
|
|
1569
|
+
normalized.push(document.createTextNode(value));
|
|
1250
1570
|
}
|
|
1251
1571
|
}
|
|
1252
1572
|
return dynamic;
|
|
1253
1573
|
}
|
|
1254
1574
|
function appendNodes(parent, array, marker = null) {
|
|
1255
|
-
for (let i = 0, len = array.length; i < len; i++)
|
|
1575
|
+
for (let i = 0, len = array.length; i < len; i++)
|
|
1576
|
+
parent.insertBefore(array[i], marker);
|
|
1256
1577
|
}
|
|
1257
1578
|
function cleanChildren(parent, current, marker, replacement) {
|
|
1258
|
-
if (marker ===
|
|
1579
|
+
if (marker === void 0)
|
|
1580
|
+
return parent.textContent = "";
|
|
1259
1581
|
const node = replacement || document.createTextNode("");
|
|
1260
1582
|
if (current.length) {
|
|
1261
1583
|
let inserted = false;
|
|
@@ -1263,107 +1585,17 @@ function cleanChildren(parent, current, marker, replacement) {
|
|
|
1263
1585
|
const el = current[i];
|
|
1264
1586
|
if (node !== el) {
|
|
1265
1587
|
const isParent = el.parentNode === parent;
|
|
1266
|
-
if (!inserted && !i)
|
|
1267
|
-
|
|
1588
|
+
if (!inserted && !i)
|
|
1589
|
+
isParent ? parent.replaceChild(node, el) : parent.insertBefore(node, marker);
|
|
1590
|
+
else
|
|
1591
|
+
isParent && el.remove();
|
|
1592
|
+
} else
|
|
1593
|
+
inserted = true;
|
|
1268
1594
|
}
|
|
1269
|
-
} else
|
|
1595
|
+
} else
|
|
1596
|
+
parent.insertBefore(node, marker);
|
|
1270
1597
|
return [node];
|
|
1271
1598
|
}
|
|
1599
|
+
var isServer = false;
|
|
1272
1600
|
|
|
1273
|
-
|
|
1274
|
-
isMounted = false;
|
|
1275
|
-
constructor(config) {
|
|
1276
|
-
const {
|
|
1277
|
-
client,
|
|
1278
|
-
queryFlavor,
|
|
1279
|
-
version,
|
|
1280
|
-
onlineManager,
|
|
1281
|
-
buttonPosition,
|
|
1282
|
-
position,
|
|
1283
|
-
initialIsOpen,
|
|
1284
|
-
errorTypes
|
|
1285
|
-
} = config;
|
|
1286
|
-
this.client = createSignal(client);
|
|
1287
|
-
this.queryFlavor = queryFlavor;
|
|
1288
|
-
this.version = version;
|
|
1289
|
-
this.onlineManager = onlineManager;
|
|
1290
|
-
this.buttonPosition = createSignal(buttonPosition);
|
|
1291
|
-
this.position = createSignal(position);
|
|
1292
|
-
this.initialIsOpen = createSignal(initialIsOpen);
|
|
1293
|
-
this.errorTypes = createSignal(errorTypes);
|
|
1294
|
-
}
|
|
1295
|
-
setButtonPosition(position) {
|
|
1296
|
-
this.buttonPosition[1](position);
|
|
1297
|
-
}
|
|
1298
|
-
setPosition(position) {
|
|
1299
|
-
this.position[1](position);
|
|
1300
|
-
}
|
|
1301
|
-
setInitialIsOpen(isOpen) {
|
|
1302
|
-
this.initialIsOpen[1](isOpen);
|
|
1303
|
-
}
|
|
1304
|
-
setErrorTypes(errorTypes) {
|
|
1305
|
-
this.errorTypes[1](errorTypes);
|
|
1306
|
-
}
|
|
1307
|
-
setClient(client) {
|
|
1308
|
-
this.client[1](client);
|
|
1309
|
-
}
|
|
1310
|
-
mount(el) {
|
|
1311
|
-
if (this.isMounted) {
|
|
1312
|
-
throw new Error('Devtools is already mounted');
|
|
1313
|
-
}
|
|
1314
|
-
const dispose = render(() => {
|
|
1315
|
-
const [btnPosition] = this.buttonPosition;
|
|
1316
|
-
const [pos] = this.position;
|
|
1317
|
-
const [isOpen] = this.initialIsOpen;
|
|
1318
|
-
const [errors] = this.errorTypes;
|
|
1319
|
-
const [queryClient] = this.client;
|
|
1320
|
-
let Devtools;
|
|
1321
|
-
if (this.Component) {
|
|
1322
|
-
Devtools = this.Component;
|
|
1323
|
-
} else {
|
|
1324
|
-
Devtools = lazy(() => import('./Devtools-26de9f2c.js'));
|
|
1325
|
-
this.Component = Devtools;
|
|
1326
|
-
}
|
|
1327
|
-
const _self$ = this;
|
|
1328
|
-
return createComponent(Devtools, mergeProps({
|
|
1329
|
-
get queryFlavor() {
|
|
1330
|
-
return _self$.queryFlavor;
|
|
1331
|
-
},
|
|
1332
|
-
get version() {
|
|
1333
|
-
return _self$.version;
|
|
1334
|
-
},
|
|
1335
|
-
get onlineManager() {
|
|
1336
|
-
return _self$.onlineManager;
|
|
1337
|
-
}
|
|
1338
|
-
}, {
|
|
1339
|
-
get client() {
|
|
1340
|
-
return queryClient();
|
|
1341
|
-
},
|
|
1342
|
-
get buttonPosition() {
|
|
1343
|
-
return btnPosition();
|
|
1344
|
-
},
|
|
1345
|
-
get position() {
|
|
1346
|
-
return pos();
|
|
1347
|
-
},
|
|
1348
|
-
get initialIsOpen() {
|
|
1349
|
-
return isOpen();
|
|
1350
|
-
},
|
|
1351
|
-
get errorTypes() {
|
|
1352
|
-
return errors();
|
|
1353
|
-
}
|
|
1354
|
-
}));
|
|
1355
|
-
}, el);
|
|
1356
|
-
this.isMounted = true;
|
|
1357
|
-
this.dispose = dispose;
|
|
1358
|
-
}
|
|
1359
|
-
unmount() {
|
|
1360
|
-
if (!this.isMounted) {
|
|
1361
|
-
throw new Error('Devtools is not mounted');
|
|
1362
|
-
}
|
|
1363
|
-
this.dispose?.();
|
|
1364
|
-
this.isMounted = false;
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
export { $TRACK as $, For as F, Index as I, Match as M, Show as S, TanstackQueryDevtools as T, createMemo as a, useTransition as b, createSignal as c, createRoot as d, onMount as e, createEffect as f, createRenderEffect as g, delegateEvents as h, insert as i, createComponent as j, className as k, addEventListener as l, Switch as m, useContext as n, onCleanup as o, createContext as p, on as q, spread as r, setAttribute as s, template as t, untrack as u, mergeProps as v, use as w };
|
|
1369
|
-
//# sourceMappingURL=index-7c6d68e3.js.map
|
|
1601
|
+
export { $TRACK, For, Index, Match, Show, Switch, addEventListener, className, createComponent, createContext, createEffect, createMemo, createRenderEffect, createRoot, createSignal, delegateEvents, insert, isServer, lazy, mergeProps, on, onCleanup, onMount, render, setAttribute, spread, template, untrack, use, useContext, useTransition };
|