reaxify 0.0.84 → 0.0.86
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/components/Alert/index.cjs.js +1 -0
- package/dist/components/Alert/index.es.js +8 -0
- package/dist/components/Badge/index.cjs.js +1 -1
- package/dist/components/Badge/index.es.js +36 -36
- package/dist/components/Button/index.cjs.js +1 -1
- package/dist/components/Button/index.es.js +75 -57
- package/dist/components/Drawer/index.cjs.js +1 -1
- package/dist/components/Drawer/index.es.js +75 -71
- package/dist/components/Menu/index.cjs.js +1 -1
- package/dist/components/Menu/index.es.js +91 -88
- package/dist/components/Modal/index.cjs.js +1 -1
- package/dist/components/Modal/index.es.js +76 -69
- package/dist/components/Progress/index.cjs.js +1 -1
- package/dist/components/Progress/index.es.js +21 -21
- package/dist/components/Spacer/index.cjs.js +1 -1
- package/dist/components/Spacer/index.es.js +13 -7
- package/dist/components/Stack/index.cjs.js +1 -1
- package/dist/components/Stack/index.es.js +28 -28
- package/dist/components/Switch/index.cjs.js +1 -1
- package/dist/components/Switch/index.es.js +1 -1
- package/dist/components/Tabs/index.cjs.js +1 -1
- package/dist/components/Tabs/index.es.js +9 -9
- package/dist/helpers/scrollIntoView.cjs.js +1 -1
- package/dist/helpers/scrollIntoView.es.js +4 -3
- package/dist/hooks/index.cjs.js +1 -1
- package/dist/hooks/index.es.js +6 -8
- package/dist/node_modules/@tanstack/hotkeys/dist/constants.cjs.js +1 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/constants.es.js +206 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/format.cjs.js +1 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/format.es.js +10 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.cjs.js +1 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.es.js +276 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.cjs.js +1 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.es.js +48 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/match.cjs.js +1 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/match.es.js +27 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/parse.cjs.js +1 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/parse.es.js +72 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.cjs.js +1 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.es.js +10 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs.js +1 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.es.js +35 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.cjs.js +1 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.es.js +7 -0
- package/dist/node_modules/@tanstack/store/dist/esm/alien.cjs.js +1 -0
- package/dist/node_modules/@tanstack/store/dist/esm/alien.es.js +129 -0
- package/dist/node_modules/@tanstack/store/dist/esm/atom.cjs.js +1 -0
- package/dist/node_modules/@tanstack/store/dist/esm/atom.es.js +124 -0
- package/dist/node_modules/@tanstack/store/dist/esm/store.cjs.js +1 -0
- package/dist/node_modules/@tanstack/store/dist/esm/store.es.js +24 -0
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.cjs.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.es.js +2 -2
- package/dist/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
- package/dist/node_modules/react-transition-group/esm/Transition.es.js +2 -2
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.cjs.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.es.js +745 -553
- package/dist/reaxify.css +1 -1
- package/dist/{axios → src/axios}/AxiosProvider.d.ts +1 -1
- package/dist/{components → src/components}/Accordion/index.d.ts +1 -1
- package/dist/src/components/Alert/index.d.ts +26 -0
- package/dist/{components → src/components}/Badge/index.d.ts +1 -1
- package/dist/{components → src/components}/Button/index.d.ts +3 -3
- package/dist/{components → src/components}/ButtonGroup/index.d.ts +1 -1
- package/dist/{components → src/components}/Card/index.d.ts +1 -1
- package/dist/{components → src/components}/Drawer/index.d.ts +6 -6
- package/dist/src/components/Fill/index.d.ts +3 -0
- package/dist/{components → src/components}/InputGroup/index.d.ts +1 -1
- package/dist/src/components/Menu/index.d.ts +16 -0
- package/dist/{components → src/components}/Modal/index.d.ts +5 -6
- package/dist/{components → src/components}/Portal/index.d.ts +1 -1
- package/dist/{components → src/components}/Progress/index.d.ts +1 -1
- package/dist/src/components/Spacer/index.d.ts +6 -0
- package/dist/{components → src/components}/Spinner/index.d.ts +1 -1
- package/dist/src/components/Stack/index.d.ts +10 -0
- package/dist/{components → src/components}/Switch/index.d.ts +1 -1
- package/dist/{components → src/components}/Tabs/index.d.ts +1 -1
- package/dist/{components → src/components}/Tooltip/index.d.ts +2 -2
- package/dist/{components → src/components}/Typography/index.d.ts +1 -1
- package/dist/src/helpers/scrollIntoView.d.ts +1 -0
- package/dist/{hooks → src/hooks}/index.d.ts +0 -1
- package/dist/{hooks → src/hooks}/useClasses.d.ts +2 -2
- package/dist/{providers → src/providers}/ThemeProvider.d.ts +28 -5
- package/dist/{types → src/types}/index.d.ts +8 -3
- package/package.json +26 -26
- package/dist/components/Menu/index.d.ts +0 -15
- package/dist/components/Spacer/index.d.ts +0 -6
- package/dist/components/Stack/index.d.ts +0 -10
- package/dist/helpers/scrollIntoView.d.ts +0 -1
- package/dist/hooks/useKeyDown.cjs.js +0 -1
- package/dist/hooks/useKeyDown.d.ts +0 -6
- package/dist/hooks/useKeyDown.es.js +0 -17
- /package/dist/{axios → src/axios}/index.d.ts +0 -0
- /package/dist/{axios → src/axios}/types.d.ts +0 -0
- /package/dist/{axios → src/axios}/useAxios.d.ts +0 -0
- /package/dist/{components → src/components}/Skeleton/index.d.ts +0 -0
- /package/dist/{components → src/components}/Table/index.d.ts +0 -0
- /package/dist/{components → src/components}/index.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/cn.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/copy.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/index.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/isEmpty.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/isServer.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/randomID.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/replaceNonDigits.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/replacePersianNumbers.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/twoDigitNumber.d.ts +0 -0
- /package/dist/{helpers → src/helpers}/wait.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useCreateRipple.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useDebounce.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useDocumentVisible.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useIsOffline.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/usePersistedState.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/useToggle.d.ts +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{providers → src/providers}/index.d.ts +0 -0
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
2
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import m from "../../helpers/cn.es.js";
|
|
4
|
+
import C from "../../hooks/useClasses.es.js";
|
|
5
5
|
import { useMemo as l } from "react";
|
|
6
|
-
import { twMerge as
|
|
7
|
-
function
|
|
8
|
-
as:
|
|
9
|
-
|
|
10
|
-
wrap:
|
|
6
|
+
import { twMerge as v } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
7
|
+
function j({
|
|
8
|
+
as: c,
|
|
9
|
+
direction: t = "row",
|
|
10
|
+
wrap: o = !1,
|
|
11
11
|
reverse: e = !1,
|
|
12
|
-
className:
|
|
13
|
-
children:
|
|
14
|
-
...
|
|
12
|
+
className: u,
|
|
13
|
+
children: s,
|
|
14
|
+
...x
|
|
15
15
|
}) {
|
|
16
|
-
const r =
|
|
17
|
-
var i,
|
|
16
|
+
const r = C((n) => n.stack), p = c || "div", w = l(() => {
|
|
17
|
+
var i, f;
|
|
18
18
|
return {
|
|
19
|
-
|
|
19
|
+
row: m(
|
|
20
20
|
"*:min-w-0",
|
|
21
21
|
e ? "flex-row-reverse" : "flex-row",
|
|
22
|
-
(i = r == null ? void 0 : r.
|
|
22
|
+
(i = r == null ? void 0 : r.directions) == null ? void 0 : i.row
|
|
23
23
|
),
|
|
24
|
-
|
|
24
|
+
column: m(
|
|
25
25
|
"*:min-h-0",
|
|
26
26
|
e ? "flex-col-reverse" : "flex-col",
|
|
27
|
-
(
|
|
27
|
+
(f = r == null ? void 0 : r.directions) == null ? void 0 : f.column
|
|
28
28
|
)
|
|
29
|
-
}[
|
|
30
|
-
}, [
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
29
|
+
}[t];
|
|
30
|
+
}, [t, e, r == null ? void 0 : r.directions]), d = l(() => o === "reverse" ? "flex-wrap-reverse" : o ? "flex-wrap" : null, [o]);
|
|
31
|
+
return /* @__PURE__ */ a(
|
|
32
|
+
p,
|
|
33
33
|
{
|
|
34
|
-
className:
|
|
34
|
+
className: v(
|
|
35
35
|
"flex",
|
|
36
36
|
r == null ? void 0 : r.base,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
w,
|
|
38
|
+
d,
|
|
39
|
+
u
|
|
40
40
|
),
|
|
41
|
-
...
|
|
42
|
-
children:
|
|
41
|
+
...x,
|
|
42
|
+
children: s
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
export {
|
|
47
|
-
|
|
47
|
+
j as default
|
|
48
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";const s=require("react/jsx-runtime"),g=require("../../helpers/cn.cjs.js"),i=require("react"),y=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function z({checked:e,onChange:n,disabled:l,color:a="primary",size:b="md",inputProps:t={},className:u,...c}){const d=i.useMemo(()=>"",[e]),m=i.useMemo(()=>{const r={primary:e?"bg-primary border-primary":"bg-white border-[#e8eaee]",secondary:e?"bg-secondary border-secondary":"bg-white border-[#e8eaee]",success:e?"bg-success border-success":"bg-white border-[#e8eaee]",info:e?"bg-info border-info":"bg-white border-[#e8eaee]",warning:e?"bg-warning border-warning":"bg-white border-[#e8eaee]",danger:e?"bg-danger border-danger":"bg-white border-[#e8eaee]",dark:e?"bg-dark border-dark":"bg-white border-[#e8eaee]",light:e?"bg-light border-light":"bg-white border-[#e8eaee]"};return r==null?void 0:r[a]},[a,e]),w=i.useMemo(()=>{const r={primary:e?"bg-primary ":"bg-black",secondary:e?"bg-secondary":"bg-black",success:e?"bg-success":"bg-black",info:e?"bg-info":"bg-black",warning:e?"bg-warning":"bg-black",danger:e?"bg-danger":"bg-black",dark:e?"bg-dark":"bg-black",light:e?"bg-light":"bg-black"};return r==null?void 0:r[a]},[a,e]),f=i.useMemo(()=>{const r={sm:"[--size:0.25rem]",md:"[--size:0.5rem]",lg:"[--size:0.75rem]"};return r==null?void 0:r[b]},[b]),h=r=>{var o;n==null||n(r.currentTarget.checked),(o=t.onChange)==null||o.call(t,r)};return s.jsxs("span",{className:y.twMerge(f,"[--w:2.5rem] [--h:1.875rem] [--t:0.75rem] [--width:calc(var(--w)+var(--size)*2)] [--height:calc(var(--h)+var(--size))] [--thumb:calc(var(--t)+var(--size))] [--scale:0] hover:[--scale:1]","inline-flex w-(--width) h-(--height) overflow-hidden p-3 relative align-middle",l&&"opacity-75",d,u),...c,children:[s.jsx("input",{...t,type:"checkbox",className:"peer absolute inset-0 size-full opacity-0 cursor-pointer disabled:cursor-not-allowed z-[2]",checked:e,disabled:l,onChange:h}),s.jsxs("span",{className:"inline-flex justify-center items-center size-(--height) rounded-full absolute inset-y-0 my-auto left-0 peer-checked:left-[calc(100%-var(--height))] transition-[left] z-[1]",children:[s.jsx("span",{className:"absolute size-full inset-0 bg-black/
|
|
1
|
+
"use client";"use strict";const s=require("react/jsx-runtime"),g=require("../../helpers/cn.cjs.js"),i=require("react"),y=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js");function z({checked:e,onChange:n,disabled:l,color:a="primary",size:b="md",inputProps:t={},className:u,...c}){const d=i.useMemo(()=>"",[e]),m=i.useMemo(()=>{const r={primary:e?"bg-primary border-primary":"bg-white border-[#e8eaee]",secondary:e?"bg-secondary border-secondary":"bg-white border-[#e8eaee]",success:e?"bg-success border-success":"bg-white border-[#e8eaee]",info:e?"bg-info border-info":"bg-white border-[#e8eaee]",warning:e?"bg-warning border-warning":"bg-white border-[#e8eaee]",danger:e?"bg-danger border-danger":"bg-white border-[#e8eaee]",dark:e?"bg-dark border-dark":"bg-white border-[#e8eaee]",light:e?"bg-light border-light":"bg-white border-[#e8eaee]"};return r==null?void 0:r[a]},[a,e]),w=i.useMemo(()=>{const r={primary:e?"bg-primary ":"bg-black",secondary:e?"bg-secondary":"bg-black",success:e?"bg-success":"bg-black",info:e?"bg-info":"bg-black",warning:e?"bg-warning":"bg-black",danger:e?"bg-danger":"bg-black",dark:e?"bg-dark":"bg-black",light:e?"bg-light":"bg-black"};return r==null?void 0:r[a]},[a,e]),f=i.useMemo(()=>{const r={sm:"[--size:0.25rem]",md:"[--size:0.5rem]",lg:"[--size:0.75rem]"};return r==null?void 0:r[b]},[b]),h=r=>{var o;n==null||n(r.currentTarget.checked),(o=t.onChange)==null||o.call(t,r)};return s.jsxs("span",{className:y.twMerge(f,"[--w:2.5rem] [--h:1.875rem] [--t:0.75rem] [--width:calc(var(--w)+var(--size)*2)] [--height:calc(var(--h)+var(--size))] [--thumb:calc(var(--t)+var(--size))] [--scale:0] hover:[--scale:1]","inline-flex w-(--width) h-(--height) overflow-hidden p-3 relative align-middle",l&&"opacity-75",d,u),...c,children:[s.jsx("input",{...t,type:"checkbox",className:"peer absolute inset-0 size-full opacity-0 cursor-pointer disabled:cursor-not-allowed z-[2]",checked:e,disabled:l,onChange:h}),s.jsxs("span",{className:"inline-flex justify-center items-center size-(--height) rounded-full absolute inset-y-0 my-auto left-0 peer-checked:left-[calc(100%-var(--height))] transition-[left] z-[1]",children:[s.jsx("span",{className:"absolute size-full inset-0 bg-black/10 rounded-full scale-(--scale) transition-[scale]"}),s.jsx("span",{className:g("absolute size-(--thumb) inset-0 m-auto border rounded-full shadow transition-colors",m)})]}),s.jsx("span",{className:g("size-full rounded-full opacity-35 transition-colors",w)})]})}module.exports=z;
|
|
@@ -73,7 +73,7 @@ function C({
|
|
|
73
73
|
}
|
|
74
74
|
),
|
|
75
75
|
/* @__PURE__ */ g("span", { className: "inline-flex justify-center items-center size-(--height) rounded-full absolute inset-y-0 my-auto left-0 peer-checked:left-[calc(100%-var(--height))] transition-[left] z-[1]", children: [
|
|
76
|
-
/* @__PURE__ */ t("span", { className: "absolute size-full inset-0 bg-black/
|
|
76
|
+
/* @__PURE__ */ t("span", { className: "absolute size-full inset-0 bg-black/10 rounded-full scale-(--scale) transition-[scale]" }),
|
|
77
77
|
/* @__PURE__ */ t(
|
|
78
78
|
"span",
|
|
79
79
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),n=require("react"),j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),g=require("../../helpers/cn.cjs.js"),x=require("../../hooks/useClasses.cjs.js"),q=require("../Button/index.cjs.js"),b=n.createContext({active:null,onChange:()=>{},buttonGroupClasses:""});function m({active:r=null,onChange:s=()=>{},children:u}){const a=x(l=>l.tabs.buttonGroup.base),i=n.useMemo(()=>g("relative flex items-center",a),[a]);return d.jsx(b.Provider,{value:{active:r,onChange:s,buttonGroupClasses:i},children:u})}function I({className:r,...s}){const[u,a]=n.useState(!1),i=x(t=>t.tabs.indicator.base),{active:l}=n.useContext(b),f=n.useRef(null),p=n.useCallback(()=>{const t=f.current,e=t==null?void 0:t.parentElement,o=e==null?void 0:e.querySelector("button[data-active='true']");if(!e||!o||!t)return;const c=(o==null?void 0:o.offsetLeft)??0,C=window.getComputedStyle(o).paddingInline,v=(o==null?void 0:o.getBoundingClientRect().width)??0,y=c,w=v;t.style.setProperty("--left",`${y}px`),t.style.setProperty("--width",`${w}px`),t.style.setProperty("--padding-x",`${C}`)},[]);return n.useEffect(()=>{p(),requestAnimationFrame(()=>a(!0))},[p,l]),d.jsx("span",{ref:f,className:j.twMerge("absolute bottom-0 left-(--left,0px) rtl:left-(--left,100%) w-(--width,0px) px-(--padding-x,0px) h-px overflow-hidden",u?"transition-[width,left,padding]":"",i,r),...s,children:d.jsx("span",{className:"block size-full rounded-full bg-primary"})})}function T({eventKey:r,className:s,children:u,onClick:a,...i}){const l=x(c=>c.tabs.button.base),f=x(c=>c.tabs.button.active),{active:p,onChange:t}=n.useContext(b),e=r===p,h=n.useMemo(()=>typeof s=="function"?s({isActive:e}):s,[e,s]),o=c=>{!e&&t(r),a==null||a(c)};return d.jsx(q,{as:"button",type:"button","data-active":e,onClick:o,color:e?"primary":
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),n=require("react"),j=require("../../node_modules/tailwind-merge/dist/bundle-mjs.cjs.js"),g=require("../../helpers/cn.cjs.js"),x=require("../../hooks/useClasses.cjs.js"),q=require("../Button/index.cjs.js"),b=n.createContext({active:null,onChange:()=>{},buttonGroupClasses:""});function m({active:r=null,onChange:s=()=>{},children:u}){const a=x(l=>l.tabs.buttonGroup.base),i=n.useMemo(()=>g("relative flex items-center",a),[a]);return d.jsx(b.Provider,{value:{active:r,onChange:s,buttonGroupClasses:i},children:u})}function I({className:r,...s}){const[u,a]=n.useState(!1),i=x(t=>t.tabs.indicator.base),{active:l}=n.useContext(b),f=n.useRef(null),p=n.useCallback(()=>{const t=f.current,e=t==null?void 0:t.parentElement,o=e==null?void 0:e.querySelector("button[data-active='true']");if(!e||!o||!t)return;const c=(o==null?void 0:o.offsetLeft)??0,C=window.getComputedStyle(o).paddingInline,v=(o==null?void 0:o.getBoundingClientRect().width)??0,y=c,w=v;t.style.setProperty("--left",`${y}px`),t.style.setProperty("--width",`${w}px`),t.style.setProperty("--padding-x",`${C}`)},[]);return n.useEffect(()=>{p(),requestAnimationFrame(()=>a(!0))},[p,l]),d.jsx("span",{ref:f,className:j.twMerge("absolute bottom-0 left-(--left,0px) rtl:left-(--left,100%) w-(--width,0px) px-(--padding-x,0px) h-px overflow-hidden",u?"transition-[width,left,padding]":"",i,r),...s,children:d.jsx("span",{className:"block size-full rounded-full bg-primary"})})}function T({eventKey:r,className:s,children:u,onClick:a,...i}){const l=x(c=>c.tabs.button.base),f=x(c=>c.tabs.button.active),{active:p,onChange:t}=n.useContext(b),e=r===p,h=n.useMemo(()=>typeof s=="function"?s({isActive:e}):s,[e,s]),o=c=>{!e&&t(r),a==null||a(c)};return d.jsx(q,{as:"button",type:"button","data-active":e,onClick:o,color:e?"primary":"dark",variant:"text",className:g("shadow-none border-none",l,e&&f,h),...i,children:u})}function M({eventKey:r,children:s}){const{active:u}=n.useContext(b);return u!==r?null:d.jsx(n.Fragment,{children:s})}m.Indicator=I;m.Button=T;m.Item=M;exports.TabsContext=b;exports.default=m;
|
|
@@ -4,7 +4,7 @@ import { createContext as P, useMemo as g, useState as T, useContext as m, useRe
|
|
|
4
4
|
import { twMerge as $ } from "../../node_modules/tailwind-merge/dist/bundle-mjs.es.js";
|
|
5
5
|
import C from "../../helpers/cn.es.js";
|
|
6
6
|
import p from "../../hooks/useClasses.es.js";
|
|
7
|
-
import
|
|
7
|
+
import k from "../Button/index.es.js";
|
|
8
8
|
const b = P({
|
|
9
9
|
active: null,
|
|
10
10
|
onChange: () => {
|
|
@@ -16,7 +16,7 @@ function h({ active: o = null, onChange: n = () => {
|
|
|
16
16
|
const r = p((c) => c.tabs.buttonGroup.base), l = g(() => C("relative flex items-center", r), [r]);
|
|
17
17
|
return /* @__PURE__ */ u(b.Provider, { value: { active: o, onChange: n, buttonGroupClasses: l }, children: a });
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function q({
|
|
20
20
|
className: o,
|
|
21
21
|
...n
|
|
22
22
|
}) {
|
|
@@ -43,7 +43,7 @@ function E({
|
|
|
43
43
|
}
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function E({
|
|
47
47
|
eventKey: o,
|
|
48
48
|
className: n,
|
|
49
49
|
children: a,
|
|
@@ -52,7 +52,7 @@ function F({
|
|
|
52
52
|
}) {
|
|
53
53
|
const c = p((i) => i.tabs.button.base), d = p((i) => i.tabs.button.active), { active: f, onChange: t } = m(b), e = o === f, x = g(() => typeof n == "function" ? n({ isActive: e }) : n, [e, n]);
|
|
54
54
|
return /* @__PURE__ */ u(
|
|
55
|
-
|
|
55
|
+
k,
|
|
56
56
|
{
|
|
57
57
|
as: "button",
|
|
58
58
|
type: "button",
|
|
@@ -60,7 +60,7 @@ function F({
|
|
|
60
60
|
onClick: (i) => {
|
|
61
61
|
!e && t(o), r == null || r(i);
|
|
62
62
|
},
|
|
63
|
-
color: e ? "primary" :
|
|
63
|
+
color: e ? "primary" : "dark",
|
|
64
64
|
variant: "text",
|
|
65
65
|
className: C(
|
|
66
66
|
"shadow-none border-none",
|
|
@@ -73,13 +73,13 @@ function F({
|
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function F({ eventKey: o, children: n }) {
|
|
77
77
|
const { active: a } = m(b);
|
|
78
78
|
return a !== o ? null : /* @__PURE__ */ u(S, { children: n });
|
|
79
79
|
}
|
|
80
|
-
h.Indicator =
|
|
81
|
-
h.Button =
|
|
82
|
-
h.Item =
|
|
80
|
+
h.Indicator = q;
|
|
81
|
+
h.Button = E;
|
|
82
|
+
h.Item = F;
|
|
83
83
|
export {
|
|
84
84
|
b as TabsContext,
|
|
85
85
|
h as default
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";function t
|
|
1
|
+
"use client";"use strict";function i(t,n={block:"center",inline:"center",behavior:"smooth"}){const o=typeof t=="string"?document.querySelector(t):t;o==null||o.scrollIntoView(n)}module.exports=i;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
function
|
|
2
|
+
function i(t, n = {
|
|
3
3
|
block: "center",
|
|
4
4
|
inline: "center",
|
|
5
5
|
behavior: "smooth"
|
|
6
6
|
}) {
|
|
7
|
-
|
|
7
|
+
const o = typeof t == "string" ? document.querySelector(t) : t;
|
|
8
|
+
o == null || o.scrollIntoView(n);
|
|
8
9
|
}
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
i as default
|
|
11
12
|
};
|
package/dist/hooks/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useClasses.cjs.js"),s=require("./useCreateRipple.cjs.js"),u=require("./useDebounce.cjs.js"),t=require("./useDocumentVisible.cjs.js"),r=require("./useIsOffline.cjs.js"),i=require("./
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useClasses.cjs.js"),s=require("./useCreateRipple.cjs.js"),u=require("./useDebounce.cjs.js"),t=require("./useDocumentVisible.cjs.js"),r=require("./useIsOffline.cjs.js"),i=require("./usePersistedState.cjs.js"),o=require("./useToggle.cjs.js");exports.useClasses=e;exports.useCreateRipple=s;exports.useDebounce=u;exports.useDocumentVisible=t;exports.useIsOffline=r;exports.usePersistedState=i;exports.useToggle=o;
|
package/dist/hooks/index.es.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { default as t } from "./useClasses.es.js";
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as o } from "./useCreateRipple.es.js";
|
|
4
4
|
import { default as f } from "./useDebounce.es.js";
|
|
5
5
|
import { default as l } from "./useDocumentVisible.es.js";
|
|
6
6
|
import { default as d } from "./useIsOffline.es.js";
|
|
7
|
-
import { default as x } from "./
|
|
8
|
-
import { default as n } from "./
|
|
9
|
-
import { default as D } from "./useToggle.es.js";
|
|
7
|
+
import { default as x } from "./usePersistedState.es.js";
|
|
8
|
+
import { default as n } from "./useToggle.es.js";
|
|
10
9
|
export {
|
|
11
10
|
t as useClasses,
|
|
12
|
-
|
|
11
|
+
o as useCreateRipple,
|
|
13
12
|
f as useDebounce,
|
|
14
13
|
l as useDocumentVisible,
|
|
15
14
|
d as useIsOffline,
|
|
16
|
-
x as
|
|
17
|
-
n as
|
|
18
|
-
D as useToggle
|
|
15
|
+
x as usePersistedState,
|
|
16
|
+
n as useToggle
|
|
19
17
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function a(){var r,o;if(typeof navigator>"u")return"linux";const e=((r=navigator.platform)==null?void 0:r.toLowerCase())??"",t=((o=navigator.userAgent)==null?void 0:o.toLowerCase())??"";return e.includes("mac")||t.includes("mac")?"mac":e.includes("win")||t.includes("win")?"windows":"linux"}const c=["Control","Alt","Shift","Meta"];new Set(c);const u={Control:"Control",Ctrl:"Control",control:"Control",ctrl:"Control",Shift:"Shift",shift:"Shift",Alt:"Alt",Option:"Alt",alt:"Alt",option:"Alt",Command:"Meta",Cmd:"Meta",Meta:"Meta",command:"Meta",cmd:"Meta",meta:"Meta",OS:"Meta",os:"Meta",Win:"Meta",win:"Meta",CommandOrControl:"Mod",Mod:"Mod",commandorcontrol:"Mod",mod:"Mod"};function A(e,t=a()){return e==="Mod"?t==="mac"?"Meta":"Control":e}const i=new Set(["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]),l=new Set(["0","1","2","3","4","5","6","7","8","9"]),s=new Set(["F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12"]),p=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),w=new Set(["Enter","Escape","Space","Tab","Backspace","Delete"]),E=new Set(["/","[","]","\\","=","-",",",".",";","`"]),d={Backquote:"`",Backslash:"\\",BracketLeft:"[",BracketRight:"]",Comma:",",Equal:"=",Minus:"-",Period:".",Semicolon:";",Slash:"/"};[...i,...l,...s,...p,...w,...E];const n={Esc:"Escape",esc:"Escape",escape:"Escape",Return:"Enter",return:"Enter",enter:"Enter"," ":"Space",space:"Space",Spacebar:"Space",spacebar:"Space",tab:"Tab",backspace:"Backspace",Del:"Delete",del:"Delete",delete:"Delete",Up:"ArrowUp",up:"ArrowUp",arrowup:"ArrowUp",Down:"ArrowDown",down:"ArrowDown",arrowdown:"ArrowDown",Left:"ArrowLeft",left:"ArrowLeft",arrowleft:"ArrowLeft",Right:"ArrowRight",right:"ArrowRight",arrowright:"ArrowRight",home:"Home",end:"End",pageup:"PageUp",pagedown:"PageDown",PgUp:"PageUp",PgDn:"PageDown",pgup:"PageUp",pgdn:"PageDown"};function S(e){return new RegExp("^\\p{Letter}$","u").test(e)}function f(e){if(!e)return"";if(e in n)return n[e];if(S(e)){const r=e.toUpperCase();return r.length===1?r:e}const t=e.toUpperCase();return/^F([1-9]|1[0-2])$/.test(t)?t:e}exports.EDITING_KEYS=w;exports.FUNCTION_KEYS=s;exports.LETTER_KEYS=i;exports.MODIFIER_ALIASES=u;exports.MODIFIER_ORDER=c;exports.NAVIGATION_KEYS=p;exports.NUMBER_KEYS=l;exports.PUNCTUATION_CODE_MAP=d;exports.PUNCTUATION_KEYS=E;exports.detectPlatform=a;exports.isSingleLetterKey=S;exports.normalizeKeyName=f;exports.resolveModifier=A;
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
function a() {
|
|
3
|
+
var r, o;
|
|
4
|
+
if (typeof navigator > "u") return "linux";
|
|
5
|
+
const e = ((r = navigator.platform) == null ? void 0 : r.toLowerCase()) ?? "", t = ((o = navigator.userAgent) == null ? void 0 : o.toLowerCase()) ?? "";
|
|
6
|
+
return e.includes("mac") || t.includes("mac") ? "mac" : e.includes("win") || t.includes("win") ? "windows" : "linux";
|
|
7
|
+
}
|
|
8
|
+
const c = [
|
|
9
|
+
"Control",
|
|
10
|
+
"Alt",
|
|
11
|
+
"Shift",
|
|
12
|
+
"Meta"
|
|
13
|
+
];
|
|
14
|
+
new Set(c);
|
|
15
|
+
const S = {
|
|
16
|
+
Control: "Control",
|
|
17
|
+
Ctrl: "Control",
|
|
18
|
+
control: "Control",
|
|
19
|
+
ctrl: "Control",
|
|
20
|
+
Shift: "Shift",
|
|
21
|
+
shift: "Shift",
|
|
22
|
+
Alt: "Alt",
|
|
23
|
+
Option: "Alt",
|
|
24
|
+
alt: "Alt",
|
|
25
|
+
option: "Alt",
|
|
26
|
+
Command: "Meta",
|
|
27
|
+
Cmd: "Meta",
|
|
28
|
+
Meta: "Meta",
|
|
29
|
+
command: "Meta",
|
|
30
|
+
cmd: "Meta",
|
|
31
|
+
meta: "Meta",
|
|
32
|
+
OS: "Meta",
|
|
33
|
+
os: "Meta",
|
|
34
|
+
Win: "Meta",
|
|
35
|
+
win: "Meta",
|
|
36
|
+
CommandOrControl: "Mod",
|
|
37
|
+
Mod: "Mod",
|
|
38
|
+
commandorcontrol: "Mod",
|
|
39
|
+
mod: "Mod"
|
|
40
|
+
};
|
|
41
|
+
function d(e, t = a()) {
|
|
42
|
+
return e === "Mod" ? t === "mac" ? "Meta" : "Control" : e;
|
|
43
|
+
}
|
|
44
|
+
const i = /* @__PURE__ */ new Set([
|
|
45
|
+
"A",
|
|
46
|
+
"B",
|
|
47
|
+
"C",
|
|
48
|
+
"D",
|
|
49
|
+
"E",
|
|
50
|
+
"F",
|
|
51
|
+
"G",
|
|
52
|
+
"H",
|
|
53
|
+
"I",
|
|
54
|
+
"J",
|
|
55
|
+
"K",
|
|
56
|
+
"L",
|
|
57
|
+
"M",
|
|
58
|
+
"N",
|
|
59
|
+
"O",
|
|
60
|
+
"P",
|
|
61
|
+
"Q",
|
|
62
|
+
"R",
|
|
63
|
+
"S",
|
|
64
|
+
"T",
|
|
65
|
+
"U",
|
|
66
|
+
"V",
|
|
67
|
+
"W",
|
|
68
|
+
"X",
|
|
69
|
+
"Y",
|
|
70
|
+
"Z"
|
|
71
|
+
]), p = /* @__PURE__ */ new Set([
|
|
72
|
+
"0",
|
|
73
|
+
"1",
|
|
74
|
+
"2",
|
|
75
|
+
"3",
|
|
76
|
+
"4",
|
|
77
|
+
"5",
|
|
78
|
+
"6",
|
|
79
|
+
"7",
|
|
80
|
+
"8",
|
|
81
|
+
"9"
|
|
82
|
+
]), s = /* @__PURE__ */ new Set([
|
|
83
|
+
"F1",
|
|
84
|
+
"F2",
|
|
85
|
+
"F3",
|
|
86
|
+
"F4",
|
|
87
|
+
"F5",
|
|
88
|
+
"F6",
|
|
89
|
+
"F7",
|
|
90
|
+
"F8",
|
|
91
|
+
"F9",
|
|
92
|
+
"F10",
|
|
93
|
+
"F11",
|
|
94
|
+
"F12"
|
|
95
|
+
]), w = /* @__PURE__ */ new Set([
|
|
96
|
+
"ArrowUp",
|
|
97
|
+
"ArrowDown",
|
|
98
|
+
"ArrowLeft",
|
|
99
|
+
"ArrowRight",
|
|
100
|
+
"Home",
|
|
101
|
+
"End",
|
|
102
|
+
"PageUp",
|
|
103
|
+
"PageDown"
|
|
104
|
+
]), l = /* @__PURE__ */ new Set([
|
|
105
|
+
"Enter",
|
|
106
|
+
"Escape",
|
|
107
|
+
"Space",
|
|
108
|
+
"Tab",
|
|
109
|
+
"Backspace",
|
|
110
|
+
"Delete"
|
|
111
|
+
]), u = /* @__PURE__ */ new Set([
|
|
112
|
+
"/",
|
|
113
|
+
"[",
|
|
114
|
+
"]",
|
|
115
|
+
"\\",
|
|
116
|
+
"=",
|
|
117
|
+
"-",
|
|
118
|
+
",",
|
|
119
|
+
".",
|
|
120
|
+
";",
|
|
121
|
+
"`"
|
|
122
|
+
]), f = {
|
|
123
|
+
Backquote: "`",
|
|
124
|
+
Backslash: "\\",
|
|
125
|
+
BracketLeft: "[",
|
|
126
|
+
BracketRight: "]",
|
|
127
|
+
Comma: ",",
|
|
128
|
+
Equal: "=",
|
|
129
|
+
Minus: "-",
|
|
130
|
+
Period: ".",
|
|
131
|
+
Semicolon: ";",
|
|
132
|
+
Slash: "/"
|
|
133
|
+
};
|
|
134
|
+
[
|
|
135
|
+
...i,
|
|
136
|
+
...p,
|
|
137
|
+
...s,
|
|
138
|
+
...w,
|
|
139
|
+
...l,
|
|
140
|
+
...u
|
|
141
|
+
];
|
|
142
|
+
const n = {
|
|
143
|
+
Esc: "Escape",
|
|
144
|
+
esc: "Escape",
|
|
145
|
+
escape: "Escape",
|
|
146
|
+
Return: "Enter",
|
|
147
|
+
return: "Enter",
|
|
148
|
+
enter: "Enter",
|
|
149
|
+
" ": "Space",
|
|
150
|
+
space: "Space",
|
|
151
|
+
Spacebar: "Space",
|
|
152
|
+
spacebar: "Space",
|
|
153
|
+
tab: "Tab",
|
|
154
|
+
backspace: "Backspace",
|
|
155
|
+
Del: "Delete",
|
|
156
|
+
del: "Delete",
|
|
157
|
+
delete: "Delete",
|
|
158
|
+
Up: "ArrowUp",
|
|
159
|
+
up: "ArrowUp",
|
|
160
|
+
arrowup: "ArrowUp",
|
|
161
|
+
Down: "ArrowDown",
|
|
162
|
+
down: "ArrowDown",
|
|
163
|
+
arrowdown: "ArrowDown",
|
|
164
|
+
Left: "ArrowLeft",
|
|
165
|
+
left: "ArrowLeft",
|
|
166
|
+
arrowleft: "ArrowLeft",
|
|
167
|
+
Right: "ArrowRight",
|
|
168
|
+
right: "ArrowRight",
|
|
169
|
+
arrowright: "ArrowRight",
|
|
170
|
+
home: "Home",
|
|
171
|
+
end: "End",
|
|
172
|
+
pageup: "PageUp",
|
|
173
|
+
pagedown: "PageDown",
|
|
174
|
+
PgUp: "PageUp",
|
|
175
|
+
PgDn: "PageDown",
|
|
176
|
+
pgup: "PageUp",
|
|
177
|
+
pgdn: "PageDown"
|
|
178
|
+
};
|
|
179
|
+
function A(e) {
|
|
180
|
+
return new RegExp("^\\p{Letter}$", "u").test(e);
|
|
181
|
+
}
|
|
182
|
+
function E(e) {
|
|
183
|
+
if (!e) return "";
|
|
184
|
+
if (e in n) return n[e];
|
|
185
|
+
if (A(e)) {
|
|
186
|
+
const r = e.toUpperCase();
|
|
187
|
+
return r.length === 1 ? r : e;
|
|
188
|
+
}
|
|
189
|
+
const t = e.toUpperCase();
|
|
190
|
+
return /^F([1-9]|1[0-2])$/.test(t) ? t : e;
|
|
191
|
+
}
|
|
192
|
+
export {
|
|
193
|
+
l as EDITING_KEYS,
|
|
194
|
+
s as FUNCTION_KEYS,
|
|
195
|
+
i as LETTER_KEYS,
|
|
196
|
+
S as MODIFIER_ALIASES,
|
|
197
|
+
c as MODIFIER_ORDER,
|
|
198
|
+
w as NAVIGATION_KEYS,
|
|
199
|
+
p as NUMBER_KEYS,
|
|
200
|
+
f as PUNCTUATION_CODE_MAP,
|
|
201
|
+
u as PUNCTUATION_KEYS,
|
|
202
|
+
a as detectPlatform,
|
|
203
|
+
A as isSingleLetterKey,
|
|
204
|
+
E as normalizeKeyName,
|
|
205
|
+
d as resolveModifier
|
|
206
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./constants.cjs.js");function n(o){const t=[];for(const e of i.MODIFIER_ORDER)o.modifiers.includes(e)&&t.push(e);return t.push(o.key),t.join("+")}exports.formatHotkey=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";"use strict";var q=a=>{throw TypeError(a)};var I=(a,t,e)=>t.has(a)||q("Cannot "+e);var o=(a,t,e)=>(I(a,t,"read from private field"),e?e.call(a):t.get(a)),k=(a,t,e)=>t.has(a)?q("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(a):t.set(a,e),v=(a,t,e,r)=>(I(a,t,"write to private field"),r?r.call(a,e):t.set(a,e),e),c=(a,t,e)=>(I(a,t,"access private method"),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("./constants.cjs.js"),L=require("./parse.cjs.js"),G=require("./format.cjs.js"),P=require("./match.cjs.js"),w=require("./manager.utils.cjs.js"),J=require("../../store/dist/esm/store.cjs.js");let Q=0;function D(){return`hotkey_${++Q}`}var g,p,H,d,l,i,R,z,C,K,S,O,A,U,B,x=(g=class{constructor(){k(this,i);k(this,H);k(this,d,new Map);k(this,l,new Map);this.registrations=new J.Store(new Map),v(this,H,F.detectPlatform())}static getInstance(){return o(g,p)||v(g,p,new g),o(g,p)}static resetInstance(){o(g,p)&&(o(g,p).destroy(),v(g,p,null))}register(t,e,r={}){if(typeof document>"u"&&!r.target){let u=e;return{id:D(),unregister:()=>{},get callback(){return u},set callback(y){u=y},setOptions:()=>{},get isActive(){return!1}}}const s=D(),f=r.platform??o(this,H),n=typeof t=="string"?L.parseHotkey(t,f):L.rawHotkeyToParsedHotkey(t,f),b=typeof t=="string"?t:G.formatHotkey(n),h=r.target??document,N=r.conflictBehavior??"warn",E=c(this,i,U).call(this,b,h);E&&w.handleConflict(E.id,b,N,u=>c(this,i,R).call(this,u));const j=r.ignoreInputs??w.getDefaultIgnoreInputs(n),$={id:s,hotkey:b,parsedHotkey:n,callback:e,options:{...w.defaultHotkeyOptions,requireReset:!1,...r,platform:f,ignoreInputs:j},hasFired:!1,triggerCount:0,target:h};this.registrations.setState(u=>new Map(u).set(s,$)),o(this,l).has(h)||o(this,l).set(h,new Set),o(this,l).get(h).add(s),c(this,i,z).call(this,h);const m=this;return{get id(){return s},unregister:()=>{var u;c(u=m,i,R).call(u,s)},get callback(){var u;return((u=m.registrations.state.get(s))==null?void 0:u.callback)??e},set callback(u){const y=m.registrations.state.get(s);y&&(y.callback=u)},setOptions:u=>{m.registrations.setState(y=>{const M=y.get(s);if(M){const T=new Map(y);return T.set(s,{...M,options:{...M.options,...u}}),T}return y})},get isActive(){return m.registrations.state.has(s)}}}triggerRegistration(t){const e=this.registrations.state.get(t);if(!e)return!1;const r=e.parsedHotkey,s=new KeyboardEvent(e.options.eventType??"keydown",{key:r.key,ctrlKey:r.ctrl,shiftKey:r.shift,altKey:r.alt,metaKey:r.meta,bubbles:!0,cancelable:!0});return e.triggerCount++,this.registrations.setState(f=>new Map(f)),e.callback(s,{hotkey:e.hotkey,parsedHotkey:e.parsedHotkey}),!0}getRegistrationCount(){return this.registrations.state.size}isRegistered(t,e){for(const r of this.registrations.state.values())if(r.hotkey===t&&(e===void 0||r.target===e))return!0;return!1}destroy(){for(const t of o(this,d).keys())c(this,i,C).call(this,t);this.registrations.setState(()=>new Map),o(this,d).clear(),o(this,l).clear()}},p=new WeakMap,H=new WeakMap,d=new WeakMap,l=new WeakMap,i=new WeakSet,R=function(t){const e=this.registrations.state.get(t);if(!e)return;const r=e.target;this.registrations.setState(f=>{const n=new Map(f);return n.delete(t),n});const s=o(this,l).get(r);s&&(s.delete(t),s.size===0&&c(this,i,C).call(this,r))},z=function(t){if(typeof document>"u"||o(this,d).has(t))return;const e=c(this,i,O).call(this,t),r=c(this,i,A).call(this,t);t.addEventListener("keydown",e),t.addEventListener("keyup",r),o(this,d).set(t,{keydown:e,keyup:r})},C=function(t){if(typeof document>"u")return;const e=o(this,d).get(t);e&&(t.removeEventListener("keydown",e.keydown),t.removeEventListener("keyup",e.keyup),o(this,d).delete(t),o(this,l).delete(t))},K=function(t,e,r){const s=o(this,l).get(e);if(s)for(const f of s){const n=this.registrations.state.get(f);if(n&&w.isEventForTarget(t,e)&&n.options.enabled&&!(n.options.ignoreInputs!==!1&&w.shouldIgnoreInputEvent(t,e,n.target)))if(r==="keydown"){if(n.options.eventType!=="keydown")continue;P.matchesKeyboardEvent(t,n.parsedHotkey,n.options.platform)&&(n.options.preventDefault&&t.preventDefault(),n.options.stopPropagation&&t.stopPropagation(),(!n.options.requireReset||!n.hasFired)&&(c(this,i,S).call(this,n,t),n.options.requireReset&&(n.hasFired=!0)))}else n.options.eventType==="keyup"&&P.matchesKeyboardEvent(t,n.parsedHotkey,n.options.platform)&&c(this,i,S).call(this,n,t),n.options.requireReset&&n.hasFired&&c(this,i,B).call(this,n,t)&&(n.hasFired=!1)}},S=function(t,e){t.options.preventDefault&&e.preventDefault(),t.options.stopPropagation&&e.stopPropagation(),t.triggerCount++,this.registrations.setState(s=>new Map(s));const r={hotkey:t.hotkey,parsedHotkey:t.parsedHotkey};t.callback(e,r)},O=function(t){return e=>{c(this,i,K).call(this,e,t,"keydown")}},A=function(t){return e=>{c(this,i,K).call(this,e,t,"keyup")}},U=function(t,e){for(const r of this.registrations.state.values())if(r.hotkey===t&&r.target===e)return r;return null},B=function(t,e){const r=t.parsedHotkey,s=F.normalizeKeyName(e.key),f=r.key.length===1?r.key.toUpperCase():r.key;return!!((s.length===1?s.toUpperCase():s)===f||r.ctrl&&s==="Control"||r.shift&&s==="Shift"||r.alt&&s==="Alt"||r.meta&&s==="Meta")},k(g,p,null),g);function V(){return x.getInstance()}exports.HotkeyManager=x;exports.getHotkeyManager=V;
|