@mantine/spotlight 5.10.2 → 5.10.3
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/SpotlightProvider.js +5 -3
- package/cjs/SpotlightProvider.js.map +1 -1
- package/cjs/use-spotlight-shortcuts/use-spotlight-shortcuts.js +2 -2
- package/cjs/use-spotlight-shortcuts/use-spotlight-shortcuts.js.map +1 -1
- package/esm/SpotlightProvider.js +5 -3
- package/esm/SpotlightProvider.js.map +1 -1
- package/esm/use-spotlight-shortcuts/use-spotlight-shortcuts.js +2 -2
- package/esm/use-spotlight-shortcuts/use-spotlight-shortcuts.js.map +1 -1
- package/lib/SpotlightProvider.d.ts +3 -1
- package/lib/SpotlightProvider.d.ts.map +1 -1
- package/lib/use-spotlight-shortcuts/use-spotlight-shortcuts.d.ts +1 -1
- package/lib/use-spotlight-shortcuts/use-spotlight-shortcuts.d.ts.map +1 -1
- package/package.json +4 -4
package/cjs/SpotlightProvider.js
CHANGED
|
@@ -53,7 +53,8 @@ function SpotlightProvider(_a) {
|
|
|
53
53
|
cleanQueryOnClose = true,
|
|
54
54
|
transitionDuration = 150,
|
|
55
55
|
disabled = false,
|
|
56
|
-
tagsToIgnore = ["INPUT", "TEXTAREA", "SELECT"]
|
|
56
|
+
tagsToIgnore = ["INPUT", "TEXTAREA", "SELECT"],
|
|
57
|
+
triggerOnContentEditable = false
|
|
57
58
|
} = _b, others = __objRest(_b, [
|
|
58
59
|
"actions",
|
|
59
60
|
"children",
|
|
@@ -64,7 +65,8 @@ function SpotlightProvider(_a) {
|
|
|
64
65
|
"cleanQueryOnClose",
|
|
65
66
|
"transitionDuration",
|
|
66
67
|
"disabled",
|
|
67
|
-
"tagsToIgnore"
|
|
68
|
+
"tagsToIgnore",
|
|
69
|
+
"triggerOnContentEditable"
|
|
68
70
|
]);
|
|
69
71
|
const timeoutRef = React.useRef(-1);
|
|
70
72
|
const [query, setQuery] = React.useState("");
|
|
@@ -101,7 +103,7 @@ function SpotlightProvider(_a) {
|
|
|
101
103
|
actions,
|
|
102
104
|
query
|
|
103
105
|
};
|
|
104
|
-
useSpotlightShortcuts.useSpotlightShortcuts(shortcut, open, tagsToIgnore);
|
|
106
|
+
useSpotlightShortcuts.useSpotlightShortcuts(shortcut, open, tagsToIgnore, triggerOnContentEditable);
|
|
105
107
|
events.useSpotlightEvents({ open, close, toggle, registerActions, removeActions, triggerAction });
|
|
106
108
|
return /* @__PURE__ */ React__default.createElement(Spotlight_context.SpotlightContext.Provider, {
|
|
107
109
|
value: ctx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotlightProvider.js","sources":["../src/SpotlightProvider.tsx"],"sourcesContent":["import { useDidUpdate, useDisclosure } from '@mantine/hooks';\nimport React, { useRef, useState } from 'react';\nimport { useSpotlightEvents } from './events';\nimport { SpotlightContext } from './Spotlight.context';\nimport { InnerSpotlightProps, Spotlight } from './Spotlight/Spotlight';\nimport type { SpotlightAction } from './types';\nimport { useActionsState } from './use-actions-state/use-actions-state';\nimport { useSpotlightShortcuts } from './use-spotlight-shortcuts/use-spotlight-shortcuts';\n\nexport interface SpotlightProviderProps extends InnerSpotlightProps {\n /** Actions list */\n actions: SpotlightAction[] | ((query: string) => SpotlightAction[]);\n\n /** Your application */\n children?: React.ReactNode;\n\n /** Called when spotlight opens */\n onSpotlightOpen?(): void;\n\n /** Called when spotlight closes */\n onSpotlightClose?(): void;\n\n /** Called when user enters text in search input */\n onQueryChange?(query: string): void;\n\n /** Keyboard shortcut or list of shortcuts to trigger spotlight */\n shortcut?: string | string[] | null;\n\n /** Should search be cleared when spotlight closes */\n cleanQueryOnClose?: boolean;\n\n /** Spotlight will not render if disabled is set to true */\n disabled?: boolean;\n\n /** Tags to ignore shortcut hotkeys on. */\n tagsToIgnore?: string[];\n}\n\nexport function SpotlightProvider({\n actions: initialActions,\n children,\n shortcut = 'mod + K',\n onSpotlightClose,\n onSpotlightOpen,\n onQueryChange,\n cleanQueryOnClose = true,\n transitionDuration = 150,\n disabled = false,\n tagsToIgnore = ['INPUT', 'TEXTAREA', 'SELECT'],\n ...others\n}: SpotlightProviderProps) {\n const timeoutRef = useRef<number>(-1);\n const [query, setQuery] = useState('');\n const [actions, { registerActions, updateActions, removeActions, triggerAction }] =\n useActionsState(initialActions, query);\n\n useDidUpdate(() => {\n updateActions(initialActions);\n }, [initialActions]);\n\n const handleQueryChange = (value: string) => {\n setQuery(value);\n onQueryChange?.(value);\n };\n\n const [opened, { open, close, toggle }] = useDisclosure(false, {\n onClose: () => {\n onSpotlightClose?.();\n if (cleanQueryOnClose) {\n timeoutRef.current = window.setTimeout(() => {\n handleQueryChange('');\n }, transitionDuration);\n }\n },\n onOpen: () => {\n onSpotlightOpen?.();\n window.clearTimeout(timeoutRef.current);\n },\n });\n\n const ctx = {\n openSpotlight: open,\n closeSpotlight: close,\n toggleSpotlight: toggle,\n registerActions,\n removeActions,\n triggerAction,\n opened,\n actions,\n query,\n };\n\n useSpotlightShortcuts(shortcut, open, tagsToIgnore);\n useSpotlightEvents({ open, close, toggle, registerActions, removeActions, triggerAction });\n\n return (\n <SpotlightContext.Provider value={ctx}>\n {!disabled && (\n <Spotlight\n actions={actions}\n onClose={close}\n opened={opened}\n query={query}\n onQueryChange={handleQueryChange}\n transitionDuration={transitionDuration}\n {...others}\n />\n )}\n {children}\n </SpotlightContext.Provider>\n );\n}\n\nSpotlightProvider.displayName = '@mantine/spotlight/SpotlightProvider';\n"],"names":["useRef","useState","useActionsState","useDidUpdate","useDisclosure","useSpotlightShortcuts","useSpotlightEvents","React","SpotlightContext","Spotlight"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CA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I,OAAO;AACX,IAAI,KAAK;AACT,GAAG,CAAC;AACJ,EAAEC,2CAAqB,CAAC,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"SpotlightProvider.js","sources":["../src/SpotlightProvider.tsx"],"sourcesContent":["import { useDidUpdate, useDisclosure } from '@mantine/hooks';\nimport React, { useRef, useState } from 'react';\nimport { useSpotlightEvents } from './events';\nimport { SpotlightContext } from './Spotlight.context';\nimport { InnerSpotlightProps, Spotlight } from './Spotlight/Spotlight';\nimport type { SpotlightAction } from './types';\nimport { useActionsState } from './use-actions-state/use-actions-state';\nimport { useSpotlightShortcuts } from './use-spotlight-shortcuts/use-spotlight-shortcuts';\n\nexport interface SpotlightProviderProps extends InnerSpotlightProps {\n /** Actions list */\n actions: SpotlightAction[] | ((query: string) => SpotlightAction[]);\n\n /** Your application */\n children?: React.ReactNode;\n\n /** Called when spotlight opens */\n onSpotlightOpen?(): void;\n\n /** Called when spotlight closes */\n onSpotlightClose?(): void;\n\n /** Called when user enters text in search input */\n onQueryChange?(query: string): void;\n\n /** Keyboard shortcut or list of shortcuts to trigger spotlight */\n shortcut?: string | string[] | null;\n\n /** Should search be cleared when spotlight closes */\n cleanQueryOnClose?: boolean;\n\n /** Spotlight will not render if disabled is set to true */\n disabled?: boolean;\n\n /** Tags to ignore shortcut hotkeys on. */\n tagsToIgnore?: string[];\n\n /** Whether shortcuts should trigger based on contentEditable. */\n triggerOnContentEditable?: boolean;\n}\n\nexport function SpotlightProvider({\n actions: initialActions,\n children,\n shortcut = 'mod + K',\n onSpotlightClose,\n onSpotlightOpen,\n onQueryChange,\n cleanQueryOnClose = true,\n transitionDuration = 150,\n disabled = false,\n tagsToIgnore = ['INPUT', 'TEXTAREA', 'SELECT'],\n triggerOnContentEditable = false,\n ...others\n}: SpotlightProviderProps) {\n const timeoutRef = useRef<number>(-1);\n const [query, setQuery] = useState('');\n const [actions, { registerActions, updateActions, removeActions, triggerAction }] =\n useActionsState(initialActions, query);\n\n useDidUpdate(() => {\n updateActions(initialActions);\n }, [initialActions]);\n\n const handleQueryChange = (value: string) => {\n setQuery(value);\n onQueryChange?.(value);\n };\n\n const [opened, { open, close, toggle }] = useDisclosure(false, {\n onClose: () => {\n onSpotlightClose?.();\n if (cleanQueryOnClose) {\n timeoutRef.current = window.setTimeout(() => {\n handleQueryChange('');\n }, transitionDuration);\n }\n },\n onOpen: () => {\n onSpotlightOpen?.();\n window.clearTimeout(timeoutRef.current);\n },\n });\n\n const ctx = {\n openSpotlight: open,\n closeSpotlight: close,\n toggleSpotlight: toggle,\n registerActions,\n removeActions,\n triggerAction,\n opened,\n actions,\n query,\n };\n\n useSpotlightShortcuts(shortcut, open, tagsToIgnore, triggerOnContentEditable);\n useSpotlightEvents({ open, close, toggle, registerActions, removeActions, triggerAction });\n\n return (\n <SpotlightContext.Provider value={ctx}>\n {!disabled && (\n <Spotlight\n actions={actions}\n onClose={close}\n opened={opened}\n query={query}\n onQueryChange={handleQueryChange}\n transitionDuration={transitionDuration}\n {...others}\n />\n )}\n {children}\n </SpotlightContext.Provider>\n );\n}\n\nSpotlightProvider.displayName = '@mantine/spotlight/SpotlightProvider';\n"],"names":["useRef","useState","useActionsState","useDidUpdate","useDisclosure","useSpotlightShortcuts","useSpotlightEvents","React","SpotlightContext","Spotlight"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE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C,CAAC;AAChF,EAAEC,yBAAkB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,aAAa,EAAE,CAAC,CAAC;AAC7F,EAAE,uBAAuBC,cAAK,CAAC,aAAa,CAACC,kCAAgB,CAAC,QAAQ,EAAE;AACxE,IAAI,KAAK,EAAE,GAAG;AACd,GAAG,EAAE,CAAC,QAAQ,oBAAoBD,cAAK,CAAC,aAAa,CAACE,mBAAS,EAAE,cAAc,CAAC;AAChF,IAAI,OAAO;AACX,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,MAAM;AACV,IAAI,KAAK;AACT,IAAI,aAAa,EAAE,iBAAiB;AACpC,IAAI,kBAAkB;AACtB,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AACzB,CAAC;AACD,iBAAiB,CAAC,WAAW,GAAG,sCAAsC;;;;"}
|
|
@@ -13,8 +13,8 @@ function getHotkeysPayload(shortcuts, onToggle) {
|
|
|
13
13
|
}
|
|
14
14
|
return [[shortcuts, onToggle]];
|
|
15
15
|
}
|
|
16
|
-
function useSpotlightShortcuts(shortcuts, onToggle, tagsToIgnore) {
|
|
17
|
-
hooks.useHotkeys(getHotkeysPayload(shortcuts, onToggle), tagsToIgnore);
|
|
16
|
+
function useSpotlightShortcuts(shortcuts, onToggle, tagsToIgnore, triggerOnContentEditable) {
|
|
17
|
+
hooks.useHotkeys(getHotkeysPayload(shortcuts, onToggle), tagsToIgnore, triggerOnContentEditable);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
exports.getHotkeysPayload = getHotkeysPayload;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-spotlight-shortcuts.js","sources":["../../src/use-spotlight-shortcuts/use-spotlight-shortcuts.ts"],"sourcesContent":["import { HotkeyItem, useHotkeys } from '@mantine/hooks';\n\nexport function getHotkeysPayload(\n shortcuts: string | string[],\n onToggle: () => void\n): HotkeyItem[] {\n if (shortcuts === null) {\n return [];\n }\n\n if (Array.isArray(shortcuts)) {\n return shortcuts.map((shortcut) => [shortcut, onToggle]);\n }\n\n return [[shortcuts, onToggle]];\n}\n\nexport function useSpotlightShortcuts(\n shortcuts: string | string[],\n onToggle: () => void,\n tagsToIgnore?: string[]\n) {\n useHotkeys(getHotkeysPayload(shortcuts, onToggle), tagsToIgnore);\n}\n"],"names":["useHotkeys"],"mappings":";;;;;;AACO,SAAS,iBAAiB,CAAC,SAAS,EAAE,QAAQ,EAAE;AACvD,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AAChC,IAAI,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7D,GAAG;AACH,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACjC,CAAC;AACM,SAAS,qBAAqB,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"use-spotlight-shortcuts.js","sources":["../../src/use-spotlight-shortcuts/use-spotlight-shortcuts.ts"],"sourcesContent":["import { HotkeyItem, useHotkeys } from '@mantine/hooks';\n\nexport function getHotkeysPayload(\n shortcuts: string | string[],\n onToggle: () => void\n): HotkeyItem[] {\n if (shortcuts === null) {\n return [];\n }\n\n if (Array.isArray(shortcuts)) {\n return shortcuts.map((shortcut) => [shortcut, onToggle]);\n }\n\n return [[shortcuts, onToggle]];\n}\n\nexport function useSpotlightShortcuts(\n shortcuts: string | string[],\n onToggle: () => void,\n tagsToIgnore?: string[],\n triggerOnContentEditable?: boolean\n) {\n useHotkeys(getHotkeysPayload(shortcuts, onToggle), tagsToIgnore, triggerOnContentEditable);\n}\n"],"names":["useHotkeys"],"mappings":";;;;;;AACO,SAAS,iBAAiB,CAAC,SAAS,EAAE,QAAQ,EAAE;AACvD,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AAChC,IAAI,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7D,GAAG;AACH,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACjC,CAAC;AACM,SAAS,qBAAqB,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,wBAAwB,EAAE;AACnG,EAAEA,gBAAU,CAAC,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,wBAAwB,CAAC,CAAC;AAC7F;;;;;"}
|
package/esm/SpotlightProvider.js
CHANGED
|
@@ -45,7 +45,8 @@ function SpotlightProvider(_a) {
|
|
|
45
45
|
cleanQueryOnClose = true,
|
|
46
46
|
transitionDuration = 150,
|
|
47
47
|
disabled = false,
|
|
48
|
-
tagsToIgnore = ["INPUT", "TEXTAREA", "SELECT"]
|
|
48
|
+
tagsToIgnore = ["INPUT", "TEXTAREA", "SELECT"],
|
|
49
|
+
triggerOnContentEditable = false
|
|
49
50
|
} = _b, others = __objRest(_b, [
|
|
50
51
|
"actions",
|
|
51
52
|
"children",
|
|
@@ -56,7 +57,8 @@ function SpotlightProvider(_a) {
|
|
|
56
57
|
"cleanQueryOnClose",
|
|
57
58
|
"transitionDuration",
|
|
58
59
|
"disabled",
|
|
59
|
-
"tagsToIgnore"
|
|
60
|
+
"tagsToIgnore",
|
|
61
|
+
"triggerOnContentEditable"
|
|
60
62
|
]);
|
|
61
63
|
const timeoutRef = useRef(-1);
|
|
62
64
|
const [query, setQuery] = useState("");
|
|
@@ -93,7 +95,7 @@ function SpotlightProvider(_a) {
|
|
|
93
95
|
actions,
|
|
94
96
|
query
|
|
95
97
|
};
|
|
96
|
-
useSpotlightShortcuts(shortcut, open, tagsToIgnore);
|
|
98
|
+
useSpotlightShortcuts(shortcut, open, tagsToIgnore, triggerOnContentEditable);
|
|
97
99
|
useSpotlightEvents({ open, close, toggle, registerActions, removeActions, triggerAction });
|
|
98
100
|
return /* @__PURE__ */ React.createElement(SpotlightContext.Provider, {
|
|
99
101
|
value: ctx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotlightProvider.js","sources":["../src/SpotlightProvider.tsx"],"sourcesContent":["import { useDidUpdate, useDisclosure } from '@mantine/hooks';\nimport React, { useRef, useState } from 'react';\nimport { useSpotlightEvents } from './events';\nimport { SpotlightContext } from './Spotlight.context';\nimport { InnerSpotlightProps, Spotlight } from './Spotlight/Spotlight';\nimport type { SpotlightAction } from './types';\nimport { useActionsState } from './use-actions-state/use-actions-state';\nimport { useSpotlightShortcuts } from './use-spotlight-shortcuts/use-spotlight-shortcuts';\n\nexport interface SpotlightProviderProps extends InnerSpotlightProps {\n /** Actions list */\n actions: SpotlightAction[] | ((query: string) => SpotlightAction[]);\n\n /** Your application */\n children?: React.ReactNode;\n\n /** Called when spotlight opens */\n onSpotlightOpen?(): void;\n\n /** Called when spotlight closes */\n onSpotlightClose?(): void;\n\n /** Called when user enters text in search input */\n onQueryChange?(query: string): void;\n\n /** Keyboard shortcut or list of shortcuts to trigger spotlight */\n shortcut?: string | string[] | null;\n\n /** Should search be cleared when spotlight closes */\n cleanQueryOnClose?: boolean;\n\n /** Spotlight will not render if disabled is set to true */\n disabled?: boolean;\n\n /** Tags to ignore shortcut hotkeys on. */\n tagsToIgnore?: string[];\n}\n\nexport function SpotlightProvider({\n actions: initialActions,\n children,\n shortcut = 'mod + K',\n onSpotlightClose,\n onSpotlightOpen,\n onQueryChange,\n cleanQueryOnClose = true,\n transitionDuration = 150,\n disabled = false,\n tagsToIgnore = ['INPUT', 'TEXTAREA', 'SELECT'],\n ...others\n}: SpotlightProviderProps) {\n const timeoutRef = useRef<number>(-1);\n const [query, setQuery] = useState('');\n const [actions, { registerActions, updateActions, removeActions, triggerAction }] =\n useActionsState(initialActions, query);\n\n useDidUpdate(() => {\n updateActions(initialActions);\n }, [initialActions]);\n\n const handleQueryChange = (value: string) => {\n setQuery(value);\n onQueryChange?.(value);\n };\n\n const [opened, { open, close, toggle }] = useDisclosure(false, {\n onClose: () => {\n onSpotlightClose?.();\n if (cleanQueryOnClose) {\n timeoutRef.current = window.setTimeout(() => {\n handleQueryChange('');\n }, transitionDuration);\n }\n },\n onOpen: () => {\n onSpotlightOpen?.();\n window.clearTimeout(timeoutRef.current);\n },\n });\n\n const ctx = {\n openSpotlight: open,\n closeSpotlight: close,\n toggleSpotlight: toggle,\n registerActions,\n removeActions,\n triggerAction,\n opened,\n actions,\n query,\n };\n\n useSpotlightShortcuts(shortcut, open, tagsToIgnore);\n useSpotlightEvents({ open, close, toggle, registerActions, removeActions, triggerAction });\n\n return (\n <SpotlightContext.Provider value={ctx}>\n {!disabled && (\n <Spotlight\n actions={actions}\n onClose={close}\n opened={opened}\n query={query}\n onQueryChange={handleQueryChange}\n transitionDuration={transitionDuration}\n {...others}\n />\n )}\n {children}\n </SpotlightContext.Provider>\n );\n}\n\nSpotlightProvider.displayName = '@mantine/spotlight/SpotlightProvider';\n"],"names":[],"mappings":";;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EA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src/SpotlightProvider.tsx"],"sourcesContent":["import { useDidUpdate, useDisclosure } from '@mantine/hooks';\nimport React, { useRef, useState } from 'react';\nimport { useSpotlightEvents } from './events';\nimport { SpotlightContext } from './Spotlight.context';\nimport { InnerSpotlightProps, Spotlight } from './Spotlight/Spotlight';\nimport type { SpotlightAction } from './types';\nimport { useActionsState } from './use-actions-state/use-actions-state';\nimport { useSpotlightShortcuts } from './use-spotlight-shortcuts/use-spotlight-shortcuts';\n\nexport interface SpotlightProviderProps extends InnerSpotlightProps {\n /** Actions list */\n actions: SpotlightAction[] | ((query: string) => SpotlightAction[]);\n\n /** Your application */\n children?: React.ReactNode;\n\n /** Called when spotlight opens */\n onSpotlightOpen?(): void;\n\n /** Called when spotlight closes */\n onSpotlightClose?(): void;\n\n /** Called when user enters text in search input */\n onQueryChange?(query: string): void;\n\n /** Keyboard shortcut or list of shortcuts to trigger spotlight */\n shortcut?: string | string[] | null;\n\n /** Should search be cleared when spotlight closes */\n cleanQueryOnClose?: boolean;\n\n /** Spotlight will not render if disabled is set to true */\n disabled?: boolean;\n\n /** Tags to ignore shortcut hotkeys on. */\n tagsToIgnore?: string[];\n\n /** Whether shortcuts should trigger based on contentEditable. */\n triggerOnContentEditable?: boolean;\n}\n\nexport function SpotlightProvider({\n actions: initialActions,\n children,\n shortcut = 'mod + K',\n onSpotlightClose,\n onSpotlightOpen,\n onQueryChange,\n cleanQueryOnClose = true,\n transitionDuration = 150,\n disabled = false,\n tagsToIgnore = ['INPUT', 'TEXTAREA', 'SELECT'],\n triggerOnContentEditable = false,\n ...others\n}: SpotlightProviderProps) {\n const timeoutRef = useRef<number>(-1);\n const [query, setQuery] = useState('');\n const [actions, { registerActions, updateActions, removeActions, triggerAction }] =\n useActionsState(initialActions, query);\n\n useDidUpdate(() => {\n updateActions(initialActions);\n }, [initialActions]);\n\n const handleQueryChange = (value: string) => {\n setQuery(value);\n onQueryChange?.(value);\n };\n\n const [opened, { open, close, toggle }] = useDisclosure(false, {\n onClose: () => {\n onSpotlightClose?.();\n if (cleanQueryOnClose) {\n timeoutRef.current = window.setTimeout(() => {\n handleQueryChange('');\n }, transitionDuration);\n }\n },\n onOpen: () => {\n onSpotlightOpen?.();\n window.clearTimeout(timeoutRef.current);\n },\n });\n\n const ctx = {\n openSpotlight: open,\n closeSpotlight: close,\n toggleSpotlight: toggle,\n registerActions,\n removeActions,\n triggerAction,\n opened,\n actions,\n query,\n };\n\n useSpotlightShortcuts(shortcut, open, tagsToIgnore, triggerOnContentEditable);\n useSpotlightEvents({ open, close, toggle, registerActions, removeActions, triggerAction });\n\n return (\n <SpotlightContext.Provider value={ctx}>\n {!disabled && (\n <Spotlight\n actions={actions}\n onClose={close}\n opened={opened}\n query={query}\n onQueryChange={handleQueryChange}\n transitionDuration={transitionDuration}\n {...others}\n />\n )}\n {children}\n </SpotlightContext.Provider>\n );\n}\n\nSpotlightProvider.displayName = '@mantine/spotlight/SpotlightProvider';\n"],"names":[],"mappings":";;;;;;;;AAAA,IAAI,SAAS,GAAG,MAAM,CAAC,cAAc,CAAC;AACtC,IAAI,mBAAmB,GAAG,MAAM,CAAC,qBAAqB,CAAC;AACvD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC;AACnD,IAAI,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC;AACzD,IAAI,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,KAAK,GAAG,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAChK,IAAI,cAAc,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK;AAC/B,EAAE,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;AA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,oBAAoB,KAAK,CAAC,aAAa,CAAC,SAAS,EAAE,cAAc,CAAC;AAChF,IAAI,OAAO;AACX,IAAI,OAAO,EAAE,KAAK;AAClB,IAAI,MAAM;AACV,IAAI,KAAK;AACT,IAAI,aAAa,EAAE,iBAAiB;AACpC,IAAI,kBAAkB;AACtB,GAAG,EAAE,MAAM,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AACzB,CAAC;AACD,iBAAiB,CAAC,WAAW,GAAG,sCAAsC;;;;"}
|
|
@@ -9,8 +9,8 @@ function getHotkeysPayload(shortcuts, onToggle) {
|
|
|
9
9
|
}
|
|
10
10
|
return [[shortcuts, onToggle]];
|
|
11
11
|
}
|
|
12
|
-
function useSpotlightShortcuts(shortcuts, onToggle, tagsToIgnore) {
|
|
13
|
-
useHotkeys(getHotkeysPayload(shortcuts, onToggle), tagsToIgnore);
|
|
12
|
+
function useSpotlightShortcuts(shortcuts, onToggle, tagsToIgnore, triggerOnContentEditable) {
|
|
13
|
+
useHotkeys(getHotkeysPayload(shortcuts, onToggle), tagsToIgnore, triggerOnContentEditable);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export { getHotkeysPayload, useSpotlightShortcuts };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-spotlight-shortcuts.js","sources":["../../src/use-spotlight-shortcuts/use-spotlight-shortcuts.ts"],"sourcesContent":["import { HotkeyItem, useHotkeys } from '@mantine/hooks';\n\nexport function getHotkeysPayload(\n shortcuts: string | string[],\n onToggle: () => void\n): HotkeyItem[] {\n if (shortcuts === null) {\n return [];\n }\n\n if (Array.isArray(shortcuts)) {\n return shortcuts.map((shortcut) => [shortcut, onToggle]);\n }\n\n return [[shortcuts, onToggle]];\n}\n\nexport function useSpotlightShortcuts(\n shortcuts: string | string[],\n onToggle: () => void,\n tagsToIgnore?: string[]\n) {\n useHotkeys(getHotkeysPayload(shortcuts, onToggle), tagsToIgnore);\n}\n"],"names":[],"mappings":";;AACO,SAAS,iBAAiB,CAAC,SAAS,EAAE,QAAQ,EAAE;AACvD,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AAChC,IAAI,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7D,GAAG;AACH,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACjC,CAAC;AACM,SAAS,qBAAqB,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE;
|
|
1
|
+
{"version":3,"file":"use-spotlight-shortcuts.js","sources":["../../src/use-spotlight-shortcuts/use-spotlight-shortcuts.ts"],"sourcesContent":["import { HotkeyItem, useHotkeys } from '@mantine/hooks';\n\nexport function getHotkeysPayload(\n shortcuts: string | string[],\n onToggle: () => void\n): HotkeyItem[] {\n if (shortcuts === null) {\n return [];\n }\n\n if (Array.isArray(shortcuts)) {\n return shortcuts.map((shortcut) => [shortcut, onToggle]);\n }\n\n return [[shortcuts, onToggle]];\n}\n\nexport function useSpotlightShortcuts(\n shortcuts: string | string[],\n onToggle: () => void,\n tagsToIgnore?: string[],\n triggerOnContentEditable?: boolean\n) {\n useHotkeys(getHotkeysPayload(shortcuts, onToggle), tagsToIgnore, triggerOnContentEditable);\n}\n"],"names":[],"mappings":";;AACO,SAAS,iBAAiB,CAAC,SAAS,EAAE,QAAQ,EAAE;AACvD,EAAE,IAAI,SAAS,KAAK,IAAI,EAAE;AAC1B,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;AAChC,IAAI,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7D,GAAG;AACH,EAAE,OAAO,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AACjC,CAAC;AACM,SAAS,qBAAqB,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,wBAAwB,EAAE;AACnG,EAAE,UAAU,CAAC,iBAAiB,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,YAAY,EAAE,wBAAwB,CAAC,CAAC;AAC7F;;;;"}
|
|
@@ -20,8 +20,10 @@ export interface SpotlightProviderProps extends InnerSpotlightProps {
|
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
/** Tags to ignore shortcut hotkeys on. */
|
|
22
22
|
tagsToIgnore?: string[];
|
|
23
|
+
/** Whether shortcuts should trigger based on contentEditable. */
|
|
24
|
+
triggerOnContentEditable?: boolean;
|
|
23
25
|
}
|
|
24
|
-
export declare function SpotlightProvider({ actions: initialActions, children, shortcut, onSpotlightClose, onSpotlightOpen, onQueryChange, cleanQueryOnClose, transitionDuration, disabled, tagsToIgnore, ...others }: SpotlightProviderProps): JSX.Element;
|
|
26
|
+
export declare function SpotlightProvider({ actions: initialActions, children, shortcut, onSpotlightClose, onSpotlightOpen, onQueryChange, cleanQueryOnClose, transitionDuration, disabled, tagsToIgnore, triggerOnContentEditable, ...others }: SpotlightProviderProps): JSX.Element;
|
|
25
27
|
export declare namespace SpotlightProvider {
|
|
26
28
|
var displayName: string;
|
|
27
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpotlightProvider.d.ts","sourceRoot":"","sources":["../src/SpotlightProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2B,MAAM,OAAO,CAAC;AAGhD,OAAO,EAAE,mBAAmB,EAAa,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAI/C,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,mBAAmB;IACnB,OAAO,EAAE,eAA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AQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAEpC,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,2DAA2D;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,0CAA0C;IAC1C,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,iEAAiE;IACjE,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EAAE,cAAc,EACvB,QAAQ,EACR,QAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,iBAAwB,EACxB,kBAAwB,EACxB,QAAgB,EAChB,YAA8C,EAC9C,wBAAgC,EAChC,GAAG,MAAM,EACV,EAAE,sBAAsB,eA6DxB;yBA1Ee,iBAAiB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { HotkeyItem } from '@mantine/hooks';
|
|
2
2
|
export declare function getHotkeysPayload(shortcuts: string | string[], onToggle: () => void): HotkeyItem[];
|
|
3
|
-
export declare function useSpotlightShortcuts(shortcuts: string | string[], onToggle: () => void, tagsToIgnore?: string[]): void;
|
|
3
|
+
export declare function useSpotlightShortcuts(shortcuts: string | string[], onToggle: () => void, tagsToIgnore?: string[], triggerOnContentEditable?: boolean): void;
|
|
4
4
|
//# sourceMappingURL=use-spotlight-shortcuts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-spotlight-shortcuts.d.ts","sourceRoot":"","sources":["../../src/use-spotlight-shortcuts/use-spotlight-shortcuts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,QAAQ,EAAE,MAAM,IAAI,GACnB,UAAU,EAAE,CAUd;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,QAAQ,EAAE,MAAM,IAAI,EACpB,YAAY,CAAC,EAAE,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"use-spotlight-shortcuts.d.ts","sourceRoot":"","sources":["../../src/use-spotlight-shortcuts/use-spotlight-shortcuts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,QAAQ,EAAE,MAAM,IAAI,GACnB,UAAU,EAAE,CAUd;AAED,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,EAC5B,QAAQ,EAAE,MAAM,IAAI,EACpB,YAAY,CAAC,EAAE,MAAM,EAAE,EACvB,wBAAwB,CAAC,EAAE,OAAO,QAGnC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mantine/spotlight",
|
|
3
3
|
"description": "Command center for your application",
|
|
4
|
-
"version": "5.10.
|
|
4
|
+
"version": "5.10.3",
|
|
5
5
|
"main": "cjs/index.js",
|
|
6
6
|
"module": "esm/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
"directory": "src/mantine-spotlight"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
|
-
"@mantine/core": "5.10.
|
|
19
|
-
"@mantine/hooks": "5.10.
|
|
18
|
+
"@mantine/core": "5.10.3",
|
|
19
|
+
"@mantine/hooks": "5.10.3",
|
|
20
20
|
"react": ">=16.8.0",
|
|
21
21
|
"react-dom": ">=16.8.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@mantine/utils": "5.10.
|
|
24
|
+
"@mantine/utils": "5.10.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {}
|
|
27
27
|
}
|