@bquery/bquery 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -27
- package/dist/batch-x7b2eZST.js +13 -0
- package/dist/batch-x7b2eZST.js.map +1 -0
- package/dist/component/component.d.ts +69 -0
- package/dist/component/component.d.ts.map +1 -0
- package/dist/component/html.d.ts +35 -0
- package/dist/component/html.d.ts.map +1 -0
- package/dist/component/index.d.ts +3 -126
- package/dist/component/index.d.ts.map +1 -1
- package/dist/component/props.d.ts +18 -0
- package/dist/component/props.d.ts.map +1 -0
- package/dist/component/types.d.ts +77 -0
- package/dist/component/types.d.ts.map +1 -0
- package/dist/component.es.mjs +90 -59
- package/dist/component.es.mjs.map +1 -1
- package/dist/core/collection.d.ts +55 -3
- package/dist/core/collection.d.ts.map +1 -1
- package/dist/core/dom.d.ts +6 -0
- package/dist/core/dom.d.ts.map +1 -0
- package/dist/core/element.d.ts +31 -4
- package/dist/core/element.d.ts.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/utils/array.d.ts +74 -0
- package/dist/core/utils/array.d.ts.map +1 -0
- package/dist/core/utils/function.d.ts +87 -0
- package/dist/core/utils/function.d.ts.map +1 -0
- package/dist/core/utils/index.d.ts +70 -0
- package/dist/core/utils/index.d.ts.map +1 -0
- package/dist/core/utils/misc.d.ts +63 -0
- package/dist/core/utils/misc.d.ts.map +1 -0
- package/dist/core/utils/number.d.ts +65 -0
- package/dist/core/utils/number.d.ts.map +1 -0
- package/dist/core/utils/object.d.ts +133 -0
- package/dist/core/utils/object.d.ts.map +1 -0
- package/dist/core/utils/string.d.ts +80 -0
- package/dist/core/utils/string.d.ts.map +1 -0
- package/dist/core/utils/type-guards.d.ts +79 -0
- package/dist/core/utils/type-guards.d.ts.map +1 -0
- package/dist/core-BhpuvPhy.js +170 -0
- package/dist/core-BhpuvPhy.js.map +1 -0
- package/dist/core.es.mjs +495 -489
- package/dist/core.es.mjs.map +1 -1
- package/dist/full.d.ts +2 -2
- package/dist/full.d.ts.map +1 -1
- package/dist/full.es.mjs +87 -64
- package/dist/full.es.mjs.map +1 -1
- package/dist/full.iife.js +2 -2
- package/dist/full.iife.js.map +1 -1
- package/dist/full.umd.js +2 -2
- package/dist/full.umd.js.map +1 -1
- package/dist/index.es.mjs +138 -68
- package/dist/index.es.mjs.map +1 -1
- package/dist/motion/animate.d.ts +25 -0
- package/dist/motion/animate.d.ts.map +1 -0
- package/dist/motion/easing.d.ts +30 -0
- package/dist/motion/easing.d.ts.map +1 -0
- package/dist/motion/flip.d.ts +55 -0
- package/dist/motion/flip.d.ts.map +1 -0
- package/dist/motion/index.d.ts +11 -138
- package/dist/motion/index.d.ts.map +1 -1
- package/dist/motion/keyframes.d.ts +21 -0
- package/dist/motion/keyframes.d.ts.map +1 -0
- package/dist/motion/reduced-motion.d.ts +12 -0
- package/dist/motion/reduced-motion.d.ts.map +1 -0
- package/dist/motion/scroll.d.ts +15 -0
- package/dist/motion/scroll.d.ts.map +1 -0
- package/dist/motion/spring.d.ts +42 -0
- package/dist/motion/spring.d.ts.map +1 -0
- package/dist/motion/stagger.d.ts +22 -0
- package/dist/motion/stagger.d.ts.map +1 -0
- package/dist/motion/timeline.d.ts +21 -0
- package/dist/motion/timeline.d.ts.map +1 -0
- package/dist/motion/transition.d.ts +22 -0
- package/dist/motion/transition.d.ts.map +1 -0
- package/dist/motion/types.d.ts +182 -0
- package/dist/motion/types.d.ts.map +1 -0
- package/dist/motion.es.mjs +320 -61
- package/dist/motion.es.mjs.map +1 -1
- package/dist/persisted-DHoi3uEs.js +278 -0
- package/dist/persisted-DHoi3uEs.js.map +1 -0
- package/dist/platform/storage.d.ts.map +1 -1
- package/dist/platform.es.mjs +12 -7
- package/dist/platform.es.mjs.map +1 -1
- package/dist/reactive/batch.d.ts +13 -0
- package/dist/reactive/batch.d.ts.map +1 -0
- package/dist/reactive/computed.d.ts +50 -0
- package/dist/reactive/computed.d.ts.map +1 -0
- package/dist/reactive/core.d.ts +72 -0
- package/dist/reactive/core.d.ts.map +1 -0
- package/dist/reactive/effect.d.ts +15 -0
- package/dist/reactive/effect.d.ts.map +1 -0
- package/dist/reactive/index.d.ts +2 -2
- package/dist/reactive/index.d.ts.map +1 -1
- package/dist/reactive/internals.d.ts +42 -0
- package/dist/reactive/internals.d.ts.map +1 -0
- package/dist/reactive/linked.d.ts +36 -0
- package/dist/reactive/linked.d.ts.map +1 -0
- package/dist/reactive/persisted.d.ts +14 -0
- package/dist/reactive/persisted.d.ts.map +1 -0
- package/dist/reactive/readonly.d.ts +26 -0
- package/dist/reactive/readonly.d.ts.map +1 -0
- package/dist/reactive/signal.d.ts +13 -312
- package/dist/reactive/signal.d.ts.map +1 -1
- package/dist/reactive/type-guards.d.ts +20 -0
- package/dist/reactive/type-guards.d.ts.map +1 -0
- package/dist/reactive/untrack.d.ts +29 -0
- package/dist/reactive/untrack.d.ts.map +1 -0
- package/dist/reactive/watch.d.ts +42 -0
- package/dist/reactive/watch.d.ts.map +1 -0
- package/dist/reactive.es.mjs +30 -163
- package/dist/reactive.es.mjs.map +1 -1
- package/dist/router/index.d.ts +6 -252
- package/dist/router/index.d.ts.map +1 -1
- package/dist/router/links.d.ts +44 -0
- package/dist/router/links.d.ts.map +1 -0
- package/dist/router/match.d.ts +20 -0
- package/dist/router/match.d.ts.map +1 -0
- package/dist/router/navigation.d.ts +45 -0
- package/dist/router/navigation.d.ts.map +1 -0
- package/dist/router/query.d.ts +16 -0
- package/dist/router/query.d.ts.map +1 -0
- package/dist/router/router.d.ts +34 -0
- package/dist/router/router.d.ts.map +1 -0
- package/dist/router/state.d.ts +27 -0
- package/dist/router/state.d.ts.map +1 -0
- package/dist/router/types.d.ts +88 -0
- package/dist/router/types.d.ts.map +1 -0
- package/dist/router/utils.d.ts +65 -0
- package/dist/router/utils.d.ts.map +1 -0
- package/dist/router.es.mjs +168 -132
- package/dist/router.es.mjs.map +1 -1
- package/dist/sanitize-Cxvxa-DX.js +283 -0
- package/dist/sanitize-Cxvxa-DX.js.map +1 -0
- package/dist/security/constants.d.ts +42 -0
- package/dist/security/constants.d.ts.map +1 -0
- package/dist/security/csp.d.ts +24 -0
- package/dist/security/csp.d.ts.map +1 -0
- package/dist/security/index.d.ts +4 -2
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/sanitize-core.d.ts +13 -0
- package/dist/security/sanitize-core.d.ts.map +1 -0
- package/dist/security/sanitize.d.ts +5 -57
- package/dist/security/sanitize.d.ts.map +1 -1
- package/dist/security/trusted-types.d.ts +25 -0
- package/dist/security/trusted-types.d.ts.map +1 -0
- package/dist/security/types.d.ts +36 -0
- package/dist/security/types.d.ts.map +1 -0
- package/dist/security.es.mjs +50 -277
- package/dist/security.es.mjs.map +1 -1
- package/dist/store/create-store.d.ts +15 -0
- package/dist/store/create-store.d.ts.map +1 -0
- package/dist/store/define-store.d.ts +28 -0
- package/dist/store/define-store.d.ts.map +1 -0
- package/dist/store/devtools.d.ts +22 -0
- package/dist/store/devtools.d.ts.map +1 -0
- package/dist/store/index.d.ts +10 -286
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/mapping.d.ts +28 -0
- package/dist/store/mapping.d.ts.map +1 -0
- package/dist/store/persisted.d.ts +13 -0
- package/dist/store/persisted.d.ts.map +1 -0
- package/dist/store/plugins.d.ts +13 -0
- package/dist/store/plugins.d.ts.map +1 -0
- package/dist/store/registry.d.ts +28 -0
- package/dist/store/registry.d.ts.map +1 -0
- package/dist/store/types.d.ts +71 -0
- package/dist/store/types.d.ts.map +1 -0
- package/dist/store/utils.d.ts +28 -0
- package/dist/store/utils.d.ts.map +1 -0
- package/dist/store/watch.d.ts +23 -0
- package/dist/store/watch.d.ts.map +1 -0
- package/dist/store.es.mjs +22 -224
- package/dist/store.es.mjs.map +1 -1
- package/dist/type-guards-BdKlYYlS.js +32 -0
- package/dist/type-guards-BdKlYYlS.js.map +1 -0
- package/dist/untrack-DNnnqdlR.js +6 -0
- package/dist/untrack-DNnnqdlR.js.map +1 -0
- package/dist/view/directives/bind.d.ts +7 -0
- package/dist/view/directives/bind.d.ts.map +1 -0
- package/dist/view/directives/class.d.ts +8 -0
- package/dist/view/directives/class.d.ts.map +1 -0
- package/dist/view/directives/for.d.ts +23 -0
- package/dist/view/directives/for.d.ts.map +1 -0
- package/dist/view/directives/html.d.ts +7 -0
- package/dist/view/directives/html.d.ts.map +1 -0
- package/dist/view/directives/if.d.ts +7 -0
- package/dist/view/directives/if.d.ts.map +1 -0
- package/dist/view/directives/index.d.ts +12 -0
- package/dist/view/directives/index.d.ts.map +1 -0
- package/dist/view/directives/model.d.ts +7 -0
- package/dist/view/directives/model.d.ts.map +1 -0
- package/dist/view/directives/on.d.ts +7 -0
- package/dist/view/directives/on.d.ts.map +1 -0
- package/dist/view/directives/ref.d.ts +7 -0
- package/dist/view/directives/ref.d.ts.map +1 -0
- package/dist/view/directives/show.d.ts +7 -0
- package/dist/view/directives/show.d.ts.map +1 -0
- package/dist/view/directives/style.d.ts +7 -0
- package/dist/view/directives/style.d.ts.map +1 -0
- package/dist/view/directives/text.d.ts +7 -0
- package/dist/view/directives/text.d.ts.map +1 -0
- package/dist/view/evaluate.d.ts +43 -0
- package/dist/view/evaluate.d.ts.map +1 -0
- package/dist/view/index.d.ts +3 -93
- package/dist/view/index.d.ts.map +1 -1
- package/dist/view/mount.d.ts +69 -0
- package/dist/view/mount.d.ts.map +1 -0
- package/dist/view/process.d.ts +26 -0
- package/dist/view/process.d.ts.map +1 -0
- package/dist/view/types.d.ts +36 -0
- package/dist/view/types.d.ts.map +1 -0
- package/dist/view.es.mjs +358 -251
- package/dist/view.es.mjs.map +1 -1
- package/dist/watch-DXXv3iAI.js +58 -0
- package/dist/watch-DXXv3iAI.js.map +1 -0
- package/package.json +14 -14
- package/src/component/component.ts +289 -0
- package/src/component/html.ts +53 -0
- package/src/component/index.ts +40 -414
- package/src/component/props.ts +116 -0
- package/src/component/types.ts +85 -0
- package/src/core/collection.ts +181 -7
- package/src/core/dom.ts +38 -0
- package/src/core/element.ts +59 -25
- package/src/core/index.ts +48 -4
- package/src/core/utils/array.ts +102 -0
- package/src/core/utils/function.ts +151 -0
- package/src/core/utils/index.ts +83 -0
- package/src/core/utils/misc.ts +82 -0
- package/src/core/utils/number.ts +78 -0
- package/src/core/utils/object.ts +206 -0
- package/src/core/utils/string.ts +112 -0
- package/src/core/utils/type-guards.ts +112 -0
- package/src/full.ts +187 -150
- package/src/index.ts +36 -36
- package/src/motion/animate.ts +113 -0
- package/src/motion/easing.ts +40 -0
- package/src/motion/flip.ts +176 -0
- package/src/motion/index.ts +41 -358
- package/src/motion/keyframes.ts +46 -0
- package/src/motion/reduced-motion.ts +17 -0
- package/src/motion/scroll.ts +57 -0
- package/src/motion/spring.ts +150 -0
- package/src/motion/stagger.ts +43 -0
- package/src/motion/timeline.ts +246 -0
- package/src/motion/transition.ts +51 -0
- package/src/motion/types.ts +198 -0
- package/src/platform/storage.ts +215 -208
- package/src/reactive/batch.ts +22 -0
- package/src/reactive/computed.ts +92 -0
- package/src/reactive/core.ts +114 -0
- package/src/reactive/effect.ts +54 -0
- package/src/reactive/index.ts +23 -22
- package/src/reactive/internals.ts +122 -0
- package/src/reactive/linked.ts +56 -0
- package/src/reactive/persisted.ts +74 -0
- package/src/reactive/readonly.ts +35 -0
- package/src/reactive/signal.ts +20 -520
- package/src/reactive/type-guards.ts +22 -0
- package/src/reactive/untrack.ts +31 -0
- package/src/reactive/watch.ts +73 -0
- package/src/router/index.ts +41 -718
- package/src/router/links.ts +130 -0
- package/src/router/match.ts +106 -0
- package/src/router/navigation.ts +71 -0
- package/src/router/query.ts +35 -0
- package/src/router/router.ts +211 -0
- package/src/router/state.ts +46 -0
- package/src/router/types.ts +93 -0
- package/src/router/utils.ts +116 -0
- package/src/security/constants.ts +209 -0
- package/src/security/csp.ts +77 -0
- package/src/security/index.ts +4 -12
- package/src/security/sanitize-core.ts +364 -0
- package/src/security/sanitize.ts +66 -625
- package/src/security/trusted-types.ts +69 -0
- package/src/security/types.ts +40 -0
- package/src/store/create-store.ts +329 -0
- package/src/store/define-store.ts +48 -0
- package/src/store/devtools.ts +45 -0
- package/src/store/index.ts +22 -848
- package/src/store/mapping.ts +73 -0
- package/src/store/persisted.ts +61 -0
- package/src/store/plugins.ts +32 -0
- package/src/store/registry.ts +51 -0
- package/src/store/types.ts +94 -0
- package/src/store/utils.ts +141 -0
- package/src/store/watch.ts +52 -0
- package/src/view/directives/bind.ts +23 -0
- package/src/view/directives/class.ts +70 -0
- package/src/view/directives/for.ts +275 -0
- package/src/view/directives/html.ts +19 -0
- package/src/view/directives/if.ts +30 -0
- package/src/view/directives/index.ts +11 -0
- package/src/view/directives/model.ts +56 -0
- package/src/view/directives/on.ts +41 -0
- package/src/view/directives/ref.ts +41 -0
- package/src/view/directives/show.ts +26 -0
- package/src/view/directives/style.ts +47 -0
- package/src/view/directives/text.ts +15 -0
- package/src/view/evaluate.ts +290 -0
- package/src/view/index.ts +112 -1041
- package/src/view/mount.ts +200 -0
- package/src/view/process.ts +92 -0
- package/src/view/types.ts +44 -0
- package/dist/core/utils.d.ts +0 -313
- package/dist/core/utils.d.ts.map +0 -1
- package/src/core/utils.ts +0 -444
package/dist/store.es.mjs
CHANGED
|
@@ -1,229 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (e instanceof Set)
|
|
12
|
-
return new Set(Array.from(e).map(d));
|
|
13
|
-
const n = {};
|
|
14
|
-
for (const o of Object.keys(e))
|
|
15
|
-
n[o] = d(e[o]);
|
|
16
|
-
return n;
|
|
17
|
-
}, v = (e, n) => {
|
|
18
|
-
if (e === n) return !0;
|
|
19
|
-
if (e === null || n === null || typeof e != "object" || typeof n != "object") return !1;
|
|
20
|
-
if (Array.isArray(e) && Array.isArray(n))
|
|
21
|
-
return e.length !== n.length ? !1 : e.every((i, u) => v(i, n[u]));
|
|
22
|
-
if (Array.isArray(e) !== Array.isArray(n)) return !1;
|
|
23
|
-
const o = Object.keys(e), c = Object.keys(n);
|
|
24
|
-
return o.length !== c.length ? !1 : o.every(
|
|
25
|
-
(i) => v(e[i], n[i])
|
|
26
|
-
);
|
|
27
|
-
}, V = (e, n, o) => {
|
|
28
|
-
const c = [];
|
|
29
|
-
for (const i of Object.keys(n)) {
|
|
30
|
-
const u = e[i], s = n[i];
|
|
31
|
-
o.get(i) === s && // Same reference as signal
|
|
32
|
-
A(u) && A(s) && !v(u, s) && c.push(i);
|
|
33
|
-
}
|
|
34
|
-
return c;
|
|
35
|
-
}, S = (() => {
|
|
36
|
-
try {
|
|
37
|
-
const e = globalThis.process;
|
|
38
|
-
return typeof e < "u" && e.env?.NODE_ENV !== "production";
|
|
39
|
-
} catch {
|
|
40
|
-
return !0;
|
|
41
|
-
}
|
|
42
|
-
})(), j = [], x = (e) => {
|
|
43
|
-
const { id: n, state: o, getters: c = {}, actions: i = {} } = e;
|
|
44
|
-
if (p.has(n))
|
|
45
|
-
return console.warn(`bQuery store: Store "${n}" already exists. Returning existing instance.`), p.get(n);
|
|
46
|
-
const u = o(), s = /* @__PURE__ */ new Map();
|
|
47
|
-
for (const t of Object.keys(u))
|
|
48
|
-
s.set(t, D(u[t]));
|
|
49
|
-
const _ = [], w = () => {
|
|
50
|
-
const t = O();
|
|
51
|
-
for (const r of _)
|
|
52
|
-
r(t);
|
|
53
|
-
typeof window < "u" && window.__BQUERY_DEVTOOLS__?.onStateChange && window.__BQUERY_DEVTOOLS__.onStateChange(n, t);
|
|
54
|
-
}, k = new Proxy({}, {
|
|
55
|
-
get: (t, r) => {
|
|
56
|
-
const a = r;
|
|
57
|
-
if (s.has(a))
|
|
58
|
-
return s.get(a).value;
|
|
59
|
-
},
|
|
60
|
-
ownKeys: () => Array.from(s.keys()),
|
|
61
|
-
getOwnPropertyDescriptor: (t, r) => {
|
|
62
|
-
if (s.has(r))
|
|
63
|
-
return { enumerable: !0, configurable: !0 };
|
|
64
|
-
},
|
|
65
|
-
has: (t, r) => s.has(r)
|
|
66
|
-
}), O = () => ({ ...k }), b = /* @__PURE__ */ new Map(), y = {};
|
|
67
|
-
for (const t of Object.keys(u))
|
|
68
|
-
Object.defineProperty(y, t, {
|
|
69
|
-
get: () => s.get(t).value,
|
|
70
|
-
set: (r) => {
|
|
71
|
-
s.get(t).value = r, w();
|
|
72
|
-
},
|
|
73
|
-
enumerable: !0,
|
|
74
|
-
configurable: !1
|
|
75
|
-
});
|
|
76
|
-
for (const t of Object.keys(c)) {
|
|
77
|
-
const r = c[t], a = P(() => {
|
|
78
|
-
const g = k, l = new Proxy({}, {
|
|
79
|
-
get: (f, h) => {
|
|
80
|
-
const E = h;
|
|
81
|
-
if (b.has(E))
|
|
82
|
-
return b.get(E).value;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
return r(g, l);
|
|
86
|
-
});
|
|
87
|
-
b.set(t, a), Object.defineProperty(y, t, {
|
|
88
|
-
get: () => a.value,
|
|
89
|
-
enumerable: !0,
|
|
90
|
-
configurable: !1
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
for (const t of Object.keys(i)) {
|
|
94
|
-
const r = i[t];
|
|
95
|
-
y[t] = function(...a) {
|
|
96
|
-
const g = new Proxy(y, {
|
|
97
|
-
get: (l, f) => typeof f == "string" && s.has(f) ? s.get(f).value : l[f],
|
|
98
|
-
set: (l, f, h) => typeof f == "string" && s.has(f) ? (s.get(f).value = h, w(), !0) : !1
|
|
99
|
-
});
|
|
100
|
-
return r.apply(g, a);
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
Object.defineProperties(y, {
|
|
104
|
-
$id: {
|
|
105
|
-
value: n,
|
|
106
|
-
writable: !1,
|
|
107
|
-
enumerable: !1
|
|
108
|
-
},
|
|
109
|
-
$reset: {
|
|
110
|
-
value: () => {
|
|
111
|
-
const t = o();
|
|
112
|
-
m(() => {
|
|
113
|
-
for (const [r, a] of s)
|
|
114
|
-
a.value = t[r];
|
|
115
|
-
}), w();
|
|
116
|
-
},
|
|
117
|
-
writable: !1,
|
|
118
|
-
enumerable: !1
|
|
119
|
-
},
|
|
120
|
-
$subscribe: {
|
|
121
|
-
value: (t) => (_.push(t), () => {
|
|
122
|
-
const r = _.indexOf(t);
|
|
123
|
-
r > -1 && _.splice(r, 1);
|
|
124
|
-
}),
|
|
125
|
-
writable: !1,
|
|
126
|
-
enumerable: !1
|
|
127
|
-
},
|
|
128
|
-
$patch: {
|
|
129
|
-
value: (t) => {
|
|
130
|
-
m(() => {
|
|
131
|
-
if (typeof t == "function") {
|
|
132
|
-
const r = S ? d(O()) : null, a = S ? new Map(Array.from(s.entries()).map(([l, f]) => [l, f.value])) : null, g = O();
|
|
133
|
-
if (t(g), S && r && a) {
|
|
134
|
-
const l = V(r, g, a);
|
|
135
|
-
l.length > 0 && console.warn(
|
|
136
|
-
`[bQuery store "${n}"] Nested mutation detected in $patch() for keys: ${l.map(String).join(", ")}.
|
|
137
|
-
Nested object mutations do not trigger reactive updates because the store uses shallow reactivity.
|
|
138
|
-
To fix this, either:
|
|
139
|
-
1. Replace the entire object: state.user = { ...state.user, name: "New" }
|
|
140
|
-
2. Use $patchDeep() for automatic deep cloning
|
|
141
|
-
See: https://bquery.dev/guide/store#deep-reactivity`
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
for (const [l, f] of Object.entries(g))
|
|
145
|
-
s.has(l) && (s.get(l).value = f);
|
|
146
|
-
} else
|
|
147
|
-
for (const [r, a] of Object.entries(t))
|
|
148
|
-
s.has(r) && (s.get(r).value = a);
|
|
149
|
-
}), w();
|
|
150
|
-
},
|
|
151
|
-
writable: !1,
|
|
152
|
-
enumerable: !1
|
|
153
|
-
},
|
|
154
|
-
$patchDeep: {
|
|
155
|
-
value: (t) => {
|
|
156
|
-
m(() => {
|
|
157
|
-
if (typeof t == "function") {
|
|
158
|
-
const r = d(O());
|
|
159
|
-
t(r);
|
|
160
|
-
for (const [a, g] of Object.entries(r))
|
|
161
|
-
s.has(a) && (s.get(a).value = g);
|
|
162
|
-
} else
|
|
163
|
-
for (const [r, a] of Object.entries(t))
|
|
164
|
-
s.has(r) && (s.get(r).value = d(a));
|
|
165
|
-
}), w();
|
|
166
|
-
},
|
|
167
|
-
writable: !1,
|
|
168
|
-
enumerable: !1
|
|
169
|
-
},
|
|
170
|
-
$state: {
|
|
171
|
-
get: () => O(),
|
|
172
|
-
enumerable: !1
|
|
1
|
+
import { h as c, g as m, a as S, f as p } from "./persisted-DHoi3uEs.js";
|
|
2
|
+
import { c as h, d as q, l as v, m as x, e as P, b as $, r as j } from "./persisted-DHoi3uEs.js";
|
|
3
|
+
const d = (e, t) => () => c(e) ? m(e) : S({ id: e, ...t }), g = (e, t, o, s = {}) => {
|
|
4
|
+
const i = s.equals ?? (s.deep ? p : Object.is);
|
|
5
|
+
let r = t(e.$state);
|
|
6
|
+
return s.immediate && o(r, void 0), e.$subscribe((n) => {
|
|
7
|
+
const a = t(n);
|
|
8
|
+
if (!i(a, r)) {
|
|
9
|
+
const u = r;
|
|
10
|
+
r = a, o(a, u);
|
|
173
11
|
}
|
|
174
|
-
})
|
|
175
|
-
for (const t of j) {
|
|
176
|
-
const r = t({ store: y, options: e });
|
|
177
|
-
r && Object.assign(y, r);
|
|
178
|
-
}
|
|
179
|
-
return typeof window < "u" && (window.__BQUERY_DEVTOOLS__ || (window.__BQUERY_DEVTOOLS__ = { stores: /* @__PURE__ */ new Map() }), window.__BQUERY_DEVTOOLS__.stores.set(n, y), window.__BQUERY_DEVTOOLS__.onStoreCreated?.(n, y)), y;
|
|
180
|
-
}, B = (e) => p.get(e), R = () => Array.from(p.keys()), T = (e) => {
|
|
181
|
-
p.delete(e), typeof window < "u" && window.__BQUERY_DEVTOOLS__ && window.__BQUERY_DEVTOOLS__.stores.delete(e);
|
|
182
|
-
}, Q = (e) => {
|
|
183
|
-
j.push(e);
|
|
184
|
-
}, U = (e, n) => {
|
|
185
|
-
const o = n ?? `bquery-store-${e.id}`, c = e.state;
|
|
186
|
-
e.state = () => {
|
|
187
|
-
const u = c();
|
|
188
|
-
if (typeof window < "u")
|
|
189
|
-
try {
|
|
190
|
-
const s = localStorage.getItem(o);
|
|
191
|
-
if (s)
|
|
192
|
-
return { ...u, ...JSON.parse(s) };
|
|
193
|
-
} catch {
|
|
194
|
-
}
|
|
195
|
-
return u;
|
|
196
|
-
};
|
|
197
|
-
const i = x(e);
|
|
198
|
-
return i.$subscribe((u) => {
|
|
199
|
-
if (typeof window < "u")
|
|
200
|
-
try {
|
|
201
|
-
localStorage.setItem(o, JSON.stringify(u));
|
|
202
|
-
} catch {
|
|
203
|
-
}
|
|
204
|
-
}), i;
|
|
205
|
-
}, L = (e, n) => {
|
|
206
|
-
const o = {};
|
|
207
|
-
for (const c of n)
|
|
208
|
-
Object.defineProperty(o, c, {
|
|
209
|
-
get: () => e[c],
|
|
210
|
-
enumerable: !0
|
|
211
|
-
});
|
|
212
|
-
return o;
|
|
213
|
-
}, M = (e, n) => {
|
|
214
|
-
const o = {};
|
|
215
|
-
for (const c of n)
|
|
216
|
-
o[c] = (...i) => e[c](...i);
|
|
217
|
-
return o;
|
|
12
|
+
});
|
|
218
13
|
};
|
|
219
14
|
export {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
15
|
+
h as createPersistedStore,
|
|
16
|
+
S as createStore,
|
|
17
|
+
d as defineStore,
|
|
18
|
+
q as destroyStore,
|
|
19
|
+
m as getStore,
|
|
20
|
+
v as listStores,
|
|
21
|
+
x as mapActions,
|
|
22
|
+
P as mapGetters,
|
|
23
|
+
$ as mapState,
|
|
24
|
+
j as registerPlugin,
|
|
25
|
+
g as watchStore
|
|
228
26
|
};
|
|
229
27
|
//# sourceMappingURL=store.es.mjs.map
|
package/dist/store.es.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.es.mjs","sources":["../src/store/index.ts"],"sourcesContent":["/**\r\n * Minimal state management built on signals.\r\n *\r\n * This module provides a lightweight store pattern inspired by Pinia/Vuex\r\n * but built entirely on bQuery's reactive primitives. Features include:\r\n * - Signal-based reactive state\r\n * - Computed getters\r\n * - Actions with async support\r\n * - Devtools hooks for debugging\r\n * - Plugin system for extensions\r\n *\r\n * @module bquery/store\r\n *\r\n * @example\r\n * ```ts\r\n * import { createStore } from 'bquery/store';\r\n * import { effect } from 'bquery/reactive';\r\n *\r\n * const counterStore = createStore({\r\n * id: 'counter',\r\n * state: () => ({ count: 0 }),\r\n * getters: {\r\n * doubled: (state) => state.count * 2,\r\n * isPositive: (state) => state.count > 0,\r\n * },\r\n * actions: {\r\n * increment() {\r\n * this.count++;\r\n * },\r\n * async fetchAndSet(url: string) {\r\n * const response = await fetch(url);\r\n * const data = await response.json();\r\n * this.count = data.count;\r\n * },\r\n * },\r\n * });\r\n *\r\n * effect(() => {\r\n * console.log('Count:', counterStore.count);\r\n * console.log('Doubled:', counterStore.doubled);\r\n * });\r\n *\r\n * counterStore.increment();\r\n * ```\r\n */\r\n\r\nimport { batch, computed, signal, type ReadonlySignal, type Signal } from '../reactive/index';\r\n\r\n// ============================================================================\r\n// Types\r\n// ============================================================================\r\n\r\n/**\r\n * Store state factory function.\r\n */\r\nexport type StateFactory<S> = () => S;\r\n\r\n/**\r\n * Getter definition - derives computed values from state.\r\n */\r\nexport type Getters<S, G> = {\r\n [K in keyof G]: (state: S, getters: G) => G[K];\r\n};\r\n\r\n/**\r\n * Action definition - methods that can modify state.\r\n */\r\nexport type Actions<S, A> = {\r\n [K in keyof A]: A[K] extends (...args: infer P) => infer R\r\n ? (this: S & A, ...args: P) => R\r\n : never;\r\n};\r\n\r\n/**\r\n * Store definition for createStore.\r\n */\r\nexport type StoreDefinition<\r\n S extends Record<string, unknown> = Record<string, unknown>,\r\n G extends Record<string, unknown> = Record<string, unknown>,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n A extends Record<string, (...args: any[]) => any> = Record<string, never>,\r\n> = {\r\n /** Unique store identifier for devtools */\r\n id: string;\r\n /** State factory function */\r\n state: StateFactory<S>;\r\n /** Computed getters */\r\n getters?: Getters<S, G>;\r\n /** Action methods */\r\n actions?: A;\r\n};\r\n\r\n/**\r\n * The returned store instance with state, getters, and actions merged.\r\n */\r\nexport type Store<\r\n S extends Record<string, unknown>,\r\n G extends Record<string, unknown>,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n A extends Record<string, (...args: any[]) => any>,\r\n> = S &\r\n G &\r\n A & {\r\n /** Store identifier */\r\n $id: string;\r\n /** Reset state to initial values */\r\n $reset: () => void;\r\n /** Subscribe to state changes */\r\n $subscribe: (callback: (state: S) => void) => () => void;\r\n /** Patch multiple state properties at once (shallow) */\r\n $patch: (partial: Partial<S> | ((state: S) => void)) => void;\r\n /**\r\n * Patch with deep reactivity support.\r\n * Unlike $patch, this method deep-clones nested objects before mutation,\r\n * ensuring that all changes trigger reactive updates.\r\n */\r\n $patchDeep: (partial: Partial<S> | ((state: S) => void)) => void;\r\n /** Get raw state object (non-reactive snapshot) */\r\n $state: S;\r\n };\r\n\r\n/**\r\n * Plugin that can extend store functionality.\r\n */\r\nexport type StorePlugin<S = unknown> = (context: {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n store: Store<any, any, any>;\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n options: StoreDefinition<any, any, any>;\r\n}) => Partial<S> | void;\r\n\r\n// ============================================================================\r\n// Internal State\r\n// ============================================================================\r\n\r\n/** @internal Registry of all stores for devtools */\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\r\nconst storeRegistry = new Map<string, Store<any, any, any>>();\r\n\r\n// ============================================================================\r\n// Internal Utilities\r\n// ============================================================================\r\n\r\n/**\r\n * Check if a value is a plain object (not array, null, Date, etc.).\r\n * @internal\r\n */\r\nconst isPlainObject = (value: unknown): value is Record<string, unknown> => {\r\n return (\r\n value !== null && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype\r\n );\r\n};\r\n\r\n/**\r\n * Deep clones an object. Used for deep reactivity support.\r\n * @internal\r\n */\r\nconst deepClone = <T>(obj: T): T => {\r\n if (obj === null || typeof obj !== 'object') {\r\n return obj;\r\n }\r\n\r\n if (Array.isArray(obj)) {\r\n return obj.map(deepClone) as T;\r\n }\r\n\r\n if (obj instanceof Date) {\r\n return new Date(obj.getTime()) as T;\r\n }\r\n\r\n if (obj instanceof Map) {\r\n return new Map(Array.from(obj.entries()).map(([k, v]) => [k, deepClone(v)])) as T;\r\n }\r\n\r\n if (obj instanceof Set) {\r\n return new Set(Array.from(obj).map(deepClone)) as T;\r\n }\r\n\r\n const cloned = {} as T;\r\n for (const key of Object.keys(obj)) {\r\n (cloned as Record<string, unknown>)[key] = deepClone((obj as Record<string, unknown>)[key]);\r\n }\r\n return cloned;\r\n};\r\n\r\n/**\r\n * Compares two values for deep equality.\r\n * @internal\r\n */\r\nconst deepEqual = (a: unknown, b: unknown): boolean => {\r\n if (a === b) return true;\r\n if (a === null || b === null) return false;\r\n if (typeof a !== 'object' || typeof b !== 'object') return false;\r\n\r\n if (Array.isArray(a) && Array.isArray(b)) {\r\n if (a.length !== b.length) return false;\r\n return a.every((item, i) => deepEqual(item, b[i]));\r\n }\r\n\r\n if (Array.isArray(a) !== Array.isArray(b)) return false;\r\n\r\n const keysA = Object.keys(a as object);\r\n const keysB = Object.keys(b as object);\r\n\r\n if (keysA.length !== keysB.length) return false;\r\n\r\n return keysA.every((key) =>\r\n deepEqual((a as Record<string, unknown>)[key], (b as Record<string, unknown>)[key])\r\n );\r\n};\r\n\r\n/**\r\n * Detects if nested objects were mutated but the reference stayed the same.\r\n * Returns the keys where nested mutations were detected.\r\n * @internal\r\n */\r\nconst detectNestedMutations = <S extends Record<string, unknown>>(\r\n before: S,\r\n after: S,\r\n signalValues: Map<keyof S, unknown>\r\n): Array<keyof S> => {\r\n const mutatedKeys: Array<keyof S> = [];\r\n\r\n for (const key of Object.keys(after) as Array<keyof S>) {\r\n const beforeValue = before[key];\r\n const afterValue = after[key];\r\n const signalValue = signalValues.get(key);\r\n\r\n // Check if it's the same reference but content changed\r\n if (\r\n signalValue === afterValue && // Same reference as signal\r\n isPlainObject(beforeValue) &&\r\n isPlainObject(afterValue) &&\r\n !deepEqual(beforeValue, afterValue)\r\n ) {\r\n mutatedKeys.push(key);\r\n }\r\n }\r\n\r\n return mutatedKeys;\r\n};\r\n\r\n/** @internal Flag to enable/disable development warnings */\r\nconst __DEV__ = (() => {\r\n try {\r\n // Check for Node.js environment\r\n const globalProcess = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process;\r\n return typeof globalProcess !== 'undefined' && globalProcess.env?.NODE_ENV !== 'production';\r\n } catch {\r\n return true; // Default to dev mode if detection fails\r\n }\r\n})();\r\n\r\n/** @internal Registered plugins */\r\nconst plugins: StorePlugin[] = [];\r\n\r\n/** @internal Devtools hook */\r\ndeclare global {\r\n interface Window {\r\n __BQUERY_DEVTOOLS__?: {\r\n stores: Map<string, unknown>;\r\n onStoreCreated?: (id: string, store: unknown) => void;\r\n onStateChange?: (id: string, state: unknown) => void;\r\n };\r\n }\r\n}\r\n\r\n// ============================================================================\r\n// Store Creation\r\n// ============================================================================\r\n\r\n/**\r\n * Creates a reactive store with state, getters, and actions.\r\n *\r\n * @template S - State type\r\n * @template G - Getters type\r\n * @template A - Actions type\r\n * @param definition - Store definition\r\n * @returns The reactive store instance\r\n *\r\n * @example\r\n * ```ts\r\n * import { createStore } from 'bquery/store';\r\n *\r\n * // Simple counter store\r\n * const useCounter = createStore({\r\n * id: 'counter',\r\n * state: () => ({ count: 0, step: 1 }),\r\n * getters: {\r\n * doubled: (state) => state.count * 2,\r\n * next: (state) => state.count + state.step,\r\n * },\r\n * actions: {\r\n * increment() {\r\n * this.count += this.step;\r\n * },\r\n * decrement() {\r\n * this.count -= this.step;\r\n * },\r\n * setStep(newStep: number) {\r\n * this.step = newStep;\r\n * },\r\n * async loadFromServer() {\r\n * const res = await fetch('/api/counter');\r\n * const data = await res.json();\r\n * this.count = data.count;\r\n * },\r\n * },\r\n * });\r\n *\r\n * // Use the store\r\n * useCounter.increment();\r\n * console.log(useCounter.count); // 1\r\n * console.log(useCounter.doubled); // 2\r\n * ```\r\n */\r\nexport const createStore = <\r\n S extends Record<string, unknown>,\r\n G extends Record<string, unknown> = Record<string, never>,\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n A extends Record<string, (...args: any[]) => any> = Record<string, never>,\r\n>(\r\n definition: StoreDefinition<S, G, A>\r\n): Store<S, G, A> => {\r\n const { id, state: stateFactory, getters = {} as Getters<S, G>, actions = {} as A } = definition;\r\n\r\n // Check for duplicate store IDs\r\n if (storeRegistry.has(id)) {\r\n console.warn(`bQuery store: Store \"${id}\" already exists. Returning existing instance.`);\r\n return storeRegistry.get(id) as Store<S, G, A>;\r\n }\r\n\r\n // Create initial state\r\n const initialState = stateFactory();\r\n\r\n // Create signals for each state property\r\n const stateSignals = new Map<keyof S, Signal<unknown>>();\r\n for (const key of Object.keys(initialState) as Array<keyof S>) {\r\n stateSignals.set(key, signal(initialState[key]));\r\n }\r\n\r\n // Subscribers for $subscribe\r\n const subscribers: Array<(state: S) => void> = [];\r\n\r\n /**\r\n * Notifies subscribers of state changes.\r\n * @internal\r\n */\r\n const notifySubscribers = (): void => {\r\n const currentState = getCurrentState();\r\n for (const callback of subscribers) {\r\n callback(currentState);\r\n }\r\n\r\n // Notify devtools\r\n if (typeof window !== 'undefined' && window.__BQUERY_DEVTOOLS__?.onStateChange) {\r\n window.__BQUERY_DEVTOOLS__.onStateChange(id, currentState);\r\n }\r\n };\r\n\r\n /**\r\n * Cached state proxy that lazily reads signal values.\r\n * Uses a Proxy to avoid creating new objects on each access.\r\n *\r\n * **Note:** This returns a shallow snapshot of the state. Nested object\r\n * mutations will NOT trigger reactive updates. For nested reactivity,\r\n * replace the entire object or use signals for nested properties.\r\n *\r\n * @internal\r\n */\r\n const stateProxy = new Proxy({} as S, {\r\n get: (_, prop: string | symbol) => {\r\n const key = prop as keyof S;\r\n if (stateSignals.has(key)) {\r\n return stateSignals.get(key)!.value;\r\n }\r\n return undefined;\r\n },\r\n ownKeys: () => Array.from(stateSignals.keys()) as string[],\r\n getOwnPropertyDescriptor: (_, prop) => {\r\n if (stateSignals.has(prop as keyof S)) {\r\n return { enumerable: true, configurable: true };\r\n }\r\n return undefined;\r\n },\r\n has: (_, prop) => stateSignals.has(prop as keyof S),\r\n });\r\n\r\n /**\r\n * Gets the current state.\r\n *\r\n * For subscriber notifications (where a plain object snapshot is needed),\r\n * this creates a shallow copy. For internal reads, use stateProxy directly.\r\n *\r\n * **Note:** Returns a shallow snapshot. Nested object mutations will NOT\r\n * trigger reactive updates. This differs from frameworks like Pinia that\r\n * use deep reactivity. To update nested state, replace the entire object:\r\n *\r\n * @example\r\n * ```ts\r\n * // ❌ Won't trigger updates\r\n * store.user.name = 'New Name';\r\n *\r\n * // ✅ Will trigger updates\r\n * store.user = { ...store.user, name: 'New Name' };\r\n * ```\r\n *\r\n * @internal\r\n */\r\n const getCurrentState = (): S => ({ ...stateProxy });\r\n\r\n // Create computed getters\r\n const getterComputed = new Map<keyof G, ReadonlySignal<unknown>>();\r\n\r\n // Build the store proxy\r\n const store = {} as Store<S, G, A>;\r\n\r\n // Define state properties with getters/setters\r\n for (const key of Object.keys(initialState) as Array<keyof S>) {\r\n Object.defineProperty(store, key, {\r\n get: () => stateSignals.get(key)!.value,\r\n set: (value: unknown) => {\r\n stateSignals.get(key)!.value = value;\r\n notifySubscribers();\r\n },\r\n enumerable: true,\r\n configurable: false,\r\n });\r\n }\r\n\r\n // Define getters as computed properties\r\n for (const key of Object.keys(getters) as Array<keyof G>) {\r\n const getterFn = getters[key];\r\n\r\n // Create computed that reads from state signals via proxy (more efficient)\r\n const computedGetter = computed(() => {\r\n const state = stateProxy;\r\n // For getter dependencies, pass a proxy that reads from computed getters\r\n const getterProxy = new Proxy({} as G, {\r\n get: (_, prop: string | symbol) => {\r\n const propKey = prop as keyof G;\r\n if (getterComputed.has(propKey)) {\r\n return getterComputed.get(propKey)!.value;\r\n }\r\n return undefined;\r\n },\r\n });\r\n return getterFn(state, getterProxy);\r\n });\r\n\r\n getterComputed.set(key, computedGetter as unknown as ReadonlySignal<unknown>);\r\n\r\n Object.defineProperty(store, key, {\r\n get: () => computedGetter.value,\r\n enumerable: true,\r\n configurable: false,\r\n });\r\n }\r\n\r\n // Bind actions to the store context\r\n for (const key of Object.keys(actions) as Array<keyof A>) {\r\n const actionFn = actions[key];\r\n\r\n // Wrap action to enable 'this' binding\r\n (store as Record<string, unknown>)[key as string] = function (...args: unknown[]) {\r\n // Create a context that allows 'this.property' access\r\n const context = new Proxy(store, {\r\n get: (target, prop) => {\r\n if (typeof prop === 'string' && stateSignals.has(prop as keyof S)) {\r\n return stateSignals.get(prop as keyof S)!.value;\r\n }\r\n return (target as Record<string, unknown>)[prop as string];\r\n },\r\n set: (_target, prop, value) => {\r\n if (typeof prop === 'string' && stateSignals.has(prop as keyof S)) {\r\n stateSignals.get(prop as keyof S)!.value = value;\r\n notifySubscribers();\r\n return true;\r\n }\r\n return false;\r\n },\r\n });\r\n\r\n return actionFn.apply(context, args);\r\n };\r\n }\r\n\r\n // Add store utility methods\r\n Object.defineProperties(store, {\r\n $id: {\r\n value: id,\r\n writable: false,\r\n enumerable: false,\r\n },\r\n $reset: {\r\n value: () => {\r\n const fresh = stateFactory();\r\n batch(() => {\r\n for (const [key, sig] of stateSignals) {\r\n sig.value = fresh[key];\r\n }\r\n });\r\n notifySubscribers();\r\n },\r\n writable: false,\r\n enumerable: false,\r\n },\r\n $subscribe: {\r\n value: (callback: (state: S) => void) => {\r\n subscribers.push(callback);\r\n return () => {\r\n const index = subscribers.indexOf(callback);\r\n if (index > -1) subscribers.splice(index, 1);\r\n };\r\n },\r\n writable: false,\r\n enumerable: false,\r\n },\r\n $patch: {\r\n value: (partial: Partial<S> | ((state: S) => void)) => {\r\n batch(() => {\r\n if (typeof partial === 'function') {\r\n // Capture state before mutation for nested mutation detection\r\n const stateBefore = __DEV__ ? deepClone(getCurrentState()) : null;\r\n const signalValuesBefore = __DEV__\r\n ? new Map(Array.from(stateSignals.entries()).map(([k, s]) => [k, s.value]))\r\n : null;\r\n\r\n // Mutation function\r\n const state = getCurrentState();\r\n partial(state);\r\n\r\n // Detect nested mutations in development mode\r\n if (__DEV__ && stateBefore && signalValuesBefore) {\r\n const mutatedKeys = detectNestedMutations(stateBefore, state, signalValuesBefore);\r\n if (mutatedKeys.length > 0) {\r\n console.warn(\r\n `[bQuery store \"${id}\"] Nested mutation detected in $patch() for keys: ${mutatedKeys.map(String).join(', ')}.\\n` +\r\n 'Nested object mutations do not trigger reactive updates because the store uses shallow reactivity.\\n' +\r\n 'To fix this, either:\\n' +\r\n ' 1. Replace the entire object: state.user = { ...state.user, name: \"New\" }\\n' +\r\n ' 2. Use $patchDeep() for automatic deep cloning\\n' +\r\n 'See: https://bquery.dev/guide/store#deep-reactivity'\r\n );\r\n }\r\n }\r\n\r\n for (const [key, value] of Object.entries(state) as Array<[keyof S, unknown]>) {\r\n if (stateSignals.has(key)) {\r\n stateSignals.get(key)!.value = value;\r\n }\r\n }\r\n } else {\r\n // Partial object\r\n for (const [key, value] of Object.entries(partial) as Array<[keyof S, unknown]>) {\r\n if (stateSignals.has(key)) {\r\n stateSignals.get(key)!.value = value;\r\n }\r\n }\r\n }\r\n });\r\n notifySubscribers();\r\n },\r\n writable: false,\r\n enumerable: false,\r\n },\r\n $patchDeep: {\r\n value: (partial: Partial<S> | ((state: S) => void)) => {\r\n batch(() => {\r\n if (typeof partial === 'function') {\r\n // Deep clone state before mutation to ensure new references\r\n const state = deepClone(getCurrentState());\r\n partial(state);\r\n\r\n for (const [key, value] of Object.entries(state) as Array<[keyof S, unknown]>) {\r\n if (stateSignals.has(key)) {\r\n stateSignals.get(key)!.value = value;\r\n }\r\n }\r\n } else {\r\n // Deep clone each value in partial to ensure new references\r\n for (const [key, value] of Object.entries(partial) as Array<[keyof S, unknown]>) {\r\n if (stateSignals.has(key)) {\r\n stateSignals.get(key)!.value = deepClone(value);\r\n }\r\n }\r\n }\r\n });\r\n notifySubscribers();\r\n },\r\n writable: false,\r\n enumerable: false,\r\n },\r\n $state: {\r\n get: () => getCurrentState(),\r\n enumerable: false,\r\n },\r\n });\r\n\r\n // Register store\r\n storeRegistry.set(id, store);\r\n\r\n // Apply plugins\r\n for (const plugin of plugins) {\r\n const extension = plugin({ store, options: definition });\r\n if (extension) {\r\n Object.assign(store, extension);\r\n }\r\n }\r\n\r\n // Notify devtools\r\n if (typeof window !== 'undefined') {\r\n if (!window.__BQUERY_DEVTOOLS__) {\r\n window.__BQUERY_DEVTOOLS__ = { stores: new Map() };\r\n }\r\n window.__BQUERY_DEVTOOLS__.stores.set(id, store);\r\n window.__BQUERY_DEVTOOLS__.onStoreCreated?.(id, store);\r\n }\r\n\r\n return store;\r\n};\r\n\r\n// ============================================================================\r\n// Store Utilities\r\n// ============================================================================\r\n\r\n/**\r\n * Retrieves an existing store by its ID.\r\n *\r\n * @param id - The store identifier\r\n * @returns The store instance or undefined if not found\r\n *\r\n * @example\r\n * ```ts\r\n * import { getStore } from 'bquery/store';\r\n *\r\n * const counter = getStore('counter');\r\n * if (counter) {\r\n * counter.increment();\r\n * }\r\n * ```\r\n */\r\nexport const getStore = <T = unknown>(id: string): T | undefined => {\r\n return storeRegistry.get(id) as T | undefined;\r\n};\r\n\r\n/**\r\n * Lists all registered store IDs.\r\n *\r\n * @returns Array of store IDs\r\n *\r\n * @example\r\n * ```ts\r\n * import { listStores } from 'bquery/store';\r\n *\r\n * console.log('Active stores:', listStores());\r\n * ```\r\n */\r\nexport const listStores = (): string[] => {\r\n return Array.from(storeRegistry.keys());\r\n};\r\n\r\n/**\r\n * Removes a store from the registry.\r\n *\r\n * @param id - The store identifier\r\n *\r\n * @example\r\n * ```ts\r\n * import { destroyStore } from 'bquery/store';\r\n *\r\n * destroyStore('counter');\r\n * ```\r\n */\r\nexport const destroyStore = (id: string): void => {\r\n storeRegistry.delete(id);\r\n if (typeof window !== 'undefined' && window.__BQUERY_DEVTOOLS__) {\r\n window.__BQUERY_DEVTOOLS__.stores.delete(id);\r\n }\r\n};\r\n\r\n/**\r\n * Registers a plugin that extends all stores.\r\n *\r\n * @param plugin - The plugin function\r\n *\r\n * @example\r\n * ```ts\r\n * import { registerPlugin } from 'bquery/store';\r\n *\r\n * // Add localStorage persistence\r\n * registerPlugin(({ store, options }) => {\r\n * const key = `bquery-store-${options.id}`;\r\n *\r\n * // Load saved state\r\n * const saved = localStorage.getItem(key);\r\n * if (saved) {\r\n * store.$patch(JSON.parse(saved));\r\n * }\r\n *\r\n * // Save on changes\r\n * store.$subscribe((state) => {\r\n * localStorage.setItem(key, JSON.stringify(state));\r\n * });\r\n * });\r\n * ```\r\n */\r\nexport const registerPlugin = (plugin: StorePlugin): void => {\r\n plugins.push(plugin);\r\n};\r\n\r\n// ============================================================================\r\n// Composition Helpers\r\n// ============================================================================\r\n\r\n/**\r\n * Creates a store with automatic persistence to localStorage.\r\n *\r\n * @param definition - Store definition\r\n * @param storageKey - Optional custom storage key\r\n * @returns The reactive store instance\r\n *\r\n * @example\r\n * ```ts\r\n * import { createPersistedStore } from 'bquery/store';\r\n *\r\n * const settings = createPersistedStore({\r\n * id: 'settings',\r\n * state: () => ({\r\n * theme: 'dark',\r\n * language: 'en',\r\n * }),\r\n * });\r\n *\r\n * // State is automatically saved/loaded from localStorage\r\n * settings.theme = 'light';\r\n * ```\r\n */\r\nexport const createPersistedStore = <\r\n S extends Record<string, unknown>,\r\n G extends Record<string, unknown> = Record<string, never>,\r\n A extends Record<string, (...args: unknown[]) => unknown> = Record<string, never>,\r\n>(\r\n definition: StoreDefinition<S, G, A>,\r\n storageKey?: string\r\n): Store<S, G, A> => {\r\n const key = storageKey ?? `bquery-store-${definition.id}`;\r\n\r\n // Wrap state factory to load from storage\r\n const originalStateFactory = definition.state;\r\n definition.state = () => {\r\n const defaultState = originalStateFactory();\r\n\r\n if (typeof window !== 'undefined') {\r\n try {\r\n const saved = localStorage.getItem(key);\r\n if (saved) {\r\n return { ...defaultState, ...JSON.parse(saved) };\r\n }\r\n } catch {\r\n // Ignore parse errors\r\n }\r\n }\r\n\r\n return defaultState;\r\n };\r\n\r\n const store = createStore(definition);\r\n\r\n // Subscribe to save changes\r\n store.$subscribe((state) => {\r\n if (typeof window !== 'undefined') {\r\n try {\r\n localStorage.setItem(key, JSON.stringify(state));\r\n } catch {\r\n // Ignore quota errors\r\n }\r\n }\r\n });\r\n\r\n return store;\r\n};\r\n\r\n/**\r\n * Maps store state properties to a reactive object for use in components.\r\n *\r\n * @param store - The store instance\r\n * @param keys - State keys to map\r\n * @returns Object with mapped properties\r\n *\r\n * @example\r\n * ```ts\r\n * import { mapState } from 'bquery/store';\r\n *\r\n * const counter = useCounter();\r\n * const { count, step } = mapState(counter, ['count', 'step']);\r\n * ```\r\n */\r\nexport const mapState = <S extends Record<string, unknown>, K extends keyof S>(\r\n store: S,\r\n keys: K[]\r\n): Pick<S, K> => {\r\n const mapped = {} as Pick<S, K>;\r\n\r\n for (const key of keys) {\r\n Object.defineProperty(mapped, key, {\r\n get: () => store[key],\r\n enumerable: true,\r\n });\r\n }\r\n\r\n return mapped;\r\n};\r\n\r\n/**\r\n * Maps store actions to an object for easier destructuring.\r\n *\r\n * @param store - The store instance\r\n * @param keys - Action keys to map\r\n * @returns Object with mapped actions\r\n *\r\n * @example\r\n * ```ts\r\n * import { mapActions } from 'bquery/store';\r\n *\r\n * const counter = useCounter();\r\n * const { increment, decrement } = mapActions(counter, ['increment', 'decrement']);\r\n *\r\n * // Use directly\r\n * increment();\r\n * ```\r\n */\r\nexport const mapActions = <\r\n A extends Record<string, (...args: unknown[]) => unknown>,\r\n K extends keyof A,\r\n>(\r\n store: A,\r\n keys: K[]\r\n): Pick<A, K> => {\r\n const mapped = {} as Pick<A, K>;\r\n\r\n for (const key of keys) {\r\n (mapped as Record<string, unknown>)[key as string] = (...args: unknown[]) =>\r\n (store[key] as (...args: unknown[]) => unknown)(...args);\r\n }\r\n\r\n return mapped;\r\n};\r\n"],"names":["storeRegistry","isPlainObject","value","deepClone","obj","k","v","cloned","key","deepEqual","a","b","item","i","keysA","keysB","detectNestedMutations","before","after","signalValues","mutatedKeys","beforeValue","afterValue","__DEV__","globalProcess","plugins","createStore","definition","id","stateFactory","getters","actions","initialState","stateSignals","signal","subscribers","notifySubscribers","currentState","getCurrentState","callback","stateProxy","_","prop","getterComputed","store","getterFn","computedGetter","computed","state","getterProxy","propKey","actionFn","args","context","target","_target","fresh","batch","sig","index","partial","stateBefore","signalValuesBefore","s","plugin","extension","getStore","listStores","destroyStore","registerPlugin","createPersistedStore","storageKey","originalStateFactory","defaultState","saved","mapState","keys","mapped","mapActions"],"mappings":";AAyIA,MAAMA,wBAAoB,IAAA,GAUpBC,IAAgB,CAACC,MAEnBA,MAAU,QAAQ,OAAOA,KAAU,YAAY,OAAO,eAAeA,CAAK,MAAM,OAAO,WAQrFC,IAAY,CAAIC,MAAc;AAClC,MAAIA,MAAQ,QAAQ,OAAOA,KAAQ;AACjC,WAAOA;AAGT,MAAI,MAAM,QAAQA,CAAG;AACnB,WAAOA,EAAI,IAAID,CAAS;AAG1B,MAAIC,aAAe;AACjB,WAAO,IAAI,KAAKA,EAAI,SAAS;AAG/B,MAAIA,aAAe;AACjB,WAAO,IAAI,IAAI,MAAM,KAAKA,EAAI,QAAA,CAAS,EAAE,IAAI,CAAC,CAACC,GAAGC,CAAC,MAAM,CAACD,GAAGF,EAAUG,CAAC,CAAC,CAAC,CAAC;AAG7E,MAAIF,aAAe;AACjB,WAAO,IAAI,IAAI,MAAM,KAAKA,CAAG,EAAE,IAAID,CAAS,CAAC;AAG/C,QAAMI,IAAS,CAAA;AACf,aAAWC,KAAO,OAAO,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B/B,GACAgC,MACe;AACf,QAAMC,IAAS,CAAA;AAEf,aAAWrE,KAAOoE;AAChB,WAAO,eAAeC,GAAQrE,GAAK;AAAA,MACjC,KAAK,MAAMoC,EAAMpC,CAAG;AAAA,MACpB,YAAY;AAAA,IAAA,CACb;AAGH,SAAOqE;AACT,GAoBaC,IAAa,CAIxBlC,GACAgC,MACe;AACf,QAAMC,IAAS,CAAA;AAEf,aAAWrE,KAAOoE;AACf,IAAAC,EAAmCrE,CAAa,IAAI,IAAI4C,MACtDR,EAAMpC,CAAG,EAAsC,GAAG4C,CAAI;AAG3D,SAAOyB;AACT;"}
|
|
1
|
+
{"version":3,"file":"store.es.mjs","sources":["../src/store/define-store.ts","../src/store/watch.ts"],"sourcesContent":["/**\n * Store factory helpers.\n */\n\nimport { createStore } from './create-store';\nimport { getStore, hasStore } from './registry';\nimport type { Store, StoreDefinition } from './types';\n\n/**\n * Creates a store factory that returns the store instance.\n *\n * The store is lazily created on first call and cached in the global store\n * registry. Subsequent calls return the same instance. After calling\n * `destroyStore(id)`, the next factory call will create a fresh store.\n *\n * @param id - Store identifier\n * @param definition - Store definition without id\n * @returns A function that returns the store instance\n *\n * @example\n * ```ts\n * const useCounter = defineStore('counter', {\n * state: () => ({ count: 0 }),\n * actions: { increment() { this.count++; } },\n * });\n *\n * const counter = useCounter();\n * counter.increment();\n * ```\n */\nexport const defineStore = <\n S extends Record<string, unknown>,\n G extends Record<string, unknown> = Record<string, never>,\n A extends Record<string, (...args: unknown[]) => unknown> = Record<string, never>,\n>(\n id: string,\n definition: Omit<StoreDefinition<S, G, A>, 'id'>\n): (() => Store<S, G, A>) => {\n // Check registry first to avoid noisy warnings from createStore()\n // when the factory is called multiple times (intended usage pattern).\n // createStore() only called when store doesn't exist or was destroyed.\n return () => {\n if (hasStore(id)) {\n return getStore(id) as Store<S, G, A>;\n }\n return createStore({ id, ...definition });\n };\n};\n","/**\n * Store watch helpers.\n */\n\nimport type { Store } from './types';\nimport { deepEqual } from './utils';\n\nexport type WatchStoreOptions<T> = {\n /** Call the callback immediately with the current value. */\n immediate?: boolean;\n /** Use deep comparison when determining changes. */\n deep?: boolean;\n /** Custom equality check for selected values. */\n equals?: (a: T, b: T) => boolean;\n};\n\n/**\n * Watch a selected slice of store state.\n *\n * @param store - The store instance\n * @param selector - Function to select the watched value\n * @param callback - Called when the selected value changes\n * @param options - Watch options\n * @returns Unsubscribe function\n */\nexport const watchStore = <\n S extends Record<string, unknown>,\n G extends Record<string, unknown>,\n A extends Record<string, (...args: unknown[]) => unknown>,\n T,\n>(\n store: Store<S, G, A>,\n selector: (state: S) => T,\n callback: (value: T, previous: T | undefined) => void,\n options: WatchStoreOptions<T> = {}\n): (() => void) => {\n const equals = options.equals ?? (options.deep ? deepEqual : Object.is);\n let previous = selector(store.$state);\n\n if (options.immediate) {\n callback(previous, undefined);\n }\n\n return store.$subscribe((state) => {\n const current = selector(state);\n if (!equals(current, previous)) {\n const prev = previous;\n previous = current;\n callback(current, prev);\n }\n });\n};\n"],"names":["defineStore","id","definition","hasStore","getStore","createStore","watchStore","store","selector","callback","options","equals","deepEqual","previous","state","current","prev"],"mappings":";;AA8BO,MAAMA,IAAc,CAKzBC,GACAC,MAKO,MACDC,EAASF,CAAE,IACNG,EAASH,CAAE,IAEbI,EAAY,EAAE,IAAAJ,GAAI,GAAGC,GAAY,GCpB/BI,IAAa,CAMxBC,GACAC,GACAC,GACAC,IAAgC,CAAA,MACf;AACjB,QAAMC,IAASD,EAAQ,WAAWA,EAAQ,OAAOE,IAAY,OAAO;AACpE,MAAIC,IAAWL,EAASD,EAAM,MAAM;AAEpC,SAAIG,EAAQ,aACVD,EAASI,GAAU,MAAS,GAGvBN,EAAM,WAAW,CAACO,MAAU;AACjC,UAAMC,IAAUP,EAASM,CAAK;AAC9B,QAAI,CAACH,EAAOI,GAASF,CAAQ,GAAG;AAC9B,YAAMG,IAAOH;AACb,MAAAA,IAAWE,GACXN,EAASM,GAASC,CAAI;AAAA,IACxB;AAAA,EACF,CAAC;AACH;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { a, t as c, C as i, S as f } from "./core-BhpuvPhy.js";
|
|
2
|
+
const u = (e) => {
|
|
3
|
+
let r, n = !1;
|
|
4
|
+
const s = () => {
|
|
5
|
+
if (r) {
|
|
6
|
+
try {
|
|
7
|
+
r();
|
|
8
|
+
} catch (o) {
|
|
9
|
+
console.error("bQuery reactive: Error in effect cleanup", o);
|
|
10
|
+
}
|
|
11
|
+
r = void 0;
|
|
12
|
+
}
|
|
13
|
+
}, t = () => {
|
|
14
|
+
if (!n) {
|
|
15
|
+
s(), a(t);
|
|
16
|
+
try {
|
|
17
|
+
r = c(t, e);
|
|
18
|
+
} catch (o) {
|
|
19
|
+
console.error("bQuery reactive: Error in effect", o);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
return t(), () => {
|
|
24
|
+
n = !0, s(), a(t);
|
|
25
|
+
};
|
|
26
|
+
}, p = (e) => e instanceof f, d = (e) => e instanceof i;
|
|
27
|
+
export {
|
|
28
|
+
p as a,
|
|
29
|
+
u as e,
|
|
30
|
+
d as i
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=type-guards-BdKlYYlS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-guards-BdKlYYlS.js","sources":["../src/reactive/effect.ts","../src/reactive/type-guards.ts"],"sourcesContent":["/**\r\n * Reactive effects.\r\n */\r\n\r\nimport { CleanupFn, Observer, track, clearDependencies } from './internals';\r\n\r\n/**\r\n * Creates a side effect that automatically re-runs when dependencies change.\r\n *\r\n * The effect runs immediately upon creation and then re-runs whenever\r\n * any signal or computed value read inside it changes.\r\n *\r\n * @param fn - The effect function to run\r\n * @returns A cleanup function to stop the effect\r\n */\r\nexport const effect = (fn: () => void | CleanupFn): CleanupFn => {\r\n let cleanupFn: CleanupFn | void;\r\n let isDisposed = false;\r\n\r\n const runCleanup = (): void => {\r\n if (cleanupFn) {\r\n try {\r\n cleanupFn();\r\n } catch (error) {\r\n console.error('bQuery reactive: Error in effect cleanup', error);\r\n }\r\n cleanupFn = undefined;\r\n }\r\n };\r\n\r\n const observer: Observer = () => {\r\n if (isDisposed) return;\r\n\r\n runCleanup();\r\n\r\n // Clear old dependencies before running to avoid stale subscriptions\r\n clearDependencies(observer);\r\n\r\n try {\r\n cleanupFn = track(observer, fn);\r\n } catch (error) {\r\n console.error('bQuery reactive: Error in effect', error);\r\n }\r\n };\r\n\r\n observer();\r\n\r\n return () => {\r\n isDisposed = true;\r\n runCleanup();\r\n // Clean up all dependencies when effect is disposed\r\n clearDependencies(observer);\r\n };\r\n};\r\n","/**\n * Type guards for reactive primitives.\n */\n\nimport { Computed } from './computed';\nimport { Signal } from './core';\n\n/**\n * Type guard to check if a value is a Signal instance.\n *\n * @param value - The value to check\n * @returns True if the value is a Signal\n */\nexport const isSignal = (value: unknown): value is Signal<unknown> => value instanceof Signal;\n\n/**\n * Type guard to check if a value is a Computed instance.\n *\n * @param value - The value to check\n * @returns True if the value is a Computed\n */\nexport const isComputed = (value: unknown): value is Computed<unknown> => value instanceof Computed;\n"],"names":["effect","fn","cleanupFn","isDisposed","runCleanup","error","observer","clearDependencies","track","isSignal","value","Signal","isComputed","Computed"],"mappings":";AAeO,MAAMA,IAAS,CAACC,MAA0C;AAC/D,MAAIC,GACAC,IAAa;AAEjB,QAAMC,IAAa,MAAY;AAC7B,QAAIF,GAAW;AACb,UAAI;AACF,QAAAA,EAAA;AAAA,MACF,SAASG,GAAO;AACd,gBAAQ,MAAM,4CAA4CA,CAAK;AAAA,MACjE;AACA,MAAAH,IAAY;AAAA,IACd;AAAA,EACF,GAEMI,IAAqB,MAAM;AAC/B,QAAI,CAAAH,GAEJ;AAAA,MAAAC,EAAA,GAGAG,EAAkBD,CAAQ;AAE1B,UAAI;AACF,QAAAJ,IAAYM,EAAMF,GAAUL,CAAE;AAAA,MAChC,SAASI,GAAO;AACd,gBAAQ,MAAM,oCAAoCA,CAAK;AAAA,MACzD;AAAA;AAAA,EACF;AAEA,SAAAC,EAAA,GAEO,MAAM;AACX,IAAAH,IAAa,IACbC,EAAA,GAEAG,EAAkBD,CAAQ;AAAA,EAC5B;AACF,GCxCaG,IAAW,CAACC,MAA6CA,aAAiBC,GAQ1EC,IAAa,CAACF,MAA+CA,aAAiBG;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"untrack-DNnnqdlR.js","sources":["../src/reactive/untrack.ts"],"sourcesContent":["/**\n * Dependency tracking control helpers.\n */\n\nimport { withoutCurrentObserver } from './internals';\n\n/**\n * Executes a function without tracking any signal dependencies.\n * Useful when reading a signal value without creating a reactive dependency.\n *\n * This implementation temporarily hides the current observer rather than\n * disabling tracking globally. This ensures that nested reactive internals\n * (e.g., computed recomputation triggered during untrack) can still properly\n * track their own dependencies.\n *\n * @template T - The return type of the function\n * @param fn - The function to execute without tracking\n * @returns The result of the function\n *\n * @example\n * ```ts\n * const count = signal(0);\n * effect(() => {\n * // This read creates a dependency\n * console.log(count.value);\n * // This read does not create a dependency\n * const snapshot = untrack(() => count.value);\n * });\n * ```\n */\nexport const untrack = <T>(fn: () => T): T => withoutCurrentObserver(fn);\n"],"names":["untrack","fn","withoutCurrentObserver"],"mappings":";AA8BO,MAAMA,IAAU,CAAIC,MAAmBC,EAAuBD,CAAE;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../../../src/view/directives/bind.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,MAAM,KAAG,gBAc7C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DirectiveHandler } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Handles bq-class directive - dynamic class binding.
|
|
4
|
+
* Tracks previously added classes to ensure proper cleanup when expressions change.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare const handleClass: DirectiveHandler;
|
|
8
|
+
//# sourceMappingURL=class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../../src/view/directives/class.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,gBA4DzB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type CleanupFn } from '../../reactive/index';
|
|
2
|
+
import type { BindingContext, DirectiveHandler } from '../types';
|
|
3
|
+
type ProcessElementFn = (el: Element, context: BindingContext, prefix: string, cleanups: CleanupFn[]) => void;
|
|
4
|
+
type ProcessChildrenFn = (el: Element, context: BindingContext, prefix: string, cleanups: CleanupFn[]) => void;
|
|
5
|
+
/**
|
|
6
|
+
* Handles bq-for directive - list rendering with keyed reconciliation.
|
|
7
|
+
*
|
|
8
|
+
* Supports optional `:key` attribute for efficient DOM reuse:
|
|
9
|
+
* ```html
|
|
10
|
+
* <li bq-for="item in items" :key="item.id">...</li>
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* Without a key, falls back to index-based tracking (less efficient for reordering).
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export declare const createForHandler: (options: {
|
|
18
|
+
prefix: string;
|
|
19
|
+
processElement: ProcessElementFn;
|
|
20
|
+
processChildren: ProcessChildrenFn;
|
|
21
|
+
}) => DirectiveHandler;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=for.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"for.d.ts","sourceRoot":"","sources":["../../../src/view/directives/for.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,SAAS,EAAe,MAAM,sBAAsB,CAAC;AAEnF,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjE,KAAK,gBAAgB,GAAG,CACtB,EAAE,EAAE,OAAO,EACX,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,KAClB,IAAI,CAAC;AAEV,KAAK,iBAAiB,GAAG,CACvB,EAAE,EAAE,OAAO,EACX,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,EAAE,KAClB,IAAI,CAAC;AA2CV;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,SAAS;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,gBAAgB,CAAC;IACjC,eAAe,EAAE,iBAAiB,CAAC;CACpC,KAAG,gBAuMH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/view/directives/html.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,UAAU,OAAO,KAAG,gBAS9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"if.d.ts","sourceRoot":"","sources":["../../../src/view/directives/if.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,gBAqBtB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { handleBind } from './bind';
|
|
2
|
+
export { handleClass } from './class';
|
|
3
|
+
export { createForHandler } from './for';
|
|
4
|
+
export { handleHtml } from './html';
|
|
5
|
+
export { handleIf } from './if';
|
|
6
|
+
export { handleModel } from './model';
|
|
7
|
+
export { handleOn } from './on';
|
|
8
|
+
export { handleRef } from './ref';
|
|
9
|
+
export { handleShow } from './show';
|
|
10
|
+
export { handleStyle } from './style';
|
|
11
|
+
export { handleText } from './text';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/directives/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/view/directives/model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,gBA+CzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"on.d.ts","sourceRoot":"","sources":["../../../src/view/directives/on.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,WAAW,MAAM,KAAG,gBAiC5C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../../src/view/directives/ref.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAgBjD;;;GAGG;AACH,eAAO,MAAM,SAAS,EAAE,gBAkBvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/view/directives/show.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,gBAiBxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/view/directives/style.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,gBAsCzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/view/directives/text.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEjD;;;GAGG;AACH,eAAO,MAAM,UAAU,EAAE,gBAMxB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BindingContext } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Clears all cached compiled expression functions.
|
|
4
|
+
* Call this when unmounting views or to free memory after heavy template usage.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { clearExpressionCache } from 'bquery/view';
|
|
9
|
+
*
|
|
10
|
+
* // After destroying a view or when cleaning up
|
|
11
|
+
* clearExpressionCache();
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const clearExpressionCache: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Evaluates an expression in the given context using `new Function()`.
|
|
17
|
+
*
|
|
18
|
+
* Signals and computed values in the context are lazily unwrapped only when
|
|
19
|
+
* accessed by the expression, avoiding unnecessary subscriptions to unused values.
|
|
20
|
+
*
|
|
21
|
+
* @security **WARNING:** This function uses dynamic code execution via `new Function()`.
|
|
22
|
+
* - NEVER pass expressions derived from user input or untrusted sources
|
|
23
|
+
* - Expressions should only come from developer-controlled templates
|
|
24
|
+
* - Malicious expressions can access and exfiltrate context data
|
|
25
|
+
* - Consider this equivalent to `eval()` in terms of security implications
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
|
+
export declare const evaluate: <T = unknown>(expression: string, context: BindingContext) => T;
|
|
30
|
+
/**
|
|
31
|
+
* Evaluates an expression and returns the raw value (for signal access).
|
|
32
|
+
*
|
|
33
|
+
* @security **WARNING:** Uses dynamic code execution. See {@link evaluate} for security notes.
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
export declare const evaluateRaw: <T = unknown>(expression: string, context: BindingContext) => T;
|
|
37
|
+
/**
|
|
38
|
+
* Parses object expression like "{ active: isActive, disabled: !enabled }".
|
|
39
|
+
* Handles nested structures like function calls, arrays, and template literals.
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
export declare const parseObjectExpression: (expression: string) => Record<string, string>;
|
|
43
|
+
//# sourceMappingURL=evaluate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/view/evaluate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AA4D9C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,QAAO,IAGvC,CAAC;AA8BF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,GAAG,OAAO,EAAE,YAAY,MAAM,EAAE,SAAS,cAAc,KAAG,CAoBnF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,GAAG,OAAO,EAAE,YAAY,MAAM,EAAE,SAAS,cAAc,KAAG,CAiBtF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,YAAY,MAAM,KAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAqH/E,CAAC"}
|