@shane_il/pulse 0.3.0 → 0.4.0
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/README.md +2 -2
- package/dist/connect.d.ts +5 -1
- package/dist/devtools.cjs +1 -1
- package/dist/devtools.cjs.map +1 -1
- package/dist/devtools.js +367 -337
- package/dist/devtools.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/pulse.cjs +1 -1
- package/dist/pulse.cjs.map +1 -1
- package/dist/pulse.js +305 -275
- package/dist/pulse.js.map +1 -1
- package/dist/vnode.d.ts +7 -0
- package/package.json +1 -1
package/dist/devtools.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var S = (t, e, n) =>
|
|
4
|
-
let
|
|
1
|
+
var it = Object.defineProperty;
|
|
2
|
+
var ct = (t, e, n) => e in t ? it(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var S = (t, e, n) => ct(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
let M = !1;
|
|
5
5
|
const R = /* @__PURE__ */ new Set();
|
|
6
|
-
function
|
|
7
|
-
R.add(t),
|
|
6
|
+
function K(t) {
|
|
7
|
+
R.add(t), M || (M = !0, queueMicrotask(lt));
|
|
8
8
|
}
|
|
9
9
|
function lt() {
|
|
10
10
|
const t = [...R];
|
|
11
|
-
R.clear(),
|
|
11
|
+
R.clear(), M = !1;
|
|
12
12
|
for (const e of t)
|
|
13
13
|
e();
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const J = Symbol("PULSE_CONNECTED"), F = globalThis;
|
|
16
16
|
F.__PULSE_HOOKS__ || (F.__PULSE_HOOKS__ = { onMount: null, onUnmount: null });
|
|
17
17
|
const T = F.__PULSE_HOOKS__;
|
|
18
18
|
function at(t, e) {
|
|
@@ -22,14 +22,14 @@ function pt(t, e) {
|
|
|
22
22
|
return function(o) {
|
|
23
23
|
const s = t || {};
|
|
24
24
|
function r(i) {
|
|
25
|
-
const
|
|
26
|
-
for (const
|
|
27
|
-
const { store:
|
|
28
|
-
|
|
25
|
+
const l = {};
|
|
26
|
+
for (const u in s) {
|
|
27
|
+
const { store: f, selector: h } = s[u];
|
|
28
|
+
l[u] = h(f.getState());
|
|
29
29
|
}
|
|
30
|
-
return o({ ...
|
|
30
|
+
return o({ ...l, ...i });
|
|
31
31
|
}
|
|
32
|
-
return r[
|
|
32
|
+
return r[J] = !0, r._bindings = s, r._innerComponent = o, r.displayName = `Connected(${o.displayName || o.name || "Anonymous"})`, r;
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
class ut {
|
|
@@ -42,21 +42,51 @@ class ut {
|
|
|
42
42
|
S(this, "parentDom");
|
|
43
43
|
S(this, "_renderCallback");
|
|
44
44
|
S(this, "_mountCleanup");
|
|
45
|
-
this
|
|
45
|
+
S(this, "_localState");
|
|
46
|
+
S(this, "_localActions");
|
|
47
|
+
this.connectedFn = e, this.props = n, this.prevSelected = {}, this.unsubscribers = [], this.lastVTree = null, this.parentDom = null, this._renderCallback = null, this._mountCleanup = null, this._localState = null, this._localActions = null;
|
|
48
|
+
const o = e._lifecycle;
|
|
49
|
+
o != null && o.store && this._initLocalStore(o.store);
|
|
50
|
+
}
|
|
51
|
+
_initLocalStore(e) {
|
|
52
|
+
this._localState = { ...e.state }, this._localActions = e.actions;
|
|
53
|
+
const n = this.connectedFn._bindings, o = this.connectedFn.displayName || "component", s = Object.keys(this._localState), r = Object.keys(this._localActions);
|
|
54
|
+
for (const i of s)
|
|
55
|
+
i in n && console.warn(
|
|
56
|
+
`[pulse] Local store state "${i}" shadows global binding in ${o}. Local value will be used.`
|
|
57
|
+
);
|
|
58
|
+
for (const i of r)
|
|
59
|
+
i in n && console.warn(
|
|
60
|
+
`[pulse] Local store action "${i}" shadows global binding in ${o}. Local value will be used.`
|
|
61
|
+
), i in this._localState && console.warn(
|
|
62
|
+
`[pulse] Local store action "${i}" shadows state key with same name in ${o}.`
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
getLocalProps() {
|
|
66
|
+
if (!this._localState) return null;
|
|
67
|
+
const e = { ...this._localState };
|
|
68
|
+
for (const n in this._localActions) {
|
|
69
|
+
const o = this._localActions[n];
|
|
70
|
+
e[n] = (s) => {
|
|
71
|
+
const r = o(this._localState, s);
|
|
72
|
+
r !== this._localState && (this._localState = r, this._renderCallback && K(this._renderCallback));
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
return e;
|
|
46
76
|
}
|
|
47
77
|
mount(e, n) {
|
|
48
78
|
var r;
|
|
49
79
|
this.parentDom = e, this._renderCallback = n;
|
|
50
80
|
const o = this.connectedFn._bindings;
|
|
51
81
|
for (const i in o) {
|
|
52
|
-
const { store:
|
|
53
|
-
this.prevSelected[i] =
|
|
82
|
+
const { store: l, selector: u } = o[i];
|
|
83
|
+
this.prevSelected[i] = u(l.getState());
|
|
54
84
|
}
|
|
55
85
|
for (const i in o) {
|
|
56
|
-
const { store:
|
|
86
|
+
const { store: l } = o[i], u = l.subscribe(() => {
|
|
57
87
|
this._onStoreChange();
|
|
58
88
|
});
|
|
59
|
-
this.unsubscribers.push(
|
|
89
|
+
this.unsubscribers.push(u);
|
|
60
90
|
}
|
|
61
91
|
const s = this.connectedFn._lifecycle;
|
|
62
92
|
if (s != null && s.onMount) {
|
|
@@ -78,7 +108,7 @@ class ut {
|
|
|
78
108
|
break;
|
|
79
109
|
}
|
|
80
110
|
}
|
|
81
|
-
n &&
|
|
111
|
+
n && K(this._renderCallback);
|
|
82
112
|
}
|
|
83
113
|
updateSelected() {
|
|
84
114
|
const e = this.connectedFn._bindings;
|
|
@@ -106,64 +136,64 @@ function ft(t, e) {
|
|
|
106
136
|
return !1;
|
|
107
137
|
return !0;
|
|
108
138
|
}
|
|
109
|
-
function
|
|
139
|
+
function Q(t) {
|
|
110
140
|
let e = t.state;
|
|
111
141
|
const n = t.actions, o = /* @__PURE__ */ new Set(), s = t.middleware;
|
|
112
142
|
function r() {
|
|
113
143
|
return e;
|
|
114
144
|
}
|
|
115
145
|
function i() {
|
|
116
|
-
for (const
|
|
117
|
-
|
|
146
|
+
for (const p of o)
|
|
147
|
+
p(e);
|
|
118
148
|
}
|
|
119
|
-
function
|
|
120
|
-
const
|
|
121
|
-
if (!
|
|
122
|
-
throw new Error(`[pulse] Unknown action: "${
|
|
123
|
-
const
|
|
124
|
-
|
|
149
|
+
function l(p, b) {
|
|
150
|
+
const _ = n[p];
|
|
151
|
+
if (!_)
|
|
152
|
+
throw new Error(`[pulse] Unknown action: "${p}"`);
|
|
153
|
+
const m = _(e, b);
|
|
154
|
+
m !== e && (e = m, i());
|
|
125
155
|
}
|
|
126
|
-
function p
|
|
127
|
-
if (
|
|
128
|
-
e =
|
|
156
|
+
function u(p, b) {
|
|
157
|
+
if (p === "__devtools_replace__") {
|
|
158
|
+
e = b, i();
|
|
129
159
|
return;
|
|
130
160
|
}
|
|
131
|
-
const
|
|
132
|
-
if (!
|
|
133
|
-
throw new Error(`[pulse] Unknown action: "${
|
|
134
|
-
const
|
|
161
|
+
const _ = n[p];
|
|
162
|
+
if (!_)
|
|
163
|
+
throw new Error(`[pulse] Unknown action: "${p}"`);
|
|
164
|
+
const m = {
|
|
135
165
|
store: c,
|
|
136
|
-
actionName:
|
|
137
|
-
payload:
|
|
166
|
+
actionName: p,
|
|
167
|
+
payload: b,
|
|
138
168
|
prevState: e,
|
|
139
169
|
nextState: void 0
|
|
140
170
|
};
|
|
141
|
-
let
|
|
171
|
+
let k = 0;
|
|
142
172
|
function z() {
|
|
143
|
-
if (
|
|
144
|
-
const C = s[
|
|
145
|
-
C(
|
|
173
|
+
if (k < s.length) {
|
|
174
|
+
const C = s[k++];
|
|
175
|
+
C(m, z);
|
|
146
176
|
} else {
|
|
147
|
-
const C =
|
|
148
|
-
|
|
177
|
+
const C = _(m.prevState, m.payload);
|
|
178
|
+
m.nextState = C, C !== e && (e = C, i());
|
|
149
179
|
}
|
|
150
180
|
}
|
|
151
181
|
z();
|
|
152
182
|
}
|
|
153
|
-
const
|
|
154
|
-
function h(
|
|
155
|
-
return o.add(
|
|
156
|
-
o.delete(
|
|
183
|
+
const f = s && s.length > 0 ? u : l;
|
|
184
|
+
function h(p) {
|
|
185
|
+
return o.add(p), () => {
|
|
186
|
+
o.delete(p);
|
|
157
187
|
};
|
|
158
188
|
}
|
|
159
|
-
function
|
|
160
|
-
return { store: c, selector:
|
|
189
|
+
function y(p) {
|
|
190
|
+
return { store: c, selector: p };
|
|
161
191
|
}
|
|
162
192
|
const c = {
|
|
163
193
|
getState: r,
|
|
164
|
-
dispatch:
|
|
194
|
+
dispatch: f,
|
|
165
195
|
subscribe: h,
|
|
166
|
-
select:
|
|
196
|
+
select: y
|
|
167
197
|
};
|
|
168
198
|
return t.name && (c.name = t.name), c;
|
|
169
199
|
}
|
|
@@ -179,7 +209,7 @@ function dt(t, e) {
|
|
|
179
209
|
};
|
|
180
210
|
}
|
|
181
211
|
let ht = 1;
|
|
182
|
-
class
|
|
212
|
+
class yt {
|
|
183
213
|
constructor() {
|
|
184
214
|
S(this, "stores", /* @__PURE__ */ new Map());
|
|
185
215
|
S(this, "components", /* @__PURE__ */ new Map());
|
|
@@ -238,13 +268,13 @@ class mt {
|
|
|
238
268
|
}
|
|
239
269
|
}
|
|
240
270
|
function Qt(t, e) {
|
|
241
|
-
const n = [], o = dt(n), s =
|
|
271
|
+
const n = [], o = dt(n), s = Q({
|
|
242
272
|
...e,
|
|
243
273
|
middleware: [o, ...e.middleware || []]
|
|
244
274
|
});
|
|
245
275
|
return t.registerStore(s, n, e.name), { store: s, history: n };
|
|
246
276
|
}
|
|
247
|
-
const D = Symbol("TEXT_NODE"),
|
|
277
|
+
const D = Symbol("TEXT_NODE"), mt = Symbol("FRAGMENT");
|
|
248
278
|
function B(t) {
|
|
249
279
|
return {
|
|
250
280
|
type: D,
|
|
@@ -256,25 +286,25 @@ function B(t) {
|
|
|
256
286
|
function gt(t) {
|
|
257
287
|
return t == null || typeof t == "boolean" ? null : typeof t == "string" || typeof t == "number" ? B(t) : t;
|
|
258
288
|
}
|
|
259
|
-
function
|
|
289
|
+
function Y(t) {
|
|
260
290
|
const e = [];
|
|
261
291
|
for (const n of t)
|
|
262
292
|
if (Array.isArray(n))
|
|
263
|
-
e.push(...
|
|
293
|
+
e.push(...Y(n));
|
|
264
294
|
else {
|
|
265
295
|
const o = gt(n);
|
|
266
296
|
o !== null && e.push(o);
|
|
267
297
|
}
|
|
268
298
|
return e;
|
|
269
299
|
}
|
|
270
|
-
function
|
|
300
|
+
function a(t, e, ...n) {
|
|
271
301
|
e = e || {};
|
|
272
302
|
const o = e.key ?? null;
|
|
273
303
|
e.key !== void 0 && (e = { ...e }, delete e.key);
|
|
274
|
-
const s =
|
|
304
|
+
const s = Y(n);
|
|
275
305
|
return { type: t, props: e, children: s, key: o };
|
|
276
306
|
}
|
|
277
|
-
const
|
|
307
|
+
const g = {
|
|
278
308
|
CREATE: "CREATE",
|
|
279
309
|
REMOVE: "REMOVE",
|
|
280
310
|
REPLACE: "REPLACE",
|
|
@@ -285,16 +315,16 @@ const y = {
|
|
|
285
315
|
};
|
|
286
316
|
function x(t, e) {
|
|
287
317
|
if (e == null && t == null) return [];
|
|
288
|
-
if (e == null) return [{ type:
|
|
289
|
-
if (t == null) return [{ type:
|
|
318
|
+
if (e == null) return [{ type: g.REMOVE, target: t }];
|
|
319
|
+
if (t == null) return [{ type: g.CREATE, newVNode: e }];
|
|
290
320
|
if (t.type !== e.type)
|
|
291
|
-
return [{ type:
|
|
321
|
+
return [{ type: g.REPLACE, oldVNode: t, newVNode: e }];
|
|
292
322
|
if (e._dom = t._dom, t.type === D)
|
|
293
|
-
return t.props.nodeValue !== e.props.nodeValue ? [{ type:
|
|
323
|
+
return t.props.nodeValue !== e.props.nodeValue ? [{ type: g.TEXT, oldVNode: t, newVNode: e }] : [];
|
|
294
324
|
const n = [], o = St(t.props, e.props);
|
|
295
|
-
o && n.push({ type:
|
|
325
|
+
o && n.push({ type: g.UPDATE, target: t, propPatches: o });
|
|
296
326
|
const s = bt(t.children, e.children);
|
|
297
|
-
return s.length && n.push({ type:
|
|
327
|
+
return s.length && n.push({ type: g.CHILDREN, parent: t, childPatches: s }), n;
|
|
298
328
|
}
|
|
299
329
|
function St(t, e) {
|
|
300
330
|
const n = {}, o = [];
|
|
@@ -305,7 +335,7 @@ function St(t, e) {
|
|
|
305
335
|
r !== "children" && (r in e || (o.push(r), s = !0));
|
|
306
336
|
return s ? { set: n, remove: o } : null;
|
|
307
337
|
}
|
|
308
|
-
function
|
|
338
|
+
function v(t, e) {
|
|
309
339
|
return t == null || e == null ? !1 : t.type === e.type && t.key === e.key;
|
|
310
340
|
}
|
|
311
341
|
function G(t, e) {
|
|
@@ -320,103 +350,103 @@ function G(t, e) {
|
|
|
320
350
|
);
|
|
321
351
|
}
|
|
322
352
|
function bt(t, e) {
|
|
323
|
-
var
|
|
353
|
+
var y;
|
|
324
354
|
process.env.NODE_ENV !== "production" && (G(t, "old"), G(e, "new"));
|
|
325
355
|
const n = [];
|
|
326
|
-
let o = 0, s = t.length - 1, r = 0, i = e.length - 1,
|
|
356
|
+
let o = 0, s = t.length - 1, r = 0, i = e.length - 1, l = t[o], u = t[s], f = e[r], h = e[i];
|
|
327
357
|
for (; o <= s && r <= i; ) {
|
|
328
|
-
if (
|
|
329
|
-
|
|
358
|
+
if (l == null) {
|
|
359
|
+
l = t[++o];
|
|
330
360
|
continue;
|
|
331
361
|
}
|
|
332
|
-
if (
|
|
333
|
-
|
|
362
|
+
if (u == null) {
|
|
363
|
+
u = t[--s];
|
|
334
364
|
continue;
|
|
335
365
|
}
|
|
336
|
-
if (
|
|
337
|
-
n.push(...x(
|
|
338
|
-
else if (
|
|
339
|
-
n.push(...x(
|
|
340
|
-
else if (
|
|
366
|
+
if (v(l, f))
|
|
367
|
+
n.push(...x(l, f)), l = t[++o], f = e[++r];
|
|
368
|
+
else if (v(u, h))
|
|
369
|
+
n.push(...x(u, h)), u = t[--s], h = e[--i];
|
|
370
|
+
else if (v(l, h))
|
|
341
371
|
n.push({
|
|
342
|
-
type:
|
|
343
|
-
vnode:
|
|
372
|
+
type: g.MOVE,
|
|
373
|
+
vnode: l,
|
|
344
374
|
anchor: t[s + 1] || null,
|
|
345
|
-
childPatches: x(
|
|
346
|
-
}),
|
|
347
|
-
else if (
|
|
375
|
+
childPatches: x(l, h)
|
|
376
|
+
}), l = t[++o], h = e[--i];
|
|
377
|
+
else if (v(u, f))
|
|
348
378
|
n.push({
|
|
349
|
-
type:
|
|
350
|
-
vnode:
|
|
351
|
-
anchor:
|
|
352
|
-
childPatches: x(
|
|
353
|
-
}),
|
|
379
|
+
type: g.MOVE,
|
|
380
|
+
vnode: u,
|
|
381
|
+
anchor: l,
|
|
382
|
+
childPatches: x(u, f)
|
|
383
|
+
}), u = t[--s], f = e[++r];
|
|
354
384
|
else
|
|
355
385
|
break;
|
|
356
386
|
}
|
|
357
387
|
if (o <= s && r <= i) {
|
|
358
388
|
const c = /* @__PURE__ */ new Map();
|
|
359
|
-
for (let
|
|
360
|
-
const
|
|
361
|
-
|
|
389
|
+
for (let p = o; p <= s; p++) {
|
|
390
|
+
const b = (y = t[p]) == null ? void 0 : y.key;
|
|
391
|
+
b != null && c.set(b, p);
|
|
362
392
|
}
|
|
363
393
|
for (; r <= i; ) {
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
if (
|
|
367
|
-
const
|
|
394
|
+
f = e[r];
|
|
395
|
+
const p = f.key != null ? c.get(f.key) : void 0;
|
|
396
|
+
if (p !== void 0) {
|
|
397
|
+
const b = t[p];
|
|
368
398
|
n.push({
|
|
369
|
-
type:
|
|
370
|
-
vnode:
|
|
399
|
+
type: g.MOVE,
|
|
400
|
+
vnode: b,
|
|
371
401
|
anchor: t[o] || null,
|
|
372
|
-
childPatches: x(
|
|
373
|
-
}), t[
|
|
402
|
+
childPatches: x(b, f)
|
|
403
|
+
}), t[p] = null, c.delete(f.key);
|
|
374
404
|
} else
|
|
375
405
|
n.push({
|
|
376
|
-
type:
|
|
377
|
-
newVNode:
|
|
406
|
+
type: g.CREATE,
|
|
407
|
+
newVNode: f,
|
|
378
408
|
anchor: t[o] || null
|
|
379
409
|
});
|
|
380
410
|
r++;
|
|
381
411
|
}
|
|
382
|
-
for (let
|
|
383
|
-
t[
|
|
412
|
+
for (let p = o; p <= s; p++)
|
|
413
|
+
t[p] != null && n.push({ type: g.REMOVE, target: t[p] });
|
|
384
414
|
}
|
|
385
415
|
if (o > s) {
|
|
386
416
|
const c = e[i + 1] || null;
|
|
387
|
-
for (let
|
|
388
|
-
n.push({ type:
|
|
417
|
+
for (let p = r; p <= i; p++)
|
|
418
|
+
n.push({ type: g.CREATE, newVNode: e[p], anchor: c });
|
|
389
419
|
} else if (r > i)
|
|
390
420
|
for (let c = o; c <= s; c++)
|
|
391
|
-
t[c] != null && n.push({ type:
|
|
421
|
+
t[c] != null && n.push({ type: g.REMOVE, target: t[c] });
|
|
392
422
|
return n;
|
|
393
423
|
}
|
|
394
|
-
const
|
|
395
|
-
function
|
|
424
|
+
const Z = "http://www.w3.org/2000/svg";
|
|
425
|
+
function P(t, e) {
|
|
396
426
|
if (t.type === D) {
|
|
397
427
|
const o = document.createTextNode(t.props.nodeValue);
|
|
398
428
|
return t._dom = o, o;
|
|
399
429
|
}
|
|
400
|
-
if (t.type ===
|
|
430
|
+
if (t.type === mt) {
|
|
401
431
|
const o = document.createDocumentFragment();
|
|
402
432
|
for (const s of t.children)
|
|
403
|
-
o.appendChild(
|
|
433
|
+
o.appendChild(P(s, e));
|
|
404
434
|
return t._dom = o, o;
|
|
405
435
|
}
|
|
406
|
-
t.type === "svg" ? e =
|
|
436
|
+
t.type === "svg" ? e = Z : t.type === "foreignObject" && (e = void 0);
|
|
407
437
|
const n = e ? document.createElementNS(e, t.type) : document.createElement(t.type);
|
|
408
438
|
_t(n, {}, t.props);
|
|
409
439
|
for (const o of t.children)
|
|
410
|
-
n.appendChild(
|
|
440
|
+
n.appendChild(P(o, e));
|
|
411
441
|
return t._dom = n, n;
|
|
412
442
|
}
|
|
413
443
|
function _t(t, e, n) {
|
|
414
444
|
for (const o in e)
|
|
415
|
-
o === "children" || o === "key" || o in n ||
|
|
445
|
+
o === "children" || o === "key" || o in n || et(t, o, e[o]);
|
|
416
446
|
for (const o in n)
|
|
417
|
-
o === "children" || o === "key" || e[o] !== n[o] &&
|
|
447
|
+
o === "children" || o === "key" || e[o] !== n[o] && tt(t, o, n[o], e[o]);
|
|
418
448
|
}
|
|
419
|
-
function
|
|
449
|
+
function tt(t, e, n, o) {
|
|
420
450
|
if (e.startsWith("on")) {
|
|
421
451
|
const s = e.slice(2).toLowerCase();
|
|
422
452
|
o && t.removeEventListener(s, o), n && t.addEventListener(s, n);
|
|
@@ -439,7 +469,7 @@ function Z(t, e, n, o) {
|
|
|
439
469
|
}
|
|
440
470
|
else n === !0 ? t.setAttribute(e, "") : n === !1 || n == null ? t.removeAttribute(e) : t.setAttribute(e, n);
|
|
441
471
|
}
|
|
442
|
-
function
|
|
472
|
+
function et(t, e, n) {
|
|
443
473
|
if (e.startsWith("on"))
|
|
444
474
|
t.removeEventListener(e.slice(2).toLowerCase(), n);
|
|
445
475
|
else if (e === "dangerouslySetInnerHTML")
|
|
@@ -455,103 +485,103 @@ function tt(t, e, n) {
|
|
|
455
485
|
else
|
|
456
486
|
t.removeAttribute(e);
|
|
457
487
|
}
|
|
458
|
-
function
|
|
459
|
-
return t instanceof SVGElement ?
|
|
488
|
+
function W(t) {
|
|
489
|
+
return t instanceof SVGElement ? Z : void 0;
|
|
460
490
|
}
|
|
461
|
-
function
|
|
491
|
+
function V(t, e) {
|
|
462
492
|
var n, o, s;
|
|
463
493
|
for (const r of e)
|
|
464
494
|
switch (r.type) {
|
|
465
|
-
case
|
|
466
|
-
const i =
|
|
495
|
+
case g.CREATE: {
|
|
496
|
+
const i = P(r.newVNode, W(t));
|
|
467
497
|
(n = r.anchor) != null && n._dom ? t.insertBefore(i, r.anchor._dom) : t.appendChild(i);
|
|
468
498
|
break;
|
|
469
499
|
}
|
|
470
|
-
case
|
|
500
|
+
case g.REMOVE: {
|
|
471
501
|
const i = r.target._dom;
|
|
472
502
|
i != null && i.parentNode && i.parentNode.removeChild(i);
|
|
473
503
|
break;
|
|
474
504
|
}
|
|
475
|
-
case
|
|
476
|
-
const i = r.oldVNode._dom,
|
|
505
|
+
case g.REPLACE: {
|
|
506
|
+
const i = r.oldVNode._dom, l = i == null ? void 0 : i.parentNode, u = P(
|
|
477
507
|
r.newVNode,
|
|
478
|
-
|
|
508
|
+
l ? W(l) : void 0
|
|
479
509
|
);
|
|
480
|
-
|
|
510
|
+
l && l.replaceChild(u, i);
|
|
481
511
|
break;
|
|
482
512
|
}
|
|
483
|
-
case
|
|
484
|
-
const i = r.target._dom, { set:
|
|
485
|
-
for (const
|
|
486
|
-
|
|
487
|
-
for (const
|
|
488
|
-
|
|
513
|
+
case g.UPDATE: {
|
|
514
|
+
const i = r.target._dom, { set: l, remove: u } = r.propPatches;
|
|
515
|
+
for (const f of u)
|
|
516
|
+
et(i, f, r.target.props[f]);
|
|
517
|
+
for (const f in l)
|
|
518
|
+
tt(i, f, l[f], r.target.props[f]);
|
|
489
519
|
break;
|
|
490
520
|
}
|
|
491
|
-
case
|
|
521
|
+
case g.TEXT: {
|
|
492
522
|
const i = r.oldVNode._dom;
|
|
493
523
|
i && (i.nodeValue = r.newVNode.props.nodeValue);
|
|
494
524
|
break;
|
|
495
525
|
}
|
|
496
|
-
case
|
|
526
|
+
case g.MOVE: {
|
|
497
527
|
const i = r.vnode._dom;
|
|
498
|
-
i && ((o = r.anchor) != null && o._dom ? t.insertBefore(i, r.anchor._dom) : t.appendChild(i)), (s = r.childPatches) != null && s.length && i &&
|
|
528
|
+
i && ((o = r.anchor) != null && o._dom ? t.insertBefore(i, r.anchor._dom) : t.appendChild(i)), (s = r.childPatches) != null && s.length && i && V(i, r.childPatches);
|
|
499
529
|
break;
|
|
500
530
|
}
|
|
501
|
-
case
|
|
531
|
+
case g.CHILDREN: {
|
|
502
532
|
const i = r.parent._dom;
|
|
503
|
-
i && r.childPatches.length &&
|
|
533
|
+
i && r.childPatches.length && V(i, r.childPatches);
|
|
504
534
|
break;
|
|
505
535
|
}
|
|
506
536
|
}
|
|
507
537
|
}
|
|
508
|
-
const
|
|
538
|
+
const A = /* @__PURE__ */ new WeakMap();
|
|
509
539
|
function xt(t, e) {
|
|
510
|
-
const n =
|
|
540
|
+
const n = A.get(e);
|
|
511
541
|
if (n) {
|
|
512
542
|
const o = E(t, e), s = [];
|
|
513
|
-
|
|
543
|
+
O(n.vTree, s);
|
|
514
544
|
const r = x(n.vTree, o);
|
|
515
|
-
|
|
545
|
+
V(e, r);
|
|
516
546
|
const i = [];
|
|
517
|
-
o &&
|
|
518
|
-
const
|
|
519
|
-
for (const
|
|
520
|
-
|
|
521
|
-
const
|
|
522
|
-
for (const
|
|
523
|
-
|
|
524
|
-
|
|
547
|
+
o && O(o, i);
|
|
548
|
+
const l = new Set(i);
|
|
549
|
+
for (const f of s)
|
|
550
|
+
l.has(f) || f.unmount();
|
|
551
|
+
const u = new Set(s);
|
|
552
|
+
for (const f of i)
|
|
553
|
+
u.has(f) || f.mount(e, () => U(f, e));
|
|
554
|
+
A.set(e, { vTree: o });
|
|
525
555
|
} else {
|
|
526
556
|
const o = E(t, e);
|
|
527
557
|
if (!o) return;
|
|
528
|
-
const s =
|
|
558
|
+
const s = P(o);
|
|
529
559
|
e.appendChild(s);
|
|
530
560
|
const r = [];
|
|
531
|
-
|
|
561
|
+
O(o, r);
|
|
532
562
|
for (const i of r)
|
|
533
563
|
i.mount(e, () => U(i, e));
|
|
534
|
-
|
|
564
|
+
A.set(e, { vTree: o });
|
|
535
565
|
}
|
|
536
566
|
}
|
|
537
567
|
function E(t, e) {
|
|
538
568
|
var n;
|
|
539
569
|
if (t == null) return null;
|
|
540
570
|
if (typeof t.type == "function") {
|
|
541
|
-
if (t.type[
|
|
571
|
+
if (t.type[J]) {
|
|
542
572
|
const s = t.type._lifecycle;
|
|
543
573
|
try {
|
|
544
|
-
const r = new ut(t.type, t.props), i =
|
|
545
|
-
if (
|
|
546
|
-
const
|
|
574
|
+
const r = new ut(t.type, t.props), i = r.getLocalProps(), l = i ? { ...t.props, ...i } : t.props, u = t.type(l), h = E(u, e) ?? B("");
|
|
575
|
+
if (h._instance) {
|
|
576
|
+
const y = {
|
|
547
577
|
type: "div",
|
|
548
578
|
props: { style: { display: "contents" } },
|
|
549
|
-
children: [
|
|
579
|
+
children: [h],
|
|
550
580
|
key: t.key
|
|
551
581
|
};
|
|
552
|
-
return
|
|
582
|
+
return y._instance = r, r.lastVTree = y, y;
|
|
553
583
|
}
|
|
554
|
-
return
|
|
584
|
+
return h._instance = r, r.lastVTree = h, h;
|
|
555
585
|
} catch (r) {
|
|
556
586
|
if (s != null && s.onError) {
|
|
557
587
|
const i = s.onError({
|
|
@@ -573,67 +603,67 @@ function U(t, e) {
|
|
|
573
603
|
if (!t._renderCallback) return;
|
|
574
604
|
const n = t.connectedFn, o = n._lifecycle;
|
|
575
605
|
try {
|
|
576
|
-
const i =
|
|
577
|
-
let
|
|
578
|
-
if (
|
|
606
|
+
const i = t.getLocalProps(), l = i ? { ...t.props, ...i } : t.props, u = n(l), h = E(u, e) ?? B("");
|
|
607
|
+
let y;
|
|
608
|
+
if (h._instance && h._instance !== t ? (y = {
|
|
579
609
|
type: "div",
|
|
580
610
|
props: { style: { display: "contents" } },
|
|
581
|
-
children: [
|
|
611
|
+
children: [h],
|
|
582
612
|
key: null
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
const m = x(t.lastVTree,
|
|
586
|
-
|
|
613
|
+
}, y._instance = t) : (h._instance = t, y = h), t.lastVTree) {
|
|
614
|
+
j(t.lastVTree, t);
|
|
615
|
+
const m = x(t.lastVTree, y), k = ((s = t.lastVTree._dom) == null ? void 0 : s.parentNode) || e;
|
|
616
|
+
V(k, m), y._dom || (y._dom = t.lastVTree._dom);
|
|
587
617
|
}
|
|
588
|
-
const
|
|
589
|
-
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
const
|
|
593
|
-
for (const m of
|
|
594
|
-
|
|
595
|
-
t.lastVTree =
|
|
596
|
-
const
|
|
597
|
-
for (const m of
|
|
598
|
-
|
|
618
|
+
const c = [];
|
|
619
|
+
I(t.lastVTree, c, t);
|
|
620
|
+
const p = [];
|
|
621
|
+
I(y, p, t);
|
|
622
|
+
const b = new Set(p);
|
|
623
|
+
for (const m of c)
|
|
624
|
+
b.has(m) || m.unmount();
|
|
625
|
+
t.lastVTree = y;
|
|
626
|
+
const _ = new Set(c);
|
|
627
|
+
for (const m of p)
|
|
628
|
+
_.has(m) || m.mount(e, () => U(m, e));
|
|
599
629
|
o != null && o.onUpdate && o.onUpdate({
|
|
600
|
-
dom:
|
|
630
|
+
dom: y == null ? void 0 : y._dom,
|
|
601
631
|
props: t.props
|
|
602
632
|
}), t.updateSelected();
|
|
603
633
|
} catch (i) {
|
|
604
634
|
if (o != null && o.onError) {
|
|
605
|
-
const
|
|
606
|
-
if (t.lastVTree &&
|
|
607
|
-
|
|
608
|
-
const h = x(t.lastVTree,
|
|
609
|
-
|
|
635
|
+
const l = o.onError({ error: i, props: t.props }), u = E(l, e);
|
|
636
|
+
if (t.lastVTree && u) {
|
|
637
|
+
j(t.lastVTree, t);
|
|
638
|
+
const h = x(t.lastVTree, u), y = ((r = t.lastVTree._dom) == null ? void 0 : r.parentNode) || e;
|
|
639
|
+
V(y, h), u._dom || (u._dom = t.lastVTree._dom);
|
|
610
640
|
}
|
|
611
|
-
const
|
|
612
|
-
|
|
613
|
-
for (const h of
|
|
614
|
-
t.lastVTree =
|
|
641
|
+
const f = [];
|
|
642
|
+
I(t.lastVTree, f, t);
|
|
643
|
+
for (const h of f) h.unmount();
|
|
644
|
+
t.lastVTree = u, t.updateSelected();
|
|
615
645
|
} else
|
|
616
646
|
throw i;
|
|
617
647
|
}
|
|
618
648
|
}
|
|
619
|
-
function
|
|
649
|
+
function j(t, e) {
|
|
620
650
|
if (!(!t || !t.children))
|
|
621
651
|
for (let n = 0; n < t.children.length; n++) {
|
|
622
652
|
const o = t.children[n];
|
|
623
|
-
o._instance && o._instance !== e && o._instance.lastVTree && o._instance.lastVTree !== o && (t.children[n] = o._instance.lastVTree),
|
|
653
|
+
o._instance && o._instance !== e && o._instance.lastVTree && o._instance.lastVTree !== o && (t.children[n] = o._instance.lastVTree), j(t.children[n], e);
|
|
624
654
|
}
|
|
625
655
|
}
|
|
626
|
-
function
|
|
656
|
+
function O(t, e) {
|
|
627
657
|
if (t && (t._instance && e.push(t._instance), t.children))
|
|
628
658
|
for (const n of t.children)
|
|
629
|
-
|
|
659
|
+
O(n, e);
|
|
630
660
|
}
|
|
631
|
-
function
|
|
661
|
+
function I(t, e, n) {
|
|
632
662
|
if (t && (t._instance && t._instance !== n && e.push(t._instance), t.children))
|
|
633
663
|
for (const o of t.children)
|
|
634
|
-
|
|
664
|
+
I(o, e, n);
|
|
635
665
|
}
|
|
636
|
-
function
|
|
666
|
+
function X(t, e, n) {
|
|
637
667
|
const o = t.getTrackedStore(e);
|
|
638
668
|
if (!o)
|
|
639
669
|
throw new Error(`[pulse-devtools] Unknown store: "${e}"`);
|
|
@@ -654,10 +684,10 @@ function Yt(t, e, n) {
|
|
|
654
684
|
throw new Error(
|
|
655
685
|
`[pulse-devtools] Index ${n} out of range (0..${r.length - 1})`
|
|
656
686
|
);
|
|
657
|
-
const i = r.slice(n),
|
|
658
|
-
s.dispatch("__devtools_replace__",
|
|
659
|
-
for (const
|
|
660
|
-
s.dispatch(
|
|
687
|
+
const i = r.slice(n), l = r[n].prevState;
|
|
688
|
+
s.dispatch("__devtools_replace__", l);
|
|
689
|
+
for (const u of i)
|
|
690
|
+
s.dispatch(u.actionName, u.payload);
|
|
661
691
|
t.emit({
|
|
662
692
|
type: "time-travel",
|
|
663
693
|
storeName: e,
|
|
@@ -693,7 +723,7 @@ const d = {
|
|
|
693
723
|
flexDirection: "column",
|
|
694
724
|
borderTop: `2px solid ${d.mauve}`,
|
|
695
725
|
overflow: "hidden"
|
|
696
|
-
},
|
|
726
|
+
}, kt = {
|
|
697
727
|
display: "flex",
|
|
698
728
|
alignItems: "center",
|
|
699
729
|
backgroundColor: d.surface0,
|
|
@@ -701,7 +731,7 @@ const d = {
|
|
|
701
731
|
padding: "0 8px",
|
|
702
732
|
height: "32px",
|
|
703
733
|
flexShrink: "0"
|
|
704
|
-
},
|
|
734
|
+
}, Tt = (t) => ({
|
|
705
735
|
background: "none",
|
|
706
736
|
border: "none",
|
|
707
737
|
color: t ? d.mauve : d.subtext0,
|
|
@@ -728,33 +758,33 @@ const d = {
|
|
|
728
758
|
display: "flex",
|
|
729
759
|
height: "100%",
|
|
730
760
|
gap: "1px"
|
|
731
|
-
},
|
|
761
|
+
}, Pt = {
|
|
732
762
|
width: "200px",
|
|
733
763
|
flexShrink: "0",
|
|
734
764
|
borderRight: `1px solid ${d.surface1}`,
|
|
735
765
|
overflow: "auto",
|
|
736
766
|
padding: "4px 0"
|
|
737
|
-
},
|
|
767
|
+
}, Vt = {
|
|
738
768
|
flex: "1",
|
|
739
769
|
overflow: "auto",
|
|
740
770
|
padding: "8px"
|
|
741
|
-
},
|
|
771
|
+
}, vt = (t) => ({
|
|
742
772
|
padding: "4px 12px",
|
|
743
773
|
cursor: "pointer",
|
|
744
774
|
backgroundColor: t ? d.surface1 : "transparent",
|
|
745
775
|
color: t ? d.blue : d.text
|
|
746
|
-
}),
|
|
776
|
+
}), q = {
|
|
747
777
|
color: d.mauve
|
|
748
|
-
},
|
|
778
|
+
}, L = {
|
|
749
779
|
color: d.green
|
|
750
|
-
},
|
|
780
|
+
}, Lt = {
|
|
751
781
|
color: d.yellow
|
|
752
|
-
},
|
|
782
|
+
}, Ot = {
|
|
753
783
|
color: d.peach
|
|
754
|
-
},
|
|
784
|
+
}, w = {
|
|
755
785
|
color: d.overlay0,
|
|
756
786
|
fontStyle: "italic"
|
|
757
|
-
},
|
|
787
|
+
}, It = (t) => ({
|
|
758
788
|
padding: "4px 8px",
|
|
759
789
|
cursor: "pointer",
|
|
760
790
|
backgroundColor: t ? d.surface1 : "transparent",
|
|
@@ -762,17 +792,17 @@ const d = {
|
|
|
762
792
|
display: "flex",
|
|
763
793
|
justifyContent: "space-between",
|
|
764
794
|
alignItems: "center"
|
|
765
|
-
}),
|
|
795
|
+
}), nt = {
|
|
766
796
|
color: d.blue,
|
|
767
797
|
fontWeight: "bold"
|
|
768
|
-
},
|
|
798
|
+
}, $t = {
|
|
769
799
|
color: d.overlay0,
|
|
770
800
|
fontSize: "10px"
|
|
771
|
-
},
|
|
801
|
+
}, At = {
|
|
772
802
|
width: "100%",
|
|
773
803
|
accentColor: d.mauve,
|
|
774
804
|
margin: "4px 0 8px"
|
|
775
|
-
},
|
|
805
|
+
}, Mt = {
|
|
776
806
|
width: "100%",
|
|
777
807
|
backgroundColor: d.surface0,
|
|
778
808
|
border: `1px solid ${d.surface1}`,
|
|
@@ -794,7 +824,7 @@ const d = {
|
|
|
794
824
|
color: d.overlay0,
|
|
795
825
|
fontSize: "10px",
|
|
796
826
|
marginLeft: "8px"
|
|
797
|
-
},
|
|
827
|
+
}, ot = {
|
|
798
828
|
display: "inline-block",
|
|
799
829
|
backgroundColor: d.surface1,
|
|
800
830
|
color: d.subtext0,
|
|
@@ -802,92 +832,92 @@ const d = {
|
|
|
802
832
|
borderRadius: "8px",
|
|
803
833
|
fontSize: "10px",
|
|
804
834
|
marginLeft: "4px"
|
|
805
|
-
},
|
|
835
|
+
}, jt = {
|
|
806
836
|
color: d.mauve,
|
|
807
837
|
fontWeight: "bold",
|
|
808
838
|
fontSize: "12px",
|
|
809
839
|
marginRight: "8px"
|
|
810
840
|
};
|
|
811
|
-
function
|
|
841
|
+
function H(t, e) {
|
|
812
842
|
if (t === null)
|
|
813
|
-
return
|
|
843
|
+
return a("span", { style: w }, "null");
|
|
814
844
|
if (t === void 0)
|
|
815
|
-
return
|
|
845
|
+
return a("span", { style: w }, "undefined");
|
|
816
846
|
if (typeof t == "string")
|
|
817
|
-
return
|
|
847
|
+
return a("span", { style: Lt }, `"${t}"`);
|
|
818
848
|
if (typeof t == "boolean")
|
|
819
|
-
return
|
|
849
|
+
return a("span", { style: Ot }, String(t));
|
|
820
850
|
if (typeof t == "number")
|
|
821
|
-
return
|
|
851
|
+
return a("span", { style: L }, String(t));
|
|
822
852
|
if (Array.isArray(t))
|
|
823
|
-
return t.length === 0 ?
|
|
853
|
+
return t.length === 0 ? a("span", { style: L }, "[]") : e > 4 ? a("span", { style: w }, "[…]") : a(
|
|
824
854
|
"div",
|
|
825
855
|
{ style: { paddingLeft: "12px" } },
|
|
826
856
|
...t.map(
|
|
827
|
-
(n, o) =>
|
|
857
|
+
(n, o) => a(
|
|
828
858
|
"div",
|
|
829
859
|
{ key: o },
|
|
830
|
-
|
|
831
|
-
|
|
860
|
+
a("span", { style: q }, `${o}: `),
|
|
861
|
+
H(n, e + 1)
|
|
832
862
|
)
|
|
833
863
|
)
|
|
834
864
|
);
|
|
835
865
|
if (typeof t == "object") {
|
|
836
866
|
const n = Object.keys(t);
|
|
837
|
-
return n.length === 0 ?
|
|
867
|
+
return n.length === 0 ? a("span", { style: L }, "{}") : e > 4 ? a("span", { style: w }, "{…}") : a(
|
|
838
868
|
"div",
|
|
839
869
|
{ style: { paddingLeft: "12px" } },
|
|
840
870
|
...n.map(
|
|
841
|
-
(o) =>
|
|
871
|
+
(o) => a(
|
|
842
872
|
"div",
|
|
843
873
|
{ key: o },
|
|
844
|
-
|
|
845
|
-
|
|
874
|
+
a("span", { style: q }, `${o}: `),
|
|
875
|
+
H(t[o], e + 1)
|
|
846
876
|
)
|
|
847
877
|
)
|
|
848
878
|
);
|
|
849
879
|
}
|
|
850
|
-
return
|
|
880
|
+
return a("span", { style: L }, String(t));
|
|
851
881
|
}
|
|
852
|
-
function
|
|
882
|
+
function Ht({
|
|
853
883
|
storeNames: t,
|
|
854
884
|
selectedStore: e,
|
|
855
885
|
storeStates: n,
|
|
856
886
|
onSelectStore: o
|
|
857
887
|
}) {
|
|
858
888
|
const s = e ? n[e] : null;
|
|
859
|
-
return
|
|
889
|
+
return a(
|
|
860
890
|
"div",
|
|
861
891
|
{ style: Nt },
|
|
862
|
-
|
|
892
|
+
a(
|
|
863
893
|
"div",
|
|
864
|
-
{ style:
|
|
894
|
+
{ style: Pt },
|
|
865
895
|
...t.map(
|
|
866
|
-
(r) =>
|
|
896
|
+
(r) => a(
|
|
867
897
|
"div",
|
|
868
898
|
{
|
|
869
899
|
key: r,
|
|
870
|
-
style:
|
|
900
|
+
style: vt(r === e),
|
|
871
901
|
onClick: () => o(r)
|
|
872
902
|
},
|
|
873
903
|
r
|
|
874
904
|
)
|
|
875
905
|
)
|
|
876
906
|
),
|
|
877
|
-
|
|
907
|
+
a(
|
|
878
908
|
"div",
|
|
879
|
-
{ style:
|
|
880
|
-
e ?
|
|
909
|
+
{ style: Vt },
|
|
910
|
+
e ? a(
|
|
881
911
|
"div",
|
|
882
912
|
null,
|
|
883
|
-
|
|
913
|
+
a(
|
|
884
914
|
"div",
|
|
885
915
|
{ style: { marginBottom: "8px", color: d.subtext0 } },
|
|
886
916
|
"State of ",
|
|
887
|
-
|
|
917
|
+
a("span", { style: nt }, e)
|
|
888
918
|
),
|
|
889
|
-
s != null ?
|
|
890
|
-
) :
|
|
919
|
+
s != null ? H(s, 0) : a("span", { style: w }, "No state")
|
|
920
|
+
) : a("span", { style: w }, "Select a store")
|
|
891
921
|
)
|
|
892
922
|
);
|
|
893
923
|
}
|
|
@@ -904,31 +934,31 @@ function Bt({
|
|
|
904
934
|
onSliderChange: r
|
|
905
935
|
}) {
|
|
906
936
|
const i = n ? t.filter(
|
|
907
|
-
(
|
|
937
|
+
(l) => l.actionName.toLowerCase().includes(n.toLowerCase())
|
|
908
938
|
) : t;
|
|
909
|
-
return
|
|
939
|
+
return a(
|
|
910
940
|
"div",
|
|
911
941
|
{ style: { height: "100%", display: "flex", flexDirection: "column" } },
|
|
912
942
|
// Filter
|
|
913
|
-
|
|
914
|
-
style:
|
|
943
|
+
a("input", {
|
|
944
|
+
style: Mt,
|
|
915
945
|
placeholder: "Filter actions…",
|
|
916
946
|
value: n,
|
|
917
|
-
onInput: (
|
|
947
|
+
onInput: (l) => o(l.target.value)
|
|
918
948
|
}),
|
|
919
949
|
// Slider
|
|
920
|
-
t.length > 0 ?
|
|
950
|
+
t.length > 0 ? a(
|
|
921
951
|
"div",
|
|
922
952
|
{ style: { flexShrink: "0" } },
|
|
923
|
-
|
|
953
|
+
a("input", {
|
|
924
954
|
type: "range",
|
|
925
|
-
style:
|
|
955
|
+
style: At,
|
|
926
956
|
min: "0",
|
|
927
957
|
max: String(t.length - 1),
|
|
928
958
|
value: String(e),
|
|
929
|
-
onInput: (
|
|
959
|
+
onInput: (l) => r(Number(l.target.value))
|
|
930
960
|
}),
|
|
931
|
-
|
|
961
|
+
a(
|
|
932
962
|
"div",
|
|
933
963
|
{
|
|
934
964
|
style: {
|
|
@@ -941,32 +971,32 @@ function Bt({
|
|
|
941
971
|
)
|
|
942
972
|
) : null,
|
|
943
973
|
// Action list
|
|
944
|
-
|
|
974
|
+
a(
|
|
945
975
|
"div",
|
|
946
976
|
{ style: { flex: "1", overflow: "auto" } },
|
|
947
|
-
...i.map((
|
|
948
|
-
const
|
|
949
|
-
return
|
|
977
|
+
...i.map((l) => {
|
|
978
|
+
const u = t.indexOf(l);
|
|
979
|
+
return a(
|
|
950
980
|
"div",
|
|
951
981
|
{
|
|
952
|
-
key:
|
|
953
|
-
style:
|
|
954
|
-
onClick: () => s(
|
|
982
|
+
key: u,
|
|
983
|
+
style: It(u === e),
|
|
984
|
+
onClick: () => s(u)
|
|
955
985
|
},
|
|
956
|
-
|
|
986
|
+
a(
|
|
957
987
|
"span",
|
|
958
988
|
null,
|
|
959
|
-
|
|
960
|
-
|
|
989
|
+
a("span", { style: nt }, l.actionName),
|
|
990
|
+
l.payload !== void 0 ? a(
|
|
961
991
|
"span",
|
|
962
992
|
{ style: { color: d.subtext0, marginLeft: "8px" } },
|
|
963
|
-
typeof
|
|
993
|
+
typeof l.payload == "object" ? JSON.stringify(l.payload) : String(l.payload)
|
|
964
994
|
) : null
|
|
965
995
|
),
|
|
966
|
-
|
|
996
|
+
a("span", { style: $t }, Dt(l.timestamp))
|
|
967
997
|
);
|
|
968
998
|
}),
|
|
969
|
-
i.length === 0 ?
|
|
999
|
+
i.length === 0 ? a(
|
|
970
1000
|
"div",
|
|
971
1001
|
{ style: { color: d.overlay0, padding: "8px" } },
|
|
972
1002
|
t.length === 0 ? "No actions yet" : "No matching actions"
|
|
@@ -977,31 +1007,31 @@ function Bt({
|
|
|
977
1007
|
function zt({
|
|
978
1008
|
components: t
|
|
979
1009
|
}) {
|
|
980
|
-
return t.length === 0 ?
|
|
1010
|
+
return t.length === 0 ? a(
|
|
981
1011
|
"div",
|
|
982
1012
|
{ style: { color: d.overlay0, padding: "8px" } },
|
|
983
1013
|
"No connected components mounted"
|
|
984
|
-
) :
|
|
1014
|
+
) : a(
|
|
985
1015
|
"div",
|
|
986
1016
|
null,
|
|
987
1017
|
...t.map(
|
|
988
|
-
(e) =>
|
|
1018
|
+
(e) => a(
|
|
989
1019
|
"div",
|
|
990
1020
|
{ key: e.id, style: Rt },
|
|
991
|
-
|
|
992
|
-
e.storeNames.length > 0 ?
|
|
1021
|
+
a("span", { style: Ft }, e.displayName),
|
|
1022
|
+
e.storeNames.length > 0 ? a(
|
|
993
1023
|
"span",
|
|
994
1024
|
{ style: Ut },
|
|
995
1025
|
e.storeNames.map(
|
|
996
|
-
(n) =>
|
|
1026
|
+
(n) => a("span", { key: n, style: ot }, n)
|
|
997
1027
|
)
|
|
998
1028
|
) : null
|
|
999
1029
|
)
|
|
1000
1030
|
)
|
|
1001
1031
|
);
|
|
1002
1032
|
}
|
|
1003
|
-
function
|
|
1004
|
-
return
|
|
1033
|
+
function Kt() {
|
|
1034
|
+
return Q({
|
|
1005
1035
|
state: {
|
|
1006
1036
|
open: !1,
|
|
1007
1037
|
activeTab: "stores",
|
|
@@ -1028,7 +1058,7 @@ function Gt() {
|
|
|
1028
1058
|
}
|
|
1029
1059
|
});
|
|
1030
1060
|
}
|
|
1031
|
-
function
|
|
1061
|
+
function Gt({
|
|
1032
1062
|
open: t,
|
|
1033
1063
|
activeTab: e,
|
|
1034
1064
|
selectedStore: n,
|
|
@@ -1036,9 +1066,9 @@ function Kt({
|
|
|
1036
1066
|
storeNames: s,
|
|
1037
1067
|
storeStates: r,
|
|
1038
1068
|
actionLog: i,
|
|
1039
|
-
filter:
|
|
1040
|
-
components:
|
|
1041
|
-
panelActions:
|
|
1069
|
+
filter: l,
|
|
1070
|
+
components: u,
|
|
1071
|
+
panelActions: f
|
|
1042
1072
|
}) {
|
|
1043
1073
|
if (!t) return null;
|
|
1044
1074
|
const h = [
|
|
@@ -1046,75 +1076,75 @@ function Kt({
|
|
|
1046
1076
|
{ id: "actions", label: "Actions" },
|
|
1047
1077
|
{ id: "components", label: "Components" }
|
|
1048
1078
|
];
|
|
1049
|
-
let
|
|
1050
|
-
return e === "stores" ?
|
|
1079
|
+
let y;
|
|
1080
|
+
return e === "stores" ? y = Ht({
|
|
1051
1081
|
storeNames: s,
|
|
1052
1082
|
selectedStore: n,
|
|
1053
1083
|
storeStates: r,
|
|
1054
|
-
onSelectStore:
|
|
1055
|
-
}) : e === "actions" ?
|
|
1084
|
+
onSelectStore: f.selectStore
|
|
1085
|
+
}) : e === "actions" ? y = Bt({
|
|
1056
1086
|
actionLog: i,
|
|
1057
1087
|
timeTravelIndex: o,
|
|
1058
|
-
filter:
|
|
1059
|
-
onFilterChange:
|
|
1060
|
-
onTravelTo:
|
|
1061
|
-
onSliderChange:
|
|
1062
|
-
}) :
|
|
1088
|
+
filter: l,
|
|
1089
|
+
onFilterChange: f.setFilter,
|
|
1090
|
+
onTravelTo: f.travelTo,
|
|
1091
|
+
onSliderChange: f.sliderChange
|
|
1092
|
+
}) : y = zt({ components: u }), a(
|
|
1063
1093
|
"div",
|
|
1064
1094
|
{ style: Et },
|
|
1065
1095
|
// Tab bar (all children keyed to avoid mixed key warnings)
|
|
1066
|
-
|
|
1096
|
+
a(
|
|
1067
1097
|
"div",
|
|
1068
|
-
{ style:
|
|
1069
|
-
|
|
1098
|
+
{ style: kt },
|
|
1099
|
+
a("span", { key: "title", style: jt }, "Pulse"),
|
|
1070
1100
|
...h.map(
|
|
1071
|
-
(c) =>
|
|
1101
|
+
(c) => a(
|
|
1072
1102
|
"button",
|
|
1073
1103
|
{
|
|
1074
1104
|
key: c.id,
|
|
1075
|
-
style:
|
|
1076
|
-
onClick: () =>
|
|
1105
|
+
style: Tt(c.id === e),
|
|
1106
|
+
onClick: () => f.setTab(c.id)
|
|
1077
1107
|
},
|
|
1078
1108
|
c.label
|
|
1079
1109
|
)
|
|
1080
1110
|
),
|
|
1081
|
-
|
|
1111
|
+
a(
|
|
1082
1112
|
"span",
|
|
1083
|
-
{ key: "badge", style:
|
|
1113
|
+
{ key: "badge", style: ot },
|
|
1084
1114
|
`${s.length} stores`
|
|
1085
1115
|
),
|
|
1086
|
-
|
|
1116
|
+
a(
|
|
1087
1117
|
"button",
|
|
1088
1118
|
{
|
|
1089
1119
|
key: "close",
|
|
1090
1120
|
style: wt,
|
|
1091
|
-
onClick:
|
|
1121
|
+
onClick: f.close
|
|
1092
1122
|
},
|
|
1093
1123
|
"×"
|
|
1094
1124
|
)
|
|
1095
1125
|
),
|
|
1096
1126
|
// Content
|
|
1097
|
-
|
|
1127
|
+
a("div", { style: Ct }, y)
|
|
1098
1128
|
);
|
|
1099
1129
|
}
|
|
1100
1130
|
function Wt(t, e) {
|
|
1101
|
-
const n =
|
|
1131
|
+
const n = Kt();
|
|
1102
1132
|
e && e(n);
|
|
1103
1133
|
let o = !1;
|
|
1104
1134
|
function s() {
|
|
1105
1135
|
if (!o) {
|
|
1106
1136
|
o = !0;
|
|
1107
1137
|
try {
|
|
1108
|
-
const c = t.getStoreNames(),
|
|
1109
|
-
for (const
|
|
1110
|
-
|
|
1111
|
-
const
|
|
1138
|
+
const c = t.getStoreNames(), p = {};
|
|
1139
|
+
for (const k of c)
|
|
1140
|
+
p[k] = t.getStoreState(k);
|
|
1141
|
+
const _ = n.getState().selectedStore || c[0] || null, m = _ ? t.getHistory(_) : [];
|
|
1112
1142
|
n.dispatch("sync", {
|
|
1113
1143
|
storeNames: c,
|
|
1114
|
-
storeStates:
|
|
1115
|
-
actionLog:
|
|
1116
|
-
timeTravelIndex:
|
|
1117
|
-
selectedStore:
|
|
1144
|
+
storeStates: p,
|
|
1145
|
+
actionLog: m,
|
|
1146
|
+
timeTravelIndex: m.length > 0 ? m.length - 1 : -1,
|
|
1147
|
+
selectedStore: _,
|
|
1118
1148
|
components: t.getComponents()
|
|
1119
1149
|
});
|
|
1120
1150
|
} finally {
|
|
@@ -1128,22 +1158,22 @@ function Wt(t, e) {
|
|
|
1128
1158
|
const r = {
|
|
1129
1159
|
selectStore: (c) => {
|
|
1130
1160
|
n.dispatch("selectStore", c);
|
|
1131
|
-
const
|
|
1161
|
+
const p = t.getHistory(c);
|
|
1132
1162
|
n.dispatch("sync", {
|
|
1133
|
-
actionLog:
|
|
1134
|
-
timeTravelIndex:
|
|
1163
|
+
actionLog: p,
|
|
1164
|
+
timeTravelIndex: p.length > 0 ? p.length - 1 : -1
|
|
1135
1165
|
});
|
|
1136
1166
|
},
|
|
1137
1167
|
setTab: (c) => n.dispatch("setTab", c),
|
|
1138
1168
|
setFilter: (c) => n.dispatch("setFilter", c),
|
|
1139
1169
|
close: () => n.dispatch("close"),
|
|
1140
1170
|
travelTo: (c) => {
|
|
1141
|
-
const
|
|
1142
|
-
|
|
1171
|
+
const p = n.getState().selectedStore;
|
|
1172
|
+
p && (X(t, p, c), n.dispatch("setTimeTravelIndex", c));
|
|
1143
1173
|
},
|
|
1144
1174
|
sliderChange: (c) => {
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1175
|
+
const p = n.getState().selectedStore;
|
|
1176
|
+
p && (X(t, p, c), n.dispatch("setTimeTravelIndex", c));
|
|
1147
1177
|
}
|
|
1148
1178
|
}, i = pt({
|
|
1149
1179
|
open: n.select((c) => c.open),
|
|
@@ -1155,64 +1185,64 @@ function Wt(t, e) {
|
|
|
1155
1185
|
actionLog: n.select((c) => c.actionLog),
|
|
1156
1186
|
filter: n.select((c) => c.filter),
|
|
1157
1187
|
components: n.select((c) => c.components)
|
|
1158
|
-
})((c) =>
|
|
1159
|
-
let
|
|
1160
|
-
function
|
|
1161
|
-
|
|
1188
|
+
})((c) => Gt({ ...c, panelActions: r }));
|
|
1189
|
+
let l = null;
|
|
1190
|
+
function u() {
|
|
1191
|
+
l || (l = document.createElement("div"), l.id = "pulse-devtools-root", document.body.appendChild(l), xt(a(i, null), l), s());
|
|
1162
1192
|
}
|
|
1163
|
-
function
|
|
1164
|
-
|
|
1193
|
+
function f() {
|
|
1194
|
+
u(), n.dispatch("open");
|
|
1165
1195
|
}
|
|
1166
1196
|
function h() {
|
|
1167
1197
|
n.dispatch("close");
|
|
1168
1198
|
}
|
|
1169
|
-
function
|
|
1170
|
-
|
|
1199
|
+
function y() {
|
|
1200
|
+
u(), n.dispatch("toggle");
|
|
1171
1201
|
}
|
|
1172
|
-
return { openPanel:
|
|
1202
|
+
return { openPanel: f, closePanel: h, togglePanel: y, panelStore: n };
|
|
1173
1203
|
}
|
|
1174
|
-
const
|
|
1204
|
+
const $ = new yt(), st = /* @__PURE__ */ new WeakSet();
|
|
1175
1205
|
function Xt(t) {
|
|
1176
|
-
|
|
1206
|
+
st.add(t);
|
|
1177
1207
|
}
|
|
1178
1208
|
at(
|
|
1179
1209
|
(t) => {
|
|
1180
1210
|
const e = t.connectedFn._bindings || {}, n = Object.values(e).map((i) => i.store);
|
|
1181
|
-
if (n.length > 0 && n.every((i) =>
|
|
1211
|
+
if (n.length > 0 && n.every((i) => st.has(i)))
|
|
1182
1212
|
return;
|
|
1183
|
-
const o = n.map((i) => i.name || "unnamed"), s = t.connectedFn.displayName || "Unknown", r =
|
|
1213
|
+
const o = n.map((i) => i.name || "unnamed"), s = t.connectedFn.displayName || "Unknown", r = $.trackComponent(s, o);
|
|
1184
1214
|
t._devtoolsId = r;
|
|
1185
1215
|
},
|
|
1186
1216
|
(t) => {
|
|
1187
1217
|
const e = t._devtoolsId;
|
|
1188
|
-
e != null &&
|
|
1218
|
+
e != null && $.untrackComponent(e);
|
|
1189
1219
|
}
|
|
1190
1220
|
);
|
|
1191
1221
|
let N = null;
|
|
1192
|
-
function
|
|
1193
|
-
return N || (N = Wt(
|
|
1222
|
+
function rt() {
|
|
1223
|
+
return N || (N = Wt($, Xt)), N;
|
|
1194
1224
|
}
|
|
1195
1225
|
function Zt() {
|
|
1196
|
-
|
|
1226
|
+
rt().openPanel();
|
|
1197
1227
|
}
|
|
1198
1228
|
function te() {
|
|
1199
1229
|
N && N.closePanel();
|
|
1200
1230
|
}
|
|
1201
1231
|
function qt() {
|
|
1202
|
-
|
|
1232
|
+
rt().togglePanel();
|
|
1203
1233
|
}
|
|
1204
1234
|
typeof window < "u" && (window.addEventListener("keydown", (t) => {
|
|
1205
1235
|
t.ctrlKey && t.shiftKey && t.key === "P" && (t.preventDefault(), qt());
|
|
1206
|
-
}), window.__PULSE_DEVTOOLS__ =
|
|
1236
|
+
}), window.__PULSE_DEVTOOLS__ = $);
|
|
1207
1237
|
export {
|
|
1208
|
-
|
|
1238
|
+
yt as PulseDevtools,
|
|
1209
1239
|
Xt as _markInternalStore,
|
|
1210
1240
|
te as closePanel,
|
|
1211
|
-
|
|
1241
|
+
$ as devtools,
|
|
1212
1242
|
Qt as instrumentStore,
|
|
1213
1243
|
Zt as openPanel,
|
|
1214
1244
|
Yt as replayFrom,
|
|
1215
1245
|
qt as togglePanel,
|
|
1216
|
-
|
|
1246
|
+
X as travelTo
|
|
1217
1247
|
};
|
|
1218
1248
|
//# sourceMappingURL=devtools.js.map
|