@silvery/examples 0.17.3 → 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.
Files changed (111) hide show
  1. package/dist/UPNG-ShUlaTDh.mjs +5074 -0
  2. package/dist/__vite-browser-external-2447137e-Bopa5BFR.mjs +4 -0
  3. package/dist/_banner-A70_y2Vi.mjs +43 -0
  4. package/dist/ansi-0VXlUmNn.mjs +16397 -0
  5. package/dist/apng-B0gRaDVT.mjs +3 -0
  6. package/dist/apng-BTRDTfDW.mjs +68 -0
  7. package/dist/apps/aichat/index.mjs +1298 -0
  8. package/dist/apps/app-todo.mjs +138 -0
  9. package/dist/apps/async-data.mjs +203 -0
  10. package/dist/apps/cli-wizard.mjs +338 -0
  11. package/dist/apps/clipboard.mjs +197 -0
  12. package/dist/apps/components.mjs +863 -0
  13. package/dist/apps/data-explorer.mjs +482 -0
  14. package/dist/apps/dev-tools.mjs +396 -0
  15. package/dist/apps/explorer.mjs +697 -0
  16. package/dist/apps/gallery.mjs +765 -0
  17. package/dist/apps/inline-bench.mjs +115 -0
  18. package/dist/apps/kanban.mjs +279 -0
  19. package/dist/apps/layout-ref.mjs +186 -0
  20. package/dist/apps/outline.mjs +202 -0
  21. package/dist/apps/paste-demo.mjs +188 -0
  22. package/dist/apps/scroll.mjs +85 -0
  23. package/dist/apps/search-filter.mjs +286 -0
  24. package/dist/apps/selection.mjs +354 -0
  25. package/dist/apps/spatial-focus-demo.mjs +387 -0
  26. package/dist/apps/task-list.mjs +257 -0
  27. package/dist/apps/terminal-caps-demo.mjs +314 -0
  28. package/dist/apps/terminal.mjs +871 -0
  29. package/dist/apps/text-selection-demo.mjs +253 -0
  30. package/dist/apps/textarea.mjs +177 -0
  31. package/dist/apps/theme.mjs +660 -0
  32. package/dist/apps/transform.mjs +214 -0
  33. package/dist/apps/virtual-10k.mjs +421 -0
  34. package/dist/assets/resvgjs.darwin-arm64-BtufyGW1.node +0 -0
  35. package/dist/backends-Dj-11kZF.mjs +1179 -0
  36. package/dist/backends-U3QwStfO.mjs +3 -0
  37. package/dist/{cli.mjs → bin/cli.mjs} +15 -19
  38. package/dist/chunk-BSw8zbkd.mjs +37 -0
  39. package/dist/components/counter.mjs +47 -0
  40. package/dist/components/hello.mjs +30 -0
  41. package/dist/components/progress-bar.mjs +58 -0
  42. package/dist/components/select-list.mjs +84 -0
  43. package/dist/components/spinner.mjs +56 -0
  44. package/dist/components/text-input.mjs +61 -0
  45. package/dist/components/virtual-list.mjs +50 -0
  46. package/dist/flexily-zero-adapter-ByVzLTFP.mjs +3374 -0
  47. package/dist/gif-B6NGH5gs.mjs +3 -0
  48. package/dist/gif-CfkOF-iG.mjs +71 -0
  49. package/dist/gifenc-BI4ihP_T.mjs +728 -0
  50. package/dist/key-mapping-5oYQdAQE.mjs +3 -0
  51. package/dist/key-mapping-D4LR1go6.mjs +130 -0
  52. package/dist/layout/dashboard.mjs +1203 -0
  53. package/dist/layout/live-resize.mjs +302 -0
  54. package/dist/layout/overflow.mjs +69 -0
  55. package/dist/layout/text-layout.mjs +334 -0
  56. package/dist/node-nsrAOjH4.mjs +1083 -0
  57. package/dist/plugins-CT0DdV_E.mjs +3056 -0
  58. package/dist/resvg-js-Cnk2o49d.mjs +201 -0
  59. package/dist/src-9ZhfQyzD.mjs +814 -0
  60. package/dist/src-CUUOuRH6.mjs +5322 -0
  61. package/dist/src-jO3Zuzjj.mjs +23538 -0
  62. package/dist/usingCtx-CsEf0xO3.mjs +57 -0
  63. package/dist/yoga-adapter-BSQHuMV9.mjs +237 -0
  64. package/package.json +21 -14
  65. package/_banner.tsx +0 -60
  66. package/apps/aichat/components.tsx +0 -469
  67. package/apps/aichat/index.tsx +0 -220
  68. package/apps/aichat/script.ts +0 -460
  69. package/apps/aichat/state.ts +0 -325
  70. package/apps/aichat/types.ts +0 -19
  71. package/apps/app-todo.tsx +0 -201
  72. package/apps/async-data.tsx +0 -196
  73. package/apps/cli-wizard.tsx +0 -332
  74. package/apps/clipboard.tsx +0 -183
  75. package/apps/components.tsx +0 -658
  76. package/apps/data-explorer.tsx +0 -490
  77. package/apps/dev-tools.tsx +0 -395
  78. package/apps/explorer.tsx +0 -731
  79. package/apps/gallery.tsx +0 -653
  80. package/apps/inline-bench.tsx +0 -138
  81. package/apps/kanban.tsx +0 -265
  82. package/apps/layout-ref.tsx +0 -173
  83. package/apps/outline.tsx +0 -160
  84. package/apps/panes/index.tsx +0 -203
  85. package/apps/paste-demo.tsx +0 -185
  86. package/apps/scroll.tsx +0 -80
  87. package/apps/search-filter.tsx +0 -240
  88. package/apps/selection.tsx +0 -346
  89. package/apps/spatial-focus-demo.tsx +0 -372
  90. package/apps/task-list.tsx +0 -271
  91. package/apps/terminal-caps-demo.tsx +0 -317
  92. package/apps/terminal.tsx +0 -784
  93. package/apps/text-selection-demo.tsx +0 -193
  94. package/apps/textarea.tsx +0 -155
  95. package/apps/theme.tsx +0 -515
  96. package/apps/transform.tsx +0 -229
  97. package/apps/virtual-10k.tsx +0 -405
  98. package/apps/vterm-demo/index.tsx +0 -216
  99. package/components/counter.tsx +0 -49
  100. package/components/hello.tsx +0 -38
  101. package/components/progress-bar.tsx +0 -52
  102. package/components/select-list.tsx +0 -54
  103. package/components/spinner.tsx +0 -44
  104. package/components/text-input.tsx +0 -61
  105. package/components/virtual-list.tsx +0 -56
  106. package/dist/cli.d.mts +0 -1
  107. package/dist/cli.mjs.map +0 -1
  108. package/layout/dashboard.tsx +0 -953
  109. package/layout/live-resize.tsx +0 -282
  110. package/layout/overflow.tsx +0 -51
  111. package/layout/text-layout.tsx +0 -283
