zcode-app-cli 3.3.6-2 → 3.3.6-3
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/package.json
CHANGED
package/vendor/extraction.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"appVersion": "3.3.6",
|
|
3
3
|
"cliVersion": "0.15.2",
|
|
4
|
-
"extractedAt": "2026-07-
|
|
4
|
+
"extractedAt": "2026-07-17T03:15:27.269Z",
|
|
5
5
|
"sha512": "NwQzSBf+Q5FR3VWwAEQUeALHR9jvDjRT7PJLVQ4iLOyTxPm7Lt8kMQbQXI7MJ/wEDQ0EK3FBBjJQVlJiC4Kgsw==",
|
|
6
6
|
"source": "https://cdn-zcode.z.ai/zcode/electron/releases/3.3.6/linux-x64/ZCode-3.3.6-linux-x64.deb",
|
|
7
7
|
"tui": {
|
|
@@ -156892,6 +156892,26 @@ function isWindowedComponent(component) {
|
|
|
156892
156892
|
}
|
|
156893
156893
|
//#endregion
|
|
156894
156894
|
//#region packages/zcode-tui/src/choice-dialog.ts
|
|
156895
|
+
var ChoiceItemDetails = class {
|
|
156896
|
+
item;
|
|
156897
|
+
theme;
|
|
156898
|
+
constructor(item, theme) {
|
|
156899
|
+
this.item = item;
|
|
156900
|
+
this.theme = theme;
|
|
156901
|
+
}
|
|
156902
|
+
render(width) {
|
|
156903
|
+
const safeWidth = Math.max(1, width);
|
|
156904
|
+
const preview = this.item.preview?.render(safeWidth) ?? [];
|
|
156905
|
+
return [
|
|
156906
|
+
...wrapTerminalText(this.theme.bold(this.item.label), safeWidth),
|
|
156907
|
+
...this.item.description ? wrapTerminalText(this.theme.muted(this.item.description), safeWidth) : [],
|
|
156908
|
+
...preview.length > 0 ? ["", ...preview] : []
|
|
156909
|
+
];
|
|
156910
|
+
}
|
|
156911
|
+
invalidate() {
|
|
156912
|
+
this.item.preview?.invalidate?.();
|
|
156913
|
+
}
|
|
156914
|
+
};
|
|
156895
156915
|
var ChoiceDialog = class {
|
|
156896
156916
|
title;
|
|
156897
156917
|
prompt;
|
|
@@ -157060,6 +157080,7 @@ function choose(ui, host, theme, options) {
|
|
|
157060
157080
|
if (options.items.length === 0) return Promise.resolve(null);
|
|
157061
157081
|
return new Promise((resolve) => {
|
|
157062
157082
|
const choicesByValue = /* @__PURE__ */ new Map();
|
|
157083
|
+
const detailsByValue = /* @__PURE__ */ new Map();
|
|
157063
157084
|
const searchableItems = options.items.map((item, index) => {
|
|
157064
157085
|
const safeItem = {
|
|
157065
157086
|
...item,
|
|
@@ -157068,21 +157089,23 @@ function choose(ui, host, theme, options) {
|
|
|
157068
157089
|
};
|
|
157069
157090
|
const value = `${safeItem.label}\u0000${index}`;
|
|
157070
157091
|
choicesByValue.set(value, safeItem);
|
|
157092
|
+
if (options.showSelectedItemDetails) detailsByValue.set(value, new ChoiceItemDetails(safeItem, theme));
|
|
157071
157093
|
return {
|
|
157072
157094
|
value,
|
|
157073
157095
|
label: safeItem.label,
|
|
157074
157096
|
description: safeItem.description
|
|
157075
157097
|
};
|
|
157076
157098
|
});
|
|
157077
|
-
const
|
|
157099
|
+
const hasDetails = Boolean(options.content || options.showSelectedItemDetails || options.items.some((item) => item.preview));
|
|
157100
|
+
const maxVisible = Math.max(1, Math.min(8, searchableItems.length, Math.floor(Math.max(2, ui.terminal.rows - 8) / (hasDetails ? 2 : 1))));
|
|
157078
157101
|
const list = new SelectList(searchableItems, maxVisible, theme.select);
|
|
157079
157102
|
list.setSelectedIndex(options.selectedIndex ?? 0);
|
|
157080
157103
|
const maxContentLines = Math.max(0, ui.terminal.rows - maxVisible - 9);
|
|
157081
157104
|
const maxExpandedContentLines = Math.max(2, maxContentLines, ui.terminal.rows - 8);
|
|
157082
|
-
const hasDetails = Boolean(options.content || options.items.some((item) => item.preview));
|
|
157083
157105
|
const dialog = new ChoiceDialog(sanitizeTerminalText(options.title, { preserveSgr: false }), sanitizeTerminalText(options.prompt, { preserveSgr: false }), sanitizeTerminalText(options.help ?? (hasDetails ? "Type to filter · Up/Down choose · Ctrl+O details · PgUp/PgDn scroll · Enter confirm · Esc cancel" : "Type to filter · Up/Down choose · Enter confirm · Esc cancel · Ctrl+U clear"), { preserveSgr: false }), list, theme, options.content, sanitizeTerminalText(options.contentLabel ?? "Details", { preserveSgr: false }), maxContentLines, maxExpandedContentLines);
|
|
157084
157106
|
const previewFor = (item) => {
|
|
157085
|
-
|
|
157107
|
+
if (!item) return void 0;
|
|
157108
|
+
return options.showSelectedItemDetails ? detailsByValue.get(item.value) : choicesByValue.get(item.value)?.preview;
|
|
157086
157109
|
};
|
|
157087
157110
|
dialog.setSelectionPreview(previewFor(list.getSelectedItem()));
|
|
157088
157111
|
let settled = false;
|
|
@@ -165101,6 +165124,8 @@ var ZCodeTui = class {
|
|
|
165101
165124
|
label: "Other…",
|
|
165102
165125
|
description: "Enter a different answer"
|
|
165103
165126
|
}],
|
|
165127
|
+
contentLabel: "Option details",
|
|
165128
|
+
showSelectedItemDetails: true,
|
|
165104
165129
|
signal
|
|
165105
165130
|
});
|
|
165106
165131
|
if (!selected) return null;
|
|
@@ -165137,6 +165162,8 @@ var ZCodeTui = class {
|
|
|
165137
165162
|
description: `${selected.size + (custom ? 1 : 0)} selected`
|
|
165138
165163
|
}
|
|
165139
165164
|
],
|
|
165165
|
+
contentLabel: "Option details",
|
|
165166
|
+
showSelectedItemDetails: true,
|
|
165140
165167
|
signal
|
|
165141
165168
|
});
|
|
165142
165169
|
if (!choice) return null;
|