@nil-/xit 0.1.4 → 0.1.6

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.
@@ -0,0 +1,77 @@
1
+ import { c as e, l as o, u as _, a as r, i as x, b as i, f as h } from "./index2.js";
2
+ import { e as S, g as U, j as $, h as j, m as A, s as M, t as P, d as R } from "./index2.js";
3
+ import { c as z } from "./snippet.js";
4
+ function v(t) {
5
+ e === null && o(), e.l !== null ? u(e).m.push(t) : _(() => {
6
+ const n = r(t);
7
+ if (typeof n == "function") return (
8
+ /** @type {() => void} */
9
+ n
10
+ );
11
+ });
12
+ }
13
+ function b(t) {
14
+ e === null && o(), v(() => () => r(t));
15
+ }
16
+ function y(t, n, { bubbles: a = !1, cancelable: c = !1 } = {}) {
17
+ return new CustomEvent(t, { detail: n, bubbles: a, cancelable: c });
18
+ }
19
+ function C() {
20
+ const t = e;
21
+ return t === null && o(), (n, a, c) => {
22
+ var l;
23
+ const s = (
24
+ /** @type {Record<string, Function | Function[]>} */
25
+ (l = t.s.$$events) == null ? void 0 : l[
26
+ /** @type {any} */
27
+ n
28
+ ]
29
+ );
30
+ if (s) {
31
+ const p = x(s) ? s.slice() : [s], f = y(
32
+ /** @type {string} */
33
+ n,
34
+ a,
35
+ c
36
+ );
37
+ for (const m of p)
38
+ m.call(t.x, f);
39
+ return !f.defaultPrevented;
40
+ }
41
+ return !0;
42
+ };
43
+ }
44
+ function g(t) {
45
+ e === null && o(), e.l === null && i(), u(e).b.push(t);
46
+ }
47
+ function k(t) {
48
+ e === null && o(), e.l === null && i(), u(e).a.push(t);
49
+ }
50
+ function u(t) {
51
+ var n = (
52
+ /** @type {ComponentContextLegacy} */
53
+ t.l
54
+ );
55
+ return n.u ?? (n.u = { a: [], b: [], m: [] });
56
+ }
57
+ function w(t) {
58
+ h(t);
59
+ }
60
+ export {
61
+ k as afterUpdate,
62
+ g as beforeUpdate,
63
+ C as createEventDispatcher,
64
+ z as createRawSnippet,
65
+ w as flushSync,
66
+ S as getAllContexts,
67
+ U as getContext,
68
+ $ as hasContext,
69
+ j as hydrate,
70
+ A as mount,
71
+ b as onDestroy,
72
+ v as onMount,
73
+ M as setContext,
74
+ P as tick,
75
+ R as unmount,
76
+ r as untrack
77
+ };
@@ -0,0 +1,63 @@
1
+ import { k as f, w as o, n as b, r as i, o as l, p as d, t as p, q as v, v as m, x as g } from "./index2.js";
2
+ import { y as h, z as q, A as z } from "./index2.js";
3
+ function k(e) {
4
+ f(e, e.v + 1);
5
+ }
6
+ function x(e, t) {
7
+ const s = o(e(), (r) => {
8
+ let u = !1;
9
+ const a = b(() => {
10
+ i(() => {
11
+ const n = e();
12
+ u && r(n);
13
+ });
14
+ });
15
+ return u = !0, a;
16
+ });
17
+ return t ? {
18
+ set: t,
19
+ update: (r) => t(r(e())),
20
+ subscribe: s.subscribe
21
+ } : {
22
+ subscribe: s.subscribe
23
+ };
24
+ }
25
+ function _(e) {
26
+ let t, s = m(0), r = 0, u = g;
27
+ function a() {
28
+ return l() ? (d(s), i(() => {
29
+ if (r === 0) {
30
+ let n = !1;
31
+ u = e.subscribe((c) => {
32
+ t = c, n && k(s);
33
+ }), n = !0;
34
+ }
35
+ return r += 1, () => {
36
+ r -= 1, p().then(() => {
37
+ r === 0 && u();
38
+ });
39
+ };
40
+ }), t) : v(e);
41
+ }
42
+ return "set" in e ? {
43
+ get current() {
44
+ return a();
45
+ },
46
+ set current(n) {
47
+ e.set(n);
48
+ }
49
+ } : {
50
+ get current() {
51
+ return a();
52
+ }
53
+ };
54
+ }
55
+ export {
56
+ h as derived,
57
+ _ as fromStore,
58
+ v as get,
59
+ q as readable,
60
+ z as readonly,
61
+ x as toStore,
62
+ o as writable
63
+ };