@@ -0,0 +1,253 @@
1
+ import { W as CapabilityRegistryContext } from "../src-jO3Zuzjj.mjs";
2
+ import { t as _usingCtx } from "../usingCtx-CsEf0xO3.mjs";
3
+ import { a as createApp, i as pipe, n as withTerminal, r as withReact, t as withDomEvents } from "../plugins-CT0DdV_E.mjs";
4
+ import { t as ExampleBanner } from "../_banner-A70_y2Vi.mjs";
5
+ import { useContext, useSyncExternalStore } from "react";
6
+ import { Box, H1, H2, HR, Kbd, Muted, Small, Strong, Text } from "silvery";
7
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ //#region ../packages/ag-react/src/hooks/useSelection.ts
9
+ /**
10
+ * useSelection — React hook for accessing the selection feature from the capability registry.
11
+ *
12
+ * Reads SELECTION_CAPABILITY from the app's CapabilityRegistry via context.
13
+ * Returns `undefined` when the selection feature is not installed (e.g., simple
14
+ * run() apps without pipe() composition, or when withDomEvents is not used).
15
+ *
16
+ * When installed, returns the current TerminalSelectionState and re-renders
17
+ * reactively on selection changes via useSyncExternalStore.
18
+ *
19
+ * This is the recommended hook for reading selection state. It replaces the
20
+ * older useTerminalSelection/TerminalSelectionProvider pattern with a simpler
21
+ * capability-based lookup.
22
+ */
23
+ const SELECTION_CAPABILITY = Symbol.for("silvery.selection");
24
+ const noopSubscribe = (_listener) => () => {};
25
+ const getUndefined = () => void 0;
26
+ /**
27
+ * Access the current selection state from the capability registry.
28
+ *
29
+ * Returns `undefined` when:
30
+ * - No CapabilityRegistryContext is provided (simple run() apps)
31
+ * - SELECTION_CAPABILITY is not registered (withDomEvents not used or selection disabled)
32
+ *
33
+ * Returns `TerminalSelectionState` when selection is installed:
34
+ * - `state.range` — current SelectionRange or null (idle)
35
+ * - `state.selecting` — true while mouse button is held
36
+ * - `state.source` — "mouse" | "keyboard" | null
37
+ */
38
+ function useSelection() {
39
+ const feature = useContext(CapabilityRegistryContext)?.get(SELECTION_CAPABILITY);
40
+ return useSyncExternalStore(feature ? (listener) => feature.subscribe(listener) : noopSubscribe, feature ? () => feature.state : getUndefined);
41
+ }
42
+ //#endregion
43
+ //#region apps/text-selection-demo.tsx
44
+ const meta = {
45
+ name: "Text Selection",
46
+ description: "Real selection via useSelection hook, userSelect modes, live state readout",
47
+ demo: true,
48
+ features: [
49
+ "useSelection()",
50
+ "userSelect prop",
51
+ "CapabilityRegistry",
52
+ "mouse drag selection"
53
+ ]
54
+ };
55
+ function SelectableTextPanel() {
56
+ return /* @__PURE__ */ jsxs(Box, {
57
+ flexDirection: "column",
58
+ borderStyle: "round",
59
+ borderColor: "$border",
60
+ paddingX: 1,
61
+ flexGrow: 1,
62
+ children: [
63
+ /* @__PURE__ */ jsx(H2, { children: "Selectable Text" }),
64
+ /* @__PURE__ */ jsx(Small, { children: "userSelect=\"text\" (default)" }),
65
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
66
+ /* @__PURE__ */ jsx(Text, { children: "Drag your mouse over this text to select it." }),
67
+ /* @__PURE__ */ jsx(Text, { children: "Multi-line selections work across paragraphs." }),
68
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
69
+ /* @__PURE__ */ jsx(Text, {
70
+ color: "$muted",
71
+ children: "The quick brown fox jumps over the lazy dog. Pack my box with five dozen liquor jugs."
72
+ })
73
+ ]
74
+ });
75
+ }
76
+ function NonSelectablePanel() {
77
+ return /* @__PURE__ */ jsxs(Box, {
78
+ flexDirection: "column",
79
+ borderStyle: "round",
80
+ borderColor: "$border",
81
+ paddingX: 1,
82
+ flexGrow: 1,
83
+ userSelect: "none",
84
+ children: [
85
+ /* @__PURE__ */ jsx(H2, { children: "Non-Selectable" }),
86
+ /* @__PURE__ */ jsx(Small, { children: "userSelect=\"none\"" }),
87
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
88
+ /* @__PURE__ */ jsx(Text, { children: "This area cannot be selected by mouse drag." }),
89
+ /* @__PURE__ */ jsx(Text, { children: "Click events still work normally here." }),
90
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
91
+ /* @__PURE__ */ jsx(Muted, { children: "Hold Alt and drag to override and select anyway." })
92
+ ]
93
+ });
94
+ }
95
+ function ContainedPanel() {
96
+ return /* @__PURE__ */ jsxs(Box, {
97
+ flexDirection: "column",
98
+ borderStyle: "round",
99
+ borderColor: "$warning",
100
+ paddingX: 1,
101
+ flexGrow: 1,
102
+ children: [
103
+ /* @__PURE__ */ jsx(H2, {
104
+ color: "$warning",
105
+ children: "Contained Selection"
106
+ }),
107
+ /* @__PURE__ */ jsx(Small, { children: "userSelect=\"contain\"" }),
108
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
109
+ /* @__PURE__ */ jsxs(Box, {
110
+ flexDirection: "column",
111
+ borderStyle: "round",
112
+ borderColor: "$primary",
113
+ paddingX: 1,
114
+ userSelect: "contain",
115
+ children: [
116
+ /* @__PURE__ */ jsx(Text, {
117
+ bold: true,
118
+ color: "$primary",
119
+ children: "Selection Boundary"
120
+ }),
121
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
122
+ /* @__PURE__ */ jsx(Text, { children: "Selection cannot escape this container." }),
123
+ /* @__PURE__ */ jsx(Text, { children: "Try dragging past the border — it clips." }),
124
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
125
+ /* @__PURE__ */ jsx(Text, {
126
+ color: "$success",
127
+ children: "Useful for modals, side panes, overlays."
128
+ })
129
+ ]
130
+ })
131
+ ]
132
+ });
133
+ }
134
+ function SelectionStatePanel() {
135
+ const selection = useSelection();
136
+ return /* @__PURE__ */ jsxs(Box, {
137
+ flexDirection: "column",
138
+ borderStyle: "round",
139
+ borderColor: "$info",
140
+ paddingX: 1,
141
+ flexGrow: 1,
142
+ children: [
143
+ /* @__PURE__ */ jsx(H2, {
144
+ color: "$info",
145
+ children: "Selection State"
146
+ }),
147
+ /* @__PURE__ */ jsx(Small, { children: "Live readout from useSelection()" }),
148
+ /* @__PURE__ */ jsx(Box, { height: 1 }),
149
+ !selection ? /* @__PURE__ */ jsx(Text, {
150
+ color: "$muted",
151
+ children: "useSelection() returned undefined — feature not installed"
152
+ }) : selection.range ? /* @__PURE__ */ jsxs(Fragment, { children: [
153
+ /* @__PURE__ */ jsxs(Box, {
154
+ gap: 1,
155
+ children: [/* @__PURE__ */ jsx(Strong, { children: "Status:" }), /* @__PURE__ */ jsx(Text, {
156
+ color: "$success",
157
+ children: selection.selecting ? "Selecting..." : "Selected"
158
+ })]
159
+ }),
160
+ /* @__PURE__ */ jsxs(Box, {
161
+ gap: 1,
162
+ children: [/* @__PURE__ */ jsx(Strong, { children: "Source:" }), /* @__PURE__ */ jsx(Text, { children: selection.source ?? "unknown" })]
163
+ }),
164
+ /* @__PURE__ */ jsxs(Box, {
165
+ gap: 1,
166
+ children: [/* @__PURE__ */ jsx(Strong, { children: "Anchor:" }), /* @__PURE__ */ jsxs(Text, { children: [
167
+ "(",
168
+ selection.range.anchor.col,
169
+ ", ",
170
+ selection.range.anchor.row,
171
+ ")"
172
+ ] })]
173
+ }),
174
+ /* @__PURE__ */ jsxs(Box, {
175
+ gap: 1,
176
+ children: [/* @__PURE__ */ jsx(Strong, { children: "Head:" }), /* @__PURE__ */ jsxs(Text, { children: [
177
+ "(",
178
+ selection.range.head.col,
179
+ ", ",
180
+ selection.range.head.row,
181
+ ")"
182
+ ] })]
183
+ })
184
+ ] }) : /* @__PURE__ */ jsx(Text, {
185
+ color: "$muted",
186
+ children: "No active selection — drag to select text"
187
+ })
188
+ ]
189
+ });
190
+ }
191
+ function StatusBar() {
192
+ return /* @__PURE__ */ jsx(Box, {
193
+ flexDirection: "row",
194
+ gap: 2,
195
+ paddingX: 1,
196
+ flexShrink: 0,
197
+ userSelect: "none",
198
+ children: /* @__PURE__ */ jsxs(Muted, { children: [
199
+ /* @__PURE__ */ jsx(Kbd, { children: "Drag" }),
200
+ " select ",
201
+ /* @__PURE__ */ jsx(Kbd, { children: "Alt+Drag" }),
202
+ " force select ",
203
+ /* @__PURE__ */ jsx(Kbd, { children: "Ctrl+C" }),
204
+ " quit"
205
+ ] })
206
+ });
207
+ }
208
+ function TextSelectionDemo() {
209
+ return /* @__PURE__ */ jsxs(Box, {
210
+ flexDirection: "column",
211
+ padding: 1,
212
+ gap: 1,
213
+ height: "100%",
214
+ children: [
215
+ /* @__PURE__ */ jsxs(Box, { children: [/* @__PURE__ */ jsx(H1, {
216
+ color: "$primary",
217
+ children: "Text Selection Demo"
218
+ }), /* @__PURE__ */ jsx(Muted, { children: " — real selection via useSelection()" })] }),
219
+ /* @__PURE__ */ jsxs(Box, {
220
+ flexDirection: "row",
221
+ gap: 1,
222
+ flexGrow: 1,
223
+ children: [/* @__PURE__ */ jsx(SelectableTextPanel, {}), /* @__PURE__ */ jsx(NonSelectablePanel, {})]
224
+ }),
225
+ /* @__PURE__ */ jsxs(Box, {
226
+ flexDirection: "row",
227
+ gap: 1,
228
+ flexGrow: 1,
229
+ children: [/* @__PURE__ */ jsx(ContainedPanel, {}), /* @__PURE__ */ jsx(SelectionStatePanel, {})]
230
+ }),
231
+ /* @__PURE__ */ jsx(HR, {}),
232
+ /* @__PURE__ */ jsx(StatusBar, {})
233
+ ]
234
+ });
235
+ }
236
+ async function main() {
237
+ try {
238
+ var _usingCtx$1 = _usingCtx();
239
+ const app = pipe(createApp(() => () => ({})), withReact(/* @__PURE__ */ jsx(ExampleBanner, {
240
+ meta,
241
+ controls: "Drag select Alt+Drag force select Ctrl+C quit",
242
+ children: /* @__PURE__ */ jsx(TextSelectionDemo, {})
243
+ })), withTerminal(process, { mouse: true }), withDomEvents());
244
+ await _usingCtx$1.u(await app.run()).waitUntilExit();
245
+ } catch (_) {
246
+ _usingCtx$1.e = _;
247
+ } finally {
248
+ _usingCtx$1.d();
249
+ }
250
+ }
251
+ if (import.meta.main) await main();
252
+ //#endregion
253
+ export { main, meta };
@@ -0,0 +1,177 @@
1
+ import { t as _usingCtx } from "../usingCtx-CsEf0xO3.mjs";
2
+ import { t as ExampleBanner } from "../_banner-A70_y2Vi.mjs";
3
+ import { useState } from "react";
4
+ import { Box, H1, Muted, Strong, Text, TextArea, createTerm, render, useApp, useInput } from "silvery";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region apps/textarea.tsx
7
+ /**
8
+ * TextArea Example — Split-Pane Note Editor
9
+ *
10
+ * A note-taking app demonstrating:
11
+ * - Multi-line text input with word wrapping and pre-filled content
12
+ * - Split-pane layout: editor (2/3) + saved notes sidebar (1/3)
13
+ * - Tab focus cycling between panes
14
+ * - Cursor movement (arrow keys, Home/End, Ctrl+A/E)
15
+ * - Kill operations (Ctrl+K, Ctrl+U)
16
+ * - Word/character stats in the header
17
+ * - Submit with Ctrl+Enter to collect notes
18
+ */
19
+ const meta = {
20
+ name: "TextArea",
21
+ description: "Split-pane note editor with word wrap, kill ring, and note collection",
22
+ features: [
23
+ "TextArea",
24
+ "Split pane layout",
25
+ "Ctrl+Enter submit",
26
+ "Tab focus cycling"
27
+ ]
28
+ };
29
+ const INITIAL_CONTENT = `# Release Notes — Silvery v0.1
30
+
31
+ ## New Features
32
+
33
+ - **Flexbox layout engine** — CSS-compatible sizing,
34
+ wrapping, and gap support via Flexily
35
+ - **38 built-in color palettes** — from Dracula
36
+ to Solarized, Nord to Catppuccin
37
+ - **Incremental rendering** — only changed cells
38
+ are repainted, no full-screen flicker
39
+
40
+ ## Breaking Changes
41
+
42
+ - Dropped Node.js 18 support (now requires >=20)
43
+ - Renamed \`useTerminal()\` to \`useTerm()\`
44
+
45
+ ## Performance
46
+
47
+ Benchmark results on an M4 MacBook Pro:
48
+ Initial render: 2.1ms (80x24)
49
+ Incremental: 0.3ms (typical diff)
50
+ Layout: 0.8ms (1000 nodes)
51
+
52
+ Thanks to all contributors!`;
53
+ function NoteEditor() {
54
+ const { exit } = useApp();
55
+ const [notes, setNotes] = useState([]);
56
+ const [value, setValue] = useState(INITIAL_CONTENT);
57
+ const [focusIndex, setFocusIndex] = useState(0);
58
+ useInput((input, key) => {
59
+ if (key.escape) exit();
60
+ if (key.tab && !key.shift) setFocusIndex((prev) => (prev + 1) % 2);
61
+ if (key.tab && key.shift) setFocusIndex((prev) => (prev - 1 + 2) % 2);
62
+ });
63
+ function handleSubmit(text) {
64
+ if (text.trim()) {
65
+ setNotes((prev) => [...prev, text.trim()]);
66
+ setValue("");
67
+ }
68
+ }
69
+ const lines = value.split("\n").length;
70
+ const chars = value.length;
71
+ const words = value.split(/\s+/).filter(Boolean).length;
72
+ return /* @__PURE__ */ jsx(Box, {
73
+ flexDirection: "column",
74
+ flexGrow: 1,
75
+ padding: 1,
76
+ children: /* @__PURE__ */ jsxs(Box, {
77
+ flexDirection: "row",
78
+ gap: 1,
79
+ flexGrow: 1,
80
+ children: [/* @__PURE__ */ jsxs(Box, {
81
+ borderStyle: "round",
82
+ borderColor: focusIndex === 0 ? "$primary" : "$border",
83
+ flexDirection: "column",
84
+ flexGrow: 3,
85
+ flexBasis: 0,
86
+ children: [
87
+ /* @__PURE__ */ jsxs(Box, {
88
+ paddingX: 1,
89
+ justifyContent: "space-between",
90
+ children: [/* @__PURE__ */ jsx(H1, { children: "Editor" }), /* @__PURE__ */ jsxs(Muted, { children: [
91
+ lines,
92
+ " lines, ",
93
+ words,
94
+ " words, ",
95
+ chars,
96
+ " chars"
97
+ ] })]
98
+ }),
99
+ /* @__PURE__ */ jsx(Text, { children: " " }),
100
+ /* @__PURE__ */ jsx(Box, {
101
+ paddingX: 1,
102
+ flexGrow: 1,
103
+ children: /* @__PURE__ */ jsx(TextArea, {
104
+ value,
105
+ onChange: setValue,
106
+ onSubmit: handleSubmit,
107
+ height: 16,
108
+ isActive: focusIndex === 0
109
+ })
110
+ })
111
+ ]
112
+ }), /* @__PURE__ */ jsxs(Box, {
113
+ borderStyle: "round",
114
+ borderColor: focusIndex === 1 ? "$primary" : "$border",
115
+ flexDirection: "column",
116
+ flexGrow: 2,
117
+ flexBasis: 0,
118
+ children: [
119
+ /* @__PURE__ */ jsxs(Box, {
120
+ paddingX: 1,
121
+ children: [/* @__PURE__ */ jsx(H1, { children: "Notes" }), /* @__PURE__ */ jsxs(Muted, { children: [
122
+ " (",
123
+ notes.length,
124
+ ")"
125
+ ] })]
126
+ }),
127
+ /* @__PURE__ */ jsx(Text, { children: " " }),
128
+ /* @__PURE__ */ jsx(Box, {
129
+ flexDirection: "column",
130
+ paddingX: 1,
131
+ overflow: "scroll",
132
+ flexGrow: 1,
133
+ children: notes.length === 0 ? /* @__PURE__ */ jsx(Muted, { children: "No notes yet." }) : notes.map((note, i) => /* @__PURE__ */ jsxs(Box, {
134
+ flexDirection: "column",
135
+ marginBottom: 1,
136
+ children: [/* @__PURE__ */ jsxs(Text, {
137
+ wrap: "truncate",
138
+ children: [
139
+ /* @__PURE__ */ jsxs(Strong, {
140
+ color: "$success",
141
+ children: ["#", i + 1]
142
+ }),
143
+ " ",
144
+ note.split("\n")[0]
145
+ ]
146
+ }), /* @__PURE__ */ jsxs(Muted, { children: [
147
+ note.split("\n").length,
148
+ " lines, ",
149
+ note.length,
150
+ " chars"
151
+ ] })]
152
+ }, i))
153
+ })
154
+ ]
155
+ })]
156
+ })
157
+ });
158
+ }
159
+ async function main() {
160
+ try {
161
+ var _usingCtx$1 = _usingCtx();
162
+ const term = _usingCtx$1.u(createTerm());
163
+ const { waitUntilExit } = await render(/* @__PURE__ */ jsx(ExampleBanner, {
164
+ meta,
165
+ controls: "Tab switch pane Ctrl+Enter submit Esc quit",
166
+ children: /* @__PURE__ */ jsx(NoteEditor, {})
167
+ }), term);
168
+ await waitUntilExit();
169
+ } catch (_) {
170
+ _usingCtx$1.e = _;
171
+ } finally {
172
+ _usingCtx$1.d();
173
+ }
174
+ }
175
+ if (import.meta.main) await main();
176
+ //#endregion
177
+ export { NoteEditor, main, meta };