ink-cartridge 3.6.1

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 (151) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +249 -0
  3. package/dist/binary-storage/BinaryStorage.d.ts +308 -0
  4. package/dist/binary-storage/BinaryStorage.js +548 -0
  5. package/dist/binary-storage/StreamingReader.d.ts +53 -0
  6. package/dist/binary-storage/StreamingReader.js +530 -0
  7. package/dist/binary-storage/index.d.ts +91 -0
  8. package/dist/binary-storage/index.js +91 -0
  9. package/dist/binary-storage/types.d.ts +400 -0
  10. package/dist/binary-storage/types.js +15 -0
  11. package/dist/cli/index.d.ts +2 -0
  12. package/dist/cli/index.js +214 -0
  13. package/dist/cli/initTheme.d.ts +14 -0
  14. package/dist/cli/initTheme.js +124 -0
  15. package/dist/cli/makeLanguageType.d.ts +46 -0
  16. package/dist/cli/makeLanguageType.js +264 -0
  17. package/dist/cli/makeThemeType.d.ts +43 -0
  18. package/dist/cli/makeThemeType.js +222 -0
  19. package/dist/components/badge/Badge.d.ts +7 -0
  20. package/dist/components/badge/Badge.js +9 -0
  21. package/dist/components/dialog/ConfirmDialog.d.ts +23 -0
  22. package/dist/components/dialog/ConfirmDialog.js +57 -0
  23. package/dist/components/dialog/types.d.ts +20 -0
  24. package/dist/components/dialog/types.js +1 -0
  25. package/dist/components/divider/Divider.d.ts +8 -0
  26. package/dist/components/divider/Divider.js +10 -0
  27. package/dist/components/fold/Fold.d.ts +3 -0
  28. package/dist/components/fold/Fold.js +44 -0
  29. package/dist/components/fold/types.d.ts +28 -0
  30. package/dist/components/fold/types.js +1 -0
  31. package/dist/components/form/Field.d.ts +30 -0
  32. package/dist/components/form/Field.js +59 -0
  33. package/dist/components/form/Form.d.ts +32 -0
  34. package/dist/components/form/Form.js +163 -0
  35. package/dist/components/form/context.d.ts +14 -0
  36. package/dist/components/form/context.js +20 -0
  37. package/dist/components/form/types.d.ts +115 -0
  38. package/dist/components/form/types.js +1 -0
  39. package/dist/components/key-hint/KeyHint.d.ts +10 -0
  40. package/dist/components/key-hint/KeyHint.js +12 -0
  41. package/dist/components/multi-select/MultiSelectInput.d.ts +125 -0
  42. package/dist/components/multi-select/MultiSelectInput.js +287 -0
  43. package/dist/components/multi-select/types.d.ts +100 -0
  44. package/dist/components/multi-select/types.js +1 -0
  45. package/dist/components/number-input/NumberInput.d.ts +11 -0
  46. package/dist/components/number-input/NumberInput.js +44 -0
  47. package/dist/components/progress-bar/ProgressBar.d.ts +11 -0
  48. package/dist/components/progress-bar/ProgressBar.js +9 -0
  49. package/dist/components/search-input/SearchInput.d.ts +10 -0
  50. package/dist/components/search-input/SearchInput.js +15 -0
  51. package/dist/components/select/SelectInput.d.ts +100 -0
  52. package/dist/components/select/SelectInput.js +147 -0
  53. package/dist/components/select/types.d.ts +63 -0
  54. package/dist/components/select/types.js +1 -0
  55. package/dist/components/spinner/Spinner.d.ts +12 -0
  56. package/dist/components/spinner/Spinner.js +24 -0
  57. package/dist/components/tabs/Tabs.d.ts +3 -0
  58. package/dist/components/tabs/Tabs.js +57 -0
  59. package/dist/components/tabs/types.d.ts +32 -0
  60. package/dist/components/tabs/types.js +1 -0
  61. package/dist/components/text/TextInput.d.ts +39 -0
  62. package/dist/components/text/TextInput.js +233 -0
  63. package/dist/components/text/types.d.ts +62 -0
  64. package/dist/components/text/types.js +1 -0
  65. package/dist/dev/dev-screen.d.ts +36 -0
  66. package/dist/dev/dev-screen.js +142 -0
  67. package/dist/dev/entrance.d.ts +51 -0
  68. package/dist/dev/entrance.js +67 -0
  69. package/dist/dev/globalKey-display.d.ts +2 -0
  70. package/dist/dev/globalKey-display.js +8 -0
  71. package/dist/dev/types.d.ts +9 -0
  72. package/dist/dev/types.js +1 -0
  73. package/dist/index.d.ts +46 -0
  74. package/dist/index.js +50 -0
  75. package/dist/keyboard/check-global-key.d.ts +18 -0
  76. package/dist/keyboard/check-global-key.js +52 -0
  77. package/dist/keyboard/context.d.ts +398 -0
  78. package/dist/keyboard/context.js +9 -0
  79. package/dist/keyboard/global-key-processor/index.d.ts +16 -0
  80. package/dist/keyboard/global-key-processor/index.js +75 -0
  81. package/dist/keyboard/global-sequence-processor/index.d.ts +14 -0
  82. package/dist/keyboard/global-sequence-processor/index.js +165 -0
  83. package/dist/keyboard/hook.d.ts +51 -0
  84. package/dist/keyboard/hook.js +105 -0
  85. package/dist/keyboard/index.d.ts +5 -0
  86. package/dist/keyboard/index.js +3 -0
  87. package/dist/keyboard/keyNormalizer.d.ts +37 -0
  88. package/dist/keyboard/keyNormalizer.js +119 -0
  89. package/dist/keyboard/layer-handler.d.ts +57 -0
  90. package/dist/keyboard/layer-handler.js +274 -0
  91. package/dist/keyboard/modal-processor/index.d.ts +16 -0
  92. package/dist/keyboard/modal-processor/index.js +97 -0
  93. package/dist/keyboard/overlay-processor/index.d.ts +16 -0
  94. package/dist/keyboard/overlay-processor/index.js +30 -0
  95. package/dist/keyboard/pipeline/chain.d.ts +10 -0
  96. package/dist/keyboard/pipeline/chain.js +45 -0
  97. package/dist/keyboard/pipeline/context.d.ts +34 -0
  98. package/dist/keyboard/pipeline/context.js +42 -0
  99. package/dist/keyboard/pipeline/index.d.ts +3 -0
  100. package/dist/keyboard/pipeline/index.js +2 -0
  101. package/dist/keyboard/provider.d.ts +32 -0
  102. package/dist/keyboard/provider.js +985 -0
  103. package/dist/keyboard/screen-stack-processor/index.d.ts +14 -0
  104. package/dist/keyboard/screen-stack-processor/index.js +32 -0
  105. package/dist/keyboard/types.d.ts +632 -0
  106. package/dist/keyboard/types.js +1 -0
  107. package/dist/language/context.d.ts +7 -0
  108. package/dist/language/context.js +7 -0
  109. package/dist/language/hook.d.ts +19 -0
  110. package/dist/language/hook.js +26 -0
  111. package/dist/language/index.d.ts +3 -0
  112. package/dist/language/index.js +2 -0
  113. package/dist/language/provider.d.ts +30 -0
  114. package/dist/language/provider.js +155 -0
  115. package/dist/language/types.d.ts +124 -0
  116. package/dist/language/types.js +1 -0
  117. package/dist/screen/ModalContext.d.ts +11 -0
  118. package/dist/screen/ModalContext.js +12 -0
  119. package/dist/screen/OverlayContext.d.ts +9 -0
  120. package/dist/screen/OverlayContext.js +10 -0
  121. package/dist/screen/context.d.ts +61 -0
  122. package/dist/screen/context.js +8 -0
  123. package/dist/screen/current-screen.d.ts +16 -0
  124. package/dist/screen/current-screen.js +38 -0
  125. package/dist/screen/hook.d.ts +13 -0
  126. package/dist/screen/hook.js +20 -0
  127. package/dist/screen/index.d.ts +7 -0
  128. package/dist/screen/index.js +5 -0
  129. package/dist/screen/provider.d.ts +112 -0
  130. package/dist/screen/provider.js +577 -0
  131. package/dist/screen/registry.d.ts +27 -0
  132. package/dist/screen/registry.js +71 -0
  133. package/dist/screen/types.d.ts +227 -0
  134. package/dist/screen/types.js +1 -0
  135. package/dist/storage/index.d.ts +45 -0
  136. package/dist/storage/index.js +46 -0
  137. package/dist/storage/storage.d.ts +139 -0
  138. package/dist/storage/storage.js +236 -0
  139. package/dist/storage/types.d.ts +145 -0
  140. package/dist/storage/types.js +1 -0
  141. package/dist/theme/context.d.ts +7 -0
  142. package/dist/theme/context.js +7 -0
  143. package/dist/theme/hook.d.ts +11 -0
  144. package/dist/theme/hook.js +18 -0
  145. package/dist/theme/index.d.ts +4 -0
  146. package/dist/theme/index.js +2 -0
  147. package/dist/theme/provider.d.ts +18 -0
  148. package/dist/theme/provider.js +308 -0
  149. package/dist/theme/types.d.ts +53 -0
  150. package/dist/theme/types.js +1 -0
  151. package/package.json +71 -0
