@tanstack/hotkeys-devtools 0.9.0 → 1.1.0
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/README.md +15 -1
- package/dist/HotkeysContextProvider.js +1 -2
- package/dist/_registrations.js +47 -0
- package/dist/components/ActionButtons.js +2 -3
- package/dist/components/DetailsPanel.js +317 -325
- package/dist/components/HeldKeysTopbar.js +5 -3
- package/dist/components/HotkeyList.js +167 -196
- package/dist/components/Shell.js +5 -4
- package/dist/components/index.js +1 -2
- package/dist/core.d.ts +3 -6
- package/dist/core.js +1 -2
- package/dist/index.d.ts +2 -4
- package/dist/index.js +1 -2
- package/dist/sequence-progress.js +1 -2
- package/dist/styles/tokens.js +1 -2
- package/dist/styles/use-styles.js +5 -4
- package/package.json +11 -11
- package/dist/HotkeysContextProvider.js.map +0 -1
- package/dist/components/ActionButtons.js.map +0 -1
- package/dist/components/DetailsPanel.js.map +0 -1
- package/dist/components/HeldKeysTopbar.js.map +0 -1
- package/dist/components/HotkeyList.js.map +0 -1
- package/dist/components/Shell.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/core.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/sequence-progress.js.map +0 -1
- package/dist/styles/tokens.js.map +0 -1
- package/dist/styles/use-styles.js.map +0 -1
- package/src/HotkeysContextProvider.tsx +0 -130
- package/src/components/ActionButtons.tsx +0 -38
- package/src/components/DetailsPanel.tsx +0 -829
- package/src/components/HeldKeysTopbar.tsx +0 -46
- package/src/components/HotkeyList.tsx +0 -565
- package/src/components/Shell.tsx +0 -171
- package/src/components/index.tsx +0 -19
- package/src/core.tsx +0 -11
- package/src/index.ts +0 -11
- package/src/production.ts +0 -5
- package/src/sequence-progress.ts +0 -29
- package/src/styles/tokens.ts +0 -305
- package/src/styles/use-styles.ts +0 -687
|
@@ -5,7 +5,10 @@ import { For, Show } from "solid-js";
|
|
|
5
5
|
import { detectPlatform, formatForDisplay } from "@tanstack/hotkeys";
|
|
6
6
|
|
|
7
7
|
//#region src/components/HeldKeysTopbar.tsx
|
|
8
|
-
var _tmpl$ =
|
|
8
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div><span>Held</span><div>`);
|
|
9
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<span>--`);
|
|
10
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<span>`);
|
|
11
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<span><span>`);
|
|
9
12
|
function HeldKeysBar() {
|
|
10
13
|
const styles = useStyles();
|
|
11
14
|
const state = useHotkeysDevtoolsState();
|
|
@@ -74,5 +77,4 @@ function HeldKeysBar() {
|
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
//#endregion
|
|
77
|
-
export { HeldKeysBar };
|
|
78
|
-
//# sourceMappingURL=HeldKeysTopbar.js.map
|
|
80
|
+
export { HeldKeysBar };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { effectiveSequenceMatchedSteps } from "../sequence-progress.js";
|
|
2
2
|
import { useHotkeysDevtoolsState } from "../HotkeysContextProvider.js";
|
|
3
3
|
import { useStyles } from "../styles/use-styles.js";
|
|
4
|
+
import { formatRegistration, getBindingKind, useRegistrationConflicts } from "../_registrations.js";
|
|
4
5
|
import { className, createComponent, delegateEvents, effect, insert, memo, template } from "solid-js/web";
|
|
5
6
|
import { For, Show, createEffect, createMemo, createSignal, on } from "solid-js";
|
|
6
7
|
import { formatForDisplay } from "@tanstack/hotkeys";
|
|
@@ -8,10 +9,18 @@ import clsx from "clsx";
|
|
|
8
9
|
import { matchSorter } from "match-sorter";
|
|
9
10
|
|
|
10
11
|
//#region src/components/HotkeyList.tsx
|
|
11
|
-
var _tmpl$ =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
var _tmpl$ = /*#__PURE__*/ template(`<span data-tooltip>`);
|
|
13
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<span>`);
|
|
14
|
+
var _tmpl$3 = /*#__PURE__*/ template(`<span>x`);
|
|
15
|
+
var _tmpl$4 = /*#__PURE__*/ template(`<div><span><span></span></span><div><span data-binding-kind></span><span><span data-tooltip></span></span><span><span data-tooltip>Fires on <!> event</span></span><span><span data-tooltip>`);
|
|
16
|
+
var _tmpl$5 = /*#__PURE__*/ template(`<span><span>`);
|
|
17
|
+
var _tmpl$6 = /*#__PURE__*/ template(`<span><span data-tooltip>`);
|
|
18
|
+
var _tmpl$7 = /*#__PURE__*/ template(`<span>i<span data-tooltip>`);
|
|
19
|
+
var _tmpl$8 = /*#__PURE__*/ template(`<button>×`);
|
|
20
|
+
var _tmpl$9 = /*#__PURE__*/ template(`<div><input type=text placeholder="Search hotkeys...">`);
|
|
21
|
+
var _tmpl$0 = /*#__PURE__*/ template(`<div>Hotkeys (<!>)`);
|
|
22
|
+
var _tmpl$1 = /*#__PURE__*/ template(`<div>`);
|
|
23
|
+
var _tmpl$10 = /*#__PURE__*/ template(`<div>Sequences (<!>)`);
|
|
15
24
|
function getTargetLabel(target) {
|
|
16
25
|
if (typeof document !== "undefined" && target === document) return "document";
|
|
17
26
|
if (typeof window !== "undefined" && target === window) return "window";
|
|
@@ -34,21 +43,10 @@ function getTargetTooltip(target) {
|
|
|
34
43
|
}
|
|
35
44
|
return "Listening on element";
|
|
36
45
|
}
|
|
37
|
-
function findTargetConflicts(registration, all) {
|
|
38
|
-
return all.filter((other) => other.id !== registration.id && other.hotkey === registration.hotkey && other.options.eventType === registration.options.eventType && other.target === registration.target);
|
|
39
|
-
}
|
|
40
|
-
function findScopeConflicts(registration, all) {
|
|
41
|
-
return all.filter((other) => other.id !== registration.id && other.hotkey === registration.hotkey && other.options.eventType === registration.options.eventType && other.target !== registration.target);
|
|
42
|
-
}
|
|
43
|
-
function findSequenceTargetConflicts(registration, all) {
|
|
44
|
-
return all.filter((other) => other.id !== registration.id && sequenceKey(other.sequence) === sequenceKey(registration.sequence) && other.options.eventType === registration.options.eventType && other.target === registration.target);
|
|
45
|
-
}
|
|
46
|
-
function findSequenceScopeConflicts(registration, all) {
|
|
47
|
-
return all.filter((other) => other.id !== registration.id && sequenceKey(other.sequence) === sequenceKey(registration.sequence) && other.options.eventType === registration.options.eventType && other.target !== registration.target);
|
|
48
|
-
}
|
|
49
46
|
function buildRowTooltip(meta) {
|
|
50
47
|
if (!meta) return void 0;
|
|
51
48
|
const parts = [];
|
|
49
|
+
if (meta.group) parts.push(meta.group);
|
|
52
50
|
if (meta.name) parts.push(meta.name);
|
|
53
51
|
if (meta.description) parts.push(meta.description);
|
|
54
52
|
return parts.length > 0 ? parts.join(" — ") : void 0;
|
|
@@ -56,34 +54,17 @@ function buildRowTooltip(meta) {
|
|
|
56
54
|
function SequenceListRow(props) {
|
|
57
55
|
const styles = useStyles();
|
|
58
56
|
const sequenceRegistrations = () => props.getSequences();
|
|
59
|
-
const
|
|
60
|
-
const
|
|
57
|
+
const conflicts = useRegistrationConflicts(() => props.reg);
|
|
58
|
+
const targetConflicts = () => conflicts().overlapping;
|
|
59
|
+
const scopeConflicts = () => conflicts().separate;
|
|
61
60
|
const hasTargetConflict = () => targetConflicts().length > 0;
|
|
62
61
|
const hasScopeConflict = () => scopeConflicts().length > 0;
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
label: "~",
|
|
70
|
-
tooltip: `Allowed: ${c.length} other binding${c.length > 1 ? "s" : ""} on same sequence and target (conflictBehavior: allow)`
|
|
71
|
-
};
|
|
72
|
-
if (behavior === "error") return {
|
|
73
|
-
style: "badgeError",
|
|
74
|
-
label: "!",
|
|
75
|
-
tooltip: `Error: ${c.length} conflicting binding${c.length > 1 ? "s" : ""} on same sequence and target (conflictBehavior: error)`
|
|
76
|
-
};
|
|
77
|
-
return {
|
|
78
|
-
style: "badgeConflict",
|
|
79
|
-
label: "!",
|
|
80
|
-
tooltip: `Warning: ${c.length} other binding${c.length > 1 ? "s" : ""} on same sequence and target`
|
|
81
|
-
};
|
|
82
|
-
};
|
|
83
|
-
const scopeConflictTooltip = () => {
|
|
84
|
-
const c = scopeConflicts();
|
|
85
|
-
return `Info: ${c.length} binding${c.length > 1 ? "s" : ""} with same sequence on different target${c.length > 1 ? "s" : ""}`;
|
|
86
|
-
};
|
|
62
|
+
const targetConflictBadge = () => ({
|
|
63
|
+
style: "badgeConflict",
|
|
64
|
+
label: "!",
|
|
65
|
+
tooltip: `Potential overlap: ${targetConflicts().length} other bindings on overlapping targets`
|
|
66
|
+
});
|
|
67
|
+
const scopeConflictTooltip = () => `Info: ${scopeConflicts().length} related bindings on separate targets`;
|
|
87
68
|
const enabled = () => props.reg.options.enabled !== false;
|
|
88
69
|
const liveSequenceReg = createMemo(() => sequenceRegistrations().find((r) => r.id === props.reg.id) ?? props.reg);
|
|
89
70
|
const triggerCount = () => sequenceRegistrations().find((r) => r.id === props.reg.id)?.triggerCount ?? props.reg.triggerCount;
|
|
@@ -100,9 +81,9 @@ function SequenceListRow(props) {
|
|
|
100
81
|
const metaName = () => props.reg.options.meta?.name;
|
|
101
82
|
const rowTooltip = () => buildRowTooltip(props.reg.options.meta);
|
|
102
83
|
return (() => {
|
|
103
|
-
var _el$ = _tmpl$4(), _el$3 = _el$.firstChild, _el$4 = _el$3.firstChild, _el$8 = _el$3.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.
|
|
104
|
-
_el$
|
|
105
|
-
var _el$
|
|
84
|
+
var _el$ = _tmpl$4(), _el$3 = _el$.firstChild, _el$4 = _el$3.firstChild, _el$8 = _el$3.nextSibling, _el$9 = _el$8.firstChild, _el$0 = _el$9.nextSibling, _el$1 = _el$0.firstChild, _el$10 = _el$0.nextSibling, _el$11 = _el$10.firstChild, _el$14 = _el$11.firstChild.nextSibling;
|
|
85
|
+
_el$14.nextSibling;
|
|
86
|
+
var _el$15 = _el$10.nextSibling, _el$16 = _el$15.firstChild;
|
|
106
87
|
_el$.$$click = () => props.setSelectedId(props.reg.id);
|
|
107
88
|
insert(_el$, createComponent(Show, {
|
|
108
89
|
get when() {
|
|
@@ -120,16 +101,16 @@ function SequenceListRow(props) {
|
|
|
120
101
|
return liveSequenceReg().sequence;
|
|
121
102
|
},
|
|
122
103
|
children: (step, i) => (() => {
|
|
123
|
-
var _el$
|
|
124
|
-
insert(_el$
|
|
104
|
+
var _el$17 = _tmpl$5(), _el$18 = _el$17.firstChild;
|
|
105
|
+
insert(_el$17, createComponent(Show, {
|
|
125
106
|
get when() {
|
|
126
107
|
return i() > 0;
|
|
127
108
|
},
|
|
128
109
|
children: " "
|
|
129
|
-
}), _el$
|
|
130
|
-
insert(_el$
|
|
131
|
-
effect(() => className(_el$
|
|
132
|
-
return _el$
|
|
110
|
+
}), _el$18);
|
|
111
|
+
insert(_el$18, () => formatForDisplay(step, { platform: props.reg.options.platform }));
|
|
112
|
+
effect(() => className(_el$18, i() < matchedSteps() ? styles().sequenceStepMatched : void 0));
|
|
113
|
+
return _el$17;
|
|
133
114
|
})()
|
|
134
115
|
}));
|
|
135
116
|
insert(_el$3, createComponent(Show, {
|
|
@@ -155,49 +136,50 @@ function SequenceListRow(props) {
|
|
|
155
136
|
return _el$6;
|
|
156
137
|
}
|
|
157
138
|
}), _el$8);
|
|
139
|
+
insert(_el$9, () => getBindingKind(props.reg));
|
|
158
140
|
insert(_el$8, (() => {
|
|
159
141
|
var _c$ = memo(() => !!hasTargetConflict());
|
|
160
142
|
return () => _c$() && (() => {
|
|
161
|
-
var _el$
|
|
162
|
-
insert(_el$
|
|
163
|
-
insert(_el$
|
|
143
|
+
var _el$19 = _tmpl$6(), _el$20 = _el$19.firstChild;
|
|
144
|
+
insert(_el$19, () => targetConflictBadge().label, _el$20);
|
|
145
|
+
insert(_el$20, () => targetConflictBadge().tooltip);
|
|
164
146
|
effect((_p$) => {
|
|
165
|
-
var _v$
|
|
166
|
-
_v$
|
|
167
|
-
_v$
|
|
147
|
+
var _v$10 = clsx(styles().badge, styles()[targetConflictBadge().style], styles().tooltip), _v$11 = styles().tooltipText;
|
|
148
|
+
_v$10 !== _p$.e && className(_el$19, _p$.e = _v$10);
|
|
149
|
+
_v$11 !== _p$.t && className(_el$20, _p$.t = _v$11);
|
|
168
150
|
return _p$;
|
|
169
151
|
}, {
|
|
170
152
|
e: void 0,
|
|
171
153
|
t: void 0
|
|
172
154
|
});
|
|
173
|
-
return _el$
|
|
155
|
+
return _el$19;
|
|
174
156
|
})();
|
|
175
|
-
})(), _el$
|
|
157
|
+
})(), _el$0);
|
|
176
158
|
insert(_el$8, (() => {
|
|
177
159
|
var _c$2 = memo(() => !!hasScopeConflict());
|
|
178
160
|
return () => _c$2() && (() => {
|
|
179
|
-
var _el$
|
|
180
|
-
insert(_el$
|
|
161
|
+
var _el$21 = _tmpl$7(), _el$23 = _el$21.firstChild.nextSibling;
|
|
162
|
+
insert(_el$23, scopeConflictTooltip);
|
|
181
163
|
effect((_p$) => {
|
|
182
|
-
var _v$
|
|
183
|
-
_v$
|
|
184
|
-
_v$
|
|
164
|
+
var _v$12 = clsx(styles().badge, styles().badgeInfo, styles().tooltip), _v$13 = styles().tooltipText;
|
|
165
|
+
_v$12 !== _p$.e && className(_el$21, _p$.e = _v$12);
|
|
166
|
+
_v$13 !== _p$.t && className(_el$23, _p$.t = _v$13);
|
|
185
167
|
return _p$;
|
|
186
168
|
}, {
|
|
187
169
|
e: void 0,
|
|
188
170
|
t: void 0
|
|
189
171
|
});
|
|
190
|
-
return _el$
|
|
172
|
+
return _el$21;
|
|
191
173
|
})();
|
|
192
|
-
})(), _el$
|
|
193
|
-
insert(_el$
|
|
194
|
-
insert(_el$
|
|
195
|
-
insert(_el$
|
|
196
|
-
insert(_el$
|
|
197
|
-
insert(_el$
|
|
198
|
-
insert(_el$
|
|
174
|
+
})(), _el$0);
|
|
175
|
+
insert(_el$0, () => enabled() ? "on" : "off", _el$1);
|
|
176
|
+
insert(_el$1, () => enabled() ? "Sequence is enabled" : "Sequence is disabled");
|
|
177
|
+
insert(_el$10, () => props.reg.options.eventType ?? "keydown", _el$11);
|
|
178
|
+
insert(_el$11, () => props.reg.options.eventType ?? "keydown", _el$14);
|
|
179
|
+
insert(_el$15, () => getTargetLabel(props.reg.target), _el$16);
|
|
180
|
+
insert(_el$16, () => getTargetTooltip(props.reg.target));
|
|
199
181
|
effect((_p$) => {
|
|
200
|
-
var _v$ = clsx(styles().hotkeyRow, props.selectedId() === props.reg.id && styles().hotkeyRowSelected, pulsing() && styles().hotkeyRowTriggered, rowTooltip() && styles().tooltip), _v$2 = styles().hotkeyLabel, _v$3 = styles().hotkeyLabelKeys, _v$4 = styles().hotkeyBadges, _v$5 = clsx(styles().badge, enabled() ? styles().badgeEnabled : styles().badgeDisabled, styles().tooltip), _v$
|
|
182
|
+
var _v$ = clsx(styles().hotkeyRow, props.selectedId() === props.reg.id && styles().hotkeyRowSelected, pulsing() && styles().hotkeyRowTriggered, rowTooltip() && styles().tooltip), _v$2 = styles().hotkeyLabel, _v$3 = styles().hotkeyLabelKeys, _v$4 = styles().hotkeyBadges, _v$5 = clsx(styles().badge, styles().badgeTarget), _v$6 = clsx(styles().badge, enabled() ? styles().badgeEnabled : styles().badgeDisabled, styles().tooltip), _v$7 = styles().tooltipText, _v$8 = clsx(styles().badge, (props.reg.options.eventType ?? "keydown") === "keydown" ? styles().badgeKeydown : styles().badgeKeyup, styles().tooltip), _v$9 = styles().tooltipText, _v$0 = clsx(styles().badge, styles().badgeTarget, styles().tooltip), _v$1 = styles().tooltipText;
|
|
201
183
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
202
184
|
_v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
|
|
203
185
|
_v$3 !== _p$.a && className(_el$4, _p$.a = _v$3);
|
|
@@ -206,8 +188,9 @@ function SequenceListRow(props) {
|
|
|
206
188
|
_v$6 !== _p$.n && className(_el$0, _p$.n = _v$6);
|
|
207
189
|
_v$7 !== _p$.s && className(_el$1, _p$.s = _v$7);
|
|
208
190
|
_v$8 !== _p$.h && className(_el$10, _p$.h = _v$8);
|
|
209
|
-
_v$9 !== _p$.r && className(_el$
|
|
191
|
+
_v$9 !== _p$.r && className(_el$11, _p$.r = _v$9);
|
|
210
192
|
_v$0 !== _p$.d && className(_el$15, _p$.d = _v$0);
|
|
193
|
+
_v$1 !== _p$.l && className(_el$16, _p$.l = _v$1);
|
|
211
194
|
return _p$;
|
|
212
195
|
}, {
|
|
213
196
|
e: void 0,
|
|
@@ -219,7 +202,8 @@ function SequenceListRow(props) {
|
|
|
219
202
|
s: void 0,
|
|
220
203
|
h: void 0,
|
|
221
204
|
r: void 0,
|
|
222
|
-
d: void 0
|
|
205
|
+
d: void 0,
|
|
206
|
+
l: void 0
|
|
223
207
|
});
|
|
224
208
|
return _el$;
|
|
225
209
|
})();
|
|
@@ -234,91 +218,76 @@ function HotkeyList(props) {
|
|
|
234
218
|
const query = searchQuery().trim();
|
|
235
219
|
if (!query) return registrations();
|
|
236
220
|
return matchSorter(registrations(), query, { keys: [
|
|
237
|
-
(r) =>
|
|
221
|
+
(r) => formatRegistration(r),
|
|
238
222
|
"hotkey",
|
|
239
223
|
"options.meta.name",
|
|
240
|
-
"options.meta.description"
|
|
224
|
+
"options.meta.description",
|
|
225
|
+
"options.meta.group"
|
|
241
226
|
] });
|
|
242
227
|
});
|
|
243
228
|
const filteredSequenceRegistrations = createMemo(() => {
|
|
244
229
|
const query = searchQuery().trim();
|
|
245
230
|
if (!query) return sequenceRegistrations();
|
|
246
231
|
return matchSorter(sequenceRegistrations(), query, { keys: [
|
|
247
|
-
(r) => r
|
|
232
|
+
(r) => formatRegistration(r),
|
|
248
233
|
(r) => r.sequence.join(" "),
|
|
249
234
|
"options.meta.name",
|
|
250
|
-
"options.meta.description"
|
|
235
|
+
"options.meta.description",
|
|
236
|
+
"options.meta.group"
|
|
251
237
|
] });
|
|
252
238
|
});
|
|
253
239
|
return [
|
|
254
240
|
(() => {
|
|
255
|
-
var _el$
|
|
256
|
-
_el$
|
|
257
|
-
insert(_el$
|
|
241
|
+
var _el$24 = _tmpl$9(), _el$25 = _el$24.firstChild;
|
|
242
|
+
_el$25.$$input = (e) => setSearchQuery(e.currentTarget.value);
|
|
243
|
+
insert(_el$24, createComponent(Show, {
|
|
258
244
|
get when() {
|
|
259
245
|
return searchQuery();
|
|
260
246
|
},
|
|
261
247
|
get children() {
|
|
262
|
-
var _el$
|
|
263
|
-
_el$
|
|
264
|
-
effect(() => className(_el$
|
|
265
|
-
return _el$
|
|
248
|
+
var _el$26 = _tmpl$8();
|
|
249
|
+
_el$26.$$click = () => setSearchQuery("");
|
|
250
|
+
effect(() => className(_el$26, styles().searchClear));
|
|
251
|
+
return _el$26;
|
|
266
252
|
}
|
|
267
253
|
}), null);
|
|
268
254
|
effect((_p$) => {
|
|
269
|
-
var _v$
|
|
270
|
-
_v$
|
|
271
|
-
_v$
|
|
255
|
+
var _v$14 = styles().searchContainer, _v$15 = styles().searchInput;
|
|
256
|
+
_v$14 !== _p$.e && className(_el$24, _p$.e = _v$14);
|
|
257
|
+
_v$15 !== _p$.t && className(_el$25, _p$.t = _v$15);
|
|
272
258
|
return _p$;
|
|
273
259
|
}, {
|
|
274
260
|
e: void 0,
|
|
275
261
|
t: void 0
|
|
276
262
|
});
|
|
277
|
-
effect(() => _el$
|
|
278
|
-
return _el$
|
|
263
|
+
effect(() => _el$25.value = searchQuery());
|
|
264
|
+
return _el$24;
|
|
279
265
|
})(),
|
|
280
266
|
(() => {
|
|
281
|
-
var _el$
|
|
282
|
-
_el$
|
|
283
|
-
insert(_el$
|
|
284
|
-
effect(() => className(_el$
|
|
285
|
-
return _el$
|
|
267
|
+
var _el$27 = _tmpl$0(), _el$30 = _el$27.firstChild.nextSibling;
|
|
268
|
+
_el$30.nextSibling;
|
|
269
|
+
insert(_el$27, () => filteredRegistrations().length, _el$30);
|
|
270
|
+
effect(() => className(_el$27, styles().panelHeader));
|
|
271
|
+
return _el$27;
|
|
286
272
|
})(),
|
|
287
273
|
(() => {
|
|
288
|
-
var _el$
|
|
289
|
-
insert(_el$
|
|
274
|
+
var _el$31 = _tmpl$1();
|
|
275
|
+
insert(_el$31, createComponent(For, {
|
|
290
276
|
get each() {
|
|
291
277
|
return filteredRegistrations();
|
|
292
278
|
},
|
|
293
279
|
children: (reg) => {
|
|
294
|
-
const
|
|
295
|
-
const
|
|
280
|
+
const conflicts = useRegistrationConflicts(() => reg);
|
|
281
|
+
const targetConflicts = () => conflicts().overlapping;
|
|
282
|
+
const scopeConflicts = () => conflicts().separate;
|
|
296
283
|
const hasTargetConflict = () => targetConflicts().length > 0;
|
|
297
284
|
const hasScopeConflict = () => scopeConflicts().length > 0;
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
label: "~",
|
|
305
|
-
tooltip: `Allowed: ${c.length} other binding${c.length > 1 ? "s" : ""} on same key and target (conflictBehavior: allow)`
|
|
306
|
-
};
|
|
307
|
-
if (behavior === "error") return {
|
|
308
|
-
style: "badgeError",
|
|
309
|
-
label: "!",
|
|
310
|
-
tooltip: `Error: ${c.length} conflicting binding${c.length > 1 ? "s" : ""} on same key and target (conflictBehavior: error)`
|
|
311
|
-
};
|
|
312
|
-
return {
|
|
313
|
-
style: "badgeConflict",
|
|
314
|
-
label: "!",
|
|
315
|
-
tooltip: `Warning: ${c.length} other binding${c.length > 1 ? "s" : ""} on same key and target`
|
|
316
|
-
};
|
|
317
|
-
};
|
|
318
|
-
const scopeConflictTooltip = () => {
|
|
319
|
-
const c = scopeConflicts();
|
|
320
|
-
return `Info: ${c.length} binding${c.length > 1 ? "s" : ""} with same key on different target${c.length > 1 ? "s" : ""}`;
|
|
321
|
-
};
|
|
285
|
+
const targetConflictBadge = () => ({
|
|
286
|
+
style: "badgeConflict",
|
|
287
|
+
label: "!",
|
|
288
|
+
tooltip: `Potential overlap: ${targetConflicts().length} other bindings on overlapping targets`
|
|
289
|
+
});
|
|
290
|
+
const scopeConflictTooltip = () => `Info: ${scopeConflicts().length} related bindings on separate targets`;
|
|
322
291
|
const enabled = () => reg.options.enabled !== false;
|
|
323
292
|
const triggerCount = () => registrations().find((r) => r.id === reg.id)?.triggerCount ?? reg.triggerCount;
|
|
324
293
|
const [prevCount, setPrevCount] = createSignal(reg.triggerCount);
|
|
@@ -333,98 +302,100 @@ function HotkeyList(props) {
|
|
|
333
302
|
const metaName = () => reg.options.meta?.name;
|
|
334
303
|
const rowTooltip = () => buildRowTooltip(reg.options.meta);
|
|
335
304
|
return (() => {
|
|
336
|
-
var _el$
|
|
337
|
-
_el$
|
|
338
|
-
var _el$
|
|
339
|
-
_el$
|
|
340
|
-
insert(_el$
|
|
305
|
+
var _el$37 = _tmpl$4(), _el$39 = _el$37.firstChild, _el$40 = _el$39.firstChild, _el$44 = _el$39.nextSibling, _el$45 = _el$44.firstChild, _el$46 = _el$45.nextSibling, _el$47 = _el$46.firstChild, _el$48 = _el$46.nextSibling, _el$49 = _el$48.firstChild, _el$52 = _el$49.firstChild.nextSibling;
|
|
306
|
+
_el$52.nextSibling;
|
|
307
|
+
var _el$53 = _el$48.nextSibling, _el$54 = _el$53.firstChild;
|
|
308
|
+
_el$37.$$click = () => props.setSelectedId(reg.id);
|
|
309
|
+
insert(_el$37, createComponent(Show, {
|
|
341
310
|
get when() {
|
|
342
311
|
return rowTooltip();
|
|
343
312
|
},
|
|
344
313
|
get children() {
|
|
345
|
-
var _el$
|
|
346
|
-
insert(_el$
|
|
347
|
-
effect(() => className(_el$
|
|
348
|
-
return _el$
|
|
314
|
+
var _el$38 = _tmpl$();
|
|
315
|
+
insert(_el$38, rowTooltip);
|
|
316
|
+
effect(() => className(_el$38, styles().rowTooltipText));
|
|
317
|
+
return _el$38;
|
|
349
318
|
}
|
|
350
|
-
}), _el$
|
|
351
|
-
insert(_el$
|
|
352
|
-
insert(_el$
|
|
319
|
+
}), _el$39);
|
|
320
|
+
insert(_el$40, () => formatRegistration(reg));
|
|
321
|
+
insert(_el$39, createComponent(Show, {
|
|
353
322
|
get when() {
|
|
354
323
|
return metaName();
|
|
355
324
|
},
|
|
356
325
|
get children() {
|
|
357
|
-
var _el$
|
|
358
|
-
insert(_el$
|
|
359
|
-
effect(() => className(_el$
|
|
360
|
-
return _el$
|
|
326
|
+
var _el$41 = _tmpl$2();
|
|
327
|
+
insert(_el$41, metaName);
|
|
328
|
+
effect(() => className(_el$41, styles().hotkeyLabelName));
|
|
329
|
+
return _el$41;
|
|
361
330
|
}
|
|
362
331
|
}), null);
|
|
363
|
-
insert(_el$
|
|
332
|
+
insert(_el$37, createComponent(Show, {
|
|
364
333
|
get when() {
|
|
365
334
|
return triggerCount() > 0;
|
|
366
335
|
},
|
|
367
336
|
get children() {
|
|
368
|
-
var _el$
|
|
369
|
-
_el$
|
|
370
|
-
insert(_el$
|
|
371
|
-
effect(() => className(_el$
|
|
372
|
-
return _el$
|
|
337
|
+
var _el$42 = _tmpl$3();
|
|
338
|
+
_el$42.firstChild;
|
|
339
|
+
insert(_el$42, triggerCount, null);
|
|
340
|
+
effect(() => className(_el$42, styles().triggerCount));
|
|
341
|
+
return _el$42;
|
|
373
342
|
}
|
|
374
|
-
}), _el$
|
|
375
|
-
insert(_el$
|
|
343
|
+
}), _el$44);
|
|
344
|
+
insert(_el$45, () => getBindingKind(reg));
|
|
345
|
+
insert(_el$44, (() => {
|
|
376
346
|
var _c$3 = memo(() => !!hasTargetConflict());
|
|
377
347
|
return () => _c$3() && (() => {
|
|
378
|
-
var _el$
|
|
379
|
-
insert(_el$
|
|
380
|
-
insert(_el$
|
|
348
|
+
var _el$55 = _tmpl$6(), _el$56 = _el$55.firstChild;
|
|
349
|
+
insert(_el$55, () => targetConflictBadge().label, _el$56);
|
|
350
|
+
insert(_el$56, () => targetConflictBadge().tooltip);
|
|
381
351
|
effect((_p$) => {
|
|
382
|
-
var _v$
|
|
383
|
-
_v$
|
|
384
|
-
_v$
|
|
352
|
+
var _v$27 = clsx(styles().badge, styles()[targetConflictBadge().style], styles().tooltip), _v$28 = styles().tooltipText;
|
|
353
|
+
_v$27 !== _p$.e && className(_el$55, _p$.e = _v$27);
|
|
354
|
+
_v$28 !== _p$.t && className(_el$56, _p$.t = _v$28);
|
|
385
355
|
return _p$;
|
|
386
356
|
}, {
|
|
387
357
|
e: void 0,
|
|
388
358
|
t: void 0
|
|
389
359
|
});
|
|
390
|
-
return _el$
|
|
360
|
+
return _el$55;
|
|
391
361
|
})();
|
|
392
|
-
})(), _el$
|
|
393
|
-
insert(_el$
|
|
362
|
+
})(), _el$46);
|
|
363
|
+
insert(_el$44, (() => {
|
|
394
364
|
var _c$4 = memo(() => !!hasScopeConflict());
|
|
395
365
|
return () => _c$4() && (() => {
|
|
396
|
-
var _el$
|
|
397
|
-
insert(_el$
|
|
366
|
+
var _el$57 = _tmpl$7(), _el$59 = _el$57.firstChild.nextSibling;
|
|
367
|
+
insert(_el$59, scopeConflictTooltip);
|
|
398
368
|
effect((_p$) => {
|
|
399
|
-
var _v$
|
|
400
|
-
_v$
|
|
401
|
-
_v$
|
|
369
|
+
var _v$29 = clsx(styles().badge, styles().badgeInfo, styles().tooltip), _v$30 = styles().tooltipText;
|
|
370
|
+
_v$29 !== _p$.e && className(_el$57, _p$.e = _v$29);
|
|
371
|
+
_v$30 !== _p$.t && className(_el$59, _p$.t = _v$30);
|
|
402
372
|
return _p$;
|
|
403
373
|
}, {
|
|
404
374
|
e: void 0,
|
|
405
375
|
t: void 0
|
|
406
376
|
});
|
|
407
|
-
return _el$
|
|
377
|
+
return _el$57;
|
|
408
378
|
})();
|
|
409
|
-
})(), _el$
|
|
410
|
-
insert(_el$
|
|
411
|
-
insert(_el$
|
|
412
|
-
insert(_el$
|
|
413
|
-
insert(_el$
|
|
414
|
-
insert(_el$
|
|
415
|
-
insert(_el$
|
|
379
|
+
})(), _el$46);
|
|
380
|
+
insert(_el$46, () => enabled() ? "on" : "off", _el$47);
|
|
381
|
+
insert(_el$47, () => enabled() ? "Hotkey is enabled" : "Hotkey is disabled");
|
|
382
|
+
insert(_el$48, () => reg.options.eventType ?? "keydown", _el$49);
|
|
383
|
+
insert(_el$49, () => reg.options.eventType ?? "keydown", _el$52);
|
|
384
|
+
insert(_el$53, () => getTargetLabel(reg.target), _el$54);
|
|
385
|
+
insert(_el$54, () => getTargetTooltip(reg.target));
|
|
416
386
|
effect((_p$) => {
|
|
417
|
-
var _v$
|
|
418
|
-
_v$
|
|
419
|
-
_v$
|
|
420
|
-
_v$
|
|
421
|
-
_v$
|
|
422
|
-
_v$
|
|
423
|
-
_v$
|
|
424
|
-
_v$
|
|
425
|
-
_v$
|
|
426
|
-
_v$
|
|
427
|
-
_v$
|
|
387
|
+
var _v$16 = clsx(styles().hotkeyRow, props.selectedId() === reg.id && styles().hotkeyRowSelected, pulsing() && styles().hotkeyRowTriggered, rowTooltip() && styles().tooltip), _v$17 = styles().hotkeyLabel, _v$18 = styles().hotkeyLabelKeys, _v$19 = styles().hotkeyBadges, _v$20 = clsx(styles().badge, styles().badgeTarget), _v$21 = clsx(styles().badge, enabled() ? styles().badgeEnabled : styles().badgeDisabled, styles().tooltip), _v$22 = styles().tooltipText, _v$23 = clsx(styles().badge, (reg.options.eventType ?? "keydown") === "keydown" ? styles().badgeKeydown : styles().badgeKeyup, styles().tooltip), _v$24 = styles().tooltipText, _v$25 = clsx(styles().badge, styles().badgeTarget, styles().tooltip), _v$26 = styles().tooltipText;
|
|
388
|
+
_v$16 !== _p$.e && className(_el$37, _p$.e = _v$16);
|
|
389
|
+
_v$17 !== _p$.t && className(_el$39, _p$.t = _v$17);
|
|
390
|
+
_v$18 !== _p$.a && className(_el$40, _p$.a = _v$18);
|
|
391
|
+
_v$19 !== _p$.o && className(_el$44, _p$.o = _v$19);
|
|
392
|
+
_v$20 !== _p$.i && className(_el$45, _p$.i = _v$20);
|
|
393
|
+
_v$21 !== _p$.n && className(_el$46, _p$.n = _v$21);
|
|
394
|
+
_v$22 !== _p$.s && className(_el$47, _p$.s = _v$22);
|
|
395
|
+
_v$23 !== _p$.h && className(_el$48, _p$.h = _v$23);
|
|
396
|
+
_v$24 !== _p$.r && className(_el$49, _p$.r = _v$24);
|
|
397
|
+
_v$25 !== _p$.d && className(_el$53, _p$.d = _v$25);
|
|
398
|
+
_v$26 !== _p$.l && className(_el$54, _p$.l = _v$26);
|
|
428
399
|
return _p$;
|
|
429
400
|
}, {
|
|
430
401
|
e: void 0,
|
|
@@ -436,25 +407,26 @@ function HotkeyList(props) {
|
|
|
436
407
|
s: void 0,
|
|
437
408
|
h: void 0,
|
|
438
409
|
r: void 0,
|
|
439
|
-
d: void 0
|
|
410
|
+
d: void 0,
|
|
411
|
+
l: void 0
|
|
440
412
|
});
|
|
441
|
-
return _el$
|
|
413
|
+
return _el$37;
|
|
442
414
|
})();
|
|
443
415
|
}
|
|
444
416
|
}));
|
|
445
|
-
effect(() => className(_el$
|
|
446
|
-
return _el$
|
|
417
|
+
effect(() => className(_el$31, styles().hotkeyList));
|
|
418
|
+
return _el$31;
|
|
447
419
|
})(),
|
|
448
420
|
(() => {
|
|
449
|
-
var _el$
|
|
450
|
-
_el$
|
|
451
|
-
insert(_el$
|
|
452
|
-
effect(() => className(_el$
|
|
453
|
-
return _el$
|
|
421
|
+
var _el$32 = _tmpl$10(), _el$35 = _el$32.firstChild.nextSibling;
|
|
422
|
+
_el$35.nextSibling;
|
|
423
|
+
insert(_el$32, () => filteredSequenceRegistrations().length, _el$35);
|
|
424
|
+
effect(() => className(_el$32, styles().panelHeader));
|
|
425
|
+
return _el$32;
|
|
454
426
|
})(),
|
|
455
427
|
(() => {
|
|
456
|
-
var _el$
|
|
457
|
-
insert(_el$
|
|
428
|
+
var _el$36 = _tmpl$1();
|
|
429
|
+
insert(_el$36, createComponent(For, {
|
|
458
430
|
get each() {
|
|
459
431
|
return filteredSequenceRegistrations();
|
|
460
432
|
},
|
|
@@ -472,13 +444,12 @@ function HotkeyList(props) {
|
|
|
472
444
|
}
|
|
473
445
|
})
|
|
474
446
|
}));
|
|
475
|
-
effect(() => className(_el$
|
|
476
|
-
return _el$
|
|
447
|
+
effect(() => className(_el$36, styles().hotkeyList));
|
|
448
|
+
return _el$36;
|
|
477
449
|
})()
|
|
478
450
|
];
|
|
479
451
|
}
|
|
480
452
|
delegateEvents(["click", "input"]);
|
|
481
453
|
|
|
482
454
|
//#endregion
|
|
483
|
-
export { HotkeyList };
|
|
484
|
-
//# sourceMappingURL=HotkeyList.js.map
|
|
455
|
+
export { HotkeyList };
|
package/dist/components/Shell.js
CHANGED
|
@@ -8,7 +8,8 @@ import { Header, HeaderLogo, MainPanel } from "@tanstack/devtools-ui";
|
|
|
8
8
|
import { createEffect, createMemo, createSignal, onCleanup, onMount } from "solid-js";
|
|
9
9
|
|
|
10
10
|
//#region src/components/Shell.tsx
|
|
11
|
-
var _tmpl$ =
|
|
11
|
+
var _tmpl$ = /*#__PURE__*/ template(`<div><div><div style=min-width:150px;max-width:800px><div></div></div><div></div><div style=flex:1><div>Details`);
|
|
12
|
+
var _tmpl$2 = /*#__PURE__*/ template(`<div>`);
|
|
12
13
|
function readResizeObserverBlockSize(entry) {
|
|
13
14
|
const [box] = entry.borderBoxSize;
|
|
14
15
|
if (box !== void 0) return box.blockSize;
|
|
@@ -52,7 +53,8 @@ function Shell() {
|
|
|
52
53
|
if (!isDragging()) return;
|
|
53
54
|
e.preventDefault();
|
|
54
55
|
const deltaX = e.clientX - dragStartX;
|
|
55
|
-
|
|
56
|
+
const newWidth = Math.max(150, Math.min(800, dragStartWidth + deltaX));
|
|
57
|
+
setLeftPanelWidth(newWidth);
|
|
56
58
|
};
|
|
57
59
|
const handleMouseUp = () => {
|
|
58
60
|
setIsDragging(false);
|
|
@@ -153,5 +155,4 @@ function Shell() {
|
|
|
153
155
|
delegateEvents(["mousedown"]);
|
|
154
156
|
|
|
155
157
|
//#endregion
|
|
156
|
-
export { Shell };
|
|
157
|
-
//# sourceMappingURL=Shell.js.map
|
|
158
|
+
export { Shell };
|
package/dist/components/index.js
CHANGED
package/dist/core.d.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { ClassType } from "@tanstack/devtools-utils/solid";
|
|
2
|
-
|
|
3
2
|
//#region src/core.d.ts
|
|
4
|
-
interface HotkeysDevtoolsInit {}
|
|
5
|
-
declare const HotkeysDevtoolsCore: ClassType;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { HotkeysDevtoolsCore, HotkeysDevtoolsInit };
|
|
8
|
-
//# sourceMappingURL=core.d.ts.map
|
|
3
|
+
export interface HotkeysDevtoolsInit {}
|
|
4
|
+
export declare const HotkeysDevtoolsCore: ClassType;
|
|
5
|
+
//#endregion
|
package/dist/core.js
CHANGED