reaxify 0.0.84 → 0.0.85

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.
Files changed (44) hide show
  1. package/dist/components/Drawer/index.cjs.js +1 -1
  2. package/dist/components/Drawer/index.d.ts +2 -4
  3. package/dist/components/Drawer/index.es.js +16 -21
  4. package/dist/components/Menu/index.cjs.js +1 -1
  5. package/dist/components/Menu/index.d.ts +3 -3
  6. package/dist/components/Menu/index.es.js +71 -77
  7. package/dist/components/Modal/index.cjs.js +1 -1
  8. package/dist/components/Modal/index.d.ts +2 -4
  9. package/dist/components/Modal/index.es.js +36 -41
  10. package/dist/helpers/scrollIntoView.cjs.js +1 -1
  11. package/dist/helpers/scrollIntoView.d.ts +1 -1
  12. package/dist/helpers/scrollIntoView.es.js +4 -3
  13. package/dist/hooks/index.cjs.js +1 -1
  14. package/dist/hooks/index.d.ts +0 -1
  15. package/dist/hooks/index.es.js +6 -8
  16. package/dist/node_modules/@tanstack/hotkeys/dist/constants.cjs.js +1 -0
  17. package/dist/node_modules/@tanstack/hotkeys/dist/constants.es.js +206 -0
  18. package/dist/node_modules/@tanstack/hotkeys/dist/format.cjs.js +1 -0
  19. package/dist/node_modules/@tanstack/hotkeys/dist/format.es.js +10 -0
  20. package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.cjs.js +1 -0
  21. package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.es.js +276 -0
  22. package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.cjs.js +1 -0
  23. package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.es.js +48 -0
  24. package/dist/node_modules/@tanstack/hotkeys/dist/match.cjs.js +1 -0
  25. package/dist/node_modules/@tanstack/hotkeys/dist/match.es.js +27 -0
  26. package/dist/node_modules/@tanstack/hotkeys/dist/parse.cjs.js +1 -0
  27. package/dist/node_modules/@tanstack/hotkeys/dist/parse.es.js +72 -0
  28. package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.cjs.js +1 -0
  29. package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.es.js +10 -0
  30. package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js +1 -0
  31. package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js +35 -0
  32. package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.cjs.js +1 -0
  33. package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.es.js +7 -0
  34. package/dist/node_modules/@tanstack/store/dist/esm/alien.cjs.js +1 -0
  35. package/dist/node_modules/@tanstack/store/dist/esm/alien.es.js +129 -0
  36. package/dist/node_modules/@tanstack/store/dist/esm/atom.cjs.js +1 -0
  37. package/dist/node_modules/@tanstack/store/dist/esm/atom.es.js +124 -0
  38. package/dist/node_modules/@tanstack/store/dist/esm/store.cjs.js +1 -0
  39. package/dist/node_modules/@tanstack/store/dist/esm/store.es.js +24 -0
  40. package/dist/types/index.d.ts +2 -2
  41. package/package.json +4 -3
  42. package/dist/hooks/useKeyDown.cjs.js +0 -1
  43. package/dist/hooks/useKeyDown.d.ts +0 -6
  44. package/dist/hooks/useKeyDown.es.js +0 -17