@@ -0,0 +1,308 @@
1
+ import React, { useState, useMemo, useCallback } from 'react';
2
+ import { readFileSync, readdirSync } from 'fs';
3
+ import { resolve } from 'path';
4
+ import { ThemeContext } from './context.js';
5
+ /**
6
+ * Extract unique non-id keys from a list of themes.
7
+ * All themes must have identical keys after removing 'id'.
8
+ */
9
+ function extractKeys(themes) {
10
+ if (themes.length === 0)
11
+ return [];
12
+ const first = themes[0];
13
+ const keys = Object.keys(first).filter((k) => k !== 'id');
14
+ for (let i = 1; i < themes.length; i++) {
15
+ const current = Object.keys(themes[i]).filter((k) => k !== 'id');
16
+ const missing = keys.filter((k) => !current.includes(k));
17
+ const extra = current.filter((k) => !keys.includes(k));
18
+ if (missing.length > 0 || extra.length > 0) {
19
+ const details = [];
20
+ if (missing.length > 0)
21
+ details.push(`missing from "${themes[i].id}": ${missing.join(', ')}`);
22
+ if (extra.length > 0)
23
+ details.push(`extra in "${themes[i].id}": ${extra.join(', ')}`);
24
+ throw new Error(`[Ink-Cartridge] Theme key mismatch in "${themes[i].id}". ` +
25
+ `All themes must have identical keys (excluding 'id'). ${details.join('; ')}`);
26
+ }
27
+ }
28
+ return keys;
29
+ }
30
+ function loadFromPath(dirPath) {
31
+ const themes = [];
32
+ let files;
33
+ try {
34
+ files = readdirSync(dirPath);
35
+ }
36
+ catch (err) {
37
+ const msg = err instanceof Error ? err.message : String(err);
38
+ throw new Error(`[Ink-Cartridge] ThemeProvider failed to read directory "${dirPath}": ${msg}`);
39
+ }
40
+ for (const file of files) {
41
+ if (file.endsWith('.json')) {
42
+ const fullPath = resolve(dirPath, file);
43
+ let raw;
44
+ try {
45
+ raw = readFileSync(fullPath, 'utf-8');
46
+ }
47
+ catch (err) {
48
+ const msg = err instanceof Error ? err.message : String(err);
49
+ throw new Error(`[Ink-Cartridge] ThemeProvider failed to read "${fullPath}": ${msg}`);
50
+ }
51
+ try {
52
+ const parsed = JSON.parse(raw);
53
+ if (typeof parsed.id !== 'string') {
54
+ throw new Error(`[Ink-Cartridge] Theme file "${file}" is missing a required "id" field (string).`);
55
+ }
56
+ // Build a ThemeDefinition: strip the id field from the flat map
57
+ const theme = { id: parsed.id };
58
+ for (const [k, v] of Object.entries(parsed)) {
59
+ if (k === 'id')
60
+ continue;
61
+ if (typeof v === 'string' || typeof v === 'boolean') {
62
+ theme[k] = v;
63
+ }
64
+ }
65
+ themes.push(theme);
66
+ }
67
+ catch (err) {
68
+ const msg = err instanceof Error ? err.message : String(err);
69
+ throw new Error(`[Ink-Cartridge] ThemeProvider failed to parse "${file}": ${msg}`);
70
+ }
71
+ }
72
+ }
73
+ return themes;
74
+ }
75
+ /**
76
+ * Load themes from multiple directory paths with filename-based deduplication.
77
+ *
78
+ * Processes paths in order — later paths override earlier ones when the
79
+ * same filename appears in multiple directories (within the batch).
80
+ *
81
+ * Returns the deduplicated list of ThemeDefinitions.
82
+ */
83
+ function loadFromPaths(paths) {
84
+ // Map: filename → ThemeDefinition. Same filename → later overwrites earlier.
85
+ const fileMap = new Map();
86
+ for (const dirPath of paths) {
87
+ let files;
88
+ try {
89
+ files = readdirSync(dirPath);
90
+ }
91
+ catch (err) {
92
+ const msg = err instanceof Error ? err.message : String(err);
93
+ throw new Error(`[Ink-Cartridge] ThemeProvider failed to read directory "${dirPath}": ${msg}`);
94
+ }
95
+ for (const file of files) {
96
+ if (!file.endsWith('.json'))
97
+ continue;
98
+ const fullPath = resolve(dirPath, file);
99
+ let raw;
100
+ try {
101
+ raw = readFileSync(fullPath, 'utf-8');
102
+ }
103
+ catch (err) {
104
+ const msg = err instanceof Error ? err.message : String(err);
105
+ throw new Error(`[Ink-Cartridge] ThemeProvider failed to read "${fullPath}": ${msg}`);
106
+ }
107
+ let parsed;
108
+ try {
109
+ parsed = JSON.parse(raw);
110
+ }
111
+ catch (err) {
112
+ const msg = err instanceof Error ? err.message : String(err);
113
+ throw new Error(`[Ink-Cartridge] ThemeProvider failed to parse "${file}": ${msg}`);
114
+ }
115
+ if (typeof parsed.id !== 'string') {
116
+ throw new Error(`[Ink-Cartridge] Theme file "${file}" is missing a required "id" field (string).`);
117
+ }
118
+ const theme = { id: parsed.id };
119
+ for (const [k, v] of Object.entries(parsed)) {
120
+ if (k === 'id')
121
+ continue;
122
+ if (typeof v === 'string' || typeof v === 'boolean') {
123
+ theme[k] = v;
124
+ }
125
+ }
126
+ // Filename dedup: later paths win for same filename
127
+ fileMap.set(file, theme);
128
+ }
129
+ }
130
+ return Array.from(fileMap.values());
131
+ }
132
+ /**
133
+ * Context provider for theming.
134
+ *
135
+ * Loads theme definitions either from a directory of `{id}.json` files
136
+ * (via the `path` prop) or from pre-built inline objects (via `themes`).
137
+ *
138
+ * Descendant components can use the {@link useTheme} hook to access
139
+ * `color()` and `style()` functions, and `setTheme()` to switch themes.
140
+ */
141
+ export function ThemeProvider({ children, themes: inlineThemes = [], path, defaultTheme, }) {
142
+ const rawThemes = useMemo(() => {
143
+ if (path)
144
+ return loadFromPath(path);
145
+ return inlineThemes;
146
+ }, [inlineThemes, path]);
147
+ // Overlay state for mergeTheme — avoids mutating rawThemes
148
+ const [mergedThemes, setMergedThemes] = useState(null);
149
+ const effectiveThemes = mergedThemes ?? rawThemes;
150
+ // Validate key consistency — only on initial load; merged themes are
151
+ // validated separately at merge time
152
+ if (rawThemes.length > 0) {
153
+ extractKeys(rawThemes);
154
+ }
155
+ const themeIds = useMemo(() => effectiveThemes.map((t) => t.id), [effectiveThemes]);
156
+ const [currentThemeId, setCurrentThemeId] = useState(defaultTheme ?? themeIds[0] ?? '');
157
+ const currentTheme = useMemo(() => effectiveThemes.find((t) => t.id === currentThemeId), [effectiveThemes, currentThemeId]);
158
+ const color = useCallback((key) => {
159
+ if (!currentTheme)
160
+ return undefined;
161
+ const val = currentTheme[key];
162
+ if (typeof val === 'string')
163
+ return val;
164
+ return undefined;
165
+ }, [currentTheme]);
166
+ const style = useCallback((key) => {
167
+ if (!currentTheme)
168
+ return undefined;
169
+ const val = currentTheme[key];
170
+ if (typeof val === 'boolean')
171
+ return val;
172
+ return undefined;
173
+ }, [currentTheme]);
174
+ const setTheme = useCallback((id) => {
175
+ if (!effectiveThemes.find((t) => t.id === id)) {
176
+ const available = themeIds.join(', ');
177
+ throw new Error(`[Ink-Cartridge] Theme "${id}" is not available. ` +
178
+ `Available themes: ${available}`);
179
+ }
180
+ setCurrentThemeId(id);
181
+ }, [effectiveThemes, themeIds]);
182
+ const mergeTheme = useCallback((paths) => {
183
+ const base = mergedThemes ?? rawThemes;
184
+ // Build a lookup of existing themes by id
185
+ const lookup = new Map();
186
+ for (const t of base) {
187
+ const copy = { id: t.id };
188
+ for (const [k, v] of Object.entries(t)) {
189
+ if (k !== 'id')
190
+ copy[k] = v;
191
+ }
192
+ lookup.set(t.id, copy);
193
+ }
194
+ let hadChanges = false;
195
+ for (const dirPath of paths) {
196
+ const incoming = loadFromPath(dirPath);
197
+ for (const inc of incoming) {
198
+ const existing = lookup.get(inc.id);
199
+ if (!existing)
200
+ continue; // ignore themes not in base
201
+ for (const [k, v] of Object.entries(inc)) {
202
+ if (k === 'id')
203
+ continue;
204
+ existing[k] = v;
205
+ }
206
+ hadChanges = true;
207
+ }
208
+ }
209
+ if (hadChanges) {
210
+ const merged = Array.from(lookup.values());
211
+ extractKeys(merged); // re-validate after merge
212
+ setMergedThemes(merged);
213
+ }
214
+ }, [mergedThemes, rawThemes]);
215
+ // ── addThemes ────────────────────────────────────────────────
216
+ const addThemes = useCallback((paths) => {
217
+ const base = mergedThemes ?? rawThemes;
218
+ const existingIds = new Set(base.map((t) => t.id));
219
+ // Load from all paths with filename-based dedup
220
+ const incoming = loadFromPaths(paths);
221
+ // Detect id conflicts within the incoming batch (different filenames
222
+ // claiming the same id — filename dedup already resolved same-file cases).
223
+ // Re-scan all files to build a mapping of id → [source filenames],
224
+ // then flag any id claimed by more than one filename.
225
+ const idSourceFiles = new Map(); // id → [filenames]
226
+ for (const dirPath of paths) {
227
+ let files;
228
+ try {
229
+ files = readdirSync(dirPath);
230
+ }
231
+ catch {
232
+ continue; // loadFromPaths already validates, should not reach here
233
+ }
234
+ for (const file of files) {
235
+ if (!file.endsWith('.json'))
236
+ continue;
237
+ const fullPath = resolve(dirPath, file);
238
+ let parsed;
239
+ try {
240
+ parsed = JSON.parse(readFileSync(fullPath, 'utf-8'));
241
+ }
242
+ catch {
243
+ continue;
244
+ }
245
+ if (typeof parsed.id !== 'string')
246
+ continue;
247
+ if (!idSourceFiles.has(parsed.id)) {
248
+ idSourceFiles.set(parsed.id, []);
249
+ }
250
+ const list = idSourceFiles.get(parsed.id);
251
+ if (!list.includes(file)) {
252
+ list.push(file);
253
+ }
254
+ }
255
+ }
256
+ // Check: same id claimed by multiple filenames → error
257
+ for (const [id, filenames] of idSourceFiles) {
258
+ if (filenames.length > 1) {
259
+ throw new Error(`[Ink-Cartridge] addThemes detected duplicate theme id "${id}" ` +
260
+ `in files: ${filenames.join(', ')}. Theme ids must be unique.`);
261
+ }
262
+ }
263
+ // Expected key set from existing themes
264
+ const expectedKeys = base.length > 0
265
+ ? Object.keys(base[0]).filter((k) => k !== 'id')
266
+ : [];
267
+ // Validate each incoming theme
268
+ for (const theme of incoming) {
269
+ // Id conflict with base → error
270
+ if (existingIds.has(theme.id)) {
271
+ throw new Error(`[Ink-Cartridge] addThemes cannot add theme "${theme.id}" ` +
272
+ `because a theme with this id already exists. ` +
273
+ `Use mergeTheme() to update existing themes.`);
274
+ }
275
+ // Only validate keys if we have a reference set
276
+ if (expectedKeys.length > 0) {
277
+ const incKeys = Object.keys(theme).filter((k) => k !== 'id');
278
+ const missing = expectedKeys.filter((k) => !incKeys.includes(k));
279
+ const extra = incKeys.filter((k) => !expectedKeys.includes(k));
280
+ const details = [];
281
+ if (missing.length > 0)
282
+ details.push(`missing: ${missing.join(', ')}`);
283
+ if (extra.length > 0)
284
+ details.push(`extra: ${extra.join(', ')}`);
285
+ if (details.length > 0) {
286
+ throw new Error(`[Ink-Cartridge] addThemes theme "${theme.id}" has mismatched keys. ` +
287
+ `All themes must have identical keys (excluding 'id'). ${details.join('; ')}`);
288
+ }
289
+ }
290
+ existingIds.add(theme.id);
291
+ }
292
+ if (incoming.length > 0) {
293
+ const combined = [...base, ...incoming];
294
+ extractKeys(combined); // final safety check
295
+ setMergedThemes(combined);
296
+ }
297
+ }, [mergedThemes, rawThemes]);
298
+ const ctx = useMemo(() => ({
299
+ color,
300
+ style,
301
+ themeId: currentThemeId,
302
+ themes: themeIds,
303
+ setTheme,
304
+ mergeTheme,
305
+ addThemes,
306
+ }), [color, style, currentThemeId, themeIds, setTheme, mergeTheme, addThemes]);
307
+ return React.createElement(ThemeContext.Provider, { value: ctx }, children);
308
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * A single theme definition — a flat map of key-value pairs plus a unique id.
3
+ */
4
+ export interface ThemeDefinition {
5
+ /** Unique identifier for this theme (e.g. "dark", "light"). */
6
+ id: string;
7
+ /** Flat key-value pairs where values are Ink color names or style booleans. */
8
+ [key: string]: string | boolean;
9
+ }
10
+ /**
11
+ * Props for the {@link ThemeProvider} component.
12
+ */
13
+ export interface ThemeProviderProps {
14
+ children: React.ReactNode;
15
+ /** Directory path containing `{id}.json` files. */
16
+ path?: string;
17
+ /** Inline theme definitions (alternative to `path`). */
18
+ themes?: ThemeDefinition[];
19
+ /** Id of the theme to activate initially. Defaults to the first available. */
20
+ defaultTheme?: string;
21
+ }
22
+ /**
23
+ * Value provided by {@link ThemeProvider} via React context.
24
+ * Accessed via the {@link useTheme} hook.
25
+ */
26
+ export interface ThemeContextValue {
27
+ /** Get a color value from the current theme (returns the raw string or undefined). */
28
+ color: (key: string) => string | undefined;
29
+ /** Get a style value (boolean) from the current theme (returns undefined if not set). */
30
+ style: (key: string) => boolean | undefined;
31
+ /** Currently active theme id. */
32
+ themeId: string;
33
+ /** List of all available theme ids. */
34
+ themes: string[];
35
+ /** Switch to a different theme by id. */
36
+ setTheme: (id: string) => void;
37
+ /**
38
+ * Merge additional theme files from one or more directory paths.
39
+ * Later paths override earlier paths for matching keys.
40
+ * Only themes whose id already exists are merged; new ids are ignored.
41
+ */
42
+ mergeTheme: (paths: string[]) => void;
43
+ /**
44
+ * Add new themes from one or more directory paths.
45
+ *
46
+ * Unlike {@link mergeTheme}, this adds **new** themes to the pool.
47
+ * - Same filename across paths → later overwrites earlier.
48
+ * - Same id as existing base theme → throws immediately.
49
+ * - Same id across different filenames within the batch → throws.
50
+ * - Missing or extra keys vs. existing themes → throws.
51
+ */
52
+ addThemes: (paths: string[]) => void;
53
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "ink-cartridge",
3
+ "version": "3.6.1",
4
+ "description": "Ready-to-use Ink components and screen management system for building terminal UIs.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "bin": {
9
+ "ink-cartridge": "./dist/cli/index.js"
10
+ },
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "import": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "LICENSE"
21
+ ],
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/BAIGAOa/ink-cartridge.git"
25
+ },
26
+ "scripts": {
27
+ "build": "tsc --locale zh-CN",
28
+ "watch": "tsc --watch --locale zh-CN",
29
+ "clean": "rm -rf dist",
30
+ "test": "vitest run",
31
+ "test:watch": "vitest",
32
+ "demo:dev": "tsx examples/dev/dev.tsx"
33
+ },
34
+ "keywords": [
35
+ "ink",
36
+ "ink-component",
37
+ "react",
38
+ "tui",
39
+ "cli",
40
+ "terminal",
41
+ "screen-management"
42
+ ],
43
+ "author": "BAIGAO",
44
+ "license": "MIT",
45
+ "engines": {
46
+ "node": ">=22"
47
+ },
48
+ "peerDependencies": {
49
+ "ink": ">=5",
50
+ "react": ">=18"
51
+ },
52
+ "devDependencies": {
53
+ "@testing-library/react": "^16.3.0",
54
+ "@types/node": "^20.19.39",
55
+ "@types/react": "^19.2.14",
56
+ "ink": "^7.0.1",
57
+ "ink-testing-library": "^4.0.0",
58
+ "jsdom": "^26.0.0",
59
+ "react": "^19.2.4",
60
+ "tsx": "^4.22.4",
61
+ "typescript": "^5.9.3",
62
+ "vitest": "^4.1.5"
63
+ },
64
+ "bugs": {
65
+ "url": "https://github.com/BAIGAOa/ink-cartridge/issues"
66
+ },
67
+ "homepage": "https://github.com/BAIGAOa/ink-cartridge#readme",
68
+ "dependencies": {
69
+ "zod": "^4.4.3"
70
+ }
71
+ }