stitchkit-tui 0.1.4 → 0.2.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.
- package/dist/cli.js +457 -454
- package/dist/core/index.js +30 -30
- package/dist/index.js +665 -662
- package/package.json +6 -3
package/dist/core/index.js
CHANGED
|
@@ -44,14 +44,14 @@ function reduceTerminalCollection(state, action) {
|
|
|
44
44
|
if (keys.length === 0)
|
|
45
45
|
return { keys, selectedKey: null, start: 0, capacity: current.capacity };
|
|
46
46
|
const previousIndex = current.selectedKey === null ? 0 : Math.max(0, current.keys.indexOf(current.selectedKey));
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
47
|
+
const selectedKey = current.selectedKey !== null && keys.includes(current.selectedKey) ? current.selectedKey : keys[Math.min(previousIndex, keys.length - 1)];
|
|
48
|
+
if (!selectedKey)
|
|
49
49
|
throw new Error("Terminal collection survivor is unavailable");
|
|
50
|
-
const index = keys.indexOf(
|
|
50
|
+
const index = keys.indexOf(selectedKey);
|
|
51
51
|
return TerminalCollectionStateSchema.parse({
|
|
52
52
|
...current,
|
|
53
53
|
keys,
|
|
54
|
-
selectedKey
|
|
54
|
+
selectedKey,
|
|
55
55
|
start: reveal(current.start, current.capacity, index, keys.length)
|
|
56
56
|
});
|
|
57
57
|
}
|
|
@@ -331,31 +331,31 @@ function visibleTerminalFeedRange(state) {
|
|
|
331
331
|
return { start: parsed.start, end: Math.min(parsed.total, parsed.start + parsed.capacity) };
|
|
332
332
|
}
|
|
333
333
|
export {
|
|
334
|
-
|
|
335
|
-
visibleTerminalFeedRange,
|
|
336
|
-
visibleTerminalCollectionRange,
|
|
337
|
-
validateTerminalCommands,
|
|
338
|
-
terminalCommandMatches,
|
|
339
|
-
setTerminalCommandQuery,
|
|
340
|
-
selectedTerminalCommand,
|
|
341
|
-
resolveExactTerminalCommand,
|
|
342
|
-
reduceTerminalPaneState,
|
|
343
|
-
reduceTerminalOperationState,
|
|
344
|
-
reduceTerminalFeedViewport,
|
|
345
|
-
reduceTerminalCollection,
|
|
346
|
-
moveTerminalCommandSelection,
|
|
347
|
-
dismissTerminalCommandPalette,
|
|
348
|
-
createTerminalPaneState,
|
|
349
|
-
createTerminalOperationState,
|
|
350
|
-
createTerminalFeedViewport,
|
|
351
|
-
createTerminalCommandPalette,
|
|
352
|
-
createTerminalCollection,
|
|
353
|
-
TerminalPaneStateSchema,
|
|
354
|
-
TerminalPaneModeSchema,
|
|
355
|
-
TerminalPaneIdSchema,
|
|
356
|
-
TerminalOperationStateSchema,
|
|
357
|
-
TerminalFeedViewportSchema,
|
|
358
|
-
TerminalCommandPaletteStateSchema,
|
|
334
|
+
TerminalCollectionStateSchema,
|
|
359
335
|
TerminalCommandDescriptorSchema,
|
|
360
|
-
|
|
336
|
+
TerminalCommandPaletteStateSchema,
|
|
337
|
+
TerminalFeedViewportSchema,
|
|
338
|
+
TerminalOperationStateSchema,
|
|
339
|
+
TerminalPaneIdSchema,
|
|
340
|
+
TerminalPaneModeSchema,
|
|
341
|
+
TerminalPaneStateSchema,
|
|
342
|
+
createTerminalCollection,
|
|
343
|
+
createTerminalCommandPalette,
|
|
344
|
+
createTerminalFeedViewport,
|
|
345
|
+
createTerminalOperationState,
|
|
346
|
+
createTerminalPaneState,
|
|
347
|
+
dismissTerminalCommandPalette,
|
|
348
|
+
moveTerminalCommandSelection,
|
|
349
|
+
reduceTerminalCollection,
|
|
350
|
+
reduceTerminalFeedViewport,
|
|
351
|
+
reduceTerminalOperationState,
|
|
352
|
+
reduceTerminalPaneState,
|
|
353
|
+
resolveExactTerminalCommand,
|
|
354
|
+
selectedTerminalCommand,
|
|
355
|
+
setTerminalCommandQuery,
|
|
356
|
+
terminalCommandMatches,
|
|
357
|
+
validateTerminalCommands,
|
|
358
|
+
visibleTerminalCollectionRange,
|
|
359
|
+
visibleTerminalFeedRange,
|
|
360
|
+
visibleTerminalPanes
|
|
361
361
|
};
|