@tanstack/hotkeys-devtools 0.2.0 → 0.3.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.
@@ -3,10 +3,16 @@ import { useStyles } from "../styles/use-styles.js";
3
3
  import { ActionButtons } from "./ActionButtons.js";
4
4
  import { For, Show, createMemo } from "solid-js";
5
5
  import { className, createComponent, effect, insert, template } from "solid-js/web";
6
- import { formatForDisplay } from "@tanstack/hotkeys";
6
+ import { formatForDisplay, formatHotkeySequence } from "@tanstack/hotkeys";
7
7
 
8
8
  //#region src/components/DetailsPanel.tsx
9
- var _tmpl$ = /* @__PURE__ */ template(`<div>`), _tmpl$2 = /* @__PURE__ */ template(`<div>Select a hotkey from the list to view its details`), _tmpl$3 = /* @__PURE__ */ template(`<div><div></div><div><div>ID</div><div></div><div>Raw</div><div></div><div>Target</div><div>`), _tmpl$4 = /* @__PURE__ */ template(`<div><div>Conflicts (<!>)</div><div>`), _tmpl$5 = /* @__PURE__ */ template(`<div><div><div>Key Breakdown</div><div></div></div><div><div>Actions</div></div><div><div>Options</div><div><div><span>enabled</span><span></span></div><div><span>eventType</span><span></span></div><div><span>preventDefault</span><span></span></div><div><span>stopPropagation</span><span></span></div><div><span>ignoreInputs</span><span></span></div><div><span>requireReset</span><span></span></div><div><span>conflictBehavior</span><span></span></div><div><span>hasFired</span><span>`), _tmpl$6 = /* @__PURE__ */ template(`<span>+`), _tmpl$7 = /* @__PURE__ */ template(`<span>`), _tmpl$8 = /* @__PURE__ */ template(`<div><span></span> <!>: <!> (<!>) on `), _tmpl$9 = /* @__PURE__ */ template(`<div><span>scope</span> <!>: <!> (<!>) on `);
9
+ var _tmpl$ = /* @__PURE__ */ template(`<div><div></div><div><div>ID</div><div></div><div>Raw</div><div></div><div>Target</div><div>`), _tmpl$2 = /* @__PURE__ */ template(`<div><div>Conflicts (<!>)</div><div>`), _tmpl$3 = /* @__PURE__ */ template(`<div><div><div>Key Breakdown</div><div></div></div><div><div>Actions</div></div><div><div>Options</div><div><div><span>enabled</span><span></span></div><div><span>eventType</span><span></span></div><div><span>preventDefault</span><span></span></div><div><span>stopPropagation</span><span></span></div><div><span>ignoreInputs</span><span></span></div><div><span>requireReset</span><span></span></div><div><span>conflictBehavior</span><span></span></div><div><span>hasFired</span><span>`), _tmpl$4 = /* @__PURE__ */ template(`<span>+`), _tmpl$5 = /* @__PURE__ */ template(`<span>`), _tmpl$6 = /* @__PURE__ */ template(`<div><span></span> <!>: <!> (<!>) on `), _tmpl$7 = /* @__PURE__ */ template(`<div><span>scope</span> <!>: <!> (<!>) on `), _tmpl$8 = /* @__PURE__ */ template(`<div><div></div><div><div>ID</div><div></div><div>Sequence</div><div></div><div>Target</div><div>`), _tmpl$9 = /* @__PURE__ */ template(`<div><div><div>Key Breakdown</div><div></div></div><div><div>Actions</div></div><div><div>Options</div><div><div><span>enabled</span><span></span></div><div><span>eventType</span><span></span></div><div><span>timeout</span><span>ms</span></div><div><span>preventDefault</span><span></span></div><div><span>stopPropagation</span><span></span></div><div><span>ignoreInputs</span><span></span></div><div><span>conflictBehavior</span><span>`), _tmpl$0 = /* @__PURE__ */ template(`<span>→`), _tmpl$1 = /* @__PURE__ */ template(`<div>`), _tmpl$10 = /* @__PURE__ */ template(`<div>Select a hotkey or sequence from the list to view its details`);
10
+ function sequenceKey(sequence) {
11
+ return sequence.join("|");
12
+ }
13
+ function isSequenceRegistration(reg) {
14
+ return "sequence" in reg && Array.isArray(reg.sequence);
15
+ }
10
16
  function getTargetDescription(target) {
11
17
  if (typeof document !== "undefined" && target === document) return "document";
12
18
  if (typeof window !== "undefined" && target === window) return "window";
@@ -19,6 +25,12 @@ function findTargetConflicts(registration, all) {
19
25
  function findScopeConflicts(registration, all) {
20
26
  return all.filter((other) => other.id !== registration.id && other.hotkey === registration.hotkey && other.options.eventType === registration.options.eventType && other.target !== registration.target);
21
27
  }
28
+ function findSequenceTargetConflicts(registration, all) {
29
+ return all.filter((other) => other.id !== registration.id && sequenceKey(other.sequence) === sequenceKey(registration.sequence) && other.options.eventType === registration.options.eventType && other.target === registration.target);
30
+ }
31
+ function findSequenceScopeConflicts(registration, all) {
32
+ return all.filter((other) => other.id !== registration.id && sequenceKey(other.sequence) === sequenceKey(registration.sequence) && other.options.eventType === registration.options.eventType && other.target !== registration.target);
33
+ }
22
34
  function getConflictItemStyle(behavior, isSameTarget) {
23
35
  if (!isSameTarget) return "conflictItemScope";
24
36
  if (behavior === "allow") return "conflictItemAllow";
@@ -32,234 +44,465 @@ function getConflictLabel(behavior, isSameTarget) {
32
44
  if (behavior === "replace") return "replaced";
33
45
  return "warning";
34
46
  }
47
+ function HotkeyDetails(props) {
48
+ const reg = () => props.registration;
49
+ const parsed = () => reg().parsedHotkey;
50
+ const targetConflicts = createMemo(() => props.findTargetConflicts(reg(), props.state.registrations()));
51
+ const scopeConflicts = createMemo(() => props.findScopeConflicts(reg(), props.state.registrations()));
52
+ const allConflicts = createMemo(() => [...targetConflicts(), ...scopeConflicts()]);
53
+ const conflictBehavior = () => reg().options.conflictBehavior ?? "warn";
54
+ const keyParts = createMemo(() => {
55
+ const parts = [];
56
+ const p = parsed();
57
+ if (p.ctrl) parts.push("Ctrl");
58
+ if (p.shift) parts.push("Shift");
59
+ if (p.alt) parts.push("Alt");
60
+ if (p.meta) parts.push("Meta");
61
+ parts.push(p.key);
62
+ return parts;
63
+ });
64
+ const styles = props.styles;
65
+ return [(() => {
66
+ var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling, _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.nextSibling, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling;
67
+ insert(_el$2, () => props.formatForDisplay(reg().hotkey));
68
+ insert(_el$5, () => reg().id);
69
+ insert(_el$7, () => reg().hotkey);
70
+ insert(_el$9, () => props.getTargetDescription(reg().target));
71
+ effect((_p$) => {
72
+ var _v$ = styles().stateHeader, _v$2 = styles().stateTitle, _v$3 = styles().infoGrid, _v$4 = styles().infoLabel, _v$5 = styles().infoValueMono, _v$6 = styles().infoLabel, _v$7 = styles().infoValueMono, _v$8 = styles().infoLabel, _v$9 = styles().infoValueMono;
73
+ _v$ !== _p$.e && className(_el$, _p$.e = _v$);
74
+ _v$2 !== _p$.t && className(_el$2, _p$.t = _v$2);
75
+ _v$3 !== _p$.a && className(_el$3, _p$.a = _v$3);
76
+ _v$4 !== _p$.o && className(_el$4, _p$.o = _v$4);
77
+ _v$5 !== _p$.i && className(_el$5, _p$.i = _v$5);
78
+ _v$6 !== _p$.n && className(_el$6, _p$.n = _v$6);
79
+ _v$7 !== _p$.s && className(_el$7, _p$.s = _v$7);
80
+ _v$8 !== _p$.h && className(_el$8, _p$.h = _v$8);
81
+ _v$9 !== _p$.r && className(_el$9, _p$.r = _v$9);
82
+ return _p$;
83
+ }, {
84
+ e: void 0,
85
+ t: void 0,
86
+ a: void 0,
87
+ o: void 0,
88
+ i: void 0,
89
+ n: void 0,
90
+ s: void 0,
91
+ h: void 0,
92
+ r: void 0
93
+ });
94
+ return _el$;
95
+ })(), (() => {
96
+ var _el$0 = _tmpl$3(), _el$1 = _el$0.firstChild, _el$10 = _el$1.firstChild, _el$11 = _el$10.nextSibling, _el$12 = _el$1.nextSibling, _el$13 = _el$12.firstChild, _el$14 = _el$12.nextSibling, _el$15 = _el$14.firstChild, _el$17 = _el$15.nextSibling.firstChild, _el$18 = _el$17.firstChild, _el$19 = _el$18.nextSibling, _el$20 = _el$17.nextSibling, _el$21 = _el$20.firstChild, _el$22 = _el$21.nextSibling, _el$23 = _el$20.nextSibling, _el$24 = _el$23.firstChild, _el$25 = _el$24.nextSibling, _el$26 = _el$23.nextSibling, _el$27 = _el$26.firstChild, _el$28 = _el$27.nextSibling, _el$29 = _el$26.nextSibling, _el$30 = _el$29.firstChild, _el$31 = _el$30.nextSibling, _el$32 = _el$29.nextSibling, _el$33 = _el$32.firstChild, _el$34 = _el$33.nextSibling, _el$35 = _el$32.nextSibling, _el$36 = _el$35.firstChild, _el$37 = _el$36.nextSibling, _el$38 = _el$35.nextSibling, _el$39 = _el$38.firstChild, _el$40 = _el$39.nextSibling;
97
+ insert(_el$11, createComponent(For, {
98
+ get each() {
99
+ return keyParts();
100
+ },
101
+ children: (part, i) => [createComponent(Show, {
102
+ get when() {
103
+ return i() > 0;
104
+ },
105
+ get children() {
106
+ var _el$47 = _tmpl$4();
107
+ effect(() => className(_el$47, styles().keyBreakdownPlus));
108
+ return _el$47;
109
+ }
110
+ }), (() => {
111
+ var _el$48 = _tmpl$5();
112
+ insert(_el$48, part);
113
+ effect(() => className(_el$48, styles().keyCapLarge));
114
+ return _el$48;
115
+ })()]
116
+ }));
117
+ insert(_el$12, createComponent(ActionButtons, { get registration() {
118
+ return reg();
119
+ } }), null);
120
+ insert(_el$19, () => String(reg().options.enabled !== false));
121
+ insert(_el$22, () => reg().options.eventType ?? "keydown");
122
+ insert(_el$25, () => String(!!reg().options.preventDefault));
123
+ insert(_el$28, () => String(!!reg().options.stopPropagation));
124
+ insert(_el$31, () => String(reg().options.ignoreInputs !== false));
125
+ insert(_el$34, () => String(!!reg().options.requireReset));
126
+ insert(_el$37, conflictBehavior);
127
+ insert(_el$40, () => String(reg().hasFired));
128
+ insert(_el$0, createComponent(Show, {
129
+ get when() {
130
+ return allConflicts().length > 0;
131
+ },
132
+ get children() {
133
+ var _el$41 = _tmpl$2(), _el$42 = _el$41.firstChild, _el$45 = _el$42.firstChild.nextSibling;
134
+ _el$45.nextSibling;
135
+ var _el$46 = _el$42.nextSibling;
136
+ insert(_el$42, () => allConflicts().length, _el$45);
137
+ insert(_el$46, createComponent(For, {
138
+ get each() {
139
+ return targetConflicts();
140
+ },
141
+ children: (conflict) => {
142
+ const itemStyle = () => props.getConflictItemStyle(conflictBehavior(), true);
143
+ const label = () => props.getConflictLabel(conflictBehavior(), true);
144
+ return (() => {
145
+ var _el$49 = _tmpl$6(), _el$50 = _el$49.firstChild, _el$57 = _el$50.nextSibling.nextSibling, _el$58 = _el$57.nextSibling.nextSibling, _el$59 = _el$58.nextSibling.nextSibling;
146
+ _el$59.nextSibling;
147
+ insert(_el$50, label);
148
+ insert(_el$49, () => conflict.id, _el$57);
149
+ insert(_el$49, () => props.formatForDisplay(conflict.hotkey), _el$58);
150
+ insert(_el$49, () => conflict.options.eventType ?? "keydown", _el$59);
151
+ insert(_el$49, () => props.getTargetDescription(conflict.target), null);
152
+ effect(() => className(_el$49, styles()[itemStyle()]));
153
+ return _el$49;
154
+ })();
155
+ }
156
+ }), null);
157
+ insert(_el$46, createComponent(For, {
158
+ get each() {
159
+ return scopeConflicts();
160
+ },
161
+ children: (conflict) => (() => {
162
+ var _el$60 = _tmpl$7(), _el$68 = _el$60.firstChild.nextSibling.nextSibling, _el$69 = _el$68.nextSibling.nextSibling, _el$70 = _el$69.nextSibling.nextSibling;
163
+ _el$70.nextSibling;
164
+ insert(_el$60, () => conflict.id, _el$68);
165
+ insert(_el$60, () => props.formatForDisplay(conflict.hotkey), _el$69);
166
+ insert(_el$60, () => conflict.options.eventType ?? "keydown", _el$70);
167
+ insert(_el$60, () => props.getTargetDescription(conflict.target), null);
168
+ effect(() => className(_el$60, styles().conflictItemScope));
169
+ return _el$60;
170
+ })()
171
+ }), null);
172
+ effect((_p$) => {
173
+ var _v$0 = styles().detailSection, _v$1 = styles().detailSectionHeader, _v$10 = styles().conflictList;
174
+ _v$0 !== _p$.e && className(_el$41, _p$.e = _v$0);
175
+ _v$1 !== _p$.t && className(_el$42, _p$.t = _v$1);
176
+ _v$10 !== _p$.a && className(_el$46, _p$.a = _v$10);
177
+ return _p$;
178
+ }, {
179
+ e: void 0,
180
+ t: void 0,
181
+ a: void 0
182
+ });
183
+ return _el$41;
184
+ }
185
+ }), null);
186
+ effect((_p$) => {
187
+ var _v$11 = styles().detailsGrid, _v$12 = styles().detailSection, _v$13 = styles().detailSectionHeader, _v$14 = styles().keyBreakdown, _v$15 = styles().detailSection, _v$16 = styles().detailSectionHeader, _v$17 = styles().detailSection, _v$18 = styles().detailSectionHeader, _v$19 = styles().optionRow, _v$20 = styles().optionLabel, _v$21 = reg().options.enabled !== false ? styles().optionValueTrue : styles().optionValueFalse, _v$22 = styles().optionRow, _v$23 = styles().optionLabel, _v$24 = styles().optionValue, _v$25 = styles().optionRow, _v$26 = styles().optionLabel, _v$27 = reg().options.preventDefault ? styles().optionValueTrue : styles().optionValueFalse, _v$28 = styles().optionRow, _v$29 = styles().optionLabel, _v$30 = reg().options.stopPropagation ? styles().optionValueTrue : styles().optionValueFalse, _v$31 = styles().optionRow, _v$32 = styles().optionLabel, _v$33 = reg().options.ignoreInputs !== false ? styles().optionValueTrue : styles().optionValueFalse, _v$34 = styles().optionRow, _v$35 = styles().optionLabel, _v$36 = reg().options.requireReset ? styles().optionValueTrue : styles().optionValueFalse, _v$37 = styles().optionRow, _v$38 = styles().optionLabel, _v$39 = styles().optionValue, _v$40 = styles().optionRow, _v$41 = styles().optionLabel, _v$42 = reg().hasFired ? styles().optionValueTrue : styles().optionValueFalse;
188
+ _v$11 !== _p$.e && className(_el$0, _p$.e = _v$11);
189
+ _v$12 !== _p$.t && className(_el$1, _p$.t = _v$12);
190
+ _v$13 !== _p$.a && className(_el$10, _p$.a = _v$13);
191
+ _v$14 !== _p$.o && className(_el$11, _p$.o = _v$14);
192
+ _v$15 !== _p$.i && className(_el$12, _p$.i = _v$15);
193
+ _v$16 !== _p$.n && className(_el$13, _p$.n = _v$16);
194
+ _v$17 !== _p$.s && className(_el$14, _p$.s = _v$17);
195
+ _v$18 !== _p$.h && className(_el$15, _p$.h = _v$18);
196
+ _v$19 !== _p$.r && className(_el$17, _p$.r = _v$19);
197
+ _v$20 !== _p$.d && className(_el$18, _p$.d = _v$20);
198
+ _v$21 !== _p$.l && className(_el$19, _p$.l = _v$21);
199
+ _v$22 !== _p$.u && className(_el$20, _p$.u = _v$22);
200
+ _v$23 !== _p$.c && className(_el$21, _p$.c = _v$23);
201
+ _v$24 !== _p$.w && className(_el$22, _p$.w = _v$24);
202
+ _v$25 !== _p$.m && className(_el$23, _p$.m = _v$25);
203
+ _v$26 !== _p$.f && className(_el$24, _p$.f = _v$26);
204
+ _v$27 !== _p$.y && className(_el$25, _p$.y = _v$27);
205
+ _v$28 !== _p$.g && className(_el$26, _p$.g = _v$28);
206
+ _v$29 !== _p$.p && className(_el$27, _p$.p = _v$29);
207
+ _v$30 !== _p$.b && className(_el$28, _p$.b = _v$30);
208
+ _v$31 !== _p$.T && className(_el$29, _p$.T = _v$31);
209
+ _v$32 !== _p$.A && className(_el$30, _p$.A = _v$32);
210
+ _v$33 !== _p$.O && className(_el$31, _p$.O = _v$33);
211
+ _v$34 !== _p$.I && className(_el$32, _p$.I = _v$34);
212
+ _v$35 !== _p$.S && className(_el$33, _p$.S = _v$35);
213
+ _v$36 !== _p$.W && className(_el$34, _p$.W = _v$36);
214
+ _v$37 !== _p$.C && className(_el$35, _p$.C = _v$37);
215
+ _v$38 !== _p$.B && className(_el$36, _p$.B = _v$38);
216
+ _v$39 !== _p$.v && className(_el$37, _p$.v = _v$39);
217
+ _v$40 !== _p$.k && className(_el$38, _p$.k = _v$40);
218
+ _v$41 !== _p$.x && className(_el$39, _p$.x = _v$41);
219
+ _v$42 !== _p$.j && className(_el$40, _p$.j = _v$42);
220
+ return _p$;
221
+ }, {
222
+ e: void 0,
223
+ t: void 0,
224
+ a: void 0,
225
+ o: void 0,
226
+ i: void 0,
227
+ n: void 0,
228
+ s: void 0,
229
+ h: void 0,
230
+ r: void 0,
231
+ d: void 0,
232
+ l: void 0,
233
+ u: void 0,
234
+ c: void 0,
235
+ w: void 0,
236
+ m: void 0,
237
+ f: void 0,
238
+ y: void 0,
239
+ g: void 0,
240
+ p: void 0,
241
+ b: void 0,
242
+ T: void 0,
243
+ A: void 0,
244
+ O: void 0,
245
+ I: void 0,
246
+ S: void 0,
247
+ W: void 0,
248
+ C: void 0,
249
+ B: void 0,
250
+ v: void 0,
251
+ k: void 0,
252
+ x: void 0,
253
+ j: void 0
254
+ });
255
+ return _el$0;
256
+ })()];
257
+ }
258
+ function SequenceDetails(props) {
259
+ const reg = () => props.registration;
260
+ const targetConflicts = createMemo(() => props.findSequenceTargetConflicts(reg(), props.state.sequenceRegistrations()));
261
+ const scopeConflicts = createMemo(() => props.findSequenceScopeConflicts(reg(), props.state.sequenceRegistrations()));
262
+ const allConflicts = createMemo(() => [...targetConflicts(), ...scopeConflicts()]);
263
+ const conflictBehavior = () => reg().options.conflictBehavior ?? "warn";
264
+ const styles = props.styles;
265
+ return [(() => {
266
+ var _el$71 = _tmpl$8(), _el$72 = _el$71.firstChild, _el$73 = _el$72.nextSibling, _el$74 = _el$73.firstChild, _el$75 = _el$74.nextSibling, _el$76 = _el$75.nextSibling, _el$77 = _el$76.nextSibling, _el$78 = _el$77.nextSibling, _el$79 = _el$78.nextSibling;
267
+ insert(_el$72, () => props.formatHotkeySequence(reg().sequence));
268
+ insert(_el$75, () => reg().id);
269
+ insert(_el$77, () => props.formatHotkeySequence(reg().sequence));
270
+ insert(_el$79, () => props.getTargetDescription(reg().target));
271
+ effect((_p$) => {
272
+ var _v$43 = styles().stateHeader, _v$44 = styles().stateTitle, _v$45 = styles().infoGrid, _v$46 = styles().infoLabel, _v$47 = styles().infoValueMono, _v$48 = styles().infoLabel, _v$49 = styles().infoValueMono, _v$50 = styles().infoLabel, _v$51 = styles().infoValueMono;
273
+ _v$43 !== _p$.e && className(_el$71, _p$.e = _v$43);
274
+ _v$44 !== _p$.t && className(_el$72, _p$.t = _v$44);
275
+ _v$45 !== _p$.a && className(_el$73, _p$.a = _v$45);
276
+ _v$46 !== _p$.o && className(_el$74, _p$.o = _v$46);
277
+ _v$47 !== _p$.i && className(_el$75, _p$.i = _v$47);
278
+ _v$48 !== _p$.n && className(_el$76, _p$.n = _v$48);
279
+ _v$49 !== _p$.s && className(_el$77, _p$.s = _v$49);
280
+ _v$50 !== _p$.h && className(_el$78, _p$.h = _v$50);
281
+ _v$51 !== _p$.r && className(_el$79, _p$.r = _v$51);
282
+ return _p$;
283
+ }, {
284
+ e: void 0,
285
+ t: void 0,
286
+ a: void 0,
287
+ o: void 0,
288
+ i: void 0,
289
+ n: void 0,
290
+ s: void 0,
291
+ h: void 0,
292
+ r: void 0
293
+ });
294
+ return _el$71;
295
+ })(), (() => {
296
+ var _el$80 = _tmpl$9(), _el$81 = _el$80.firstChild, _el$82 = _el$81.firstChild, _el$83 = _el$82.nextSibling, _el$84 = _el$81.nextSibling, _el$85 = _el$84.firstChild, _el$86 = _el$84.nextSibling, _el$87 = _el$86.firstChild, _el$89 = _el$87.nextSibling.firstChild, _el$90 = _el$89.firstChild, _el$91 = _el$90.nextSibling, _el$92 = _el$89.nextSibling, _el$93 = _el$92.firstChild, _el$94 = _el$93.nextSibling, _el$95 = _el$92.nextSibling, _el$96 = _el$95.firstChild, _el$97 = _el$96.nextSibling, _el$98 = _el$97.firstChild, _el$99 = _el$95.nextSibling, _el$100 = _el$99.firstChild, _el$101 = _el$100.nextSibling, _el$102 = _el$99.nextSibling, _el$103 = _el$102.firstChild, _el$104 = _el$103.nextSibling, _el$105 = _el$102.nextSibling, _el$106 = _el$105.firstChild, _el$107 = _el$106.nextSibling, _el$108 = _el$105.nextSibling, _el$109 = _el$108.firstChild, _el$110 = _el$109.nextSibling;
297
+ insert(_el$83, createComponent(For, {
298
+ get each() {
299
+ return reg().sequence;
300
+ },
301
+ children: (step, i) => [createComponent(Show, {
302
+ get when() {
303
+ return i() > 0;
304
+ },
305
+ get children() {
306
+ var _el$117 = _tmpl$0();
307
+ effect(() => className(_el$117, styles().keyBreakdownPlus));
308
+ return _el$117;
309
+ }
310
+ }), (() => {
311
+ var _el$118 = _tmpl$5();
312
+ insert(_el$118, () => props.formatForDisplay(step));
313
+ effect(() => className(_el$118, styles().keyCapLarge));
314
+ return _el$118;
315
+ })()]
316
+ }));
317
+ insert(_el$84, createComponent(ActionButtons, { get registration() {
318
+ return reg();
319
+ } }), null);
320
+ insert(_el$91, () => String(reg().options.enabled !== false));
321
+ insert(_el$94, () => reg().options.eventType ?? "keydown");
322
+ insert(_el$97, () => reg().options.timeout ?? 1e3, _el$98);
323
+ insert(_el$101, () => String(!!reg().options.preventDefault));
324
+ insert(_el$104, () => String(!!reg().options.stopPropagation));
325
+ insert(_el$107, () => String(reg().options.ignoreInputs !== false));
326
+ insert(_el$110, conflictBehavior);
327
+ insert(_el$80, createComponent(Show, {
328
+ get when() {
329
+ return allConflicts().length > 0;
330
+ },
331
+ get children() {
332
+ var _el$111 = _tmpl$2(), _el$112 = _el$111.firstChild, _el$115 = _el$112.firstChild.nextSibling;
333
+ _el$115.nextSibling;
334
+ var _el$116 = _el$112.nextSibling;
335
+ insert(_el$112, () => allConflicts().length, _el$115);
336
+ insert(_el$116, createComponent(For, {
337
+ get each() {
338
+ return targetConflicts();
339
+ },
340
+ children: (conflict) => {
341
+ const itemStyle = () => props.getConflictItemStyle(conflictBehavior(), true);
342
+ const label = () => props.getConflictLabel(conflictBehavior(), true);
343
+ return (() => {
344
+ var _el$119 = _tmpl$6(), _el$120 = _el$119.firstChild, _el$127 = _el$120.nextSibling.nextSibling, _el$128 = _el$127.nextSibling.nextSibling, _el$129 = _el$128.nextSibling.nextSibling;
345
+ _el$129.nextSibling;
346
+ insert(_el$120, label);
347
+ insert(_el$119, () => conflict.id, _el$127);
348
+ insert(_el$119, () => props.formatHotkeySequence(conflict.sequence), _el$128);
349
+ insert(_el$119, () => conflict.options.eventType ?? "keydown", _el$129);
350
+ insert(_el$119, () => props.getTargetDescription(conflict.target), null);
351
+ effect(() => className(_el$119, styles()[itemStyle()]));
352
+ return _el$119;
353
+ })();
354
+ }
355
+ }), null);
356
+ insert(_el$116, createComponent(For, {
357
+ get each() {
358
+ return scopeConflicts();
359
+ },
360
+ children: (conflict) => (() => {
361
+ var _el$130 = _tmpl$7(), _el$138 = _el$130.firstChild.nextSibling.nextSibling, _el$139 = _el$138.nextSibling.nextSibling, _el$140 = _el$139.nextSibling.nextSibling;
362
+ _el$140.nextSibling;
363
+ insert(_el$130, () => conflict.id, _el$138);
364
+ insert(_el$130, () => props.formatHotkeySequence(conflict.sequence), _el$139);
365
+ insert(_el$130, () => conflict.options.eventType ?? "keydown", _el$140);
366
+ insert(_el$130, () => props.getTargetDescription(conflict.target), null);
367
+ effect(() => className(_el$130, styles().conflictItemScope));
368
+ return _el$130;
369
+ })()
370
+ }), null);
371
+ effect((_p$) => {
372
+ var _v$52 = styles().detailSection, _v$53 = styles().detailSectionHeader, _v$54 = styles().conflictList;
373
+ _v$52 !== _p$.e && className(_el$111, _p$.e = _v$52);
374
+ _v$53 !== _p$.t && className(_el$112, _p$.t = _v$53);
375
+ _v$54 !== _p$.a && className(_el$116, _p$.a = _v$54);
376
+ return _p$;
377
+ }, {
378
+ e: void 0,
379
+ t: void 0,
380
+ a: void 0
381
+ });
382
+ return _el$111;
383
+ }
384
+ }), null);
385
+ effect((_p$) => {
386
+ var _v$55 = styles().detailsGrid, _v$56 = styles().detailSection, _v$57 = styles().detailSectionHeader, _v$58 = styles().keyBreakdown, _v$59 = styles().detailSection, _v$60 = styles().detailSectionHeader, _v$61 = styles().detailSection, _v$62 = styles().detailSectionHeader, _v$63 = styles().optionRow, _v$64 = styles().optionLabel, _v$65 = reg().options.enabled !== false ? styles().optionValueTrue : styles().optionValueFalse, _v$66 = styles().optionRow, _v$67 = styles().optionLabel, _v$68 = styles().optionValue, _v$69 = styles().optionRow, _v$70 = styles().optionLabel, _v$71 = styles().optionValue, _v$72 = styles().optionRow, _v$73 = styles().optionLabel, _v$74 = reg().options.preventDefault ? styles().optionValueTrue : styles().optionValueFalse, _v$75 = styles().optionRow, _v$76 = styles().optionLabel, _v$77 = reg().options.stopPropagation ? styles().optionValueTrue : styles().optionValueFalse, _v$78 = styles().optionRow, _v$79 = styles().optionLabel, _v$80 = reg().options.ignoreInputs !== false ? styles().optionValueTrue : styles().optionValueFalse, _v$81 = styles().optionRow, _v$82 = styles().optionLabel, _v$83 = styles().optionValue;
387
+ _v$55 !== _p$.e && className(_el$80, _p$.e = _v$55);
388
+ _v$56 !== _p$.t && className(_el$81, _p$.t = _v$56);
389
+ _v$57 !== _p$.a && className(_el$82, _p$.a = _v$57);
390
+ _v$58 !== _p$.o && className(_el$83, _p$.o = _v$58);
391
+ _v$59 !== _p$.i && className(_el$84, _p$.i = _v$59);
392
+ _v$60 !== _p$.n && className(_el$85, _p$.n = _v$60);
393
+ _v$61 !== _p$.s && className(_el$86, _p$.s = _v$61);
394
+ _v$62 !== _p$.h && className(_el$87, _p$.h = _v$62);
395
+ _v$63 !== _p$.r && className(_el$89, _p$.r = _v$63);
396
+ _v$64 !== _p$.d && className(_el$90, _p$.d = _v$64);
397
+ _v$65 !== _p$.l && className(_el$91, _p$.l = _v$65);
398
+ _v$66 !== _p$.u && className(_el$92, _p$.u = _v$66);
399
+ _v$67 !== _p$.c && className(_el$93, _p$.c = _v$67);
400
+ _v$68 !== _p$.w && className(_el$94, _p$.w = _v$68);
401
+ _v$69 !== _p$.m && className(_el$95, _p$.m = _v$69);
402
+ _v$70 !== _p$.f && className(_el$96, _p$.f = _v$70);
403
+ _v$71 !== _p$.y && className(_el$97, _p$.y = _v$71);
404
+ _v$72 !== _p$.g && className(_el$99, _p$.g = _v$72);
405
+ _v$73 !== _p$.p && className(_el$100, _p$.p = _v$73);
406
+ _v$74 !== _p$.b && className(_el$101, _p$.b = _v$74);
407
+ _v$75 !== _p$.T && className(_el$102, _p$.T = _v$75);
408
+ _v$76 !== _p$.A && className(_el$103, _p$.A = _v$76);
409
+ _v$77 !== _p$.O && className(_el$104, _p$.O = _v$77);
410
+ _v$78 !== _p$.I && className(_el$105, _p$.I = _v$78);
411
+ _v$79 !== _p$.S && className(_el$106, _p$.S = _v$79);
412
+ _v$80 !== _p$.W && className(_el$107, _p$.W = _v$80);
413
+ _v$81 !== _p$.C && className(_el$108, _p$.C = _v$81);
414
+ _v$82 !== _p$.B && className(_el$109, _p$.B = _v$82);
415
+ _v$83 !== _p$.v && className(_el$110, _p$.v = _v$83);
416
+ return _p$;
417
+ }, {
418
+ e: void 0,
419
+ t: void 0,
420
+ a: void 0,
421
+ o: void 0,
422
+ i: void 0,
423
+ n: void 0,
424
+ s: void 0,
425
+ h: void 0,
426
+ r: void 0,
427
+ d: void 0,
428
+ l: void 0,
429
+ u: void 0,
430
+ c: void 0,
431
+ w: void 0,
432
+ m: void 0,
433
+ f: void 0,
434
+ y: void 0,
435
+ g: void 0,
436
+ p: void 0,
437
+ b: void 0,
438
+ T: void 0,
439
+ A: void 0,
440
+ O: void 0,
441
+ I: void 0,
442
+ S: void 0,
443
+ W: void 0,
444
+ C: void 0,
445
+ B: void 0,
446
+ v: void 0
447
+ });
448
+ return _el$80;
449
+ })()];
450
+ }
35
451
  function DetailsPanel(props) {
36
452
  const styles = useStyles();
37
453
  const state = useHotkeysDevtoolsState();
38
454
  return (() => {
39
- var _el$ = _tmpl$();
40
- insert(_el$, createComponent(Show, {
455
+ var _el$141 = _tmpl$1();
456
+ insert(_el$141, createComponent(Show, {
41
457
  get when() {
42
458
  return props.selectedRegistration();
43
459
  },
44
460
  get fallback() {
45
461
  return (() => {
46
- var _el$2 = _tmpl$2();
47
- effect(() => className(_el$2, styles().noSelection));
48
- return _el$2;
462
+ var _el$142 = _tmpl$10();
463
+ effect(() => className(_el$142, styles().noSelection));
464
+ return _el$142;
49
465
  })();
50
466
  },
51
- children: (reg) => {
52
- const parsed = () => reg().parsedHotkey;
53
- const targetConflicts = createMemo(() => findTargetConflicts(reg(), state.registrations()));
54
- const scopeConflicts = createMemo(() => findScopeConflicts(reg(), state.registrations()));
55
- const allConflicts = createMemo(() => [...targetConflicts(), ...scopeConflicts()]);
56
- const conflictBehavior = () => reg().options.conflictBehavior ?? "warn";
57
- const keyParts = createMemo(() => {
58
- const parts = [];
59
- const p = parsed();
60
- if (p.ctrl) parts.push("Ctrl");
61
- if (p.shift) parts.push("Shift");
62
- if (p.alt) parts.push("Alt");
63
- if (p.meta) parts.push("Meta");
64
- parts.push(p.key);
65
- return parts;
66
- });
67
- return [(() => {
68
- var _el$3 = _tmpl$3(), _el$4 = _el$3.firstChild, _el$5 = _el$4.nextSibling, _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling, _el$9 = _el$8.nextSibling, _el$0 = _el$9.nextSibling, _el$1 = _el$0.nextSibling;
69
- insert(_el$4, () => formatForDisplay(reg().hotkey));
70
- insert(_el$7, () => reg().id);
71
- insert(_el$9, () => reg().hotkey);
72
- insert(_el$1, () => getTargetDescription(reg().target));
73
- effect((_p$) => {
74
- var _v$ = styles().stateHeader, _v$2 = styles().stateTitle, _v$3 = styles().infoGrid, _v$4 = styles().infoLabel, _v$5 = styles().infoValueMono, _v$6 = styles().infoLabel, _v$7 = styles().infoValueMono, _v$8 = styles().infoLabel, _v$9 = styles().infoValueMono;
75
- _v$ !== _p$.e && className(_el$3, _p$.e = _v$);
76
- _v$2 !== _p$.t && className(_el$4, _p$.t = _v$2);
77
- _v$3 !== _p$.a && className(_el$5, _p$.a = _v$3);
78
- _v$4 !== _p$.o && className(_el$6, _p$.o = _v$4);
79
- _v$5 !== _p$.i && className(_el$7, _p$.i = _v$5);
80
- _v$6 !== _p$.n && className(_el$8, _p$.n = _v$6);
81
- _v$7 !== _p$.s && className(_el$9, _p$.s = _v$7);
82
- _v$8 !== _p$.h && className(_el$0, _p$.h = _v$8);
83
- _v$9 !== _p$.r && className(_el$1, _p$.r = _v$9);
84
- return _p$;
85
- }, {
86
- e: void 0,
87
- t: void 0,
88
- a: void 0,
89
- o: void 0,
90
- i: void 0,
91
- n: void 0,
92
- s: void 0,
93
- h: void 0,
94
- r: void 0
95
- });
96
- return _el$3;
97
- })(), (() => {
98
- var _el$10 = _tmpl$5(), _el$11 = _el$10.firstChild, _el$12 = _el$11.firstChild, _el$13 = _el$12.nextSibling, _el$14 = _el$11.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$14.nextSibling, _el$17 = _el$16.firstChild, _el$19 = _el$17.nextSibling.firstChild, _el$20 = _el$19.firstChild, _el$21 = _el$20.nextSibling, _el$22 = _el$19.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$23.nextSibling, _el$25 = _el$22.nextSibling, _el$26 = _el$25.firstChild, _el$27 = _el$26.nextSibling, _el$28 = _el$25.nextSibling, _el$29 = _el$28.firstChild, _el$30 = _el$29.nextSibling, _el$31 = _el$28.nextSibling, _el$32 = _el$31.firstChild, _el$33 = _el$32.nextSibling, _el$34 = _el$31.nextSibling, _el$35 = _el$34.firstChild, _el$36 = _el$35.nextSibling, _el$37 = _el$34.nextSibling, _el$38 = _el$37.firstChild, _el$39 = _el$38.nextSibling, _el$40 = _el$37.nextSibling, _el$41 = _el$40.firstChild, _el$42 = _el$41.nextSibling;
99
- insert(_el$13, createComponent(For, {
100
- get each() {
101
- return keyParts();
467
+ children: (reg) => createComponent(Show, {
468
+ get when() {
469
+ return isSequenceRegistration(reg());
470
+ },
471
+ get fallback() {
472
+ return createComponent(HotkeyDetails, {
473
+ get registration() {
474
+ return reg();
102
475
  },
103
- children: (part, i) => [createComponent(Show, {
104
- get when() {
105
- return i() > 0;
106
- },
107
- get children() {
108
- var _el$49 = _tmpl$6();
109
- effect(() => className(_el$49, styles().keyBreakdownPlus));
110
- return _el$49;
111
- }
112
- }), (() => {
113
- var _el$50 = _tmpl$7();
114
- insert(_el$50, part);
115
- effect(() => className(_el$50, styles().keyCapLarge));
116
- return _el$50;
117
- })()]
118
- }));
119
- insert(_el$14, createComponent(ActionButtons, { get registration() {
120
- return reg();
121
- } }), null);
122
- insert(_el$21, () => String(reg().options.enabled !== false));
123
- insert(_el$24, () => reg().options.eventType ?? "keydown");
124
- insert(_el$27, () => String(!!reg().options.preventDefault));
125
- insert(_el$30, () => String(!!reg().options.stopPropagation));
126
- insert(_el$33, () => String(reg().options.ignoreInputs !== false));
127
- insert(_el$36, () => String(!!reg().options.requireReset));
128
- insert(_el$39, conflictBehavior);
129
- insert(_el$42, () => String(reg().hasFired));
130
- insert(_el$10, createComponent(Show, {
131
- get when() {
132
- return allConflicts().length > 0;
476
+ state,
477
+ getTargetDescription,
478
+ findTargetConflicts,
479
+ findScopeConflicts,
480
+ getConflictItemStyle,
481
+ getConflictLabel,
482
+ formatForDisplay,
483
+ styles
484
+ });
485
+ },
486
+ get children() {
487
+ return createComponent(SequenceDetails, {
488
+ get registration() {
489
+ return reg();
133
490
  },
134
- get children() {
135
- var _el$43 = _tmpl$4(), _el$44 = _el$43.firstChild, _el$47 = _el$44.firstChild.nextSibling;
136
- _el$47.nextSibling;
137
- var _el$48 = _el$44.nextSibling;
138
- insert(_el$44, () => allConflicts().length, _el$47);
139
- insert(_el$48, createComponent(For, {
140
- get each() {
141
- return targetConflicts();
142
- },
143
- children: (conflict) => {
144
- const itemStyle = () => getConflictItemStyle(conflictBehavior(), true);
145
- const label = () => getConflictLabel(conflictBehavior(), true);
146
- return (() => {
147
- var _el$51 = _tmpl$8(), _el$52 = _el$51.firstChild, _el$59 = _el$52.nextSibling.nextSibling, _el$60 = _el$59.nextSibling.nextSibling, _el$61 = _el$60.nextSibling.nextSibling;
148
- _el$61.nextSibling;
149
- insert(_el$52, label);
150
- insert(_el$51, () => conflict.id, _el$59);
151
- insert(_el$51, () => formatForDisplay(conflict.hotkey), _el$60);
152
- insert(_el$51, () => conflict.options.eventType ?? "keydown", _el$61);
153
- insert(_el$51, () => getTargetDescription(conflict.target), null);
154
- effect(() => className(_el$51, styles()[itemStyle()]));
155
- return _el$51;
156
- })();
157
- }
158
- }), null);
159
- insert(_el$48, createComponent(For, {
160
- get each() {
161
- return scopeConflicts();
162
- },
163
- children: (conflict) => (() => {
164
- var _el$62 = _tmpl$9(), _el$70 = _el$62.firstChild.nextSibling.nextSibling, _el$71 = _el$70.nextSibling.nextSibling, _el$72 = _el$71.nextSibling.nextSibling;
165
- _el$72.nextSibling;
166
- insert(_el$62, () => conflict.id, _el$70);
167
- insert(_el$62, () => formatForDisplay(conflict.hotkey), _el$71);
168
- insert(_el$62, () => conflict.options.eventType ?? "keydown", _el$72);
169
- insert(_el$62, () => getTargetDescription(conflict.target), null);
170
- effect(() => className(_el$62, styles().conflictItemScope));
171
- return _el$62;
172
- })()
173
- }), null);
174
- effect((_p$) => {
175
- var _v$0 = styles().detailSection, _v$1 = styles().detailSectionHeader, _v$10 = styles().conflictList;
176
- _v$0 !== _p$.e && className(_el$43, _p$.e = _v$0);
177
- _v$1 !== _p$.t && className(_el$44, _p$.t = _v$1);
178
- _v$10 !== _p$.a && className(_el$48, _p$.a = _v$10);
179
- return _p$;
180
- }, {
181
- e: void 0,
182
- t: void 0,
183
- a: void 0
184
- });
185
- return _el$43;
186
- }
187
- }), null);
188
- effect((_p$) => {
189
- var _v$11 = styles().detailsGrid, _v$12 = styles().detailSection, _v$13 = styles().detailSectionHeader, _v$14 = styles().keyBreakdown, _v$15 = styles().detailSection, _v$16 = styles().detailSectionHeader, _v$17 = styles().detailSection, _v$18 = styles().detailSectionHeader, _v$19 = styles().optionRow, _v$20 = styles().optionLabel, _v$21 = reg().options.enabled !== false ? styles().optionValueTrue : styles().optionValueFalse, _v$22 = styles().optionRow, _v$23 = styles().optionLabel, _v$24 = styles().optionValue, _v$25 = styles().optionRow, _v$26 = styles().optionLabel, _v$27 = reg().options.preventDefault ? styles().optionValueTrue : styles().optionValueFalse, _v$28 = styles().optionRow, _v$29 = styles().optionLabel, _v$30 = reg().options.stopPropagation ? styles().optionValueTrue : styles().optionValueFalse, _v$31 = styles().optionRow, _v$32 = styles().optionLabel, _v$33 = reg().options.ignoreInputs !== false ? styles().optionValueTrue : styles().optionValueFalse, _v$34 = styles().optionRow, _v$35 = styles().optionLabel, _v$36 = reg().options.requireReset ? styles().optionValueTrue : styles().optionValueFalse, _v$37 = styles().optionRow, _v$38 = styles().optionLabel, _v$39 = styles().optionValue, _v$40 = styles().optionRow, _v$41 = styles().optionLabel, _v$42 = reg().hasFired ? styles().optionValueTrue : styles().optionValueFalse;
190
- _v$11 !== _p$.e && className(_el$10, _p$.e = _v$11);
191
- _v$12 !== _p$.t && className(_el$11, _p$.t = _v$12);
192
- _v$13 !== _p$.a && className(_el$12, _p$.a = _v$13);
193
- _v$14 !== _p$.o && className(_el$13, _p$.o = _v$14);
194
- _v$15 !== _p$.i && className(_el$14, _p$.i = _v$15);
195
- _v$16 !== _p$.n && className(_el$15, _p$.n = _v$16);
196
- _v$17 !== _p$.s && className(_el$16, _p$.s = _v$17);
197
- _v$18 !== _p$.h && className(_el$17, _p$.h = _v$18);
198
- _v$19 !== _p$.r && className(_el$19, _p$.r = _v$19);
199
- _v$20 !== _p$.d && className(_el$20, _p$.d = _v$20);
200
- _v$21 !== _p$.l && className(_el$21, _p$.l = _v$21);
201
- _v$22 !== _p$.u && className(_el$22, _p$.u = _v$22);
202
- _v$23 !== _p$.c && className(_el$23, _p$.c = _v$23);
203
- _v$24 !== _p$.w && className(_el$24, _p$.w = _v$24);
204
- _v$25 !== _p$.m && className(_el$25, _p$.m = _v$25);
205
- _v$26 !== _p$.f && className(_el$26, _p$.f = _v$26);
206
- _v$27 !== _p$.y && className(_el$27, _p$.y = _v$27);
207
- _v$28 !== _p$.g && className(_el$28, _p$.g = _v$28);
208
- _v$29 !== _p$.p && className(_el$29, _p$.p = _v$29);
209
- _v$30 !== _p$.b && className(_el$30, _p$.b = _v$30);
210
- _v$31 !== _p$.T && className(_el$31, _p$.T = _v$31);
211
- _v$32 !== _p$.A && className(_el$32, _p$.A = _v$32);
212
- _v$33 !== _p$.O && className(_el$33, _p$.O = _v$33);
213
- _v$34 !== _p$.I && className(_el$34, _p$.I = _v$34);
214
- _v$35 !== _p$.S && className(_el$35, _p$.S = _v$35);
215
- _v$36 !== _p$.W && className(_el$36, _p$.W = _v$36);
216
- _v$37 !== _p$.C && className(_el$37, _p$.C = _v$37);
217
- _v$38 !== _p$.B && className(_el$38, _p$.B = _v$38);
218
- _v$39 !== _p$.v && className(_el$39, _p$.v = _v$39);
219
- _v$40 !== _p$.k && className(_el$40, _p$.k = _v$40);
220
- _v$41 !== _p$.x && className(_el$41, _p$.x = _v$41);
221
- _v$42 !== _p$.j && className(_el$42, _p$.j = _v$42);
222
- return _p$;
223
- }, {
224
- e: void 0,
225
- t: void 0,
226
- a: void 0,
227
- o: void 0,
228
- i: void 0,
229
- n: void 0,
230
- s: void 0,
231
- h: void 0,
232
- r: void 0,
233
- d: void 0,
234
- l: void 0,
235
- u: void 0,
236
- c: void 0,
237
- w: void 0,
238
- m: void 0,
239
- f: void 0,
240
- y: void 0,
241
- g: void 0,
242
- p: void 0,
243
- b: void 0,
244
- T: void 0,
245
- A: void 0,
246
- O: void 0,
247
- I: void 0,
248
- S: void 0,
249
- W: void 0,
250
- C: void 0,
251
- B: void 0,
252
- v: void 0,
253
- k: void 0,
254
- x: void 0,
255
- j: void 0
491
+ state,
492
+ getTargetDescription,
493
+ findSequenceTargetConflicts,
494
+ findSequenceScopeConflicts,
495
+ getConflictItemStyle,
496
+ getConflictLabel,
497
+ formatHotkeySequence,
498
+ formatForDisplay,
499
+ styles
256
500
  });
257
- return _el$10;
258
- })()];
259
- }
501
+ }
502
+ })
260
503
  }));
261
- effect(() => className(_el$, styles().stateDetails));
262
- return _el$;
504
+ effect(() => className(_el$141, styles().stateDetails));
505
+ return _el$141;
263
506
  })();
264
507
  }
265
508