@manyducks.co/dolla 2.0.0-alpha.45 → 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/dist/core/markup.d.ts +9 -0
- package/dist/core/nodes/view.d.ts +2 -5
- package/dist/core/signals.d.ts +4 -2
- package/dist/core/store.d.ts +3 -3
- package/dist/{fragment-HanpB-Z6.js → fragment-CYt92o5I.js} +2 -2
- package/dist/{fragment-HanpB-Z6.js.map → fragment-CYt92o5I.js.map} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +92 -90
- package/dist/index.js.map +1 -1
- package/dist/jsx-dev-runtime.js +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/{markup-DZcvFR50.js → markup-BJffA2Ls.js} +350 -330
- 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/package.json +1 -1
- package/dist/markup-DZcvFR50.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 c = (t, e, s) =>
|
|
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
|
}) {
|
|
@@ -59,8 +59,8 @@ function ve({
|
|
|
59
59
|
}
|
|
60
60
|
for (; d; ) {
|
|
61
61
|
--d;
|
|
62
|
-
const
|
|
63
|
-
if (l =
|
|
62
|
+
const ue = l.dep.subs;
|
|
63
|
+
if (l = ue.prevSub, ue.prevSub = void 0, (r = l.nextSub) !== void 0) {
|
|
64
64
|
l = r, u = d ? 64 : 32;
|
|
65
65
|
continue e;
|
|
66
66
|
}
|
|
@@ -263,44 +263,44 @@ function ve({
|
|
|
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 D(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, V;
|
|
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(), V = 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 Se {
|
|
|
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 Se {
|
|
|
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 xt(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 xt(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 K(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,12 +709,12 @@ 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
|
-
var
|
|
702
|
-
|
|
703
|
-
class
|
|
712
|
+
const S = Symbol.for("DollaMarkupElement"), Lt = Symbol.for("DollaRouter");
|
|
713
|
+
var de;
|
|
714
|
+
de = S;
|
|
715
|
+
class le {
|
|
704
716
|
constructor(e) {
|
|
705
|
-
c(this,
|
|
717
|
+
c(this, de, !0);
|
|
706
718
|
c(this, "domNode");
|
|
707
719
|
this.domNode = e;
|
|
708
720
|
}
|
|
@@ -716,11 +728,11 @@ class ce {
|
|
|
716
728
|
this.domNode.parentNode && !e && this.domNode.parentNode.removeChild(this.domNode);
|
|
717
729
|
}
|
|
718
730
|
}
|
|
719
|
-
var
|
|
720
|
-
|
|
721
|
-
class
|
|
731
|
+
var he;
|
|
732
|
+
he = S;
|
|
733
|
+
class tt {
|
|
722
734
|
constructor(e) {
|
|
723
|
-
c(this,
|
|
735
|
+
c(this, he, !0);
|
|
724
736
|
c(this, "domNode", document.createTextNode(""));
|
|
725
737
|
c(this, "children", []);
|
|
726
738
|
c(this, "elementContext");
|
|
@@ -732,14 +744,14 @@ class Qe {
|
|
|
732
744
|
return this.domNode.parentNode != null;
|
|
733
745
|
}
|
|
734
746
|
mount(e, s) {
|
|
735
|
-
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(() => {
|
|
736
748
|
const n = this.source.get();
|
|
737
|
-
if (!
|
|
749
|
+
if (!Ve(n))
|
|
738
750
|
throw console.error(n), new TypeError(
|
|
739
|
-
`Dynamic received invalid value to render. Got type: ${
|
|
751
|
+
`Dynamic received invalid value to render. Got type: ${T(n)}, value: ${n}`
|
|
740
752
|
);
|
|
741
|
-
|
|
742
|
-
this.update(
|
|
753
|
+
Z(() => {
|
|
754
|
+
this.update(U(n) ? n : [n]);
|
|
743
755
|
});
|
|
744
756
|
}));
|
|
745
757
|
}
|
|
@@ -756,21 +768,21 @@ class Qe {
|
|
|
756
768
|
var o, f, p;
|
|
757
769
|
if (this.cleanup(!1), e == null || e.length === 0 || !this.isMounted)
|
|
758
770
|
return;
|
|
759
|
-
const s = e.flatMap((m) =>
|
|
771
|
+
const s = e.flatMap((m) => Pe(m) ? m : $(this.elementContext, re(m)));
|
|
760
772
|
for (const m of s) {
|
|
761
773
|
const r = ((o = this.children.at(-1)) == null ? void 0 : o.domNode) || this.domNode;
|
|
762
774
|
m.mount(this.domNode.parentNode, r), this.children.push(m);
|
|
763
775
|
}
|
|
764
776
|
const n = this.domNode.parentNode, i = ((p = (f = this.children.at(-1)) == null ? void 0 : f.domNode) == null ? void 0 : p.nextSibling) ?? null;
|
|
765
|
-
n.insertBefore(this.domNode, i);
|
|
777
|
+
"moveBefore" in n ? n.moveBefore(this.domNode, i) : n.insertBefore(this.domNode, i);
|
|
766
778
|
}
|
|
767
779
|
}
|
|
768
|
-
const
|
|
769
|
-
var
|
|
770
|
-
|
|
771
|
-
class
|
|
780
|
+
const st = (t) => /^on[A-Z]/.test(t);
|
|
781
|
+
var pe;
|
|
782
|
+
pe = S;
|
|
783
|
+
class nt {
|
|
772
784
|
constructor({ tag: e, props: s, children: n, elementContext: i }) {
|
|
773
|
-
c(this,
|
|
785
|
+
c(this, pe, !0);
|
|
774
786
|
c(this, "domNode");
|
|
775
787
|
c(this, "props");
|
|
776
788
|
c(this, "childMarkup", []);
|
|
@@ -785,14 +797,14 @@ class et {
|
|
|
785
797
|
...i,
|
|
786
798
|
isSVG: !0
|
|
787
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)
|
|
788
|
-
if (
|
|
800
|
+
if (k(s.ref))
|
|
789
801
|
this.ref = s.ref, this.ref(this.domNode);
|
|
790
802
|
else
|
|
791
803
|
throw new Error("Expected ref to be a function. Got: " + s.ref);
|
|
792
804
|
this.props = {
|
|
793
|
-
...
|
|
805
|
+
...et(["ref", "class", "className"], s),
|
|
794
806
|
class: s.className ?? s.class
|
|
795
|
-
}, n && (this.childMarkup =
|
|
807
|
+
}, n && (this.childMarkup = re(n)), this.elementContext = i;
|
|
796
808
|
}
|
|
797
809
|
get isMounted() {
|
|
798
810
|
return this.domNode.parentNode != null;
|
|
@@ -801,7 +813,7 @@ class et {
|
|
|
801
813
|
if (e == null)
|
|
802
814
|
throw new Error(`HTML element requires a parent element as the first argument to connect. Got: ${e}`);
|
|
803
815
|
if (!this.isMounted) {
|
|
804
|
-
this.childMarkup.length > 0 && (this.children =
|
|
816
|
+
this.childMarkup.length > 0 && (this.children = $(this.elementContext, this.childMarkup));
|
|
805
817
|
for (let n = 0; n < this.children.length; n++) {
|
|
806
818
|
const i = this.children[n], o = n > 0 ? this.children[n - 1].domNode : void 0;
|
|
807
819
|
i.mount(this.domNode, o);
|
|
@@ -825,8 +837,8 @@ class et {
|
|
|
825
837
|
}
|
|
826
838
|
}
|
|
827
839
|
attachProp(e, s) {
|
|
828
|
-
|
|
829
|
-
|
|
840
|
+
v(e) ? this.unsubscribers.push(
|
|
841
|
+
w(() => {
|
|
830
842
|
s(e.get());
|
|
831
843
|
})
|
|
832
844
|
) : s(e);
|
|
@@ -836,13 +848,13 @@ class et {
|
|
|
836
848
|
const i = s[n];
|
|
837
849
|
if (n === "on:clickoutside" || n === "onClickOutside" || n === "onclickoutside") {
|
|
838
850
|
const o = (p) => {
|
|
839
|
-
this.canClickAway && !e.contains(p.target) && (
|
|
851
|
+
this.canClickAway && !e.contains(p.target) && (v(i) ? i.peek()(p) : i(p));
|
|
840
852
|
}, f = { capture: !0 };
|
|
841
853
|
window.addEventListener("click", o, f), this.unsubscribers.push(() => {
|
|
842
854
|
window.removeEventListener("click", o, f);
|
|
843
855
|
});
|
|
844
|
-
} else if (
|
|
845
|
-
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;
|
|
846
858
|
e.addEventListener(o, f), this.unsubscribers.push(() => {
|
|
847
859
|
e.removeEventListener(o, f);
|
|
848
860
|
});
|
|
@@ -850,7 +862,7 @@ class et {
|
|
|
850
862
|
this.attachProp(i, (o) => {
|
|
851
863
|
o == null ? e.removeAttribute(n) : e.setAttribute(n, String(o));
|
|
852
864
|
});
|
|
853
|
-
else if (!
|
|
865
|
+
else if (!it.includes(n))
|
|
854
866
|
if (this.elementContext.isSVG)
|
|
855
867
|
this.attachProp(i, (o) => {
|
|
856
868
|
o != null ? e.setAttribute(n, String(s[n])) : e.removeAttribute(n);
|
|
@@ -911,18 +923,18 @@ class et {
|
|
|
911
923
|
}
|
|
912
924
|
applyStyles(e, s, n) {
|
|
913
925
|
const i = [];
|
|
914
|
-
if (
|
|
926
|
+
if (v(s)) {
|
|
915
927
|
let o;
|
|
916
|
-
const f =
|
|
917
|
-
|
|
928
|
+
const f = w(() => {
|
|
929
|
+
k(o) && o(), e.style.cssText = "", o = this.applyStyles(e, I(s), n);
|
|
918
930
|
});
|
|
919
931
|
n.push(f), i.push(f);
|
|
920
932
|
} else {
|
|
921
|
-
const o =
|
|
933
|
+
const o = De(s);
|
|
922
934
|
for (const f in o) {
|
|
923
935
|
const { value: p, priority: m } = o[f];
|
|
924
|
-
if (
|
|
925
|
-
const r =
|
|
936
|
+
if (v(p)) {
|
|
937
|
+
const r = w(() => {
|
|
926
938
|
p.get() ? e.style.setProperty(f, String(p.get()), m) : e.style.removeProperty(f);
|
|
927
939
|
});
|
|
928
940
|
n.push(r), i.push(r);
|
|
@@ -936,18 +948,18 @@ class et {
|
|
|
936
948
|
}
|
|
937
949
|
applyClasses(e, s, n) {
|
|
938
950
|
const i = [];
|
|
939
|
-
if (
|
|
951
|
+
if (v(s)) {
|
|
940
952
|
let o;
|
|
941
|
-
const f =
|
|
942
|
-
|
|
953
|
+
const f = w(() => {
|
|
954
|
+
k(o) && o(), e.removeAttribute("class"), o = this.applyClasses(e, I(s), n);
|
|
943
955
|
});
|
|
944
956
|
n.push(f), i.push(f);
|
|
945
957
|
} else {
|
|
946
|
-
const o =
|
|
958
|
+
const o = Ae(s);
|
|
947
959
|
for (const f in o) {
|
|
948
960
|
const p = o[f];
|
|
949
|
-
if (
|
|
950
|
-
const m =
|
|
961
|
+
if (v(p)) {
|
|
962
|
+
const m = w(() => {
|
|
951
963
|
I(p) ? e.classList.add(f) : e.classList.remove(f);
|
|
952
964
|
});
|
|
953
965
|
n.push(m), i.push(m);
|
|
@@ -960,18 +972,18 @@ class et {
|
|
|
960
972
|
};
|
|
961
973
|
}
|
|
962
974
|
}
|
|
963
|
-
function
|
|
975
|
+
function Ae(t) {
|
|
964
976
|
let e = {};
|
|
965
977
|
if (O(t)) {
|
|
966
978
|
const s = t.split(" ");
|
|
967
979
|
for (const n of s)
|
|
968
980
|
e[n] = !0;
|
|
969
|
-
} else
|
|
970
|
-
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));
|
|
971
983
|
});
|
|
972
984
|
return delete e.undefined, e;
|
|
973
985
|
}
|
|
974
|
-
function
|
|
986
|
+
function De(t) {
|
|
975
987
|
let e = {};
|
|
976
988
|
if (O(t)) {
|
|
977
989
|
const s = t.split(";").filter((n) => n.trim() !== "");
|
|
@@ -979,22 +991,22 @@ function Ce(t) {
|
|
|
979
991
|
const [i, o] = n.split(":"), f = {
|
|
980
992
|
value: o
|
|
981
993
|
};
|
|
982
|
-
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;
|
|
983
995
|
}
|
|
984
996
|
}
|
|
985
|
-
if (
|
|
997
|
+
if (ee(t))
|
|
986
998
|
for (const s in t)
|
|
987
|
-
s.startsWith("--") ? e[s] = { value: t[s] } : e[
|
|
999
|
+
s.startsWith("--") ? e[s] = { value: t[s] } : e[ae(s)] = { value: t[s] };
|
|
988
1000
|
else Array.isArray(t) && Array.from(t).filter((s) => s != null).forEach((s) => {
|
|
989
|
-
Object.assign(e,
|
|
1001
|
+
Object.assign(e, De(s));
|
|
990
1002
|
});
|
|
991
1003
|
return e;
|
|
992
1004
|
}
|
|
993
|
-
function
|
|
1005
|
+
function ae(t) {
|
|
994
1006
|
return t.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, s) => (s ? "-" : "") + e.toLowerCase());
|
|
995
1007
|
}
|
|
996
|
-
const
|
|
997
|
-
let
|
|
1008
|
+
const it = ["ref", "children", "class", "style", "data"];
|
|
1009
|
+
let rt = class {
|
|
998
1010
|
constructor(e) {
|
|
999
1011
|
c(this, "store");
|
|
1000
1012
|
this.store = e;
|
|
@@ -1012,15 +1024,15 @@ let st = class {
|
|
|
1012
1024
|
this.store.name = e, this.store.logger.setName(e);
|
|
1013
1025
|
}
|
|
1014
1026
|
get(e) {
|
|
1015
|
-
if (
|
|
1027
|
+
if (k(e)) {
|
|
1016
1028
|
let s = this.store.elementContext, n;
|
|
1017
1029
|
for (; n = s.stores.get(e), n == null && s.parent != null; )
|
|
1018
1030
|
s = s.parent;
|
|
1019
1031
|
if (n == null)
|
|
1020
|
-
throw new
|
|
1032
|
+
throw new R(`Store '${e.name}' is not provided on this context.`);
|
|
1021
1033
|
return n.value;
|
|
1022
1034
|
} else
|
|
1023
|
-
throw new
|
|
1035
|
+
throw new R("Invalid store.");
|
|
1024
1036
|
}
|
|
1025
1037
|
onMount(e) {
|
|
1026
1038
|
this.store.lifecycleListeners.mount.push(e);
|
|
@@ -1028,22 +1040,22 @@ let st = class {
|
|
|
1028
1040
|
onUnmount(e) {
|
|
1029
1041
|
this.store.lifecycleListeners.unmount.push(e);
|
|
1030
1042
|
}
|
|
1031
|
-
effect(e) {
|
|
1032
|
-
const
|
|
1033
|
-
if (
|
|
1034
|
-
const
|
|
1035
|
-
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;
|
|
1036
1048
|
} else {
|
|
1037
|
-
let
|
|
1038
|
-
return
|
|
1039
|
-
|
|
1049
|
+
let i, o = !1;
|
|
1050
|
+
return n.lifecycleListeners.mount.push(() => {
|
|
1051
|
+
o || (i = w(e), n.lifecycleListeners.unmount.push(i));
|
|
1040
1052
|
}), () => {
|
|
1041
|
-
|
|
1053
|
+
i != null && (o = !0, i());
|
|
1042
1054
|
};
|
|
1043
1055
|
}
|
|
1044
1056
|
}
|
|
1045
1057
|
};
|
|
1046
|
-
class
|
|
1058
|
+
class ot {
|
|
1047
1059
|
constructor(e, s) {
|
|
1048
1060
|
c(this, "fn");
|
|
1049
1061
|
c(this, "_options");
|
|
@@ -1055,7 +1067,7 @@ class nt {
|
|
|
1055
1067
|
c(this, "elementContext");
|
|
1056
1068
|
c(this, "lifecycleListeners", { mount: [], unmount: [] });
|
|
1057
1069
|
c(this, "logger");
|
|
1058
|
-
c(this, "id",
|
|
1070
|
+
c(this, "id", Ce());
|
|
1059
1071
|
c(this, "name");
|
|
1060
1072
|
this.fn = e, this.name = e.name, this._options = s;
|
|
1061
1073
|
}
|
|
@@ -1067,7 +1079,7 @@ class nt {
|
|
|
1067
1079
|
if (e.stores.has(this.fn))
|
|
1068
1080
|
return !1;
|
|
1069
1081
|
this.elementContext = e, this.logger = e.root.createLogger(this.name);
|
|
1070
|
-
const s = new
|
|
1082
|
+
const s = new rt(this);
|
|
1071
1083
|
try {
|
|
1072
1084
|
this.value = this.fn.call(s, this._options, s);
|
|
1073
1085
|
} catch (n) {
|
|
@@ -1088,9 +1100,9 @@ class nt {
|
|
|
1088
1100
|
this.lifecycleListeners.unmount.length = 0;
|
|
1089
1101
|
}
|
|
1090
1102
|
}
|
|
1091
|
-
class
|
|
1103
|
+
class R extends Error {
|
|
1092
1104
|
}
|
|
1093
|
-
class
|
|
1105
|
+
class ut {
|
|
1094
1106
|
constructor(e) {
|
|
1095
1107
|
c(this, "view");
|
|
1096
1108
|
this.view = e;
|
|
@@ -1111,7 +1123,7 @@ class it {
|
|
|
1111
1123
|
this.view.elementContext.viewName = e, this.view.logger.setName(e);
|
|
1112
1124
|
}
|
|
1113
1125
|
provide(e, s) {
|
|
1114
|
-
const n = new
|
|
1126
|
+
const n = new ot(e, s);
|
|
1115
1127
|
if (n.attach(this.view.elementContext))
|
|
1116
1128
|
return this.view.lifecycleListeners.mount.push(() => {
|
|
1117
1129
|
n.handleMount();
|
|
@@ -1124,15 +1136,15 @@ class it {
|
|
|
1124
1136
|
}
|
|
1125
1137
|
}
|
|
1126
1138
|
get(e) {
|
|
1127
|
-
if (
|
|
1139
|
+
if (k(e)) {
|
|
1128
1140
|
let s = this.view.elementContext, n;
|
|
1129
1141
|
for (; n = s.stores.get(e), n == null && s.parent != null; )
|
|
1130
1142
|
s = s.parent;
|
|
1131
1143
|
if (n == null)
|
|
1132
|
-
throw new
|
|
1144
|
+
throw new R(`Store '${e.name}' is not provided on this context.`);
|
|
1133
1145
|
return n.value;
|
|
1134
1146
|
} else
|
|
1135
|
-
throw new
|
|
1147
|
+
throw new R("Invalid store.");
|
|
1136
1148
|
}
|
|
1137
1149
|
beforeMount(e) {
|
|
1138
1150
|
this.view.lifecycleListeners.beforeMount.push(e);
|
|
@@ -1146,16 +1158,16 @@ class it {
|
|
|
1146
1158
|
onUnmount(e) {
|
|
1147
1159
|
this.view.lifecycleListeners.unmount.push(e);
|
|
1148
1160
|
}
|
|
1149
|
-
effect(e) {
|
|
1161
|
+
effect(e, s) {
|
|
1150
1162
|
if (this.view.isMounted) {
|
|
1151
|
-
const
|
|
1152
|
-
return this.view.lifecycleListeners.unmount.push(
|
|
1163
|
+
const n = w(e);
|
|
1164
|
+
return this.view.lifecycleListeners.unmount.push(n), n;
|
|
1153
1165
|
} else {
|
|
1154
|
-
let
|
|
1166
|
+
let n, i = !1;
|
|
1155
1167
|
return this.view.lifecycleListeners.mount.push(() => {
|
|
1156
|
-
|
|
1168
|
+
i || (n = w(e), this.view.lifecycleListeners.unmount.push(n));
|
|
1157
1169
|
}), () => {
|
|
1158
|
-
|
|
1170
|
+
n != null && (i = !0, n());
|
|
1159
1171
|
};
|
|
1160
1172
|
}
|
|
1161
1173
|
}
|
|
@@ -1163,12 +1175,12 @@ class it {
|
|
|
1163
1175
|
return x("$outlet", { view: this.view.elementContext.route });
|
|
1164
1176
|
}
|
|
1165
1177
|
}
|
|
1166
|
-
var
|
|
1167
|
-
|
|
1168
|
-
const
|
|
1178
|
+
var me;
|
|
1179
|
+
me = S;
|
|
1180
|
+
const oe = class oe {
|
|
1169
1181
|
constructor(e, s, n, i) {
|
|
1170
|
-
c(this,
|
|
1171
|
-
c(this, "uniqueId",
|
|
1182
|
+
c(this, me, !0);
|
|
1183
|
+
c(this, "uniqueId", Ce());
|
|
1172
1184
|
c(this, "elementContext");
|
|
1173
1185
|
c(this, "logger");
|
|
1174
1186
|
c(this, "props");
|
|
@@ -1181,7 +1193,7 @@ const ie = class ie {
|
|
|
1181
1193
|
parent: e,
|
|
1182
1194
|
viewName: s.name,
|
|
1183
1195
|
stores: /* @__PURE__ */ new Map(),
|
|
1184
|
-
route:
|
|
1196
|
+
route: Q()
|
|
1185
1197
|
}, this.logger = e.root.createLogger(s.name || "🌇 anonymous view", { uid: this.uniqueId }), this.props = {
|
|
1186
1198
|
...n,
|
|
1187
1199
|
children: i
|
|
@@ -1215,14 +1227,14 @@ const ie = class ie {
|
|
|
1215
1227
|
this.lifecycleListeners.beforeMount.length = 0, this.lifecycleListeners.mount.length = 0, this.lifecycleListeners.beforeUnmount.length = 0, this.lifecycleListeners.unmount.length = 0;
|
|
1216
1228
|
}
|
|
1217
1229
|
setRouteView(e) {
|
|
1218
|
-
const s = new
|
|
1230
|
+
const s = new oe(this.elementContext, e, {});
|
|
1219
1231
|
return this.elementContext.route.set(s), s;
|
|
1220
1232
|
}
|
|
1221
1233
|
/*===============================*\
|
|
1222
1234
|
|| Internal ||
|
|
1223
1235
|
\*===============================*/
|
|
1224
1236
|
_initialize() {
|
|
1225
|
-
const e = new
|
|
1237
|
+
const e = new ut(this);
|
|
1226
1238
|
let s;
|
|
1227
1239
|
try {
|
|
1228
1240
|
s = this.fn.call(e, this.props, e);
|
|
@@ -1230,27 +1242,27 @@ const ie = class ie {
|
|
|
1230
1242
|
throw n instanceof Error && this.logger.crash(n), n;
|
|
1231
1243
|
}
|
|
1232
1244
|
if (s !== null) if (s instanceof Node)
|
|
1233
|
-
this.element =
|
|
1234
|
-
else if (
|
|
1235
|
-
this.element =
|
|
1236
|
-
|
|
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 }))
|
|
1237
1249
|
);
|
|
1238
|
-
else if (
|
|
1239
|
-
this.element =
|
|
1250
|
+
else if (F(s) || Y(F, s))
|
|
1251
|
+
this.element = B($(this.elementContext, s));
|
|
1240
1252
|
else {
|
|
1241
1253
|
const n = new TypeError(
|
|
1242
|
-
`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)}`
|
|
1243
1255
|
);
|
|
1244
1256
|
this.logger.crash(n);
|
|
1245
1257
|
}
|
|
1246
1258
|
}
|
|
1247
1259
|
};
|
|
1248
|
-
let
|
|
1249
|
-
var
|
|
1250
|
-
|
|
1251
|
-
class
|
|
1260
|
+
let z = oe;
|
|
1261
|
+
var ge;
|
|
1262
|
+
ge = S;
|
|
1263
|
+
class ct {
|
|
1252
1264
|
constructor({ elementContext: e, items: s, renderFn: n, keyFn: i }) {
|
|
1253
|
-
c(this,
|
|
1265
|
+
c(this, ge, !0);
|
|
1254
1266
|
c(this, "domNode", document.createTextNode(""));
|
|
1255
1267
|
c(this, "items");
|
|
1256
1268
|
c(this, "unsubscribe", null);
|
|
@@ -1264,9 +1276,9 @@ class rt {
|
|
|
1264
1276
|
return this.domNode.parentNode != null;
|
|
1265
1277
|
}
|
|
1266
1278
|
mount(e, s) {
|
|
1267
|
-
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(() => {
|
|
1268
1280
|
let n = this.items.get();
|
|
1269
|
-
n == null && (n = [], console.log("list received empty value", n, this)),
|
|
1281
|
+
n == null && (n = [], console.log("list received empty value", n, this)), Z(() => {
|
|
1270
1282
|
this._update(Array.from(n));
|
|
1271
1283
|
});
|
|
1272
1284
|
}));
|
|
@@ -1300,13 +1312,13 @@ class rt {
|
|
|
1300
1312
|
if (u)
|
|
1301
1313
|
u.item.set(r.value), u.index.set(r.index), i[r.index] = u;
|
|
1302
1314
|
else {
|
|
1303
|
-
const l =
|
|
1315
|
+
const l = Q(r.value), d = Q(r.index);
|
|
1304
1316
|
i[r.index] = {
|
|
1305
1317
|
key: r.key,
|
|
1306
1318
|
item: l,
|
|
1307
1319
|
index: d,
|
|
1308
|
-
element: new
|
|
1309
|
-
item:
|
|
1320
|
+
element: new z(this.elementContext, ft, {
|
|
1321
|
+
item: ie(() => l.get()),
|
|
1310
1322
|
index: d,
|
|
1311
1323
|
renderFn: this.renderFn
|
|
1312
1324
|
})
|
|
@@ -1322,14 +1334,14 @@ class rt {
|
|
|
1322
1334
|
(m = this.domNode.parentNode) == null || m.insertBefore(this.domNode, o.nextSibling);
|
|
1323
1335
|
}
|
|
1324
1336
|
}
|
|
1325
|
-
function
|
|
1337
|
+
function ft(t, e) {
|
|
1326
1338
|
return e.name = "@ListItem", t.renderFn.call(e, t.item, t.index, e);
|
|
1327
1339
|
}
|
|
1328
|
-
var
|
|
1329
|
-
|
|
1330
|
-
class
|
|
1340
|
+
var ye;
|
|
1341
|
+
ye = S;
|
|
1342
|
+
class $e {
|
|
1331
1343
|
constructor(e) {
|
|
1332
|
-
c(this,
|
|
1344
|
+
c(this, ye, !0);
|
|
1333
1345
|
c(this, "domNode", document.createTextNode(""));
|
|
1334
1346
|
c(this, "isMounted", !1);
|
|
1335
1347
|
c(this, "source");
|
|
@@ -1338,9 +1350,9 @@ class Ae {
|
|
|
1338
1350
|
this.source = e;
|
|
1339
1351
|
}
|
|
1340
1352
|
mount(e, s) {
|
|
1341
|
-
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(() => {
|
|
1342
1354
|
const n = I(this.source);
|
|
1343
|
-
|
|
1355
|
+
Z(() => {
|
|
1344
1356
|
this.update(n);
|
|
1345
1357
|
});
|
|
1346
1358
|
}) : this.update(this.elements));
|
|
@@ -1364,11 +1376,11 @@ class Ae {
|
|
|
1364
1376
|
}
|
|
1365
1377
|
}
|
|
1366
1378
|
}
|
|
1367
|
-
var
|
|
1368
|
-
|
|
1369
|
-
class
|
|
1379
|
+
var ve;
|
|
1380
|
+
ve = S;
|
|
1381
|
+
class lt {
|
|
1370
1382
|
constructor(e) {
|
|
1371
|
-
c(this,
|
|
1383
|
+
c(this, ve, !0);
|
|
1372
1384
|
c(this, "config");
|
|
1373
1385
|
c(this, "element");
|
|
1374
1386
|
this.config = e;
|
|
@@ -1378,18 +1390,18 @@ class ut {
|
|
|
1378
1390
|
}
|
|
1379
1391
|
mount(e, s) {
|
|
1380
1392
|
const { content: n, parent: i } = this.config;
|
|
1381
|
-
|
|
1393
|
+
Pe(n) ? this.element = n : this.element = B($(this.config.elementContext, re(n))), this.element.mount(i);
|
|
1382
1394
|
}
|
|
1383
1395
|
unmount(e = !1) {
|
|
1384
1396
|
var s;
|
|
1385
1397
|
(s = this.element) != null && s.isMounted && this.element.unmount(!1);
|
|
1386
1398
|
}
|
|
1387
1399
|
}
|
|
1388
|
-
var
|
|
1389
|
-
|
|
1390
|
-
class
|
|
1400
|
+
var we;
|
|
1401
|
+
we = S;
|
|
1402
|
+
class at {
|
|
1391
1403
|
constructor(e) {
|
|
1392
|
-
c(this,
|
|
1404
|
+
c(this, we, !0);
|
|
1393
1405
|
c(this, "domNode", document.createTextNode(""));
|
|
1394
1406
|
c(this, "isMounted", !1);
|
|
1395
1407
|
c(this, "view");
|
|
@@ -1398,9 +1410,9 @@ class ct {
|
|
|
1398
1410
|
this.view = e;
|
|
1399
1411
|
}
|
|
1400
1412
|
mount(e, s) {
|
|
1401
|
-
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe =
|
|
1413
|
+
this.isMounted || (this.isMounted = !0, e.insertBefore(this.domNode, (s == null ? void 0 : s.nextSibling) ?? null), this.unsubscribe = w(() => {
|
|
1402
1414
|
const n = this.view.get();
|
|
1403
|
-
|
|
1415
|
+
Z(() => {
|
|
1404
1416
|
this.update(n);
|
|
1405
1417
|
});
|
|
1406
1418
|
}));
|
|
@@ -1415,19 +1427,19 @@ class ct {
|
|
|
1415
1427
|
this.cleanup(!1), e && (e.mount(this.domNode.parentElement, this.domNode), this.mountedView = e);
|
|
1416
1428
|
}
|
|
1417
1429
|
}
|
|
1418
|
-
function
|
|
1419
|
-
return t instanceof
|
|
1430
|
+
function F(t) {
|
|
1431
|
+
return t instanceof Oe;
|
|
1420
1432
|
}
|
|
1421
|
-
function
|
|
1422
|
-
return (t == null ? void 0 : t[
|
|
1433
|
+
function Pe(t) {
|
|
1434
|
+
return (t == null ? void 0 : t[S]) === !0;
|
|
1423
1435
|
}
|
|
1424
|
-
function
|
|
1425
|
-
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 }));
|
|
1426
1438
|
}
|
|
1427
1439
|
function x(t, e, ...s) {
|
|
1428
|
-
return new
|
|
1440
|
+
return new Oe(t, e, ...s);
|
|
1429
1441
|
}
|
|
1430
|
-
class
|
|
1442
|
+
class Oe {
|
|
1431
1443
|
constructor(e, s, ...n) {
|
|
1432
1444
|
c(this, "type");
|
|
1433
1445
|
c(this, "props");
|
|
@@ -1435,37 +1447,43 @@ class Pe {
|
|
|
1435
1447
|
this.type = e, this.props = s, this.children = n;
|
|
1436
1448
|
}
|
|
1437
1449
|
}
|
|
1438
|
-
function
|
|
1450
|
+
function Ie(t, e, s) {
|
|
1439
1451
|
return x("$dynamic", {
|
|
1440
|
-
source:
|
|
1452
|
+
source: ie(() => {
|
|
1441
1453
|
const n = I(t);
|
|
1442
1454
|
return n && e ? e : !n && s ? s : null;
|
|
1443
1455
|
})
|
|
1444
1456
|
});
|
|
1445
1457
|
}
|
|
1446
|
-
function
|
|
1447
|
-
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);
|
|
1463
|
+
}
|
|
1464
|
+
function $t(t, e, s) {
|
|
1465
|
+
return x("$list", { items: ie(() => t), keyFn: e, renderFn: s });
|
|
1448
1466
|
}
|
|
1449
|
-
function
|
|
1467
|
+
function Pt(t, e) {
|
|
1450
1468
|
return x("$portal", { parent: t, content: e });
|
|
1451
1469
|
}
|
|
1452
|
-
function
|
|
1453
|
-
return (
|
|
1454
|
-
if (
|
|
1455
|
-
return new
|
|
1470
|
+
function $(t, e) {
|
|
1471
|
+
return (U(e) ? e : [e]).map((n) => {
|
|
1472
|
+
if (k(n.type))
|
|
1473
|
+
return new z(t, n.type, n.props, n.children);
|
|
1456
1474
|
if (O(n.type))
|
|
1457
1475
|
switch (n.type) {
|
|
1458
1476
|
case "$node": {
|
|
1459
1477
|
const i = n.props;
|
|
1460
|
-
return new
|
|
1478
|
+
return new le(i.value);
|
|
1461
1479
|
}
|
|
1462
1480
|
case "$text": {
|
|
1463
1481
|
const i = n.props;
|
|
1464
|
-
return new
|
|
1482
|
+
return new le(document.createTextNode(String(i.value)));
|
|
1465
1483
|
}
|
|
1466
1484
|
case "$list": {
|
|
1467
1485
|
const i = n.props;
|
|
1468
|
-
return new
|
|
1486
|
+
return new ct({
|
|
1469
1487
|
items: i.items,
|
|
1470
1488
|
keyFn: i.keyFn,
|
|
1471
1489
|
renderFn: i.renderFn,
|
|
@@ -1474,22 +1492,22 @@ function C(t, e) {
|
|
|
1474
1492
|
}
|
|
1475
1493
|
case "$dynamic": {
|
|
1476
1494
|
const i = n.props;
|
|
1477
|
-
return new
|
|
1495
|
+
return new tt({
|
|
1478
1496
|
source: i.source,
|
|
1479
1497
|
elementContext: t
|
|
1480
1498
|
});
|
|
1481
1499
|
}
|
|
1482
1500
|
case "$fragment": {
|
|
1483
1501
|
const i = n.props;
|
|
1484
|
-
return new
|
|
1502
|
+
return new $e(i.children);
|
|
1485
1503
|
}
|
|
1486
1504
|
case "$outlet": {
|
|
1487
1505
|
const i = n.props;
|
|
1488
|
-
return new
|
|
1506
|
+
return new at(i.view);
|
|
1489
1507
|
}
|
|
1490
1508
|
case "$portal": {
|
|
1491
1509
|
const i = n.props;
|
|
1492
|
-
return new
|
|
1510
|
+
return new lt({
|
|
1493
1511
|
content: i.content,
|
|
1494
1512
|
parent: i.parent,
|
|
1495
1513
|
elementContext: t
|
|
@@ -1498,7 +1516,7 @@ function C(t, e) {
|
|
|
1498
1516
|
default:
|
|
1499
1517
|
if (n.type.startsWith("$"))
|
|
1500
1518
|
throw new Error(`Unknown markup type: ${n.type}`);
|
|
1501
|
-
return new
|
|
1519
|
+
return new nt({
|
|
1502
1520
|
tag: n.type,
|
|
1503
1521
|
props: n.props ?? {},
|
|
1504
1522
|
children: n.children,
|
|
@@ -1509,44 +1527,46 @@ function C(t, e) {
|
|
|
1509
1527
|
throw new TypeError(`Expected a string or view function. Got: ${n.type}`);
|
|
1510
1528
|
});
|
|
1511
1529
|
}
|
|
1512
|
-
function
|
|
1513
|
-
return t.length === 1 ? t[0] : new
|
|
1530
|
+
function B(t) {
|
|
1531
|
+
return t.length === 1 ? t[0] : new $e(t);
|
|
1514
1532
|
}
|
|
1515
|
-
function
|
|
1516
|
-
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);
|
|
1517
1535
|
}
|
|
1518
1536
|
export {
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
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,
|
|
1544
|
+
z as V,
|
|
1545
|
+
yt as a,
|
|
1546
|
+
vt as b,
|
|
1547
|
+
Q as c,
|
|
1548
|
+
ie as d,
|
|
1549
|
+
bt as e,
|
|
1530
1550
|
O as f,
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1551
|
+
ee as g,
|
|
1552
|
+
J as h,
|
|
1553
|
+
k as i,
|
|
1534
1554
|
I as j,
|
|
1535
|
-
|
|
1536
|
-
|
|
1555
|
+
Ie as k,
|
|
1556
|
+
Tt as l,
|
|
1537
1557
|
x as m,
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
v,
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
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
|
|
1551
1571
|
};
|
|
1552
|
-
//# sourceMappingURL=markup-
|
|
1572
|
+
//# sourceMappingURL=markup-BJffA2Ls.js.map
|