ink 4.4.1 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/colorize.js.map +1 -1
- package/build/components/App.d.ts +1 -1
- package/build/components/App.js +198 -296
- package/build/components/App.js.map +1 -1
- package/build/components/AppContext.js +1 -1
- package/build/components/Box.d.ts +51 -1
- package/build/components/Box.js +2 -2
- package/build/components/ErrorOverview.js +1 -1
- package/build/components/ErrorOverview.js.map +1 -1
- package/build/components/FocusContext.js +1 -1
- package/build/components/Static.js +1 -1
- package/build/components/StderrContext.js +1 -1
- package/build/components/StdinContext.js +1 -1
- package/build/components/StdoutContext.js +1 -1
- package/build/components/Text.d.ts +1 -1
- package/build/components/Text.js +1 -1
- package/build/components/Text.js.map +1 -1
- package/build/components/Transform.js.map +1 -1
- package/build/devtools-window-polyfill.js +8 -8
- package/build/devtools-window-polyfill.js.map +1 -1
- package/build/dom.js +2 -3
- package/build/dom.js.map +1 -1
- package/build/get-max-width.js +0 -1
- package/build/get-max-width.js.map +1 -1
- package/build/hooks/use-focus-manager.js +1 -1
- package/build/hooks/use-focus.d.ts +1 -1
- package/build/hooks/use-focus.js +2 -2
- package/build/hooks/use-focus.js.map +1 -1
- package/build/hooks/use-input.js +2 -3
- package/build/hooks/use-input.js.map +1 -1
- package/build/ink.js +77 -164
- package/build/ink.js.map +1 -1
- package/build/log-update.d.ts +1 -0
- package/build/log-update.js.map +1 -1
- package/build/measure-element.js +1 -1
- package/build/measure-text.js +1 -1
- package/build/measure-text.js.map +1 -1
- package/build/output.js +11 -26
- package/build/output.js.map +1 -1
- package/build/parse-keypress.d.ts +1 -0
- package/build/parse-keypress.js +4 -4
- package/build/parse-keypress.js.map +1 -1
- package/build/reconciler.js +8 -6
- package/build/reconciler.js.map +1 -1
- package/build/render-border.js +1 -1
- package/build/render-border.js.map +1 -1
- package/build/render-node-to-output.js +2 -3
- package/build/render-node-to-output.js.map +1 -1
- package/build/render.d.ts +4 -0
- package/build/render.js +3 -3
- package/build/render.js.map +1 -1
- package/build/renderer.js +5 -5
- package/build/renderer.js.map +1 -1
- package/build/squash-text-nodes.js.map +1 -1
- package/build/styles.d.ts +1 -1
- package/build/styles.js +0 -1
- package/build/styles.js.map +1 -1
- package/build/wrap-text.js +1 -1
- package/build/wrap-text.js.map +1 -1
- package/package.json +33 -37
- package/readme.md +2 -17
package/build/colorize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorize.js","sourceRoot":"","sources":["../src/colorize.ts"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAIhF,MAAM,QAAQ,GAAG,wCAAwC,CAAC;AAC1D,MAAM,SAAS,GAAG,0BAA0B,CAAC;AAE7C,MAAM,YAAY,GAAG,CAAC,KAAa,EAAgC,EAAE;IACpE,OAAO,KAAK,IAAI,KAAK,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAChB,GAAW,EACX,KAAyB,EACzB,IAAe,EACN,EAAE;IACX,IAAI,CAAC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"colorize.js","sourceRoot":"","sources":["../src/colorize.ts"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAIhF,MAAM,QAAQ,GAAG,wCAAwC,CAAC;AAC1D,MAAM,SAAS,GAAG,0BAA0B,CAAC;AAE7C,MAAM,YAAY,GAAG,CAAC,KAAa,EAAgC,EAAE;IACpE,OAAO,KAAK,IAAI,KAAK,CAAC;AACvB,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,CAChB,GAAW,EACX,KAAyB,EACzB,IAAe,EACN,EAAE;IACX,IAAI,CAAC,KAAK,EAAE,CAAC;QACZ,OAAO,GAAG,CAAC;IACZ,CAAC;IAED,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;YAC3B,OAAO,KAAK,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,CAAC,CAAC;QACtC,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtC,OAAO,IAAI,KAAK,YAAY;YAC3B,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC;YACrD,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,GAAG,CAAC;AACZ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -34,7 +34,7 @@ export default class App extends PureComponent<Props, State> {
|
|
|
34
34
|
error: undefined;
|
|
35
35
|
};
|
|
36
36
|
rawModeEnabledCount: number;
|
|
37
|
-
internal_eventEmitter: EventEmitter
|
|
37
|
+
internal_eventEmitter: EventEmitter<[never]>;
|
|
38
38
|
isRawModeSupported(): boolean;
|
|
39
39
|
render(): React.JSX.Element;
|
|
40
40
|
componentDidMount(): void;
|
package/build/components/App.js
CHANGED
|
@@ -15,294 +15,21 @@ const escape = '\u001B';
|
|
|
15
15
|
// It renders stdin and stdout contexts, so that children can access them if needed
|
|
16
16
|
// It also handles Ctrl+C exiting and cursor visibility
|
|
17
17
|
export default class App extends PureComponent {
|
|
18
|
-
|
|
19
|
-
super(...arguments);
|
|
20
|
-
Object.defineProperty(this, "state", {
|
|
21
|
-
enumerable: true,
|
|
22
|
-
configurable: true,
|
|
23
|
-
writable: true,
|
|
24
|
-
value: {
|
|
25
|
-
isFocusEnabled: true,
|
|
26
|
-
activeFocusId: undefined,
|
|
27
|
-
focusables: [],
|
|
28
|
-
error: undefined
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
// Count how many components enabled raw mode to avoid disabling
|
|
32
|
-
// raw mode until all components don't need it anymore
|
|
33
|
-
Object.defineProperty(this, "rawModeEnabledCount", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true,
|
|
37
|
-
value: 0
|
|
38
|
-
});
|
|
39
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
40
|
-
Object.defineProperty(this, "internal_eventEmitter", {
|
|
41
|
-
enumerable: true,
|
|
42
|
-
configurable: true,
|
|
43
|
-
writable: true,
|
|
44
|
-
value: new EventEmitter()
|
|
45
|
-
});
|
|
46
|
-
Object.defineProperty(this, "handleSetRawMode", {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
configurable: true,
|
|
49
|
-
writable: true,
|
|
50
|
-
value: (isEnabled) => {
|
|
51
|
-
const { stdin } = this.props;
|
|
52
|
-
if (!this.isRawModeSupported()) {
|
|
53
|
-
if (stdin === process.stdin) {
|
|
54
|
-
throw new Error('Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported');
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
throw new Error('Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
stdin.setEncoding('utf8');
|
|
61
|
-
if (isEnabled) {
|
|
62
|
-
// Ensure raw mode is enabled only once
|
|
63
|
-
if (this.rawModeEnabledCount === 0) {
|
|
64
|
-
stdin.ref();
|
|
65
|
-
stdin.setRawMode(true);
|
|
66
|
-
stdin.addListener('readable', this.handleReadable);
|
|
67
|
-
}
|
|
68
|
-
this.rawModeEnabledCount++;
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
// Disable raw mode only when no components left that are using it
|
|
72
|
-
if (--this.rawModeEnabledCount === 0) {
|
|
73
|
-
stdin.setRawMode(false);
|
|
74
|
-
stdin.removeListener('readable', this.handleReadable);
|
|
75
|
-
stdin.unref();
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
Object.defineProperty(this, "handleReadable", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
configurable: true,
|
|
82
|
-
writable: true,
|
|
83
|
-
value: () => {
|
|
84
|
-
let chunk;
|
|
85
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
86
|
-
while ((chunk = this.props.stdin.read()) !== null) {
|
|
87
|
-
this.handleInput(chunk);
|
|
88
|
-
this.internal_eventEmitter.emit('input', chunk);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(this, "handleInput", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
configurable: true,
|
|
95
|
-
writable: true,
|
|
96
|
-
value: (input) => {
|
|
97
|
-
// Exit on Ctrl+C
|
|
98
|
-
// eslint-disable-next-line unicorn/no-hex-escape
|
|
99
|
-
if (input === '\x03' && this.props.exitOnCtrlC) {
|
|
100
|
-
this.handleExit();
|
|
101
|
-
}
|
|
102
|
-
// Reset focus when there's an active focused component on Esc
|
|
103
|
-
if (input === escape && this.state.activeFocusId) {
|
|
104
|
-
this.setState({
|
|
105
|
-
activeFocusId: undefined
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
if (this.state.isFocusEnabled && this.state.focusables.length > 0) {
|
|
109
|
-
if (input === tab) {
|
|
110
|
-
this.focusNext();
|
|
111
|
-
}
|
|
112
|
-
if (input === shiftTab) {
|
|
113
|
-
this.focusPrevious();
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
Object.defineProperty(this, "handleExit", {
|
|
119
|
-
enumerable: true,
|
|
120
|
-
configurable: true,
|
|
121
|
-
writable: true,
|
|
122
|
-
value: (error) => {
|
|
123
|
-
if (this.isRawModeSupported()) {
|
|
124
|
-
this.handleSetRawMode(false);
|
|
125
|
-
}
|
|
126
|
-
this.props.onExit(error);
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
Object.defineProperty(this, "enableFocus", {
|
|
130
|
-
enumerable: true,
|
|
131
|
-
configurable: true,
|
|
132
|
-
writable: true,
|
|
133
|
-
value: () => {
|
|
134
|
-
this.setState({
|
|
135
|
-
isFocusEnabled: true
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
Object.defineProperty(this, "disableFocus", {
|
|
140
|
-
enumerable: true,
|
|
141
|
-
configurable: true,
|
|
142
|
-
writable: true,
|
|
143
|
-
value: () => {
|
|
144
|
-
this.setState({
|
|
145
|
-
isFocusEnabled: false
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
Object.defineProperty(this, "focus", {
|
|
150
|
-
enumerable: true,
|
|
151
|
-
configurable: true,
|
|
152
|
-
writable: true,
|
|
153
|
-
value: (id) => {
|
|
154
|
-
this.setState(previousState => {
|
|
155
|
-
const hasFocusableId = previousState.focusables.some(focusable => focusable?.id === id);
|
|
156
|
-
if (!hasFocusableId) {
|
|
157
|
-
return previousState;
|
|
158
|
-
}
|
|
159
|
-
return { activeFocusId: id };
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
Object.defineProperty(this, "focusNext", {
|
|
164
|
-
enumerable: true,
|
|
165
|
-
configurable: true,
|
|
166
|
-
writable: true,
|
|
167
|
-
value: () => {
|
|
168
|
-
this.setState(previousState => {
|
|
169
|
-
const firstFocusableId = previousState.focusables[0]?.id;
|
|
170
|
-
const nextFocusableId = this.findNextFocusable(previousState);
|
|
171
|
-
return {
|
|
172
|
-
activeFocusId: nextFocusableId ?? firstFocusableId
|
|
173
|
-
};
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
Object.defineProperty(this, "focusPrevious", {
|
|
178
|
-
enumerable: true,
|
|
179
|
-
configurable: true,
|
|
180
|
-
writable: true,
|
|
181
|
-
value: () => {
|
|
182
|
-
this.setState(previousState => {
|
|
183
|
-
const lastFocusableId = previousState.focusables[previousState.focusables.length - 1]?.id;
|
|
184
|
-
const previousFocusableId = this.findPreviousFocusable(previousState);
|
|
185
|
-
return {
|
|
186
|
-
activeFocusId: previousFocusableId ?? lastFocusableId
|
|
187
|
-
};
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
Object.defineProperty(this, "addFocusable", {
|
|
192
|
-
enumerable: true,
|
|
193
|
-
configurable: true,
|
|
194
|
-
writable: true,
|
|
195
|
-
value: (id, { autoFocus }) => {
|
|
196
|
-
this.setState(previousState => {
|
|
197
|
-
let nextFocusId = previousState.activeFocusId;
|
|
198
|
-
if (!nextFocusId && autoFocus) {
|
|
199
|
-
nextFocusId = id;
|
|
200
|
-
}
|
|
201
|
-
return {
|
|
202
|
-
activeFocusId: nextFocusId,
|
|
203
|
-
focusables: [
|
|
204
|
-
...previousState.focusables,
|
|
205
|
-
{
|
|
206
|
-
id,
|
|
207
|
-
isActive: true
|
|
208
|
-
}
|
|
209
|
-
]
|
|
210
|
-
};
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
Object.defineProperty(this, "removeFocusable", {
|
|
215
|
-
enumerable: true,
|
|
216
|
-
configurable: true,
|
|
217
|
-
writable: true,
|
|
218
|
-
value: (id) => {
|
|
219
|
-
this.setState(previousState => ({
|
|
220
|
-
activeFocusId: previousState.activeFocusId === id
|
|
221
|
-
? undefined
|
|
222
|
-
: previousState.activeFocusId,
|
|
223
|
-
focusables: previousState.focusables.filter(focusable => {
|
|
224
|
-
return focusable.id !== id;
|
|
225
|
-
})
|
|
226
|
-
}));
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
Object.defineProperty(this, "activateFocusable", {
|
|
230
|
-
enumerable: true,
|
|
231
|
-
configurable: true,
|
|
232
|
-
writable: true,
|
|
233
|
-
value: (id) => {
|
|
234
|
-
this.setState(previousState => ({
|
|
235
|
-
focusables: previousState.focusables.map(focusable => {
|
|
236
|
-
if (focusable.id !== id) {
|
|
237
|
-
return focusable;
|
|
238
|
-
}
|
|
239
|
-
return {
|
|
240
|
-
id,
|
|
241
|
-
isActive: true
|
|
242
|
-
};
|
|
243
|
-
})
|
|
244
|
-
}));
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
Object.defineProperty(this, "deactivateFocusable", {
|
|
248
|
-
enumerable: true,
|
|
249
|
-
configurable: true,
|
|
250
|
-
writable: true,
|
|
251
|
-
value: (id) => {
|
|
252
|
-
this.setState(previousState => ({
|
|
253
|
-
activeFocusId: previousState.activeFocusId === id
|
|
254
|
-
? undefined
|
|
255
|
-
: previousState.activeFocusId,
|
|
256
|
-
focusables: previousState.focusables.map(focusable => {
|
|
257
|
-
if (focusable.id !== id) {
|
|
258
|
-
return focusable;
|
|
259
|
-
}
|
|
260
|
-
return {
|
|
261
|
-
id,
|
|
262
|
-
isActive: false
|
|
263
|
-
};
|
|
264
|
-
})
|
|
265
|
-
}));
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
Object.defineProperty(this, "findNextFocusable", {
|
|
269
|
-
enumerable: true,
|
|
270
|
-
configurable: true,
|
|
271
|
-
writable: true,
|
|
272
|
-
value: (state) => {
|
|
273
|
-
const activeIndex = state.focusables.findIndex(focusable => {
|
|
274
|
-
return focusable.id === state.activeFocusId;
|
|
275
|
-
});
|
|
276
|
-
for (let index = activeIndex + 1; index < state.focusables.length; index++) {
|
|
277
|
-
const focusable = state.focusables[index];
|
|
278
|
-
if (focusable?.isActive) {
|
|
279
|
-
return focusable.id;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return undefined;
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
Object.defineProperty(this, "findPreviousFocusable", {
|
|
286
|
-
enumerable: true,
|
|
287
|
-
configurable: true,
|
|
288
|
-
writable: true,
|
|
289
|
-
value: (state) => {
|
|
290
|
-
const activeIndex = state.focusables.findIndex(focusable => {
|
|
291
|
-
return focusable.id === state.activeFocusId;
|
|
292
|
-
});
|
|
293
|
-
for (let index = activeIndex - 1; index >= 0; index--) {
|
|
294
|
-
const focusable = state.focusables[index];
|
|
295
|
-
if (focusable?.isActive) {
|
|
296
|
-
return focusable.id;
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
return undefined;
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
}
|
|
18
|
+
static displayName = 'InternalApp';
|
|
303
19
|
static getDerivedStateFromError(error) {
|
|
304
20
|
return { error };
|
|
305
21
|
}
|
|
22
|
+
state = {
|
|
23
|
+
isFocusEnabled: true,
|
|
24
|
+
activeFocusId: undefined,
|
|
25
|
+
focusables: [],
|
|
26
|
+
error: undefined,
|
|
27
|
+
};
|
|
28
|
+
// Count how many components enabled raw mode to avoid disabling
|
|
29
|
+
// raw mode until all components don't need it anymore
|
|
30
|
+
rawModeEnabledCount = 0;
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
32
|
+
internal_eventEmitter = new EventEmitter();
|
|
306
33
|
// Determines if TTY is supported on the provided stdin
|
|
307
34
|
isRawModeSupported() {
|
|
308
35
|
return this.props.stdin.isTTY;
|
|
@@ -313,7 +40,7 @@ export default class App extends PureComponent {
|
|
|
313
40
|
, {
|
|
314
41
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
315
42
|
value: {
|
|
316
|
-
exit: this.handleExit
|
|
43
|
+
exit: this.handleExit,
|
|
317
44
|
} },
|
|
318
45
|
React.createElement(StdinContext.Provider
|
|
319
46
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
@@ -326,7 +53,7 @@ export default class App extends PureComponent {
|
|
|
326
53
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
327
54
|
internal_exitOnCtrlC: this.props.exitOnCtrlC,
|
|
328
55
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
329
|
-
internal_eventEmitter: this.internal_eventEmitter
|
|
56
|
+
internal_eventEmitter: this.internal_eventEmitter,
|
|
330
57
|
} },
|
|
331
58
|
React.createElement(StdoutContext.Provider
|
|
332
59
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
@@ -334,7 +61,7 @@ export default class App extends PureComponent {
|
|
|
334
61
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
335
62
|
value: {
|
|
336
63
|
stdout: this.props.stdout,
|
|
337
|
-
write: this.props.writeToStdout
|
|
64
|
+
write: this.props.writeToStdout,
|
|
338
65
|
} },
|
|
339
66
|
React.createElement(StderrContext.Provider
|
|
340
67
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
@@ -342,7 +69,7 @@ export default class App extends PureComponent {
|
|
|
342
69
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
343
70
|
value: {
|
|
344
71
|
stderr: this.props.stderr,
|
|
345
|
-
write: this.props.writeToStderr
|
|
72
|
+
write: this.props.writeToStderr,
|
|
346
73
|
} },
|
|
347
74
|
React.createElement(FocusContext.Provider
|
|
348
75
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
|
@@ -358,7 +85,7 @@ export default class App extends PureComponent {
|
|
|
358
85
|
disableFocus: this.disableFocus,
|
|
359
86
|
focusNext: this.focusNext,
|
|
360
87
|
focusPrevious: this.focusPrevious,
|
|
361
|
-
focus: this.focus
|
|
88
|
+
focus: this.focus,
|
|
362
89
|
} }, this.state.error ? (React.createElement(ErrorOverview, { error: this.state.error })) : (this.props.children)))))));
|
|
363
90
|
}
|
|
364
91
|
componentDidMount() {
|
|
@@ -374,11 +101,186 @@ export default class App extends PureComponent {
|
|
|
374
101
|
componentDidCatch(error) {
|
|
375
102
|
this.handleExit(error);
|
|
376
103
|
}
|
|
104
|
+
handleSetRawMode = (isEnabled) => {
|
|
105
|
+
const { stdin } = this.props;
|
|
106
|
+
if (!this.isRawModeSupported()) {
|
|
107
|
+
if (stdin === process.stdin) {
|
|
108
|
+
throw new Error('Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported');
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
throw new Error('Raw mode is not supported on the stdin provided to Ink.\nRead about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
stdin.setEncoding('utf8');
|
|
115
|
+
if (isEnabled) {
|
|
116
|
+
// Ensure raw mode is enabled only once
|
|
117
|
+
if (this.rawModeEnabledCount === 0) {
|
|
118
|
+
stdin.ref();
|
|
119
|
+
stdin.setRawMode(true);
|
|
120
|
+
stdin.addListener('readable', this.handleReadable);
|
|
121
|
+
}
|
|
122
|
+
this.rawModeEnabledCount++;
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
// Disable raw mode only when no components left that are using it
|
|
126
|
+
if (--this.rawModeEnabledCount === 0) {
|
|
127
|
+
stdin.setRawMode(false);
|
|
128
|
+
stdin.removeListener('readable', this.handleReadable);
|
|
129
|
+
stdin.unref();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
handleReadable = () => {
|
|
133
|
+
let chunk;
|
|
134
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
135
|
+
while ((chunk = this.props.stdin.read()) !== null) {
|
|
136
|
+
this.handleInput(chunk);
|
|
137
|
+
this.internal_eventEmitter.emit('input', chunk);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
handleInput = (input) => {
|
|
141
|
+
// Exit on Ctrl+C
|
|
142
|
+
// eslint-disable-next-line unicorn/no-hex-escape
|
|
143
|
+
if (input === '\x03' && this.props.exitOnCtrlC) {
|
|
144
|
+
this.handleExit();
|
|
145
|
+
}
|
|
146
|
+
// Reset focus when there's an active focused component on Esc
|
|
147
|
+
if (input === escape && this.state.activeFocusId) {
|
|
148
|
+
this.setState({
|
|
149
|
+
activeFocusId: undefined,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
if (this.state.isFocusEnabled && this.state.focusables.length > 0) {
|
|
153
|
+
if (input === tab) {
|
|
154
|
+
this.focusNext();
|
|
155
|
+
}
|
|
156
|
+
if (input === shiftTab) {
|
|
157
|
+
this.focusPrevious();
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
handleExit = (error) => {
|
|
162
|
+
if (this.isRawModeSupported()) {
|
|
163
|
+
this.handleSetRawMode(false);
|
|
164
|
+
}
|
|
165
|
+
this.props.onExit(error);
|
|
166
|
+
};
|
|
167
|
+
enableFocus = () => {
|
|
168
|
+
this.setState({
|
|
169
|
+
isFocusEnabled: true,
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
disableFocus = () => {
|
|
173
|
+
this.setState({
|
|
174
|
+
isFocusEnabled: false,
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
focus = (id) => {
|
|
178
|
+
this.setState(previousState => {
|
|
179
|
+
const hasFocusableId = previousState.focusables.some(focusable => focusable?.id === id);
|
|
180
|
+
if (!hasFocusableId) {
|
|
181
|
+
return previousState;
|
|
182
|
+
}
|
|
183
|
+
return { activeFocusId: id };
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
focusNext = () => {
|
|
187
|
+
this.setState(previousState => {
|
|
188
|
+
const firstFocusableId = previousState.focusables[0]?.id;
|
|
189
|
+
const nextFocusableId = this.findNextFocusable(previousState);
|
|
190
|
+
return {
|
|
191
|
+
activeFocusId: nextFocusableId ?? firstFocusableId,
|
|
192
|
+
};
|
|
193
|
+
});
|
|
194
|
+
};
|
|
195
|
+
focusPrevious = () => {
|
|
196
|
+
this.setState(previousState => {
|
|
197
|
+
const lastFocusableId = previousState.focusables.at(-1)?.id;
|
|
198
|
+
const previousFocusableId = this.findPreviousFocusable(previousState);
|
|
199
|
+
return {
|
|
200
|
+
activeFocusId: previousFocusableId ?? lastFocusableId,
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
addFocusable = (id, { autoFocus }) => {
|
|
205
|
+
this.setState(previousState => {
|
|
206
|
+
let nextFocusId = previousState.activeFocusId;
|
|
207
|
+
if (!nextFocusId && autoFocus) {
|
|
208
|
+
nextFocusId = id;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
activeFocusId: nextFocusId,
|
|
212
|
+
focusables: [
|
|
213
|
+
...previousState.focusables,
|
|
214
|
+
{
|
|
215
|
+
id,
|
|
216
|
+
isActive: true,
|
|
217
|
+
},
|
|
218
|
+
],
|
|
219
|
+
};
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
removeFocusable = (id) => {
|
|
223
|
+
this.setState(previousState => ({
|
|
224
|
+
activeFocusId: previousState.activeFocusId === id
|
|
225
|
+
? undefined
|
|
226
|
+
: previousState.activeFocusId,
|
|
227
|
+
focusables: previousState.focusables.filter(focusable => {
|
|
228
|
+
return focusable.id !== id;
|
|
229
|
+
}),
|
|
230
|
+
}));
|
|
231
|
+
};
|
|
232
|
+
activateFocusable = (id) => {
|
|
233
|
+
this.setState(previousState => ({
|
|
234
|
+
focusables: previousState.focusables.map(focusable => {
|
|
235
|
+
if (focusable.id !== id) {
|
|
236
|
+
return focusable;
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
id,
|
|
240
|
+
isActive: true,
|
|
241
|
+
};
|
|
242
|
+
}),
|
|
243
|
+
}));
|
|
244
|
+
};
|
|
245
|
+
deactivateFocusable = (id) => {
|
|
246
|
+
this.setState(previousState => ({
|
|
247
|
+
activeFocusId: previousState.activeFocusId === id
|
|
248
|
+
? undefined
|
|
249
|
+
: previousState.activeFocusId,
|
|
250
|
+
focusables: previousState.focusables.map(focusable => {
|
|
251
|
+
if (focusable.id !== id) {
|
|
252
|
+
return focusable;
|
|
253
|
+
}
|
|
254
|
+
return {
|
|
255
|
+
id,
|
|
256
|
+
isActive: false,
|
|
257
|
+
};
|
|
258
|
+
}),
|
|
259
|
+
}));
|
|
260
|
+
};
|
|
261
|
+
findNextFocusable = (state) => {
|
|
262
|
+
const activeIndex = state.focusables.findIndex(focusable => {
|
|
263
|
+
return focusable.id === state.activeFocusId;
|
|
264
|
+
});
|
|
265
|
+
for (let index = activeIndex + 1; index < state.focusables.length; index++) {
|
|
266
|
+
const focusable = state.focusables[index];
|
|
267
|
+
if (focusable?.isActive) {
|
|
268
|
+
return focusable.id;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return undefined;
|
|
272
|
+
};
|
|
273
|
+
findPreviousFocusable = (state) => {
|
|
274
|
+
const activeIndex = state.focusables.findIndex(focusable => {
|
|
275
|
+
return focusable.id === state.activeFocusId;
|
|
276
|
+
});
|
|
277
|
+
for (let index = activeIndex - 1; index >= 0; index--) {
|
|
278
|
+
const focusable = state.focusables[index];
|
|
279
|
+
if (focusable?.isActive) {
|
|
280
|
+
return focusable.id;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
return undefined;
|
|
284
|
+
};
|
|
377
285
|
}
|
|
378
|
-
Object.defineProperty(App, "displayName", {
|
|
379
|
-
enumerable: true,
|
|
380
|
-
configurable: true,
|
|
381
|
-
writable: true,
|
|
382
|
-
value: 'InternalApp'
|
|
383
|
-
});
|
|
384
286
|
//# sourceMappingURL=App.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"App.js","sourceRoot":"","sources":["../../src/components/App.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,KAAK,EAAE,EAAC,aAAa,EAAiB,MAAM,OAAO,CAAC;AAC3D,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,UAAU,MAAM,iBAAiB,CAAC;AACzC,OAAO,YAAY,MAAM,mBAAmB,CAAC;AAC7C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,aAAa,MAAM,oBAAoB,CAAC;AAC/C,OAAO,YAAY,MAAM,mBAAmB,CAAC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