@yakocloud/state-vocab 3.1.3 → 3.1.5
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 +20 -1
- package/dist/state-vocab.cjs.js +4 -4
- package/dist/state-vocab.es.js +271 -258
- package/dist/types/context.d.ts +3 -0
- package/dist/types/state.d.ts +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -508,4 +508,23 @@ A React context provider that initializes a `VocabStore` for its subtree. Requir
|
|
|
508
508
|
| `onSet` | `(next: T, prev: T) => void \| undefined` | Callback after state change |
|
|
509
509
|
| `bidirectional` | `true \| undefined` | Sync state across browser tabs |
|
|
510
510
|
|
|
511
|
-
Returns `[value, setValue, resetValue]`
|
|
511
|
+
Returns `[value, setValue, resetValue]`
|
|
512
|
+
|
|
513
|
+
### `node.useInitialState(options)`
|
|
514
|
+
|
|
515
|
+
Initializes state without subscribing the caller component to re-renders. Use at layout or root components that only need to seed a value — not react to its changes.
|
|
516
|
+
|
|
517
|
+
| Option | Type | Description |
|
|
518
|
+
|---|---|---|
|
|
519
|
+
| `defaultValue` | `T \| (() => T)` | Value to seed. Required. |
|
|
520
|
+
|
|
521
|
+
```tsx
|
|
522
|
+
function Page() {
|
|
523
|
+
// Seeds the value — this component will NOT re-render when pageProps changes
|
|
524
|
+
storage.demo.pageProps.useInitialState({
|
|
525
|
+
defaultValue: { title: 'Hello', count: 42 },
|
|
526
|
+
})
|
|
527
|
+
|
|
528
|
+
return <Dashboard />
|
|
529
|
+
}
|
|
530
|
+
```
|
package/dist/state-vocab.cjs.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react");var Y={exports:{}},V={};var re;function Ee(){if(re)return V;re=1;var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(u,o,a){var l=null;if(a!==void 0&&(l=""+a),o.key!==void 0&&(l=""+o.key),"key"in o){a={};for(var c in o)c!=="key"&&(a[c]=o[c])}else a=o;return o=a.ref,{$$typeof:t,type:u,key:l,ref:o!==void 0?o:null,props:a}}return V.Fragment=n,V.jsx=r,V.jsxs=r,V}var I={};var ne;function Se(){return ne||(ne=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===be?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case h:return"Fragment";case A:return"Profiler";case j:return"StrictMode";case J:return"Suspense";case i:return"SuspenseList";case P: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 p:return"Portal";case k:return e.displayName||"Context";case w:return(e._context.displayName||"Context")+".Consumer";case C:var s=e.render;return e=e.displayName,e||(e=s.displayName||s.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case T:return s=e.displayName||null,s!==null?s:t(e.type)||"Memo";case O:s=e._payload,e=e._init;try{return t(e(s))}catch{}}return null}function n(e){return""+e}function r(e){try{n(e);var s=!1}catch{s=!0}if(s){s=console;var b=s.error,m=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return b.call(s,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",m),n(e)}}function u(e){if(e===h)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var s=t(e);return s?"<"+s+">":"<...>"}catch{return"<...>"}}function o(){var e=W.A;return e===null?null:e.getOwner()}function a(){return Error("react-stack-top-frame")}function l(e){if(H.call(e,"key")){var s=Object.getOwnPropertyDescriptor(e,"key").get;if(s&&s.isReactWarning)return!1}return e.key!==void 0}function c(e,s){function b(){Z||(Z=!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)",s))}b.isReactWarning=!0,Object.defineProperty(e,"key",{get:b,configurable:!0})}function y(){var e=t(this.type);return Q[e]||(Q[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 R(e,s,b,m,M,q){var v=b.ref;return e={$$typeof:S,type:e,key:s,props:b,_owner:m},(v!==void 0?v:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):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:M}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function g(e,s,b,m,M,q){var v=s.children;if(v!==void 0)if(m)if(me(v)){for(m=0;m<v.length;m++)f(v[m]);Object.freeze&&Object.freeze(v)}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 f(v);if(H.call(s,"key")){v=t(e);var N=Object.keys(s).filter(function(ve){return ve!=="key"});m=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",te[v+m]||(N=0<N.length?"{"+N.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,
|
|
7
|
-
`),r=[],
|
|
8
|
-
`),...
|
|
6
|
+
<%s key={someKey} {...props} />`,m,v,N,v),te[v+m]=!0)}if(v=null,b!==void 0&&(r(b),v=""+b),l(s)&&(r(s.key),v=""+s.key),"key"in s){b={};for(var G in s)G!=="key"&&(b[G]=s[G])}else b=s;return v&&c(b,typeof e=="function"?e.displayName||e.name||"Unknown":e),R(e,v,b,o(),M,q)}function f(e){d(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?d(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function d(e){return typeof e=="object"&&e!==null&&e.$$typeof===S}var E=_,S=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),k=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),i=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),be=Symbol.for("react.client.reference"),W=E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=Object.prototype.hasOwnProperty,me=Array.isArray,U=console.createTask?console.createTask:function(){return null};E={react_stack_bottom_frame:function(e){return e()}};var Z,Q={},K=E.react_stack_bottom_frame.bind(E,a)(),ee=U(u(a)),te={};I.Fragment=h,I.jsx=function(e,s,b){var m=1e4>W.recentlyCreatedOwnerStacks++;return g(e,s,b,!1,m?Error("react-stack-top-frame"):K,m?U(u(e)):ee)},I.jsxs=function(e,s,b){var m=1e4>W.recentlyCreatedOwnerStacks++;return g(e,s,b,!0,m?Error("react-stack-top-frame"):K,m?U(u(e)):ee)}})()),I}var oe;function pe(){return oe||(oe=1,process.env.NODE_ENV==="production"?Y.exports=Ee():Y.exports=Se()),Y.exports}var he=pe();function L(t,n,r){if(!n)return t;const u=n.split(".");let o=t;for(const a of u)if(o!==null&&typeof o=="object"&&a in o)o=o[a];else return r;return o===void 0?r:o}function _e(t,n,r){const u=n.replace(/\[(\d+)\]/g,".$1").split(".");let o=t;for(let a=0;a<u.length-1;a++){const l=u[a],c=u[a+1];(o[l]===void 0||o[l]===null)&&(o[l]=/^\d+$/.test(c)?[]:{}),o=o[l]}return o[u[u.length-1]]=r,t}function ye(t,n=0){let r;return function(...u){r!==void 0&&clearTimeout(r),r=setTimeout(()=>{r=void 0,t.apply(this,u)},n)}}function Re(t,n,r=[]){return _.useMemo(()=>ye(t,n),r)}function se(t){const n=JSON.stringify(t,null,2).split(`
|
|
7
|
+
`),r=[],u=[];for(const o of n){const a=o.match(/^(\s*)"([^"]+)"(\s*:\s*)(.+)$/);if(a){const[,l,c,y,R]=a;r.push(`${l}%c"${c}"%c${y}%c${R}`),u.push("color: #9cdcfe; font-weight: bold","color: #cccccc","color: #ce9178")}else r.push(`%c${o}`),u.push("color: #cccccc")}console.log(r.join(`
|
|
8
|
+
`),...u,t)}const ue=t=>typeof t=="function",Te=t=>typeof t=="function",x=t=>typeof t<"u",$=t=>Te(t)?t():t;class ie{#e;#t;constructor(){this.uid=Math.random().toString(36).slice(2),this.#e={},this.#t=new Set}subscribe(n){return this.#t.add(n),()=>this.#t.delete(n)}getClientSnapshot(){return this.#e}getServerSnapshot(){return this.#e}get(n){return L(this.#e,n)}set(n,r){const u=L(this.#e,n),o=ue(r)?r(u):r,a={...this.#e};_e(a,n,o),this.#e=a,this.#t.forEach(l=>l())}}const le=_.createContext({});function ae(t={}){const n=_.useContext(le);return t.verbose&&console.log(`[Store uid]: ${n.uid}`),n}function ge({children:t}){const n=_.useMemo(()=>new ie,[]);return he.jsx(le.Provider,{value:n,children:t})}const fe=Symbol("state-def"),z=Symbol("state-path"),D=Symbol("state-verbose"),B=Symbol("state-verbose-path"),F=Symbol("state-ssr"),X=typeof window>"u",ce=X?_.useEffect:_.useLayoutEffect;function ke(t={}){return{[fe]:!0,[z]:"",[D]:!1,[B]:"",[F]:!1,useState(n){const r=X?void 0:$(t.storage),u=$(t.defaultValue),o=t.bidirectional;n??={};const a=$(n.defaultValue)??u,l=n.bidirectional??o,c=this[z],y=this[D],R=this[B],g=this[F],f=ae({verbose:y});if(!(f instanceof ie))throw new Error("Make sure your component is wrapped in VocabStateProvider");const d=t.serialize??JSON.stringify,E=t.deserialize??JSON.parse,S=(i,T,O)=>{const P=T.getItem(i);P===null?x(O)&&T.setItem(i,d(O)):f.set(i,E(P))},p=Re(n.onSet??(()=>{}),n.delayedSet,[]),h=_.useRef(void 0),j=_.useRef(!1);if(!j.current){j.current=!0;let i=f.get(c);x(i)||(i=a,x(i)&&f.set(c,i)),!g&&r&&S(c,r,i)}const A=_.useSyncExternalStore(f.subscribe.bind(f),f.getClientSnapshot.bind(f),f.getServerSnapshot.bind(f));if(y)if(R){const i=L(A,R);i&&se(i)}else se(A);const w=L(A,c,a);h.current=w,ce(()=>{!g||!r||S(c,r,w)},[]);const k=_.useEffectEvent(i=>{if(i.key!==c)return;const T=i.newValue,P=(T===null?null:E(T))??a;x(P)&&(f.set(c,P),p(P,h.current))});_.useEffect(()=>{if(l)return window.addEventListener("storage",k),()=>window.removeEventListener("storage",k)},[l]);const C=_.useCallback(i=>{const T=ue(i)?i(h.current):i;f.set(c,T),p(T,h.current),r&&r.setItem(c,d(T))},[f,c,p,r,d]),J=_.useCallback(()=>{const i=a;if(!x(i)){r?.removeItem(c);return}f.set(c,i),p(i,h.current),r&&r.setItem(c,d(i))},[a,f,c,p,r,d]);return[w,C,J]},useInitialState(n){const r=X?void 0:$(t.storage),u=$(n.defaultValue),o=this[z],a=this[D],l=this[F],c=ae({verbose:a}),y=t.serialize??JSON.stringify,R=t.deserialize??JSON.parse,g=(E,S,p)=>{const h=S.getItem(E);h===null?x(p)&&S.setItem(E,y(p)):c.set(E,R(h))},f=_.useRef(!1);let d;f.current||(f.current=!0,d=c.get(o),x(d)||(d=u,x(d)&&c.set(o,d)),!l&&r&&g(o,r,d)),ce(()=>{!l||!r||g(o,r,d)},[])},toString(){return this[z]}}}function de(t,n){const{path:r="",verbose:u,verbosePath:o,ssr:a,cache:l}=n;let c=l.proxy.get(t);c||(c=new Map,l.proxy.set(t,c));const y=c.get(r);if(y)return y;const R=new Proxy(t,{get(g,f){const d=g[f],E=r?`${r}.${String(f)}`:String(f);if(d&&typeof d=="object"&&fe in d){const S=d;let p=l.leaf.get(S);p||(p=new Map,l.leaf.set(S,p));const h=p.get(E);if(h)return h;const j=Reflect.ownKeys(S).filter(k=>typeof S[k]=="function"),A=Object.fromEntries(j.map(k=>[k,(...C)=>S[k].call({...S,[z]:E,[D]:u,[B]:o,[F]:a},...C)])),w={...S,...A};return p.set(E,w),w}return d&&typeof d=="object"?de(d,{...n,path:E}):d}});return c.set(r,R),R}function we(t,n){return de(t,{...n,verbosePath:n?.verbosePath??"",cache:{proxy:new WeakMap,leaf:new WeakMap}})}exports.VocabStateProvider=ge;exports.defineState=ke;exports.setupStorage=we;
|
package/dist/state-vocab.es.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
if (
|
|
6
|
-
|
|
1
|
+
import he, { useMemo as le, createContext as _e, useContext as ye, useRef as G, useEffect as ue, useLayoutEffect as Re, useSyncExternalStore as Te, useEffectEvent as ge, useCallback as re } from "react";
|
|
2
|
+
var Y = { exports: {} }, C = {};
|
|
3
|
+
var ne;
|
|
4
|
+
function ke() {
|
|
5
|
+
if (ne) return C;
|
|
6
|
+
ne = 1;
|
|
7
7
|
var t = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
8
|
-
function r(
|
|
9
|
-
var
|
|
10
|
-
if (a !== void 0 && (
|
|
8
|
+
function r(i, o, a) {
|
|
9
|
+
var u = null;
|
|
10
|
+
if (a !== void 0 && (u = "" + a), o.key !== void 0 && (u = "" + o.key), "key" in o) {
|
|
11
11
|
a = {};
|
|
12
|
-
for (var c in
|
|
13
|
-
c !== "key" && (a[c] =
|
|
14
|
-
} else a =
|
|
15
|
-
return
|
|
12
|
+
for (var c in o)
|
|
13
|
+
c !== "key" && (a[c] = o[c]);
|
|
14
|
+
} else a = o;
|
|
15
|
+
return o = a.ref, {
|
|
16
16
|
$$typeof: t,
|
|
17
|
-
type:
|
|
18
|
-
key:
|
|
19
|
-
ref:
|
|
17
|
+
type: i,
|
|
18
|
+
key: u,
|
|
19
|
+
ref: o !== void 0 ? o : null,
|
|
20
20
|
props: a
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
return C.Fragment = n, C.jsx = r, C.jsxs = r, C;
|
|
24
24
|
}
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
-
return
|
|
25
|
+
var V = {};
|
|
26
|
+
var oe;
|
|
27
|
+
function we() {
|
|
28
|
+
return oe || (oe = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
29
|
function t(e) {
|
|
30
30
|
if (e == null) return null;
|
|
31
31
|
if (typeof e == "function")
|
|
32
|
-
return e.$$typeof ===
|
|
32
|
+
return e.$$typeof === Ee ? null : e.displayName || e.name || null;
|
|
33
33
|
if (typeof e == "string") return e;
|
|
34
34
|
switch (e) {
|
|
35
35
|
case h:
|
|
36
36
|
return "Fragment";
|
|
37
|
-
case
|
|
37
|
+
case P:
|
|
38
38
|
return "Profiler";
|
|
39
|
-
case
|
|
39
|
+
case O:
|
|
40
40
|
return "StrictMode";
|
|
41
|
-
case
|
|
41
|
+
case L:
|
|
42
42
|
return "Suspense";
|
|
43
|
-
case
|
|
43
|
+
case l:
|
|
44
44
|
return "SuspenseList";
|
|
45
|
-
case
|
|
45
|
+
case w:
|
|
46
46
|
return "Activity";
|
|
47
47
|
}
|
|
48
48
|
if (typeof e == "object")
|
|
@@ -51,19 +51,19 @@ function ge() {
|
|
|
51
51
|
), e.$$typeof) {
|
|
52
52
|
case p:
|
|
53
53
|
return "Portal";
|
|
54
|
-
case T:
|
|
55
|
-
return e.displayName || "Context";
|
|
56
54
|
case g:
|
|
55
|
+
return e.displayName || "Context";
|
|
56
|
+
case k:
|
|
57
57
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
|
-
case
|
|
59
|
-
var
|
|
60
|
-
return e = e.displayName, e || (e =
|
|
61
|
-
case
|
|
62
|
-
return
|
|
63
|
-
case
|
|
64
|
-
|
|
58
|
+
case N:
|
|
59
|
+
var s = e.render;
|
|
60
|
+
return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
|
+
case R:
|
|
62
|
+
return s = e.displayName || null, s !== null ? s : t(e.type) || "Memo";
|
|
63
|
+
case A:
|
|
64
|
+
s = e._payload, e = e._init;
|
|
65
65
|
try {
|
|
66
|
-
return t(e(
|
|
66
|
+
return t(e(s));
|
|
67
67
|
} catch {
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -75,74 +75,74 @@ function ge() {
|
|
|
75
75
|
function r(e) {
|
|
76
76
|
try {
|
|
77
77
|
n(e);
|
|
78
|
-
var
|
|
78
|
+
var s = !1;
|
|
79
79
|
} catch {
|
|
80
|
-
|
|
80
|
+
s = !0;
|
|
81
81
|
}
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
var
|
|
85
|
-
return
|
|
86
|
-
|
|
82
|
+
if (s) {
|
|
83
|
+
s = console;
|
|
84
|
+
var m = s.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
85
|
+
return m.call(
|
|
86
|
+
s,
|
|
87
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
|
-
|
|
88
|
+
b
|
|
89
89
|
), n(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function i(e) {
|
|
93
93
|
if (e === h) return "<>";
|
|
94
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === A)
|
|
95
95
|
return "<...>";
|
|
96
96
|
try {
|
|
97
|
-
var
|
|
98
|
-
return
|
|
97
|
+
var s = t(e);
|
|
98
|
+
return s ? "<" + s + ">" : "<...>";
|
|
99
99
|
} catch {
|
|
100
100
|
return "<...>";
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
var e =
|
|
103
|
+
function o() {
|
|
104
|
+
var e = J.A;
|
|
105
105
|
return e === null ? null : e.getOwner();
|
|
106
106
|
}
|
|
107
107
|
function a() {
|
|
108
108
|
return Error("react-stack-top-frame");
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
112
|
-
var
|
|
113
|
-
if (
|
|
110
|
+
function u(e) {
|
|
111
|
+
if (H.call(e, "key")) {
|
|
112
|
+
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
|
+
if (s && s.isReactWarning) return !1;
|
|
114
114
|
}
|
|
115
115
|
return e.key !== void 0;
|
|
116
116
|
}
|
|
117
|
-
function c(e,
|
|
118
|
-
function
|
|
119
|
-
|
|
117
|
+
function c(e, s) {
|
|
118
|
+
function m() {
|
|
119
|
+
Z || (Z = !0, console.error(
|
|
120
120
|
"%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)",
|
|
121
|
-
|
|
121
|
+
s
|
|
122
122
|
));
|
|
123
123
|
}
|
|
124
|
-
|
|
125
|
-
get:
|
|
124
|
+
m.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
125
|
+
get: m,
|
|
126
126
|
configurable: !0
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function _() {
|
|
130
130
|
var e = t(this.type);
|
|
131
|
-
return
|
|
131
|
+
return Q[e] || (Q[e] = !0, console.error(
|
|
132
132
|
"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."
|
|
133
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
var
|
|
135
|
+
function y(e, s, m, b, z, U) {
|
|
136
|
+
var v = m.ref;
|
|
137
137
|
return e = {
|
|
138
|
-
$$typeof:
|
|
138
|
+
$$typeof: S,
|
|
139
139
|
type: e,
|
|
140
|
-
key:
|
|
141
|
-
props:
|
|
142
|
-
_owner:
|
|
143
|
-
}, (
|
|
140
|
+
key: s,
|
|
141
|
+
props: m,
|
|
142
|
+
_owner: b
|
|
143
|
+
}, (v !== void 0 ? v : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
144
|
enumerable: !1,
|
|
145
|
-
get:
|
|
145
|
+
get: _
|
|
146
146
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
147
147
|
configurable: !1,
|
|
148
148
|
enumerable: !1,
|
|
@@ -157,164 +157,164 @@ function ge() {
|
|
|
157
157
|
configurable: !1,
|
|
158
158
|
enumerable: !1,
|
|
159
159
|
writable: !0,
|
|
160
|
-
value:
|
|
160
|
+
value: z
|
|
161
161
|
}), Object.defineProperty(e, "_debugTask", {
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
165
|
+
value: U
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
169
|
-
var
|
|
170
|
-
if (
|
|
171
|
-
if (
|
|
172
|
-
if (
|
|
173
|
-
for (
|
|
174
|
-
|
|
175
|
-
Object.freeze && Object.freeze(
|
|
168
|
+
function T(e, s, m, b, z, U) {
|
|
169
|
+
var v = s.children;
|
|
170
|
+
if (v !== void 0)
|
|
171
|
+
if (b)
|
|
172
|
+
if (Se(v)) {
|
|
173
|
+
for (b = 0; b < v.length; b++)
|
|
174
|
+
f(v[b]);
|
|
175
|
+
Object.freeze && Object.freeze(v);
|
|
176
176
|
} else
|
|
177
177
|
console.error(
|
|
178
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
179
|
);
|
|
180
|
-
else
|
|
181
|
-
if (
|
|
182
|
-
|
|
183
|
-
var
|
|
184
|
-
return
|
|
180
|
+
else f(v);
|
|
181
|
+
if (H.call(s, "key")) {
|
|
182
|
+
v = t(e);
|
|
183
|
+
var j = Object.keys(s).filter(function(pe) {
|
|
184
|
+
return pe !== "key";
|
|
185
185
|
});
|
|
186
|
-
|
|
186
|
+
b = 0 < j.length ? "{key: someKey, " + j.join(": ..., ") + ": ...}" : "{key: someKey}", te[v + b] || (j = 0 < j.length ? "{" + j.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
188
188
|
let props = %s;
|
|
189
189
|
<%s {...props} />
|
|
190
190
|
React keys must be passed directly to JSX without using spread:
|
|
191
191
|
let props = %s;
|
|
192
192
|
<%s key={someKey} {...props} />`,
|
|
193
|
-
m,
|
|
194
193
|
b,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
194
|
+
v,
|
|
195
|
+
j,
|
|
196
|
+
v
|
|
197
|
+
), te[v + b] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (
|
|
200
|
-
|
|
201
|
-
for (var
|
|
202
|
-
|
|
203
|
-
} else
|
|
204
|
-
return
|
|
205
|
-
|
|
199
|
+
if (v = null, m !== void 0 && (r(m), v = "" + m), u(s) && (r(s.key), v = "" + s.key), "key" in s) {
|
|
200
|
+
m = {};
|
|
201
|
+
for (var q in s)
|
|
202
|
+
q !== "key" && (m[q] = s[q]);
|
|
203
|
+
} else m = s;
|
|
204
|
+
return v && c(
|
|
205
|
+
m,
|
|
206
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
|
-
),
|
|
207
|
+
), y(
|
|
208
208
|
e,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
v,
|
|
210
|
+
m,
|
|
211
|
+
o(),
|
|
212
|
+
z,
|
|
213
|
+
U
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
|
|
216
|
+
function f(e) {
|
|
217
|
+
d(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === A && (e._payload.status === "fulfilled" ? d(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
219
|
+
function d(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === S;
|
|
221
221
|
}
|
|
222
|
-
var
|
|
222
|
+
var E = he, S = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), g = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), L = Symbol.for("react.suspense"), l = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), w = Symbol.for("react.activity"), Ee = Symbol.for("react.client.reference"), J = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, H = Object.prototype.hasOwnProperty, Se = Array.isArray, W = console.createTask ? console.createTask : function() {
|
|
223
223
|
return null;
|
|
224
224
|
};
|
|
225
|
-
|
|
225
|
+
E = {
|
|
226
226
|
react_stack_bottom_frame: function(e) {
|
|
227
227
|
return e();
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
|
-
var
|
|
231
|
-
|
|
230
|
+
var Z, Q = {}, K = E.react_stack_bottom_frame.bind(
|
|
231
|
+
E,
|
|
232
232
|
a
|
|
233
|
-
)(),
|
|
234
|
-
|
|
235
|
-
var
|
|
236
|
-
return
|
|
233
|
+
)(), ee = W(i(a)), te = {};
|
|
234
|
+
V.Fragment = h, V.jsx = function(e, s, m) {
|
|
235
|
+
var b = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return T(
|
|
237
237
|
e,
|
|
238
|
-
|
|
239
|
-
|
|
238
|
+
s,
|
|
239
|
+
m,
|
|
240
240
|
!1,
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
b ? Error("react-stack-top-frame") : K,
|
|
242
|
+
b ? W(i(e)) : ee
|
|
243
243
|
);
|
|
244
|
-
},
|
|
245
|
-
var
|
|
246
|
-
return
|
|
244
|
+
}, V.jsxs = function(e, s, m) {
|
|
245
|
+
var b = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return T(
|
|
247
247
|
e,
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
s,
|
|
249
|
+
m,
|
|
250
250
|
!0,
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
b ? Error("react-stack-top-frame") : K,
|
|
252
|
+
b ? W(i(e)) : ee
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
|
-
})()),
|
|
255
|
+
})()), V;
|
|
256
256
|
}
|
|
257
|
-
var
|
|
258
|
-
function
|
|
259
|
-
return
|
|
257
|
+
var se;
|
|
258
|
+
function xe() {
|
|
259
|
+
return se || (se = 1, process.env.NODE_ENV === "production" ? Y.exports = ke() : Y.exports = we()), Y.exports;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
261
|
+
var Pe = xe();
|
|
262
|
+
function F(t, n, r) {
|
|
263
263
|
if (!n)
|
|
264
264
|
return t;
|
|
265
|
-
const
|
|
266
|
-
let
|
|
267
|
-
for (const a of
|
|
268
|
-
if (
|
|
269
|
-
|
|
265
|
+
const i = n.split(".");
|
|
266
|
+
let o = t;
|
|
267
|
+
for (const a of i)
|
|
268
|
+
if (o !== null && typeof o == "object" && a in o)
|
|
269
|
+
o = o[a];
|
|
270
270
|
else
|
|
271
271
|
return r;
|
|
272
|
-
return
|
|
272
|
+
return o === void 0 ? r : o;
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
const
|
|
276
|
-
let
|
|
277
|
-
for (let a = 0; a <
|
|
278
|
-
const
|
|
279
|
-
(
|
|
274
|
+
function Ae(t, n, r) {
|
|
275
|
+
const i = n.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
276
|
+
let o = t;
|
|
277
|
+
for (let a = 0; a < i.length - 1; a++) {
|
|
278
|
+
const u = i[a], c = i[a + 1];
|
|
279
|
+
(o[u] === void 0 || o[u] === null) && (o[u] = /^\d+$/.test(c) ? [] : {}), o = o[u];
|
|
280
280
|
}
|
|
281
|
-
return
|
|
281
|
+
return o[i[i.length - 1]] = r, t;
|
|
282
282
|
}
|
|
283
|
-
function
|
|
283
|
+
function Oe(t, n = 0) {
|
|
284
284
|
let r;
|
|
285
|
-
return function(...
|
|
285
|
+
return function(...i) {
|
|
286
286
|
r !== void 0 && clearTimeout(r), r = setTimeout(() => {
|
|
287
|
-
r = void 0, t.apply(this,
|
|
287
|
+
r = void 0, t.apply(this, i);
|
|
288
288
|
}, n);
|
|
289
289
|
};
|
|
290
290
|
}
|
|
291
|
-
function
|
|
292
|
-
return
|
|
293
|
-
() =>
|
|
291
|
+
function je(t, n, r = []) {
|
|
292
|
+
return le(
|
|
293
|
+
() => Oe(t, n),
|
|
294
294
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
295
295
|
r
|
|
296
296
|
);
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function ae(t) {
|
|
299
299
|
const n = JSON.stringify(t, null, 2).split(`
|
|
300
|
-
`), r = [],
|
|
301
|
-
for (const
|
|
302
|
-
const a =
|
|
300
|
+
`), r = [], i = [];
|
|
301
|
+
for (const o of n) {
|
|
302
|
+
const a = o.match(/^(\s*)"([^"]+)"(\s*:\s*)(.+)$/);
|
|
303
303
|
if (a) {
|
|
304
|
-
const [,
|
|
305
|
-
r.push(`${
|
|
304
|
+
const [, u, c, _, y] = a;
|
|
305
|
+
r.push(`${u}%c"${c}"%c${_}%c${y}`), i.push(
|
|
306
306
|
"color: #9cdcfe; font-weight: bold",
|
|
307
307
|
"color: #cccccc",
|
|
308
308
|
"color: #ce9178"
|
|
309
309
|
);
|
|
310
310
|
} else
|
|
311
|
-
r.push(`%c${
|
|
311
|
+
r.push(`%c${o}`), i.push("color: #cccccc");
|
|
312
312
|
}
|
|
313
313
|
console.log(r.join(`
|
|
314
|
-
`), ...
|
|
314
|
+
`), ...i, t);
|
|
315
315
|
}
|
|
316
|
-
const
|
|
317
|
-
class
|
|
316
|
+
const fe = (t) => typeof t == "function", Ne = (t) => typeof t == "function", x = (t) => typeof t < "u", I = (t) => Ne(t) ? t() : t;
|
|
317
|
+
class de {
|
|
318
318
|
#e;
|
|
319
319
|
#t;
|
|
320
320
|
constructor() {
|
|
@@ -330,152 +330,165 @@ class je {
|
|
|
330
330
|
return this.#e;
|
|
331
331
|
}
|
|
332
332
|
get(n) {
|
|
333
|
-
return
|
|
333
|
+
return F(this.#e, n);
|
|
334
334
|
}
|
|
335
335
|
set(n, r) {
|
|
336
|
-
const
|
|
337
|
-
|
|
336
|
+
const i = F(this.#e, n), o = fe(r) ? r(i) : r, a = { ...this.#e };
|
|
337
|
+
Ae(a, n, o), this.#e = a, this.#t.forEach((u) => u());
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
function
|
|
342
|
-
const n =
|
|
343
|
-
return t.verbose && console.log(`[
|
|
340
|
+
const me = _e({});
|
|
341
|
+
function ce(t = {}) {
|
|
342
|
+
const n = ye(me);
|
|
343
|
+
return t.verbose && console.log(`[Store uid]: ${n.uid}`), n;
|
|
344
344
|
}
|
|
345
345
|
function Ve({ children: t }) {
|
|
346
|
-
const n =
|
|
347
|
-
return /* @__PURE__ */
|
|
346
|
+
const n = le(() => new de(), []);
|
|
347
|
+
return /* @__PURE__ */ Pe.jsx(me.Provider, { value: n, children: t });
|
|
348
348
|
}
|
|
349
|
-
const
|
|
350
|
-
function
|
|
349
|
+
const be = Symbol("state-def"), $ = Symbol("state-path"), M = Symbol("state-verbose"), B = Symbol("state-verbose-path"), D = Symbol("state-ssr"), X = typeof window > "u", ie = X ? ue : Re;
|
|
350
|
+
function Ie(t = {}) {
|
|
351
351
|
return {
|
|
352
|
-
[
|
|
352
|
+
[be]: !0,
|
|
353
353
|
// marks this object as a leaf in the router tree
|
|
354
|
-
[
|
|
354
|
+
[$]: "",
|
|
355
355
|
// placeholder; injected at runtime by injectPaths()
|
|
356
|
-
[
|
|
356
|
+
[M]: !1,
|
|
357
357
|
// placeholder
|
|
358
|
-
[
|
|
358
|
+
[B]: "",
|
|
359
359
|
// placeholder
|
|
360
|
-
[
|
|
360
|
+
[D]: !1,
|
|
361
361
|
// placeholder
|
|
362
362
|
useState(n) {
|
|
363
|
-
const r =
|
|
363
|
+
const r = X ? void 0 : I(t.storage), i = I(t.defaultValue), o = t.bidirectional;
|
|
364
364
|
n ??= {};
|
|
365
|
-
const a =
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
365
|
+
const a = I(n.defaultValue) ?? i, u = n.bidirectional ?? o, c = this[$], _ = this[M], y = this[B], T = this[D], f = ce({ verbose: _ });
|
|
366
|
+
if (!(f instanceof de))
|
|
367
|
+
throw new Error("Make sure your component is wrapped in VocabStateProvider");
|
|
368
|
+
const d = t.serialize ?? JSON.stringify, E = t.deserialize ?? JSON.parse, S = (l, R, A) => {
|
|
369
|
+
const w = R.getItem(l);
|
|
370
|
+
w === null ? x(A) && R.setItem(l, d(A)) : f.set(l, E(w));
|
|
371
|
+
}, p = je(
|
|
369
372
|
n.onSet ?? (() => {
|
|
370
373
|
}),
|
|
371
374
|
n.delayedSet,
|
|
372
375
|
[]
|
|
373
|
-
), h =
|
|
374
|
-
if (!
|
|
375
|
-
|
|
376
|
-
let
|
|
377
|
-
|
|
376
|
+
), h = G(void 0), O = G(!1);
|
|
377
|
+
if (!O.current) {
|
|
378
|
+
O.current = !0;
|
|
379
|
+
let l = f.get(c);
|
|
380
|
+
x(l) || (l = a, x(l) && f.set(c, l)), !T && r && S(c, r, l);
|
|
378
381
|
}
|
|
379
|
-
const
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
382
|
+
const P = Te(
|
|
383
|
+
f.subscribe.bind(f),
|
|
384
|
+
f.getClientSnapshot.bind(f),
|
|
385
|
+
f.getServerSnapshot.bind(f)
|
|
383
386
|
);
|
|
384
|
-
if (
|
|
385
|
-
if (
|
|
386
|
-
const
|
|
387
|
-
|
|
387
|
+
if (_)
|
|
388
|
+
if (y) {
|
|
389
|
+
const l = F(P, y);
|
|
390
|
+
l && ae(l);
|
|
388
391
|
} else
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
h.current =
|
|
392
|
-
!
|
|
392
|
+
ae(P);
|
|
393
|
+
const k = F(P, c, a);
|
|
394
|
+
h.current = k, ie(() => {
|
|
395
|
+
!T || !r || S(c, r, k);
|
|
393
396
|
}, []);
|
|
394
|
-
const
|
|
395
|
-
if (
|
|
397
|
+
const g = ge((l) => {
|
|
398
|
+
if (l.key !== c)
|
|
396
399
|
return;
|
|
397
|
-
const
|
|
398
|
-
|
|
400
|
+
const R = l.newValue, w = (R === null ? null : E(R)) ?? a;
|
|
401
|
+
x(w) && (f.set(c, w), p(w, h.current));
|
|
399
402
|
});
|
|
400
|
-
|
|
401
|
-
if (
|
|
402
|
-
return window.addEventListener("storage",
|
|
403
|
-
}, [
|
|
404
|
-
const
|
|
405
|
-
const
|
|
406
|
-
|
|
407
|
-
}, [c, r,
|
|
408
|
-
const
|
|
409
|
-
if (!
|
|
403
|
+
ue(() => {
|
|
404
|
+
if (u)
|
|
405
|
+
return window.addEventListener("storage", g), () => window.removeEventListener("storage", g);
|
|
406
|
+
}, [u]);
|
|
407
|
+
const N = re((l) => {
|
|
408
|
+
const R = fe(l) ? l(h.current) : l;
|
|
409
|
+
f.set(c, R), p(R, h.current), r && r.setItem(c, d(R));
|
|
410
|
+
}, [f, c, p, r, d]), L = re(() => {
|
|
411
|
+
const l = a;
|
|
412
|
+
if (!x(l)) {
|
|
410
413
|
r?.removeItem(c);
|
|
411
414
|
return;
|
|
412
415
|
}
|
|
413
|
-
|
|
414
|
-
}, [c,
|
|
416
|
+
f.set(c, l), p(l, h.current), r && r.setItem(c, d(l));
|
|
417
|
+
}, [a, f, c, p, r, d]);
|
|
415
418
|
return [
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
+
k,
|
|
420
|
+
N,
|
|
421
|
+
L
|
|
419
422
|
];
|
|
420
423
|
},
|
|
424
|
+
useInitialState(n) {
|
|
425
|
+
const r = X ? void 0 : I(t.storage), i = I(n.defaultValue), o = this[$], a = this[M], u = this[D], c = ce({ verbose: a }), _ = t.serialize ?? JSON.stringify, y = t.deserialize ?? JSON.parse, T = (E, S, p) => {
|
|
426
|
+
const h = S.getItem(E);
|
|
427
|
+
h === null ? x(p) && S.setItem(E, _(p)) : c.set(E, y(h));
|
|
428
|
+
}, f = G(!1);
|
|
429
|
+
let d;
|
|
430
|
+
f.current || (f.current = !0, d = c.get(o), x(d) || (d = i, x(d) && c.set(o, d)), !u && r && T(o, r, d)), ie(() => {
|
|
431
|
+
!u || !r || T(o, r, d);
|
|
432
|
+
}, []);
|
|
433
|
+
},
|
|
421
434
|
/** Returns the fully qualified job name (dot-separated path). */
|
|
422
435
|
toString() {
|
|
423
|
-
return this[
|
|
436
|
+
return this[$];
|
|
424
437
|
}
|
|
425
438
|
};
|
|
426
439
|
}
|
|
427
|
-
function
|
|
440
|
+
function ve(t, n) {
|
|
428
441
|
const {
|
|
429
442
|
path: r = "",
|
|
430
|
-
verbose:
|
|
431
|
-
verbosePath:
|
|
443
|
+
verbose: i,
|
|
444
|
+
verbosePath: o,
|
|
432
445
|
ssr: a,
|
|
433
|
-
cache:
|
|
446
|
+
cache: u
|
|
434
447
|
} = n;
|
|
435
|
-
let c =
|
|
436
|
-
c || (c = /* @__PURE__ */ new Map(),
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
return
|
|
440
|
-
const
|
|
441
|
-
get(
|
|
442
|
-
const
|
|
443
|
-
if (
|
|
444
|
-
const
|
|
445
|
-
let p =
|
|
446
|
-
p || (p = /* @__PURE__ */ new Map(),
|
|
447
|
-
const h = p.get(
|
|
448
|
+
let c = u.proxy.get(t);
|
|
449
|
+
c || (c = /* @__PURE__ */ new Map(), u.proxy.set(t, c));
|
|
450
|
+
const _ = c.get(r);
|
|
451
|
+
if (_)
|
|
452
|
+
return _;
|
|
453
|
+
const y = new Proxy(t, {
|
|
454
|
+
get(T, f) {
|
|
455
|
+
const d = T[f], E = r ? `${r}.${String(f)}` : String(f);
|
|
456
|
+
if (d && typeof d == "object" && be in d) {
|
|
457
|
+
const S = d;
|
|
458
|
+
let p = u.leaf.get(S);
|
|
459
|
+
p || (p = /* @__PURE__ */ new Map(), u.leaf.set(S, p));
|
|
460
|
+
const h = p.get(E);
|
|
448
461
|
if (h)
|
|
449
462
|
return h;
|
|
450
|
-
const
|
|
451
|
-
(
|
|
452
|
-
),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
(...
|
|
463
|
+
const O = Reflect.ownKeys(S).filter(
|
|
464
|
+
(g) => typeof S[g] == "function"
|
|
465
|
+
), P = Object.fromEntries(
|
|
466
|
+
O.map((g) => [
|
|
467
|
+
g,
|
|
468
|
+
(...N) => S[g].call(
|
|
456
469
|
{
|
|
457
|
-
...
|
|
458
|
-
[
|
|
459
|
-
[
|
|
460
|
-
[
|
|
461
|
-
[
|
|
470
|
+
...S,
|
|
471
|
+
[$]: E,
|
|
472
|
+
[M]: i,
|
|
473
|
+
[B]: o,
|
|
474
|
+
[D]: a
|
|
462
475
|
},
|
|
463
|
-
...
|
|
476
|
+
...N
|
|
464
477
|
)
|
|
465
478
|
])
|
|
466
|
-
),
|
|
467
|
-
return p.set(
|
|
479
|
+
), k = { ...S, ...P };
|
|
480
|
+
return p.set(E, k), k;
|
|
468
481
|
}
|
|
469
|
-
return
|
|
482
|
+
return d && typeof d == "object" ? ve(d, {
|
|
470
483
|
...n,
|
|
471
|
-
path:
|
|
472
|
-
}) :
|
|
484
|
+
path: E
|
|
485
|
+
}) : d;
|
|
473
486
|
}
|
|
474
487
|
});
|
|
475
|
-
return c.set(r,
|
|
488
|
+
return c.set(r, y), y;
|
|
476
489
|
}
|
|
477
|
-
function
|
|
478
|
-
return
|
|
490
|
+
function $e(t, n) {
|
|
491
|
+
return ve(t, {
|
|
479
492
|
...n,
|
|
480
493
|
verbosePath: n?.verbosePath ?? "",
|
|
481
494
|
cache: {
|
|
@@ -486,6 +499,6 @@ function Ie(t, n) {
|
|
|
486
499
|
}
|
|
487
500
|
export {
|
|
488
501
|
Ve as VocabStateProvider,
|
|
489
|
-
|
|
490
|
-
|
|
502
|
+
Ie as defineState,
|
|
503
|
+
$e as setupStorage
|
|
491
504
|
};
|
package/dist/types/context.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { type PropsWithChildren } from "react";
|
|
2
2
|
import VocabStore from "./store";
|
|
3
|
+
/**
|
|
4
|
+
* @see method from from https://zustand.docs.pmnd.rs/learn/guides/nextjs
|
|
5
|
+
*/
|
|
3
6
|
export declare function useVocabStoreContext(options?: {
|
|
4
7
|
verbose?: boolean;
|
|
5
8
|
}): VocabStore;
|
package/dist/types/state.d.ts
CHANGED
|
@@ -23,6 +23,13 @@ export declare function defineState<D>(definitionOptions?: {
|
|
|
23
23
|
bidirectional?: true;
|
|
24
24
|
onSet?(nextValue: NoInfer<D>, prevValue: NoInfer<D>): void;
|
|
25
25
|
}): readonly [D, (nextValue: ValueOrTransformer<D>) => void, () => void];
|
|
26
|
+
useInitialState(this: {
|
|
27
|
+
[STATE_PATH]: string;
|
|
28
|
+
[STATE_VERBOSE]: boolean;
|
|
29
|
+
[STATE_SSR]: boolean;
|
|
30
|
+
}, options: {
|
|
31
|
+
defaultValue: ValueOrFactory<D>;
|
|
32
|
+
}): void;
|
|
26
33
|
/** Returns the fully qualified job name (dot-separated path). */
|
|
27
34
|
toString(this: {
|
|
28
35
|
[STATE_PATH]: string;
|