@@ -0,0 +1,72 @@
1
+ "use client";
2
+ import { detectPlatform as a, normalizeKeyName as f, MODIFIER_ALIASES as u, resolveModifier as h, MODIFIER_ORDER as c } from "./constants.es.js";
3
+ function d(t, r = a()) {
4
+ const o = t.split("+"), e = /* @__PURE__ */ new Set();
5
+ let i = "";
6
+ for (let s = 0; s < o.length; s++) {
7
+ const n = o[s].trim();
8
+ if (s === o.length - 1) i = f(n);
9
+ else {
10
+ const l = u[n] ?? u[n.toLowerCase()];
11
+ if (l) {
12
+ const m = h(l, r);
13
+ e.add(m);
14
+ } else o.length === 1 && (i = f(n));
15
+ }
16
+ }
17
+ return !i && o.length > 0 && (i = f(o[o.length - 1].trim())), {
18
+ key: i,
19
+ ctrl: e.has("Control"),
20
+ shift: e.has("Shift"),
21
+ alt: e.has("Alt"),
22
+ meta: e.has("Meta"),
23
+ modifiers: c.filter((s) => e.has(s))
24
+ };
25
+ }
26
+ function g(t, r = a()) {
27
+ let o = t.ctrl ?? !1;
28
+ const e = t.shift ?? !1, i = t.alt ?? !1;
29
+ let s = t.meta ?? !1;
30
+ t.mod && (h("Mod", r) === "Control" ? o = !0 : s = !0);
31
+ const n = c.filter((l) => {
32
+ switch (l) {
33
+ case "Control":
34
+ return o;
35
+ case "Shift":
36
+ return e;
37
+ case "Alt":
38
+ return i;
39
+ case "Meta":
40
+ return s;
41
+ default:
42
+ return !1;
43
+ }
44
+ });
45
+ return {
46
+ key: t.key,
47
+ ctrl: o,
48
+ shift: e,
49
+ alt: i,
50
+ meta: s,
51
+ modifiers: n
52
+ };
53
+ }
54
+ function y(t, r) {
55
+ const o = r === "mac" ? t.meta && !t.ctrl : t.ctrl && !t.meta, e = [];
56
+ if (o)
57
+ e.push("Mod"), t.alt && e.push("Alt"), t.shift && e.push("Shift");
58
+ else for (const i of c) t.modifiers.includes(i) && e.push(i);
59
+ return e.push(f(t.key)), e.join("+");
60
+ }
61
+ function k(t, r = a()) {
62
+ return y(d(t, r), r);
63
+ }
64
+ function S(t, r = a()) {
65
+ return k(t, r);
66
+ }
67
+ export {
68
+ k as normalizeHotkey,
69
+ S as normalizeRegisterableHotkey,
70
+ d as parseHotkey,
71
+ g as rawHotkeyToParsedHotkey
72
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),o=e.createContext(null);function n(){var t;return((t=e.useContext(o))==null?void 0:t.defaultOptions)??{}}exports.useDefaultHotkeysOptions=n;
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { useContext as e, createContext as o } from "react";
3
+ const n = o(null);
4
+ function u() {
5
+ var t;
6
+ return ((t = e(n)) == null ? void 0 : t.defaultOptions) ?? {};
7
+ }
8
+ export {
9
+ u as useDefaultHotkeysOptions
10
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const H=require("./HotkeysProvider.cjs.js"),q=require("./utils.cjs.js"),A=require("../../hotkeys/dist/constants.cjs.js"),O=require("../../hotkeys/dist/parse.cjs.js"),T=require("../../hotkeys/dist/hotkey-manager.cjs.js"),t=require("react");function b(k,i,p={}){var g;const n={...H.useDefaultHotkeysOptions().hotkey,...p},l=T.getHotkeyManager(),e=t.useRef(null),a=t.useRef(i),r=t.useRef(n),f=t.useRef(l);a.current=i,r.current=n,f.current=l;const u=t.useRef(null),c=t.useRef(null),s=O.normalizeRegisterableHotkey(k,n.platform??A.detectPlatform()),{target:M,...v}=n;t.useEffect(()=>{var R,y;const o=q.isRef(r.current.target)?r.current.target.current:r.current.target??(typeof document<"u"?document:null);if(!o){(R=e.current)!=null&&R.isActive&&(e.current.unregister(),e.current=null),u.current=null,c.current=null;return}const m=u.current!==null&&u.current!==o,h=c.current!==null&&c.current!==s;return(y=e.current)!=null&&y.isActive&&(m||h)&&(e.current.unregister(),e.current=null),(!e.current||!e.current.isActive)&&(e.current=f.current.register(s,a.current,{...r.current,target:o})),u.current=o,c.current=s,()=>{var d;(d=e.current)!=null&&d.isActive&&(e.current.unregister(),e.current=null)}},[s]),(g=e.current)!=null&&g.isActive&&(e.current.callback=i,e.current.setOptions(v))}exports.useHotkey=b;
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { useDefaultHotkeysOptions as A } from "./HotkeysProvider.es.js";
3
+ import { isRef as H } from "./utils.es.js";
4
+ import { detectPlatform as O } from "../../hotkeys/dist/constants.es.js";
5
+ import { normalizeRegisterableHotkey as T } from "../../hotkeys/dist/parse.es.js";
6
+ import { getHotkeyManager as C } from "../../hotkeys/dist/hotkey-manager.es.js";
7
+ import { useRef as t, useEffect as b } from "react";
8
+ function W(y, s, R = {}) {
9
+ var g;
10
+ const n = {
11
+ ...A().hotkey,
12
+ ...R
13
+ }, l = C(), r = t(null), f = t(s), e = t(n), a = t(l);
14
+ f.current = s, e.current = n, a.current = l;
15
+ const u = t(null), c = t(null), o = T(y, n.platform ?? O()), { target: x, ...k } = n;
16
+ b(() => {
17
+ var m, p;
18
+ const i = H(e.current.target) ? e.current.target.current : e.current.target ?? (typeof document < "u" ? document : null);
19
+ if (!i) {
20
+ (m = r.current) != null && m.isActive && (r.current.unregister(), r.current = null), u.current = null, c.current = null;
21
+ return;
22
+ }
23
+ const v = u.current !== null && u.current !== i, h = c.current !== null && c.current !== o;
24
+ return (p = r.current) != null && p.isActive && (v || h) && (r.current.unregister(), r.current = null), (!r.current || !r.current.isActive) && (r.current = a.current.register(o, f.current, {
25
+ ...e.current,
26
+ target: i
27
+ })), u.current = i, c.current = o, () => {
28
+ var d;
29
+ (d = r.current) != null && d.isActive && (r.current.unregister(), r.current = null);
30
+ };
31
+ }, [o]), (g = r.current) != null && g.isActive && (r.current.callback = s, r.current.setOptions(k));
32
+ }
33
+ export {
34
+ W as useHotkey
35
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function t(e){return e!==null&&typeof e=="object"&&"current"in e}exports.isRef=t;
@@ -0,0 +1,7 @@
1
+ "use client";
2
+ function t(n) {
3
+ return n !== null && typeof n == "object" && "current" in n;
4
+ }
5
+ export {
6
+ t as isRef
7
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var b=(u=>(u[u.None=0]="None",u[u.Mutable=1]="Mutable",u[u.Watching=2]="Watching",u[u.RecursedCheck=4]="RecursedCheck",u[u.Recursed=8]="Recursed",u[u.Dirty=16]="Dirty",u[u.Pending=32]="Pending",u))(b||{});function T({update:u,notify:p,unwatched:l}){return{link:S,unlink:x,propagate:a,checkDirty:D,shallowPropagate:d};function S(e,s,i){const n=s.depsTail;if(n!==void 0&&n.dep===e)return;const t=n!==void 0?n.nextDep:s.deps;if(t!==void 0&&t.dep===e){t.version=i,s.depsTail=t;return}const o=e.subsTail;if(o!==void 0&&o.version===i&&o.sub===s)return;const f=s.depsTail=e.subsTail={version:i,dep:e,sub:s,prevDep:n,nextDep:t,prevSub:o,nextSub:void 0};t!==void 0&&(t.prevDep=f),n!==void 0?n.nextDep=f:s.deps=f,o!==void 0?o.nextSub=f:e.subs=f}function x(e,s=e.sub){const i=e.dep,n=e.prevDep,t=e.nextDep,o=e.nextSub,f=e.prevSub;return t!==void 0?t.prevDep=n:s.depsTail=n,n!==void 0?n.nextDep=t:s.deps=t,o!==void 0?o.prevSub=f:i.subsTail=f,f!==void 0?f.nextSub=o:(i.subs=o)===void 0&&l(i),t}function a(e){let s=e.nextSub,i;e:do{const n=e.sub;let t=n.flags;if(t&60?t&12?t&4?!(t&48)&&h(e,n)?(n.flags=t|40,t&=1):t=0:n.flags=t&-9|32:t=0:n.flags=t|32,t&2&&p(n),t&1){const o=n.subs;if(o!==void 0){const f=(e=o).nextSub;f!==void 0&&(i={value:s,prev:i},s=f);continue}}if((e=s)!==void 0){s=e.nextSub;continue}for(;i!==void 0;)if(e=i.value,i=i.prev,e!==void 0){s=e.nextSub;continue e}break}while(!0)}function D(e,s){let i,n=0,t=!1;e:do{const o=e.dep,f=o.flags;if(s.flags&16)t=!0;else if((f&17)===17){if(u(o)){const r=o.subs;r.nextSub!==void 0&&d(r),t=!0}}else if((f&33)===33){(e.nextSub!==void 0||e.prevSub!==void 0)&&(i={value:e,prev:i}),e=o.deps,s=o,++n;continue}if(!t){const r=e.nextDep;if(r!==void 0){e=r;continue}}for(;n--;){const r=s.subs,c=r.nextSub!==void 0;if(c?(e=i.value,i=i.prev):e=r,t){if(u(s)){c&&d(r),s=e.sub;continue}t=!1}else s.flags&=-33;s=e.sub;const v=e.nextDep;if(v!==void 0){e=v;continue e}}return t}while(!0)}function d(e){do{const s=e.sub,i=s.flags;(i&48)===32&&(s.flags=i|16,(i&6)===2&&p(s))}while((e=e.nextSub)!==void 0)}function h(e,s){let i=s.depsTail;for(;i!==void 0;){if(i===e)return!0;i=i.prevDep}return!1}}exports.ReactiveFlags=b;exports.createReactiveSystem=T;
@@ -0,0 +1,129 @@
1
+ "use client";
2
+ var h = /* @__PURE__ */ ((u) => (u[u.None = 0] = "None", u[u.Mutable = 1] = "Mutable", u[u.Watching = 2] = "Watching", u[u.RecursedCheck = 4] = "RecursedCheck", u[u.Recursed = 8] = "Recursed", u[u.Dirty = 16] = "Dirty", u[u.Pending = 32] = "Pending", u))(h || {});
3
+ // @__NO_SIDE_EFFECTS__
4
+ function w({
5
+ update: u,
6
+ notify: p,
7
+ unwatched: b
8
+ }) {
9
+ return {
10
+ link: x,
11
+ unlink: l,
12
+ propagate: S,
13
+ checkDirty: D,
14
+ shallowPropagate: d
15
+ };
16
+ function x(e, s, n) {
17
+ const i = s.depsTail;
18
+ if (i !== void 0 && i.dep === e)
19
+ return;
20
+ const t = i !== void 0 ? i.nextDep : s.deps;
21
+ if (t !== void 0 && t.dep === e) {
22
+ t.version = n, s.depsTail = t;
23
+ return;
24
+ }
25
+ const o = e.subsTail;
26
+ if (o !== void 0 && o.version === n && o.sub === s)
27
+ return;
28
+ const f = s.depsTail = e.subsTail = {
29
+ version: n,
30
+ dep: e,
31
+ sub: s,
32
+ prevDep: i,
33
+ nextDep: t,
34
+ prevSub: o,
35
+ nextSub: void 0
36
+ };
37
+ t !== void 0 && (t.prevDep = f), i !== void 0 ? i.nextDep = f : s.deps = f, o !== void 0 ? o.nextSub = f : e.subs = f;
38
+ }
39
+ function l(e, s = e.sub) {
40
+ const n = e.dep, i = e.prevDep, t = e.nextDep, o = e.nextSub, f = e.prevSub;
41
+ return t !== void 0 ? t.prevDep = i : s.depsTail = i, i !== void 0 ? i.nextDep = t : s.deps = t, o !== void 0 ? o.prevSub = f : n.subsTail = f, f !== void 0 ? f.nextSub = o : (n.subs = o) === void 0 && b(n), t;
42
+ }
43
+ function S(e) {
44
+ let s = e.nextSub, n;
45
+ e: do {
46
+ const i = e.sub;
47
+ let t = i.flags;
48
+ if (t & 60 ? t & 12 ? t & 4 ? !(t & 48) && a(e, i) ? (i.flags = t | 40, t &= 1) : t = 0 : i.flags = t & -9 | 32 : t = 0 : i.flags = t | 32, t & 2 && p(i), t & 1) {
49
+ const o = i.subs;
50
+ if (o !== void 0) {
51
+ const f = (e = o).nextSub;
52
+ f !== void 0 && (n = { value: s, prev: n }, s = f);
53
+ continue;
54
+ }
55
+ }
56
+ if ((e = s) !== void 0) {
57
+ s = e.nextSub;
58
+ continue;
59
+ }
60
+ for (; n !== void 0; )
61
+ if (e = n.value, n = n.prev, e !== void 0) {
62
+ s = e.nextSub;
63
+ continue e;
64
+ }
65
+ break;
66
+ } while (!0);
67
+ }
68
+ function D(e, s) {
69
+ let n, i = 0, t = !1;
70
+ e: do {
71
+ const o = e.dep, f = o.flags;
72
+ if (s.flags & 16)
73
+ t = !0;
74
+ else if ((f & 17) === 17) {
75
+ if (u(o)) {
76
+ const r = o.subs;
77
+ r.nextSub !== void 0 && d(r), t = !0;
78
+ }
79
+ } else if ((f & 33) === 33) {
80
+ (e.nextSub !== void 0 || e.prevSub !== void 0) && (n = { value: e, prev: n }), e = o.deps, s = o, ++i;
81
+ continue;
82
+ }
83
+ if (!t) {
84
+ const r = e.nextDep;
85
+ if (r !== void 0) {
86
+ e = r;
87
+ continue;
88
+ }
89
+ }
90
+ for (; i--; ) {
91
+ const r = s.subs, c = r.nextSub !== void 0;
92
+ if (c ? (e = n.value, n = n.prev) : e = r, t) {
93
+ if (u(s)) {
94
+ c && d(r), s = e.sub;
95
+ continue;
96
+ }
97
+ t = !1;
98
+ } else
99
+ s.flags &= -33;
100
+ s = e.sub;
101
+ const v = e.nextDep;
102
+ if (v !== void 0) {
103
+ e = v;
104
+ continue e;
105
+ }
106
+ }
107
+ return t;
108
+ } while (!0);
109
+ }
110
+ function d(e) {
111
+ do {
112
+ const s = e.sub, n = s.flags;
113
+ (n & 48) === 32 && (s.flags = n | 16, (n & 6) === 2 && p(s));
114
+ } while ((e = e.nextSub) !== void 0);
115
+ }
116
+ function a(e, s) {
117
+ let n = s.depsTail;
118
+ for (; n !== void 0; ) {
119
+ if (n === e)
120
+ return !0;
121
+ n = n.prevDep;
122
+ }
123
+ return !1;
124
+ }
125
+ }
126
+ export {
127
+ h as ReactiveFlags,
128
+ w as createReactiveSystem
129
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./alien.cjs.js");function F(t,l,i){var a,c,r;const o=typeof t=="object",e=o?t:void 0;return{next:(a=o?t.next:t)==null?void 0:a.bind(e),error:(c=o?t.error:l)==null?void 0:c.bind(e),complete:(r=o?t.complete:i)==null?void 0:r.bind(e)}}const p=[];let v=0;const{link:R,unlink:_,propagate:k,checkDirty:y,shallowPropagate:b}=s.createReactiveSystem({update(t){return t._update()},notify(t){p[h++]=t,t.flags&=~s.ReactiveFlags.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=s.ReactiveFlags.Mutable|s.ReactiveFlags.Dirty,g(t))}});let d=0,h=0,n;function g(t){const l=t.depsTail;let i=l!==void 0?l.nextDep:t.deps;for(;i!==void 0;)i=_(i,t)}function T(){for(;d<h;){const t=p[d];p[d++]=void 0,t.notify()}d=0,h=0}function D(t,l){const i=typeof t=="function",o=t,e={_snapshot:i?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:i?s.ReactiveFlags.None:s.ReactiveFlags.Mutable,get(){return n!==void 0&&R(e,n,v),e._snapshot},subscribe(a){const c=F(a),r={current:!1},f=m(()=>{var u;e.get(),r.current?(u=c.next)==null||u.call(c,e._snapshot):r.current=!0});return{unsubscribe:()=>{f.stop()}}},_update(a){const c=n,r=Object.is;if(i)n=e,++v,e.depsTail=void 0;else if(a===void 0)return!1;i&&(e.flags=s.ReactiveFlags.Mutable|s.ReactiveFlags.RecursedCheck);try{const f=e._snapshot,u=typeof a=="function"?a(f):a===void 0&&i?o(f):a;return f===void 0||!r(f,u)?(e._snapshot=u,!0):!1}finally{n=c,i&&(e.flags&=~s.ReactiveFlags.RecursedCheck),g(e)}}};return i?(e.flags=s.ReactiveFlags.Mutable|s.ReactiveFlags.Dirty,e.get=function(){const a=e.flags;if(a&s.ReactiveFlags.Dirty||a&s.ReactiveFlags.Pending&&y(e.deps,e)){if(e._update()){const c=e.subs;c!==void 0&&b(c)}}else a&s.ReactiveFlags.Pending&&(e.flags=a&~s.ReactiveFlags.Pending);return n!==void 0&&R(e,n,v),e._snapshot}):e.set=function(a){if(e._update(a)){const c=e.subs;c!==void 0&&(k(c),b(c),T())}},e}function m(t){const l=()=>{const o=n;n=i,++v,i.depsTail=void 0,i.flags=s.ReactiveFlags.Watching|s.ReactiveFlags.RecursedCheck;try{return t()}finally{n=o,i.flags&=~s.ReactiveFlags.RecursedCheck,g(i)}},i={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:s.ReactiveFlags.Watching|s.ReactiveFlags.RecursedCheck,notify(){const o=this.flags;o&s.ReactiveFlags.Dirty||o&s.ReactiveFlags.Pending&&y(this.deps,this)?l():this.flags=s.ReactiveFlags.Watching},stop(){this.flags=s.ReactiveFlags.None,this.depsTail=void 0,g(this)}};return l(),i}exports.createAtom=D;exports.flush=T;exports.toObserver=F;
@@ -0,0 +1,124 @@
1
+ "use client";
2
+ import { ReactiveFlags as t, createReactiveSystem as _ } from "./alien.es.js";
3
+ function k(s, r, i) {
4
+ var o, n, d;
5
+ const c = typeof s == "object", e = c ? s : void 0;
6
+ return {
7
+ next: (o = c ? s.next : s) == null ? void 0 : o.bind(e),
8
+ error: (n = c ? s.error : r) == null ? void 0 : n.bind(e),
9
+ complete: (d = c ? s.complete : i) == null ? void 0 : d.bind(
10
+ e
11
+ )
12
+ };
13
+ }
14
+ const g = [];
15
+ let p = 0;
16
+ const { link: b, unlink: D, propagate: R, checkDirty: T, shallowPropagate: y } = _({
17
+ update(s) {
18
+ return s._update();
19
+ },
20
+ // eslint-disable-next-line no-shadow
21
+ notify(s) {
22
+ g[h++] = s, s.flags &= ~t.Watching;
23
+ },
24
+ unwatched(s) {
25
+ s.depsTail !== void 0 && (s.depsTail = void 0, s.flags = t.Mutable | t.Dirty, v(s));
26
+ }
27
+ });
28
+ let l = 0, h = 0, f;
29
+ function v(s) {
30
+ const r = s.depsTail;
31
+ let i = r !== void 0 ? r.nextDep : s.deps;
32
+ for (; i !== void 0; )
33
+ i = D(i, s);
34
+ }
35
+ function m() {
36
+ for (; l < h; ) {
37
+ const s = g[l];
38
+ g[l++] = void 0, s.notify();
39
+ }
40
+ l = 0, h = 0;
41
+ }
42
+ function P(s, r) {
43
+ const i = typeof s == "function", c = s, e = {
44
+ _snapshot: i ? void 0 : s,
45
+ subs: void 0,
46
+ subsTail: void 0,
47
+ deps: void 0,
48
+ depsTail: void 0,
49
+ flags: i ? t.None : t.Mutable,
50
+ get() {
51
+ return f !== void 0 && b(e, f, p), e._snapshot;
52
+ },
53
+ subscribe(o) {
54
+ const n = k(o), d = { current: !1 }, u = C(() => {
55
+ var a;
56
+ e.get(), d.current ? (a = n.next) == null || a.call(n, e._snapshot) : d.current = !0;
57
+ });
58
+ return {
59
+ unsubscribe: () => {
60
+ u.stop();
61
+ }
62
+ };
63
+ },
64
+ _update(o) {
65
+ const n = f, d = Object.is;
66
+ if (i)
67
+ f = e, ++p, e.depsTail = void 0;
68
+ else if (o === void 0)
69
+ return !1;
70
+ i && (e.flags = t.Mutable | t.RecursedCheck);
71
+ try {
72
+ const u = e._snapshot, a = typeof o == "function" ? o(u) : o === void 0 && i ? c(u) : o;
73
+ return u === void 0 || !d(u, a) ? (e._snapshot = a, !0) : !1;
74
+ } finally {
75
+ f = n, i && (e.flags &= ~t.RecursedCheck), v(e);
76
+ }
77
+ }
78
+ };
79
+ return i ? (e.flags = t.Mutable | t.Dirty, e.get = function() {
80
+ const o = e.flags;
81
+ if (o & t.Dirty || o & t.Pending && T(e.deps, e)) {
82
+ if (e._update()) {
83
+ const n = e.subs;
84
+ n !== void 0 && y(n);
85
+ }
86
+ } else o & t.Pending && (e.flags = o & ~t.Pending);
87
+ return f !== void 0 && b(e, f, p), e._snapshot;
88
+ }) : e.set = function(o) {
89
+ if (e._update(o)) {
90
+ const n = e.subs;
91
+ n !== void 0 && (R(n), y(n), m());
92
+ }
93
+ }, e;
94
+ }
95
+ function C(s) {
96
+ const r = () => {
97
+ const c = f;
98
+ f = i, ++p, i.depsTail = void 0, i.flags = t.Watching | t.RecursedCheck;
99
+ try {
100
+ return s();
101
+ } finally {
102
+ f = c, i.flags &= ~t.RecursedCheck, v(i);
103
+ }
104
+ }, i = {
105
+ deps: void 0,
106
+ depsTail: void 0,
107
+ subs: void 0,
108
+ subsTail: void 0,
109
+ flags: t.Watching | t.RecursedCheck,
110
+ notify() {
111
+ const c = this.flags;
112
+ c & t.Dirty || c & t.Pending && T(this.deps, this) ? r() : this.flags = t.Watching;
113
+ },
114
+ stop() {
115
+ this.flags = t.None, this.depsTail = void 0, v(this);
116
+ }
117
+ };
118
+ return r(), i;
119
+ }
120
+ export {
121
+ P as createAtom,
122
+ m as flush,
123
+ k as toObserver
124
+ };
@@ -0,0 +1 @@
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./atom.cjs.js");class r{constructor(t){this.atom=e.createAtom(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(e.toObserver(t))}}exports.Store=r;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { createAtom as e, toObserver as s } from "./atom.es.js";
3
+ class a {
4
+ constructor(t) {
5
+ this.atom = e(
6
+ t
7
+ );
8
+ }
9
+ setState(t) {
10
+ this.atom.set(t);
11
+ }
12
+ get state() {
13
+ return this.atom.get();
14
+ }
15
+ get() {
16
+ return this.state;
17
+ }
18
+ subscribe(t) {
19
+ return this.atom.subscribe(s(t));
20
+ }
21
+ }
22
+ export {
23
+ a as Store
24
+ };
@@ -30,8 +30,8 @@ export type ChildrenProps = {
30
30
  children?: ReactNode;
31
31
  };
32
32
  export type ToggleProps = {
33
- open?: boolean;
34
- onClose?: VoidFunction;
33
+ open: boolean;
34
+ onClose: VoidFunction;
35
35
  };
36
36
  export type RecursivePartial<T> = {
37
37
  [P in keyof T]?: RecursivePartial<T[P]>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "reaxify",
3
3
  "private": false,
4
- "version": "0.0.84",
4
+ "version": "0.0.85",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "files": [
@@ -51,15 +51,16 @@
51
51
  "build-storybook": "storybook build"
52
52
  },
53
53
  "dependencies": {
54
+ "@tanstack/react-hotkeys": "^0.9.1",
54
55
  "iconsax-react": "^0.0.8",
55
56
  "react-animate-height": "^3.2.3",
56
57
  "react-transition-group": "^4.4.5",
57
58
  "tailwind-merge": "^3.3.1"
58
59
  },
59
60
  "peerDependencies": {
61
+ "axios": ">=1.0.0",
60
62
  "react": ">=19.0.0",
61
- "react-dom": ">=19.0.0",
62
- "axios": ">=1.0.0"
63
+ "react-dom": ">=19.0.0"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@chromatic-com/storybook": "^1.9.0",
@@ -1 +0,0 @@
1
- "use client";"use strict";const s=require("react");function o(r,{skip:t=!1,targetKey:e=null}={}){const u=s.useRef(r);u.current=r,s.useEffect(()=>{if(t)return;const c=n=>e?Array.isArray(e)?e.includes(n):n===e:!0,i=n=>{c(n.key)&&u.current(n.key)};return window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[e,t])}module.exports=o;
@@ -1,6 +0,0 @@
1
- type Options = {
2
- skip?: boolean;
3
- targetKey?: null | string | string[];
4
- };
5
- export default function useKeyDown(callback: (key: string) => void, { skip, targetKey }?: Options): void;
6
- export {};
@@ -1,17 +0,0 @@
1
- "use client";
2
- import { useRef as f, useEffect as s } from "react";
3
- function d(r, { skip: u = !1, targetKey: e = null } = {}) {
4
- const t = f(r);
5
- t.current = r, s(() => {
6
- if (u) return;
7
- const o = (n) => e ? Array.isArray(e) ? e.includes(n) : n === e : !0, i = (n) => {
8
- o(n.key) && t.current(n.key);
9
- };
10
- return window.addEventListener("keydown", i), () => {
11
- window.removeEventListener("keydown", i);
12
- };
13
- }, [e, u]);
14
- }
15
- export {
16
- d as default
17
- };