package.react-utils.useKeyboardShortcutsPaneState.useKeyboardShortcutsPaneState.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
{"version":3,"file":"useKeyboardShortcutsPaneState.js","names":["create","shallow","useKeyboardShortcutsStore","set","isOpen","setIsOpen","arg","state","useKeyboardShortcutsPaneState","_ref"],"sources":["../../../src/react-utils/useKeyboardShortcutsPaneState/useKeyboardShortcutsPaneState.js"],"sourcesContent":["import { create } from \"zustand\";\nimport { shallow } from \"zustand/shallow\";\n\nconst useKeyboardShortcutsStore = create(set => ({\n isOpen: false,\n\n setIsOpen: arg => {\n if (typeof arg === \"function\") {\n set(state => ({ isOpen: arg(state.isOpen) }));\n } else {\n set({ isOpen: arg });\n }\n },\n}));\n\nconst useKeyboardShortcutsPaneState = () =>\n useKeyboardShortcutsStore(\n ({ isOpen, setIsOpen }) => [isOpen, setIsOpen],\n shallow\n );\n\nexport default useKeyboardShortcutsPaneState;\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,SAAS;AAChC,SAASC,OAAO,QAAQ,iBAAiB;AAEzC,IAAMC,yBAAyB,GAAGF,MAAM,CAAC,UAAAG,GAAG;EAAA,OAAK;IAC/CC,MAAM,EAAE,KAAK;IAEbC,SAAS,EAAE,SAAAA,UAAAC,GAAG,EAAI;MAChB,IAAI,OAAOA,GAAG,KAAK,UAAU,EAAE;QAC7BH,GAAG,CAAC,UAAAI,KAAK;UAAA,OAAK;YAAEH,MAAM,EAAEE,GAAG,CAACC,KAAK,CAACH,MAAM;UAAE,CAAC;QAAA,CAAC,CAAC;MAC/C,CAAC,MAAM;QACLD,GAAG,CAAC;UAAEC,MAAM,EAAEE;QAAI,CAAC,CAAC;MACtB;IACF;EACF,CAAC;AAAA,CAAC,CAAC;AAEH,IAAME,6BAA6B,GAAG,SAAhCA,6BAA6BA,CAAA;EAAA,OACjCN,yBAAyB,CACvB,UAAAO,IAAA;IAAA,IAAGL,MAAM,GAAAK,IAAA,CAANL,MAAM;MAAEC,SAAS,GAAAI,IAAA,CAATJ,SAAS;IAAA,OAAO,CAACD,MAAM,EAAEC,SAAS,CAAC;EAAA,GAC9CJ,OAAO,CACR;AAAA;AAEH,eAAeO,6BAA6B"}