@bigbinary/neeto-commons-frontend 3.1.13 → 3.1.15
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/cjs/configs/nanos/webpack/resolve.js +15 -10
- package/cjs/react-utils/index.js +0 -8
- package/cjs/react-utils/index.js.map +1 -1
- package/configs/nanos/webpack/resolve.js +15 -10
- package/package.json +1 -3
- package/react-utils/index.js +0 -1
- package/react-utils/index.js.map +1 -1
- package/react-utils.d.ts +0 -47
- package/cjs/react-utils/useHotKeys/constants.js +0 -36
- package/cjs/react-utils/useHotKeys/constants.js.map +0 -1
- package/cjs/react-utils/useHotKeys/index.js +0 -14
- package/cjs/react-utils/useHotKeys/index.js.map +0 -1
- package/cjs/react-utils/useHotKeys/useHotKeys.js +0 -65
- package/cjs/react-utils/useHotKeys/useHotKeys.js.map +0 -1
- package/cjs/react-utils/useHotKeys/utils.js +0 -37
- package/cjs/react-utils/useHotKeys/utils.js.map +0 -1
- package/react-utils/useHotKeys/constants.js +0 -25
- package/react-utils/useHotKeys/constants.js.map +0 -1
- package/react-utils/useHotKeys/index.js +0 -1
- package/react-utils/useHotKeys/index.js.map +0 -1
- package/react-utils/useHotKeys/useHotKeys.js +0 -57
- package/react-utils/useHotKeys/useHotKeys.js.map +0 -1
- package/react-utils/useHotKeys/utils.js +0 -29
- package/react-utils/useHotKeys/utils.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
1
2
|
const path = require("path");
|
|
2
3
|
|
|
3
4
|
const isCommonsFrontend = !__dirname.includes("node_modules");
|
|
@@ -7,18 +8,22 @@ const absolutePath = basePath =>
|
|
|
7
8
|
? path.join(__dirname, "../../../", basePath)
|
|
8
9
|
: path.join(__dirname, "../../../../../../", basePath);
|
|
9
10
|
|
|
11
|
+
const srcPath = fs.existsSync(absolutePath("src"))
|
|
12
|
+
? absolutePath("src")
|
|
13
|
+
: absolutePath("app/javascript/src");
|
|
14
|
+
|
|
10
15
|
module.exports = {
|
|
11
16
|
alias: {
|
|
12
|
-
apis:
|
|
13
|
-
assets:
|
|
14
|
-
components:
|
|
15
|
-
hooks:
|
|
16
|
-
reducers:
|
|
17
|
-
routes:
|
|
18
|
-
stores:
|
|
19
|
-
translations:
|
|
20
|
-
utils:
|
|
21
|
-
src:
|
|
17
|
+
apis: `${srcPath}/apis`,
|
|
18
|
+
assets: `${srcPath}/assets`,
|
|
19
|
+
components: `${srcPath}/components`,
|
|
20
|
+
hooks: `${srcPath}/hooks`,
|
|
21
|
+
reducers: `${srcPath}/reducers`,
|
|
22
|
+
routes: `${srcPath}/routes`,
|
|
23
|
+
stores: `${srcPath}/stores`,
|
|
24
|
+
translations: `${srcPath}/translations`,
|
|
25
|
+
utils: `${srcPath}/utils`,
|
|
26
|
+
src: srcPath,
|
|
22
27
|
neetoui: "@bigbinary/neetoui",
|
|
23
28
|
neetocommons: "@bigbinary/neeto-commons-frontend",
|
|
24
29
|
neetoicons: "@bigbinary/neeto-icons",
|
package/cjs/react-utils/index.js
CHANGED
|
@@ -13,7 +13,6 @@ var _exportNames = {
|
|
|
13
13
|
useFetchNeetoApps: true,
|
|
14
14
|
useFieldSubmit: true,
|
|
15
15
|
useFuncDebounce: true,
|
|
16
|
-
useHotKeys: true,
|
|
17
16
|
useIsElementVisibleInDom: true,
|
|
18
17
|
useKeyboardShortcutsPaneState: true,
|
|
19
18
|
useLocalStorage: true,
|
|
@@ -79,12 +78,6 @@ Object.defineProperty(exports, "useFuncDebounce", {
|
|
|
79
78
|
return _useFuncDebounce["default"];
|
|
80
79
|
}
|
|
81
80
|
});
|
|
82
|
-
Object.defineProperty(exports, "useHotKeys", {
|
|
83
|
-
enumerable: true,
|
|
84
|
-
get: function get() {
|
|
85
|
-
return _useHotKeys["default"];
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
81
|
Object.defineProperty(exports, "useIsElementVisibleInDom", {
|
|
89
82
|
enumerable: true,
|
|
90
83
|
get: function get() {
|
|
@@ -193,7 +186,6 @@ Object.keys(_useDisplayErrorPage).forEach(function (key) {
|
|
|
193
186
|
var _useFetchNeetoApps = _interopRequireDefault(require("./useFetchNeetoApps"));
|
|
194
187
|
var _useFieldSubmit = _interopRequireDefault(require("./useFieldSubmit"));
|
|
195
188
|
var _useFuncDebounce = _interopRequireDefault(require("./useFuncDebounce"));
|
|
196
|
-
var _useHotKeys = _interopRequireDefault(require("./useHotKeys"));
|
|
197
189
|
var _useIsElementVisibleInDom = _interopRequireDefault(require("./useIsElementVisibleInDom"));
|
|
198
190
|
var _useKeyboardShortcutsPaneState = _interopRequireDefault(require("./useKeyboardShortcutsPaneState"));
|
|
199
191
|
var _useLocalStorage = _interopRequireDefault(require("./useLocalStorage"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_HoneybadgerErrorBoundary","_interopRequireDefault","require","_PrivateRoute","_useDebounce","_useDisplayErrorPage","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_useFetchNeetoApps","_useFieldSubmit","_useFuncDebounce","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_HoneybadgerErrorBoundary","_interopRequireDefault","require","_PrivateRoute","_useDebounce","_useDisplayErrorPage","_interopRequireWildcard","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_useFetchNeetoApps","_useFieldSubmit","_useFuncDebounce","_useIsElementVisibleInDom","_useKeyboardShortcutsPaneState","_useLocalStorage","_useMutationWithInvalidation","_useOnClickOutside","_usePersistedQuery","_usePrevious","_useQueryParams","_useRegisterNavigationCheckpoint","_useStateWithDependency","_useTimer","_useUpdateEffect","_useBreakpoints","_BrowserPushNotifications","_metaClick","_withImmutableActions","_withT","_withTitle","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","newObj","hasPropertyDescriptor","getOwnPropertyDescriptor","desc","set"],"sources":["../../../src/react-utils/index.js"],"sourcesContent":["// components\nexport { default as HoneybadgerErrorBoundary } from \"./HoneybadgerErrorBoundary\";\nexport { default as PrivateRoute } from \"./PrivateRoute\";\n\n// hooks\nexport { default as useDebounce } from \"./useDebounce\";\nexport * from \"./useDisplayErrorPage\";\nexport { default as useDisplayErrorPage } from \"./useDisplayErrorPage\";\nexport { default as useFetchNeetoApps } from \"./useFetchNeetoApps\";\nexport { default as useFieldSubmit } from \"./useFieldSubmit\";\nexport { default as useFuncDebounce } from \"./useFuncDebounce\";\nexport { default as useIsElementVisibleInDom } from \"./useIsElementVisibleInDom\";\nexport { default as useKeyboardShortcutsPaneState } from \"./useKeyboardShortcutsPaneState\";\nexport { default as useLocalStorage } from \"./useLocalStorage\";\nexport { default as useMutationWithInvalidation } from \"./useMutationWithInvalidation\";\nexport { default as useOnClickOutside } from \"./useOnClickOutside\";\nexport { default as usePersistedQuery } from \"./usePersistedQuery\";\nexport { default as usePrevious } from \"./usePrevious\";\nexport { default as useQueryParams } from \"./useQueryParams\";\nexport * from \"./useRegisterNavigationCheckpoint\";\nexport { default as useRegisterNavigationCheckpoint } from \"./useRegisterNavigationCheckpoint\";\nexport { default as useStateWithDependency } from \"./useStateWithDependency\";\nexport { default as useTimer } from \"./useTimer\";\nexport { default as useUpdateEffect } from \"./useUpdateEffect\";\nexport { default as useBreakpoints } from \"./useBreakpoints\";\n\n// utils\nexport * from \"./BrowserPushNotifications\";\nexport * from \"./metaClick\";\nexport { default as withImmutableActions } from \"./withImmutableActions\";\nexport { default as withT } from \"./withT\";\nexport { default as withTitle } from \"./withTitle\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,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AnC,GAAA,IAAAmC,IAAA,CAAAC,GAAA,KAAA/C,MAAA,CAAAS,cAAA,CAAAkC,MAAA,EAAAxC,GAAA,EAAA2C,IAAA,YAAAH,MAAA,CAAAxC,GAAA,IAAAmC,GAAA,CAAAnC,GAAA,SAAAwC,MAAA,cAAAL,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAM,GAAA,CAAAT,GAAA,EAAAK,MAAA,YAAAA,MAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
1
2
|
const path = require("path");
|
|
2
3
|
|
|
3
4
|
const isCommonsFrontend = !__dirname.includes("node_modules");
|
|
@@ -7,18 +8,22 @@ const absolutePath = basePath =>
|
|
|
7
8
|
? path.join(__dirname, "../../../", basePath)
|
|
8
9
|
: path.join(__dirname, "../../../../../../", basePath);
|
|
9
10
|
|
|
11
|
+
const srcPath = fs.existsSync(absolutePath("src"))
|
|
12
|
+
? absolutePath("src")
|
|
13
|
+
: absolutePath("app/javascript/src");
|
|
14
|
+
|
|
10
15
|
module.exports = {
|
|
11
16
|
alias: {
|
|
12
|
-
apis:
|
|
13
|
-
assets:
|
|
14
|
-
components:
|
|
15
|
-
hooks:
|
|
16
|
-
reducers:
|
|
17
|
-
routes:
|
|
18
|
-
stores:
|
|
19
|
-
translations:
|
|
20
|
-
utils:
|
|
21
|
-
src:
|
|
17
|
+
apis: `${srcPath}/apis`,
|
|
18
|
+
assets: `${srcPath}/assets`,
|
|
19
|
+
components: `${srcPath}/components`,
|
|
20
|
+
hooks: `${srcPath}/hooks`,
|
|
21
|
+
reducers: `${srcPath}/reducers`,
|
|
22
|
+
routes: `${srcPath}/routes`,
|
|
23
|
+
stores: `${srcPath}/stores`,
|
|
24
|
+
translations: `${srcPath}/translations`,
|
|
25
|
+
utils: `${srcPath}/utils`,
|
|
26
|
+
src: srcPath,
|
|
22
27
|
neetoui: "@bigbinary/neetoui",
|
|
23
28
|
neetocommons: "@bigbinary/neeto-commons-frontend",
|
|
24
29
|
neetoicons: "@bigbinary/neeto-icons",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bigbinary/neeto-commons-frontend",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.15",
|
|
4
4
|
"description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
|
|
5
5
|
"repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
|
|
6
6
|
"author": "Amaljith K <amaljith.k@bigbinary.com>",
|
|
@@ -59,8 +59,6 @@
|
|
|
59
59
|
"dompurify": "3.0.3",
|
|
60
60
|
"i18next-browser-languagedetector": "^7.1.0",
|
|
61
61
|
"immer": "^10.0.2",
|
|
62
|
-
"mousetrap": "^1.6.5",
|
|
63
|
-
"mousetrap-global-bind": "^1.1.0",
|
|
64
62
|
"platform": "1.3.6",
|
|
65
63
|
"qs": "^6.11.0",
|
|
66
64
|
"util": "^0.12.5",
|
package/react-utils/index.js
CHANGED
|
@@ -9,7 +9,6 @@ export { default as useDisplayErrorPage } from "./useDisplayErrorPage";
|
|
|
9
9
|
export { default as useFetchNeetoApps } from "./useFetchNeetoApps";
|
|
10
10
|
export { default as useFieldSubmit } from "./useFieldSubmit";
|
|
11
11
|
export { default as useFuncDebounce } from "./useFuncDebounce";
|
|
12
|
-
export { default as useHotKeys } from "./useHotKeys";
|
|
13
12
|
export { default as useIsElementVisibleInDom } from "./useIsElementVisibleInDom";
|
|
14
13
|
export { default as useKeyboardShortcutsPaneState } from "./useKeyboardShortcutsPaneState";
|
|
15
14
|
export { default as useLocalStorage } from "./useLocalStorage";
|
package/react-utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","HoneybadgerErrorBoundary","PrivateRoute","useDebounce","useDisplayErrorPage","useFetchNeetoApps","useFieldSubmit","useFuncDebounce","
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","HoneybadgerErrorBoundary","PrivateRoute","useDebounce","useDisplayErrorPage","useFetchNeetoApps","useFieldSubmit","useFuncDebounce","useIsElementVisibleInDom","useKeyboardShortcutsPaneState","useLocalStorage","useMutationWithInvalidation","useOnClickOutside","usePersistedQuery","usePrevious","useQueryParams","useRegisterNavigationCheckpoint","useStateWithDependency","useTimer","useUpdateEffect","useBreakpoints","withImmutableActions","withT","withTitle"],"sources":["../../src/react-utils/index.js"],"sourcesContent":["// components\nexport { default as HoneybadgerErrorBoundary } from \"./HoneybadgerErrorBoundary\";\nexport { default as PrivateRoute } from \"./PrivateRoute\";\n\n// hooks\nexport { default as useDebounce } from \"./useDebounce\";\nexport * from \"./useDisplayErrorPage\";\nexport { default as useDisplayErrorPage } from \"./useDisplayErrorPage\";\nexport { default as useFetchNeetoApps } from \"./useFetchNeetoApps\";\nexport { default as useFieldSubmit } from \"./useFieldSubmit\";\nexport { default as useFuncDebounce } from \"./useFuncDebounce\";\nexport { default as useIsElementVisibleInDom } from \"./useIsElementVisibleInDom\";\nexport { default as useKeyboardShortcutsPaneState } from \"./useKeyboardShortcutsPaneState\";\nexport { default as useLocalStorage } from \"./useLocalStorage\";\nexport { default as useMutationWithInvalidation } from \"./useMutationWithInvalidation\";\nexport { default as useOnClickOutside } from \"./useOnClickOutside\";\nexport { default as usePersistedQuery } from \"./usePersistedQuery\";\nexport { default as usePrevious } from \"./usePrevious\";\nexport { default as useQueryParams } from \"./useQueryParams\";\nexport * from \"./useRegisterNavigationCheckpoint\";\nexport { default as useRegisterNavigationCheckpoint } from \"./useRegisterNavigationCheckpoint\";\nexport { default as useStateWithDependency } from \"./useStateWithDependency\";\nexport { default as useTimer } from \"./useTimer\";\nexport { default as useUpdateEffect } from \"./useUpdateEffect\";\nexport { default as useBreakpoints } from \"./useBreakpoints\";\n\n// utils\nexport * from \"./BrowserPushNotifications\";\nexport * from \"./metaClick\";\nexport { default as withImmutableActions } from \"./withImmutableActions\";\nexport { default as withT } from \"./withT\";\nexport { default as withTitle } from \"./withTitle\";\n"],"mappings":"AAAA;AACA,SAASA,OAAO,IAAIC,wBAAwB;AAC5C,SAASD,OAAO,IAAIE,YAAY;;AAEhC;AACA,SAASF,OAAO,IAAIG,WAAW;AAC/B;AACA,SAASH,OAAO,IAAII,mBAAmB;AACvC,SAASJ,OAAO,IAAIK,iBAAiB;AACrC,SAASL,OAAO,IAAIM,cAAc;AAClC,SAASN,OAAO,IAAIO,eAAe;AACnC,SAASP,OAAO,IAAIQ,wBAAwB;AAC5C,SAASR,OAAO,IAAIS,6BAA6B;AACjD,SAAST,OAAO,IAAIU,eAAe;AACnC,SAASV,OAAO,IAAIW,2BAA2B;AAC/C,SAASX,OAAO,IAAIY,iBAAiB;AACrC,SAASZ,OAAO,IAAIa,iBAAiB;AACrC,SAASb,OAAO,IAAIc,WAAW;AAC/B,SAASd,OAAO,IAAIe,cAAc;AAClC;AACA,SAASf,OAAO,IAAIgB,+BAA+B;AACnD,SAAShB,OAAO,IAAIiB,sBAAsB;AAC1C,SAASjB,OAAO,IAAIkB,QAAQ;AAC5B,SAASlB,OAAO,IAAImB,eAAe;AACnC,SAASnB,OAAO,IAAIoB,cAAc;;AAElC;AACA;AACA;AACA,SAASpB,OAAO,IAAIqB,oBAAoB;AACxC,SAASrB,OAAO,IAAIsB,KAAK;AACzB,SAAStB,OAAO,IAAIuB,SAAS"}
|
package/react-utils.d.ts
CHANGED
|
@@ -933,53 +933,6 @@ export function handleMetaClick(history: History): (params: string | object, eve
|
|
|
933
933
|
* @endexample
|
|
934
934
|
*/
|
|
935
935
|
export function isMetaKeyPressed(event: React.MouseEvent<HTMLElement, MouseEvent>): boolean;
|
|
936
|
-
type ConfigType = {
|
|
937
|
-
mode?: "default" | "global" | "scoped";
|
|
938
|
-
unbindOnUnmount?: boolean;
|
|
939
|
-
enabled?: boolean;
|
|
940
|
-
};
|
|
941
|
-
/**
|
|
942
|
-
*
|
|
943
|
-
* The useHotKeys hook is a versatile utility for handling hotkeys in an
|
|
944
|
-
*
|
|
945
|
-
* application. It allows you to define specific hotkey combinations and associate
|
|
946
|
-
*
|
|
947
|
-
* them with handler functions. When the user presses the configured hotkey(s), the
|
|
948
|
-
*
|
|
949
|
-
* corresponding handler is invoked, enabling you to perform actions in response to
|
|
950
|
-
*
|
|
951
|
-
* keyboard input.
|
|
952
|
-
*
|
|
953
|
-
* Following illustrates the usage of useHotKeys in implementing shortcut for
|
|
954
|
-
*
|
|
955
|
-
* Sidebar opening.
|
|
956
|
-
*
|
|
957
|
-
* @example
|
|
958
|
-
*
|
|
959
|
-
* import { useHotKeys } from "@bigbinary/neeto-commons-frontend/react-utils";
|
|
960
|
-
*
|
|
961
|
-
* // openSidebar function will only be called if the user is focused inside the textarea and performs the key combination.
|
|
962
|
-
* const ref = useHotKeys("command+shift+r", openSidebar, {
|
|
963
|
-
* mode: "scoped",
|
|
964
|
-
* });
|
|
965
|
-
*
|
|
966
|
-
* return (
|
|
967
|
-
* <div>
|
|
968
|
-
* <div>Hello world</div>
|
|
969
|
-
* <textarea ref={ref}></textarea>
|
|
970
|
-
* </div>
|
|
971
|
-
* );
|
|
972
|
-
* @endexample
|
|
973
|
-
* Hotkeys are a fundamental aspect of many applications, enhancing user efficiency
|
|
974
|
-
*
|
|
975
|
-
* and interactivity. The useHotKeys hook simplifies the implementation of these
|
|
976
|
-
*
|
|
977
|
-
* hotkeys by allowing you to specify the hotkey combinations in various formats,
|
|
978
|
-
*
|
|
979
|
-
* associated handlers, and configuration options.
|
|
980
|
-
*
|
|
981
|
-
*/
|
|
982
|
-
export function useHotKeys(hotkey: string | string[], handler: (event: React.KeyboardEvent) => void, config?: ConfigType): React.MutableRefObject | null;
|
|
983
936
|
/**
|
|
984
937
|
*
|
|
985
938
|
* The useStateWithDependency hook is a utility that returns a state variable and
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.OS = exports.MODES = exports.MAC_TO_WINDOWS_KEYS_MAP = exports.KEY_NAMES = exports.DEFAULT_CONFIG = void 0;
|
|
7
|
-
var MODES = {
|
|
8
|
-
"default": "default",
|
|
9
|
-
global: "global",
|
|
10
|
-
scoped: "scoped"
|
|
11
|
-
};
|
|
12
|
-
exports.MODES = MODES;
|
|
13
|
-
var DEFAULT_CONFIG = {
|
|
14
|
-
mode: MODES["default"],
|
|
15
|
-
unbindOnUnmount: true,
|
|
16
|
-
enabled: true
|
|
17
|
-
};
|
|
18
|
-
exports.DEFAULT_CONFIG = DEFAULT_CONFIG;
|
|
19
|
-
var MAC_TO_WINDOWS_KEYS_MAP = {
|
|
20
|
-
option: "alt",
|
|
21
|
-
command: "ctrl",
|
|
22
|
-
"return": "enter",
|
|
23
|
-
"delete": "backspace"
|
|
24
|
-
};
|
|
25
|
-
exports.MAC_TO_WINDOWS_KEYS_MAP = MAC_TO_WINDOWS_KEYS_MAP;
|
|
26
|
-
var OS = {
|
|
27
|
-
mac: "OS X",
|
|
28
|
-
windows: "Windows"
|
|
29
|
-
};
|
|
30
|
-
exports.OS = OS;
|
|
31
|
-
var KEY_NAMES = {
|
|
32
|
-
"delete": "delete",
|
|
33
|
-
backspace: "backspace"
|
|
34
|
-
};
|
|
35
|
-
exports.KEY_NAMES = KEY_NAMES;
|
|
36
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["MODES","global","scoped","exports","DEFAULT_CONFIG","mode","unbindOnUnmount","enabled","MAC_TO_WINDOWS_KEYS_MAP","option","command","OS","mac","windows","KEY_NAMES","backspace"],"sources":["../../../../src/react-utils/useHotKeys/constants.js"],"sourcesContent":["export const MODES = {\n default: \"default\",\n global: \"global\",\n scoped: \"scoped\",\n};\n\nexport const DEFAULT_CONFIG = {\n mode: MODES.default,\n unbindOnUnmount: true,\n enabled: true,\n};\n\nexport const MAC_TO_WINDOWS_KEYS_MAP = {\n option: \"alt\",\n command: \"ctrl\",\n return: \"enter\",\n delete: \"backspace\",\n};\n\nexport const OS = { mac: \"OS X\", windows: \"Windows\" };\n\nexport const KEY_NAMES = { delete: \"delete\", backspace: \"backspace\" };\n"],"mappings":";;;;;;AAAO,IAAMA,KAAK,GAAG;EACnB,WAAS,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACV,CAAC;AAACC,OAAA,CAAAH,KAAA,GAAAA,KAAA;AAEK,IAAMI,cAAc,GAAG;EAC5BC,IAAI,EAAEL,KAAK,WAAQ;EACnBM,eAAe,EAAE,IAAI;EACrBC,OAAO,EAAE;AACX,CAAC;AAACJ,OAAA,CAAAC,cAAA,GAAAA,cAAA;AAEK,IAAMI,uBAAuB,GAAG;EACrCC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAE,MAAM;EACf,UAAQ,OAAO;EACf,UAAQ;AACV,CAAC;AAACP,OAAA,CAAAK,uBAAA,GAAAA,uBAAA;AAEK,IAAMG,EAAE,GAAG;EAAEC,GAAG,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAU,CAAC;AAACV,OAAA,CAAAQ,EAAA,GAAAA,EAAA;AAE/C,IAAMG,SAAS,GAAG;EAAE,UAAQ,QAAQ;EAAEC,SAAS,EAAE;AAAY,CAAC;AAACZ,OAAA,CAAAW,SAAA,GAAAA,SAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
Object.defineProperty(exports, "default", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _useHotKeys["default"];
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
|
-
var _useHotKeys = _interopRequireDefault(require("./useHotKeys"));
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_useHotKeys","_interopRequireDefault","require"],"sources":["../../../../src/react-utils/useHotKeys/index.js"],"sourcesContent":["export { default } from \"./useHotKeys\";\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports["default"] = void 0;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _mousetrap = _interopRequireDefault(require("mousetrap"));
|
|
10
|
-
require("mousetrap-global-bind");
|
|
11
|
-
var _ramda = require("ramda");
|
|
12
|
-
var _constants = require("./constants");
|
|
13
|
-
var _utils = require("./utils");
|
|
14
|
-
var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
|
|
15
|
-
var ref = (0, _react.useRef)(null);
|
|
16
|
-
var convertedHotkey = (0, _utils.convertHotkeyToUsersPlatform)(hotkey);
|
|
17
|
-
var config = (0, _ramda.mergeLeft)(userConfig, _constants.DEFAULT_CONFIG);
|
|
18
|
-
if (!handler) {
|
|
19
|
-
throw new Error("You must provide a handler function to useHotKeys");
|
|
20
|
-
}
|
|
21
|
-
(0, _react.useEffect)(function () {
|
|
22
|
-
if (!config.enabled) return undefined;
|
|
23
|
-
var mousetrapInstance = bindHotKey({
|
|
24
|
-
mode: config.mode,
|
|
25
|
-
hotkey: convertedHotkey,
|
|
26
|
-
handler: handler,
|
|
27
|
-
ref: ref
|
|
28
|
-
});
|
|
29
|
-
return function () {
|
|
30
|
-
unBindHotKey({
|
|
31
|
-
mousetrapInstance: mousetrapInstance,
|
|
32
|
-
mode: config.mode,
|
|
33
|
-
hotkey: convertedHotkey
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
}, [handler, config.mode, convertedHotkey, config]);
|
|
37
|
-
return config.mode === _constants.MODES.scoped ? ref : null;
|
|
38
|
-
};
|
|
39
|
-
var bindHotKey = function bindHotKey(_ref) {
|
|
40
|
-
var mode = _ref.mode,
|
|
41
|
-
hotkey = _ref.hotkey,
|
|
42
|
-
handler = _ref.handler,
|
|
43
|
-
ref = _ref.ref;
|
|
44
|
-
var mousetrapInstance;
|
|
45
|
-
switch (mode) {
|
|
46
|
-
case _constants.MODES.global:
|
|
47
|
-
_mousetrap["default"].bindGlobal(hotkey, handler);
|
|
48
|
-
break;
|
|
49
|
-
case _constants.MODES.scoped:
|
|
50
|
-
mousetrapInstance = (0, _mousetrap["default"])(ref.current).bind(hotkey, handler);
|
|
51
|
-
break;
|
|
52
|
-
default:
|
|
53
|
-
mousetrapInstance = _mousetrap["default"].bind(hotkey, handler);
|
|
54
|
-
}
|
|
55
|
-
return mousetrapInstance;
|
|
56
|
-
};
|
|
57
|
-
var unBindHotKey = function unBindHotKey(_ref2) {
|
|
58
|
-
var mousetrapInstance = _ref2.mousetrapInstance,
|
|
59
|
-
mode = _ref2.mode,
|
|
60
|
-
hotkey = _ref2.hotkey;
|
|
61
|
-
return mode === _constants.MODES.global ? _mousetrap["default"].unbindGlobal(hotkey) : mousetrapInstance === null || mousetrapInstance === void 0 ? void 0 : mousetrapInstance.unbind(hotkey);
|
|
62
|
-
};
|
|
63
|
-
var _default = useHotKeys;
|
|
64
|
-
exports["default"] = _default;
|
|
65
|
-
//# sourceMappingURL=useHotKeys.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHotKeys.js","names":["_react","require","_mousetrap","_interopRequireDefault","_ramda","_constants","_utils","useHotKeys","hotkey","handler","userConfig","ref","useRef","convertedHotkey","convertHotkeyToUsersPlatform","config","mergeLeft","DEFAULT_CONFIG","Error","useEffect","enabled","undefined","mousetrapInstance","bindHotKey","mode","unBindHotKey","MODES","scoped","_ref","global","Mousetrap","bindGlobal","current","bind","_ref2","unbindGlobal","unbind","_default","exports"],"sources":["../../../../src/react-utils/useHotKeys/useHotKeys.js"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nimport Mousetrap from \"mousetrap\";\nimport \"mousetrap-global-bind\";\nimport { mergeLeft } from \"ramda\";\n\nimport { DEFAULT_CONFIG, MODES } from \"./constants\";\nimport { convertHotkeyToUsersPlatform } from \"./utils\";\n\nconst useHotKeys = (hotkey, handler, userConfig) => {\n const ref = useRef(null);\n const convertedHotkey = convertHotkeyToUsersPlatform(hotkey);\n const config = mergeLeft(userConfig, DEFAULT_CONFIG);\n\n if (!handler) {\n throw new Error(\"You must provide a handler function to useHotKeys\");\n }\n\n useEffect(() => {\n if (!config.enabled) return undefined;\n\n const mousetrapInstance = bindHotKey({\n mode: config.mode,\n hotkey: convertedHotkey,\n handler,\n ref,\n });\n\n return () => {\n unBindHotKey({\n mousetrapInstance,\n mode: config.mode,\n hotkey: convertedHotkey,\n });\n };\n }, [handler, config.mode, convertedHotkey, config]);\n\n return config.mode === MODES.scoped ? ref : null;\n};\n\nconst bindHotKey = ({ mode, hotkey, handler, ref }) => {\n let mousetrapInstance;\n\n switch (mode) {\n case MODES.global:\n Mousetrap.bindGlobal(hotkey, handler);\n break;\n case MODES.scoped:\n mousetrapInstance = Mousetrap(ref.current).bind(hotkey, handler);\n break;\n default:\n mousetrapInstance = Mousetrap.bind(hotkey, handler);\n }\n\n return mousetrapInstance;\n};\n\nconst unBindHotKey = ({ mousetrapInstance, mode, hotkey }) =>\n mode === MODES.global\n ? Mousetrap.unbindGlobal(hotkey)\n : mousetrapInstance?.unbind(hotkey);\n\nexport default useHotKeys;\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACAA,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA,IAAAI,UAAA,GAAAJ,OAAA;AAC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IAAIW,iBAAiB;EAErB,QAAQE,IAAI;IACV,KAAKE,gBAAK,CAACG,MAAM;MACfC,qBAAS,CAACC,UAAU,CAACvB,MAAM,EAAEC,OAAO,CAAC;MACrC;IACF,KAAKiB,gBAAK,CAACC,MAAM;MACfL,iBAAiB,GAAG,IAAAQ,qBAAS,EAACnB,GAAG,CAACqB,OAAO,CAAC,CAACC,IAAI,CAACzB,MAAM,EAAEC,OAAO,CAAC;MAChE;IACF;MACEa,iBAAiB,GAAGQ,qBAAS,CAACG,IAAI,CAACzB,MAAM,EAAEC,OAAO,CAAC;EAAC;EAGxD,OAAOa,iBAAiB;AAC1B,CAAC;AAED,IAAMG,YAAY,GAAG,SAAfA,YAAYA,CAAAS,KAAA;EAAA,IAAMZ,iBAAiB,GAAAY,KAAA,CAAjBZ,iBAAiB;IAAEE,IAAI,GAAAU,KAAA,CAAJV,IAAI;IAAEhB,MAAM,GAAA0B,KAAA,CAAN1B,MAAM;EAAA,OACrDgB,IAAI,KAAKE,gBAAK,CAACG,MAAM,GACjBC,qBAAS,CAACK,YAAY,CAAC3B,MAAM,CAAC,GAC9Bc,iBAAiB,aAAjBA,iBAAiB,uBAAjBA,iBAAiB,CAAEc,MAAM,CAAC5B,MAAM,CAAC;AAAA;AAAC,IAAA6B,QAAA,GAEzB9B,UAAU;AAAA+B,OAAA,cAAAD,QAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.convertHotkeyToUsersPlatform = void 0;
|
|
8
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
-
var _platform = _interopRequireDefault(require("platform"));
|
|
10
|
-
var _ramda = require("ramda");
|
|
11
|
-
var _constants = require("./constants");
|
|
12
|
-
var isMultipleHotkey = function isMultipleHotkey(hotkey) {
|
|
13
|
-
return Array.isArray(hotkey);
|
|
14
|
-
};
|
|
15
|
-
var replaceKeys = function replaceKeys(hotkey, keyName, replaceWith) {
|
|
16
|
-
return isMultipleHotkey(hotkey) ? hotkey.map(function (item) {
|
|
17
|
-
return item.replaceAll(keyName, replaceWith);
|
|
18
|
-
}) : hotkey.replaceAll(keyName, replaceWith);
|
|
19
|
-
};
|
|
20
|
-
var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
|
|
21
|
-
(0, _ramda.toPairs)(_constants.MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
|
|
22
|
-
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
23
|
-
macKey = _ref2[0],
|
|
24
|
-
windowsKey = _ref2[1];
|
|
25
|
-
hotkey = replaceKeys(hotkey, macKey, windowsKey);
|
|
26
|
-
});
|
|
27
|
-
return hotkey;
|
|
28
|
-
};
|
|
29
|
-
var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
|
|
30
|
-
var _platformInfo$os, _platformInfo$os$fami;
|
|
31
|
-
var platformInfo = _platform["default"].parse(navigator.userAgent);
|
|
32
|
-
var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(_constants.OS.mac);
|
|
33
|
-
if (isOSX) return replaceKeys(hotkey, _constants.KEY_NAMES["delete"], _constants.KEY_NAMES.backspace);
|
|
34
|
-
return convertHotKeyToWindows(hotkey);
|
|
35
|
-
};
|
|
36
|
-
exports.convertHotkeyToUsersPlatform = convertHotkeyToUsersPlatform;
|
|
37
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["_platform","_interopRequireDefault","require","_ramda","_constants","isMultipleHotkey","hotkey","Array","isArray","replaceKeys","keyName","replaceWith","map","item","replaceAll","convertHotKeyToWindows","toPairs","MAC_TO_WINDOWS_KEYS_MAP","forEach","_ref","_ref2","_slicedToArray2","macKey","windowsKey","convertHotkeyToUsersPlatform","_platformInfo$os","_platformInfo$os$fami","platformInfo","platform","parse","navigator","userAgent","isOSX","os","family","includes","OS","mac","KEY_NAMES","backspace","exports"],"sources":["../../../../src/react-utils/useHotKeys/utils.js"],"sourcesContent":["import platform from \"platform\";\nimport { toPairs } from \"ramda\";\n\nimport { MAC_TO_WINDOWS_KEYS_MAP, OS, KEY_NAMES } from \"./constants\";\n\nconst isMultipleHotkey = hotkey => Array.isArray(hotkey);\n\nconst replaceKeys = (hotkey, keyName, replaceWith) =>\n isMultipleHotkey(hotkey)\n ? hotkey.map(item => item.replaceAll(keyName, replaceWith))\n : hotkey.replaceAll(keyName, replaceWith);\n\nconst convertHotKeyToWindows = hotkey => {\n toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(([macKey, windowsKey]) => {\n hotkey = replaceKeys(hotkey, macKey, windowsKey);\n });\n\n return hotkey;\n};\n\nexport const convertHotkeyToUsersPlatform = hotkey => {\n const platformInfo = platform.parse(navigator.userAgent);\n const isOSX = platformInfo.os?.family?.includes(OS.mac);\n if (isOSX) return replaceKeys(hotkey, KEY_NAMES.delete, KEY_NAMES.backspace);\n\n return convertHotKeyToWindows(hotkey);\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAEA,IAAMG,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAGC,MAAM;EAAA,OAAIC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC;AAAA;AAExD,IAAMG,WAAW,GAAG,SAAdA,WAAWA,CAAIH,MAAM,EAAEI,OAAO,EAAEC,WAAW;EAAA,OAC/CN,gBAAgB,CAACC,MAAM,CAAC,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-
scoped: "scoped"
|
|
5
|
-
};
|
|
6
|
-
export var DEFAULT_CONFIG = {
|
|
7
|
-
mode: MODES["default"],
|
|
8
|
-
unbindOnUnmount: true,
|
|
9
|
-
enabled: true
|
|
10
|
-
};
|
|
11
|
-
export var MAC_TO_WINDOWS_KEYS_MAP = {
|
|
12
|
-
option: "alt",
|
|
13
|
-
command: "ctrl",
|
|
14
|
-
"return": "enter",
|
|
15
|
-
"delete": "backspace"
|
|
16
|
-
};
|
|
17
|
-
export var OS = {
|
|
18
|
-
mac: "OS X",
|
|
19
|
-
windows: "Windows"
|
|
20
|
-
};
|
|
21
|
-
export var KEY_NAMES = {
|
|
22
|
-
"delete": "delete",
|
|
23
|
-
backspace: "backspace"
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","names":["MODES","global","scoped","DEFAULT_CONFIG","mode","unbindOnUnmount","enabled","MAC_TO_WINDOWS_KEYS_MAP","option","command","OS","mac","windows","KEY_NAMES","backspace"],"sources":["../../../src/react-utils/useHotKeys/constants.js"],"sourcesContent":["export const MODES = {\n default: \"default\",\n global: \"global\",\n scoped: \"scoped\",\n};\n\nexport const DEFAULT_CONFIG = {\n mode: MODES.default,\n unbindOnUnmount: true,\n enabled: true,\n};\n\nexport const MAC_TO_WINDOWS_KEYS_MAP = {\n option: \"alt\",\n command: \"ctrl\",\n return: \"enter\",\n delete: \"backspace\",\n};\n\nexport const OS = { mac: \"OS X\", windows: \"Windows\" };\n\nexport const KEY_NAMES = { delete: \"delete\", backspace: \"backspace\" };\n"],"mappings":"AAAA,OAAO,IAAMA,KAAK,GAAG;EACnB,WAAS,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE;AACV,CAAC;AAED,OAAO,IAAMC,cAAc,GAAG;EAC5BC,IAAI,EAAEJ,KAAK,WAAQ;EACnBK,eAAe,EAAE,IAAI;EACrBC,OAAO,EAAE;AACX,CAAC;AAED,OAAO,IAAMC,uBAAuB,GAAG;EACrCC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAE,MAAM;EACf,UAAQ,OAAO;EACf,UAAQ;AACV,CAAC;AAED,OAAO,IAAMC,EAAE,GAAG;EAAEC,GAAG,EAAE,MAAM;EAAEC,OAAO,EAAE;AAAU,CAAC;AAErD,OAAO,IAAMC,SAAS,GAAG;EAAE,UAAQ,QAAQ;EAAEC,SAAS,EAAE;AAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./useHotKeys";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default"],"sources":["../../../src/react-utils/useHotKeys/index.js"],"sourcesContent":["export { default } from \"./useHotKeys\";\n"],"mappings":"AAAA,SAASA,OAAO"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from "react";
|
|
2
|
-
import Mousetrap from "mousetrap";
|
|
3
|
-
import "mousetrap-global-bind";
|
|
4
|
-
import { mergeLeft } from "ramda";
|
|
5
|
-
import { DEFAULT_CONFIG, MODES } from "./constants";
|
|
6
|
-
import { convertHotkeyToUsersPlatform } from "./utils";
|
|
7
|
-
var useHotKeys = function useHotKeys(hotkey, handler, userConfig) {
|
|
8
|
-
var ref = useRef(null);
|
|
9
|
-
var convertedHotkey = convertHotkeyToUsersPlatform(hotkey);
|
|
10
|
-
var config = mergeLeft(userConfig, DEFAULT_CONFIG);
|
|
11
|
-
if (!handler) {
|
|
12
|
-
throw new Error("You must provide a handler function to useHotKeys");
|
|
13
|
-
}
|
|
14
|
-
useEffect(function () {
|
|
15
|
-
if (!config.enabled) return undefined;
|
|
16
|
-
var mousetrapInstance = bindHotKey({
|
|
17
|
-
mode: config.mode,
|
|
18
|
-
hotkey: convertedHotkey,
|
|
19
|
-
handler: handler,
|
|
20
|
-
ref: ref
|
|
21
|
-
});
|
|
22
|
-
return function () {
|
|
23
|
-
unBindHotKey({
|
|
24
|
-
mousetrapInstance: mousetrapInstance,
|
|
25
|
-
mode: config.mode,
|
|
26
|
-
hotkey: convertedHotkey
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
}, [handler, config.mode, convertedHotkey, config]);
|
|
30
|
-
return config.mode === MODES.scoped ? ref : null;
|
|
31
|
-
};
|
|
32
|
-
var bindHotKey = function bindHotKey(_ref) {
|
|
33
|
-
var mode = _ref.mode,
|
|
34
|
-
hotkey = _ref.hotkey,
|
|
35
|
-
handler = _ref.handler,
|
|
36
|
-
ref = _ref.ref;
|
|
37
|
-
var mousetrapInstance;
|
|
38
|
-
switch (mode) {
|
|
39
|
-
case MODES.global:
|
|
40
|
-
Mousetrap.bindGlobal(hotkey, handler);
|
|
41
|
-
break;
|
|
42
|
-
case MODES.scoped:
|
|
43
|
-
mousetrapInstance = Mousetrap(ref.current).bind(hotkey, handler);
|
|
44
|
-
break;
|
|
45
|
-
default:
|
|
46
|
-
mousetrapInstance = Mousetrap.bind(hotkey, handler);
|
|
47
|
-
}
|
|
48
|
-
return mousetrapInstance;
|
|
49
|
-
};
|
|
50
|
-
var unBindHotKey = function unBindHotKey(_ref2) {
|
|
51
|
-
var mousetrapInstance = _ref2.mousetrapInstance,
|
|
52
|
-
mode = _ref2.mode,
|
|
53
|
-
hotkey = _ref2.hotkey;
|
|
54
|
-
return mode === MODES.global ? Mousetrap.unbindGlobal(hotkey) : mousetrapInstance === null || mousetrapInstance === void 0 ? void 0 : mousetrapInstance.unbind(hotkey);
|
|
55
|
-
};
|
|
56
|
-
export default useHotKeys;
|
|
57
|
-
//# sourceMappingURL=useHotKeys.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHotKeys.js","names":["useEffect","useRef","Mousetrap","mergeLeft","DEFAULT_CONFIG","MODES","convertHotkeyToUsersPlatform","useHotKeys","hotkey","handler","userConfig","ref","convertedHotkey","config","Error","enabled","undefined","mousetrapInstance","bindHotKey","mode","unBindHotKey","scoped","_ref","global","bindGlobal","current","bind","_ref2","unbindGlobal","unbind"],"sources":["../../../src/react-utils/useHotKeys/useHotKeys.js"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nimport Mousetrap from \"mousetrap\";\nimport \"mousetrap-global-bind\";\nimport { mergeLeft } from \"ramda\";\n\nimport { DEFAULT_CONFIG, MODES } from \"./constants\";\nimport { convertHotkeyToUsersPlatform } from \"./utils\";\n\nconst useHotKeys = (hotkey, handler, userConfig) => {\n const ref = useRef(null);\n const convertedHotkey = convertHotkeyToUsersPlatform(hotkey);\n const config = mergeLeft(userConfig, DEFAULT_CONFIG);\n\n if (!handler) {\n throw new Error(\"You must provide a handler function to useHotKeys\");\n }\n\n useEffect(() => {\n if (!config.enabled) return undefined;\n\n const mousetrapInstance = bindHotKey({\n mode: config.mode,\n hotkey: convertedHotkey,\n handler,\n ref,\n });\n\n return () => {\n unBindHotKey({\n mousetrapInstance,\n mode: config.mode,\n hotkey: convertedHotkey,\n });\n };\n }, [handler, config.mode, convertedHotkey, config]);\n\n return config.mode === MODES.scoped ? ref : null;\n};\n\nconst bindHotKey = ({ mode, hotkey, handler, ref }) => {\n let mousetrapInstance;\n\n switch (mode) {\n case MODES.global:\n Mousetrap.bindGlobal(hotkey, handler);\n break;\n case MODES.scoped:\n mousetrapInstance = Mousetrap(ref.current).bind(hotkey, handler);\n break;\n default:\n mousetrapInstance = Mousetrap.bind(hotkey, handler);\n }\n\n return mousetrapInstance;\n};\n\nconst unBindHotKey = ({ mousetrapInstance, mode, hotkey }) =>\n mode === MODES.global\n ? Mousetrap.unbindGlobal(hotkey)\n : mousetrapInstance?.unbind(hotkey);\n\nexport default useHotKeys;\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAO,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,OAAO;AAEjC,SAASC,cAAc,EAAEC,KAAK;AAC9B,SAASC,4BAA4B;AA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AAS,CAACsB,UAAU,CAAChB,MAAM,EAAEC,OAAO,CAAC;MACrC;IACF,KAAKJ,KAAK,CAACgB,MAAM;MACfJ,iBAAiB,GAAGf,SAAS,CAACS,GAAG,CAACc,OAAO,CAAC,CAACC,IAAI,CAAClB,MAAM,EAAEC,OAAO,CAAC;MAChE;IACF;MACEQ,iBAAiB,GAAGf,SAAS,CAACwB,IAAI,CAAClB,MAAM,EAAEC,OAAO,CAAC;EAAC;EAGxD,OAAOQ,iBAAiB;AAC1B,CAAC;AAED,IAAMG,YAAY,GAAG,SAAfA,YAAYA,CAAAO,KAAA;EAAA,IAAMV,iBAAiB,GAAAU,KAAA,CAAjBV,iBAAiB;IAAEE,IAAI,GAAAQ,KAAA,CAAJR,IAAI;IAAEX,MAAM,GAAAmB,KAAA,CAANnB,MAAM;EAAA,OACrDW,IAAI,KAAKd,KAAK,CAACkB,MAAM,GACjBrB,SAAS,CAAC0B,YAAY,CAACpB,MAAM,CAAC,GAC9BS,iBAAiB,aAAjBA,iBAAiB,uBAAjBA,iBAAiB,CAAEY,MAAM,CAACrB,MAAM,CAAC;AAAA;AAEvC,eAAeD,UAAU"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import platform from "platform";
|
|
3
|
-
import { toPairs } from "ramda";
|
|
4
|
-
import { MAC_TO_WINDOWS_KEYS_MAP, OS, KEY_NAMES } from "./constants";
|
|
5
|
-
var isMultipleHotkey = function isMultipleHotkey(hotkey) {
|
|
6
|
-
return Array.isArray(hotkey);
|
|
7
|
-
};
|
|
8
|
-
var replaceKeys = function replaceKeys(hotkey, keyName, replaceWith) {
|
|
9
|
-
return isMultipleHotkey(hotkey) ? hotkey.map(function (item) {
|
|
10
|
-
return item.replaceAll(keyName, replaceWith);
|
|
11
|
-
}) : hotkey.replaceAll(keyName, replaceWith);
|
|
12
|
-
};
|
|
13
|
-
var convertHotKeyToWindows = function convertHotKeyToWindows(hotkey) {
|
|
14
|
-
toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(function (_ref) {
|
|
15
|
-
var _ref2 = _slicedToArray(_ref, 2),
|
|
16
|
-
macKey = _ref2[0],
|
|
17
|
-
windowsKey = _ref2[1];
|
|
18
|
-
hotkey = replaceKeys(hotkey, macKey, windowsKey);
|
|
19
|
-
});
|
|
20
|
-
return hotkey;
|
|
21
|
-
};
|
|
22
|
-
export var convertHotkeyToUsersPlatform = function convertHotkeyToUsersPlatform(hotkey) {
|
|
23
|
-
var _platformInfo$os, _platformInfo$os$fami;
|
|
24
|
-
var platformInfo = platform.parse(navigator.userAgent);
|
|
25
|
-
var isOSX = (_platformInfo$os = platformInfo.os) === null || _platformInfo$os === void 0 ? void 0 : (_platformInfo$os$fami = _platformInfo$os.family) === null || _platformInfo$os$fami === void 0 ? void 0 : _platformInfo$os$fami.includes(OS.mac);
|
|
26
|
-
if (isOSX) return replaceKeys(hotkey, KEY_NAMES["delete"], KEY_NAMES.backspace);
|
|
27
|
-
return convertHotKeyToWindows(hotkey);
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["platform","toPairs","MAC_TO_WINDOWS_KEYS_MAP","OS","KEY_NAMES","isMultipleHotkey","hotkey","Array","isArray","replaceKeys","keyName","replaceWith","map","item","replaceAll","convertHotKeyToWindows","forEach","_ref","_ref2","_slicedToArray","macKey","windowsKey","convertHotkeyToUsersPlatform","_platformInfo$os","_platformInfo$os$fami","platformInfo","parse","navigator","userAgent","isOSX","os","family","includes","mac","backspace"],"sources":["../../../src/react-utils/useHotKeys/utils.js"],"sourcesContent":["import platform from \"platform\";\nimport { toPairs } from \"ramda\";\n\nimport { MAC_TO_WINDOWS_KEYS_MAP, OS, KEY_NAMES } from \"./constants\";\n\nconst isMultipleHotkey = hotkey => Array.isArray(hotkey);\n\nconst replaceKeys = (hotkey, keyName, replaceWith) =>\n isMultipleHotkey(hotkey)\n ? hotkey.map(item => item.replaceAll(keyName, replaceWith))\n : hotkey.replaceAll(keyName, replaceWith);\n\nconst convertHotKeyToWindows = hotkey => {\n toPairs(MAC_TO_WINDOWS_KEYS_MAP).forEach(([macKey, windowsKey]) => {\n hotkey = replaceKeys(hotkey, macKey, windowsKey);\n });\n\n return hotkey;\n};\n\nexport const convertHotkeyToUsersPlatform = hotkey => {\n const platformInfo = platform.parse(navigator.userAgent);\n const isOSX = platformInfo.os?.family?.includes(OS.mac);\n if (isOSX) return replaceKeys(hotkey, KEY_NAMES.delete, KEY_NAMES.backspace);\n\n return convertHotKeyToWindows(hotkey);\n};\n"],"mappings":";AAAA,OAAOA,QAAQ,MAAM,UAAU;AAC/B,SAASC,OAAO,QAAQ,OAAO;AAE/B,SAASC,uBAAuB,EAAEC,EAAE,EAAEC,SAAS;AAE/C,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAGC,MAAM;EAAA,OAAIC,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC;AAAA;AAExD,IAAMG,WAAW,GAAG,SAAdA,WAAWA,CAAIH,MAAM,EAAEI,OAAO,EAAEC,WAAW;EAAA,OAC/CN,gBAAgB,CAACC,MAAM,CAAC,GACpBA,MAAM,CAACM,GAAG,CAAC,UAAAC,IAAI;IAAA,OAAIA,IAAI,CAACC,UAAU,CAACJ,OAAO,EAAEC,WAAW,CAAC;EAAA,EAAC,GACzDL,MAAM,CAACQ,UAAU,CAACJ,OAAO,EAAEC,WAAW,CAAC;AAAA;AAE7C,IAAMI,sBAAsB,GAAG,SAAzBA,sBAAsBA,CAAGT,MAAM,EAAI;EACvCL,OAAO,CAACC,uBAAuB,CAAC,CAACc,OAAO,CAAC,UAAAC,IAAA,EAA0B;IAAA,IAAAC,KAAA,GAAAC,cAAA,CAAAF,IAAA;MAAxBG,MAAM,GAAAF,KAAA;MAAEG,UAAU,GAAAH,KAAA;IAC3DZ,MAAM,GAAGG,WAAW,CAACH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