@manyducks.co/dolla 2.0.0-alpha.44 → 2.0.0-alpha.46
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 +28 -28
- package/dist/core/context.d.ts +6 -0
- package/dist/core/markup.d.ts +16 -5
- package/dist/core/nodes/dynamic.d.ts +2 -0
- package/dist/core/nodes/fragment.d.ts +19 -0
- package/dist/core/nodes/html.d.ts +2 -2
- package/dist/core/nodes/outlet.d.ts +6 -5
- package/dist/core/nodes/view.d.ts +8 -11
- package/dist/core/signals.d.ts +4 -2
- package/dist/core/store.d.ts +3 -3
- package/dist/core/views/default-crash-view.d.ts +1 -1
- package/dist/core/views/for.d.ts +9 -0
- package/dist/core/views/fragment.d.ts +8 -0
- package/dist/core/views/passthrough.d.ts +1 -1
- package/dist/fragment-CYt92o5I.js +8 -0
- package/dist/fragment-CYt92o5I.js.map +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +332 -323
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-dev-runtime.js +8 -8
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +10 -10
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/{markup-aCjkIk4X.js → markup-BJffA2Ls.js} +544 -501
- package/dist/markup-BJffA2Ls.js.map +1 -0
- package/dist/router/index.d.ts +0 -10
- package/dist/router/router.d.ts +0 -0
- package/dist/router/router.utils.d.ts +14 -0
- package/notes/atomic.md +74 -6
- package/package.json +2 -3
- package/dist/markup-aCjkIk4X.js.map +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var je = Object.defineProperty;
|
|
2
|
+
var ce = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var _e = (t, e, s) => e in t ? je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
6
|
+
var c = (t, e, s) => _e(t, typeof e != "symbol" ? e + "" : e, s), H = (t, e, s) => e.has(t) || ce("Cannot " + s);
|
|
7
|
+
var g = (t, e, s) => (H(t, e, "read from private field"), s ? s.call(t) : e.get(t)), E = (t, e, s) => e.has(t) ? ce("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), L = (t, e, s, n) => (H(t, e, "write to private field"), n ? n.call(t, s) : e.set(t, s), s), fe = (t, e, s) => (H(t, e, "access private method"), s);
|
|
8
8
|
var M = /* @__PURE__ */ ((t) => (t[t.Computed = 1] = "Computed", t[t.Effect = 2] = "Effect", t[t.Tracking = 4] = "Tracking", t[t.Notified = 8] = "Notified", t[t.Recursed = 16] = "Recursed", t[t.Dirty = 32] = "Dirty", t[t.PendingComputed = 64] = "PendingComputed", t[t.PendingEffect = 128] = "PendingEffect", t[t.Propagated = 224] = "Propagated", t))(M || {});
|
|
9
|
-
function
|
|
9
|
+
function be({
|
|
10
10
|
updateComputed: t,
|
|
11
11
|
notifyEffect: e
|
|
12
12
|
}) {
|
|
@@ -20,17 +20,17 @@ function ye({
|
|
|
20
20
|
* @returns The newly created link object if the two are not already linked; otherwise `undefined`.
|
|
21
21
|
*/
|
|
22
22
|
link(r, u) {
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
23
|
+
const l = u.depsTail;
|
|
24
|
+
if (l !== void 0 && l.dep === r)
|
|
25
25
|
return;
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
28
|
-
u.depsTail =
|
|
26
|
+
const d = l !== void 0 ? l.nextDep : u.deps;
|
|
27
|
+
if (d !== void 0 && d.dep === r) {
|
|
28
|
+
u.depsTail = d;
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
if (!(
|
|
33
|
-
return i(r, u,
|
|
31
|
+
const a = r.subsTail;
|
|
32
|
+
if (!(a !== void 0 && a.sub === u && p(a, u)))
|
|
33
|
+
return i(r, u, d, l);
|
|
34
34
|
},
|
|
35
35
|
/**
|
|
36
36
|
* Traverses and marks subscribers starting from the provided link.
|
|
@@ -42,26 +42,26 @@ function ye({
|
|
|
42
42
|
* @param link - The starting link from which propagation begins.
|
|
43
43
|
*/
|
|
44
44
|
propagate(r) {
|
|
45
|
-
let u = 32,
|
|
45
|
+
let u = 32, l = r, d = 0;
|
|
46
46
|
e: do {
|
|
47
|
-
const
|
|
48
|
-
if (!(
|
|
49
|
-
const
|
|
50
|
-
if (
|
|
51
|
-
|
|
47
|
+
const a = r.sub, h = a.flags;
|
|
48
|
+
if (!(h & 244) && (a.flags = h | u | 8, !0) || h & 16 && !(h & 4) && (a.flags = h & -17 | u | 8, !0) || !(h & 224) && p(r, a) && (a.flags = h | 16 | u | 8, a.subs !== void 0)) {
|
|
49
|
+
const N = a.subs;
|
|
50
|
+
if (N !== void 0) {
|
|
51
|
+
N.nextSub !== void 0 ? (N.prevSub = l, r = l = N, u = 64, ++d) : (r = N, u = h & 2 ? 128 : 64);
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
} else
|
|
56
|
-
if ((r =
|
|
57
|
-
|
|
54
|
+
h & 2 && (n !== void 0 ? n.depsTail.nextDep = a.deps : s = a, n = a);
|
|
55
|
+
} else h & (4 | u) ? !(h & u) && h & 224 && p(r, a) && (a.flags = h | u) : (a.flags = h | u | 8, (h & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = a.deps : s = a, n = a));
|
|
56
|
+
if ((r = l.nextSub) !== void 0) {
|
|
57
|
+
l = r, u = d ? 64 : 32;
|
|
58
58
|
continue;
|
|
59
59
|
}
|
|
60
|
-
for (;
|
|
61
|
-
--
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
|
|
60
|
+
for (; d; ) {
|
|
61
|
+
--d;
|
|
62
|
+
const ue = l.dep.subs;
|
|
63
|
+
if (l = ue.prevSub, ue.prevSub = void 0, (r = l.nextSub) !== void 0) {
|
|
64
|
+
l = r, u = d ? 64 : 32;
|
|
65
65
|
continue e;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
@@ -90,8 +90,8 @@ function ye({
|
|
|
90
90
|
endTracking(r) {
|
|
91
91
|
const u = r.depsTail;
|
|
92
92
|
if (u !== void 0) {
|
|
93
|
-
const
|
|
94
|
-
|
|
93
|
+
const l = u.nextDep;
|
|
94
|
+
l !== void 0 && (m(l), u.nextDep = void 0);
|
|
95
95
|
} else r.deps !== void 0 && (m(r.deps), r.deps = void 0);
|
|
96
96
|
r.flags &= -5;
|
|
97
97
|
},
|
|
@@ -120,8 +120,8 @@ function ye({
|
|
|
120
120
|
*/
|
|
121
121
|
processComputedUpdate(r, u) {
|
|
122
122
|
if ((u & 32 || (o(r.deps) || (r.flags = u & -65, !1))) && t(r)) {
|
|
123
|
-
const
|
|
124
|
-
|
|
123
|
+
const l = r.subs;
|
|
124
|
+
l !== void 0 && f(l);
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
/**
|
|
@@ -138,11 +138,11 @@ function ye({
|
|
|
138
138
|
processPendingInnerEffects(r, u) {
|
|
139
139
|
if (u & 128) {
|
|
140
140
|
r.flags = u & -129;
|
|
141
|
-
let
|
|
141
|
+
let l = r.deps;
|
|
142
142
|
do {
|
|
143
|
-
const
|
|
144
|
-
"flags" in
|
|
145
|
-
} while (
|
|
143
|
+
const d = l.dep;
|
|
144
|
+
"flags" in d && d.flags & 2 && d.flags & 224 && e(d), l = l.nextDep;
|
|
145
|
+
} while (l !== void 0);
|
|
146
146
|
}
|
|
147
147
|
},
|
|
148
148
|
/**
|
|
@@ -154,153 +154,153 @@ function ye({
|
|
|
154
154
|
*/
|
|
155
155
|
processEffectNotifications() {
|
|
156
156
|
for (; s !== void 0; ) {
|
|
157
|
-
const r = s, u = r.depsTail,
|
|
158
|
-
|
|
157
|
+
const r = s, u = r.depsTail, l = u.nextDep;
|
|
158
|
+
l !== void 0 ? (u.nextDep = void 0, s = l.sub) : (s = void 0, n = void 0), e(r) || (r.flags &= -9);
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
161
|
};
|
|
162
|
-
function i(r, u,
|
|
163
|
-
const
|
|
162
|
+
function i(r, u, l, d) {
|
|
163
|
+
const a = {
|
|
164
164
|
dep: r,
|
|
165
165
|
sub: u,
|
|
166
|
-
nextDep:
|
|
166
|
+
nextDep: l,
|
|
167
167
|
prevSub: void 0,
|
|
168
168
|
nextSub: void 0
|
|
169
169
|
};
|
|
170
|
-
if (
|
|
171
|
-
r.subs =
|
|
170
|
+
if (d === void 0 ? u.deps = a : d.nextDep = a, r.subs === void 0)
|
|
171
|
+
r.subs = a;
|
|
172
172
|
else {
|
|
173
|
-
const
|
|
174
|
-
|
|
173
|
+
const h = r.subsTail;
|
|
174
|
+
a.prevSub = h, h.nextSub = a;
|
|
175
175
|
}
|
|
176
|
-
return u.depsTail =
|
|
176
|
+
return u.depsTail = a, r.subsTail = a, a;
|
|
177
177
|
}
|
|
178
178
|
function o(r) {
|
|
179
|
-
let u = 0,
|
|
179
|
+
let u = 0, l;
|
|
180
180
|
e: do {
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
if ("flags" in
|
|
184
|
-
const
|
|
185
|
-
if ((
|
|
186
|
-
if (t(
|
|
187
|
-
const
|
|
188
|
-
|
|
181
|
+
l = !1;
|
|
182
|
+
const d = r.dep;
|
|
183
|
+
if ("flags" in d) {
|
|
184
|
+
const a = d.flags;
|
|
185
|
+
if ((a & 33) === 33) {
|
|
186
|
+
if (t(d)) {
|
|
187
|
+
const h = d.subs;
|
|
188
|
+
h.nextSub !== void 0 && f(h), l = !0;
|
|
189
189
|
}
|
|
190
|
-
} else if ((
|
|
191
|
-
const
|
|
192
|
-
|
|
190
|
+
} else if ((a & 65) === 65) {
|
|
191
|
+
const h = d.subs;
|
|
192
|
+
h.nextSub !== void 0 && (h.prevSub = r), r = d.deps, ++u;
|
|
193
193
|
continue;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
if (!
|
|
196
|
+
if (!l && r.nextDep !== void 0) {
|
|
197
197
|
r = r.nextDep;
|
|
198
198
|
continue;
|
|
199
199
|
}
|
|
200
200
|
if (u) {
|
|
201
|
-
let
|
|
201
|
+
let a = r.sub;
|
|
202
202
|
do {
|
|
203
203
|
--u;
|
|
204
|
-
const
|
|
205
|
-
if (
|
|
206
|
-
if (t(
|
|
207
|
-
(r =
|
|
204
|
+
const h = a.subs;
|
|
205
|
+
if (l) {
|
|
206
|
+
if (t(a)) {
|
|
207
|
+
(r = h.prevSub) !== void 0 ? (h.prevSub = void 0, f(a.subs), a = r.sub) : a = h.sub;
|
|
208
208
|
continue;
|
|
209
209
|
}
|
|
210
210
|
} else
|
|
211
|
-
|
|
212
|
-
if ((r =
|
|
213
|
-
if (
|
|
211
|
+
a.flags &= -65;
|
|
212
|
+
if ((r = h.prevSub) !== void 0) {
|
|
213
|
+
if (h.prevSub = void 0, r.nextDep !== void 0) {
|
|
214
214
|
r = r.nextDep;
|
|
215
215
|
continue e;
|
|
216
216
|
}
|
|
217
|
-
|
|
217
|
+
a = r.sub;
|
|
218
218
|
} else {
|
|
219
|
-
if ((r =
|
|
219
|
+
if ((r = h.nextDep) !== void 0)
|
|
220
220
|
continue e;
|
|
221
|
-
|
|
221
|
+
a = h.sub;
|
|
222
222
|
}
|
|
223
|
-
|
|
223
|
+
l = !1;
|
|
224
224
|
} while (u);
|
|
225
225
|
}
|
|
226
|
-
return
|
|
226
|
+
return l;
|
|
227
227
|
} while (!0);
|
|
228
228
|
}
|
|
229
229
|
function f(r) {
|
|
230
230
|
do {
|
|
231
|
-
const u = r.sub,
|
|
232
|
-
(
|
|
231
|
+
const u = r.sub, l = u.flags;
|
|
232
|
+
(l & 96) === 64 && (u.flags = l | 32 | 8, (l & 10) === 2 && (n !== void 0 ? n.depsTail.nextDep = u.deps : s = u, n = u)), r = r.nextSub;
|
|
233
233
|
} while (r !== void 0);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
let
|
|
235
|
+
function p(r, u) {
|
|
236
|
+
const l = u.depsTail;
|
|
237
|
+
if (l !== void 0) {
|
|
238
|
+
let d = u.deps;
|
|
239
239
|
do {
|
|
240
|
-
if (
|
|
240
|
+
if (d === r)
|
|
241
241
|
return !0;
|
|
242
|
-
if (
|
|
242
|
+
if (d === l)
|
|
243
243
|
break;
|
|
244
|
-
|
|
245
|
-
} while (
|
|
244
|
+
d = d.nextDep;
|
|
245
|
+
} while (d !== void 0);
|
|
246
246
|
}
|
|
247
247
|
return !1;
|
|
248
248
|
}
|
|
249
249
|
function m(r) {
|
|
250
250
|
do {
|
|
251
|
-
const u = r.dep,
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
r =
|
|
251
|
+
const u = r.dep, l = r.nextDep, d = r.nextSub, a = r.prevSub;
|
|
252
|
+
if (d !== void 0 ? d.prevSub = a : u.subsTail = a, a !== void 0 ? a.nextSub = d : u.subs = d, u.subs === void 0 && "deps" in u) {
|
|
253
|
+
const h = u.flags;
|
|
254
|
+
h & 32 || (u.flags = h | 32);
|
|
255
|
+
const N = u.deps;
|
|
256
|
+
if (N !== void 0) {
|
|
257
|
+
r = N, u.depsTail.nextDep = l, u.deps = void 0, u.depsTail = void 0;
|
|
258
258
|
continue;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
r =
|
|
261
|
+
r = l;
|
|
262
262
|
} while (r !== void 0);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
265
|
var {
|
|
266
|
-
link:
|
|
267
|
-
propagate:
|
|
268
|
-
updateDirtyFlag:
|
|
269
|
-
startTracking:
|
|
270
|
-
endTracking:
|
|
271
|
-
processEffectNotifications:
|
|
272
|
-
processComputedUpdate:
|
|
273
|
-
processPendingInnerEffects:
|
|
274
|
-
} =
|
|
266
|
+
link: ht,
|
|
267
|
+
propagate: pt,
|
|
268
|
+
updateDirtyFlag: qe,
|
|
269
|
+
startTracking: Ne,
|
|
270
|
+
endTracking: xe,
|
|
271
|
+
processEffectNotifications: mt,
|
|
272
|
+
processComputedUpdate: gt,
|
|
273
|
+
processPendingInnerEffects: Se
|
|
274
|
+
} = be({
|
|
275
275
|
updateComputed(t) {
|
|
276
|
-
|
|
276
|
+
Ne(t);
|
|
277
277
|
try {
|
|
278
278
|
const e = t.currentValue, s = t.getter(e);
|
|
279
279
|
return e !== s ? (t.currentValue = s, !0) : !1;
|
|
280
280
|
} finally {
|
|
281
|
-
|
|
281
|
+
xe(t);
|
|
282
282
|
}
|
|
283
283
|
},
|
|
284
284
|
notifyEffect(t) {
|
|
285
|
-
return "isScope" in t ?
|
|
285
|
+
return "isScope" in t ? Re(t) : Be(t);
|
|
286
286
|
}
|
|
287
287
|
});
|
|
288
|
-
function
|
|
289
|
-
|
|
288
|
+
function Ue(t) {
|
|
289
|
+
Ne(t);
|
|
290
290
|
try {
|
|
291
291
|
t.fn();
|
|
292
292
|
} finally {
|
|
293
|
-
|
|
293
|
+
xe(t);
|
|
294
294
|
}
|
|
295
295
|
}
|
|
296
|
-
function
|
|
296
|
+
function Be(t) {
|
|
297
297
|
const e = t.flags;
|
|
298
|
-
return e & 32 || e & 64 &&
|
|
298
|
+
return e & 32 || e & 64 && qe(t, e) ? Ue(t) : Se(t, t.flags), !0;
|
|
299
299
|
}
|
|
300
|
-
function
|
|
301
|
-
return t.flags & 128 ? (
|
|
300
|
+
function Re(t) {
|
|
301
|
+
return t.flags & 128 ? (Se(t, t.flags), !0) : !1;
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function T(t) {
|
|
304
304
|
const e = typeof t;
|
|
305
305
|
switch (e) {
|
|
306
306
|
case "undefined":
|
|
@@ -315,134 +315,140 @@ function A(t) {
|
|
|
315
315
|
return e;
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function U(t) {
|
|
319
319
|
return Array.isArray(t);
|
|
320
320
|
}
|
|
321
|
-
function
|
|
322
|
-
return
|
|
321
|
+
function Y(t, e) {
|
|
322
|
+
return U(e) && e.every((s) => t(s));
|
|
323
323
|
}
|
|
324
|
-
function
|
|
325
|
-
if (
|
|
324
|
+
function yt(t, e, s) {
|
|
325
|
+
if (Y(t, e))
|
|
326
326
|
return !0;
|
|
327
|
-
throw new TypeError(
|
|
327
|
+
throw new TypeError(W(e, s));
|
|
328
328
|
}
|
|
329
329
|
function O(t) {
|
|
330
330
|
return typeof t == "string";
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function vt(t, e) {
|
|
333
333
|
if (O(t))
|
|
334
334
|
return !0;
|
|
335
|
-
throw new TypeError(
|
|
335
|
+
throw new TypeError(W(t, e ?? "Expected a string. Got type: %t, value: %v"));
|
|
336
336
|
}
|
|
337
|
-
function
|
|
338
|
-
return
|
|
337
|
+
function k(t) {
|
|
338
|
+
return T(t) === "function";
|
|
339
339
|
}
|
|
340
|
-
function
|
|
340
|
+
function ze(t) {
|
|
341
341
|
return typeof t == "number" && !isNaN(t);
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function wt(...t) {
|
|
344
344
|
const e = t[0], s = O(t[2]) ? t[2] : `Expected instance of ${e.name}. Got type: %t, value: %v`, n = (i) => {
|
|
345
345
|
if (i instanceof e)
|
|
346
346
|
return !0;
|
|
347
|
-
throw new TypeError(
|
|
347
|
+
throw new TypeError(W(i, s));
|
|
348
348
|
};
|
|
349
349
|
return t.length < 2 ? n : n(t[1]);
|
|
350
350
|
}
|
|
351
|
-
function
|
|
352
|
-
return t != null && typeof t == "object" && !
|
|
351
|
+
function ee(t) {
|
|
352
|
+
return t != null && typeof t == "object" && !U(t);
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
if (
|
|
354
|
+
function bt(t, e) {
|
|
355
|
+
if (ee(t))
|
|
356
356
|
return !0;
|
|
357
|
-
throw new TypeError(
|
|
357
|
+
throw new TypeError(W(t, e));
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function W(t, e) {
|
|
360
360
|
var i;
|
|
361
|
-
const s =
|
|
361
|
+
const s = T(t), n = ((i = t == null ? void 0 : t.toString) == null ? void 0 : i.call(t)) || String(t);
|
|
362
362
|
return e.replaceAll("%t", s).replaceAll("%v", n);
|
|
363
363
|
}
|
|
364
|
-
let
|
|
364
|
+
let A, P = [];
|
|
365
365
|
const {
|
|
366
|
-
link:
|
|
367
|
-
propagate:
|
|
368
|
-
updateDirtyFlag:
|
|
369
|
-
startTracking:
|
|
370
|
-
endTracking:
|
|
371
|
-
processEffectNotifications:
|
|
372
|
-
processComputedUpdate:
|
|
373
|
-
processPendingInnerEffects:
|
|
374
|
-
} =
|
|
366
|
+
link: te,
|
|
367
|
+
propagate: Fe,
|
|
368
|
+
updateDirtyFlag: Ge,
|
|
369
|
+
startTracking: se,
|
|
370
|
+
endTracking: ne,
|
|
371
|
+
processEffectNotifications: We,
|
|
372
|
+
processComputedUpdate: Ze,
|
|
373
|
+
processPendingInnerEffects: He
|
|
374
|
+
} = be({
|
|
375
375
|
updateComputed(t) {
|
|
376
|
-
const e =
|
|
377
|
-
|
|
376
|
+
const e = y;
|
|
377
|
+
y = t, P.length = 0, se(t);
|
|
378
378
|
try {
|
|
379
379
|
const s = t.currentValue, n = t.getter(s);
|
|
380
380
|
return t.equals(s, n) ? !1 : (t.currentValue = n, !0);
|
|
381
381
|
} finally {
|
|
382
|
-
|
|
382
|
+
y = e, A !== void 0 && (A(P), A = void 0), ne(t);
|
|
383
383
|
}
|
|
384
384
|
},
|
|
385
385
|
notifyEffect(t) {
|
|
386
386
|
const e = t.flags;
|
|
387
|
-
return e & M.Dirty || e & M.PendingComputed &&
|
|
387
|
+
return e & M.Dirty || e & M.PendingComputed && Ge(t, e) ? Ee(t) : He(t, t.flags), !0;
|
|
388
388
|
}
|
|
389
389
|
});
|
|
390
|
-
let
|
|
391
|
-
const
|
|
392
|
-
let
|
|
393
|
-
function
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
for (let t = 0; t <
|
|
397
|
-
const e =
|
|
398
|
-
|
|
390
|
+
let y;
|
|
391
|
+
const D = [];
|
|
392
|
+
let K = !1;
|
|
393
|
+
function Ke() {
|
|
394
|
+
K || (K = !0, queueMicrotask(() => {
|
|
395
|
+
K = !1;
|
|
396
|
+
for (let t = 0; t < D.length; t++) {
|
|
397
|
+
const e = D[t], s = y;
|
|
398
|
+
y = e, P.length = 0, se(e);
|
|
399
399
|
try {
|
|
400
400
|
e.fn();
|
|
401
401
|
} finally {
|
|
402
|
-
|
|
402
|
+
y = s, ne(e), A !== void 0 && (A(P), A = void 0);
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
|
|
405
|
+
D.length = 0;
|
|
406
406
|
}));
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
408
|
+
function Ee(t) {
|
|
409
|
+
D.push(t), Ke();
|
|
410
410
|
}
|
|
411
|
-
function
|
|
412
|
-
|
|
413
|
-
|
|
411
|
+
function Xe() {
|
|
412
|
+
se(this), ne(this), queueMicrotask(() => {
|
|
413
|
+
D.splice(D.indexOf(this), 1);
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
|
-
const
|
|
417
|
-
function
|
|
418
|
-
|
|
416
|
+
const Me = [];
|
|
417
|
+
function Je() {
|
|
418
|
+
Me.push(y), y = void 0;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
420
|
+
function Qe() {
|
|
421
|
+
y = Me.pop();
|
|
422
422
|
}
|
|
423
|
-
var b, j;
|
|
424
|
-
class
|
|
423
|
+
var b, V, j;
|
|
424
|
+
class ke {
|
|
425
425
|
constructor(e, s) {
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
426
|
+
E(this, b);
|
|
427
|
+
E(this, V);
|
|
428
|
+
E(this, j);
|
|
429
|
+
L(this, b, {
|
|
430
430
|
currentValue: e,
|
|
431
431
|
subs: void 0,
|
|
432
432
|
subsTail: void 0
|
|
433
|
-
}),
|
|
433
|
+
}), L(this, V, (s == null ? void 0 : s.equals) ?? Object.is), s != null && s.name && L(this, j, s.name);
|
|
434
|
+
}
|
|
435
|
+
get name() {
|
|
436
|
+
return g(this, j) || `anonymous ${this[Symbol.toStringTag]}`;
|
|
437
|
+
}
|
|
438
|
+
get [Symbol.toStringTag]() {
|
|
439
|
+
return `Atom<${T(g(this, b).currentValue)}>`;
|
|
434
440
|
}
|
|
435
441
|
/**
|
|
436
442
|
* Returns the latest value. The signal is tracked as a dependency if called within `effect` or `compose`.
|
|
437
443
|
*/
|
|
438
444
|
get() {
|
|
439
|
-
return
|
|
445
|
+
return y !== void 0 && (te(g(this, b), y), P.push(this)), g(this, b).currentValue;
|
|
440
446
|
}
|
|
441
447
|
/**
|
|
442
448
|
* Returns the latest value. The signal is NOT tracked if called within `effect` or `compose`.
|
|
443
449
|
*/
|
|
444
450
|
peek() {
|
|
445
|
-
return
|
|
451
|
+
return g(this, b).currentValue;
|
|
446
452
|
}
|
|
447
453
|
/**
|
|
448
454
|
* Replaces the current value with `next`.
|
|
@@ -453,10 +459,10 @@ class Me {
|
|
|
453
459
|
* count.set(count.get() + 1);
|
|
454
460
|
*/
|
|
455
461
|
set(e) {
|
|
456
|
-
if (!
|
|
457
|
-
|
|
458
|
-
const s =
|
|
459
|
-
s !== void 0 && (
|
|
462
|
+
if (!g(this, V).call(this, g(this, b).currentValue, e)) {
|
|
463
|
+
g(this, b).currentValue = e;
|
|
464
|
+
const s = g(this, b).subs;
|
|
465
|
+
s !== void 0 && (Fe(s), We());
|
|
460
466
|
}
|
|
461
467
|
}
|
|
462
468
|
/**
|
|
@@ -506,15 +512,15 @@ class Me {
|
|
|
506
512
|
this.set(e);
|
|
507
513
|
}
|
|
508
514
|
}
|
|
509
|
-
b = new WeakMap(), j = new WeakMap();
|
|
510
|
-
var
|
|
511
|
-
class
|
|
515
|
+
b = new WeakMap(), V = new WeakMap(), j = new WeakMap();
|
|
516
|
+
var C, _, q, G, Le;
|
|
517
|
+
class Te {
|
|
512
518
|
constructor(e, s) {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
519
|
+
E(this, G);
|
|
520
|
+
E(this, C);
|
|
521
|
+
E(this, _);
|
|
522
|
+
E(this, q);
|
|
523
|
+
L(this, _, e), L(this, C, {
|
|
518
524
|
currentValue: void 0,
|
|
519
525
|
equals: (s == null ? void 0 : s.equals) ?? Object.is,
|
|
520
526
|
subs: void 0,
|
|
@@ -522,15 +528,21 @@ class Ee {
|
|
|
522
528
|
deps: void 0,
|
|
523
529
|
depsTail: void 0,
|
|
524
530
|
flags: M.Computed | M.Dirty,
|
|
525
|
-
getter:
|
|
526
|
-
}), s != null && s.name && (this
|
|
531
|
+
getter: fe(this, G, Le).bind(this)
|
|
532
|
+
}), s != null && s.name && L(this, q, s.name);
|
|
533
|
+
}
|
|
534
|
+
get name() {
|
|
535
|
+
return g(this, q) || `anonymous ${this[Symbol.toStringTag]}`;
|
|
536
|
+
}
|
|
537
|
+
get [Symbol.toStringTag]() {
|
|
538
|
+
return `Composed<${T(g(this, C).currentValue)}>`;
|
|
527
539
|
}
|
|
528
540
|
get() {
|
|
529
|
-
return
|
|
541
|
+
return y !== void 0 && (te(g(this, C), y), P.push(this)), this.peek();
|
|
530
542
|
}
|
|
531
543
|
peek() {
|
|
532
|
-
const e =
|
|
533
|
-
return s & (M.Dirty | M.PendingComputed) &&
|
|
544
|
+
const e = g(this, C), s = e.flags;
|
|
545
|
+
return s & (M.Dirty | M.PendingComputed) && Ze(e, s), e.currentValue;
|
|
534
546
|
}
|
|
535
547
|
/**
|
|
536
548
|
* @deprecated use `get()`
|
|
@@ -539,41 +551,41 @@ class Ee {
|
|
|
539
551
|
return this.peek();
|
|
540
552
|
}
|
|
541
553
|
}
|
|
542
|
-
|
|
543
|
-
let s =
|
|
544
|
-
return
|
|
554
|
+
C = new WeakMap(), _ = new WeakMap(), q = new WeakMap(), G = new WeakSet(), Le = function(e) {
|
|
555
|
+
let s = g(this, _).call(this, e);
|
|
556
|
+
return v(s) && (s = s.get()), s;
|
|
545
557
|
};
|
|
546
|
-
function
|
|
547
|
-
return t instanceof
|
|
558
|
+
function v(t) {
|
|
559
|
+
return t instanceof ke || t instanceof Te;
|
|
548
560
|
}
|
|
549
|
-
function
|
|
550
|
-
return new
|
|
561
|
+
function Q(t, e) {
|
|
562
|
+
return new ke(t, e);
|
|
551
563
|
}
|
|
552
|
-
function
|
|
553
|
-
return new
|
|
564
|
+
function ie(t, e) {
|
|
565
|
+
return new Te(t, e);
|
|
554
566
|
}
|
|
555
|
-
function
|
|
556
|
-
if (
|
|
567
|
+
function Ye(t, e) {
|
|
568
|
+
if (k(e))
|
|
557
569
|
t.update(e);
|
|
558
570
|
else if (arguments.length > 1)
|
|
559
571
|
t.set(e);
|
|
560
572
|
else
|
|
561
|
-
return (s) =>
|
|
573
|
+
return (s) => Ye(t, s);
|
|
562
574
|
}
|
|
563
575
|
function I(t) {
|
|
564
|
-
return
|
|
576
|
+
return v(t) ? t.get() : t;
|
|
565
577
|
}
|
|
566
|
-
function
|
|
567
|
-
return
|
|
578
|
+
function Nt(t) {
|
|
579
|
+
return v(t) ? t.peek() : t;
|
|
568
580
|
}
|
|
569
|
-
function
|
|
570
|
-
|
|
581
|
+
function Z(t) {
|
|
582
|
+
Je(), t(), Qe();
|
|
571
583
|
}
|
|
572
|
-
function
|
|
573
|
-
|
|
584
|
+
function xt(t) {
|
|
585
|
+
A = t;
|
|
574
586
|
}
|
|
575
|
-
function
|
|
576
|
-
const
|
|
587
|
+
function w(t, e) {
|
|
588
|
+
const s = {
|
|
577
589
|
fn: t,
|
|
578
590
|
subs: void 0,
|
|
579
591
|
subsTail: void 0,
|
|
@@ -581,21 +593,21 @@ function v(t) {
|
|
|
581
593
|
depsTail: void 0,
|
|
582
594
|
flags: M.Effect
|
|
583
595
|
};
|
|
584
|
-
return
|
|
596
|
+
return y !== void 0 && te(s, y), Ee(s), Xe.bind(s);
|
|
585
597
|
}
|
|
586
|
-
const
|
|
598
|
+
const St = () => {
|
|
587
599
|
};
|
|
588
|
-
let
|
|
589
|
-
function
|
|
590
|
-
return
|
|
600
|
+
let X = 1;
|
|
601
|
+
function Ce() {
|
|
602
|
+
return X = X % Number.MAX_SAFE_INTEGER + 1, X.toString(36) + Date.now().toString(36);
|
|
591
603
|
}
|
|
592
|
-
function
|
|
604
|
+
function Et(t, e) {
|
|
593
605
|
return Object.is(t, e);
|
|
594
606
|
}
|
|
595
|
-
function
|
|
607
|
+
function Mt(t, e) {
|
|
596
608
|
if (Object.is(t, e)) return !0;
|
|
597
|
-
const s =
|
|
598
|
-
if (s !==
|
|
609
|
+
const s = T(t);
|
|
610
|
+
if (s !== T(e))
|
|
599
611
|
return !1;
|
|
600
612
|
switch (s) {
|
|
601
613
|
case "object":
|
|
@@ -616,7 +628,7 @@ function Nt(t, e) {
|
|
|
616
628
|
if (t[i] !== e[i]) return !1;
|
|
617
629
|
return !0;
|
|
618
630
|
case "set":
|
|
619
|
-
if (
|
|
631
|
+
if (k(t.symmetricDifference))
|
|
620
632
|
return t.symmetricDifference(e).size === 0;
|
|
621
633
|
for (const i of t.keys())
|
|
622
634
|
if (t[i] !== e.get(i)) return !1;
|
|
@@ -624,20 +636,20 @@ function Nt(t, e) {
|
|
|
624
636
|
}
|
|
625
637
|
return !1;
|
|
626
638
|
}
|
|
627
|
-
function
|
|
639
|
+
function J(t, e) {
|
|
628
640
|
if (t === e) return !0;
|
|
629
641
|
if (t && e && typeof t == "object" && typeof e == "object") {
|
|
630
642
|
if (t.constructor !== e.constructor) return !1;
|
|
631
643
|
var s, n, i;
|
|
632
644
|
if (Array.isArray(t)) {
|
|
633
645
|
if (s = t.length, s != e.length) return !1;
|
|
634
|
-
for (n = s; n-- !== 0; ) if (!
|
|
646
|
+
for (n = s; n-- !== 0; ) if (!J(t[n], e[n])) return !1;
|
|
635
647
|
return !0;
|
|
636
648
|
}
|
|
637
649
|
if (t instanceof Map && e instanceof Map) {
|
|
638
650
|
if (t.size !== e.size) return !1;
|
|
639
651
|
for (n of t.entries()) if (!e.has(n[0])) return !1;
|
|
640
|
-
for (n of t.entries()) if (!
|
|
652
|
+
for (n of t.entries()) if (!J(n[1], e.get(n[0]))) return !1;
|
|
641
653
|
return !0;
|
|
642
654
|
}
|
|
643
655
|
if (t instanceof Set && e instanceof Set) {
|
|
@@ -657,25 +669,25 @@ function H(t, e) {
|
|
|
657
669
|
for (n = s; n-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(e, i[n])) return !1;
|
|
658
670
|
for (n = s; n-- !== 0; ) {
|
|
659
671
|
var o = i[n];
|
|
660
|
-
if (!
|
|
672
|
+
if (!J(t[o], e[o])) return !1;
|
|
661
673
|
}
|
|
662
674
|
return !0;
|
|
663
675
|
}
|
|
664
676
|
return t !== t && e !== e;
|
|
665
677
|
}
|
|
666
|
-
function
|
|
678
|
+
function et(t, e) {
|
|
667
679
|
const s = {};
|
|
668
680
|
for (const n in e)
|
|
669
681
|
t.includes(n) || (s[n] = e[n]);
|
|
670
682
|
return s;
|
|
671
683
|
}
|
|
672
|
-
function
|
|
684
|
+
function kt(t) {
|
|
673
685
|
let e = 0;
|
|
674
686
|
for (let s = 0; s < t.length; s++)
|
|
675
687
|
e = (e + t.charCodeAt(s) * 10) % 360;
|
|
676
688
|
return `oklch(0.68 0.15 ${e}deg)`;
|
|
677
689
|
}
|
|
678
|
-
function
|
|
690
|
+
function Tt(t) {
|
|
679
691
|
if (t instanceof RegExp)
|
|
680
692
|
return (n) => t.test(n);
|
|
681
693
|
const e = {
|
|
@@ -697,26 +709,13 @@ function Mt(t) {
|
|
|
697
709
|
return !(o.some((f) => f(n)) || i.length > 0 && !i.some((f) => f(n)));
|
|
698
710
|
};
|
|
699
711
|
}
|
|
700
|
-
const
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
function Je(t) {
|
|
705
|
-
for (var e, s, n = arguments, i = 1, o = "", f = "", a = [0], m = function(c) {
|
|
706
|
-
i === 1 && (c || (o = o.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? a.push(c ? n[c] : o) : i === 3 && (c || o) ? (a[1] = c ? n[c] : o, i = 2) : i === 2 && o === "..." && c ? a[2] = Object.assign(a[2] || {}, n[c]) : i === 2 && o && !c ? (a[2] = a[2] || {})[o] = !0 : i >= 5 && (i === 5 ? ((a[2] = a[2] || {})[s] = c ? o ? o + n[c] : n[c] : o, i = 6) : (c || o) && (a[2][s] += c ? o + n[c] : o)), o = "";
|
|
707
|
-
}, r = 0; r < t.length; r++) {
|
|
708
|
-
r && (i === 1 && m(), m(r));
|
|
709
|
-
for (var u = 0; u < t[r].length; u++) e = t[r][u], i === 1 ? e === "<" ? (m(), a = [a, "", null], i = 3) : o += e : i === 4 ? o === "--" && e === ">" ? (i = 1, o = "") : o = e + o[0] : f ? e === f ? f = "" : o += e : e === '"' || e === "'" ? f = e : e === ">" ? (m(), i = 1) : i && (e === "=" ? (i = 5, s = o, o = "") : e === "/" && (i < 5 || t[r][u + 1] === ">") ? (m(), i === 3 && (a = a[0]), i = a, (a = a[0]).push(this.apply(null, i.slice(1))), i = 0) : e === " " || e === " " || e === `
|
|
710
|
-
` || e === "\r" ? (m(), i = 2) : o += e), i === 3 && o === "!--" && (i = 4, a = a[0]);
|
|
711
|
-
}
|
|
712
|
-
return m(), a.length > 2 ? a.slice(1) : a[1];
|
|
713
|
-
}
|
|
714
|
-
var le;
|
|
715
|
-
le = k;
|
|
716
|
-
class ce {
|
|
712
|
+
const S = Symbol.for("DollaMarkupElement"), Lt = Symbol.for("DollaRouter");
|
|
713
|
+
var de;
|
|
714
|
+
de = S;
|
|
715
|
+
class le {
|
|
717
716
|
constructor(e) {
|
|
718
|
-
|
|
719
|
-
|
|
717
|
+
c(this, de, !0);
|
|
718
|
+
c(this, "domNode");
|
|
720
719
|
this.domNode = e;
|
|
721
720
|
}
|
|
722
721
|
get isMounted() {
|
|
@@ -729,30 +728,30 @@ class ce {
|
|
|
729
728
|
this.domNode.parentNode && !e && this.domNode.parentNode.removeChild(this.domNode);
|
|
730
729
|
}
|
|
731
730
|
}
|
|
732
|
-
var
|
|
733
|
-
|
|
734
|
-
class
|
|
731
|
+
var he;
|
|
732
|
+
he = S;
|
|
733
|
+
class tt {
|
|
735
734
|
constructor(e) {
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
735
|
+
c(this, he, !0);
|
|
736
|
+
c(this, "domNode", document.createTextNode(""));
|
|
737
|
+
c(this, "children", []);
|
|
738
|
+
c(this, "elementContext");
|
|
739
|
+
c(this, "source");
|
|
740
|
+
c(this, "unsubscribe");
|
|
742
741
|
this.source = e.source, this.elementContext = e.elementContext;
|
|
743
742
|
}
|
|
744
743
|
get isMounted() {
|
|
745
744
|
return this.domNode.parentNode != null;
|
|
746
745
|
}
|
|
747
746
|
mount(e, s) {
|
|
748
|
-
this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe =
|
|
747
|
+
this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = w(() => {
|
|
749
748
|
const n = this.source.get();
|
|
750
|
-
if (!
|
|
749
|
+
if (!Ve(n))
|
|
751
750
|
throw console.error(n), new TypeError(
|
|
752
|
-
`Dynamic received invalid value to render. Got type: ${
|
|
751
|
+
`Dynamic received invalid value to render. Got type: ${T(n)}, value: ${n}`
|
|
753
752
|
);
|
|
754
|
-
|
|
755
|
-
this.update(
|
|
753
|
+
Z(() => {
|
|
754
|
+
this.update(U(n) ? n : [n]);
|
|
756
755
|
});
|
|
757
756
|
}));
|
|
758
757
|
}
|
|
@@ -766,46 +765,46 @@ class Qe {
|
|
|
766
765
|
this.children = [];
|
|
767
766
|
}
|
|
768
767
|
update(e) {
|
|
769
|
-
var o, f,
|
|
768
|
+
var o, f, p;
|
|
770
769
|
if (this.cleanup(!1), e == null || e.length === 0 || !this.isMounted)
|
|
771
770
|
return;
|
|
772
|
-
const s = e.flatMap((m) =>
|
|
771
|
+
const s = e.flatMap((m) => Pe(m) ? m : $(this.elementContext, re(m)));
|
|
773
772
|
for (const m of s) {
|
|
774
773
|
const r = ((o = this.children.at(-1)) == null ? void 0 : o.domNode) || this.domNode;
|
|
775
774
|
m.mount(this.domNode.parentNode, r), this.children.push(m);
|
|
776
775
|
}
|
|
777
|
-
const n = this.domNode.parentNode, i = ((
|
|
778
|
-
n.insertBefore(this.domNode, i);
|
|
776
|
+
const n = this.domNode.parentNode, i = ((p = (f = this.children.at(-1)) == null ? void 0 : f.domNode) == null ? void 0 : p.nextSibling) ?? null;
|
|
777
|
+
"moveBefore" in n ? n.moveBefore(this.domNode, i) : n.insertBefore(this.domNode, i);
|
|
779
778
|
}
|
|
780
779
|
}
|
|
781
|
-
const
|
|
782
|
-
var
|
|
783
|
-
|
|
784
|
-
class
|
|
780
|
+
const st = (t) => /^on[A-Z]/.test(t);
|
|
781
|
+
var pe;
|
|
782
|
+
pe = S;
|
|
783
|
+
class nt {
|
|
785
784
|
constructor({ tag: e, props: s, children: n, elementContext: i }) {
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
785
|
+
c(this, pe, !0);
|
|
786
|
+
c(this, "domNode");
|
|
787
|
+
c(this, "props");
|
|
788
|
+
c(this, "childMarkup", []);
|
|
789
|
+
c(this, "children", []);
|
|
790
|
+
c(this, "unsubscribers", []);
|
|
791
|
+
c(this, "elementContext");
|
|
793
792
|
// Track the ref so we can nullify it on unmount.
|
|
794
|
-
|
|
793
|
+
c(this, "ref");
|
|
795
794
|
// Prevents 'onClickOutside' handlers from firing in the same cycle in which the element is connected.
|
|
796
|
-
|
|
795
|
+
c(this, "canClickAway", !1);
|
|
797
796
|
if (e.toLowerCase() === "svg" && (i = {
|
|
798
797
|
...i,
|
|
799
798
|
isSVG: !0
|
|
800
799
|
}), i.isSVG ? this.domNode = document.createElementNS("http://www.w3.org/2000/svg", e) : this.domNode = document.createElement(e), i.root.getEnv() === "development" && i.viewName && (this.domNode.dataset.view = i.viewName), s.ref)
|
|
801
|
-
if (
|
|
800
|
+
if (k(s.ref))
|
|
802
801
|
this.ref = s.ref, this.ref(this.domNode);
|
|
803
802
|
else
|
|
804
803
|
throw new Error("Expected ref to be a function. Got: " + s.ref);
|
|
805
804
|
this.props = {
|
|
806
|
-
...
|
|
805
|
+
...et(["ref", "class", "className"], s),
|
|
807
806
|
class: s.className ?? s.class
|
|
808
|
-
}, n && (this.childMarkup = n), this.elementContext = i;
|
|
807
|
+
}, n && (this.childMarkup = re(n)), this.elementContext = i;
|
|
809
808
|
}
|
|
810
809
|
get isMounted() {
|
|
811
810
|
return this.domNode.parentNode != null;
|
|
@@ -814,7 +813,7 @@ class et {
|
|
|
814
813
|
if (e == null)
|
|
815
814
|
throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
|
|
816
815
|
if (!this.isMounted) {
|
|
817
|
-
this.childMarkup.length > 0 && (this.children =
|
|
816
|
+
this.childMarkup.length > 0 && (this.children = $(this.elementContext, this.childMarkup));
|
|
818
817
|
for (let n = 0; n < this.children.length; n++) {
|
|
819
818
|
const i = this.children[n], o = n > 0 ? this.children[n - 1].domNode : void 0;
|
|
820
819
|
i.mount(this.domNode, o);
|
|
@@ -838,8 +837,8 @@ class et {
|
|
|
838
837
|
}
|
|
839
838
|
}
|
|
840
839
|
attachProp(e, s) {
|
|
841
|
-
|
|
842
|
-
|
|
840
|
+
v(e) ? this.unsubscribers.push(
|
|
841
|
+
w(() => {
|
|
843
842
|
s(e.get());
|
|
844
843
|
})
|
|
845
844
|
) : s(e);
|
|
@@ -848,14 +847,14 @@ class et {
|
|
|
848
847
|
for (const n in s) {
|
|
849
848
|
const i = s[n];
|
|
850
849
|
if (n === "on:clickoutside" || n === "onClickOutside" || n === "onclickoutside") {
|
|
851
|
-
const o = (
|
|
852
|
-
this.canClickAway && !e.contains(
|
|
850
|
+
const o = (p) => {
|
|
851
|
+
this.canClickAway && !e.contains(p.target) && (v(i) ? i.peek()(p) : i(p));
|
|
853
852
|
}, f = { capture: !0 };
|
|
854
853
|
window.addEventListener("click", o, f), this.unsubscribers.push(() => {
|
|
855
854
|
window.removeEventListener("click", o, f);
|
|
856
855
|
});
|
|
857
|
-
} else if (
|
|
858
|
-
const o = n.slice(2).toLowerCase(), f =
|
|
856
|
+
} else if (st(n)) {
|
|
857
|
+
const o = n.slice(2).toLowerCase(), f = v(i) ? (p) => i.peek()(p) : i;
|
|
859
858
|
e.addEventListener(o, f), this.unsubscribers.push(() => {
|
|
860
859
|
e.removeEventListener(o, f);
|
|
861
860
|
});
|
|
@@ -863,7 +862,7 @@ class et {
|
|
|
863
862
|
this.attachProp(i, (o) => {
|
|
864
863
|
o == null ? e.removeAttribute(n) : e.setAttribute(n, String(o));
|
|
865
864
|
});
|
|
866
|
-
else if (!
|
|
865
|
+
else if (!it.includes(n))
|
|
867
866
|
if (this.elementContext.isSVG)
|
|
868
867
|
this.attachProp(i, (o) => {
|
|
869
868
|
o != null ? e.setAttribute(n, String(s[n])) : e.removeAttribute(n);
|
|
@@ -881,6 +880,10 @@ class et {
|
|
|
881
880
|
e.htmlFor = o;
|
|
882
881
|
});
|
|
883
882
|
break;
|
|
883
|
+
case "title":
|
|
884
|
+
this.attachProp(i, (o) => {
|
|
885
|
+
o == null ? e.removeAttribute(n) : e.setAttribute(n, String(o));
|
|
886
|
+
});
|
|
884
887
|
case "checked":
|
|
885
888
|
this.attachProp(i, (o) => {
|
|
886
889
|
e.checked = o, o ? e.setAttribute("checked", "") : e.removeAttribute("checked");
|
|
@@ -901,8 +904,8 @@ class et {
|
|
|
901
904
|
} else if (n.startsWith("on:")) {
|
|
902
905
|
const o = n.substring(3);
|
|
903
906
|
let f;
|
|
904
|
-
this.attachProp(i, (
|
|
905
|
-
!
|
|
907
|
+
this.attachProp(i, (p) => {
|
|
908
|
+
!p && f ? e.removeEventListener(o, f) : p != null && (f && f !== p && e.removeEventListener(o, f), e.addEventListener(o, p)), f = p;
|
|
906
909
|
});
|
|
907
910
|
} else if (n.startsWith("attr:")) {
|
|
908
911
|
const o = n.substring(5).toLowerCase();
|
|
@@ -920,22 +923,22 @@ class et {
|
|
|
920
923
|
}
|
|
921
924
|
applyStyles(e, s, n) {
|
|
922
925
|
const i = [];
|
|
923
|
-
if (
|
|
926
|
+
if (v(s)) {
|
|
924
927
|
let o;
|
|
925
|
-
const f =
|
|
926
|
-
|
|
928
|
+
const f = w(() => {
|
|
929
|
+
k(o) && o(), e.style.cssText = "", o = this.applyStyles(e, I(s), n);
|
|
927
930
|
});
|
|
928
931
|
n.push(f), i.push(f);
|
|
929
932
|
} else {
|
|
930
|
-
const o =
|
|
933
|
+
const o = De(s);
|
|
931
934
|
for (const f in o) {
|
|
932
|
-
const { value:
|
|
933
|
-
if (
|
|
934
|
-
const r =
|
|
935
|
-
|
|
935
|
+
const { value: p, priority: m } = o[f];
|
|
936
|
+
if (v(p)) {
|
|
937
|
+
const r = w(() => {
|
|
938
|
+
p.get() ? e.style.setProperty(f, String(p.get()), m) : e.style.removeProperty(f);
|
|
936
939
|
});
|
|
937
940
|
n.push(r), i.push(r);
|
|
938
|
-
} else
|
|
941
|
+
} else p != null && e.style.setProperty(f, String(p));
|
|
939
942
|
}
|
|
940
943
|
}
|
|
941
944
|
return function() {
|
|
@@ -945,22 +948,22 @@ class et {
|
|
|
945
948
|
}
|
|
946
949
|
applyClasses(e, s, n) {
|
|
947
950
|
const i = [];
|
|
948
|
-
if (
|
|
951
|
+
if (v(s)) {
|
|
949
952
|
let o;
|
|
950
|
-
const f =
|
|
951
|
-
|
|
953
|
+
const f = w(() => {
|
|
954
|
+
k(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, I(s), n);
|
|
952
955
|
});
|
|
953
956
|
n.push(f), i.push(f);
|
|
954
957
|
} else {
|
|
955
|
-
const o =
|
|
958
|
+
const o = Ae(s);
|
|
956
959
|
for (const f in o) {
|
|
957
|
-
const
|
|
958
|
-
if (
|
|
959
|
-
const m =
|
|
960
|
-
I(
|
|
960
|
+
const p = o[f];
|
|
961
|
+
if (v(p)) {
|
|
962
|
+
const m = w(() => {
|
|
963
|
+
I(p) ? e.classList.add(f) : e.classList.remove(f);
|
|
961
964
|
});
|
|
962
965
|
n.push(m), i.push(m);
|
|
963
|
-
} else
|
|
966
|
+
} else p && e.classList.add(f);
|
|
964
967
|
}
|
|
965
968
|
}
|
|
966
969
|
return function() {
|
|
@@ -969,18 +972,18 @@ class et {
|
|
|
969
972
|
};
|
|
970
973
|
}
|
|
971
974
|
}
|
|
972
|
-
function
|
|
975
|
+
function Ae(t) {
|
|
973
976
|
let e = {};
|
|
974
977
|
if (O(t)) {
|
|
975
978
|
const s = t.split(" ");
|
|
976
979
|
for (const n of s)
|
|
977
980
|
e[n] = !0;
|
|
978
|
-
} else
|
|
979
|
-
Object.assign(e,
|
|
981
|
+
} else ee(t) ? Object.assign(e, t) : Array.isArray(t) && Array.from(t).filter(Boolean).forEach((s) => {
|
|
982
|
+
Object.assign(e, Ae(s));
|
|
980
983
|
});
|
|
981
984
|
return delete e.undefined, e;
|
|
982
985
|
}
|
|
983
|
-
function
|
|
986
|
+
function De(t) {
|
|
984
987
|
let e = {};
|
|
985
988
|
if (O(t)) {
|
|
986
989
|
const s = t.split(";").filter((n) => n.trim() !== "");
|
|
@@ -988,24 +991,24 @@ function Le(t) {
|
|
|
988
991
|
const [i, o] = n.split(":"), f = {
|
|
989
992
|
value: o
|
|
990
993
|
};
|
|
991
|
-
o.includes("!important") ? (f.priority = "important", f.value = o.replace("!important", "").trim()) : f.value = o.trim(), e[
|
|
994
|
+
o.includes("!important") ? (f.priority = "important", f.value = o.replace("!important", "").trim()) : f.value = o.trim(), e[ae(i.trim())] = f;
|
|
992
995
|
}
|
|
993
996
|
}
|
|
994
|
-
if (
|
|
997
|
+
if (ee(t))
|
|
995
998
|
for (const s in t)
|
|
996
|
-
s.startsWith("--") ? e[s] = { value: t[s] } : e[
|
|
999
|
+
s.startsWith("--") ? e[s] = { value: t[s] } : e[ae(s)] = { value: t[s] };
|
|
997
1000
|
else Array.isArray(t) && Array.from(t).filter((s) => s != null).forEach((s) => {
|
|
998
|
-
Object.assign(e,
|
|
1001
|
+
Object.assign(e, De(s));
|
|
999
1002
|
});
|
|
1000
1003
|
return e;
|
|
1001
1004
|
}
|
|
1002
|
-
function
|
|
1005
|
+
function ae(t) {
|
|
1003
1006
|
return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, s) => (s ? "-" : "") + e.toLowerCase());
|
|
1004
1007
|
}
|
|
1005
|
-
const
|
|
1006
|
-
let
|
|
1008
|
+
const it = ["ref", "children", "class", "style", "data"];
|
|
1009
|
+
let rt = class {
|
|
1007
1010
|
constructor(e) {
|
|
1008
|
-
|
|
1011
|
+
c(this, "store");
|
|
1009
1012
|
this.store = e;
|
|
1010
1013
|
const s = Object.getOwnPropertyDescriptors(this.store.logger);
|
|
1011
1014
|
for (const n in s)
|
|
@@ -1021,15 +1024,15 @@ let st = class {
|
|
|
1021
1024
|
this.store.name = e, this.store.logger.setName(e);
|
|
1022
1025
|
}
|
|
1023
1026
|
get(e) {
|
|
1024
|
-
if (
|
|
1027
|
+
if (k(e)) {
|
|
1025
1028
|
let s = this.store.elementContext, n;
|
|
1026
1029
|
for (; n = s.stores.get(e), n == null && s.parent != null; )
|
|
1027
1030
|
s = s.parent;
|
|
1028
1031
|
if (n == null)
|
|
1029
|
-
throw new
|
|
1032
|
+
throw new R(`Store '${e.name}' is not provided on this context.`);
|
|
1030
1033
|
return n.value;
|
|
1031
1034
|
} else
|
|
1032
|
-
throw new
|
|
1035
|
+
throw new R("Invalid store.");
|
|
1033
1036
|
}
|
|
1034
1037
|
onMount(e) {
|
|
1035
1038
|
this.store.lifecycleListeners.mount.push(e);
|
|
@@ -1037,35 +1040,35 @@ let st = class {
|
|
|
1037
1040
|
onUnmount(e) {
|
|
1038
1041
|
this.store.lifecycleListeners.unmount.push(e);
|
|
1039
1042
|
}
|
|
1040
|
-
effect(e) {
|
|
1041
|
-
const
|
|
1042
|
-
if (
|
|
1043
|
-
const
|
|
1044
|
-
return
|
|
1043
|
+
effect(e, s) {
|
|
1044
|
+
const n = this.store;
|
|
1045
|
+
if (n.isMounted) {
|
|
1046
|
+
const i = w(e);
|
|
1047
|
+
return n.lifecycleListeners.unmount.push(i), i;
|
|
1045
1048
|
} else {
|
|
1046
|
-
let
|
|
1047
|
-
return
|
|
1048
|
-
|
|
1049
|
+
let i, o = !1;
|
|
1050
|
+
return n.lifecycleListeners.mount.push(() => {
|
|
1051
|
+
o || (i = w(e), n.lifecycleListeners.unmount.push(i));
|
|
1049
1052
|
}), () => {
|
|
1050
|
-
|
|
1053
|
+
i != null && (o = !0, i());
|
|
1051
1054
|
};
|
|
1052
1055
|
}
|
|
1053
1056
|
}
|
|
1054
1057
|
};
|
|
1055
|
-
class
|
|
1058
|
+
class ot {
|
|
1056
1059
|
constructor(e, s) {
|
|
1057
|
-
|
|
1058
|
-
|
|
1060
|
+
c(this, "fn");
|
|
1061
|
+
c(this, "_options");
|
|
1059
1062
|
/**
|
|
1060
1063
|
* Value is guaranteed to be set after `attach` is called.
|
|
1061
1064
|
*/
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1065
|
+
c(this, "value");
|
|
1066
|
+
c(this, "isMounted", !1);
|
|
1067
|
+
c(this, "elementContext");
|
|
1068
|
+
c(this, "lifecycleListeners", { mount: [], unmount: [] });
|
|
1069
|
+
c(this, "logger");
|
|
1070
|
+
c(this, "id", Ce());
|
|
1071
|
+
c(this, "name");
|
|
1069
1072
|
this.fn = e, this.name = e.name, this._options = s;
|
|
1070
1073
|
}
|
|
1071
1074
|
/**
|
|
@@ -1076,7 +1079,7 @@ class nt {
|
|
|
1076
1079
|
if (e.stores.has(this.fn))
|
|
1077
1080
|
return !1;
|
|
1078
1081
|
this.elementContext = e, this.logger = e.root.createLogger(this.name);
|
|
1079
|
-
const s = new
|
|
1082
|
+
const s = new rt(this);
|
|
1080
1083
|
try {
|
|
1081
1084
|
this.value = this.fn.call(s, this._options, s);
|
|
1082
1085
|
} catch (n) {
|
|
@@ -1097,11 +1100,11 @@ class nt {
|
|
|
1097
1100
|
this.lifecycleListeners.unmount.length = 0;
|
|
1098
1101
|
}
|
|
1099
1102
|
}
|
|
1100
|
-
class
|
|
1103
|
+
class R extends Error {
|
|
1101
1104
|
}
|
|
1102
|
-
class
|
|
1105
|
+
class ut {
|
|
1103
1106
|
constructor(e) {
|
|
1104
|
-
|
|
1107
|
+
c(this, "view");
|
|
1105
1108
|
this.view = e;
|
|
1106
1109
|
const s = Object.getOwnPropertyDescriptors(this.view.logger);
|
|
1107
1110
|
for (const n in s)
|
|
@@ -1120,7 +1123,7 @@ class it {
|
|
|
1120
1123
|
this.view.elementContext.viewName = e, this.view.logger.setName(e);
|
|
1121
1124
|
}
|
|
1122
1125
|
provide(e, s) {
|
|
1123
|
-
const n = new
|
|
1126
|
+
const n = new ot(e, s);
|
|
1124
1127
|
if (n.attach(this.view.elementContext))
|
|
1125
1128
|
return this.view.lifecycleListeners.mount.push(() => {
|
|
1126
1129
|
n.handleMount();
|
|
@@ -1133,15 +1136,15 @@ class it {
|
|
|
1133
1136
|
}
|
|
1134
1137
|
}
|
|
1135
1138
|
get(e) {
|
|
1136
|
-
if (
|
|
1139
|
+
if (k(e)) {
|
|
1137
1140
|
let s = this.view.elementContext, n;
|
|
1138
1141
|
for (; n = s.stores.get(e), n == null && s.parent != null; )
|
|
1139
1142
|
s = s.parent;
|
|
1140
1143
|
if (n == null)
|
|
1141
|
-
throw new
|
|
1144
|
+
throw new R(`Store '${e.name}' is not provided on this context.`);
|
|
1142
1145
|
return n.value;
|
|
1143
1146
|
} else
|
|
1144
|
-
throw new
|
|
1147
|
+
throw new R("Invalid store.");
|
|
1145
1148
|
}
|
|
1146
1149
|
beforeMount(e) {
|
|
1147
1150
|
this.view.lifecycleListeners.beforeMount.push(e);
|
|
@@ -1155,44 +1158,46 @@ class it {
|
|
|
1155
1158
|
onUnmount(e) {
|
|
1156
1159
|
this.view.lifecycleListeners.unmount.push(e);
|
|
1157
1160
|
}
|
|
1158
|
-
effect(e) {
|
|
1161
|
+
effect(e, s) {
|
|
1159
1162
|
if (this.view.isMounted) {
|
|
1160
|
-
const
|
|
1161
|
-
return this.view.lifecycleListeners.unmount.push(
|
|
1163
|
+
const n = w(e);
|
|
1164
|
+
return this.view.lifecycleListeners.unmount.push(n), n;
|
|
1162
1165
|
} else {
|
|
1163
|
-
let
|
|
1166
|
+
let n, i = !1;
|
|
1164
1167
|
return this.view.lifecycleListeners.mount.push(() => {
|
|
1165
|
-
|
|
1168
|
+
i || (n = w(e), this.view.lifecycleListeners.unmount.push(n));
|
|
1166
1169
|
}), () => {
|
|
1167
|
-
|
|
1170
|
+
n != null && (i = !0, n());
|
|
1168
1171
|
};
|
|
1169
1172
|
}
|
|
1170
1173
|
}
|
|
1171
1174
|
outlet() {
|
|
1172
|
-
return
|
|
1175
|
+
return x("$outlet", { view: this.view.elementContext.route });
|
|
1173
1176
|
}
|
|
1174
1177
|
}
|
|
1175
|
-
var
|
|
1176
|
-
|
|
1177
|
-
const
|
|
1178
|
-
constructor(e, s, n, i
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
l(this, "lifecycleListeners", { beforeMount: [], mount: [], beforeUnmount: [], unmount: [] });
|
|
1189
|
-
l(this, "isMounted", !1);
|
|
1178
|
+
var me;
|
|
1179
|
+
me = S;
|
|
1180
|
+
const oe = class oe {
|
|
1181
|
+
constructor(e, s, n, i) {
|
|
1182
|
+
c(this, me, !0);
|
|
1183
|
+
c(this, "uniqueId", Ce());
|
|
1184
|
+
c(this, "elementContext");
|
|
1185
|
+
c(this, "logger");
|
|
1186
|
+
c(this, "props");
|
|
1187
|
+
c(this, "fn");
|
|
1188
|
+
c(this, "element");
|
|
1189
|
+
c(this, "lifecycleListeners", { beforeMount: [], mount: [], beforeUnmount: [], unmount: [] });
|
|
1190
|
+
c(this, "isMounted", !1);
|
|
1190
1191
|
this.elementContext = {
|
|
1191
1192
|
...e,
|
|
1192
1193
|
parent: e,
|
|
1193
1194
|
viewName: s.name,
|
|
1194
|
-
stores: /* @__PURE__ */ new Map()
|
|
1195
|
-
|
|
1195
|
+
stores: /* @__PURE__ */ new Map(),
|
|
1196
|
+
route: Q()
|
|
1197
|
+
}, this.logger = e.root.createLogger(s.name || "🌇 anonymous view", { uid: this.uniqueId }), this.props = {
|
|
1198
|
+
...n,
|
|
1199
|
+
children: i
|
|
1200
|
+
}, this.fn = s;
|
|
1196
1201
|
}
|
|
1197
1202
|
/*===============================*\
|
|
1198
1203
|
|| "Public" API ||
|
|
@@ -1221,60 +1226,59 @@ const ie = class ie {
|
|
|
1221
1226
|
s();
|
|
1222
1227
|
this.lifecycleListeners.beforeMount.length = 0, this.lifecycleListeners.mount.length = 0, this.lifecycleListeners.beforeUnmount.length = 0, this.lifecycleListeners.unmount.length = 0;
|
|
1223
1228
|
}
|
|
1224
|
-
|
|
1225
|
-
this.
|
|
1226
|
-
|
|
1227
|
-
return this.children.set([s]), s;
|
|
1229
|
+
setRouteView(e) {
|
|
1230
|
+
const s = new oe(this.elementContext, e, {});
|
|
1231
|
+
return this.elementContext.route.set(s), s;
|
|
1228
1232
|
}
|
|
1229
1233
|
/*===============================*\
|
|
1230
1234
|
|| Internal ||
|
|
1231
1235
|
\*===============================*/
|
|
1232
1236
|
_initialize() {
|
|
1233
|
-
const e = new
|
|
1237
|
+
const e = new ut(this);
|
|
1234
1238
|
let s;
|
|
1235
1239
|
try {
|
|
1236
|
-
s = this.fn.call(e, this.props, e)
|
|
1240
|
+
s = this.fn.call(e, this.props, e);
|
|
1237
1241
|
} catch (n) {
|
|
1238
1242
|
throw n instanceof Error && this.logger.crash(n), n;
|
|
1239
1243
|
}
|
|
1240
1244
|
if (s !== null) if (s instanceof Node)
|
|
1241
|
-
this.element =
|
|
1242
|
-
else if (
|
|
1243
|
-
this.element =
|
|
1244
|
-
|
|
1245
|
+
this.element = B($(this.elementContext, x("$node", { value: s })));
|
|
1246
|
+
else if (v(s))
|
|
1247
|
+
this.element = B(
|
|
1248
|
+
$(this.elementContext, x("$dynamic", { source: s }))
|
|
1245
1249
|
);
|
|
1246
|
-
else if (
|
|
1247
|
-
this.element =
|
|
1250
|
+
else if (F(s) || Y(F, s))
|
|
1251
|
+
this.element = B($(this.elementContext, s));
|
|
1248
1252
|
else {
|
|
1249
1253
|
const n = new TypeError(
|
|
1250
|
-
`Expected '${this.fn.name}' function to return a DOM node, Markup element, Readable or null. Got: ${
|
|
1254
|
+
`Expected '${this.fn.name}' function to return a DOM node, Markup element, Readable or null. Got: ${T(s)}`
|
|
1251
1255
|
);
|
|
1252
1256
|
this.logger.crash(n);
|
|
1253
1257
|
}
|
|
1254
1258
|
}
|
|
1255
1259
|
};
|
|
1256
|
-
let z =
|
|
1257
|
-
var
|
|
1258
|
-
|
|
1259
|
-
class
|
|
1260
|
+
let z = oe;
|
|
1261
|
+
var ge;
|
|
1262
|
+
ge = S;
|
|
1263
|
+
class ct {
|
|
1260
1264
|
constructor({ elementContext: e, items: s, renderFn: n, keyFn: i }) {
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1265
|
+
c(this, ge, !0);
|
|
1266
|
+
c(this, "domNode", document.createTextNode(""));
|
|
1267
|
+
c(this, "items");
|
|
1268
|
+
c(this, "unsubscribe", null);
|
|
1269
|
+
c(this, "connectedItems", []);
|
|
1270
|
+
c(this, "elementContext");
|
|
1271
|
+
c(this, "renderFn");
|
|
1272
|
+
c(this, "keyFn");
|
|
1269
1273
|
this.elementContext = e, this.items = s, this.renderFn = n, this.keyFn = i;
|
|
1270
1274
|
}
|
|
1271
1275
|
get isMounted() {
|
|
1272
1276
|
return this.domNode.parentNode != null;
|
|
1273
1277
|
}
|
|
1274
1278
|
mount(e, s) {
|
|
1275
|
-
this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe =
|
|
1279
|
+
this.isMounted || (e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = w(() => {
|
|
1276
1280
|
let n = this.items.get();
|
|
1277
|
-
n == null && (n = [], console.log("list received empty value", n, this)),
|
|
1281
|
+
n == null && (n = [], console.log("list received empty value", n, this)), Z(() => {
|
|
1278
1282
|
this._update(Array.from(n));
|
|
1279
1283
|
});
|
|
1280
1284
|
}));
|
|
@@ -1289,7 +1293,7 @@ class rt {
|
|
|
1289
1293
|
this.connectedItems = [];
|
|
1290
1294
|
}
|
|
1291
1295
|
_update(e) {
|
|
1292
|
-
var f,
|
|
1296
|
+
var f, p, m;
|
|
1293
1297
|
if (e.length === 0 || !this.isMounted)
|
|
1294
1298
|
return this._cleanup(!1);
|
|
1295
1299
|
const s = [];
|
|
@@ -1302,53 +1306,53 @@ class rt {
|
|
|
1302
1306
|
});
|
|
1303
1307
|
const i = [];
|
|
1304
1308
|
for (const r of this.connectedItems)
|
|
1305
|
-
s.find((
|
|
1309
|
+
s.find((l) => l.key === r.key) || r.element.unmount(!1);
|
|
1306
1310
|
for (const r of s) {
|
|
1307
|
-
const u = this.connectedItems.find((
|
|
1311
|
+
const u = this.connectedItems.find((l) => l.key === r.key);
|
|
1308
1312
|
if (u)
|
|
1309
1313
|
u.item.set(r.value), u.index.set(r.index), i[r.index] = u;
|
|
1310
1314
|
else {
|
|
1311
|
-
const
|
|
1315
|
+
const l = Q(r.value), d = Q(r.index);
|
|
1312
1316
|
i[r.index] = {
|
|
1313
1317
|
key: r.key,
|
|
1314
|
-
item:
|
|
1315
|
-
index:
|
|
1316
|
-
element: new z(this.elementContext,
|
|
1317
|
-
item:
|
|
1318
|
-
index:
|
|
1318
|
+
item: l,
|
|
1319
|
+
index: d,
|
|
1320
|
+
element: new z(this.elementContext, ft, {
|
|
1321
|
+
item: ie(() => l.get()),
|
|
1322
|
+
index: d,
|
|
1319
1323
|
renderFn: this.renderFn
|
|
1320
1324
|
})
|
|
1321
1325
|
};
|
|
1322
1326
|
}
|
|
1323
1327
|
}
|
|
1324
1328
|
for (let r = 0; r < i.length; r++) {
|
|
1325
|
-
const u = i[r],
|
|
1326
|
-
u.element.mount(this.domNode.parentNode,
|
|
1329
|
+
const u = i[r], l = ((f = i[r - 1]) == null ? void 0 : f.element.domNode) ?? this.domNode;
|
|
1330
|
+
u.element.mount(this.domNode.parentNode, l);
|
|
1327
1331
|
}
|
|
1328
1332
|
this.connectedItems = i;
|
|
1329
|
-
const o = ((
|
|
1333
|
+
const o = ((p = i.at(-1)) == null ? void 0 : p.element.domNode) ?? this.domNode;
|
|
1330
1334
|
(m = this.domNode.parentNode) == null || m.insertBefore(this.domNode, o.nextSibling);
|
|
1331
1335
|
}
|
|
1332
1336
|
}
|
|
1333
|
-
function
|
|
1337
|
+
function ft(t, e) {
|
|
1334
1338
|
return e.name = "@ListItem", t.renderFn.call(e, t.item, t.index, e);
|
|
1335
1339
|
}
|
|
1336
|
-
var
|
|
1337
|
-
|
|
1338
|
-
class
|
|
1340
|
+
var ye;
|
|
1341
|
+
ye = S;
|
|
1342
|
+
class $e {
|
|
1339
1343
|
constructor(e) {
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1344
|
+
c(this, ye, !0);
|
|
1345
|
+
c(this, "domNode", document.createTextNode(""));
|
|
1346
|
+
c(this, "isMounted", !1);
|
|
1347
|
+
c(this, "source");
|
|
1348
|
+
c(this, "elements", []);
|
|
1349
|
+
c(this, "unsubscribe");
|
|
1346
1350
|
this.source = e;
|
|
1347
1351
|
}
|
|
1348
1352
|
mount(e, s) {
|
|
1349
|
-
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null),
|
|
1353
|
+
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), v(this.source) ? this.unsubscribe = w(() => {
|
|
1350
1354
|
const n = I(this.source);
|
|
1351
|
-
|
|
1355
|
+
Z(() => {
|
|
1352
1356
|
this.update(n);
|
|
1353
1357
|
});
|
|
1354
1358
|
}) : this.update(this.elements));
|
|
@@ -1372,13 +1376,13 @@ class Ce {
|
|
|
1372
1376
|
}
|
|
1373
1377
|
}
|
|
1374
1378
|
}
|
|
1375
|
-
var
|
|
1376
|
-
|
|
1377
|
-
class
|
|
1379
|
+
var ve;
|
|
1380
|
+
ve = S;
|
|
1381
|
+
class lt {
|
|
1378
1382
|
constructor(e) {
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1383
|
+
c(this, ve, !0);
|
|
1384
|
+
c(this, "config");
|
|
1385
|
+
c(this, "element");
|
|
1382
1386
|
this.config = e;
|
|
1383
1387
|
}
|
|
1384
1388
|
get isMounted() {
|
|
@@ -1386,65 +1390,100 @@ class ut {
|
|
|
1386
1390
|
}
|
|
1387
1391
|
mount(e, s) {
|
|
1388
1392
|
const { content: n, parent: i } = this.config;
|
|
1389
|
-
|
|
1393
|
+
Pe(n) ? this.element = n : this.element = B($(this.config.elementContext, re(n))), this.element.mount(i);
|
|
1390
1394
|
}
|
|
1391
1395
|
unmount(e = !1) {
|
|
1392
1396
|
var s;
|
|
1393
1397
|
(s = this.element) != null && s.isMounted && this.element.unmount(!1);
|
|
1394
1398
|
}
|
|
1395
1399
|
}
|
|
1396
|
-
|
|
1397
|
-
|
|
1400
|
+
var we;
|
|
1401
|
+
we = S;
|
|
1402
|
+
class at {
|
|
1403
|
+
constructor(e) {
|
|
1404
|
+
c(this, we, !0);
|
|
1405
|
+
c(this, "domNode", document.createTextNode(""));
|
|
1406
|
+
c(this, "isMounted", !1);
|
|
1407
|
+
c(this, "view");
|
|
1408
|
+
c(this, "mountedView");
|
|
1409
|
+
c(this, "unsubscribe");
|
|
1410
|
+
this.view = e;
|
|
1411
|
+
}
|
|
1412
|
+
mount(e, s) {
|
|
1413
|
+
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = w(() => {
|
|
1414
|
+
const n = this.view.get();
|
|
1415
|
+
Z(() => {
|
|
1416
|
+
this.update(n);
|
|
1417
|
+
});
|
|
1418
|
+
}));
|
|
1419
|
+
}
|
|
1420
|
+
unmount(e = !1) {
|
|
1421
|
+
this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0), this.isMounted && (this.cleanup(e), this.isMounted = !1);
|
|
1422
|
+
}
|
|
1423
|
+
cleanup(e) {
|
|
1424
|
+
this.mountedView && this.mountedView.unmount(e), this.mountedView = void 0;
|
|
1425
|
+
}
|
|
1426
|
+
update(e) {
|
|
1427
|
+
this.cleanup(!1), e && (e.mount(this.domNode.parentElement, this.domNode), this.mountedView = e);
|
|
1428
|
+
}
|
|
1398
1429
|
}
|
|
1399
|
-
function
|
|
1400
|
-
return
|
|
1430
|
+
function F(t) {
|
|
1431
|
+
return t instanceof Oe;
|
|
1401
1432
|
}
|
|
1402
|
-
function
|
|
1403
|
-
return
|
|
1433
|
+
function Pe(t) {
|
|
1434
|
+
return (t == null ? void 0 : t[S]) === !0;
|
|
1404
1435
|
}
|
|
1405
|
-
function
|
|
1406
|
-
return
|
|
1436
|
+
function re(t) {
|
|
1437
|
+
return U(t) || (t = [t]), t.flat(1 / 0).filter((e) => e != null && e !== !1).map((e) => F(e) ? e : e instanceof Node ? x("$node", { value: e }) : v(e) ? x("$dynamic", { source: e }) : x("$text", { value: e }));
|
|
1407
1438
|
}
|
|
1408
|
-
|
|
1439
|
+
function x(t, e, ...s) {
|
|
1440
|
+
return new Oe(t, e, ...s);
|
|
1441
|
+
}
|
|
1442
|
+
class Oe {
|
|
1409
1443
|
constructor(e, s, ...n) {
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
this.type = e, this.props = s, this.children =
|
|
1444
|
+
c(this, "type");
|
|
1445
|
+
c(this, "props");
|
|
1446
|
+
c(this, "children");
|
|
1447
|
+
this.type = e, this.props = s, this.children = n;
|
|
1414
1448
|
}
|
|
1415
1449
|
}
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
source: te(() => {
|
|
1450
|
+
function Ie(t, e, s) {
|
|
1451
|
+
return x("$dynamic", {
|
|
1452
|
+
source: ie(() => {
|
|
1420
1453
|
const n = I(t);
|
|
1421
1454
|
return n && e ? e : !n && s ? s : null;
|
|
1422
1455
|
})
|
|
1423
1456
|
});
|
|
1424
1457
|
}
|
|
1425
|
-
function
|
|
1426
|
-
return
|
|
1458
|
+
function At(t, e, s) {
|
|
1459
|
+
return Ie(t, e, s);
|
|
1460
|
+
}
|
|
1461
|
+
function Dt(t, e, s) {
|
|
1462
|
+
return Ie(t, s, e);
|
|
1427
1463
|
}
|
|
1428
|
-
function
|
|
1429
|
-
return
|
|
1464
|
+
function $t(t, e, s) {
|
|
1465
|
+
return x("$list", { items: ie(() => t), keyFn: e, renderFn: s });
|
|
1430
1466
|
}
|
|
1431
|
-
function
|
|
1432
|
-
return (
|
|
1433
|
-
|
|
1467
|
+
function Pt(t, e) {
|
|
1468
|
+
return x("$portal", { parent: t, content: e });
|
|
1469
|
+
}
|
|
1470
|
+
function $(t, e) {
|
|
1471
|
+
return (U(e) ? e : [e]).map((n) => {
|
|
1472
|
+
if (k(n.type))
|
|
1434
1473
|
return new z(t, n.type, n.props, n.children);
|
|
1435
1474
|
if (O(n.type))
|
|
1436
1475
|
switch (n.type) {
|
|
1437
1476
|
case "$node": {
|
|
1438
1477
|
const i = n.props;
|
|
1439
|
-
return new
|
|
1478
|
+
return new le(i.value);
|
|
1440
1479
|
}
|
|
1441
1480
|
case "$text": {
|
|
1442
1481
|
const i = n.props;
|
|
1443
|
-
return new
|
|
1482
|
+
return new le(document.createTextNode(String(i.value)));
|
|
1444
1483
|
}
|
|
1445
1484
|
case "$list": {
|
|
1446
1485
|
const i = n.props;
|
|
1447
|
-
return new
|
|
1486
|
+
return new ct({
|
|
1448
1487
|
items: i.items,
|
|
1449
1488
|
keyFn: i.keyFn,
|
|
1450
1489
|
renderFn: i.renderFn,
|
|
@@ -1453,18 +1492,22 @@ function S(t, e) {
|
|
|
1453
1492
|
}
|
|
1454
1493
|
case "$dynamic": {
|
|
1455
1494
|
const i = n.props;
|
|
1456
|
-
return new
|
|
1495
|
+
return new tt({
|
|
1457
1496
|
source: i.source,
|
|
1458
1497
|
elementContext: t
|
|
1459
1498
|
});
|
|
1460
1499
|
}
|
|
1500
|
+
case "$fragment": {
|
|
1501
|
+
const i = n.props;
|
|
1502
|
+
return new $e(i.children);
|
|
1503
|
+
}
|
|
1461
1504
|
case "$outlet": {
|
|
1462
1505
|
const i = n.props;
|
|
1463
|
-
return new
|
|
1506
|
+
return new at(i.view);
|
|
1464
1507
|
}
|
|
1465
1508
|
case "$portal": {
|
|
1466
1509
|
const i = n.props;
|
|
1467
|
-
return new
|
|
1510
|
+
return new lt({
|
|
1468
1511
|
content: i.content,
|
|
1469
1512
|
parent: i.parent,
|
|
1470
1513
|
elementContext: t
|
|
@@ -1473,7 +1516,7 @@ function S(t, e) {
|
|
|
1473
1516
|
default:
|
|
1474
1517
|
if (n.type.startsWith("$"))
|
|
1475
1518
|
throw new Error(`Unknown markup type: ${n.type}`);
|
|
1476
|
-
return new
|
|
1519
|
+
return new nt({
|
|
1477
1520
|
tag: n.type,
|
|
1478
1521
|
props: n.props ?? {},
|
|
1479
1522
|
children: n.children,
|
|
@@ -1484,46 +1527,46 @@ function S(t, e) {
|
|
|
1484
1527
|
throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
|
|
1485
1528
|
});
|
|
1486
1529
|
}
|
|
1487
|
-
function
|
|
1488
|
-
return t.length === 1 ? t[0] : new
|
|
1530
|
+
function B(t) {
|
|
1531
|
+
return t.length === 1 ? t[0] : new $e(t);
|
|
1489
1532
|
}
|
|
1490
|
-
function
|
|
1491
|
-
return t == null || t === !1 || O(t) ||
|
|
1533
|
+
function Ve(t) {
|
|
1534
|
+
return t == null || t === !1 || O(t) || ze(t) || F(t) || v(t) || Y(Ve, t);
|
|
1492
1535
|
}
|
|
1493
1536
|
export {
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1537
|
+
Et as A,
|
|
1538
|
+
$t as B,
|
|
1539
|
+
Pt as C,
|
|
1540
|
+
Dt as D,
|
|
1541
|
+
At as E,
|
|
1542
|
+
Lt as I,
|
|
1543
|
+
ot as S,
|
|
1501
1544
|
z as V,
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1545
|
+
yt as a,
|
|
1546
|
+
vt as b,
|
|
1547
|
+
Q as c,
|
|
1548
|
+
ie as d,
|
|
1549
|
+
bt as e,
|
|
1507
1550
|
O as f,
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1551
|
+
ee as g,
|
|
1552
|
+
J as h,
|
|
1553
|
+
k as i,
|
|
1511
1554
|
I as j,
|
|
1512
|
-
|
|
1555
|
+
Ie as k,
|
|
1513
1556
|
Tt as l,
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
q,
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1557
|
+
x as m,
|
|
1558
|
+
R as n,
|
|
1559
|
+
wt as o,
|
|
1560
|
+
B as p,
|
|
1561
|
+
$ as q,
|
|
1562
|
+
St as r,
|
|
1563
|
+
Mt as s,
|
|
1564
|
+
T as t,
|
|
1565
|
+
kt as u,
|
|
1566
|
+
w as v,
|
|
1567
|
+
xt as w,
|
|
1568
|
+
Nt as x,
|
|
1569
|
+
Ye as y,
|
|
1570
|
+
Z as z
|
|
1528
1571
|
};
|
|
1529
|
-
//# sourceMappingURL=markup-
|
|
1572
|
+
//# sourceMappingURL=markup-BJffA2Ls.js.map
|