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