@quantajs/react 2.0.0-beta.5 → 2.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -20,9 +20,9 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
22
  */
23
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("react"),i=require("@quantajs/core");function $(r,c){if(!r.subscribe){const a=new Error("QuantaJS store missing `subscribe`—ensure core v0.1.0-beta.2+.");throw i.logger.error(`useQuantaStore: ${a.message}`),a}const n=E.useRef(null),u=E.useCallback(()=>{const R={...r.state??{}};return Object.keys(r.actions??{}).forEach(S=>{R[S]=r.actions[S].bind(r)}),r.getters&&Object.keys(r.getters).forEach(S=>{const g=r.getters[S];R[S]=typeof g=="function"?g.bind(r):g}),R},[r]);n.current===null&&(n.current=u());const o=E.useCallback(a=>{const R=S=>{try{const h={...S??r.state??{}};Object.keys(r.actions??{}).forEach(b=>{h[b]=r.actions[b]}),r.getters&&Object.keys(r.getters).forEach(b=>{const _=r.getters[b];h[b]=typeof _=="function"?_.bind(r):_}),n.current=h,a()}catch(g){i.logger.warn(`useQuantaStore: Failed to update snapshot: ${g instanceof Error?g.message:String(g)}`)}};return r.subscribe(R)},[r]),l=E.useCallback(()=>{try{return n.current||(n.current=u()),c?c(n.current):n.current}catch(a){throw i.logger.error(`useQuantaStore: getSnapshot failed: ${a instanceof Error?a.message:String(a)}`),a}},[c,u]),v=E.useCallback(()=>{try{const a=u();return c?c(a):a}catch(a){throw i.logger.error(`useQuantaStore: getServerSnapshot failed: ${a instanceof Error?a.message:String(a)}`),a}},[c,u]);return E.useSyncExternalStore(o,l,v)}const N=E.createContext({stores:{}});function J(){try{const r=E.useContext(N);if(!r){const c="useQuantaContext must be used within a QuantaProvider";throw i.logger.error(`QuantaContext: ${c}`),new Error(c)}return r}catch(r){throw i.logger.error(`QuantaContext: Failed to access context: ${r instanceof Error?r.message:String(r)}`),r}}function ae(r,c){try{const{stores:n}=J(),u=n[r];if(!u){const o=`Store with name "${r}" does not exist in the context.`;throw i.logger.error(`useStore: ${o}`),new Error(o)}return c?$(u,c):$(u)}catch(n){throw i.logger.error(`useStore: Failed to access store "${r}": ${n instanceof Error?n.message:String(n)}`),n}}function se(r,c,n,u){try{const o=E.useRef(void 0);if(!o.current)try{o.current=i.createStore(r,{state:c,getters:n,actions:u})}catch(l){throw i.logger.error(`useCreateStore: Failed to create store "${r}": ${l instanceof Error?l.message:String(l)}`),l}return o.current}catch(o){throw i.logger.error(`useCreateStore: Hook execution failed: ${o instanceof Error?o.message:String(o)}`),o}}var k={exports:{}},T={};var W;function ce(){if(W)return T;W=1;var r=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function n(u,o,l){var v=null;if(l!==void 0&&(v=""+l),o.key!==void 0&&(v=""+o.key),"key"in o){l={};for(var a in o)a!=="key"&&(l[a]=o[a])}else l=o;return o=l.ref,{$$typeof:r,type:u,key:v,ref:o!==void 0?o:null,props:l}}return T.Fragment=c,T.jsx=n,T.jsxs=n,T}var O={};var q;function ue(){return q||(q=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case P:return"Fragment";case G:return"Profiler";case V:return"StrictMode";case Z:return"Suspense";case K:return"SuspenseList";case re:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case z:return"Portal";case H:return(e.displayName||"Context")+".Provider";case X:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ee:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case Q:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function c(e){return""+e}function n(e){try{c(e);var t=!1}catch{t=!0}if(t){t=console;var s=t.error,f=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",f),c(e)}}function u(e){if(e===P)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===Q)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function o(){var e=x.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function v(e){if(Y.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function a(e,t){function s(){F||(F=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function R(){var e=r(this.type);return I[e]||(I[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function S(e,t,s,f,p,m,j,C){return s=m.ref,e={$$typeof:_,type:e,key:t,props:m,_owner:p},(s!==void 0?s:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:R}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:j}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:C}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function g(e,t,s,f,p,m,j,C){var d=t.children;if(d!==void 0)if(f)if(ne(d)){for(f=0;f<d.length;f++)h(d[f]);Object.freeze&&Object.freeze(d)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(d);if(Y.call(t,"key")){d=r(e);var w=Object.keys(t).filter(function(oe){return oe!=="key"});f=0<w.length?"{key: someKey, "+w.join(": ..., ")+": ...}":"{key: someKey}",L[d+f]||(w=0<w.length?"{"+w.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),d=require("@quantajs/core"),oe=(r,a)=>{try{return r&&typeof r=="object"&&"value"in r?r.value:typeof r=="function"?r.bind(a):r}catch{return r}};function A(r,a){if(!r.subscribe){const l=new Error("QuantaJS store missing `subscribe`—ensure core v0.1.0-beta.2+.");throw d.logger.error(`useQuantaStore: ${l.message}`),l}if(!a){const l=b.useRef(null),g=b.useCallback(()=>{if(l.current)return l.current;const m={};return Object.keys(r.state||{}).forEach(E=>{m[E]=r[E]}),Object.keys(r.getters||{}).forEach(E=>{const S=r.getters[E];m[E]=oe(S,r)}),Object.keys(r.actions||{}).forEach(E=>{m[E]=r.actions[E].bind(r)}),m.$reset=r.$reset,m.$persist=r.$persist,m.$destroy=r.$destroy,l.current=m,m},[r]),T=b.useCallback(m=>{const E=S=>{l.current=null,m()};return r.subscribe(E)},[r]),p=b.useCallback(()=>g(),[g]);return b.useSyncExternalStore(T,g,p)}const n=b.useRef(null),u=b.useCallback(()=>{const l=a(r);return n.current=l,l},[r,a]),o=b.useCallback(l=>{const g=T=>{try{const p=a(r);n.current!==p&&(n.current=p,l())}catch(p){d.logger.warn(`useQuantaStore: Selector update failed: ${String(p)}`)}};return r.subscribe(g)},[r,a]),f=b.useCallback(()=>(n.current===null&&u(),n.current),[u]),v=b.useCallback(()=>u(),[u]);return b.useSyncExternalStore(o,f,v)}const $=b.createContext({stores:{}});function U(){try{const r=b.useContext($);if(!r){const a="useQuantaContext must be used within a QuantaProvider";throw d.logger.error(`QuantaContext: ${a}`),new Error(a)}return r}catch(r){throw d.logger.error(`QuantaContext: Failed to access context: ${r instanceof Error?r.message:String(r)}`),r}}function ae(r,a){try{const{stores:n}=U(),u=n[r];if(!u){const o=`Store with name "${r}" does not exist in the context.`;throw d.logger.error(`useStore: ${o}`),new Error(o)}return a?A(u,a):A(u)}catch(n){throw d.logger.error(`useStore: Failed to access store "${r}": ${n instanceof Error?n.message:String(n)}`),n}}function se(r,a,n,u){try{const o=b.useRef(void 0);if(!o.current)try{o.current=d.createStore(r,{state:a,getters:n,actions:u})}catch(f){throw d.logger.error(`useCreateStore: Failed to create store "${r}": ${f instanceof Error?f.message:String(f)}`),f}return o.current}catch(o){throw d.logger.error(`useCreateStore: Hook execution failed: ${o instanceof Error?o.message:String(o)}`),o}}var w={exports:{}},R={};var L;function ue(){if(L)return R;L=1;var r=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function n(u,o,f){var v=null;if(f!==void 0&&(v=""+f),o.key!==void 0&&(v=""+o.key),"key"in o){f={};for(var l in o)l!=="key"&&(f[l]=o[l])}else f=o;return o=f.ref,{$$typeof:r,type:u,key:v,ref:o!==void 0?o:null,props:f}}return R.Fragment=a,R.jsx=n,R.jsxs=n,R}var h={};var W;function ce(){return W||(W=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case z:return"Profiler";case V:return"StrictMode";case B:return"Suspense";case Z:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case J:return"Portal";case X:return e.displayName||"Context";case G:return(e._context.displayName||"Context")+".Consumer";case H:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function a(e){return""+e}function n(e){try{a(e);var t=!1}catch{t=!0}if(t){t=console;var s=t.error,c=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",c),a(e)}}function u(e){if(e===k)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function o(){var e=x.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function v(e){if(Y.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function l(e,t){function s(){Q||(Q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function g(){var e=r(this.type);return F[e]||(F[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function T(e,t,s,c,y,j){var i=s.ref;return e={$$typeof:N,type:e,key:t,props:s,_owner:c},(i!==void 0?i:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:g}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:j}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function p(e,t,s,c,y,j){var i=t.children;if(i!==void 0)if(c)if(te(i)){for(c=0;c<i.length;c++)m(i[c]);Object.freeze&&Object.freeze(i)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else m(i);if(Y.call(t,"key")){i=r(e);var _=Object.keys(t).filter(function(ne){return ne!=="key"});c=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",D[i+c]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
24
24
  let props = %s;
25
25
  <%s {...props} />
26
26
  React keys must be passed directly to JSX without using spread:
27
27
  let props = %s;
28
- <%s key={someKey} {...props} />`,f,d,w,d),L[d+f]=!0)}if(d=null,s!==void 0&&(n(s),d=""+s),v(t)&&(n(t.key),d=""+t.key),"key"in t){s={};for(var A in t)A!=="key"&&(s[A]=t[A])}else s=t;return d&&a(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),S(e,d,m,p,o(),s,j,C)}function h(e){typeof e=="object"&&e!==null&&e.$$typeof===_&&e._store&&(e._store.validated=1)}var b=E,_=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),P=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),X=Symbol.for("react.consumer"),H=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),K=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),re=Symbol.for("react.activity"),te=Symbol.for("react.client.reference"),x=b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,ne=Array.isArray,y=console.createTask?console.createTask:function(){return null};b={react_stack_bottom_frame:function(e){return e()}};var F,I={},M=b.react_stack_bottom_frame.bind(b,l)(),D=y(u(l)),L={};O.Fragment=P,O.jsx=function(e,t,s,f,p){var m=1e4>x.recentlyCreatedOwnerStacks++;return g(e,t,s,!1,f,p,m?Error("react-stack-top-frame"):M,m?y(u(e)):D)},O.jsxs=function(e,t,s,f,p){var m=1e4>x.recentlyCreatedOwnerStacks++;return g(e,t,s,!0,f,p,m?Error("react-stack-top-frame"):M,m?y(u(e)):D)}})()),O}var U;function ie(){return U||(U=1,process.env.NODE_ENV==="production"?k.exports=ce():k.exports=ue()),k.exports}var le=ie();function fe({stores:r,children:c}){try{if(!r||typeof r!="object"){const n="QuantaProvider: Invalid stores prop provided";throw i.logger.error(n),new Error(n)}for(const[n,u]of Object.entries(r))if(!u||typeof u!="object"){const o=`QuantaProvider: Invalid store "${n}" provided`;throw i.logger.error(o),new Error(o)}return le.jsx(N.Provider,{value:{stores:r},children:c})}catch(n){throw i.logger.error(`QuantaProvider: Failed to render provider: ${n instanceof Error?n.message:String(n)}`),n}}Object.defineProperty(exports,"computed",{enumerable:!0,get:()=>i.computed});Object.defineProperty(exports,"createStore",{enumerable:!0,get:()=>i.createStore});Object.defineProperty(exports,"logger",{enumerable:!0,get:()=>i.logger});Object.defineProperty(exports,"reactive",{enumerable:!0,get:()=>i.reactive});Object.defineProperty(exports,"watch",{enumerable:!0,get:()=>i.watch});exports.QuantaContext=N;exports.QuantaProvider=fe;exports.useCreateStore=se;exports.useQuantaContext=J;exports.useQuantaStore=$;exports.useStore=ae;
28
+ <%s key={someKey} {...props} />`,c,i,_,i),D[i+c]=!0)}if(i=null,s!==void 0&&(n(s),i=""+s),v(t)&&(n(t.key),i=""+t.key),"key"in t){s={};for(var C in t)C!=="key"&&(s[C]=t[C])}else s=t;return i&&l(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),T(e,i,s,o(),y,j)}function m(e){E(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?E(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function E(e){return typeof e=="object"&&e!==null&&e.$$typeof===N}var S=b,N=Symbol.for("react.transitional.element"),J=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),X=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),re=Symbol.for("react.client.reference"),x=S.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,te=Array.isArray,P=console.createTask?console.createTask:function(){return null};S={react_stack_bottom_frame:function(e){return e()}};var Q,F={},I=S.react_stack_bottom_frame.bind(S,f)(),M=P(u(f)),D={};h.Fragment=k,h.jsx=function(e,t,s){var c=1e4>x.recentlyCreatedOwnerStacks++;return p(e,t,s,!1,c?Error("react-stack-top-frame"):I,c?P(u(e)):M)},h.jsxs=function(e,t,s){var c=1e4>x.recentlyCreatedOwnerStacks++;return p(e,t,s,!0,c?Error("react-stack-top-frame"):I,c?P(u(e)):M)}})()),h}var q;function ie(){return q||(q=1,process.env.NODE_ENV==="production"?w.exports=ue():w.exports=ce()),w.exports}var le=ie();function fe({stores:r,children:a}){try{if(!r||typeof r!="object"){const n="QuantaProvider: Invalid stores prop provided";throw d.logger.error(n),new Error(n)}for(const[n,u]of Object.entries(r))if(!u||typeof u!="object"){const o=`QuantaProvider: Invalid store "${n}" provided`;throw d.logger.error(o),new Error(o)}return le.jsx($.Provider,{value:{stores:r},children:a})}catch(n){throw d.logger.error(`QuantaProvider: Failed to render provider: ${n instanceof Error?n.message:String(n)}`),n}}Object.defineProperty(exports,"computed",{enumerable:!0,get:()=>d.computed});Object.defineProperty(exports,"createStore",{enumerable:!0,get:()=>d.createStore});Object.defineProperty(exports,"logger",{enumerable:!0,get:()=>d.logger});Object.defineProperty(exports,"reactive",{enumerable:!0,get:()=>d.reactive});Object.defineProperty(exports,"watch",{enumerable:!0,get:()=>d.watch});exports.QuantaContext=$;exports.QuantaProvider=fe;exports.useCreateStore=se;exports.useQuantaContext=U;exports.useQuantaStore=A;exports.useStore=ae;
package/dist/index.d.ts CHANGED
@@ -2,13 +2,13 @@ import { ActionDefinition } from '@quantajs/core';
2
2
  import { computed } from '@quantajs/core';
3
3
  import { Context } from 'react';
4
4
  import { createStore } from '@quantajs/core';
5
- import { GetterDefinition } from '@quantajs/core';
5
+ import { GetterDefinitions } from '@quantajs/core';
6
6
  import { JSX } from 'react/jsx-runtime';
7
7
  import { logger } from '@quantajs/core';
8
+ import { RawActions } from '@quantajs/core';
8
9
  import { reactive } from '@quantajs/core';
9
10
  import { ReactNode } from 'react';
10
11
  import { StateDefinition } from '@quantajs/core';
11
- import { Store } from '@quantajs/core';
12
12
  import { StoreInstance } from '@quantajs/core';
13
13
  import { StoreSubscriber } from '@quantajs/core';
14
14
  import { watch } from '@quantajs/core';
@@ -19,7 +19,7 @@ export { computed }
19
19
 
20
20
  export { createStore }
21
21
 
22
- export { GetterDefinition }
22
+ export { GetterDefinitions }
23
23
 
24
24
  export { logger }
25
25
 
@@ -49,8 +49,6 @@ export { reactive }
49
49
 
50
50
  export { StateDefinition }
51
51
 
52
- export { Store }
53
-
54
52
  export { StoreInstance }
55
53
 
56
54
  export { StoreSubscriber }
@@ -59,7 +57,7 @@ export { StoreSubscriber }
59
57
  * Hook to create a QuantaJS store instance within a React component
60
58
  * Creates store only once and reuses it across re-renders
61
59
  */
62
- export declare function useCreateStore<S extends object, G extends object = {}, A extends Record<string, (...args: any[]) => any> = {}>(name: string, state: StateDefinition<S>, getters?: GetterDefinition<S, G>, actions?: ActionDefinition<S, G, A>): StoreInstance<S, G, A>;
60
+ export declare function useCreateStore<S extends object, GDefs extends Record<string, (state: S) => any> = {}, A extends Record<string, (...args: any[]) => any> = {}>(name: string, state: StateDefinition<S>, getters?: GetterDefinitions<S, GDefs>, actions?: ActionDefinition<S, GDefs, A>): StoreInstance<S, GDefs, A>;
63
61
 
64
62
  /**
65
63
  * Hook to access the QuantaJS store from the context
@@ -72,9 +70,9 @@ export declare function useQuantaContext(): QuantaContextValue;
72
70
  * Hook to subscribe to a QuantaJS store and get reactive updates
73
71
  * Simple implementation that relies on QuantaJS core's reactivity system
74
72
  */
75
- export declare function useQuantaStore<S extends object, G extends object, A extends object>(store: StoreInstance<S, G, A>): StoreInstance<S, G, A>;
73
+ export declare function useQuantaStore<S extends object, GDefs extends Record<string, (state: S) => any> = {}, A extends RawActions = {}>(store: StoreInstance<S, GDefs, A>): StoreInstance<S, GDefs, A>;
76
74
 
77
- export declare function useQuantaStore<S extends object, G extends object, A extends object, T = any>(store: StoreInstance<S, G, A>, selector: (store: StoreInstance<S, G, A>) => T): T;
75
+ export declare function useQuantaStore<S extends object, GDefs extends Record<string, (state: S) => any> = {}, A extends RawActions = {}, T = any>(store: StoreInstance<S, GDefs, A>, selector: (store: StoreInstance<S, GDefs, A>) => T): T;
78
76
 
79
77
  /**
80
78
  * Hook to access and subscribe to the QuantaJS store from context
package/dist/index.js CHANGED
@@ -20,155 +20,164 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
22
  */
23
- import ae, { useRef as J, useCallback as x, useSyncExternalStore as se, createContext as ce, useContext as ue } from "react";
24
- import { logger as d, createStore as ie } from "@quantajs/core";
25
- import { computed as _e, createStore as we, logger as Te, reactive as xe, watch as ke } from "@quantajs/core";
26
- function D(r, c) {
23
+ import ae, { useRef as C, useCallback as R, useSyncExternalStore as D, createContext as se, useContext as ce } from "react";
24
+ import { logger as b, createStore as ue } from "@quantajs/core";
25
+ import { computed as Te, createStore as ge, logger as we, reactive as xe, watch as ye } from "@quantajs/core";
26
+ const ie = (r, a) => {
27
+ try {
28
+ return r && typeof r == "object" && "value" in r ? r.value : typeof r == "function" ? r.bind(a) : r;
29
+ } catch {
30
+ return r;
31
+ }
32
+ };
33
+ function L(r, a) {
27
34
  if (!r.subscribe) {
28
- const a = new Error(
35
+ const l = new Error(
29
36
  "QuantaJS store missing `subscribe`—ensure core v0.1.0-beta.2+."
30
37
  );
31
- throw d.error(`useQuantaStore: ${a.message}`), a;
38
+ throw b.error(`useQuantaStore: ${l.message}`), l;
32
39
  }
33
- const n = J(null), u = x(() => {
34
- const g = { ...r.state ?? {} };
35
- return Object.keys(r.actions ?? {}).forEach((p) => {
36
- g[p] = r.actions[p].bind(r);
37
- }), r.getters && Object.keys(r.getters).forEach((p) => {
38
- const m = r.getters[p];
39
- g[p] = typeof m == "function" ? m.bind(r) : m;
40
- }), g;
41
- }, [r]);
42
- n.current === null && (n.current = u());
43
- const o = x(
44
- (a) => {
45
- const g = (p) => {
40
+ if (!a) {
41
+ const l = C(null), v = R(() => {
42
+ if (l.current) return l.current;
43
+ const d = {};
44
+ return Object.keys(r.state || {}).forEach((m) => {
45
+ d[m] = r[m];
46
+ }), Object.keys(r.getters || {}).forEach((m) => {
47
+ const _ = r.getters[m];
48
+ d[m] = ie(_, r);
49
+ }), Object.keys(r.actions || {}).forEach((m) => {
50
+ d[m] = r.actions[m].bind(r);
51
+ }), d.$reset = r.$reset, d.$persist = r.$persist, d.$destroy = r.$destroy, l.current = d, d;
52
+ }, [r]), g = R(
53
+ (d) => {
54
+ const m = (_) => {
55
+ l.current = null, d();
56
+ };
57
+ return r.subscribe(m);
58
+ },
59
+ [r]
60
+ ), E = R(
61
+ () => v(),
62
+ [v]
63
+ );
64
+ return D(g, v, E);
65
+ }
66
+ const n = C(null), c = R(() => {
67
+ const l = a(r);
68
+ return n.current = l, l;
69
+ }, [r, a]), o = R(
70
+ (l) => {
71
+ const v = (g) => {
46
72
  try {
47
- const R = { ...p ?? r.state ?? {} };
48
- Object.keys(r.actions ?? {}).forEach((E) => {
49
- R[E] = r.actions[E];
50
- }), r.getters && Object.keys(r.getters).forEach((E) => {
51
- const h = r.getters[E];
52
- R[E] = typeof h == "function" ? h.bind(r) : h;
53
- }), n.current = R, a();
54
- } catch (m) {
55
- d.warn(
56
- `useQuantaStore: Failed to update snapshot: ${m instanceof Error ? m.message : String(m)}`
73
+ const E = a(r);
74
+ n.current !== E && (n.current = E, l());
75
+ } catch (E) {
76
+ b.warn(
77
+ `useQuantaStore: Selector update failed: ${String(E)}`
57
78
  );
58
79
  }
59
80
  };
60
- return r.subscribe(g);
81
+ return r.subscribe(v);
61
82
  },
62
- [r]
63
- ), i = x(() => {
64
- try {
65
- return n.current || (n.current = u()), c ? c(n.current) : n.current;
66
- } catch (a) {
67
- throw d.error(
68
- `useQuantaStore: getSnapshot failed: ${a instanceof Error ? a.message : String(a)}`
69
- ), a;
70
- }
71
- }, [c, u]), S = x(() => {
72
- try {
73
- const a = u();
74
- return c ? c(a) : a;
75
- } catch (a) {
76
- throw d.error(
77
- `useQuantaStore: getServerSnapshot failed: ${a instanceof Error ? a.message : String(a)}`
78
- ), a;
79
- }
80
- }, [c, u]);
81
- return se(o, i, S);
83
+ [r, a]
84
+ ), f = R(() => (n.current === null && c(), n.current), [c]), p = R(
85
+ () => c(),
86
+ [c]
87
+ );
88
+ return D(o, f, p);
82
89
  }
83
- const q = ce({ stores: {} });
90
+ const V = se({ stores: {} });
84
91
  function le() {
85
92
  try {
86
- const r = ue(q);
93
+ const r = ce(V);
87
94
  if (!r) {
88
- const c = "useQuantaContext must be used within a QuantaProvider";
89
- throw d.error(`QuantaContext: ${c}`), new Error(c);
95
+ const a = "useQuantaContext must be used within a QuantaProvider";
96
+ throw b.error(`QuantaContext: ${a}`), new Error(a);
90
97
  }
91
98
  return r;
92
99
  } catch (r) {
93
- throw d.error(
100
+ throw b.error(
94
101
  `QuantaContext: Failed to access context: ${r instanceof Error ? r.message : String(r)}`
95
102
  ), r;
96
103
  }
97
104
  }
98
- function ve(r, c) {
105
+ function ve(r, a) {
99
106
  try {
100
- const { stores: n } = le(), u = n[r];
101
- if (!u) {
107
+ const { stores: n } = le(), c = n[r];
108
+ if (!c) {
102
109
  const o = `Store with name "${r}" does not exist in the context.`;
103
- throw d.error(`useStore: ${o}`), new Error(o);
110
+ throw b.error(`useStore: ${o}`), new Error(o);
104
111
  }
105
- return c ? D(u, c) : D(u);
112
+ return a ? L(c, a) : L(c);
106
113
  } catch (n) {
107
- throw d.error(
114
+ throw b.error(
108
115
  `useStore: Failed to access store "${r}": ${n instanceof Error ? n.message : String(n)}`
109
116
  ), n;
110
117
  }
111
118
  }
112
- function Se(r, c, n, u) {
119
+ function _e(r, a, n, c) {
113
120
  try {
114
- const o = J(void 0);
121
+ const o = C(
122
+ void 0
123
+ );
115
124
  if (!o.current)
116
125
  try {
117
- o.current = ie(r, {
118
- state: c,
126
+ o.current = ue(r, {
127
+ state: a,
119
128
  getters: n,
120
- actions: u
129
+ actions: c
121
130
  });
122
- } catch (i) {
123
- throw d.error(
124
- `useCreateStore: Failed to create store "${r}": ${i instanceof Error ? i.message : String(i)}`
125
- ), i;
131
+ } catch (f) {
132
+ throw b.error(
133
+ `useCreateStore: Failed to create store "${r}": ${f instanceof Error ? f.message : String(f)}`
134
+ ), f;
126
135
  }
127
136
  return o.current;
128
137
  } catch (o) {
129
- throw d.error(
138
+ throw b.error(
130
139
  `useCreateStore: Hook execution failed: ${o instanceof Error ? o.message : String(o)}`
131
140
  ), o;
132
141
  }
133
142
  }
134
- var k = { exports: {} }, w = {};
135
- var L;
143
+ var x = { exports: {} }, h = {};
144
+ var W;
136
145
  function fe() {
137
- if (L) return w;
138
- L = 1;
139
- var r = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
140
- function n(u, o, i) {
141
- var S = null;
142
- if (i !== void 0 && (S = "" + i), o.key !== void 0 && (S = "" + o.key), "key" in o) {
143
- i = {};
144
- for (var a in o)
145
- a !== "key" && (i[a] = o[a]);
146
- } else i = o;
147
- return o = i.ref, {
146
+ if (W) return h;
147
+ W = 1;
148
+ var r = Symbol.for("react.transitional.element"), a = Symbol.for("react.fragment");
149
+ function n(c, o, f) {
150
+ var p = null;
151
+ if (f !== void 0 && (p = "" + f), o.key !== void 0 && (p = "" + o.key), "key" in o) {
152
+ f = {};
153
+ for (var l in o)
154
+ l !== "key" && (f[l] = o[l]);
155
+ } else f = o;
156
+ return o = f.ref, {
148
157
  $$typeof: r,
149
- type: u,
150
- key: S,
158
+ type: c,
159
+ key: p,
151
160
  ref: o !== void 0 ? o : null,
152
- props: i
161
+ props: f
153
162
  };
154
163
  }
155
- return w.Fragment = c, w.jsx = n, w.jsxs = n, w;
164
+ return h.Fragment = a, h.jsx = n, h.jsxs = n, h;
156
165
  }
157
166
  var T = {};
158
- var W;
167
+ var U;
159
168
  function de() {
160
- return W || (W = 1, process.env.NODE_ENV !== "production" && (function() {
169
+ return U || (U = 1, process.env.NODE_ENV !== "production" && (function() {
161
170
  function r(e) {
162
171
  if (e == null) return null;
163
172
  if (typeof e == "function")
164
173
  return e.$$typeof === te ? null : e.displayName || e.name || null;
165
174
  if (typeof e == "string") return e;
166
175
  switch (e) {
167
- case O:
176
+ case y:
168
177
  return "Fragment";
169
178
  case G:
170
179
  return "Profiler";
171
- case V:
180
+ case z:
172
181
  return "StrictMode";
173
182
  case Z:
174
183
  return "Suspense";
@@ -181,10 +190,10 @@ function de() {
181
190
  switch (typeof e.tag == "number" && console.error(
182
191
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
183
192
  ), e.$$typeof) {
184
- case z:
193
+ case q:
185
194
  return "Portal";
186
195
  case H:
187
- return (e.displayName || "Context") + ".Provider";
196
+ return e.displayName || "Context";
188
197
  case X:
189
198
  return (e._context.displayName || "Context") + ".Consumer";
190
199
  case B:
@@ -192,7 +201,7 @@ function de() {
192
201
  return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
193
202
  case ee:
194
203
  return t = e.displayName || null, t !== null ? t : r(e.type) || "Memo";
195
- case $:
204
+ case k:
196
205
  t = e._payload, e = e._init;
197
206
  try {
198
207
  return r(e(t));
@@ -201,29 +210,29 @@ function de() {
201
210
  }
202
211
  return null;
203
212
  }
204
- function c(e) {
213
+ function a(e) {
205
214
  return "" + e;
206
215
  }
207
216
  function n(e) {
208
217
  try {
209
- c(e);
218
+ a(e);
210
219
  var t = !1;
211
220
  } catch {
212
221
  t = !0;
213
222
  }
214
223
  if (t) {
215
224
  t = console;
216
- var s = t.error, l = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
225
+ var s = t.error, u = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
217
226
  return s.call(
218
227
  t,
219
228
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
220
- l
221
- ), c(e);
229
+ u
230
+ ), a(e);
222
231
  }
223
232
  }
224
- function u(e) {
225
- if (e === O) return "<>";
226
- if (typeof e == "object" && e !== null && e.$$typeof === $)
233
+ function c(e) {
234
+ if (e === y) return "<>";
235
+ if (typeof e == "object" && e !== null && e.$$typeof === k)
227
236
  return "<...>";
228
237
  try {
229
238
  var t = r(e);
@@ -233,20 +242,20 @@ function de() {
233
242
  }
234
243
  }
235
244
  function o() {
236
- var e = P.A;
245
+ var e = O.A;
237
246
  return e === null ? null : e.getOwner();
238
247
  }
239
- function i() {
248
+ function f() {
240
249
  return Error("react-stack-top-frame");
241
250
  }
242
- function S(e) {
251
+ function p(e) {
243
252
  if (N.call(e, "key")) {
244
253
  var t = Object.getOwnPropertyDescriptor(e, "key").get;
245
254
  if (t && t.isReactWarning) return !1;
246
255
  }
247
256
  return e.key !== void 0;
248
257
  }
249
- function a(e, t) {
258
+ function l(e, t) {
250
259
  function s() {
251
260
  Y || (Y = !0, console.error(
252
261
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
@@ -258,22 +267,23 @@ function de() {
258
267
  configurable: !0
259
268
  });
260
269
  }
261
- function g() {
270
+ function v() {
262
271
  var e = r(this.type);
263
272
  return F[e] || (F[e] = !0, console.error(
264
273
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
265
274
  )), e = this.props.ref, e !== void 0 ? e : null;
266
275
  }
267
- function p(e, t, s, l, v, b, y, A) {
268
- return s = b.ref, e = {
269
- $$typeof: h,
276
+ function g(e, t, s, u, w, j) {
277
+ var i = s.ref;
278
+ return e = {
279
+ $$typeof: $,
270
280
  type: e,
271
281
  key: t,
272
- props: b,
273
- _owner: v
274
- }, (s !== void 0 ? s : null) !== null ? Object.defineProperty(e, "ref", {
282
+ props: s,
283
+ _owner: u
284
+ }, (i !== void 0 ? i : null) !== null ? Object.defineProperty(e, "ref", {
275
285
  enumerable: !1,
276
- get: g
286
+ get: v
277
287
  }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
278
288
  configurable: !1,
279
289
  enumerable: !1,
@@ -288,139 +298,136 @@ function de() {
288
298
  configurable: !1,
289
299
  enumerable: !1,
290
300
  writable: !0,
291
- value: y
301
+ value: w
292
302
  }), Object.defineProperty(e, "_debugTask", {
293
303
  configurable: !1,
294
304
  enumerable: !1,
295
305
  writable: !0,
296
- value: A
306
+ value: j
297
307
  }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
298
308
  }
299
- function m(e, t, s, l, v, b, y, A) {
300
- var f = t.children;
301
- if (f !== void 0)
302
- if (l)
303
- if (ne(f)) {
304
- for (l = 0; l < f.length; l++)
305
- R(f[l]);
306
- Object.freeze && Object.freeze(f);
309
+ function E(e, t, s, u, w, j) {
310
+ var i = t.children;
311
+ if (i !== void 0)
312
+ if (u)
313
+ if (ne(i)) {
314
+ for (u = 0; u < i.length; u++)
315
+ d(i[u]);
316
+ Object.freeze && Object.freeze(i);
307
317
  } else
308
318
  console.error(
309
319
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
310
320
  );
311
- else R(f);
321
+ else d(i);
312
322
  if (N.call(t, "key")) {
313
- f = r(e);
314
- var _ = Object.keys(t).filter(function(oe) {
323
+ i = r(e);
324
+ var S = Object.keys(t).filter(function(oe) {
315
325
  return oe !== "key";
316
326
  });
317
- l = 0 < _.length ? "{key: someKey, " + _.join(": ..., ") + ": ...}" : "{key: someKey}", M[f + l] || (_ = 0 < _.length ? "{" + _.join(": ..., ") + ": ...}" : "{}", console.error(
327
+ u = 0 < S.length ? "{key: someKey, " + S.join(": ..., ") + ": ...}" : "{key: someKey}", Q[i + u] || (S = 0 < S.length ? "{" + S.join(": ..., ") + ": ...}" : "{}", console.error(
318
328
  `A props object containing a "key" prop is being spread into JSX:
319
329
  let props = %s;
320
330
  <%s {...props} />
321
331
  React keys must be passed directly to JSX without using spread:
322
332
  let props = %s;
323
333
  <%s key={someKey} {...props} />`,
324
- l,
325
- f,
326
- _,
327
- f
328
- ), M[f + l] = !0);
334
+ u,
335
+ i,
336
+ S,
337
+ i
338
+ ), Q[i + u] = !0);
329
339
  }
330
- if (f = null, s !== void 0 && (n(s), f = "" + s), S(t) && (n(t.key), f = "" + t.key), "key" in t) {
340
+ if (i = null, s !== void 0 && (n(s), i = "" + s), p(t) && (n(t.key), i = "" + t.key), "key" in t) {
331
341
  s = {};
332
- for (var C in t)
333
- C !== "key" && (s[C] = t[C]);
342
+ for (var A in t)
343
+ A !== "key" && (s[A] = t[A]);
334
344
  } else s = t;
335
- return f && a(
345
+ return i && l(
336
346
  s,
337
347
  typeof e == "function" ? e.displayName || e.name || "Unknown" : e
338
- ), p(
348
+ ), g(
339
349
  e,
340
- f,
341
- b,
342
- v,
343
- o(),
350
+ i,
344
351
  s,
345
- y,
346
- A
352
+ o(),
353
+ w,
354
+ j
347
355
  );
348
356
  }
349
- function R(e) {
350
- typeof e == "object" && e !== null && e.$$typeof === h && e._store && (e._store.validated = 1);
357
+ function d(e) {
358
+ m(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === k && (e._payload.status === "fulfilled" ? m(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
351
359
  }
352
- var E = ae, h = Symbol.for("react.transitional.element"), z = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), V = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), H = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), K = Symbol.for("react.suspense_list"), ee = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), re = Symbol.for("react.activity"), te = Symbol.for("react.client.reference"), P = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, ne = Array.isArray, j = console.createTask ? console.createTask : function() {
360
+ function m(e) {
361
+ return typeof e == "object" && e !== null && e.$$typeof === $;
362
+ }
363
+ var _ = ae, $ = Symbol.for("react.transitional.element"), q = Symbol.for("react.portal"), y = Symbol.for("react.fragment"), z = Symbol.for("react.strict_mode"), G = Symbol.for("react.profiler"), X = Symbol.for("react.consumer"), H = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), Z = Symbol.for("react.suspense"), K = Symbol.for("react.suspense_list"), ee = Symbol.for("react.memo"), k = Symbol.for("react.lazy"), re = Symbol.for("react.activity"), te = Symbol.for("react.client.reference"), O = _.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, N = Object.prototype.hasOwnProperty, ne = Array.isArray, P = console.createTask ? console.createTask : function() {
353
364
  return null;
354
365
  };
355
- E = {
366
+ _ = {
356
367
  react_stack_bottom_frame: function(e) {
357
368
  return e();
358
369
  }
359
370
  };
360
- var Y, F = {}, I = E.react_stack_bottom_frame.bind(
361
- E,
362
- i
363
- )(), Q = j(u(i)), M = {};
364
- T.Fragment = O, T.jsx = function(e, t, s, l, v) {
365
- var b = 1e4 > P.recentlyCreatedOwnerStacks++;
366
- return m(
371
+ var Y, F = {}, I = _.react_stack_bottom_frame.bind(
372
+ _,
373
+ f
374
+ )(), M = P(c(f)), Q = {};
375
+ T.Fragment = y, T.jsx = function(e, t, s) {
376
+ var u = 1e4 > O.recentlyCreatedOwnerStacks++;
377
+ return E(
367
378
  e,
368
379
  t,
369
380
  s,
370
381
  !1,
371
- l,
372
- v,
373
- b ? Error("react-stack-top-frame") : I,
374
- b ? j(u(e)) : Q
382
+ u ? Error("react-stack-top-frame") : I,
383
+ u ? P(c(e)) : M
375
384
  );
376
- }, T.jsxs = function(e, t, s, l, v) {
377
- var b = 1e4 > P.recentlyCreatedOwnerStacks++;
378
- return m(
385
+ }, T.jsxs = function(e, t, s) {
386
+ var u = 1e4 > O.recentlyCreatedOwnerStacks++;
387
+ return E(
379
388
  e,
380
389
  t,
381
390
  s,
382
391
  !0,
383
- l,
384
- v,
385
- b ? Error("react-stack-top-frame") : I,
386
- b ? j(u(e)) : Q
392
+ u ? Error("react-stack-top-frame") : I,
393
+ u ? P(c(e)) : M
387
394
  );
388
395
  };
389
396
  })()), T;
390
397
  }
391
- var U;
398
+ var J;
392
399
  function me() {
393
- return U || (U = 1, process.env.NODE_ENV === "production" ? k.exports = fe() : k.exports = de()), k.exports;
400
+ return J || (J = 1, process.env.NODE_ENV === "production" ? x.exports = fe() : x.exports = de()), x.exports;
394
401
  }
395
- var Ee = me();
396
- function ge({ stores: r, children: c }) {
402
+ var be = me();
403
+ function Re({ stores: r, children: a }) {
397
404
  try {
398
405
  if (!r || typeof r != "object") {
399
406
  const n = "QuantaProvider: Invalid stores prop provided";
400
- throw d.error(n), new Error(n);
407
+ throw b.error(n), new Error(n);
401
408
  }
402
- for (const [n, u] of Object.entries(r))
403
- if (!u || typeof u != "object") {
409
+ for (const [n, c] of Object.entries(r))
410
+ if (!c || typeof c != "object") {
404
411
  const o = `QuantaProvider: Invalid store "${n}" provided`;
405
- throw d.error(o), new Error(o);
412
+ throw b.error(o), new Error(o);
406
413
  }
407
- return /* @__PURE__ */ Ee.jsx(q.Provider, { value: { stores: r }, children: c });
414
+ return /* @__PURE__ */ be.jsx(V.Provider, { value: { stores: r }, children: a });
408
415
  } catch (n) {
409
- throw d.error(
416
+ throw b.error(
410
417
  `QuantaProvider: Failed to render provider: ${n instanceof Error ? n.message : String(n)}`
411
418
  ), n;
412
419
  }
413
420
  }
414
421
  export {
415
- q as QuantaContext,
416
- ge as QuantaProvider,
417
- _e as computed,
418
- we as createStore,
419
- Te as logger,
422
+ V as QuantaContext,
423
+ Re as QuantaProvider,
424
+ Te as computed,
425
+ ge as createStore,
426
+ we as logger,
420
427
  xe as reactive,
421
- Se as useCreateStore,
428
+ _e as useCreateStore,
422
429
  le as useQuantaContext,
423
- D as useQuantaStore,
430
+ L as useQuantaStore,
424
431
  ve as useStore,
425
- ke as watch
432
+ ye as watch
426
433
  };
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "url": "https://github.com/quanta-js/quanta/issues"
23
23
  },
24
24
  "homepage": "https://quantajs.com",
25
- "version": "2.0.0-beta.5",
25
+ "version": "2.0.0-beta.6",
26
26
  "type": "module",
27
27
  "license": "MIT",
28
28
  "main": "./dist/index.js",
@@ -43,11 +43,11 @@
43
43
  "react": ">=16.8.0"
44
44
  },
45
45
  "dependencies": {
46
- "@quantajs/core": "2.0.0-beta.5"
46
+ "@quantajs/core": "2.0.0-beta.6"
47
47
  },
48
48
  "devDependencies": {
49
- "@types/react": "^19.1.13",
50
- "react": "^19.1.1"
49
+ "@types/react": "^19.2.2",
50
+ "react": "^19.2.0"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public",