@tanstack/hotkeys-devtools 0.8.1 → 1.0.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/_registrations.js +48 -0
- package/dist/_registrations.js.map +1 -0
- package/dist/components/DetailsPanel.js +302 -323
- package/dist/components/DetailsPanel.js.map +1 -1
- package/dist/components/HotkeyList.js +155 -194
- package/dist/components/HotkeyList.js.map +1 -1
- package/package.json +4 -4
- package/src/_registrations.ts +59 -0
- package/src/components/DetailsPanel.tsx +53 -197
- package/src/components/HotkeyList.tsx +48 -140
|
@@ -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,7 @@ import clsx from "clsx";
|
|
|
8
9
|
import { matchSorter } from "match-sorter";
|
|
9
10
|
|
|
10
11
|
//#region src/components/HotkeyList.tsx
|
|
11
|
-
var _tmpl$ = /* @__PURE__ */ template(`<span data-tooltip>`), _tmpl$2 = /* @__PURE__ */ template(`<span>`), _tmpl$3 = /* @__PURE__ */ template(`<span>x`), _tmpl$4 = /* @__PURE__ */ template(`<div><span><span></span></span><div><span><span data-tooltip></span></span><span><span data-tooltip>Fires on <!> event</span></span><span><span data-tooltip>`), _tmpl$5 = /* @__PURE__ */ template(`<span><span>`), _tmpl$6 = /* @__PURE__ */ template(`<span><span data-tooltip>`), _tmpl$7 = /* @__PURE__ */ template(`<span>i<span data-tooltip>`), _tmpl$8 = /* @__PURE__ */ template(`<button>×`), _tmpl$9 = /* @__PURE__ */ template(`<div><input type=text placeholder="Search hotkeys...">`), _tmpl$0 = /* @__PURE__ */ template(`<div>Hotkeys (<!>)`), _tmpl$1 = /* @__PURE__ */ template(`<div>`), _tmpl$10 = /* @__PURE__ */ template(`<div>Sequences (<!>)`);
|
|
12
|
-
function sequenceKey(sequence) {
|
|
13
|
-
return sequence.join("|");
|
|
14
|
-
}
|
|
12
|
+
var _tmpl$ = /* @__PURE__ */ template(`<span data-tooltip>`), _tmpl$2 = /* @__PURE__ */ template(`<span>`), _tmpl$3 = /* @__PURE__ */ template(`<span>x`), _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>`), _tmpl$5 = /* @__PURE__ */ template(`<span><span>`), _tmpl$6 = /* @__PURE__ */ template(`<span><span data-tooltip>`), _tmpl$7 = /* @__PURE__ */ template(`<span>i<span data-tooltip>`), _tmpl$8 = /* @__PURE__ */ template(`<button>×`), _tmpl$9 = /* @__PURE__ */ template(`<div><input type=text placeholder="Search hotkeys...">`), _tmpl$0 = /* @__PURE__ */ template(`<div>Hotkeys (<!>)`), _tmpl$1 = /* @__PURE__ */ template(`<div>`), _tmpl$10 = /* @__PURE__ */ template(`<div>Sequences (<!>)`);
|
|
15
13
|
function getTargetLabel(target) {
|
|
16
14
|
if (typeof document !== "undefined" && target === document) return "document";
|
|
17
15
|
if (typeof window !== "undefined" && target === window) return "window";
|
|
@@ -34,21 +32,10 @@ function getTargetTooltip(target) {
|
|
|
34
32
|
}
|
|
35
33
|
return "Listening on element";
|
|
36
34
|
}
|
|
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
35
|
function buildRowTooltip(meta) {
|
|
50
36
|
if (!meta) return void 0;
|
|
51
37
|
const parts = [];
|
|
38
|
+
if (meta.group) parts.push(meta.group);
|
|
52
39
|
if (meta.name) parts.push(meta.name);
|
|
53
40
|
if (meta.description) parts.push(meta.description);
|
|
54
41
|
return parts.length > 0 ? parts.join(" — ") : void 0;
|
|
@@ -56,34 +43,17 @@ function buildRowTooltip(meta) {
|
|
|
56
43
|
function SequenceListRow(props) {
|
|
57
44
|
const styles = useStyles();
|
|
58
45
|
const sequenceRegistrations = () => props.getSequences();
|
|
59
|
-
const
|
|
60
|
-
const
|
|
46
|
+
const conflicts = useRegistrationConflicts(() => props.reg);
|
|
47
|
+
const targetConflicts = () => conflicts().overlapping;
|
|
48
|
+
const scopeConflicts = () => conflicts().separate;
|
|
61
49
|
const hasTargetConflict = () => targetConflicts().length > 0;
|
|
62
50
|
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
|
-
};
|
|
51
|
+
const targetConflictBadge = () => ({
|
|
52
|
+
style: "badgeConflict",
|
|
53
|
+
label: "!",
|
|
54
|
+
tooltip: `Potential overlap: ${targetConflicts().length} other bindings on overlapping targets`
|
|
55
|
+
});
|
|
56
|
+
const scopeConflictTooltip = () => `Info: ${scopeConflicts().length} related bindings on separate targets`;
|
|
87
57
|
const enabled = () => props.reg.options.enabled !== false;
|
|
88
58
|
const liveSequenceReg = createMemo(() => sequenceRegistrations().find((r) => r.id === props.reg.id) ?? props.reg);
|
|
89
59
|
const triggerCount = () => sequenceRegistrations().find((r) => r.id === props.reg.id)?.triggerCount ?? props.reg.triggerCount;
|
|
@@ -100,9 +70,9 @@ function SequenceListRow(props) {
|
|
|
100
70
|
const metaName = () => props.reg.options.meta?.name;
|
|
101
71
|
const rowTooltip = () => buildRowTooltip(props.reg.options.meta);
|
|
102
72
|
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$
|
|
73
|
+
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;
|
|
74
|
+
_el$14.nextSibling;
|
|
75
|
+
var _el$15 = _el$10.nextSibling, _el$16 = _el$15.firstChild;
|
|
106
76
|
_el$.$$click = () => props.setSelectedId(props.reg.id);
|
|
107
77
|
insert(_el$, createComponent(Show, {
|
|
108
78
|
get when() {
|
|
@@ -120,16 +90,16 @@ function SequenceListRow(props) {
|
|
|
120
90
|
return liveSequenceReg().sequence;
|
|
121
91
|
},
|
|
122
92
|
children: (step, i) => (() => {
|
|
123
|
-
var _el$
|
|
124
|
-
insert(_el$
|
|
93
|
+
var _el$17 = _tmpl$5(), _el$18 = _el$17.firstChild;
|
|
94
|
+
insert(_el$17, createComponent(Show, {
|
|
125
95
|
get when() {
|
|
126
96
|
return i() > 0;
|
|
127
97
|
},
|
|
128
98
|
children: " "
|
|
129
|
-
}), _el$
|
|
130
|
-
insert(_el$
|
|
131
|
-
effect(() => className(_el$
|
|
132
|
-
return _el$
|
|
99
|
+
}), _el$18);
|
|
100
|
+
insert(_el$18, () => formatForDisplay(step, { platform: props.reg.options.platform }));
|
|
101
|
+
effect(() => className(_el$18, i() < matchedSteps() ? styles().sequenceStepMatched : void 0));
|
|
102
|
+
return _el$17;
|
|
133
103
|
})()
|
|
134
104
|
}));
|
|
135
105
|
insert(_el$3, createComponent(Show, {
|
|
@@ -155,49 +125,50 @@ function SequenceListRow(props) {
|
|
|
155
125
|
return _el$6;
|
|
156
126
|
}
|
|
157
127
|
}), _el$8);
|
|
128
|
+
insert(_el$9, () => getBindingKind(props.reg));
|
|
158
129
|
insert(_el$8, (() => {
|
|
159
130
|
var _c$ = memo(() => !!hasTargetConflict());
|
|
160
131
|
return () => _c$() && (() => {
|
|
161
|
-
var _el$
|
|
162
|
-
insert(_el$
|
|
163
|
-
insert(_el$
|
|
132
|
+
var _el$19 = _tmpl$6(), _el$20 = _el$19.firstChild;
|
|
133
|
+
insert(_el$19, () => targetConflictBadge().label, _el$20);
|
|
134
|
+
insert(_el$20, () => targetConflictBadge().tooltip);
|
|
164
135
|
effect((_p$) => {
|
|
165
|
-
var _v$
|
|
166
|
-
_v$
|
|
167
|
-
_v$
|
|
136
|
+
var _v$10 = clsx(styles().badge, styles()[targetConflictBadge().style], styles().tooltip), _v$11 = styles().tooltipText;
|
|
137
|
+
_v$10 !== _p$.e && className(_el$19, _p$.e = _v$10);
|
|
138
|
+
_v$11 !== _p$.t && className(_el$20, _p$.t = _v$11);
|
|
168
139
|
return _p$;
|
|
169
140
|
}, {
|
|
170
141
|
e: void 0,
|
|
171
142
|
t: void 0
|
|
172
143
|
});
|
|
173
|
-
return _el$
|
|
144
|
+
return _el$19;
|
|
174
145
|
})();
|
|
175
|
-
})(), _el$
|
|
146
|
+
})(), _el$0);
|
|
176
147
|
insert(_el$8, (() => {
|
|
177
148
|
var _c$2 = memo(() => !!hasScopeConflict());
|
|
178
149
|
return () => _c$2() && (() => {
|
|
179
|
-
var _el$
|
|
180
|
-
insert(_el$
|
|
150
|
+
var _el$21 = _tmpl$7(), _el$23 = _el$21.firstChild.nextSibling;
|
|
151
|
+
insert(_el$23, scopeConflictTooltip);
|
|
181
152
|
effect((_p$) => {
|
|
182
|
-
var _v$
|
|
183
|
-
_v$
|
|
184
|
-
_v$
|
|
153
|
+
var _v$12 = clsx(styles().badge, styles().badgeInfo, styles().tooltip), _v$13 = styles().tooltipText;
|
|
154
|
+
_v$12 !== _p$.e && className(_el$21, _p$.e = _v$12);
|
|
155
|
+
_v$13 !== _p$.t && className(_el$23, _p$.t = _v$13);
|
|
185
156
|
return _p$;
|
|
186
157
|
}, {
|
|
187
158
|
e: void 0,
|
|
188
159
|
t: void 0
|
|
189
160
|
});
|
|
190
|
-
return _el$
|
|
161
|
+
return _el$21;
|
|
191
162
|
})();
|
|
192
|
-
})(), _el$
|
|
193
|
-
insert(_el$
|
|
194
|
-
insert(_el$
|
|
195
|
-
insert(_el$
|
|
196
|
-
insert(_el$
|
|
197
|
-
insert(_el$
|
|
198
|
-
insert(_el$
|
|
163
|
+
})(), _el$0);
|
|
164
|
+
insert(_el$0, () => enabled() ? "on" : "off", _el$1);
|
|
165
|
+
insert(_el$1, () => enabled() ? "Sequence is enabled" : "Sequence is disabled");
|
|
166
|
+
insert(_el$10, () => props.reg.options.eventType ?? "keydown", _el$11);
|
|
167
|
+
insert(_el$11, () => props.reg.options.eventType ?? "keydown", _el$14);
|
|
168
|
+
insert(_el$15, () => getTargetLabel(props.reg.target), _el$16);
|
|
169
|
+
insert(_el$16, () => getTargetTooltip(props.reg.target));
|
|
199
170
|
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$
|
|
171
|
+
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
172
|
_v$ !== _p$.e && className(_el$, _p$.e = _v$);
|
|
202
173
|
_v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
|
|
203
174
|
_v$3 !== _p$.a && className(_el$4, _p$.a = _v$3);
|
|
@@ -206,8 +177,9 @@ function SequenceListRow(props) {
|
|
|
206
177
|
_v$6 !== _p$.n && className(_el$0, _p$.n = _v$6);
|
|
207
178
|
_v$7 !== _p$.s && className(_el$1, _p$.s = _v$7);
|
|
208
179
|
_v$8 !== _p$.h && className(_el$10, _p$.h = _v$8);
|
|
209
|
-
_v$9 !== _p$.r && className(_el$
|
|
180
|
+
_v$9 !== _p$.r && className(_el$11, _p$.r = _v$9);
|
|
210
181
|
_v$0 !== _p$.d && className(_el$15, _p$.d = _v$0);
|
|
182
|
+
_v$1 !== _p$.l && className(_el$16, _p$.l = _v$1);
|
|
211
183
|
return _p$;
|
|
212
184
|
}, {
|
|
213
185
|
e: void 0,
|
|
@@ -219,7 +191,8 @@ function SequenceListRow(props) {
|
|
|
219
191
|
s: void 0,
|
|
220
192
|
h: void 0,
|
|
221
193
|
r: void 0,
|
|
222
|
-
d: void 0
|
|
194
|
+
d: void 0,
|
|
195
|
+
l: void 0
|
|
223
196
|
});
|
|
224
197
|
return _el$;
|
|
225
198
|
})();
|
|
@@ -234,91 +207,76 @@ function HotkeyList(props) {
|
|
|
234
207
|
const query = searchQuery().trim();
|
|
235
208
|
if (!query) return registrations();
|
|
236
209
|
return matchSorter(registrations(), query, { keys: [
|
|
237
|
-
(r) =>
|
|
210
|
+
(r) => formatRegistration(r),
|
|
238
211
|
"hotkey",
|
|
239
212
|
"options.meta.name",
|
|
240
|
-
"options.meta.description"
|
|
213
|
+
"options.meta.description",
|
|
214
|
+
"options.meta.group"
|
|
241
215
|
] });
|
|
242
216
|
});
|
|
243
217
|
const filteredSequenceRegistrations = createMemo(() => {
|
|
244
218
|
const query = searchQuery().trim();
|
|
245
219
|
if (!query) return sequenceRegistrations();
|
|
246
220
|
return matchSorter(sequenceRegistrations(), query, { keys: [
|
|
247
|
-
(r) => r
|
|
221
|
+
(r) => formatRegistration(r),
|
|
248
222
|
(r) => r.sequence.join(" "),
|
|
249
223
|
"options.meta.name",
|
|
250
|
-
"options.meta.description"
|
|
224
|
+
"options.meta.description",
|
|
225
|
+
"options.meta.group"
|
|
251
226
|
] });
|
|
252
227
|
});
|
|
253
228
|
return [
|
|
254
229
|
(() => {
|
|
255
|
-
var _el$
|
|
256
|
-
_el$
|
|
257
|
-
insert(_el$
|
|
230
|
+
var _el$24 = _tmpl$9(), _el$25 = _el$24.firstChild;
|
|
231
|
+
_el$25.$$input = (e) => setSearchQuery(e.currentTarget.value);
|
|
232
|
+
insert(_el$24, createComponent(Show, {
|
|
258
233
|
get when() {
|
|
259
234
|
return searchQuery();
|
|
260
235
|
},
|
|
261
236
|
get children() {
|
|
262
|
-
var _el$
|
|
263
|
-
_el$
|
|
264
|
-
effect(() => className(_el$
|
|
265
|
-
return _el$
|
|
237
|
+
var _el$26 = _tmpl$8();
|
|
238
|
+
_el$26.$$click = () => setSearchQuery("");
|
|
239
|
+
effect(() => className(_el$26, styles().searchClear));
|
|
240
|
+
return _el$26;
|
|
266
241
|
}
|
|
267
242
|
}), null);
|
|
268
243
|
effect((_p$) => {
|
|
269
|
-
var _v$
|
|
270
|
-
_v$
|
|
271
|
-
_v$
|
|
244
|
+
var _v$14 = styles().searchContainer, _v$15 = styles().searchInput;
|
|
245
|
+
_v$14 !== _p$.e && className(_el$24, _p$.e = _v$14);
|
|
246
|
+
_v$15 !== _p$.t && className(_el$25, _p$.t = _v$15);
|
|
272
247
|
return _p$;
|
|
273
248
|
}, {
|
|
274
249
|
e: void 0,
|
|
275
250
|
t: void 0
|
|
276
251
|
});
|
|
277
|
-
effect(() => _el$
|
|
278
|
-
return _el$
|
|
252
|
+
effect(() => _el$25.value = searchQuery());
|
|
253
|
+
return _el$24;
|
|
279
254
|
})(),
|
|
280
255
|
(() => {
|
|
281
|
-
var _el$
|
|
282
|
-
_el$
|
|
283
|
-
insert(_el$
|
|
284
|
-
effect(() => className(_el$
|
|
285
|
-
return _el$
|
|
256
|
+
var _el$27 = _tmpl$0(), _el$30 = _el$27.firstChild.nextSibling;
|
|
257
|
+
_el$30.nextSibling;
|
|
258
|
+
insert(_el$27, () => filteredRegistrations().length, _el$30);
|
|
259
|
+
effect(() => className(_el$27, styles().panelHeader));
|
|
260
|
+
return _el$27;
|
|
286
261
|
})(),
|
|
287
262
|
(() => {
|
|
288
|
-
var _el$
|
|
289
|
-
insert(_el$
|
|
263
|
+
var _el$31 = _tmpl$1();
|
|
264
|
+
insert(_el$31, createComponent(For, {
|
|
290
265
|
get each() {
|
|
291
266
|
return filteredRegistrations();
|
|
292
267
|
},
|
|
293
268
|
children: (reg) => {
|
|
294
|
-
const
|
|
295
|
-
const
|
|
269
|
+
const conflicts = useRegistrationConflicts(() => reg);
|
|
270
|
+
const targetConflicts = () => conflicts().overlapping;
|
|
271
|
+
const scopeConflicts = () => conflicts().separate;
|
|
296
272
|
const hasTargetConflict = () => targetConflicts().length > 0;
|
|
297
273
|
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
|
-
};
|
|
274
|
+
const targetConflictBadge = () => ({
|
|
275
|
+
style: "badgeConflict",
|
|
276
|
+
label: "!",
|
|
277
|
+
tooltip: `Potential overlap: ${targetConflicts().length} other bindings on overlapping targets`
|
|
278
|
+
});
|
|
279
|
+
const scopeConflictTooltip = () => `Info: ${scopeConflicts().length} related bindings on separate targets`;
|
|
322
280
|
const enabled = () => reg.options.enabled !== false;
|
|
323
281
|
const triggerCount = () => registrations().find((r) => r.id === reg.id)?.triggerCount ?? reg.triggerCount;
|
|
324
282
|
const [prevCount, setPrevCount] = createSignal(reg.triggerCount);
|
|
@@ -333,98 +291,100 @@ function HotkeyList(props) {
|
|
|
333
291
|
const metaName = () => reg.options.meta?.name;
|
|
334
292
|
const rowTooltip = () => buildRowTooltip(reg.options.meta);
|
|
335
293
|
return (() => {
|
|
336
|
-
var _el$
|
|
337
|
-
_el$
|
|
338
|
-
var _el$
|
|
339
|
-
_el$
|
|
340
|
-
insert(_el$
|
|
294
|
+
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;
|
|
295
|
+
_el$52.nextSibling;
|
|
296
|
+
var _el$53 = _el$48.nextSibling, _el$54 = _el$53.firstChild;
|
|
297
|
+
_el$37.$$click = () => props.setSelectedId(reg.id);
|
|
298
|
+
insert(_el$37, createComponent(Show, {
|
|
341
299
|
get when() {
|
|
342
300
|
return rowTooltip();
|
|
343
301
|
},
|
|
344
302
|
get children() {
|
|
345
|
-
var _el$
|
|
346
|
-
insert(_el$
|
|
347
|
-
effect(() => className(_el$
|
|
348
|
-
return _el$
|
|
303
|
+
var _el$38 = _tmpl$();
|
|
304
|
+
insert(_el$38, rowTooltip);
|
|
305
|
+
effect(() => className(_el$38, styles().rowTooltipText));
|
|
306
|
+
return _el$38;
|
|
349
307
|
}
|
|
350
|
-
}), _el$
|
|
351
|
-
insert(_el$
|
|
352
|
-
insert(_el$
|
|
308
|
+
}), _el$39);
|
|
309
|
+
insert(_el$40, () => formatRegistration(reg));
|
|
310
|
+
insert(_el$39, createComponent(Show, {
|
|
353
311
|
get when() {
|
|
354
312
|
return metaName();
|
|
355
313
|
},
|
|
356
314
|
get children() {
|
|
357
|
-
var _el$
|
|
358
|
-
insert(_el$
|
|
359
|
-
effect(() => className(_el$
|
|
360
|
-
return _el$
|
|
315
|
+
var _el$41 = _tmpl$2();
|
|
316
|
+
insert(_el$41, metaName);
|
|
317
|
+
effect(() => className(_el$41, styles().hotkeyLabelName));
|
|
318
|
+
return _el$41;
|
|
361
319
|
}
|
|
362
320
|
}), null);
|
|
363
|
-
insert(_el$
|
|
321
|
+
insert(_el$37, createComponent(Show, {
|
|
364
322
|
get when() {
|
|
365
323
|
return triggerCount() > 0;
|
|
366
324
|
},
|
|
367
325
|
get children() {
|
|
368
|
-
var _el$
|
|
369
|
-
_el$
|
|
370
|
-
insert(_el$
|
|
371
|
-
effect(() => className(_el$
|
|
372
|
-
return _el$
|
|
326
|
+
var _el$42 = _tmpl$3();
|
|
327
|
+
_el$42.firstChild;
|
|
328
|
+
insert(_el$42, triggerCount, null);
|
|
329
|
+
effect(() => className(_el$42, styles().triggerCount));
|
|
330
|
+
return _el$42;
|
|
373
331
|
}
|
|
374
|
-
}), _el$
|
|
375
|
-
insert(_el$
|
|
332
|
+
}), _el$44);
|
|
333
|
+
insert(_el$45, () => getBindingKind(reg));
|
|
334
|
+
insert(_el$44, (() => {
|
|
376
335
|
var _c$3 = memo(() => !!hasTargetConflict());
|
|
377
336
|
return () => _c$3() && (() => {
|
|
378
|
-
var _el$
|
|
379
|
-
insert(_el$
|
|
380
|
-
insert(_el$
|
|
337
|
+
var _el$55 = _tmpl$6(), _el$56 = _el$55.firstChild;
|
|
338
|
+
insert(_el$55, () => targetConflictBadge().label, _el$56);
|
|
339
|
+
insert(_el$56, () => targetConflictBadge().tooltip);
|
|
381
340
|
effect((_p$) => {
|
|
382
|
-
var _v$
|
|
383
|
-
_v$
|
|
384
|
-
_v$
|
|
341
|
+
var _v$27 = clsx(styles().badge, styles()[targetConflictBadge().style], styles().tooltip), _v$28 = styles().tooltipText;
|
|
342
|
+
_v$27 !== _p$.e && className(_el$55, _p$.e = _v$27);
|
|
343
|
+
_v$28 !== _p$.t && className(_el$56, _p$.t = _v$28);
|
|
385
344
|
return _p$;
|
|
386
345
|
}, {
|
|
387
346
|
e: void 0,
|
|
388
347
|
t: void 0
|
|
389
348
|
});
|
|
390
|
-
return _el$
|
|
349
|
+
return _el$55;
|
|
391
350
|
})();
|
|
392
|
-
})(), _el$
|
|
393
|
-
insert(_el$
|
|
351
|
+
})(), _el$46);
|
|
352
|
+
insert(_el$44, (() => {
|
|
394
353
|
var _c$4 = memo(() => !!hasScopeConflict());
|
|
395
354
|
return () => _c$4() && (() => {
|
|
396
|
-
var _el$
|
|
397
|
-
insert(_el$
|
|
355
|
+
var _el$57 = _tmpl$7(), _el$59 = _el$57.firstChild.nextSibling;
|
|
356
|
+
insert(_el$59, scopeConflictTooltip);
|
|
398
357
|
effect((_p$) => {
|
|
399
|
-
var _v$
|
|
400
|
-
_v$
|
|
401
|
-
_v$
|
|
358
|
+
var _v$29 = clsx(styles().badge, styles().badgeInfo, styles().tooltip), _v$30 = styles().tooltipText;
|
|
359
|
+
_v$29 !== _p$.e && className(_el$57, _p$.e = _v$29);
|
|
360
|
+
_v$30 !== _p$.t && className(_el$59, _p$.t = _v$30);
|
|
402
361
|
return _p$;
|
|
403
362
|
}, {
|
|
404
363
|
e: void 0,
|
|
405
364
|
t: void 0
|
|
406
365
|
});
|
|
407
|
-
return _el$
|
|
366
|
+
return _el$57;
|
|
408
367
|
})();
|
|
409
|
-
})(), _el$
|
|
410
|
-
insert(_el$
|
|
411
|
-
insert(_el$
|
|
412
|
-
insert(_el$
|
|
413
|
-
insert(_el$
|
|
414
|
-
insert(_el$
|
|
415
|
-
insert(_el$
|
|
368
|
+
})(), _el$46);
|
|
369
|
+
insert(_el$46, () => enabled() ? "on" : "off", _el$47);
|
|
370
|
+
insert(_el$47, () => enabled() ? "Hotkey is enabled" : "Hotkey is disabled");
|
|
371
|
+
insert(_el$48, () => reg.options.eventType ?? "keydown", _el$49);
|
|
372
|
+
insert(_el$49, () => reg.options.eventType ?? "keydown", _el$52);
|
|
373
|
+
insert(_el$53, () => getTargetLabel(reg.target), _el$54);
|
|
374
|
+
insert(_el$54, () => getTargetTooltip(reg.target));
|
|
416
375
|
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$
|
|
376
|
+
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;
|
|
377
|
+
_v$16 !== _p$.e && className(_el$37, _p$.e = _v$16);
|
|
378
|
+
_v$17 !== _p$.t && className(_el$39, _p$.t = _v$17);
|
|
379
|
+
_v$18 !== _p$.a && className(_el$40, _p$.a = _v$18);
|
|
380
|
+
_v$19 !== _p$.o && className(_el$44, _p$.o = _v$19);
|
|
381
|
+
_v$20 !== _p$.i && className(_el$45, _p$.i = _v$20);
|
|
382
|
+
_v$21 !== _p$.n && className(_el$46, _p$.n = _v$21);
|
|
383
|
+
_v$22 !== _p$.s && className(_el$47, _p$.s = _v$22);
|
|
384
|
+
_v$23 !== _p$.h && className(_el$48, _p$.h = _v$23);
|
|
385
|
+
_v$24 !== _p$.r && className(_el$49, _p$.r = _v$24);
|
|
386
|
+
_v$25 !== _p$.d && className(_el$53, _p$.d = _v$25);
|
|
387
|
+
_v$26 !== _p$.l && className(_el$54, _p$.l = _v$26);
|
|
428
388
|
return _p$;
|
|
429
389
|
}, {
|
|
430
390
|
e: void 0,
|
|
@@ -436,25 +396,26 @@ function HotkeyList(props) {
|
|
|
436
396
|
s: void 0,
|
|
437
397
|
h: void 0,
|
|
438
398
|
r: void 0,
|
|
439
|
-
d: void 0
|
|
399
|
+
d: void 0,
|
|
400
|
+
l: void 0
|
|
440
401
|
});
|
|
441
|
-
return _el$
|
|
402
|
+
return _el$37;
|
|
442
403
|
})();
|
|
443
404
|
}
|
|
444
405
|
}));
|
|
445
|
-
effect(() => className(_el$
|
|
446
|
-
return _el$
|
|
406
|
+
effect(() => className(_el$31, styles().hotkeyList));
|
|
407
|
+
return _el$31;
|
|
447
408
|
})(),
|
|
448
409
|
(() => {
|
|
449
|
-
var _el$
|
|
450
|
-
_el$
|
|
451
|
-
insert(_el$
|
|
452
|
-
effect(() => className(_el$
|
|
453
|
-
return _el$
|
|
410
|
+
var _el$32 = _tmpl$10(), _el$35 = _el$32.firstChild.nextSibling;
|
|
411
|
+
_el$35.nextSibling;
|
|
412
|
+
insert(_el$32, () => filteredSequenceRegistrations().length, _el$35);
|
|
413
|
+
effect(() => className(_el$32, styles().panelHeader));
|
|
414
|
+
return _el$32;
|
|
454
415
|
})(),
|
|
455
416
|
(() => {
|
|
456
|
-
var _el$
|
|
457
|
-
insert(_el$
|
|
417
|
+
var _el$36 = _tmpl$1();
|
|
418
|
+
insert(_el$36, createComponent(For, {
|
|
458
419
|
get each() {
|
|
459
420
|
return filteredSequenceRegistrations();
|
|
460
421
|
},
|
|
@@ -472,8 +433,8 @@ function HotkeyList(props) {
|
|
|
472
433
|
}
|
|
473
434
|
})
|
|
474
435
|
}));
|
|
475
|
-
effect(() => className(_el$
|
|
476
|
-
return _el$
|
|
436
|
+
effect(() => className(_el$36, styles().hotkeyList));
|
|
437
|
+
return _el$36;
|
|
477
438
|
})()
|
|
478
439
|
];
|
|
479
440
|
}
|