@redis-ui/components 47.4.0 → 47.5.1
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/MultiSelect/components/Content/components/SelectAll/SelectAll.cjs +11 -7
- package/dist/MultiSelect/components/Content/components/SelectAll/SelectAll.js +12 -8
- package/dist/node_modules/@tanstack/hotkeys/dist/constants.cjs +389 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/constants.js +383 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/format.cjs +22 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/format.js +22 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.cjs +363 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/hotkey-manager.js +363 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.cjs +111 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/manager.utils.js +107 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/match.cjs +59 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/match.js +59 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/parse.cjs +143 -0
- package/dist/node_modules/@tanstack/hotkeys/dist/parse.js +141 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.cjs +10 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/HotkeysProvider.js +8 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.cjs +121 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/useHotkey.js +120 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.cjs +9 -0
- package/dist/node_modules/@tanstack/react-hotkeys/dist/utils.js +9 -0
- package/dist/node_modules/@tanstack/store/dist/alien.cjs +183 -0
- package/dist/node_modules/@tanstack/store/dist/alien.js +182 -0
- package/dist/node_modules/@tanstack/store/dist/atom.cjs +161 -0
- package/dist/node_modules/@tanstack/store/dist/atom.js +160 -0
- package/dist/node_modules/@tanstack/store/dist/store.cjs +25 -0
- package/dist/node_modules/@tanstack/store/dist/store.js +25 -0
- package/package.json +3 -3
- package/skills/redis-ui-components/SKILL.md +1 -1
- package/skills/redis-ui-components/references/Icons.md +3 -3
- package/skills/redis-ui-components/references/SideBar.md +8 -8
- package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.cjs +0 -289
- package/dist/node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js +0 -288
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import { createContext, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
-
//#region ../../node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js
|
|
4
|
-
function _extends() {
|
|
5
|
-
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
6
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
7
|
-
var t = arguments[e];
|
|
8
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
9
|
-
}
|
|
10
|
-
return n;
|
|
11
|
-
}, _extends.apply(null, arguments);
|
|
12
|
-
}
|
|
13
|
-
var reservedModifierKeywords = [
|
|
14
|
-
"shift",
|
|
15
|
-
"alt",
|
|
16
|
-
"meta",
|
|
17
|
-
"mod",
|
|
18
|
-
"ctrl"
|
|
19
|
-
];
|
|
20
|
-
var mappedKeys = {
|
|
21
|
-
esc: "escape",
|
|
22
|
-
"return": "enter",
|
|
23
|
-
".": "period",
|
|
24
|
-
",": "comma",
|
|
25
|
-
"-": "slash",
|
|
26
|
-
" ": "space",
|
|
27
|
-
"`": "backquote",
|
|
28
|
-
"#": "backslash",
|
|
29
|
-
"+": "bracketright",
|
|
30
|
-
ShiftLeft: "shift",
|
|
31
|
-
ShiftRight: "shift",
|
|
32
|
-
AltLeft: "alt",
|
|
33
|
-
AltRight: "alt",
|
|
34
|
-
MetaLeft: "meta",
|
|
35
|
-
MetaRight: "meta",
|
|
36
|
-
OSLeft: "meta",
|
|
37
|
-
OSRight: "meta",
|
|
38
|
-
ControlLeft: "ctrl",
|
|
39
|
-
ControlRight: "ctrl"
|
|
40
|
-
};
|
|
41
|
-
function mapKey(key) {
|
|
42
|
-
return (key && mappedKeys[key] || key || "").trim().toLowerCase().replace(/key|digit|numpad|arrow/, "");
|
|
43
|
-
}
|
|
44
|
-
function isHotkeyModifier(key) {
|
|
45
|
-
return reservedModifierKeywords.includes(key);
|
|
46
|
-
}
|
|
47
|
-
function parseKeysHookInput(keys, splitKey) {
|
|
48
|
-
if (splitKey === void 0) splitKey = ",";
|
|
49
|
-
return keys.split(splitKey);
|
|
50
|
-
}
|
|
51
|
-
function parseHotkey(hotkey, combinationKey, description) {
|
|
52
|
-
if (combinationKey === void 0) combinationKey = "+";
|
|
53
|
-
var keys = hotkey.toLocaleLowerCase().split(combinationKey).map(function(k) {
|
|
54
|
-
return mapKey(k);
|
|
55
|
-
});
|
|
56
|
-
var modifiers = {
|
|
57
|
-
alt: keys.includes("alt"),
|
|
58
|
-
ctrl: keys.includes("ctrl") || keys.includes("control"),
|
|
59
|
-
shift: keys.includes("shift"),
|
|
60
|
-
meta: keys.includes("meta"),
|
|
61
|
-
mod: keys.includes("mod")
|
|
62
|
-
};
|
|
63
|
-
var singleCharKeys = keys.filter(function(k) {
|
|
64
|
-
return !reservedModifierKeywords.includes(k);
|
|
65
|
-
});
|
|
66
|
-
return _extends({}, modifiers, {
|
|
67
|
-
keys: singleCharKeys,
|
|
68
|
-
description,
|
|
69
|
-
hotkey
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
(function() {
|
|
73
|
-
if (typeof document !== "undefined") {
|
|
74
|
-
document.addEventListener("keydown", function(e) {
|
|
75
|
-
if (e.key === void 0) return;
|
|
76
|
-
pushToCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);
|
|
77
|
-
});
|
|
78
|
-
document.addEventListener("keyup", function(e) {
|
|
79
|
-
if (e.key === void 0) return;
|
|
80
|
-
removeFromCurrentlyPressedKeys([mapKey(e.key), mapKey(e.code)]);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
if (typeof window !== "undefined") window.addEventListener("blur", function() {
|
|
84
|
-
currentlyPressedKeys.clear();
|
|
85
|
-
});
|
|
86
|
-
})();
|
|
87
|
-
var currentlyPressedKeys = /* @__PURE__ */ new Set();
|
|
88
|
-
function isReadonlyArray(value) {
|
|
89
|
-
return Array.isArray(value);
|
|
90
|
-
}
|
|
91
|
-
function isHotkeyPressed(key, splitKey) {
|
|
92
|
-
if (splitKey === void 0) splitKey = ",";
|
|
93
|
-
return (isReadonlyArray(key) ? key : key.split(splitKey)).every(function(hotkey) {
|
|
94
|
-
return currentlyPressedKeys.has(hotkey.trim().toLowerCase());
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function pushToCurrentlyPressedKeys(key) {
|
|
98
|
-
var hotkeyArray = Array.isArray(key) ? key : [key];
|
|
99
|
-
if (currentlyPressedKeys.has("meta")) currentlyPressedKeys.forEach(function(key) {
|
|
100
|
-
return !isHotkeyModifier(key) && currentlyPressedKeys["delete"](key.toLowerCase());
|
|
101
|
-
});
|
|
102
|
-
hotkeyArray.forEach(function(hotkey) {
|
|
103
|
-
return currentlyPressedKeys.add(hotkey.toLowerCase());
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function removeFromCurrentlyPressedKeys(key) {
|
|
107
|
-
var hotkeyArray = Array.isArray(key) ? key : [key];
|
|
108
|
-
if (key === "meta") currentlyPressedKeys.clear();
|
|
109
|
-
else hotkeyArray.forEach(function(hotkey) {
|
|
110
|
-
return currentlyPressedKeys["delete"](hotkey.toLowerCase());
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
function maybePreventDefault(e, hotkey, preventDefault) {
|
|
114
|
-
if (typeof preventDefault === "function" && preventDefault(e, hotkey) || preventDefault === true) e.preventDefault();
|
|
115
|
-
}
|
|
116
|
-
function isHotkeyEnabled(e, hotkey, enabled) {
|
|
117
|
-
if (typeof enabled === "function") return enabled(e, hotkey);
|
|
118
|
-
return enabled === true || enabled === void 0;
|
|
119
|
-
}
|
|
120
|
-
function isKeyboardEventTriggeredByInput(ev) {
|
|
121
|
-
return isHotkeyEnabledOnTag(ev, [
|
|
122
|
-
"input",
|
|
123
|
-
"textarea",
|
|
124
|
-
"select"
|
|
125
|
-
]);
|
|
126
|
-
}
|
|
127
|
-
function isHotkeyEnabledOnTag(event, enabledOnTags) {
|
|
128
|
-
if (enabledOnTags === void 0) enabledOnTags = false;
|
|
129
|
-
var target = event.target, composed = event.composed;
|
|
130
|
-
var targetTagName = null;
|
|
131
|
-
if (isCustomElement(target) && composed) targetTagName = event.composedPath()[0] && event.composedPath()[0].tagName;
|
|
132
|
-
else targetTagName = target && target.tagName;
|
|
133
|
-
if (isReadonlyArray(enabledOnTags)) return Boolean(targetTagName && enabledOnTags && enabledOnTags.some(function(tag) {
|
|
134
|
-
var _targetTagName;
|
|
135
|
-
return tag.toLowerCase() === ((_targetTagName = targetTagName) == null ? void 0 : _targetTagName.toLowerCase());
|
|
136
|
-
}));
|
|
137
|
-
return Boolean(targetTagName && enabledOnTags && enabledOnTags);
|
|
138
|
-
}
|
|
139
|
-
function isCustomElement(element) {
|
|
140
|
-
return !!element.tagName && !element.tagName.startsWith("-") && element.tagName.includes("-");
|
|
141
|
-
}
|
|
142
|
-
function isScopeActive(activeScopes, scopes) {
|
|
143
|
-
if (activeScopes.length === 0 && scopes) {
|
|
144
|
-
console.warn("A hotkey has the \"scopes\" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>");
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
if (!scopes) return true;
|
|
148
|
-
return activeScopes.some(function(scope) {
|
|
149
|
-
return scopes.includes(scope);
|
|
150
|
-
}) || activeScopes.includes("*");
|
|
151
|
-
}
|
|
152
|
-
var isHotkeyMatchingKeyboardEvent = function isHotkeyMatchingKeyboardEvent(e, hotkey, ignoreModifiers) {
|
|
153
|
-
if (ignoreModifiers === void 0) ignoreModifiers = false;
|
|
154
|
-
var alt = hotkey.alt, meta = hotkey.meta, mod = hotkey.mod, shift = hotkey.shift, ctrl = hotkey.ctrl, keys = hotkey.keys;
|
|
155
|
-
var pressedKeyUppercase = e.key, code = e.code, ctrlKey = e.ctrlKey, metaKey = e.metaKey, shiftKey = e.shiftKey, altKey = e.altKey;
|
|
156
|
-
var keyCode = mapKey(code);
|
|
157
|
-
var pressedKey = pressedKeyUppercase.toLowerCase();
|
|
158
|
-
if (!(keys != null && keys.includes(keyCode)) && !(keys != null && keys.includes(pressedKey)) && ![
|
|
159
|
-
"ctrl",
|
|
160
|
-
"control",
|
|
161
|
-
"unknown",
|
|
162
|
-
"meta",
|
|
163
|
-
"alt",
|
|
164
|
-
"shift",
|
|
165
|
-
"os"
|
|
166
|
-
].includes(keyCode)) return false;
|
|
167
|
-
if (!ignoreModifiers) {
|
|
168
|
-
if (alt === !altKey && pressedKey !== "alt") return false;
|
|
169
|
-
if (shift === !shiftKey && pressedKey !== "shift") return false;
|
|
170
|
-
if (mod) {
|
|
171
|
-
if (!metaKey && !ctrlKey) return false;
|
|
172
|
-
} else {
|
|
173
|
-
if (meta === !metaKey && pressedKey !== "meta" && pressedKey !== "os") return false;
|
|
174
|
-
if (ctrl === !ctrlKey && pressedKey !== "ctrl" && pressedKey !== "control") return false;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
if (keys && keys.length === 1 && (keys.includes(pressedKey) || keys.includes(keyCode))) return true;
|
|
178
|
-
else if (keys) return isHotkeyPressed(keys);
|
|
179
|
-
else if (!keys) return true;
|
|
180
|
-
return false;
|
|
181
|
-
};
|
|
182
|
-
var BoundHotkeysProxyProvider = /* @__PURE__ */ createContext(void 0);
|
|
183
|
-
var useBoundHotkeysProxy = function useBoundHotkeysProxy() {
|
|
184
|
-
return useContext(BoundHotkeysProxyProvider);
|
|
185
|
-
};
|
|
186
|
-
function deepEqual(x, y) {
|
|
187
|
-
return x && y && typeof x === "object" && typeof y === "object" ? Object.keys(x).length === Object.keys(y).length && Object.keys(x).reduce(function(isEqual, key) {
|
|
188
|
-
return isEqual && deepEqual(x[key], y[key]);
|
|
189
|
-
}, true) : x === y;
|
|
190
|
-
}
|
|
191
|
-
var HotkeysContext = /* @__PURE__ */ createContext({
|
|
192
|
-
hotkeys: [],
|
|
193
|
-
enabledScopes: [],
|
|
194
|
-
toggleScope: function toggleScope() {},
|
|
195
|
-
enableScope: function enableScope() {},
|
|
196
|
-
disableScope: function disableScope() {}
|
|
197
|
-
});
|
|
198
|
-
var useHotkeysContext = function useHotkeysContext() {
|
|
199
|
-
return useContext(HotkeysContext);
|
|
200
|
-
};
|
|
201
|
-
function useDeepEqualMemo(value) {
|
|
202
|
-
var ref = useRef(void 0);
|
|
203
|
-
if (!deepEqual(ref.current, value)) ref.current = value;
|
|
204
|
-
return ref.current;
|
|
205
|
-
}
|
|
206
|
-
var stopPropagation = function stopPropagation(e) {
|
|
207
|
-
e.stopPropagation();
|
|
208
|
-
e.preventDefault();
|
|
209
|
-
e.stopImmediatePropagation();
|
|
210
|
-
};
|
|
211
|
-
var useSafeLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
212
|
-
function useHotkeys(keys, callback, options, dependencies) {
|
|
213
|
-
var _useState = useState(null), ref = _useState[0], setRef = _useState[1];
|
|
214
|
-
var hasTriggeredRef = useRef(false);
|
|
215
|
-
var _options = !(options instanceof Array) ? options : !(dependencies instanceof Array) ? dependencies : void 0;
|
|
216
|
-
var _keys = isReadonlyArray(keys) ? keys.join(_options == null ? void 0 : _options.splitKey) : keys;
|
|
217
|
-
var _deps = options instanceof Array ? options : dependencies instanceof Array ? dependencies : void 0;
|
|
218
|
-
var memoisedCB = useCallback(callback, _deps != null ? _deps : []);
|
|
219
|
-
var cbRef = useRef(memoisedCB);
|
|
220
|
-
if (_deps) cbRef.current = memoisedCB;
|
|
221
|
-
else cbRef.current = callback;
|
|
222
|
-
var memoisedOptions = useDeepEqualMemo(_options);
|
|
223
|
-
var enabledScopes = useHotkeysContext().enabledScopes;
|
|
224
|
-
var proxy = useBoundHotkeysProxy();
|
|
225
|
-
useSafeLayoutEffect(function() {
|
|
226
|
-
if ((memoisedOptions == null ? void 0 : memoisedOptions.enabled) === false || !isScopeActive(enabledScopes, memoisedOptions == null ? void 0 : memoisedOptions.scopes)) return;
|
|
227
|
-
var listener = function listener(e, isKeyUp) {
|
|
228
|
-
var _e$target;
|
|
229
|
-
if (isKeyUp === void 0) isKeyUp = false;
|
|
230
|
-
if (isKeyboardEventTriggeredByInput(e) && !isHotkeyEnabledOnTag(e, memoisedOptions == null ? void 0 : memoisedOptions.enableOnFormTags)) return;
|
|
231
|
-
if (ref !== null) {
|
|
232
|
-
var rootNode = ref.getRootNode();
|
|
233
|
-
if ((rootNode instanceof Document || rootNode instanceof ShadowRoot) && rootNode.activeElement !== ref && !ref.contains(rootNode.activeElement)) {
|
|
234
|
-
stopPropagation(e);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
if ((_e$target = e.target) != null && _e$target.isContentEditable && !(memoisedOptions != null && memoisedOptions.enableOnContentEditable)) return;
|
|
239
|
-
parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function(key) {
|
|
240
|
-
var _hotkey$keys;
|
|
241
|
-
var hotkey = parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey);
|
|
242
|
-
if (isHotkeyMatchingKeyboardEvent(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.ignoreModifiers) || (_hotkey$keys = hotkey.keys) != null && _hotkey$keys.includes("*")) {
|
|
243
|
-
if (memoisedOptions != null && memoisedOptions.ignoreEventWhen != null && memoisedOptions.ignoreEventWhen(e)) return;
|
|
244
|
-
if (isKeyUp && hasTriggeredRef.current) return;
|
|
245
|
-
maybePreventDefault(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.preventDefault);
|
|
246
|
-
if (!isHotkeyEnabled(e, hotkey, memoisedOptions == null ? void 0 : memoisedOptions.enabled)) {
|
|
247
|
-
stopPropagation(e);
|
|
248
|
-
return;
|
|
249
|
-
}
|
|
250
|
-
cbRef.current(e, hotkey);
|
|
251
|
-
if (!isKeyUp) hasTriggeredRef.current = true;
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
};
|
|
255
|
-
var handleKeyDown = function handleKeyDown(event) {
|
|
256
|
-
if (event.key === void 0) return;
|
|
257
|
-
pushToCurrentlyPressedKeys(mapKey(event.code));
|
|
258
|
-
if ((memoisedOptions == null ? void 0 : memoisedOptions.keydown) === void 0 && (memoisedOptions == null ? void 0 : memoisedOptions.keyup) !== true || memoisedOptions != null && memoisedOptions.keydown) listener(event);
|
|
259
|
-
};
|
|
260
|
-
var handleKeyUp = function handleKeyUp(event) {
|
|
261
|
-
if (event.key === void 0) return;
|
|
262
|
-
removeFromCurrentlyPressedKeys(mapKey(event.code));
|
|
263
|
-
hasTriggeredRef.current = false;
|
|
264
|
-
if (memoisedOptions != null && memoisedOptions.keyup) listener(event, true);
|
|
265
|
-
};
|
|
266
|
-
var domNode = ref || (_options == null ? void 0 : _options.document) || document;
|
|
267
|
-
domNode.addEventListener("keyup", handleKeyUp);
|
|
268
|
-
domNode.addEventListener("keydown", handleKeyDown);
|
|
269
|
-
if (proxy) parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function(key) {
|
|
270
|
-
return proxy.addHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));
|
|
271
|
-
});
|
|
272
|
-
return function() {
|
|
273
|
-
domNode.removeEventListener("keyup", handleKeyUp);
|
|
274
|
-
domNode.removeEventListener("keydown", handleKeyDown);
|
|
275
|
-
if (proxy) parseKeysHookInput(_keys, memoisedOptions == null ? void 0 : memoisedOptions.splitKey).forEach(function(key) {
|
|
276
|
-
return proxy.removeHotkey(parseHotkey(key, memoisedOptions == null ? void 0 : memoisedOptions.combinationKey, memoisedOptions == null ? void 0 : memoisedOptions.description));
|
|
277
|
-
});
|
|
278
|
-
};
|
|
279
|
-
}, [
|
|
280
|
-
ref,
|
|
281
|
-
_keys,
|
|
282
|
-
memoisedOptions,
|
|
283
|
-
enabledScopes
|
|
284
|
-
]);
|
|
285
|
-
return setRef;
|
|
286
|
-
}
|
|
287
|
-
//#endregion
|
|
288
|
-
export { useHotkeys };
|