@bquery/bquery 1.1.2 → 1.3.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 +501 -323
- package/dist/batch-4LAvfLE7.js +13 -0
- package/dist/batch-4LAvfLE7.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 +36 -0
- 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 +8 -0
- 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/array.d.ts +74 -0
- package/dist/core/utils/array.d.ts.map +1 -0
- package/dist/core/utils/function.d.ts +70 -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-COenAZjD.js +145 -0
- package/dist/core-COenAZjD.js.map +1 -0
- package/dist/core.es.mjs +411 -448
- package/dist/core.es.mjs.map +1 -1
- package/dist/full.d.ts +8 -2
- package/dist/full.d.ts.map +1 -1
- package/dist/full.es.mjs +86 -40
- package/dist/full.es.mjs.map +1 -1
- package/dist/full.iife.js +6 -1
- package/dist/full.iife.js.map +1 -1
- package/dist/full.umd.js +6 -1
- package/dist/full.umd.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.mjs +137 -44
- 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-Dz_ryNuC.js +278 -0
- package/dist/persisted-Dz_ryNuC.js.map +1 -0
- 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 +60 -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 +36 -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 -305
- 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 -154
- package/dist/reactive.es.mjs.map +1 -1
- package/dist/router/index.d.ts +41 -0
- package/dist/router/index.d.ts.map +1 -0
- 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 +202 -0
- package/dist/router.es.mjs.map +1 -0
- package/dist/sanitize-1FBEPAFH.js +272 -0
- package/dist/sanitize-1FBEPAFH.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 +12 -0
- package/dist/store/index.d.ts.map +1 -0
- 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 +27 -0
- package/dist/store.es.mjs.map +1 -0
- package/dist/type-guards-DRma3-Kc.js +16 -0
- package/dist/type-guards-DRma3-Kc.js.map +1 -0
- package/dist/untrack-BuEQKH7_.js +6 -0
- package/dist/untrack-BuEQKH7_.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 +111 -0
- package/dist/view/index.d.ts.map +1 -0
- 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 +426 -0
- package/dist/view.es.mjs.map +1 -0
- package/dist/watch-CXyaBC_9.js +58 -0
- package/dist/watch-CXyaBC_9.js.map +1 -0
- package/package.json +26 -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 +588 -454
- package/src/core/dom.ts +38 -0
- package/src/core/element.ts +746 -740
- package/src/core/index.ts +43 -0
- package/src/core/utils/array.ts +102 -0
- package/src/core/utils/function.ts +110 -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 -106
- package/src/index.ts +36 -27
- 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/reactive/batch.ts +22 -0
- package/src/reactive/computed.ts +92 -0
- package/src/reactive/core.ts +93 -0
- package/src/reactive/effect.ts +43 -0
- package/src/reactive/index.ts +23 -22
- package/src/reactive/internals.ts +105 -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 -506
- 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 -0
- 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 +343 -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 -0
- 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 +274 -0
- package/src/view/index.ts +112 -0
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-store.d.ts","sourceRoot":"","sources":["../../src/store/create-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AAaH,OAAO,KAAK,EAAW,KAAK,EAAE,eAAe,EAAmB,MAAM,SAAS,CAAC;AAGhF;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,GACtB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAEzD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAEzE,YAAY,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KACnC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAsSf,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store factory helpers.
|
|
3
|
+
*/
|
|
4
|
+
import type { Store, StoreDefinition } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a store factory that returns the store instance.
|
|
7
|
+
*
|
|
8
|
+
* The store is lazily created on first call and cached in the global store
|
|
9
|
+
* registry. Subsequent calls return the same instance. After calling
|
|
10
|
+
* `destroyStore(id)`, the next factory call will create a fresh store.
|
|
11
|
+
*
|
|
12
|
+
* @param id - Store identifier
|
|
13
|
+
* @param definition - Store definition without id
|
|
14
|
+
* @returns A function that returns the store instance
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const useCounter = defineStore('counter', {
|
|
19
|
+
* state: () => ({ count: 0 }),
|
|
20
|
+
* actions: { increment() { this.count++; } },
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* const counter = useCounter();
|
|
24
|
+
* counter.increment();
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const defineStore: <S extends Record<string, unknown>, G extends Record<string, unknown> = Record<string, never>, A extends Record<string, (...args: unknown[]) => unknown> = Record<string, never>>(id: string, definition: Omit<StoreDefinition<S, G, A>, "id">) => (() => Store<S, G, A>);
|
|
28
|
+
//# sourceMappingURL=define-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define-store.d.ts","sourceRoot":"","sources":["../../src/store/define-store.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,WAAW,GACtB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACzD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAEjF,IAAI,MAAM,EACV,YAAY,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,KAC/C,CAAC,MAAM,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAUvB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Devtools integration for stores.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
declare global {
|
|
6
|
+
interface Window {
|
|
7
|
+
__BQUERY_DEVTOOLS__?: {
|
|
8
|
+
stores: Map<string, unknown>;
|
|
9
|
+
onStoreCreated?: (id: string, store: unknown) => void;
|
|
10
|
+
onStateChange?: (id: string, state: unknown) => void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export type DevtoolsHook = {
|
|
15
|
+
stores: Map<string, unknown>;
|
|
16
|
+
onStoreCreated?: (id: string, store: unknown) => void;
|
|
17
|
+
onStateChange?: (id: string, state: unknown) => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const registerDevtoolsStore: (id: string, store: unknown) => void;
|
|
20
|
+
export declare const unregisterDevtoolsStore: (id: string) => void;
|
|
21
|
+
export declare const notifyDevtoolsStateChange: (id: string, state: unknown) => void;
|
|
22
|
+
//# sourceMappingURL=devtools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../../src/store/devtools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,mBAAmB,CAAC,EAAE;YACpB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAC7B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;YACtD,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;SACtD,CAAC;KACH;CACF;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC7B,cAAc,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,aAAa,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACtD,CAAC;AAUF,eAAO,MAAM,qBAAqB,GAAI,IAAI,MAAM,EAAE,OAAO,OAAO,KAAG,IAKlE,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,IAAI,MAAM,KAAG,IAGpD,CAAC;AAEF,eAAO,MAAM,yBAAyB,GAAI,IAAI,MAAM,EAAE,OAAO,OAAO,KAAG,IAGtE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store module exports.
|
|
3
|
+
*/
|
|
4
|
+
export type { Actions, Getters, StateFactory, Store, StoreDefinition, StorePatch, StorePlugin, StoreSubscriber, } from './types';
|
|
5
|
+
export { createStore } from './create-store';
|
|
6
|
+
export { defineStore } from './define-store';
|
|
7
|
+
export { mapActions, mapGetters, mapState } from './mapping';
|
|
8
|
+
export { createPersistedStore } from './persisted';
|
|
9
|
+
export { registerPlugin } from './plugins';
|
|
10
|
+
export { destroyStore, getStore, listStores } from './registry';
|
|
11
|
+
export { watchStore } from './watch';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,YAAY,EACV,OAAO,EACP,OAAO,EACP,YAAY,EACZ,KAAK,EACL,eAAe,EACf,UAAU,EACV,WAAW,EACX,eAAe,GAChB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping helpers for store state and actions.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Maps store state properties to a reactive object for use in components.
|
|
6
|
+
*
|
|
7
|
+
* @param store - The store instance
|
|
8
|
+
* @param keys - State keys to map
|
|
9
|
+
* @returns Object with mapped properties
|
|
10
|
+
*/
|
|
11
|
+
export declare const mapState: <S extends Record<string, unknown>, K extends keyof S>(store: S, keys: K[]) => Pick<S, K>;
|
|
12
|
+
/**
|
|
13
|
+
* Maps store getters to a reactive object for use in components.
|
|
14
|
+
*
|
|
15
|
+
* @param store - The store instance
|
|
16
|
+
* @param keys - Getter keys to map
|
|
17
|
+
* @returns Object with mapped getters
|
|
18
|
+
*/
|
|
19
|
+
export declare const mapGetters: <G extends Record<string, unknown>, K extends keyof G>(store: G, keys: K[]) => Pick<G, K>;
|
|
20
|
+
/**
|
|
21
|
+
* Maps store actions to an object for easier destructuring.
|
|
22
|
+
*
|
|
23
|
+
* @param store - The store instance
|
|
24
|
+
* @param keys - Action keys to map
|
|
25
|
+
* @returns Object with mapped actions
|
|
26
|
+
*/
|
|
27
|
+
export declare const mapActions: <A extends Record<string, (...args: unknown[]) => unknown>, K extends keyof A>(store: A, keys: K[]) => Pick<A, K>;
|
|
28
|
+
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../../src/store/mapping.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAC3E,OAAO,CAAC,EACR,MAAM,CAAC,EAAE,KACR,IAAI,CAAC,CAAC,EAAE,CAAC,CAWX,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAC7E,OAAO,CAAC,EACR,MAAM,CAAC,EAAE,KACR,IAAI,CAAC,CAAC,EAAE,CAAC,CAWX,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GACrB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,EACzD,CAAC,SAAS,MAAM,CAAC,EAEjB,OAAO,CAAC,EACR,MAAM,CAAC,EAAE,KACR,IAAI,CAAC,CAAC,EAAE,CAAC,CASX,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store persistence helpers.
|
|
3
|
+
*/
|
|
4
|
+
import type { Store, StoreDefinition } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Creates a store with automatic persistence to localStorage.
|
|
7
|
+
*
|
|
8
|
+
* @param definition - Store definition
|
|
9
|
+
* @param storageKey - Optional custom storage key
|
|
10
|
+
* @returns The reactive store instance
|
|
11
|
+
*/
|
|
12
|
+
export declare const createPersistedStore: <S extends Record<string, unknown>, G extends Record<string, unknown> = Record<string, never>, A extends Record<string, (...args: unknown[]) => unknown> = Record<string, never>>(definition: StoreDefinition<S, G, A>, storageKey?: string) => Store<S, G, A>;
|
|
13
|
+
//# sourceMappingURL=persisted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persisted.d.ts","sourceRoot":"","sources":["../../src/store/persisted.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEtD;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EACzD,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAEjF,YAAY,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACpC,aAAa,MAAM,KAClB,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAuCf,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store plugins API.
|
|
3
|
+
*/
|
|
4
|
+
import type { Store, StoreDefinition, StorePlugin } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Registers a plugin that extends all stores.
|
|
7
|
+
*
|
|
8
|
+
* @param plugin - The plugin function
|
|
9
|
+
*/
|
|
10
|
+
export declare const registerPlugin: (plugin: StorePlugin) => void;
|
|
11
|
+
/** @internal */
|
|
12
|
+
export declare const applyPlugins: (store: Store<any, any, any>, options: StoreDefinition<any, any, any>) => void;
|
|
13
|
+
//# sourceMappingURL=plugins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/store/plugins.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAKnE;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,WAAW,KAAG,IAEpD,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,YAAY,GAEvB,OAAO,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAE3B,SAAS,eAAe,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KACtC,IAOF,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store registry utilities.
|
|
3
|
+
*/
|
|
4
|
+
import type { Store } from './types';
|
|
5
|
+
/** @internal */
|
|
6
|
+
export declare const hasStore: (id: string) => boolean;
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare const registerStore: (id: string, store: Store<any, any, any>) => void;
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves an existing store by its ID.
|
|
11
|
+
*
|
|
12
|
+
* @param id - The store identifier
|
|
13
|
+
* @returns The store instance or undefined if not found
|
|
14
|
+
*/
|
|
15
|
+
export declare const getStore: <T = unknown>(id: string) => T | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Lists all registered store IDs.
|
|
18
|
+
*
|
|
19
|
+
* @returns Array of store IDs
|
|
20
|
+
*/
|
|
21
|
+
export declare const listStores: () => string[];
|
|
22
|
+
/**
|
|
23
|
+
* Removes a store from the registry.
|
|
24
|
+
*
|
|
25
|
+
* @param id - The store identifier
|
|
26
|
+
*/
|
|
27
|
+
export declare const destroyStore: (id: string) => void;
|
|
28
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/store/registry.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAMrC,gBAAgB;AAChB,eAAO,MAAM,QAAQ,GAAI,IAAI,MAAM,KAAG,OAAgC,CAAC;AAEvE,gBAAgB;AAChB,eAAO,MAAM,aAAa,GACxB,IAAI,MAAM,EAEV,OAAO,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,KAC1B,IAEF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,GAAI,CAAC,GAAG,OAAO,EAAE,IAAI,MAAM,KAAG,CAAC,GAAG,SAEtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,QAAO,MAAM,EAEnC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,IAGzC,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store types for bQuery's state module.
|
|
3
|
+
* @module bquery/store
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Store state factory function.
|
|
7
|
+
*/
|
|
8
|
+
export type StateFactory<S> = () => S;
|
|
9
|
+
/**
|
|
10
|
+
* Getter definition - derives computed values from state.
|
|
11
|
+
*/
|
|
12
|
+
export type Getters<S, G> = {
|
|
13
|
+
[K in keyof G]: (state: S, getters: G) => G[K];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Action definition - methods that can modify state.
|
|
17
|
+
* The `this` context includes state, getters, and other actions.
|
|
18
|
+
*/
|
|
19
|
+
export type Actions<S, G, A> = {
|
|
20
|
+
[K in keyof A]: A[K] extends (...args: infer P) => infer R ? (this: S & G & A, ...args: P) => R : never;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Store definition for createStore.
|
|
24
|
+
*/
|
|
25
|
+
export type StoreDefinition<S extends Record<string, unknown> = Record<string, unknown>, G extends Record<string, unknown> = Record<string, unknown>, A extends Record<string, (...args: any[]) => any> = Record<string, never>> = {
|
|
26
|
+
/** Unique store identifier for devtools */
|
|
27
|
+
id: string;
|
|
28
|
+
/** State factory function */
|
|
29
|
+
state: StateFactory<S>;
|
|
30
|
+
/** Computed getters */
|
|
31
|
+
getters?: Getters<S, G>;
|
|
32
|
+
/** Action methods */
|
|
33
|
+
actions?: Actions<S, G, A>;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Store subscriber callback.
|
|
37
|
+
*/
|
|
38
|
+
export type StoreSubscriber<S> = (state: S) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Patch payload for store updates.
|
|
41
|
+
*/
|
|
42
|
+
export type StorePatch<S> = Partial<S> | ((state: S) => void);
|
|
43
|
+
/**
|
|
44
|
+
* The returned store instance with state, getters, and actions merged.
|
|
45
|
+
*/
|
|
46
|
+
export type Store<S extends Record<string, unknown>, G extends Record<string, unknown>, A extends Record<string, (...args: any[]) => any>> = S & G & A & {
|
|
47
|
+
/** Store identifier */
|
|
48
|
+
$id: string;
|
|
49
|
+
/** Reset state to initial values */
|
|
50
|
+
$reset: () => void;
|
|
51
|
+
/** Subscribe to state changes */
|
|
52
|
+
$subscribe: (callback: StoreSubscriber<S>) => () => void;
|
|
53
|
+
/** Patch multiple state properties at once (shallow) */
|
|
54
|
+
$patch: (partial: StorePatch<S>) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Patch with deep reactivity support.
|
|
57
|
+
* Unlike $patch, this method deep-clones nested objects before mutation,
|
|
58
|
+
* ensuring that all changes trigger reactive updates.
|
|
59
|
+
*/
|
|
60
|
+
$patchDeep: (partial: StorePatch<S>) => void;
|
|
61
|
+
/** Get raw state object (non-reactive snapshot) */
|
|
62
|
+
$state: S;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Plugin that can extend store functionality.
|
|
66
|
+
*/
|
|
67
|
+
export type StorePlugin<S = unknown> = (context: {
|
|
68
|
+
store: Store<any, any, any>;
|
|
69
|
+
options: StoreDefinition<any, any, any>;
|
|
70
|
+
}) => Partial<S> | void;
|
|
71
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/store/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal utilities for the store module.
|
|
3
|
+
* @internal
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Check if a value is a plain object (not array, null, Date, etc.).
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export declare const isPlainObject: (value: unknown) => value is Record<string, unknown>;
|
|
10
|
+
/**
|
|
11
|
+
* Deep clones an object. Used for deep reactivity support.
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare const deepClone: <T>(obj: T) => T;
|
|
15
|
+
/**
|
|
16
|
+
* Compares two values for deep equality.
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export declare const deepEqual: (a: unknown, b: unknown) => boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Detects if nested objects were mutated but the reference stayed the same.
|
|
22
|
+
* Returns the keys where nested mutations were detected.
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export declare const detectNestedMutations: <S extends Record<string, unknown>>(before: S, after: S, signalValues: Map<keyof S, unknown>) => Array<keyof S>;
|
|
26
|
+
/** @internal Flag to enable/disable development warnings */
|
|
27
|
+
export declare const isDev: boolean;
|
|
28
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/store/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAI7E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,KAAK,CAAC,KAAG,CA0BrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,SAAS,GAAI,GAAG,OAAO,EAAE,GAAG,OAAO,KAAG,OA+ClD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrE,QAAQ,CAAC,EACT,OAAO,CAAC,EACR,cAAc,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,KAClC,KAAK,CAAC,MAAM,CAAC,CAoBf,CAAC;AAEF,4DAA4D;AAC5D,eAAO,MAAM,KAAK,SAQd,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store watch helpers.
|
|
3
|
+
*/
|
|
4
|
+
import type { Store } from './types';
|
|
5
|
+
export type WatchStoreOptions<T> = {
|
|
6
|
+
/** Call the callback immediately with the current value. */
|
|
7
|
+
immediate?: boolean;
|
|
8
|
+
/** Use deep comparison when determining changes. */
|
|
9
|
+
deep?: boolean;
|
|
10
|
+
/** Custom equality check for selected values. */
|
|
11
|
+
equals?: (a: T, b: T) => boolean;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Watch a selected slice of store state.
|
|
15
|
+
*
|
|
16
|
+
* @param store - The store instance
|
|
17
|
+
* @param selector - Function to select the watched value
|
|
18
|
+
* @param callback - Called when the selected value changes
|
|
19
|
+
* @param options - Watch options
|
|
20
|
+
* @returns Unsubscribe function
|
|
21
|
+
*/
|
|
22
|
+
export declare const watchStore: <S extends Record<string, unknown>, G extends Record<string, unknown>, A extends Record<string, (...args: unknown[]) => unknown>, T>(store: Store<S, G, A>, selector: (state: S) => T, callback: (value: T, previous: T | undefined) => void, options?: WatchStoreOptions<T>) => (() => void);
|
|
23
|
+
//# sourceMappingURL=watch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch.d.ts","sourceRoot":"","sources":["../../src/store/watch.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGrC,MAAM,MAAM,iBAAiB,CAAC,CAAC,IAAI;IACjC,4DAA4D;IAC5D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oDAAoD;IACpD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,iDAAiD;IACjD,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,CAAC;CAClC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,GACrB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,EACzD,CAAC,EAED,OAAO,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EACrB,UAAU,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EACzB,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,EACrD,UAAS,iBAAiB,CAAC,CAAC,CAAM,KACjC,CAAC,MAAM,IAAI,CAgBb,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { h as c, g as m, a as S, f as p } from "./persisted-Dz_ryNuC.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-Dz_ryNuC.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);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
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
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=store.es.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
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,16 @@
|
|
|
1
|
+
import { a as n, t as i, C as o, S as r } from "./core-COenAZjD.js";
|
|
2
|
+
const f = (e) => {
|
|
3
|
+
let s, a = !1;
|
|
4
|
+
const t = () => {
|
|
5
|
+
a || (s && s(), n(t), s = i(t, e));
|
|
6
|
+
};
|
|
7
|
+
return t(), () => {
|
|
8
|
+
a = !0, s && s(), n(t);
|
|
9
|
+
};
|
|
10
|
+
}, l = (e) => e instanceof r, p = (e) => e instanceof o;
|
|
11
|
+
export {
|
|
12
|
+
l as a,
|
|
13
|
+
f as e,
|
|
14
|
+
p as i
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=type-guards-DRma3-Kc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-guards-DRma3-Kc.js","sources":["../src/reactive/effect.ts","../src/reactive/type-guards.ts"],"sourcesContent":["/**\n * Reactive effects.\n */\n\nimport { CleanupFn, Observer, track, clearDependencies } from './internals';\n\n/**\n * Creates a side effect that automatically re-runs when dependencies change.\n *\n * The effect runs immediately upon creation and then re-runs whenever\n * any signal or computed value read inside it changes.\n *\n * @param fn - The effect function to run\n * @returns A cleanup function to stop the effect\n */\nexport const effect = (fn: () => void | CleanupFn): CleanupFn => {\n let cleanupFn: CleanupFn | void;\n let isDisposed = false;\n\n const observer: Observer = () => {\n if (isDisposed) return;\n\n if (cleanupFn) {\n cleanupFn();\n }\n\n // Clear old dependencies before running to avoid stale subscriptions\n clearDependencies(observer);\n\n cleanupFn = track(observer, fn);\n };\n\n observer();\n\n return () => {\n isDisposed = true;\n if (cleanupFn) {\n cleanupFn();\n }\n // Clean up all dependencies when effect is disposed\n clearDependencies(observer);\n };\n};\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","observer","clearDependencies","track","isSignal","value","Signal","isComputed","Computed"],"mappings":";AAeO,MAAMA,IAAS,CAACC,MAA0C;AAC/D,MAAIC,GACAC,IAAa;AAEjB,QAAMC,IAAqB,MAAM;AAC/B,IAAID,MAEAD,KACFA,EAAA,GAIFG,EAAkBD,CAAQ,GAE1BF,IAAYI,EAAMF,GAAUH,CAAE;AAAA,EAChC;AAEA,SAAAG,EAAA,GAEO,MAAM;AACX,IAAAD,IAAa,IACTD,KACFA,EAAA,GAGFG,EAAkBD,CAAQ;AAAA,EAC5B;AACF,GC7BaG,IAAW,CAACC,MAA6CA,aAAiBC,GAQ1EC,IAAa,CAACF,MAA+CA,aAAiBG;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"untrack-BuEQKH7_.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
|