@crazyhappyone/dsh-tui 0.1.0-alpha.28 → 0.1.0-alpha.29
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/README.i18n.yaml
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Bilingual-pair consistency record: both languages carry equal authority.
|
|
2
2
|
# This source-only mirror has no DSH pairing runner. Recompute with:
|
|
3
3
|
# git hash-object README.md README.zh.md
|
|
4
|
-
README.md:
|
|
5
|
-
README.zh.md:
|
|
4
|
+
README.md: 9edd0d7b9c067fc810fa59fc53525eed8be07dd9
|
|
5
|
+
README.zh.md: 9f4e419aeb64eb7e676b7763caa9b69e835cf0dd
|
package/README.md
CHANGED
|
@@ -33,9 +33,9 @@ English | [中文](README.zh.md)
|
|
|
33
33
|
<a id="screenshots"></a>
|
|
34
34
|
## Screenshots
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
Interactive settings pane (`/settings`):
|
|
37
37
|
|
|
38
|
-

|
|
39
39
|
|
|
40
40
|
After sending `你好`:
|
|
41
41
|
|
package/README.zh.md
CHANGED
|
Binary file
|
|
Binary file
|
package/dist/index.js
CHANGED
|
@@ -228,6 +228,7 @@ var THEME_LEVELS = {
|
|
|
228
228
|
toolBg: "#252830",
|
|
229
229
|
inputBg: "#23262B",
|
|
230
230
|
codeBg: "#202328",
|
|
231
|
+
settingsCardBg: "#182236",
|
|
231
232
|
fg: "#EEF0F2",
|
|
232
233
|
fgSoft: "#D1D4D8",
|
|
233
234
|
fgDim: "#A4A9B0",
|
|
@@ -253,6 +254,7 @@ var THEME_LEVELS = {
|
|
|
253
254
|
toolBg: "236",
|
|
254
255
|
inputBg: "235",
|
|
255
256
|
codeBg: "235",
|
|
257
|
+
settingsCardBg: "236",
|
|
256
258
|
fg: "255",
|
|
257
259
|
fgSoft: "252",
|
|
258
260
|
fgDim: "248",
|
|
@@ -278,6 +280,7 @@ var THEME_LEVELS = {
|
|
|
278
280
|
toolBg: "black",
|
|
279
281
|
inputBg: "bright-black",
|
|
280
282
|
codeBg: "black",
|
|
283
|
+
settingsCardBg: "blue",
|
|
281
284
|
fg: "white",
|
|
282
285
|
fgSoft: "white",
|
|
283
286
|
fgDim: "white",
|
|
@@ -303,6 +306,7 @@ var THEME_LEVELS = {
|
|
|
303
306
|
toolBg: "",
|
|
304
307
|
inputBg: "",
|
|
305
308
|
codeBg: "",
|
|
309
|
+
settingsCardBg: "",
|
|
306
310
|
fg: "",
|
|
307
311
|
fgSoft: "",
|
|
308
312
|
fgDim: "",
|
|
@@ -416,7 +420,8 @@ var BACKGROUND_TOKENS = /* @__PURE__ */ new Set([
|
|
|
416
420
|
"messageBg",
|
|
417
421
|
"toolBg",
|
|
418
422
|
"inputBg",
|
|
419
|
-
"codeBg"
|
|
423
|
+
"codeBg",
|
|
424
|
+
"settingsCardBg"
|
|
420
425
|
]);
|
|
421
426
|
|
|
422
427
|
// tui-render/src/brand.ts
|
|
@@ -9727,12 +9732,14 @@ function fitValue(value, maxCols) {
|
|
|
9727
9732
|
if (budget <= 0) return wcwidthSafeSlice(VALUE_ELLIPSIS, maxCols);
|
|
9728
9733
|
return `${wcwidthSafeSlice(value, budget)}${VALUE_ELLIPSIS}`;
|
|
9729
9734
|
}
|
|
9730
|
-
function fieldRow(label, value, selected, columns) {
|
|
9735
|
+
function fieldRow(label, value, selected, columns, required = false) {
|
|
9731
9736
|
const marker = selected ? styled(escapeContent("\u203A "), "accent", void 0, true) : " ";
|
|
9737
|
+
const reqMark = required ? styled("* ", "error", void 0, true) : "";
|
|
9738
|
+
const reqWidth = required ? 2 : 0;
|
|
9732
9739
|
const escapedLabel = escapeContent(label);
|
|
9733
9740
|
const escapedValue = escapeContent(value);
|
|
9734
|
-
const labelToken = selected ? "fg" : "
|
|
9735
|
-
const labelCols = MARKER_COLS + displayWidth(escapedLabel);
|
|
9741
|
+
const labelToken = selected ? "fg" : "fgSoft";
|
|
9742
|
+
const labelCols = MARKER_COLS + reqWidth + displayWidth(escapedLabel);
|
|
9736
9743
|
const valueBudget = Math.max(0, columns - labelCols - VALUE_GAP);
|
|
9737
9744
|
const fittedValue = fitValue(escapedValue, valueBudget);
|
|
9738
9745
|
const gap = Math.max(
|
|
@@ -9741,9 +9748,10 @@ function fieldRow(label, value, selected, columns) {
|
|
|
9741
9748
|
);
|
|
9742
9749
|
return [
|
|
9743
9750
|
marker,
|
|
9751
|
+
...required ? [reqMark] : [],
|
|
9744
9752
|
styled(escapedLabel, labelToken),
|
|
9745
|
-
styled(" ".repeat(gap), "
|
|
9746
|
-
...fittedValue === "" ? [] : [styled(fittedValue, "fgDim")]
|
|
9753
|
+
styled(" ".repeat(gap), "settingsCardBg"),
|
|
9754
|
+
...fittedValue === "" ? [] : [styled(fittedValue, selected ? "fg" : "fgDim")]
|
|
9747
9755
|
];
|
|
9748
9756
|
}
|
|
9749
9757
|
function computeSettingsWindow(maxRows, totalRows, errorReason) {
|
|
@@ -9776,25 +9784,35 @@ function SettingsPane({
|
|
|
9776
9784
|
rows.length - size
|
|
9777
9785
|
);
|
|
9778
9786
|
const visible = rows.slice(start, start + size);
|
|
9787
|
+
const renderLine = (text, token, bold = false) => /* @__PURE__ */ jsx14(Box14, { width: "100%", children: /* @__PURE__ */ jsx14(Text14, { children: paintBackgroundRow([styled(escapeContent(text), token, void 0, bold)], "settingsCardBg", width) }) });
|
|
9779
9788
|
return /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", width: "100%", children: [
|
|
9780
|
-
|
|
9781
|
-
start > 0 ?
|
|
9789
|
+
renderLine(onboarding === true ? ONBOARDING_TITLE : TITLE2, "fg", true),
|
|
9790
|
+
start > 0 ? renderLine(`\u2026 \u8FD8\u6709 ${String(start)} \u9879`, "fgDim") : null,
|
|
9782
9791
|
visible.map((row, index) => {
|
|
9783
9792
|
const absolute = start + index;
|
|
9784
9793
|
const selected = absolute === selectedIndex;
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
|
|
9794
|
+
let localized;
|
|
9795
|
+
if (row.label !== void 0) {
|
|
9796
|
+
localized = row.label;
|
|
9797
|
+
} else if (row.namespace === "tui" && (row.field === "reasoning" || row.field === "scrollbar" || row.field === "statusDetails" || row.field === "locale")) {
|
|
9798
|
+
localized = `${row.field} \xB7 ${tuiCopy(row.field, locale)}`;
|
|
9799
|
+
} else if (row.field === "apiKeyEnv") {
|
|
9800
|
+
localized = `${row.field} \xB7 \u73AF\u5883\u53D8\u91CF\u540D`;
|
|
9801
|
+
} else {
|
|
9802
|
+
localized = row.field;
|
|
9803
|
+
}
|
|
9804
|
+
const label = row.label === void 0 ? `${row.namespace} \xB7 ${localized}` : localized;
|
|
9805
|
+
return /* @__PURE__ */ jsx14(Box14, { width: "100%", children: /* @__PURE__ */ jsx14(Text14, { children: paintBackgroundRow(fieldRow(label, row.value, selected, width, row.required === true), "settingsCardBg", width) }) }, `${row.namespace}:${row.field}`);
|
|
9788
9806
|
}),
|
|
9789
|
-
rows.length > start + size ?
|
|
9790
|
-
errorReason
|
|
9791
|
-
|
|
9807
|
+
rows.length > start + size ? renderLine(`\u2026 \u8FD8\u6709 ${String(rows.length - start - size)} \u9879`, "fgDim") : null,
|
|
9808
|
+
errorReason === void 0 ? null : /* @__PURE__ */ jsxs13(Box14, { flexDirection: "column", width: "100%", children: [
|
|
9809
|
+
renderLine(
|
|
9792
9810
|
errorReason === EMPTY_TABLE_REASON2 ? EMPTY_TABLE_REASON2 : `\u2717 \u66F4\u65B0\u5931\u8D25\uFF1A${errorReason}`,
|
|
9793
9811
|
"error"
|
|
9794
9812
|
),
|
|
9795
|
-
errorReason === EMPTY_TABLE_REASON2 ? null :
|
|
9796
|
-
] })
|
|
9797
|
-
|
|
9813
|
+
errorReason === EMPTY_TABLE_REASON2 ? null : renderLine(FAIL_NEXT2, "fgDim")
|
|
9814
|
+
] }),
|
|
9815
|
+
renderLine(footnote, "fgDim")
|
|
9798
9816
|
] });
|
|
9799
9817
|
}
|
|
9800
9818
|
|
package/package.json
CHANGED
|
Binary file
|