@manyducks.co/dolla 3.3.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/context.d.ts +9 -0
- package/dist/core/root.d.ts +4 -6
- package/dist/core/signals.d.ts +11 -0
- package/dist/{core-BRSu5hVw.js → core-CHBZF6Mb.js} +104 -99
- package/dist/core-CHBZF6Mb.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/router/index.d.ts +1 -1
- package/dist/router/router.d.ts +1 -1
- package/dist/router.js +2 -2
- package/dist/router.js.map +1 -1
- package/dist/translate/index.d.ts +1 -1
- package/dist/translate.js +2 -2
- package/dist/translate.js.map +1 -1
- package/package.json +1 -1
- package/dist/core-BRSu5hVw.js.map +0 -1
package/dist/core/context.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Store } from "../types.js";
|
|
2
2
|
import { ViewNode } from "./markup/nodes/view.js";
|
|
3
|
+
import { Unwrapped } from "./signals.js";
|
|
3
4
|
export type LifecycleListener = () => any;
|
|
4
5
|
type ContextState = {
|
|
5
6
|
isMounted: boolean;
|
|
@@ -13,7 +14,15 @@ export declare function mountContext(context: Context): void;
|
|
|
13
14
|
export declare function unmountContext(context: Context): void;
|
|
14
15
|
export declare function onMount(context: Context, fn: LifecycleListener): void;
|
|
15
16
|
export declare function onCleanup(context: Context, fn: LifecycleListener): void;
|
|
17
|
+
/**
|
|
18
|
+
* Creates an effect with auto-tracking for getters called within its callback.
|
|
19
|
+
*/
|
|
16
20
|
export declare function onEffect(context: Context, fn: () => void): void;
|
|
21
|
+
/**
|
|
22
|
+
* Creates an effect that tracks getters in its `deps` array.
|
|
23
|
+
* Unwrapped values from `deps` are passed as arguments to the callback.
|
|
24
|
+
*/
|
|
25
|
+
export declare function onEffect<const T extends readonly any[]>(context: Context, fn: (...values: Unwrapped<T>) => void, deps: T): void;
|
|
17
26
|
/**
|
|
18
27
|
* Returns the parent element of the root we're mounted in.
|
|
19
28
|
*/
|
package/dist/core/root.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import type { Renderable, View } from "../types.js";
|
|
2
2
|
import { type Context } from "./context.js";
|
|
3
|
-
export type CleanupCallback = () => void | Promise<void>;
|
|
4
3
|
/**
|
|
5
|
-
* Plugins
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* Hooks can be used inside plugins.
|
|
4
|
+
* Plugins are simply functions that take a context object.
|
|
5
|
+
* A plugin can return a Promise to suspend app mounting.
|
|
6
|
+
* Hooks can be used to attach app lifecycle logic.
|
|
9
7
|
*/
|
|
10
|
-
export type DollaPlugin = (context: Context) =>
|
|
8
|
+
export type DollaPlugin = (context: Context) => any;
|
|
11
9
|
export interface DollaRootOptions {
|
|
12
10
|
/**
|
|
13
11
|
* Adds additional view info to the DOM to help with debugging.
|
package/dist/core/signals.d.ts
CHANGED
|
@@ -74,7 +74,18 @@ export declare function createAtom<T>(initialValue: T): AtomAccessors<T>;
|
|
|
74
74
|
*/
|
|
75
75
|
export declare function createSetter<T>(getter: Getter<T>, callback: (current: T) => T | void): Setter<T>;
|
|
76
76
|
export declare function compose<T>(getter: T | ((previousValue?: T) => Getter<T> | T)): Getter<T>;
|
|
77
|
+
export type Unwrapped<T> = {
|
|
78
|
+
[K in keyof T]: T[K] extends () => infer R ? R : T[K];
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Creates an effect with auto-tracking for getters called within its callback.
|
|
82
|
+
*/
|
|
77
83
|
export declare function createEffect(fn: () => void): () => void;
|
|
84
|
+
/**
|
|
85
|
+
* Creates an effect that tracks getters in its `deps` array.
|
|
86
|
+
* Unwrapped values from `deps` are passed as arguments to the callback.
|
|
87
|
+
*/
|
|
88
|
+
export declare function createEffect<const T extends readonly any[]>(fn: (...values: Unwrapped<T>) => void, deps?: T): () => void;
|
|
78
89
|
/**
|
|
79
90
|
* Unwraps a `MaybeGetter<T>` into a plain `T`.
|
|
80
91
|
* Tracks the value if it is a getter.
|
|
@@ -314,25 +314,33 @@ function w(e) {
|
|
|
314
314
|
_getter: e
|
|
315
315
|
}) : () => e;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
let t =
|
|
319
|
-
|
|
317
|
+
function _e(e) {
|
|
318
|
+
let t = this.map((e) => E(e));
|
|
319
|
+
return D(() => e(...t));
|
|
320
|
+
}
|
|
321
|
+
function T(e, t) {
|
|
322
|
+
let n = {
|
|
323
|
+
_fn: t ? _e.bind(t, e) : e,
|
|
320
324
|
_cleanup: void 0,
|
|
321
325
|
_subs: void 0,
|
|
322
326
|
_subsTail: void 0,
|
|
323
327
|
_deps: void 0,
|
|
324
328
|
_depsTail: void 0,
|
|
325
329
|
_flags: u.Watching | u.RecursedCheck
|
|
326
|
-
},
|
|
327
|
-
|
|
330
|
+
}, r = b(n);
|
|
331
|
+
r !== void 0 && _(n, r, 0);
|
|
328
332
|
try {
|
|
329
|
-
let e =
|
|
330
|
-
o(e) && (
|
|
333
|
+
let e = n._fn();
|
|
334
|
+
o(e) && (n._cleanup = e);
|
|
331
335
|
} finally {
|
|
332
|
-
h =
|
|
336
|
+
h = r, n._flags &= ~u.RecursedCheck;
|
|
333
337
|
}
|
|
334
|
-
return he.bind(
|
|
338
|
+
return he.bind(n);
|
|
335
339
|
}
|
|
340
|
+
var [ve, ye] = C(5);
|
|
341
|
+
T((e, t) => {
|
|
342
|
+
console.log("count is now", e);
|
|
343
|
+
}, [ve, "on"]);
|
|
336
344
|
function E(e) {
|
|
337
345
|
return o(e) ? e() : e;
|
|
338
346
|
}
|
|
@@ -344,7 +352,7 @@ function D(e) {
|
|
|
344
352
|
b(t);
|
|
345
353
|
}
|
|
346
354
|
}
|
|
347
|
-
function
|
|
355
|
+
function be(e) {
|
|
348
356
|
++f;
|
|
349
357
|
try {
|
|
350
358
|
e();
|
|
@@ -436,7 +444,7 @@ function k({ value: e, signal: t }) {
|
|
|
436
444
|
}
|
|
437
445
|
};
|
|
438
446
|
}
|
|
439
|
-
function
|
|
447
|
+
function xe(e) {
|
|
440
448
|
let t = {
|
|
441
449
|
_currentValue: e?.initialValue,
|
|
442
450
|
_pendingValue: e?.initialValue,
|
|
@@ -454,9 +462,9 @@ function ve(e) {
|
|
|
454
462
|
}
|
|
455
463
|
//#endregion
|
|
456
464
|
//#region src/core/markup/types.ts
|
|
457
|
-
var
|
|
458
|
-
static [
|
|
459
|
-
get [
|
|
465
|
+
var Se = Symbol(), Ce = Symbol(), we = Symbol(), A = class {
|
|
466
|
+
static [we] = !0;
|
|
467
|
+
get [Ce]() {
|
|
460
468
|
return !0;
|
|
461
469
|
}
|
|
462
470
|
}, j = class extends A {
|
|
@@ -477,7 +485,7 @@ var ye = Symbol(), be = Symbol(), xe = Symbol(), A = class {
|
|
|
477
485
|
e || this.#e.parentNode?.removeChild(this.#e);
|
|
478
486
|
}
|
|
479
487
|
move(e, t) {
|
|
480
|
-
|
|
488
|
+
Fe(e, this.#e, t);
|
|
481
489
|
}
|
|
482
490
|
};
|
|
483
491
|
//#endregion
|
|
@@ -550,7 +558,7 @@ var N = class extends A {
|
|
|
550
558
|
a && (r = a);
|
|
551
559
|
}
|
|
552
560
|
}
|
|
553
|
-
},
|
|
561
|
+
}, Te = Symbol("parentElement"), P = Symbol("debug"), F = Symbol("isSVG"), Ee = ["ref", "children"], De = class extends A {
|
|
554
562
|
#e;
|
|
555
563
|
#t;
|
|
556
564
|
#n;
|
|
@@ -560,7 +568,7 @@ var N = class extends A {
|
|
|
560
568
|
#o;
|
|
561
569
|
constructor(e, t, n) {
|
|
562
570
|
if (super(), this.#t = n, this.#n = e, t === "svg" ? (this.#n = K(e), this.#n[F] = !0, this.#r = !0) : this.#n[F] && t === "foreignObject" && (this.#n = K(e), this.#n[F] = !1, this.#r = !1), this.#n[F] ? this.#e = document.createElementNS("http://www.w3.org/2000/svg", t) : this.#e = document.createElement(t), this.#n[P]) {
|
|
563
|
-
let e =
|
|
571
|
+
let e = Be(this.#n);
|
|
564
572
|
e && (this.#e.dataset.view = e.context.name);
|
|
565
573
|
}
|
|
566
574
|
}
|
|
@@ -572,7 +580,7 @@ var N = class extends A {
|
|
|
572
580
|
}
|
|
573
581
|
mount(e, t) {
|
|
574
582
|
let r = this.isMounted();
|
|
575
|
-
if (!r && (this.#c(this.#e, n(
|
|
583
|
+
if (!r && (this.#c(this.#e, n(Ee, this.#t)), this.#t.children)) {
|
|
576
584
|
this.#i = z(this.#n, this.#t.children);
|
|
577
585
|
for (let e of this.#i) e.mount(this.#e);
|
|
578
586
|
}
|
|
@@ -641,13 +649,13 @@ var N = class extends A {
|
|
|
641
649
|
n.forEach((e) => {
|
|
642
650
|
e(), this.#a.delete(e);
|
|
643
651
|
}), n.clear(), e.style.cssText = "";
|
|
644
|
-
let r =
|
|
652
|
+
let r = ke(t);
|
|
645
653
|
for (let [t, { value: i, priority: a }] of Object.entries(r)) if (o(i)) {
|
|
646
654
|
let r = O(i, (n) => {
|
|
647
|
-
n ? e.style.setProperty(t,
|
|
655
|
+
n ? e.style.setProperty(t, je(n), a) : e.style.removeProperty(t);
|
|
648
656
|
});
|
|
649
657
|
this.#a.add(r), n.add(r);
|
|
650
|
-
} else i != null && e.style.setProperty(t,
|
|
658
|
+
} else i != null && e.style.setProperty(t, je(i), a);
|
|
651
659
|
};
|
|
652
660
|
o(t) ? this.#a.add(O(t, r)) : r(t);
|
|
653
661
|
}
|
|
@@ -656,7 +664,7 @@ var N = class extends A {
|
|
|
656
664
|
n.forEach((e) => {
|
|
657
665
|
e(), this.#a.delete(e);
|
|
658
666
|
}), n.clear(), I(e, "class", null);
|
|
659
|
-
let r =
|
|
667
|
+
let r = Oe(t);
|
|
660
668
|
for (let [t, i] of Object.entries(r)) if (t !== "undefined") if (o(i)) {
|
|
661
669
|
let r = O(i, (n) => e.classList.toggle(t, !!n));
|
|
662
670
|
this.#a.add(r), n.add(r);
|
|
@@ -665,22 +673,22 @@ var N = class extends A {
|
|
|
665
673
|
o(t) ? this.#a.add(O(t, r)) : r(t);
|
|
666
674
|
}
|
|
667
675
|
};
|
|
668
|
-
function
|
|
669
|
-
return a(e) ? Object.fromEntries(e.split(" ").map((e) => [e, !0])) : i(e) ? Object.assign({}, ...e.filter(Boolean).map(
|
|
676
|
+
function Oe(e) {
|
|
677
|
+
return a(e) ? Object.fromEntries(e.split(" ").map((e) => [e, !0])) : i(e) ? Object.assign({}, ...e.filter(Boolean).map(Oe)) : l(e) ? e : {};
|
|
670
678
|
}
|
|
671
|
-
function
|
|
679
|
+
function ke(e) {
|
|
672
680
|
return a(e) ? Object.fromEntries(e.split(";").filter((e) => e.trim()).map((e) => {
|
|
673
681
|
let [t, n] = e.split(":");
|
|
674
|
-
return [
|
|
682
|
+
return [Ae(t.trim()), {
|
|
675
683
|
value: n.replace("!important", "").trim(),
|
|
676
684
|
priority: n.includes("!important") ? "important" : ""
|
|
677
685
|
}];
|
|
678
|
-
})) : i(e) ? Object.assign({}, ...e.filter(Boolean).map(
|
|
686
|
+
})) : i(e) ? Object.assign({}, ...e.filter(Boolean).map(ke)) : l(e) ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e.startsWith("--") ? e : Ae(e), { value: t }])) : {};
|
|
679
687
|
}
|
|
680
|
-
function
|
|
688
|
+
function Ae(e) {
|
|
681
689
|
return e.replace(/[A-Z]+(?![a-z])|[A-Z]/g, (e, t) => (t ? "-" : "") + e.toLowerCase());
|
|
682
690
|
}
|
|
683
|
-
function
|
|
691
|
+
function je(e) {
|
|
684
692
|
return c(e) ? `${e}px` : e;
|
|
685
693
|
}
|
|
686
694
|
function I(e, t, n) {
|
|
@@ -690,19 +698,19 @@ function I(e, t, n) {
|
|
|
690
698
|
//#region src/core/markup/utils.ts
|
|
691
699
|
function L(e, t) {
|
|
692
700
|
return {
|
|
693
|
-
[
|
|
701
|
+
[Se]: !0,
|
|
694
702
|
type: e,
|
|
695
703
|
props: t
|
|
696
704
|
};
|
|
697
705
|
}
|
|
698
|
-
function
|
|
699
|
-
return e && e[
|
|
706
|
+
function Me(e) {
|
|
707
|
+
return e && e[Se];
|
|
700
708
|
}
|
|
701
|
-
function
|
|
702
|
-
return e && e[
|
|
709
|
+
function Ne(e) {
|
|
710
|
+
return e && e[Ce];
|
|
703
711
|
}
|
|
704
|
-
function
|
|
705
|
-
return e && e[
|
|
712
|
+
function Pe(e) {
|
|
713
|
+
return e && e[we];
|
|
706
714
|
}
|
|
707
715
|
function R(e, t = K()) {
|
|
708
716
|
let n = z(t, e);
|
|
@@ -713,10 +721,10 @@ function z(e, ...t) {
|
|
|
713
721
|
function r(t) {
|
|
714
722
|
if (!(t == null || t === !1)) if (i(t)) for (let e = 0; e < t.length; e++) r(t[e]);
|
|
715
723
|
else if (a(t) || c(t)) n.push(new j(e, V(String(t))));
|
|
716
|
-
else if (
|
|
724
|
+
else if (Me(t)) {
|
|
717
725
|
let { type: r, props: i } = t;
|
|
718
|
-
|
|
719
|
-
} else
|
|
726
|
+
Pe(r) ? n.push(new r(e, ...i.args)) : o(r) ? n.push(new U(e, r, i)) : a(r) && n.push(new De(e, r, i));
|
|
727
|
+
} else Ne(t) ? n.push(t) : t instanceof Node ? n.push(new j(e, t)) : o(t) && n.push(new N(e, t));
|
|
720
728
|
}
|
|
721
729
|
for (let e = 0; e < t.length; e++) r(t[e]);
|
|
722
730
|
return n;
|
|
@@ -727,7 +735,7 @@ function B(e, t, n) {
|
|
|
727
735
|
function V(e) {
|
|
728
736
|
return document.createTextNode(e);
|
|
729
737
|
}
|
|
730
|
-
function
|
|
738
|
+
function Fe(e, t, n) {
|
|
731
739
|
let r = n?.nextSibling ?? null;
|
|
732
740
|
if (e.moveBefore) try {
|
|
733
741
|
e.moveBefore(t, r);
|
|
@@ -740,13 +748,13 @@ function H(e, t, n) {
|
|
|
740
748
|
}
|
|
741
749
|
//#endregion
|
|
742
750
|
//#region src/core/markup/nodes/view.ts
|
|
743
|
-
var
|
|
751
|
+
var Ie = Symbol.for("ViewNode"), U = class extends A {
|
|
744
752
|
#e;
|
|
745
753
|
#t;
|
|
746
754
|
#n;
|
|
747
755
|
context;
|
|
748
756
|
constructor(e, t, n) {
|
|
749
|
-
super(), this.context = K(e), this.context[
|
|
757
|
+
super(), this.context = K(e), this.context[Ie] = this, this.context.name = t.name, this.#e = n, this.#t = t;
|
|
750
758
|
}
|
|
751
759
|
getRoot() {
|
|
752
760
|
return this.#n?.getRoot();
|
|
@@ -773,12 +781,12 @@ function K(e) {
|
|
|
773
781
|
return Object.assign(Object.create(e ?? null), { isMounted: !1 });
|
|
774
782
|
}
|
|
775
783
|
function q(e) {
|
|
776
|
-
e.isMounted || (e.isMounted = !0,
|
|
784
|
+
e.isMounted || (e.isMounted = !0, Le(e, W));
|
|
777
785
|
}
|
|
778
786
|
function J(e) {
|
|
779
|
-
e.isMounted && (e.isMounted = !1,
|
|
787
|
+
e.isMounted && (e.isMounted = !1, Le(e, G));
|
|
780
788
|
}
|
|
781
|
-
function
|
|
789
|
+
function Le(e, t) {
|
|
782
790
|
if (Object.hasOwn(e, t)) {
|
|
783
791
|
for (let n of e[t]) n();
|
|
784
792
|
e[t].length = 0;
|
|
@@ -790,74 +798,71 @@ function Y(e, t) {
|
|
|
790
798
|
function X(e, t) {
|
|
791
799
|
Object.hasOwn(e, G) ? e[G].push(t) : e[G] = [t];
|
|
792
800
|
}
|
|
793
|
-
function
|
|
794
|
-
e.isMounted ? X(e, T(t)) : Y(e, () => {
|
|
795
|
-
X(e, T(t));
|
|
801
|
+
function Re(e, t, n) {
|
|
802
|
+
e.isMounted ? X(e, T(t, n)) : Y(e, () => {
|
|
803
|
+
X(e, T(t, n));
|
|
796
804
|
});
|
|
797
805
|
}
|
|
798
|
-
function
|
|
799
|
-
return e[
|
|
806
|
+
function ze(e) {
|
|
807
|
+
return e[Te];
|
|
800
808
|
}
|
|
801
|
-
function
|
|
802
|
-
return e[
|
|
809
|
+
function Be(e) {
|
|
810
|
+
return e[Ie];
|
|
803
811
|
}
|
|
804
812
|
var Z = Symbol("Dolla.StoreId");
|
|
805
|
-
function
|
|
813
|
+
function Ve(e, t, ...n) {
|
|
806
814
|
t[Z] ??= Symbol(t.name), r(!Object.hasOwn(e, t[Z]), "Store was already provided on this context.");
|
|
807
815
|
let i = K(e);
|
|
808
816
|
return Y(e, () => q(i)), X(e, () => J(i)), i.name = t.name, e[t[Z]] = t.call(i, n[0], i);
|
|
809
817
|
}
|
|
810
|
-
function
|
|
818
|
+
function He(e, t) {
|
|
811
819
|
let n = t[Z], i = n ? e[n] : void 0;
|
|
812
820
|
return r(i != null, `Store '${t.name}' is not provided by this context.`), i;
|
|
813
821
|
}
|
|
814
822
|
//#endregion
|
|
815
823
|
//#region src/core/root.ts
|
|
816
|
-
function
|
|
824
|
+
function Ue(e, t) {
|
|
817
825
|
let n = a(e) ? document.querySelector(e) : e;
|
|
818
826
|
r(n, "Element cannot be null.");
|
|
819
827
|
let i = K();
|
|
820
828
|
i.name = "dolla:root";
|
|
821
|
-
let s = []
|
|
822
|
-
i[
|
|
823
|
-
let
|
|
824
|
-
plugin:
|
|
825
|
-
mount:
|
|
826
|
-
unmount:
|
|
829
|
+
let s = [];
|
|
830
|
+
i[Te] = n, i[P] = !!t?.debug;
|
|
831
|
+
let c = null, l = {
|
|
832
|
+
plugin: u,
|
|
833
|
+
mount: d,
|
|
834
|
+
unmount: f
|
|
827
835
|
};
|
|
828
|
-
function
|
|
829
|
-
return s.push(e),
|
|
836
|
+
function u(e) {
|
|
837
|
+
return s.push(e), l;
|
|
830
838
|
}
|
|
831
|
-
async function
|
|
832
|
-
|
|
833
|
-
let t = await Promise.all(s.map((e) => e(i)));
|
|
834
|
-
for (let e of t) o(e) && c.push(e);
|
|
835
|
-
l = o(e) ? new U(i, e, {}) : R(e, i), l?.mount(n), q(i);
|
|
839
|
+
async function d(e) {
|
|
840
|
+
i.isMounted || (await Promise.all(s.map((e) => e(i))), c = o(e) ? new U(i, e, {}) : R(e, i), c?.mount(n), q(i));
|
|
836
841
|
}
|
|
837
|
-
async function
|
|
838
|
-
i.isMounted && (
|
|
842
|
+
async function f() {
|
|
843
|
+
i.isMounted && (c?.unmount(!1), c = null, J(i));
|
|
839
844
|
}
|
|
840
|
-
return
|
|
845
|
+
return l;
|
|
841
846
|
}
|
|
842
847
|
//#endregion
|
|
843
848
|
//#region src/core/debug.ts
|
|
844
|
-
var
|
|
849
|
+
var We = () => {}, Ge = {
|
|
845
850
|
trace: 1,
|
|
846
851
|
info: 1,
|
|
847
852
|
log: 2,
|
|
848
853
|
warn: 3,
|
|
849
854
|
error: 4,
|
|
850
855
|
silent: 5
|
|
851
|
-
},
|
|
852
|
-
|
|
853
|
-
},
|
|
854
|
-
|
|
856
|
+
}, Ke = 1, qe = (e) => !e.startsWith("dolla:"), Je = (e) => {
|
|
857
|
+
Ke = Ge[e] || 1;
|
|
858
|
+
}, Ye = (e) => {
|
|
859
|
+
qe = e;
|
|
855
860
|
}, Q = globalThis.console || {};
|
|
856
|
-
function
|
|
861
|
+
function Xe(e, ...t) {
|
|
857
862
|
let n = e.name, r, i = (e, i) => {
|
|
858
|
-
if (i <
|
|
863
|
+
if (i < Ke || !qe(n) || !Q[e]) return We;
|
|
859
864
|
if (!r) {
|
|
860
|
-
let e = "%c" + n, i = [`color:${
|
|
865
|
+
let e = "%c" + n, i = [`color:${Qe(n)};font-weight:bold`];
|
|
861
866
|
for (let [n, r] of t) e += `%c[${n}: %c${r}%c]`, i.push("color:#777", "color:#aaa", "color:#777");
|
|
862
867
|
r = [e, ...i];
|
|
863
868
|
}
|
|
@@ -881,18 +886,18 @@ function qe(e, ...t) {
|
|
|
881
886
|
}
|
|
882
887
|
};
|
|
883
888
|
}
|
|
884
|
-
function
|
|
889
|
+
function Ze(e, ...t) {
|
|
885
890
|
let n = K();
|
|
886
|
-
return n.name = e,
|
|
891
|
+
return n.name = e, Xe(n, ...t);
|
|
887
892
|
}
|
|
888
|
-
function
|
|
893
|
+
function Qe(e) {
|
|
889
894
|
let t = 0;
|
|
890
895
|
for (let n = 0; n < e.length; n++) t = (t + e.charCodeAt(n) * 10) % 360;
|
|
891
896
|
return `oklch(0.68 0.15 ${t}deg)`;
|
|
892
897
|
}
|
|
893
898
|
//#endregion
|
|
894
899
|
//#region src/core/markup/nodes/portal.ts
|
|
895
|
-
var
|
|
900
|
+
var $e = class extends A {
|
|
896
901
|
#e = V("");
|
|
897
902
|
#t;
|
|
898
903
|
#n;
|
|
@@ -914,9 +919,9 @@ var Xe = class extends A {
|
|
|
914
919
|
this.isMounted() && (e || this.#e.parentNode?.removeChild(this.#e), this.#i?.isMounted() && this.#i.unmount(!1));
|
|
915
920
|
}
|
|
916
921
|
move(e, t) {
|
|
917
|
-
|
|
922
|
+
Fe(e, this.#e, t);
|
|
918
923
|
}
|
|
919
|
-
},
|
|
924
|
+
}, et = class extends A {
|
|
920
925
|
#e = V("");
|
|
921
926
|
#t;
|
|
922
927
|
#n;
|
|
@@ -954,7 +959,7 @@ var Xe = class extends A {
|
|
|
954
959
|
if (!this.isMounted()) return;
|
|
955
960
|
if (e.length === 0) return this._cleanup(!1);
|
|
956
961
|
let t = /* @__PURE__ */ new Map();
|
|
957
|
-
|
|
962
|
+
be(() => {
|
|
958
963
|
let n = new Set(e.map((e, t) => this.#r(e, t)));
|
|
959
964
|
for (let [e, t] of this.#o.entries()) n.has(e) || t._node.unmount(!1);
|
|
960
965
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -983,31 +988,31 @@ var Xe = class extends A {
|
|
|
983
988
|
};
|
|
984
989
|
//#endregion
|
|
985
990
|
//#region src/core/markup/helpers.ts
|
|
986
|
-
function
|
|
987
|
-
return o(e) ? L(
|
|
991
|
+
function tt(e, t, n) {
|
|
992
|
+
return o(e) ? L(et, { args: [
|
|
988
993
|
e,
|
|
989
994
|
t,
|
|
990
995
|
n
|
|
991
996
|
] }) : Array.from(e).map((e, t) => n(() => e, () => t));
|
|
992
997
|
}
|
|
993
|
-
function
|
|
998
|
+
function nt(e, t, n) {
|
|
994
999
|
return o(e) ? L(N, { args: [w(() => e() ? t : n)] }) : e ? t : n;
|
|
995
1000
|
}
|
|
996
|
-
function
|
|
997
|
-
return
|
|
1001
|
+
function rt(e, t, n) {
|
|
1002
|
+
return nt(e, t, n);
|
|
998
1003
|
}
|
|
999
|
-
function
|
|
1000
|
-
return
|
|
1004
|
+
function it(e, t, n) {
|
|
1005
|
+
return nt(e, n, t);
|
|
1001
1006
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return L(
|
|
1007
|
+
function at(e, t) {
|
|
1008
|
+
return L($e, { args: [t, e] });
|
|
1004
1009
|
}
|
|
1005
1010
|
//#endregion
|
|
1006
1011
|
//#region src/core/markup/html.ts
|
|
1007
1012
|
var $ = /* @__PURE__ */ function(e) {
|
|
1008
1013
|
return e[e.Slash = 0] = "Slash", e[e.Text = 1] = "Text", e[e.Whitespace = 2] = "Whitespace", e[e.TagName = 3] = "TagName", e[e.Comment = 4] = "Comment", e[e.PropSet = 5] = "PropSet", e[e.PropAppend = 6] = "PropAppend", e;
|
|
1009
1014
|
}($ || {});
|
|
1010
|
-
function
|
|
1015
|
+
function ot(e, ...t) {
|
|
1011
1016
|
let n = [e, ...t], r = $.Text, i = "", a = "", o = [0], s = "", c = (e) => {
|
|
1012
1017
|
r === $.Text && (e || (i = i.replace(/^\s*\n\s*|\s*\n\s*$/g, ""))) ? o.push(e ? n[e] : i) : r === $.TagName && (e || i) ? (o[1] = e ? n[e] : i, r = $.Whitespace) : r === $.Whitespace && i === "..." && e ? o[2] = Object.assign(o[2] || {}, n[e]) : r === $.Whitespace && i && !e ? (o[2] = o[2] || {})[i] = !0 : r >= $.PropSet && (r === $.PropSet ? ((o[2] = o[2] || {})[s] = e ? i ? i + n[e] : n[e] : i, r = $.PropAppend) : (e || i) && (o[2][s] += e ? i + n[e] : i)), i = "";
|
|
1013
1018
|
};
|
|
@@ -1042,13 +1047,13 @@ function rt(e, ...t) {
|
|
|
1042
1047
|
}
|
|
1043
1048
|
//#endregion
|
|
1044
1049
|
//#region src/core/ref.ts
|
|
1045
|
-
function
|
|
1050
|
+
function st() {
|
|
1046
1051
|
let e;
|
|
1047
1052
|
return ((...t) => t.length ? (e = t[0], () => {
|
|
1048
1053
|
e = void 0;
|
|
1049
1054
|
}) : e);
|
|
1050
1055
|
}
|
|
1051
1056
|
//#endregion
|
|
1052
|
-
export { ge as A, t as B, R as C, w as D,
|
|
1057
|
+
export { ge as A, t as B, R as C, w as D, be as E, r as F, i as I, o as L, D as M, O as N, C as O, E as P, l as R, L as S, N as T, X as _, it as a, U as b, Xe as c, Ue as d, Ve as f, He as g, ze as h, tt as i, xe as j, T as k, Ye as l, Be as m, ot as n, rt as o, K as p, at as r, Ze as s, st as t, Je as u, Re as v, P as w, H as x, Y as y, a as z };
|
|
1053
1058
|
|
|
1054
|
-
//# sourceMappingURL=core-
|
|
1059
|
+
//# sourceMappingURL=core-CHBZF6Mb.js.map
|