@bquery/bquery 1.3.0 → 1.5.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 +546 -501
- package/dist/component/component.d.ts.map +1 -1
- package/dist/component/index.d.ts +2 -0
- package/dist/component/index.d.ts.map +1 -1
- package/dist/component/library.d.ts +34 -0
- package/dist/component/library.d.ts.map +1 -0
- package/dist/component/types.d.ts +10 -6
- package/dist/component/types.d.ts.map +1 -1
- package/dist/component-CY5MVoYN.js +531 -0
- package/dist/component-CY5MVoYN.js.map +1 -0
- package/dist/component.es.mjs +6 -184
- package/dist/config-DRmZZno3.js +40 -0
- package/dist/config-DRmZZno3.js.map +1 -0
- package/dist/core/collection.d.ts +19 -3
- package/dist/core/collection.d.ts.map +1 -1
- package/dist/core/element.d.ts +23 -4
- package/dist/core/element.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/utils/function.d.ts +21 -4
- package/dist/core/utils/function.d.ts.map +1 -1
- package/dist/core-CK2Mfpf4.js +648 -0
- package/dist/core-CK2Mfpf4.js.map +1 -0
- package/dist/core-DPdbItcq.js +112 -0
- package/dist/core-DPdbItcq.js.map +1 -0
- package/dist/core.es.mjs +45 -1218
- package/dist/full.d.ts +6 -6
- package/dist/full.d.ts.map +1 -1
- package/dist/full.es.mjs +98 -92
- package/dist/full.iife.js +173 -3
- package/dist/full.iife.js.map +1 -1
- package/dist/full.umd.js +173 -3
- package/dist/full.umd.js.map +1 -1
- package/dist/index.es.mjs +143 -139
- package/dist/motion/transition.d.ts +1 -1
- package/dist/motion/transition.d.ts.map +1 -1
- package/dist/motion/types.d.ts +11 -1
- package/dist/motion/types.d.ts.map +1 -1
- package/dist/motion-C5DRdPnO.js +415 -0
- package/dist/motion-C5DRdPnO.js.map +1 -0
- package/dist/motion.es.mjs +25 -361
- package/dist/object-qGpWr6-J.js +38 -0
- package/dist/object-qGpWr6-J.js.map +1 -0
- package/dist/platform/announcer.d.ts +59 -0
- package/dist/platform/announcer.d.ts.map +1 -0
- package/dist/platform/config.d.ts +92 -0
- package/dist/platform/config.d.ts.map +1 -0
- package/dist/platform/cookies.d.ts +45 -0
- package/dist/platform/cookies.d.ts.map +1 -0
- package/dist/platform/index.d.ts +8 -0
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/meta.d.ts +62 -0
- package/dist/platform/meta.d.ts.map +1 -0
- package/dist/platform/storage.d.ts.map +1 -1
- package/dist/platform-B7JhGBc7.js +361 -0
- package/dist/platform-B7JhGBc7.js.map +1 -0
- package/dist/platform.es.mjs +11 -243
- package/dist/reactive/async-data.d.ts +114 -0
- package/dist/reactive/async-data.d.ts.map +1 -0
- package/dist/reactive/core.d.ts +12 -0
- package/dist/reactive/core.d.ts.map +1 -1
- package/dist/reactive/effect.d.ts.map +1 -1
- package/dist/reactive/index.d.ts +2 -2
- package/dist/reactive/index.d.ts.map +1 -1
- package/dist/reactive/internals.d.ts +6 -0
- package/dist/reactive/internals.d.ts.map +1 -1
- package/dist/reactive/signal.d.ts +2 -0
- package/dist/reactive/signal.d.ts.map +1 -1
- package/dist/reactive-BDya-ia8.js +253 -0
- package/dist/reactive-BDya-ia8.js.map +1 -0
- package/dist/reactive.es.mjs +18 -34
- package/dist/router-CijiICxt.js +188 -0
- package/dist/router-CijiICxt.js.map +1 -0
- package/dist/router.es.mjs +11 -200
- package/dist/sanitize-jyJ2ryE2.js +302 -0
- package/dist/sanitize-jyJ2ryE2.js.map +1 -0
- package/dist/security/constants.d.ts.map +1 -1
- package/dist/security/sanitize-core.d.ts.map +1 -1
- package/dist/security.es.mjs +10 -56
- package/dist/store-CPK9E62U.js +262 -0
- package/dist/store-CPK9E62U.js.map +1 -0
- package/dist/store.es.mjs +12 -25
- package/dist/view/evaluate.d.ts.map +1 -1
- package/dist/view-Cdi0g-qo.js +396 -0
- package/dist/view-Cdi0g-qo.js.map +1 -0
- package/dist/view.es.mjs +10 -424
- package/package.json +136 -132
- package/src/component/component.ts +319 -289
- package/src/component/index.ts +42 -40
- package/src/component/library.ts +504 -0
- package/src/component/types.ts +91 -85
- package/src/core/collection.ts +44 -4
- package/src/core/element.ts +33 -5
- package/src/core/index.ts +1 -0
- package/src/core/utils/function.ts +56 -15
- package/src/full.ts +223 -187
- package/src/motion/transition.ts +97 -51
- package/src/motion/types.ts +208 -198
- package/src/platform/announcer.ts +208 -0
- package/src/platform/config.ts +163 -0
- package/src/platform/cookies.ts +165 -0
- package/src/platform/index.ts +39 -18
- package/src/platform/meta.ts +168 -0
- package/src/platform/storage.ts +8 -1
- package/src/reactive/async-data.ts +486 -0
- package/src/reactive/core.ts +21 -0
- package/src/reactive/effect.ts +18 -7
- package/src/reactive/index.ts +37 -23
- package/src/reactive/internals.ts +18 -1
- package/src/reactive/signal.ts +29 -20
- package/src/security/constants.ts +211 -209
- package/src/security/sanitize-core.ts +22 -1
- package/src/view/evaluate.ts +29 -13
- package/dist/batch-4LAvfLE7.js +0 -13
- package/dist/batch-4LAvfLE7.js.map +0 -1
- package/dist/component.es.mjs.map +0 -1
- package/dist/core-COenAZjD.js +0 -145
- package/dist/core-COenAZjD.js.map +0 -1
- package/dist/core.es.mjs.map +0 -1
- package/dist/full.es.mjs.map +0 -1
- package/dist/index.es.mjs.map +0 -1
- package/dist/motion.es.mjs.map +0 -1
- package/dist/persisted-Dz_ryNuC.js +0 -278
- package/dist/persisted-Dz_ryNuC.js.map +0 -1
- package/dist/platform.es.mjs.map +0 -1
- package/dist/reactive.es.mjs.map +0 -1
- package/dist/router.es.mjs.map +0 -1
- package/dist/sanitize-1FBEPAFH.js +0 -272
- package/dist/sanitize-1FBEPAFH.js.map +0 -1
- package/dist/security.es.mjs.map +0 -1
- package/dist/store.es.mjs.map +0 -1
- package/dist/type-guards-DRma3-Kc.js +0 -16
- package/dist/type-guards-DRma3-Kc.js.map +0 -1
- package/dist/untrack-BuEQKH7_.js +0 -6
- package/dist/untrack-BuEQKH7_.js.map +0 -1
- package/dist/view.es.mjs.map +0 -1
- package/dist/watch-CXyaBC_9.js +0 -58
- package/dist/watch-CXyaBC_9.js.map +0 -1
package/dist/motion.es.mjs
CHANGED
|
@@ -1,363 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
const r = t.style;
|
|
3
|
-
if (Array.isArray(e)) {
|
|
4
|
-
const o = e[e.length - 1];
|
|
5
|
-
if (!o) return;
|
|
6
|
-
for (const [i, s] of Object.entries(o))
|
|
7
|
-
if (!(i === "offset" || i === "easing" || i === "composite") && $(s)) {
|
|
8
|
-
const a = i.startsWith("--") ? i : v(i);
|
|
9
|
-
r.setProperty(a, String(s));
|
|
10
|
-
}
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
for (const [o, i] of Object.entries(e)) {
|
|
14
|
-
if (o === "offset" || o === "easing" || o === "composite") continue;
|
|
15
|
-
const s = Array.isArray(i) ? i[i.length - 1] : i;
|
|
16
|
-
if ($(s)) {
|
|
17
|
-
const a = o.startsWith("--") ? o : v(o);
|
|
18
|
-
r.setProperty(a, String(s));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}, P = (t, e) => {
|
|
22
|
-
const { keyframes: n, options: r, commitStyles: o = !0, respectReducedMotion: i = !0, onFinish: s } = e;
|
|
23
|
-
if (i && A())
|
|
24
|
-
return o && w(t, n), s?.(), Promise.resolve();
|
|
25
|
-
const a = t;
|
|
26
|
-
return typeof a.animate != "function" ? (o && w(t, n), s?.(), Promise.resolve()) : new Promise((m) => {
|
|
27
|
-
const f = a.animate(n, r);
|
|
28
|
-
let u = !1;
|
|
29
|
-
const p = () => {
|
|
30
|
-
u || (u = !0, o && (typeof f.commitStyles == "function" ? f.commitStyles() : w(t, n)), f.cancel(), s?.(), m());
|
|
31
|
-
};
|
|
32
|
-
f.onfinish = p, f.finished && f.finished.then(p).catch(p);
|
|
33
|
-
});
|
|
34
|
-
}, y = (t) => Math.min(1, Math.max(0, t)), C = (t) => y(t), D = (t) => y(t * t), T = (t) => y(1 - (1 - t) * (1 - t)), z = (t) => y(t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2), R = (t) => y(t * t * t), X = (t) => y(1 - Math.pow(1 - t, 3)), L = (t) => y(t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2), W = (t) => y(1 + 2.70158 * Math.pow(t - 1, 3) + 1.70158 * Math.pow(t - 1, 2)), Y = (t) => y(t === 1 ? 1 : 1 - Math.pow(2, -10 * t)), G = {
|
|
35
|
-
linear: C,
|
|
36
|
-
easeInQuad: D,
|
|
37
|
-
easeOutQuad: T,
|
|
38
|
-
easeInOutQuad: z,
|
|
39
|
-
easeInCubic: R,
|
|
40
|
-
easeOutCubic: X,
|
|
41
|
-
easeInOutCubic: L,
|
|
42
|
-
easeOutBack: W,
|
|
43
|
-
easeOutExpo: Y
|
|
44
|
-
}, S = (t) => {
|
|
45
|
-
const e = t.getBoundingClientRect();
|
|
46
|
-
return {
|
|
47
|
-
top: e.top,
|
|
48
|
-
left: e.left,
|
|
49
|
-
width: e.width,
|
|
50
|
-
height: e.height
|
|
51
|
-
};
|
|
52
|
-
}, x = (t, e, n = {}) => {
|
|
53
|
-
const { duration: r = 300, easing: o = "ease-out", onComplete: i } = n, s = S(t);
|
|
54
|
-
if (s.width === 0 || s.height === 0)
|
|
55
|
-
return i?.(), Promise.resolve();
|
|
56
|
-
const a = e.left - s.left, m = e.top - s.top, f = e.width / s.width, u = e.height / s.height;
|
|
57
|
-
if (a === 0 && m === 0 && f === 1 && u === 1)
|
|
58
|
-
return i?.(), Promise.resolve();
|
|
59
|
-
const p = t;
|
|
60
|
-
return typeof p.animate != "function" ? (i?.(), Promise.resolve()) : (p.style.transform = `translate(${a}px, ${m}px) scale(${f}, ${u})`, p.style.transformOrigin = "top left", p.offsetHeight, new Promise((h) => {
|
|
61
|
-
const c = p.animate(
|
|
62
|
-
[
|
|
63
|
-
{
|
|
64
|
-
transform: `translate(${a}px, ${m}px) scale(${f}, ${u})`
|
|
65
|
-
},
|
|
66
|
-
{ transform: "translate(0, 0) scale(1, 1)" }
|
|
67
|
-
],
|
|
68
|
-
{ duration: r, easing: o, fill: "forwards" }
|
|
69
|
-
);
|
|
70
|
-
let d = !1;
|
|
71
|
-
const l = () => {
|
|
72
|
-
d || (d = !0, p.style.transform = "", p.style.transformOrigin = "", i?.(), h());
|
|
73
|
-
};
|
|
74
|
-
c.onfinish = l, c.finished && c.finished.then(l).catch(l);
|
|
75
|
-
}));
|
|
76
|
-
}, Q = async (t, e, n = {}) => {
|
|
77
|
-
await _(t, e, n);
|
|
78
|
-
}, _ = async (t, e, n = {}) => {
|
|
79
|
-
const { stagger: r, ...o } = n, i = /* @__PURE__ */ new Map();
|
|
80
|
-
for (const m of t)
|
|
81
|
-
i.set(m, S(m));
|
|
82
|
-
e();
|
|
83
|
-
const s = t.length, a = t.map((m, f) => {
|
|
84
|
-
const u = i.get(m);
|
|
85
|
-
if (!u) return Promise.resolve();
|
|
86
|
-
const p = r ? r(f, s) : 0;
|
|
87
|
-
return p > 0 ? new Promise((h) => setTimeout(h, p)).then(
|
|
88
|
-
() => x(m, u, o)
|
|
89
|
-
) : x(m, u, o);
|
|
90
|
-
});
|
|
91
|
-
await Promise.all(a);
|
|
92
|
-
}, j = {
|
|
93
|
-
fadeIn: (t = 0, e = 1) => [{ opacity: t }, { opacity: e }],
|
|
94
|
-
fadeOut: (t = 1, e = 0) => [{ opacity: t }, { opacity: e }],
|
|
95
|
-
slideInUp: (t = 16) => [
|
|
96
|
-
{ opacity: 0, transform: `translateY(${t}px)` },
|
|
97
|
-
{ opacity: 1, transform: "translateY(0)" }
|
|
98
|
-
],
|
|
99
|
-
slideInDown: (t = 16) => [
|
|
100
|
-
{ opacity: 0, transform: `translateY(-${t}px)` },
|
|
101
|
-
{ opacity: 1, transform: "translateY(0)" }
|
|
102
|
-
],
|
|
103
|
-
slideInLeft: (t = 16) => [
|
|
104
|
-
{ opacity: 0, transform: `translateX(${t}px)` },
|
|
105
|
-
{ opacity: 1, transform: "translateX(0)" }
|
|
106
|
-
],
|
|
107
|
-
slideInRight: (t = 16) => [
|
|
108
|
-
{ opacity: 0, transform: `translateX(-${t}px)` },
|
|
109
|
-
{ opacity: 1, transform: "translateX(0)" }
|
|
110
|
-
],
|
|
111
|
-
scaleIn: (t = 0.95, e = 1) => [
|
|
112
|
-
{ opacity: 0, transform: `scale(${t})` },
|
|
113
|
-
{ opacity: 1, transform: `scale(${e})` }
|
|
114
|
-
],
|
|
115
|
-
scaleOut: (t = 1, e = 0.95) => [
|
|
116
|
-
{ opacity: 1, transform: `scale(${t})` },
|
|
117
|
-
{ opacity: 0, transform: `scale(${e})` }
|
|
118
|
-
],
|
|
119
|
-
pop: (t = 0.9, e = 1.02, n = 1) => [
|
|
120
|
-
{ opacity: 0, transform: `scale(${t})` },
|
|
121
|
-
{ opacity: 1, transform: `scale(${e})`, offset: 0.6 },
|
|
122
|
-
{ opacity: 1, transform: `scale(${n})` }
|
|
123
|
-
],
|
|
124
|
-
rotateIn: (t = 6) => [
|
|
125
|
-
{ opacity: 0, transform: `rotate(${t}deg) scale(0.98)` },
|
|
126
|
-
{ opacity: 1, transform: "rotate(0deg) scale(1)" }
|
|
127
|
-
]
|
|
128
|
-
}, U = (t) => typeof Element < "u" && t instanceof Element ? [t] : Array.from(t), H = (t, e) => {
|
|
129
|
-
const n = U(t);
|
|
130
|
-
if (!n.length) return () => {
|
|
131
|
-
};
|
|
132
|
-
const { root: r = null, rootMargin: o, threshold: i, once: s = !0, onEnter: a, ...m } = e;
|
|
133
|
-
if (typeof IntersectionObserver > "u")
|
|
134
|
-
return n.forEach((u) => {
|
|
135
|
-
a?.(u), P(u, m);
|
|
136
|
-
}), () => {
|
|
137
|
-
};
|
|
138
|
-
const f = new IntersectionObserver(
|
|
139
|
-
(u) => {
|
|
140
|
-
u.forEach((p) => {
|
|
141
|
-
if (!p.isIntersecting) return;
|
|
142
|
-
const h = p.target;
|
|
143
|
-
a?.(h), P(h, m), s && f.unobserve(h);
|
|
144
|
-
});
|
|
145
|
-
},
|
|
146
|
-
{ root: r, rootMargin: o, threshold: i }
|
|
147
|
-
);
|
|
148
|
-
return n.forEach((u) => f.observe(u)), () => f.disconnect();
|
|
149
|
-
}, V = {
|
|
150
|
-
stiffness: 100,
|
|
151
|
-
damping: 10,
|
|
152
|
-
mass: 1,
|
|
153
|
-
precision: 0.01
|
|
154
|
-
}, K = (t, e = {}) => {
|
|
155
|
-
const { stiffness: n, damping: r, mass: o, precision: i } = {
|
|
156
|
-
...V,
|
|
157
|
-
...e
|
|
158
|
-
};
|
|
159
|
-
let s = t, a = 0, m = t, f = null, u = null, p = null;
|
|
160
|
-
const h = /* @__PURE__ */ new Set(), c = () => {
|
|
161
|
-
for (const l of h)
|
|
162
|
-
l(s);
|
|
163
|
-
}, d = (l) => {
|
|
164
|
-
const g = p !== null ? (l - p) / 1e3 : 0.016666666666666666, M = Math.min(g, 1 / 30);
|
|
165
|
-
p = l;
|
|
166
|
-
const b = s - m, F = -n * b, N = -r * a, O = (F + N) / o;
|
|
167
|
-
if (a += O * M, s += a * M, c(), Math.abs(a) < i && Math.abs(b) < i) {
|
|
168
|
-
s = m, a = 0, f = null, c(), u?.(), u = null;
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
f = requestAnimationFrame(d);
|
|
172
|
-
};
|
|
173
|
-
return {
|
|
174
|
-
to(l) {
|
|
175
|
-
return m = l, f !== null && cancelAnimationFrame(f), u?.(), p = null, new Promise((g) => {
|
|
176
|
-
u = g, f = requestAnimationFrame(d);
|
|
177
|
-
});
|
|
178
|
-
},
|
|
179
|
-
current() {
|
|
180
|
-
return s;
|
|
181
|
-
},
|
|
182
|
-
stop() {
|
|
183
|
-
f !== null && (cancelAnimationFrame(f), f = null), a = 0, p = null, u?.(), u = null;
|
|
184
|
-
},
|
|
185
|
-
onChange(l) {
|
|
186
|
-
return h.add(l), () => h.delete(l);
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
}, Z = {
|
|
190
|
-
/** Gentle, slow-settling spring */
|
|
191
|
-
gentle: { stiffness: 80, damping: 15 },
|
|
192
|
-
/** Responsive, snappy spring */
|
|
193
|
-
snappy: { stiffness: 200, damping: 20 },
|
|
194
|
-
/** Bouncy, playful spring */
|
|
195
|
-
bouncy: { stiffness: 300, damping: 8 },
|
|
196
|
-
/** Stiff, quick spring with minimal overshoot */
|
|
197
|
-
stiff: { stiffness: 400, damping: 30 }
|
|
198
|
-
}, B = (t, e = {}) => {
|
|
199
|
-
const { start: n = 0, from: r = "start", easing: o } = e;
|
|
200
|
-
return (i, s = 0) => {
|
|
201
|
-
const a = typeof r == "number" ? r : r === "center" ? (s - 1) / 2 : r === "end" ? s - 1 : 0, m = Math.abs(i - a), f = s > 1 ? Math.max(a, s - 1 - a) : 1, u = f === 0 ? 0 : m / f, p = o ? o(u) * f : m;
|
|
202
|
-
return n + p * t;
|
|
203
|
-
};
|
|
204
|
-
}, E = (t) => {
|
|
205
|
-
if (typeof t == "number") return t;
|
|
206
|
-
if (typeof t == "string") {
|
|
207
|
-
const e = t.trim();
|
|
208
|
-
if (e.endsWith("ms")) {
|
|
209
|
-
const r = Number.parseFloat(e.slice(0, -2));
|
|
210
|
-
return Number.isFinite(r) ? r : 0;
|
|
211
|
-
}
|
|
212
|
-
if (e.endsWith("s")) {
|
|
213
|
-
const r = Number.parseFloat(e.slice(0, -1));
|
|
214
|
-
return Number.isFinite(r) ? r * 1e3 : 0;
|
|
215
|
-
}
|
|
216
|
-
const n = Number.parseFloat(e);
|
|
217
|
-
return Number.isFinite(n) ? n : 0;
|
|
218
|
-
}
|
|
219
|
-
return 0;
|
|
220
|
-
}, k = (t, e) => {
|
|
221
|
-
if (typeof t == "number") return t;
|
|
222
|
-
if (typeof t == "string") {
|
|
223
|
-
const n = /^([+-])=(\d+(?:\.\d+)?)$/.exec(t);
|
|
224
|
-
if (n) {
|
|
225
|
-
const r = Number.parseFloat(n[2]);
|
|
226
|
-
return Number.isFinite(r) ? n[1] === "+" ? e + r : e - r : e;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
return e;
|
|
230
|
-
}, q = (t) => {
|
|
231
|
-
const e = E(t?.duration), n = E(t?.endDelay), r = t?.iterations ?? 1;
|
|
232
|
-
if (r === 1 / 0)
|
|
233
|
-
return Number.MAX_SAFE_INTEGER;
|
|
234
|
-
const o = Math.max(0, r);
|
|
235
|
-
return e * o + n;
|
|
236
|
-
}, I = (t) => {
|
|
237
|
-
let e = 0;
|
|
238
|
-
return t.map((n) => {
|
|
239
|
-
const r = k(n.at, e), o = E(n.options?.delay), i = Math.max(0, r + o), s = q(n.options), a = i + s;
|
|
240
|
-
return e = Math.max(e, a), { step: n, start: i, end: a, duration: s };
|
|
241
|
-
});
|
|
242
|
-
}, J = async (t, e = {}) => {
|
|
243
|
-
const { stagger: n, onFinish: r } = e, o = t.length;
|
|
244
|
-
for (let i = 0; i < t.length; i += 1) {
|
|
245
|
-
const s = t[i], a = n ? n(i, o) : 0;
|
|
246
|
-
a > 0 && await new Promise((m) => setTimeout(m, a)), await P(s.target, s);
|
|
247
|
-
}
|
|
248
|
-
r?.();
|
|
249
|
-
}, tt = (t = [], e = {}) => {
|
|
250
|
-
const n = [...t], r = /* @__PURE__ */ new Set();
|
|
251
|
-
let o = [], i = 0, s = !1, a = !1;
|
|
252
|
-
const { commitStyles: m = !0, respectReducedMotion: f = !0, onFinish: u } = e, p = () => {
|
|
253
|
-
if (!a) {
|
|
254
|
-
if (a = !0, m)
|
|
255
|
-
for (const c of o) {
|
|
256
|
-
const { animation: d, step: l } = c;
|
|
257
|
-
typeof d.commitStyles == "function" ? d.commitStyles() : w(l.target, l.keyframes), d.cancel();
|
|
258
|
-
}
|
|
259
|
-
r.forEach((c) => c()), u?.();
|
|
260
|
-
}
|
|
261
|
-
}, h = () => {
|
|
262
|
-
o.forEach(({ animation: l }) => l.cancel()), o = [], a = !1;
|
|
263
|
-
const c = I(n);
|
|
264
|
-
if (i = c.length ? Math.max(...c.map((l) => l.end)) : 0, f && A()) {
|
|
265
|
-
m && c.forEach(({ step: l }) => w(l.target, l.keyframes)), s = !0;
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
if (c.some(
|
|
269
|
-
({ step: l }) => typeof l.target.animate != "function"
|
|
270
|
-
)) {
|
|
271
|
-
m && c.forEach(({ step: l }) => w(l.target, l.keyframes)), s = !0;
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
s = !1, o = c.map(({ step: l, start: g }) => {
|
|
275
|
-
const { delay: M, ...b } = l.options ?? {};
|
|
276
|
-
return { animation: l.target.animate(l.keyframes, {
|
|
277
|
-
...b,
|
|
278
|
-
delay: g,
|
|
279
|
-
fill: b.fill ?? "both"
|
|
280
|
-
}), step: l, start: g };
|
|
281
|
-
});
|
|
282
|
-
};
|
|
283
|
-
return {
|
|
284
|
-
add(c) {
|
|
285
|
-
n.push(c);
|
|
286
|
-
},
|
|
287
|
-
duration() {
|
|
288
|
-
if (!n.length) return 0;
|
|
289
|
-
if (!o.length) {
|
|
290
|
-
const c = I(n);
|
|
291
|
-
return Math.max(...c.map((d) => d.end));
|
|
292
|
-
}
|
|
293
|
-
return i;
|
|
294
|
-
},
|
|
295
|
-
async play() {
|
|
296
|
-
if (h(), s || o.length === 0) {
|
|
297
|
-
p();
|
|
298
|
-
return;
|
|
299
|
-
}
|
|
300
|
-
const c = o.map(
|
|
301
|
-
(d) => d.animation.finished.catch(() => {
|
|
302
|
-
})
|
|
303
|
-
);
|
|
304
|
-
await Promise.all(c), p();
|
|
305
|
-
},
|
|
306
|
-
pause() {
|
|
307
|
-
s || o.forEach(({ animation: c }) => c.pause());
|
|
308
|
-
},
|
|
309
|
-
resume() {
|
|
310
|
-
s || o.forEach(({ animation: c }) => c.play());
|
|
311
|
-
},
|
|
312
|
-
stop() {
|
|
313
|
-
o.forEach(({ animation: c }) => c.cancel()), o = [], s = !1;
|
|
314
|
-
},
|
|
315
|
-
seek(c) {
|
|
316
|
-
s || o.forEach(({ animation: d }) => {
|
|
317
|
-
d.currentTime = c;
|
|
318
|
-
});
|
|
319
|
-
},
|
|
320
|
-
onFinish(c) {
|
|
321
|
-
return r.add(c), () => r.delete(c);
|
|
322
|
-
}
|
|
323
|
-
};
|
|
324
|
-
}, et = async (t) => {
|
|
325
|
-
const e = typeof t == "function" ? t : t.update;
|
|
326
|
-
if (typeof document > "u") {
|
|
327
|
-
e();
|
|
328
|
-
return;
|
|
329
|
-
}
|
|
330
|
-
const n = document;
|
|
331
|
-
if (n.startViewTransition) {
|
|
332
|
-
await n.startViewTransition(() => e()).finished;
|
|
333
|
-
return;
|
|
334
|
-
}
|
|
335
|
-
e();
|
|
336
|
-
};
|
|
1
|
+
import { C as a, S as e, _ as t, a as i, b as n, c as r, d as u, f as o, g as p, h as c, i as l, l as m, m as f, n as d, o as g, p as O, r as b, s as C, t as I, u as P, v as x, w as Q, x as k, y } from "./motion-C5DRdPnO.js";
|
|
337
2
|
export {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
3
|
+
a as animate,
|
|
4
|
+
m as capturePosition,
|
|
5
|
+
O as easeInCubic,
|
|
6
|
+
f as easeInOutCubic,
|
|
7
|
+
c as easeInOutQuad,
|
|
8
|
+
p as easeInQuad,
|
|
9
|
+
t as easeOutBack,
|
|
10
|
+
x as easeOutCubic,
|
|
11
|
+
y as easeOutExpo,
|
|
12
|
+
n as easeOutQuad,
|
|
13
|
+
k as easingPresets,
|
|
14
|
+
P as flip,
|
|
15
|
+
u as flipElements,
|
|
16
|
+
o as flipList,
|
|
17
|
+
r as keyframePresets,
|
|
18
|
+
e as linear,
|
|
19
|
+
Q as prefersReducedMotion,
|
|
20
|
+
C as scrollAnimate,
|
|
21
|
+
d as sequence,
|
|
22
|
+
i as spring,
|
|
23
|
+
g as springPresets,
|
|
24
|
+
l as stagger,
|
|
25
|
+
b as timeline,
|
|
26
|
+
I as transition
|
|
362
27
|
};
|
|
363
|
-
//# sourceMappingURL=motion.es.mjs.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
function c(t) {
|
|
2
|
+
return Object.prototype.toString.call(t) === "[object Object]";
|
|
3
|
+
}
|
|
4
|
+
function s(t) {
|
|
5
|
+
return t === "__proto__" || t === "constructor" || t === "prototype";
|
|
6
|
+
}
|
|
7
|
+
function i(t) {
|
|
8
|
+
return typeof structuredClone == "function" ? structuredClone(t) : JSON.parse(JSON.stringify(t));
|
|
9
|
+
}
|
|
10
|
+
function u(...t) {
|
|
11
|
+
const o = {};
|
|
12
|
+
for (const r of t) for (const [n, e] of Object.entries(r))
|
|
13
|
+
s(n) || (c(e) && c(o[n]) ? o[n] = u(o[n], e) : o[n] = e);
|
|
14
|
+
return o;
|
|
15
|
+
}
|
|
16
|
+
function f(t, o) {
|
|
17
|
+
const r = {};
|
|
18
|
+
for (const n of o) n in t && (r[n] = t[n]);
|
|
19
|
+
return r;
|
|
20
|
+
}
|
|
21
|
+
function l(t, o) {
|
|
22
|
+
const r = { ...t };
|
|
23
|
+
for (const n of o) delete r[n];
|
|
24
|
+
return r;
|
|
25
|
+
}
|
|
26
|
+
function a(t, o) {
|
|
27
|
+
return Object.prototype.hasOwnProperty.call(t, o);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
l as a,
|
|
31
|
+
u as i,
|
|
32
|
+
a as n,
|
|
33
|
+
f as o,
|
|
34
|
+
c as r,
|
|
35
|
+
i as t
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=object-qGpWr6-J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"object-qGpWr6-J.js","names":[],"sources":["../src/core/utils/object.ts"],"sourcesContent":["/**\n * Object-focused utility helpers.\n *\n * @module bquery/core/utils/object\n */\n\n/**\n * Checks if a value is a plain object (not null, array, or class instance).\n *\n * @param value - The value to check\n * @returns True if the value is a plain object\n */\nexport function isPlainObject(value: unknown): value is Record<string, unknown> {\n return Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Checks if a key could cause prototype pollution.\n * These keys are dangerous when used in object merging operations.\n *\n * @param key - The key to check\n * @returns True if the key is a prototype pollution vector\n *\n * @internal\n */\nexport function isPrototypePollutionKey(key: string): boolean {\n return key === '__proto__' || key === 'constructor' || key === 'prototype';\n}\n\n/**\n * Creates a deep clone using structuredClone if available, otherwise fallback to JSON.\n *\n * @template T - The type of value being cloned\n * @param value - The value to clone\n * @returns A deep copy of the value\n *\n * @remarks\n * When `structuredClone` is available (modern browsers, Node 17+, Bun), this function\n * provides full deep cloning including circular references, Date, Map, Set, ArrayBuffer, etc.\n *\n * **JSON fallback limitations** (older environments without `structuredClone`):\n * - **Throws** on circular references\n * - **Drops** functions, `undefined`, and Symbol properties\n * - **Transforms** Date → ISO string, Map/Set → empty object, BigInt → throws\n * - **Loses** prototype chains and non-enumerable properties\n *\n * For guaranteed safe cloning of arbitrary data, ensure your environment supports\n * `structuredClone` or pre-validate your data structure.\n *\n * @example\n * ```ts\n * const original = { nested: { value: 1 } };\n * const copy = clone(original);\n * copy.nested.value = 2;\n * console.log(original.nested.value); // 1\n * ```\n */\nexport function clone<T>(value: T): T {\n if (typeof structuredClone === 'function') {\n return structuredClone(value);\n }\n return JSON.parse(JSON.stringify(value)) as T;\n}\n\n/**\n * Deep-merges plain objects into a new object.\n * Later sources override earlier ones for primitive values.\n * Objects are recursively merged.\n *\n * @param sources - Objects to merge\n * @returns A new object with all sources merged as an intersection type\n *\n * @remarks\n * This function uses overloads to provide accurate intersection types for up to 5 sources.\n * For more than 5 sources, the return type falls back to `Record<string, unknown>`.\n *\n * Note that deep merging creates a shallow intersection at the type level. Nested objects\n * are merged at runtime, but TypeScript sees them as intersected types which may not\n * perfectly represent the merged structure for deeply nested conflicting types.\n *\n * @example\n * ```ts\n * const result = merge(\n * { a: 1, nested: { x: 1 } },\n * { b: 2, nested: { y: 2 } }\n * );\n * // Result: { a: 1, b: 2, nested: { x: 1, y: 2 } }\n * // Type: { a: number; nested: { x: number } } & { b: number; nested: { y: number } }\n * ```\n *\n * @security This method is protected against prototype pollution attacks.\n * Keys like `__proto__`, `constructor`, and `prototype` are ignored.\n */\nexport function merge<T1 extends Record<string, unknown>>(source1: T1): T1;\nexport function merge<T1 extends Record<string, unknown>, T2 extends Record<string, unknown>>(\n source1: T1,\n source2: T2\n): T1 & T2;\nexport function merge<\n T1 extends Record<string, unknown>,\n T2 extends Record<string, unknown>,\n T3 extends Record<string, unknown>,\n>(source1: T1, source2: T2, source3: T3): T1 & T2 & T3;\nexport function merge<\n T1 extends Record<string, unknown>,\n T2 extends Record<string, unknown>,\n T3 extends Record<string, unknown>,\n T4 extends Record<string, unknown>,\n>(source1: T1, source2: T2, source3: T3, source4: T4): T1 & T2 & T3 & T4;\nexport function merge<\n T1 extends Record<string, unknown>,\n T2 extends Record<string, unknown>,\n T3 extends Record<string, unknown>,\n T4 extends Record<string, unknown>,\n T5 extends Record<string, unknown>,\n>(source1: T1, source2: T2, source3: T3, source4: T4, source5: T5): T1 & T2 & T3 & T4 & T5;\nexport function merge(...sources: Record<string, unknown>[]): Record<string, unknown>;\nexport function merge(...sources: Record<string, unknown>[]): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const source of sources) {\n for (const [key, value] of Object.entries(source)) {\n if (isPrototypePollutionKey(key)) continue;\n\n if (isPlainObject(value) && isPlainObject(result[key])) {\n result[key] = merge(\n result[key] as Record<string, unknown>,\n value as Record<string, unknown>\n );\n } else {\n result[key] = value;\n }\n }\n }\n return result;\n}\n\n/**\n * Picks specified keys from an object.\n *\n * @template T - The object type\n * @template K - The key type\n * @param obj - The source object\n * @param keys - Keys to pick\n * @returns A new object with only the specified keys\n *\n * @example\n * ```ts\n * const user = { name: 'John', age: 30, email: 'john@example.com' };\n * pick(user, ['name', 'email']); // { name: 'John', email: 'john@example.com' }\n * ```\n */\nexport function pick<T extends Record<string, unknown>, K extends keyof T>(\n obj: T,\n keys: K[]\n): Pick<T, K> {\n const result = {} as Pick<T, K>;\n for (const key of keys) {\n if (key in obj) {\n result[key] = obj[key];\n }\n }\n return result;\n}\n\n/**\n * Omits specified keys from an object.\n *\n * @template T - The object type\n * @template K - The key type\n * @param obj - The source object\n * @param keys - Keys to omit\n * @returns A new object without the specified keys\n *\n * @example\n * ```ts\n * const user = { name: 'John', age: 30, password: 'secret' };\n * omit(user, ['password']); // { name: 'John', age: 30 }\n * ```\n */\nexport function omit<T extends Record<string, unknown>, K extends keyof T>(\n obj: T,\n keys: K[]\n): Omit<T, K> {\n const result = { ...obj };\n for (const key of keys) {\n delete result[key];\n }\n return result as Omit<T, K>;\n}\n\n/**\n * Checks if an object has a given own property.\n *\n * @template T - The object type\n * @param obj - The object to check\n * @param key - The property key\n * @returns True if the property exists on the object\n *\n * @example\n * ```ts\n * hasOwn({ a: 1 }, 'a'); // true\n * ```\n */\nexport function hasOwn<T extends object>(obj: T, key: PropertyKey): key is keyof T {\n return Object.prototype.hasOwnProperty.call(obj, key);\n}\n"],"mappings":"AAYA,SAAgB,EAAc,GAAkD;AAC9E,SAAO,OAAO,UAAU,SAAS,KAAK,CAAA,MAAW;;AAYnD,SAAgB,EAAwB,GAAsB;AAC5D,SAAO,MAAQ,eAAe,MAAQ,iBAAiB,MAAQ;;AA+BjE,SAAgB,EAAS,GAAa;AACpC,SAAI,OAAO,mBAAoB,aACtB,gBAAgB,CAAA,IAElB,KAAK,MAAM,KAAK,UAAU,CAAA,CAAM;;AAwDzC,SAAgB,KAAS,GAA6D;AACpF,QAAM,IAAkC,CAAA;AACxC,aAAW,KAAU,EACnB,YAAW,CAAC,GAAK,CAAA,KAAU,OAAO,QAAQ,CAAA;AACxC,IAAI,EAAwB,CAAA,MAExB,EAAc,CAAA,KAAU,EAAc,EAAO,CAAA,CAAA,IAC/C,EAAO,CAAA,IAAO,EACZ,EAAO,CAAA,GACP,CAAA,IAGF,EAAO,CAAA,IAAO;AAIpB,SAAO;;AAkBT,SAAgB,EACd,GACA,GACY;AACZ,QAAM,IAAS,CAAA;AACf,aAAW,KAAO,EAChB,CAAI,KAAO,MACT,EAAO,CAAA,IAAO,EAAI,CAAA;AAGtB,SAAO;;AAkBT,SAAgB,EACd,GACA,GACY;AACZ,QAAM,IAAS,EAAE,GAAG,EAAA;AACpB,aAAW,KAAO,EAChB,QAAO,EAAO,CAAA;AAEhB,SAAO;;AAgBT,SAAgB,EAAyB,GAAQ,GAAkC;AACjF,SAAO,OAAO,UAAU,eAAe,KAAK,GAAK,CAAA"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Accessibility live-region announcer helpers.
|
|
3
|
+
*
|
|
4
|
+
* @module bquery/platform
|
|
5
|
+
*/
|
|
6
|
+
import { type Signal } from '../reactive/signal';
|
|
7
|
+
/** Options for creating an announcer. */
|
|
8
|
+
export interface UseAnnouncerOptions {
|
|
9
|
+
/** Live region politeness. */
|
|
10
|
+
politeness?: 'polite' | 'assertive';
|
|
11
|
+
/** Whether the live region should be atomic. */
|
|
12
|
+
atomic?: boolean;
|
|
13
|
+
/** Delay before applying the message. */
|
|
14
|
+
delay?: number;
|
|
15
|
+
/** Delay after which the message is cleared automatically. */
|
|
16
|
+
clearDelay?: number;
|
|
17
|
+
/** Optional element id for the live region. */
|
|
18
|
+
id?: string;
|
|
19
|
+
/** Optional CSS class name. */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** Optional container used to append the live region. */
|
|
22
|
+
container?: HTMLElement;
|
|
23
|
+
}
|
|
24
|
+
/** Runtime options for a single announcement. */
|
|
25
|
+
export interface AnnounceOptions {
|
|
26
|
+
/** Override politeness for this specific announcement. */
|
|
27
|
+
politeness?: 'polite' | 'assertive';
|
|
28
|
+
/** Override the message delay for this specific announcement. */
|
|
29
|
+
delay?: number;
|
|
30
|
+
/** Override the auto-clear delay for this specific announcement. */
|
|
31
|
+
clearDelay?: number;
|
|
32
|
+
}
|
|
33
|
+
/** Returned announcer API. */
|
|
34
|
+
export interface AnnouncerHandle {
|
|
35
|
+
/** The live region element or null outside the DOM. */
|
|
36
|
+
element: HTMLElement | null;
|
|
37
|
+
/** Reactive message signal. */
|
|
38
|
+
message: Signal<string>;
|
|
39
|
+
/** Announce a message to assistive technologies. */
|
|
40
|
+
announce: (value: string, options?: AnnounceOptions) => void;
|
|
41
|
+
/** Clear the current announcement. */
|
|
42
|
+
clear: () => void;
|
|
43
|
+
/** Remove the live region if it was created by this announcer. */
|
|
44
|
+
destroy: () => void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create or reuse an accessible live region.
|
|
48
|
+
*
|
|
49
|
+
* @param options - Live region configuration
|
|
50
|
+
* @returns An announcer handle with announce(), clear(), and destroy()
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const announcer = useAnnouncer();
|
|
55
|
+
* announcer.announce('Saved successfully');
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare const useAnnouncer: (options?: UseAnnouncerOptions) => AnnouncerHandle;
|
|
59
|
+
//# sourceMappingURL=announcer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"announcer.d.ts","sourceRoot":"","sources":["../../src/platform/announcer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjE,yCAAyC;AACzC,MAAM,WAAW,mBAAmB;IAClC,8BAA8B;IAC9B,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IACpC,gDAAgD;IAChD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+CAA+C;IAC/C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,SAAS,CAAC,EAAE,WAAW,CAAC;CACzB;AAED,iDAAiD;AACjD,MAAM,WAAW,eAAe;IAC9B,0DAA0D;IAC1D,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IACpC,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B,uDAAuD;IACvD,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;IAC5B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,oDAAoD;IACpD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7D,sCAAsC;IACtC,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,kEAAkE;IAClE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAcD;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,UAAS,mBAAwB,KAAG,eAoIhE,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global bQuery configuration helpers.
|
|
3
|
+
*
|
|
4
|
+
* @module bquery/platform
|
|
5
|
+
*/
|
|
6
|
+
/** Supported response parsing strategies for fetch composables. */
|
|
7
|
+
export type BqueryFetchParseAs = 'json' | 'text' | 'blob' | 'arrayBuffer' | 'formData' | 'response';
|
|
8
|
+
/** Global fetch defaults used by useFetch(). */
|
|
9
|
+
export interface BqueryFetchConfig {
|
|
10
|
+
/** Optional base URL prepended to relative request URLs. */
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
/** Default request headers. */
|
|
13
|
+
headers?: HeadersInit;
|
|
14
|
+
/** Default response parser. */
|
|
15
|
+
parseAs?: BqueryFetchParseAs;
|
|
16
|
+
}
|
|
17
|
+
/** Global cookie defaults used by useCookie(). */
|
|
18
|
+
export interface BqueryCookieConfig {
|
|
19
|
+
/** Default cookie path. */
|
|
20
|
+
path?: string;
|
|
21
|
+
/** Default SameSite mode. */
|
|
22
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
23
|
+
/** Whether cookies should be marked secure by default. */
|
|
24
|
+
secure?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/** Global announcer defaults used by useAnnouncer(). */
|
|
27
|
+
export interface BqueryAnnouncerConfig {
|
|
28
|
+
/** Default politeness level. */
|
|
29
|
+
politeness?: 'polite' | 'assertive';
|
|
30
|
+
/** Whether announcements should be treated atomically. */
|
|
31
|
+
atomic?: boolean;
|
|
32
|
+
/** Delay before writing the message into the live region. */
|
|
33
|
+
delay?: number;
|
|
34
|
+
/** Delay after which the live region is cleared automatically. */
|
|
35
|
+
clearDelay?: number;
|
|
36
|
+
}
|
|
37
|
+
/** Global page meta defaults used by definePageMeta(). */
|
|
38
|
+
export interface BqueryPageMetaConfig {
|
|
39
|
+
/** Optional title template function. */
|
|
40
|
+
titleTemplate?: (title: string) => string;
|
|
41
|
+
}
|
|
42
|
+
/** Global motion defaults used by transition(). */
|
|
43
|
+
export interface BqueryTransitionConfig {
|
|
44
|
+
/** Skip transitions when reduced motion is preferred. */
|
|
45
|
+
skipOnReducedMotion?: boolean;
|
|
46
|
+
/** Classes applied to the root element during transitions. */
|
|
47
|
+
classes?: string[];
|
|
48
|
+
/** Transition type identifiers added when supported by the browser. */
|
|
49
|
+
types?: string[];
|
|
50
|
+
}
|
|
51
|
+
/** Global default component library configuration. */
|
|
52
|
+
export interface BqueryComponentLibraryConfig {
|
|
53
|
+
/** Prefix used by registerDefaultComponents(). */
|
|
54
|
+
prefix?: string;
|
|
55
|
+
}
|
|
56
|
+
/** Complete global bQuery configuration object. */
|
|
57
|
+
export interface BqueryConfig {
|
|
58
|
+
/** Fetch composable defaults. */
|
|
59
|
+
fetch?: BqueryFetchConfig;
|
|
60
|
+
/** Cookie composable defaults. */
|
|
61
|
+
cookies?: BqueryCookieConfig;
|
|
62
|
+
/** Announcer composable defaults. */
|
|
63
|
+
announcer?: BqueryAnnouncerConfig;
|
|
64
|
+
/** Page metadata defaults. */
|
|
65
|
+
pageMeta?: BqueryPageMetaConfig;
|
|
66
|
+
/** View transition defaults. */
|
|
67
|
+
transitions?: BqueryTransitionConfig;
|
|
68
|
+
/** Default component library options. */
|
|
69
|
+
components?: BqueryComponentLibraryConfig;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Define or extend the global bQuery configuration.
|
|
73
|
+
*
|
|
74
|
+
* @param config - Partial configuration values to merge into the current config
|
|
75
|
+
* @returns The resolved configuration after merging
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* defineBqueryConfig({
|
|
80
|
+
* fetch: { baseUrl: 'https://api.example.com' },
|
|
81
|
+
* components: { prefix: 'ui' },
|
|
82
|
+
* });
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export declare const defineBqueryConfig: (config: BqueryConfig) => BqueryConfig;
|
|
86
|
+
/**
|
|
87
|
+
* Get the currently resolved bQuery configuration.
|
|
88
|
+
*
|
|
89
|
+
* @returns A cloned snapshot of the active configuration
|
|
90
|
+
*/
|
|
91
|
+
export declare const getBqueryConfig: () => BqueryConfig;
|
|
92
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/platform/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,mEAAmE;AACnE,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC;AAEpG,gDAAgD;AAChD,MAAM,WAAW,iBAAiB;IAChC,4DAA4D;IAC5D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAED,kDAAkD;AAClD,MAAM,WAAW,kBAAkB;IACjC,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACrC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wDAAwD;AACxD,MAAM,WAAW,qBAAqB;IACpC,gCAAgC;IAChC,UAAU,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAC;IACpC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,0DAA0D;AAC1D,MAAM,WAAW,oBAAoB;IACnC,wCAAwC;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3C;AAED,mDAAmD;AACnD,MAAM,WAAW,sBAAsB;IACrC,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,8DAA8D;IAC9D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,uEAAuE;IACvE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,sDAAsD;AACtD,MAAM,WAAW,4BAA4B;IAC3C,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,iCAAiC;IACjC,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,kCAAkC;IAClC,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,qCAAqC;IACrC,SAAS,CAAC,EAAE,qBAAqB,CAAC;IAClC,8BAA8B;IAC9B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,gCAAgC;IAChC,WAAW,CAAC,EAAE,sBAAsB,CAAC;IACrC,yCAAyC;IACzC,UAAU,CAAC,EAAE,4BAA4B,CAAC;CAC3C;AAmDD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY,KAAG,YASzD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,QAAO,YAElC,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reactive cookie helpers.
|
|
3
|
+
*
|
|
4
|
+
* @module bquery/platform
|
|
5
|
+
*/
|
|
6
|
+
import { type Signal } from '../reactive/signal';
|
|
7
|
+
/** Options for useCookie(). */
|
|
8
|
+
export interface UseCookieOptions<T> {
|
|
9
|
+
/** Default value when the cookie is not present. */
|
|
10
|
+
defaultValue?: T;
|
|
11
|
+
/** Cookie path. Defaults to the global config or `/`. */
|
|
12
|
+
path?: string;
|
|
13
|
+
/** Optional cookie domain. */
|
|
14
|
+
domain?: string;
|
|
15
|
+
/** Cookie SameSite attribute. */
|
|
16
|
+
sameSite?: 'Strict' | 'Lax' | 'None';
|
|
17
|
+
/** Whether the cookie should be marked secure. */
|
|
18
|
+
secure?: boolean;
|
|
19
|
+
/** Cookie expiry date. */
|
|
20
|
+
expires?: Date;
|
|
21
|
+
/** Cookie max-age in seconds. */
|
|
22
|
+
maxAge?: number;
|
|
23
|
+
/** Automatically persist signal updates back to document.cookie. */
|
|
24
|
+
watch?: boolean;
|
|
25
|
+
/** Serialize a value before writing it into the cookie. */
|
|
26
|
+
serialize?: (value: T) => string;
|
|
27
|
+
/** Deserialize a cookie string into a typed value. */
|
|
28
|
+
deserialize?: (value: string) => T;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a reactive cookie signal.
|
|
32
|
+
*
|
|
33
|
+
* @template T - Cookie value type
|
|
34
|
+
* @param name - Cookie name
|
|
35
|
+
* @param options - Read/write configuration for the cookie
|
|
36
|
+
* @returns Reactive signal representing the cookie value
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const theme = useCookie('theme', { defaultValue: 'light' });
|
|
41
|
+
* theme.value = 'dark';
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const useCookie: <T>(name: string, options?: UseCookieOptions<T>) => Signal<T | null>;
|
|
45
|
+
//# sourceMappingURL=cookies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../src/platform/cookies.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAGjE,+BAA+B;AAC/B,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,oDAAoD;IACpD,YAAY,CAAC,EAAE,CAAC,CAAC;IACjB,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;IACrC,kDAAkD;IAClD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0BAA0B;IAC1B,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;IACjC,sDAAsD;IACtD,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,CAAC;CACpC;AAiED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,MAAM,MAAM,EAAE,UAAS,gBAAgB,CAAC,CAAC,CAAM,KAAG,MAAM,CAAC,CAAC,GAAG,IAAI,CAsD7F,CAAC"}
|
package/dist/platform/index.d.ts
CHANGED
|
@@ -8,8 +8,16 @@ export { buckets } from './buckets';
|
|
|
8
8
|
export type { Bucket } from './buckets';
|
|
9
9
|
export { cache } from './cache';
|
|
10
10
|
export type { CacheHandle } from './cache';
|
|
11
|
+
export { useCookie } from './cookies';
|
|
12
|
+
export type { UseCookieOptions } from './cookies';
|
|
13
|
+
export { defineBqueryConfig, getBqueryConfig } from './config';
|
|
14
|
+
export type { BqueryAnnouncerConfig, BqueryComponentLibraryConfig, BqueryConfig, BqueryCookieConfig, BqueryFetchConfig, BqueryFetchParseAs, BqueryPageMetaConfig, BqueryTransitionConfig, } from './config';
|
|
11
15
|
export { notifications } from './notifications';
|
|
12
16
|
export type { NotificationOptions } from './notifications';
|
|
17
|
+
export { useAnnouncer } from './announcer';
|
|
18
|
+
export type { AnnounceOptions, AnnouncerHandle, UseAnnouncerOptions } from './announcer';
|
|
19
|
+
export { definePageMeta } from './meta';
|
|
20
|
+
export type { PageLinkTag, PageMetaCleanup, PageMetaDefinition, PageMetaTag } from './meta';
|
|
13
21
|
export { storage } from './storage';
|
|
14
22
|
export type { IndexedDBOptions, StorageAdapter } from './storage';
|
|
15
23
|
//# sourceMappingURL=index.d.ts.map
|