@silvery/examples 0.17.4 → 0.17.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_banner-A70_y2Vi.mjs +43 -0
- package/dist/{ansi-CCE2pVS0.mjs → ansi-0VXlUmNn.mjs} +7 -7
- package/dist/apng-B0gRaDVT.mjs +3 -0
- package/dist/{apng-HhhBjRGt.mjs → apng-BTRDTfDW.mjs} +2 -2
- package/dist/apps/aichat/index.mjs +69 -70
- package/dist/apps/app-todo.mjs +19 -20
- package/dist/apps/async-data.mjs +40 -41
- package/dist/apps/cli-wizard.mjs +51 -52
- package/dist/apps/clipboard.mjs +26 -27
- package/dist/apps/components.mjs +189 -190
- package/dist/apps/data-explorer.mjs +52 -53
- package/dist/apps/dev-tools.mjs +39 -40
- package/dist/apps/explorer.mjs +73 -74
- package/dist/apps/gallery.mjs +61 -62
- package/dist/apps/inline-bench.mjs +1 -1
- package/dist/apps/kanban.mjs +22 -23
- package/dist/apps/layout-ref.mjs +27 -28
- package/dist/apps/outline.mjs +35 -36
- package/dist/apps/paste-demo.mjs +33 -34
- package/dist/apps/scroll.mjs +11 -12
- package/dist/apps/search-filter.mjs +23 -24
- package/dist/apps/selection.mjs +30 -31
- package/dist/apps/spatial-focus-demo.mjs +32 -33
- package/dist/apps/task-list.mjs +25 -26
- package/dist/apps/terminal-caps-demo.mjs +30 -31
- package/dist/apps/terminal.mjs +157 -158
- package/dist/apps/text-selection-demo.mjs +62 -63
- package/dist/apps/textarea.mjs +21 -22
- package/dist/apps/theme.mjs +142 -143
- package/dist/apps/transform.mjs +25 -26
- package/dist/apps/virtual-10k.mjs +52 -53
- package/dist/{backends-Bahh9mKN.mjs → backends-Dj-11kZF.mjs} +1 -1
- package/dist/backends-U3QwStfO.mjs +3 -0
- package/dist/components/counter.mjs +6 -7
- package/dist/components/hello.mjs +5 -6
- package/dist/components/progress-bar.mjs +10 -11
- package/dist/components/select-list.mjs +8 -9
- package/dist/components/spinner.mjs +10 -11
- package/dist/components/text-input.mjs +8 -9
- package/dist/components/virtual-list.mjs +7 -8
- package/dist/{flexily-zero-adapter-UB-ra8fR.mjs → flexily-zero-adapter-ByVzLTFP.mjs} +1 -1
- package/dist/gif-B6NGH5gs.mjs +3 -0
- package/dist/{gif-BtnXuxLF.mjs → gif-CfkOF-iG.mjs} +2 -2
- package/dist/layout/dashboard.mjs +197 -198
- package/dist/layout/live-resize.mjs +44 -45
- package/dist/layout/overflow.mjs +16 -17
- package/dist/layout/text-layout.mjs +67 -68
- package/dist/{plugins-D1KtkT4a.mjs → plugins-CT0DdV_E.mjs} +12 -13
- package/dist/{src-BTEVGpd9.mjs → src-jO3Zuzjj.mjs} +3 -3
- package/dist/{yoga-adapter-BVtQ5OJR.mjs → yoga-adapter-BSQHuMV9.mjs} +1 -1
- package/package.json +4 -2
- package/dist/_banner-DLPxCqVy.mjs +0 -44
- package/dist/apng-mwUQbTTF.mjs +0 -3
- package/dist/backends-CCtCDQ94.mjs +0 -3
- package/dist/gif-BZaqPPVX.mjs +0 -3
- package/dist/jsx-runtime-dMs_8fNu.mjs +0 -241
- /package/dist/{UPNG-Cy7ViL8f.mjs → UPNG-ShUlaTDh.mjs} +0 -0
- /package/dist/{__vite-browser-external-2447137e-BML7CYau.mjs → __vite-browser-external-2447137e-Bopa5BFR.mjs} +0 -0
- /package/dist/{gifenc-CLRW41dk.mjs → gifenc-BI4ihP_T.mjs} +0 -0
- /package/dist/{node-NuJ94BWl.mjs → node-nsrAOjH4.mjs} +0 -0
- /package/dist/{resvg-js-C_8Wps1F.mjs → resvg-js-Cnk2o49d.mjs} +0 -0
- /package/dist/{src-CzfRafCQ.mjs → src-9ZhfQyzD.mjs} +0 -0
package/dist/apps/terminal.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { t as _usingCtx } from "../usingCtx-CsEf0xO3.mjs";
|
|
2
|
-
import { t as
|
|
3
|
-
import { t as ExampleBanner } from "../_banner-DLPxCqVy.mjs";
|
|
2
|
+
import { t as ExampleBanner } from "../_banner-A70_y2Vi.mjs";
|
|
4
3
|
import { useEffect, useRef, useState } from "react";
|
|
5
4
|
import { Box, H2, Kbd, KittyFlags, Muted, Small, Tab, TabList, TabPanel, Tabs, Text, copyToClipboard, createTerm, detectKittyFromStdio, disableFocusReporting, disableKittyKeyboard, disableMouse, enableFocusReporting, enableKittyKeyboard, enableMouse, isMouseSequence, parseClipboardResponse, parseFocusEvent, parseKeypress, parseMouseSequence, render, requestClipboard, useApp, useInput, useStdout } from "silvery";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
//#region apps/terminal.tsx
|
|
7
7
|
/**
|
|
8
8
|
* Terminal Kitchensink
|
|
@@ -20,7 +20,6 @@ import { Box, H2, Kbd, KittyFlags, Muted, Small, Tab, TabList, TabPanel, Tabs, T
|
|
|
20
20
|
*
|
|
21
21
|
* Run: bun vendor/silvery/examples/apps/terminal.tsx
|
|
22
22
|
*/
|
|
23
|
-
var import_jsx_runtime = require_jsx_runtime();
|
|
24
23
|
const meta = {
|
|
25
24
|
name: "Terminal",
|
|
26
25
|
description: "Keyboard, mouse, clipboard, focus, and terminal capabilities",
|
|
@@ -119,26 +118,26 @@ function KeysTab({ kittySupported }) {
|
|
|
119
118
|
stdin.off("data", onData);
|
|
120
119
|
};
|
|
121
120
|
}, [stdin]);
|
|
122
|
-
return /* @__PURE__ */
|
|
121
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
123
122
|
gap: 3,
|
|
124
123
|
paddingX: 1,
|
|
125
124
|
paddingTop: 1,
|
|
126
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
127
126
|
flexDirection: "column",
|
|
128
127
|
width: 46,
|
|
129
128
|
children: [
|
|
130
|
-
/* @__PURE__ */
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
latest ? /* @__PURE__ */
|
|
129
|
+
/* @__PURE__ */ jsx(H2, { children: "Last Key Pressed" }),
|
|
130
|
+
/* @__PURE__ */ jsx(Box, { height: 1 }),
|
|
131
|
+
latest ? /* @__PURE__ */ jsx(KeyDetails, { event: latest }) : /* @__PURE__ */ jsx(KeyPlaceholder, { kittySupported })
|
|
133
132
|
]
|
|
134
|
-
}), /* @__PURE__ */
|
|
133
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
135
134
|
flexDirection: "column",
|
|
136
135
|
flexGrow: 1,
|
|
137
136
|
children: [
|
|
138
|
-
/* @__PURE__ */
|
|
137
|
+
/* @__PURE__ */ jsxs(H2, { children: [
|
|
139
138
|
"Event Log",
|
|
140
139
|
" ",
|
|
141
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ jsxs(Small, { children: [
|
|
142
141
|
"(",
|
|
143
142
|
counterRef.current,
|
|
144
143
|
" ",
|
|
@@ -146,15 +145,15 @@ function KeysTab({ kittySupported }) {
|
|
|
146
145
|
")"
|
|
147
146
|
] })
|
|
148
147
|
] }),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
events.length === 0 ? /* @__PURE__ */
|
|
148
|
+
/* @__PURE__ */ jsx(Box, { height: 1 }),
|
|
149
|
+
events.length === 0 ? /* @__PURE__ */ jsx(Muted, { children: "Waiting for input..." }) : /* @__PURE__ */ jsx(Box, {
|
|
151
150
|
flexDirection: "column",
|
|
152
151
|
overflow: "scroll",
|
|
153
152
|
scrollTo: events.length - 1,
|
|
154
|
-
children: events.map((e, i) => /* @__PURE__ */
|
|
153
|
+
children: events.map((e, i) => /* @__PURE__ */ jsxs(Text, {
|
|
155
154
|
dimColor: i < events.length - 1,
|
|
156
155
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ jsxs(Text, {
|
|
158
157
|
color: "$muted",
|
|
159
158
|
children: ["#", String(e.index).padStart(3)]
|
|
160
159
|
}),
|
|
@@ -168,15 +167,15 @@ function KeysTab({ kittySupported }) {
|
|
|
168
167
|
});
|
|
169
168
|
}
|
|
170
169
|
function KeyPlaceholder({ kittySupported }) {
|
|
171
|
-
return /* @__PURE__ */
|
|
170
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
172
171
|
flexDirection: "column",
|
|
173
172
|
children: [
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
kittySupported && /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ jsx(Text, { children: "Try pressing some key combinations:" }),
|
|
174
|
+
/* @__PURE__ */ jsx(Box, { height: 1 }),
|
|
175
|
+
/* @__PURE__ */ jsx(Text, { children: " Ctrl+A, Shift+Tab, Alt+Enter..." }),
|
|
176
|
+
kittySupported && /* @__PURE__ */ jsx(Text, { children: " Cmd+S, Hyper+X (Kitty-only)" }),
|
|
177
|
+
/* @__PURE__ */ jsx(Box, { height: 1 }),
|
|
178
|
+
/* @__PURE__ */ jsx(Muted, { children: "Each keypress shows its full breakdown here." })
|
|
180
179
|
]
|
|
181
180
|
});
|
|
182
181
|
}
|
|
@@ -189,118 +188,118 @@ function KeyDetails({ event }) {
|
|
|
189
188
|
parsed.super,
|
|
190
189
|
parsed.hyper
|
|
191
190
|
];
|
|
192
|
-
return /* @__PURE__ */
|
|
191
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
193
192
|
flexDirection: "column",
|
|
194
193
|
children: [
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
195
|
+
/* @__PURE__ */ jsx(Text, {
|
|
197
196
|
bold: true,
|
|
198
197
|
children: "Name:"
|
|
199
198
|
}),
|
|
200
199
|
" ",
|
|
201
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ jsx(Text, {
|
|
202
201
|
bold: true,
|
|
203
202
|
color: "$primary",
|
|
204
203
|
children: parsed.name || "(none)"
|
|
205
204
|
})
|
|
206
205
|
] }),
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
206
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
207
|
+
/* @__PURE__ */ jsx(Text, {
|
|
209
208
|
bold: true,
|
|
210
209
|
children: "Input:"
|
|
211
210
|
}),
|
|
212
211
|
" ",
|
|
213
212
|
JSON.stringify(event.input)
|
|
214
213
|
] }),
|
|
215
|
-
/* @__PURE__ */
|
|
214
|
+
/* @__PURE__ */ jsx(Box, {
|
|
216
215
|
marginTop: 1,
|
|
217
216
|
gap: 1,
|
|
218
|
-
children: MODIFIER_DEFS.map((mod, i) => /* @__PURE__ */
|
|
217
|
+
children: MODIFIER_DEFS.map((mod, i) => /* @__PURE__ */ jsx(ModBadge, {
|
|
219
218
|
mod,
|
|
220
219
|
active: modActive[i]
|
|
221
220
|
}, mod.symbol))
|
|
222
221
|
}),
|
|
223
|
-
parsed.eventType && /* @__PURE__ */
|
|
222
|
+
parsed.eventType && /* @__PURE__ */ jsx(Box, {
|
|
224
223
|
marginTop: 1,
|
|
225
|
-
children: /* @__PURE__ */
|
|
226
|
-
/* @__PURE__ */
|
|
224
|
+
children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
225
|
+
/* @__PURE__ */ jsx(Text, {
|
|
227
226
|
bold: true,
|
|
228
227
|
children: "Event type:"
|
|
229
228
|
}),
|
|
230
229
|
" ",
|
|
231
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ jsx(Text, {
|
|
232
231
|
color: "$accent",
|
|
233
232
|
children: parsed.eventType
|
|
234
233
|
})
|
|
235
234
|
] })
|
|
236
235
|
}),
|
|
237
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
238
237
|
flexDirection: "column",
|
|
239
238
|
marginTop: 1,
|
|
240
239
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ jsx(Text, {
|
|
242
241
|
bold: true,
|
|
243
242
|
color: "$muted",
|
|
244
243
|
children: "Kitty Extensions"
|
|
245
244
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ jsx(KittyField, {
|
|
247
246
|
label: "shiftedKey",
|
|
248
247
|
value: parsed.shiftedKey
|
|
249
248
|
}),
|
|
250
|
-
/* @__PURE__ */
|
|
249
|
+
/* @__PURE__ */ jsx(KittyField, {
|
|
251
250
|
label: "baseLayoutKey",
|
|
252
251
|
value: parsed.baseLayoutKey
|
|
253
252
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
253
|
+
/* @__PURE__ */ jsx(KittyField, {
|
|
255
254
|
label: "associatedText",
|
|
256
255
|
value: parsed.associatedText
|
|
257
256
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
257
|
+
/* @__PURE__ */ jsx(KittyField, {
|
|
259
258
|
label: "capsLock",
|
|
260
259
|
value: parsed.capsLock
|
|
261
260
|
}),
|
|
262
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ jsx(KittyField, {
|
|
263
262
|
label: "numLock",
|
|
264
263
|
value: parsed.numLock
|
|
265
264
|
})
|
|
266
265
|
]
|
|
267
266
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
267
|
+
/* @__PURE__ */ jsx(Box, {
|
|
269
268
|
marginTop: 1,
|
|
270
|
-
children: /* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
269
|
+
children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
270
|
+
/* @__PURE__ */ jsx(Text, {
|
|
272
271
|
bold: true,
|
|
273
272
|
children: "Raw:"
|
|
274
273
|
}),
|
|
275
274
|
" ",
|
|
276
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ jsx(Muted, { children: [...raw].map((c) => c.charCodeAt(0) < 32 || c.charCodeAt(0) === 127 ? `\\x${c.charCodeAt(0).toString(16).padStart(2, "0")}` : c).join("") })
|
|
277
276
|
] })
|
|
278
277
|
})
|
|
279
278
|
]
|
|
280
279
|
});
|
|
281
280
|
}
|
|
282
281
|
function ModBadge({ mod, active }) {
|
|
283
|
-
if (active) return /* @__PURE__ */
|
|
282
|
+
if (active) return /* @__PURE__ */ jsx(Text, {
|
|
284
283
|
backgroundColor: mod.color,
|
|
285
284
|
color: "$inversebg",
|
|
286
285
|
bold: true,
|
|
287
286
|
children: ` ${mod.symbol} ${mod.label} `
|
|
288
287
|
});
|
|
289
|
-
return /* @__PURE__ */
|
|
288
|
+
return /* @__PURE__ */ jsx(Text, {
|
|
290
289
|
color: "$muted",
|
|
291
290
|
children: ` ${mod.symbol} `
|
|
292
291
|
});
|
|
293
292
|
}
|
|
294
293
|
function KittyField({ label, value }) {
|
|
295
|
-
if (value === void 0) return /* @__PURE__ */
|
|
294
|
+
if (value === void 0) return /* @__PURE__ */ jsxs(Muted, { children: [
|
|
296
295
|
label,
|
|
297
296
|
": ",
|
|
298
297
|
"--"
|
|
299
298
|
] });
|
|
300
|
-
return /* @__PURE__ */
|
|
299
|
+
return /* @__PURE__ */ jsxs(Text, { children: [
|
|
301
300
|
label,
|
|
302
301
|
": ",
|
|
303
|
-
/* @__PURE__ */
|
|
302
|
+
/* @__PURE__ */ jsx(Text, {
|
|
304
303
|
color: "$warning",
|
|
305
304
|
children: String(value)
|
|
306
305
|
})
|
|
@@ -392,91 +391,91 @@ function MouseTab() {
|
|
|
392
391
|
stdin.off("data", onData);
|
|
393
392
|
};
|
|
394
393
|
}, [stdin]);
|
|
395
|
-
return /* @__PURE__ */
|
|
394
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
396
395
|
gap: 3,
|
|
397
396
|
paddingX: 1,
|
|
398
397
|
paddingTop: 1,
|
|
399
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
400
399
|
flexDirection: "column",
|
|
401
400
|
width: 36,
|
|
402
401
|
children: [
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
/* @__PURE__ */
|
|
402
|
+
/* @__PURE__ */ jsx(H2, { children: "Position" }),
|
|
403
|
+
/* @__PURE__ */ jsx(Box, {
|
|
405
404
|
marginTop: 1,
|
|
406
|
-
children: mousePos ? /* @__PURE__ */
|
|
405
|
+
children: mousePos ? /* @__PURE__ */ jsxs(Box, {
|
|
407
406
|
flexDirection: "column",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
409
|
-
/* @__PURE__ */
|
|
407
|
+
children: [/* @__PURE__ */ jsxs(Text, { children: [
|
|
408
|
+
/* @__PURE__ */ jsx(Text, {
|
|
410
409
|
bold: true,
|
|
411
410
|
children: "X:"
|
|
412
411
|
}),
|
|
413
412
|
" ",
|
|
414
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ jsx(Text, {
|
|
415
414
|
color: "$primary",
|
|
416
415
|
bold: true,
|
|
417
416
|
children: String(mousePos.x).padStart(4)
|
|
418
417
|
})
|
|
419
|
-
] }), /* @__PURE__ */
|
|
420
|
-
/* @__PURE__ */
|
|
418
|
+
] }), /* @__PURE__ */ jsxs(Text, { children: [
|
|
419
|
+
/* @__PURE__ */ jsx(Text, {
|
|
421
420
|
bold: true,
|
|
422
421
|
children: "Y:"
|
|
423
422
|
}),
|
|
424
423
|
" ",
|
|
425
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ jsx(Text, {
|
|
426
425
|
color: "$primary",
|
|
427
426
|
bold: true,
|
|
428
427
|
children: String(mousePos.y).padStart(4)
|
|
429
428
|
})
|
|
430
429
|
] })]
|
|
431
|
-
}) : /* @__PURE__ */
|
|
430
|
+
}) : /* @__PURE__ */ jsx(Muted, { children: "Move mouse to track position" })
|
|
432
431
|
}),
|
|
433
|
-
/* @__PURE__ */
|
|
432
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
434
433
|
marginTop: 1,
|
|
435
434
|
flexDirection: "column",
|
|
436
|
-
children: [/* @__PURE__ */
|
|
435
|
+
children: [/* @__PURE__ */ jsx(H2, { children: "Click Counts" }), /* @__PURE__ */ jsxs(Box, {
|
|
437
436
|
marginTop: 1,
|
|
438
437
|
flexDirection: "column",
|
|
439
438
|
children: [
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
439
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
440
|
+
/* @__PURE__ */ jsx(Text, {
|
|
442
441
|
bold: true,
|
|
443
442
|
children: "Left:"
|
|
444
443
|
}),
|
|
445
444
|
" ",
|
|
446
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ jsx(Text, {
|
|
447
446
|
color: "$info",
|
|
448
447
|
children: clicks.left
|
|
449
448
|
})
|
|
450
449
|
] }),
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
451
|
+
/* @__PURE__ */ jsx(Text, {
|
|
453
452
|
bold: true,
|
|
454
453
|
children: "Middle:"
|
|
455
454
|
}),
|
|
456
455
|
" ",
|
|
457
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ jsx(Text, {
|
|
458
457
|
color: "$info",
|
|
459
458
|
children: clicks.middle
|
|
460
459
|
})
|
|
461
460
|
] }),
|
|
462
|
-
/* @__PURE__ */
|
|
463
|
-
/* @__PURE__ */
|
|
461
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
462
|
+
/* @__PURE__ */ jsx(Text, {
|
|
464
463
|
bold: true,
|
|
465
464
|
children: "Right:"
|
|
466
465
|
}),
|
|
467
466
|
" ",
|
|
468
|
-
/* @__PURE__ */
|
|
467
|
+
/* @__PURE__ */ jsx(Text, {
|
|
469
468
|
color: "$info",
|
|
470
469
|
children: clicks.right
|
|
471
470
|
})
|
|
472
471
|
] }),
|
|
473
|
-
/* @__PURE__ */
|
|
474
|
-
/* @__PURE__ */
|
|
472
|
+
/* @__PURE__ */ jsxs(Text, { children: [
|
|
473
|
+
/* @__PURE__ */ jsx(Text, {
|
|
475
474
|
bold: true,
|
|
476
475
|
children: "Scroll:"
|
|
477
476
|
}),
|
|
478
477
|
" ",
|
|
479
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ jsx(Text, {
|
|
480
479
|
color: "$info",
|
|
481
480
|
children: scrollTotal
|
|
482
481
|
})
|
|
@@ -485,40 +484,40 @@ function MouseTab() {
|
|
|
485
484
|
})]
|
|
486
485
|
})
|
|
487
486
|
]
|
|
488
|
-
}), /* @__PURE__ */
|
|
487
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
489
488
|
flexDirection: "column",
|
|
490
489
|
flexGrow: 1,
|
|
491
490
|
children: [
|
|
492
|
-
/* @__PURE__ */
|
|
491
|
+
/* @__PURE__ */ jsxs(H2, { children: ["Mouse Events ", /* @__PURE__ */ jsxs(Small, { children: [
|
|
493
492
|
"(",
|
|
494
493
|
counterRef.current,
|
|
495
494
|
")"
|
|
496
495
|
] })] }),
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
events.length === 0 ? /* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ jsx(Box, { height: 1 }),
|
|
497
|
+
events.length === 0 ? /* @__PURE__ */ jsx(Muted, { children: "Click or scroll to see events..." }) : /* @__PURE__ */ jsx(Box, {
|
|
499
498
|
flexDirection: "column",
|
|
500
499
|
overflow: "scroll",
|
|
501
500
|
scrollTo: events.length - 1,
|
|
502
|
-
children: events.map((e, i) => /* @__PURE__ */
|
|
501
|
+
children: events.map((e, i) => /* @__PURE__ */ jsxs(Text, {
|
|
503
502
|
dimColor: i < events.length - 1,
|
|
504
503
|
children: [
|
|
505
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ jsx(Small, { children: e.timestamp }),
|
|
506
505
|
" ",
|
|
507
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ jsx(Text, {
|
|
508
507
|
color: e.action.startsWith("scroll") ? "$accent" : "$primary",
|
|
509
508
|
bold: true,
|
|
510
509
|
children: e.action
|
|
511
510
|
}),
|
|
512
511
|
" ",
|
|
513
|
-
e.button !== "wheel" && /* @__PURE__ */
|
|
514
|
-
/* @__PURE__ */
|
|
512
|
+
e.button !== "wheel" && /* @__PURE__ */ jsxs(Text, { children: [e.button, " "] }),
|
|
513
|
+
/* @__PURE__ */ jsxs(Muted, { children: [
|
|
515
514
|
"(",
|
|
516
515
|
e.x,
|
|
517
516
|
",",
|
|
518
517
|
e.y,
|
|
519
518
|
")"
|
|
520
519
|
] }),
|
|
521
|
-
e.mods ? /* @__PURE__ */
|
|
520
|
+
e.mods ? /* @__PURE__ */ jsxs(Text, {
|
|
522
521
|
color: "$warning",
|
|
523
522
|
children: [" +", e.mods]
|
|
524
523
|
}) : null
|
|
@@ -574,30 +573,30 @@ function ClipboardTab() {
|
|
|
574
573
|
}]);
|
|
575
574
|
}
|
|
576
575
|
});
|
|
577
|
-
return /* @__PURE__ */
|
|
576
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
578
577
|
flexDirection: "column",
|
|
579
578
|
paddingX: 1,
|
|
580
579
|
paddingTop: 1,
|
|
581
580
|
gap: 1,
|
|
582
581
|
children: [
|
|
583
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
584
583
|
flexDirection: "column",
|
|
585
|
-
children: [/* @__PURE__ */
|
|
584
|
+
children: [/* @__PURE__ */ jsxs(H2, { children: [
|
|
586
585
|
"Snippets",
|
|
587
586
|
" ",
|
|
588
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ jsxs(Small, { children: [
|
|
589
588
|
selectedIndex + 1,
|
|
590
589
|
"/",
|
|
591
590
|
snippets.length
|
|
592
591
|
] })
|
|
593
|
-
] }), /* @__PURE__ */
|
|
592
|
+
] }), /* @__PURE__ */ jsx(Box, {
|
|
594
593
|
flexDirection: "column",
|
|
595
594
|
marginTop: 1,
|
|
596
595
|
overflow: "scroll",
|
|
597
596
|
scrollTo: selectedIndex,
|
|
598
|
-
children: snippets.map((text, i) => /* @__PURE__ */
|
|
597
|
+
children: snippets.map((text, i) => /* @__PURE__ */ jsx(Box, {
|
|
599
598
|
paddingX: 1,
|
|
600
|
-
children: /* @__PURE__ */
|
|
599
|
+
children: /* @__PURE__ */ jsxs(Text, {
|
|
601
600
|
color: i === selectedIndex ? "$bg" : void 0,
|
|
602
601
|
backgroundColor: i === selectedIndex ? "$primary" : void 0,
|
|
603
602
|
bold: i === selectedIndex,
|
|
@@ -606,56 +605,56 @@ function ClipboardTab() {
|
|
|
606
605
|
}, i))
|
|
607
606
|
})]
|
|
608
607
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
610
609
|
gap: 4,
|
|
611
|
-
children: [/* @__PURE__ */
|
|
610
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
612
611
|
flexDirection: "column",
|
|
613
|
-
children: [/* @__PURE__ */
|
|
612
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
614
613
|
bold: true,
|
|
615
614
|
children: "Last Copied:"
|
|
616
|
-
}), lastCopied ? /* @__PURE__ */
|
|
615
|
+
}), lastCopied ? /* @__PURE__ */ jsxs(Text, {
|
|
617
616
|
color: "$success",
|
|
618
617
|
children: ["✓ ", lastCopied]
|
|
619
|
-
}) : /* @__PURE__ */
|
|
620
|
-
}), /* @__PURE__ */
|
|
618
|
+
}) : /* @__PURE__ */ jsx(Muted, { children: "nothing" })]
|
|
619
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
621
620
|
flexDirection: "column",
|
|
622
|
-
children: [/* @__PURE__ */
|
|
621
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
623
622
|
bold: true,
|
|
624
623
|
children: "Last Pasted:"
|
|
625
|
-
}), lastPasted ? /* @__PURE__ */
|
|
624
|
+
}), lastPasted ? /* @__PURE__ */ jsx(Text, {
|
|
626
625
|
color: "$warning",
|
|
627
626
|
children: lastPasted
|
|
628
|
-
}) : /* @__PURE__ */
|
|
627
|
+
}) : /* @__PURE__ */ jsx(Muted, { children: "nothing" })]
|
|
629
628
|
})]
|
|
630
629
|
}),
|
|
631
|
-
history.length > 0 && /* @__PURE__ */
|
|
630
|
+
history.length > 0 && /* @__PURE__ */ jsxs(Box, {
|
|
632
631
|
flexDirection: "column",
|
|
633
|
-
children: [/* @__PURE__ */
|
|
632
|
+
children: [/* @__PURE__ */ jsx(H2, { children: "History" }), /* @__PURE__ */ jsx(Box, {
|
|
634
633
|
flexDirection: "column",
|
|
635
634
|
overflow: "scroll",
|
|
636
635
|
scrollTo: history.length - 1,
|
|
637
|
-
children: history.map((h, i) => /* @__PURE__ */
|
|
636
|
+
children: history.map((h, i) => /* @__PURE__ */ jsxs(Text, {
|
|
638
637
|
dimColor: i < history.length - 1,
|
|
639
638
|
children: [
|
|
640
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ jsx(Small, { children: h.time }),
|
|
641
640
|
" ",
|
|
642
|
-
/* @__PURE__ */
|
|
641
|
+
/* @__PURE__ */ jsx(Text, {
|
|
643
642
|
color: h.action === "copy" ? "$success" : h.action === "paste" ? "$warning" : "$muted",
|
|
644
643
|
bold: true,
|
|
645
644
|
children: h.action
|
|
646
645
|
}),
|
|
647
646
|
" ",
|
|
648
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ jsx(Text, { children: h.text.length > 40 ? h.text.slice(0, 37) + "..." : h.text })
|
|
649
648
|
]
|
|
650
649
|
}, i))
|
|
651
650
|
})]
|
|
652
651
|
}),
|
|
653
|
-
/* @__PURE__ */
|
|
654
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ jsxs(Muted, { children: [
|
|
653
|
+
/* @__PURE__ */ jsx(Kbd, { children: "j/k" }),
|
|
655
654
|
" navigate ",
|
|
656
|
-
/* @__PURE__ */
|
|
655
|
+
/* @__PURE__ */ jsx(Kbd, { children: "c" }),
|
|
657
656
|
" copy ",
|
|
658
|
-
/* @__PURE__ */
|
|
657
|
+
/* @__PURE__ */ jsx(Kbd, { children: "v" }),
|
|
659
658
|
" paste (OSC 52)"
|
|
660
659
|
] })
|
|
661
660
|
]
|
|
@@ -684,75 +683,75 @@ function FocusTab() {
|
|
|
684
683
|
stdin.off("data", onData);
|
|
685
684
|
};
|
|
686
685
|
}, [stdin]);
|
|
687
|
-
return /* @__PURE__ */
|
|
686
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
688
687
|
gap: 3,
|
|
689
688
|
paddingX: 1,
|
|
690
689
|
paddingTop: 1,
|
|
691
|
-
children: [/* @__PURE__ */
|
|
690
|
+
children: [/* @__PURE__ */ jsxs(Box, {
|
|
692
691
|
flexDirection: "column",
|
|
693
692
|
width: 36,
|
|
694
693
|
children: [
|
|
695
|
-
/* @__PURE__ */
|
|
696
|
-
/* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ jsx(H2, { children: "Terminal Focus" }),
|
|
695
|
+
/* @__PURE__ */ jsxs(Box, {
|
|
697
696
|
marginTop: 1,
|
|
698
697
|
flexDirection: "column",
|
|
699
698
|
alignItems: "center",
|
|
700
699
|
gap: 1,
|
|
701
|
-
children: [/* @__PURE__ */
|
|
700
|
+
children: [/* @__PURE__ */ jsx(Text, {
|
|
702
701
|
bold: true,
|
|
703
702
|
color: focused ? "$success" : "$error",
|
|
704
703
|
children: focused ? " FOCUSED " : " UNFOCUSED "
|
|
705
|
-
}), /* @__PURE__ */
|
|
704
|
+
}), /* @__PURE__ */ jsx(Text, {
|
|
706
705
|
color: focused ? "$success" : "$error",
|
|
707
706
|
children: focused ? "Terminal window is active" : "Terminal window lost focus"
|
|
708
707
|
})]
|
|
709
708
|
}),
|
|
710
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ jsx(Box, {
|
|
711
710
|
marginTop: 2,
|
|
712
711
|
flexDirection: "column",
|
|
713
|
-
children: /* @__PURE__ */
|
|
712
|
+
children: /* @__PURE__ */ jsx(Muted, { children: "Switch to another window and back to see focus events. Uses CSI I/O terminal focus reporting protocol." })
|
|
714
713
|
}),
|
|
715
|
-
/* @__PURE__ */
|
|
714
|
+
/* @__PURE__ */ jsx(Box, {
|
|
716
715
|
marginTop: 1,
|
|
717
|
-
children: /* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */
|
|
716
|
+
children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
717
|
+
/* @__PURE__ */ jsx(Text, {
|
|
719
718
|
bold: true,
|
|
720
719
|
children: "Protocol:"
|
|
721
720
|
}),
|
|
722
721
|
" ",
|
|
723
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ jsx(Text, {
|
|
724
723
|
color: "$info",
|
|
725
724
|
children: "CSI ?1004h (DECRPM focus events)"
|
|
726
725
|
})
|
|
727
726
|
] })
|
|
728
727
|
})
|
|
729
728
|
]
|
|
730
|
-
}), /* @__PURE__ */
|
|
729
|
+
}), /* @__PURE__ */ jsxs(Box, {
|
|
731
730
|
flexDirection: "column",
|
|
732
731
|
flexGrow: 1,
|
|
733
732
|
children: [
|
|
734
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ jsxs(H2, { children: ["Focus Events ", /* @__PURE__ */ jsxs(Small, { children: [
|
|
735
734
|
"(",
|
|
736
735
|
counterRef.current,
|
|
737
736
|
")"
|
|
738
737
|
] })] }),
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
events.length === 0 ? /* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ jsx(Box, { height: 1 }),
|
|
739
|
+
events.length === 0 ? /* @__PURE__ */ jsx(Muted, { children: "Switch windows to generate focus events..." }) : /* @__PURE__ */ jsx(Box, {
|
|
741
740
|
flexDirection: "column",
|
|
742
741
|
overflow: "scroll",
|
|
743
742
|
scrollTo: events.length - 1,
|
|
744
|
-
children: events.map((e, i) => /* @__PURE__ */
|
|
743
|
+
children: events.map((e, i) => /* @__PURE__ */ jsxs(Text, {
|
|
745
744
|
dimColor: i < events.length - 1,
|
|
746
745
|
children: [
|
|
747
|
-
/* @__PURE__ */
|
|
746
|
+
/* @__PURE__ */ jsx(Small, { children: e.timestamp }),
|
|
748
747
|
" ",
|
|
749
|
-
/* @__PURE__ */
|
|
748
|
+
/* @__PURE__ */ jsx(Text, {
|
|
750
749
|
color: e.focused ? "$success" : "$error",
|
|
751
750
|
bold: true,
|
|
752
751
|
children: e.focused ? "focus-in " : "focus-out"
|
|
753
752
|
}),
|
|
754
753
|
" ",
|
|
755
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ jsx(Text, {
|
|
756
755
|
color: e.focused ? "$success" : "$error",
|
|
757
756
|
children: e.focused ? "Terminal gained focus" : "Terminal lost focus"
|
|
758
757
|
})
|
|
@@ -768,73 +767,73 @@ function TerminalDemo({ kittySupported }) {
|
|
|
768
767
|
useInput((input, key) => {
|
|
769
768
|
if (input === "q" || key.escape) exit();
|
|
770
769
|
});
|
|
771
|
-
return /* @__PURE__ */
|
|
770
|
+
return /* @__PURE__ */ jsxs(Box, {
|
|
772
771
|
flexDirection: "column",
|
|
773
772
|
flexGrow: 1,
|
|
774
773
|
children: [
|
|
775
|
-
/* @__PURE__ */
|
|
774
|
+
/* @__PURE__ */ jsx(Box, {
|
|
776
775
|
paddingX: 1,
|
|
777
776
|
gap: 2,
|
|
778
|
-
children: /* @__PURE__ */
|
|
779
|
-
/* @__PURE__ */
|
|
777
|
+
children: /* @__PURE__ */ jsxs(Text, { children: [
|
|
778
|
+
/* @__PURE__ */ jsx(Text, {
|
|
780
779
|
bold: true,
|
|
781
780
|
children: "Kitty:"
|
|
782
781
|
}),
|
|
783
782
|
" ",
|
|
784
|
-
kittySupported ? /* @__PURE__ */
|
|
783
|
+
kittySupported ? /* @__PURE__ */ jsx(Text, {
|
|
785
784
|
color: "$success",
|
|
786
785
|
children: "enabled"
|
|
787
|
-
}) : /* @__PURE__ */
|
|
786
|
+
}) : /* @__PURE__ */ jsx(Text, {
|
|
788
787
|
color: "$warning",
|
|
789
788
|
children: "legacy mode"
|
|
790
789
|
})
|
|
791
790
|
] })
|
|
792
791
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ jsxs(Tabs, {
|
|
794
793
|
defaultValue: "keys",
|
|
795
794
|
children: [
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ jsxs(TabList, { children: [
|
|
796
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
798
797
|
value: "keys",
|
|
799
798
|
children: "Keys"
|
|
800
799
|
}),
|
|
801
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
802
801
|
value: "mouse",
|
|
803
802
|
children: "Mouse"
|
|
804
803
|
}),
|
|
805
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
806
805
|
value: "clipboard",
|
|
807
806
|
children: "Clipboard"
|
|
808
807
|
}),
|
|
809
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ jsx(Tab, {
|
|
810
809
|
value: "focus",
|
|
811
810
|
children: "Focus"
|
|
812
811
|
})
|
|
813
812
|
] }),
|
|
814
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ jsx(TabPanel, {
|
|
815
814
|
value: "keys",
|
|
816
|
-
children: /* @__PURE__ */
|
|
815
|
+
children: /* @__PURE__ */ jsx(KeysTab, { kittySupported })
|
|
817
816
|
}),
|
|
818
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ jsx(TabPanel, {
|
|
819
818
|
value: "mouse",
|
|
820
|
-
children: /* @__PURE__ */
|
|
819
|
+
children: /* @__PURE__ */ jsx(MouseTab, {})
|
|
821
820
|
}),
|
|
822
|
-
/* @__PURE__ */
|
|
821
|
+
/* @__PURE__ */ jsx(TabPanel, {
|
|
823
822
|
value: "clipboard",
|
|
824
|
-
children: /* @__PURE__ */
|
|
823
|
+
children: /* @__PURE__ */ jsx(ClipboardTab, {})
|
|
825
824
|
}),
|
|
826
|
-
/* @__PURE__ */
|
|
825
|
+
/* @__PURE__ */ jsx(TabPanel, {
|
|
827
826
|
value: "focus",
|
|
828
|
-
children: /* @__PURE__ */
|
|
827
|
+
children: /* @__PURE__ */ jsx(FocusTab, {})
|
|
829
828
|
})
|
|
830
829
|
]
|
|
831
830
|
}),
|
|
832
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ jsx(Box, {
|
|
833
832
|
paddingX: 1,
|
|
834
|
-
children: /* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
833
|
+
children: /* @__PURE__ */ jsxs(Muted, { children: [
|
|
834
|
+
/* @__PURE__ */ jsx(Kbd, { children: "h/l" }),
|
|
836
835
|
" switch tabs ",
|
|
837
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ jsx(Kbd, { children: "Esc/q" }),
|
|
838
837
|
" quit"
|
|
839
838
|
] })
|
|
840
839
|
})
|
|
@@ -852,10 +851,10 @@ async function main() {
|
|
|
852
851
|
const term = _usingCtx$1.u(createTerm());
|
|
853
852
|
process.stdout.write(enableMouse());
|
|
854
853
|
enableFocusReporting((s) => process.stdout.write(s));
|
|
855
|
-
const { waitUntilExit } = await render(/* @__PURE__ */
|
|
854
|
+
const { waitUntilExit } = await render(/* @__PURE__ */ jsx(ExampleBanner, {
|
|
856
855
|
meta,
|
|
857
856
|
controls: "h/l tabs Esc/q quit",
|
|
858
|
-
children: /* @__PURE__ */
|
|
857
|
+
children: /* @__PURE__ */ jsx(TerminalDemo, { kittySupported: kittyResult.supported })
|
|
859
858
|
}), term);
|
|
860
859
|
await waitUntilExit();
|
|
861
860
|
process.stdout.write(disableMouse());
|