dsh-think-translate 1.0.9 → 1.0.10
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/lib/client.js +43 -13
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -14,6 +14,9 @@ window.__ModuleLoader__.load({
|
|
|
14
14
|
var primitives = null;
|
|
15
15
|
try { primitives = require("@deepseek-ai/dsh-client-ui-primitives"); } catch (e) { primitives = null; }
|
|
16
16
|
var MarkdownText = primitives && primitives.MarkdownText ? primitives.MarkdownText : null;
|
|
17
|
+
var IconChecklist = primitives && primitives.IconChecklistOutline14 ? primitives.IconChecklistOutline14 : null;
|
|
18
|
+
var IconChevronUp = primitives && primitives.IconChevronUpOutline14 ? primitives.IconChevronUpOutline14 : null;
|
|
19
|
+
var IconChevronDown = primitives && primitives.IconChevronDownOutline14 ? primitives.IconChevronDownOutline14 : null;
|
|
17
20
|
var createElement = function (type, props) {
|
|
18
21
|
var children = [];
|
|
19
22
|
for (var i = 2; i < arguments.length; i++) children.push(arguments[i]);
|
|
@@ -22,6 +25,7 @@ window.__ModuleLoader__.load({
|
|
|
22
25
|
var Fragment = React.Fragment;
|
|
23
26
|
var useState = React.useState;
|
|
24
27
|
var useEffect = React.useEffect;
|
|
28
|
+
var useId = React.useId;
|
|
25
29
|
var Component = React.Component;
|
|
26
30
|
|
|
27
31
|
// ------------------------------------------------------------------
|
|
@@ -86,16 +90,21 @@ window.__ModuleLoader__.load({
|
|
|
86
90
|
".xl-table th,.xl-table td{border:1px solid var(--dsw-alias-border-l1,rgba(127,127,127,.35));padding:6px 10px;text-align:left;vertical-align:top}",
|
|
87
91
|
".xl-table th{background:var(--dsw-alias-bg-layer-2,rgba(127,127,127,.1));font-weight:600}",
|
|
88
92
|
".xl-table code{font-family:var(--dsw-font-mono,monospace);font-size:12px}",
|
|
89
|
-
".xl-dock{box-sizing:border-box;flex:none;overflow:hidden;margin:0 auto
|
|
93
|
+
".xl-dock{box-sizing:border-box;flex:none;overflow:hidden;margin:0 auto;width:calc(100% - var(--dsh-composer-side-clearance) - var(--dsh-composer-side-clearance) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));max-width:calc(var(--dsh-composer-card-max-width) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset) - var(--dsh-composer-dock-inset));border:1px solid var(--dsw-alias-border-l1);border-radius:12px;background:var(--dsw-specific-tip);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}",
|
|
90
94
|
".xl-dock-body{display:flex;flex-direction:column;gap:8px;padding:6px 12px}",
|
|
91
|
-
".xl-dock-header{display:flex;align-items:center;gap:10px;width:100%;padding:0;border:none;background:transparent;text-align:left;cursor:pointer
|
|
92
|
-
".xl-dock-
|
|
93
|
-
".xl-dock-
|
|
94
|
-
".xl-dock-
|
|
95
|
+
".xl-dock-header{display:flex;align-items:center;gap:10px;width:100%;padding:0;border:none;background:transparent;text-align:left;cursor:pointer}",
|
|
96
|
+
".xl-dock-lead{display:grid;flex:none;place-items:center;color:var(--dsw-alias-label-tertiary)}",
|
|
97
|
+
".xl-dock-title{flex:none;font-size:13px;line-height:24px;font-weight:500;color:var(--dsw-alias-label-primary)}",
|
|
98
|
+
".xl-dock-progress{flex:1 1 auto;min-width:0;overflow:hidden;font-size:13px;line-height:20px;font-weight:400;color:var(--dsw-alias-label-tertiary);text-overflow:ellipsis;white-space:nowrap}",
|
|
99
|
+
".xl-dock-chev{display:grid;flex:none;place-items:center;color:var(--dsw-alias-label-tertiary)}",
|
|
95
100
|
".xl-dock-list{display:flex;flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;max-height:180px;overflow-y:auto}",
|
|
96
|
-
".xl-dock-item{display:flex;align-items:center;gap:10px;min-width:0;font-size:13px;line-height:20px;color:var(--dsw-alias-label-secondary
|
|
97
|
-
".xl-dock-glyph{display:grid;flex:none;place-items:center;width:16px;height:16px
|
|
98
|
-
".xl-dock-
|
|
101
|
+
".xl-dock-item{display:flex;align-items:center;gap:10px;min-width:0;font-size:13px;line-height:20px;color:var(--dsw-alias-label-secondary)}",
|
|
102
|
+
".xl-dock-glyph{display:grid;flex:none;place-items:center;width:16px;height:16px}",
|
|
103
|
+
".xl-dock-glyph-ok{color:var(--dsw-alias-state-success-primary)}",
|
|
104
|
+
".xl-dock-glyph-wait{color:var(--dsw-alias-label-caption)}",
|
|
105
|
+
".xl-dock-glyph-run{color:var(--dsw-alias-state-business-primary);animation:xl-dock-spin 1s linear infinite}",
|
|
106
|
+
".xl-dock-content{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
|
|
107
|
+
"@keyframes xl-dock-spin{to{transform:rotate(360deg)}}"
|
|
99
108
|
].join("\n");
|
|
100
109
|
if (typeof document !== "undefined" && document.querySelector('style[data-plugin-css="dsh-think-translate/styles.css"]') === null) {
|
|
101
110
|
var tag = document.createElement("style");
|
|
@@ -888,11 +897,28 @@ window.__ModuleLoader__.load({
|
|
|
888
897
|
// contents go through the same useXlate path as the in-flow todo row.
|
|
889
898
|
function XDockTodoItem(props) {
|
|
890
899
|
var s = useStore();
|
|
900
|
+
var gid = useId();
|
|
891
901
|
var content = typeof props.item.content === "string" ? props.item.content : "";
|
|
892
902
|
var tr = useXlate(content, s.todo);
|
|
893
903
|
var hasTr = !!(tr && tr.ok && !tr.skipped && tr.text !== content);
|
|
894
|
-
var
|
|
895
|
-
|
|
904
|
+
var status = props.item.status;
|
|
905
|
+
var glyph = null;
|
|
906
|
+
if (status === "completed") {
|
|
907
|
+
glyph = createElement("svg", { width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, className: "xl-dock-glyph-ok" },
|
|
908
|
+
createElement("circle", { cx: 7, cy: 7, r: 6.4, stroke: "currentColor", strokeWidth: 1.2 }),
|
|
909
|
+
createElement("path", { d: "M10.9631 5.71411L7.70154 8.97571C7.48011 9.19714 7.27736 9.40099 7.09229 9.54993C6.89742 9.70669 6.66314 9.85279 6.3634 9.90027C6.2049 9.92534 6.04339 9.92534 5.88489 9.90027C5.58515 9.85279 5.35087 9.70669 5.15601 9.54993C4.97093 9.40099 4.76818 9.19714 4.54675 8.97571L3.03516 7.46411L3.96313 6.53613L5.47473 8.04773C5.7169 8.28989 5.86196 8.43389 5.97888 8.52795C6.08597 8.61409 6.10875 8.60701 6.08997 8.604C6.11259 8.60758 6.13571 8.60758 6.15833 8.604C6.13954 8.60701 6.16232 8.61409 6.26941 8.52795C6.38633 8.43389 6.53139 8.28989 6.77356 8.04773L10.0352 4.78613L10.9631 5.71411Z", fill: "currentColor" }));
|
|
910
|
+
} else if (status === "in_progress") {
|
|
911
|
+
glyph = createElement("svg", { width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, className: "xl-dock-glyph-run" },
|
|
912
|
+
createElement("defs", null,
|
|
913
|
+
createElement("linearGradient", { id: gid, x1: 2.5, y1: 12, x2: 10.5, y2: 3.5, gradientUnits: "userSpaceOnUse" },
|
|
914
|
+
createElement("stop", { stopColor: "currentColor" }),
|
|
915
|
+
createElement("stop", { offset: 1, stopColor: "currentColor", stopOpacity: 0 }))),
|
|
916
|
+
createElement("circle", { cx: 7, cy: 7, r: 6.4, stroke: "url(#" + gid + ")", strokeWidth: 1.2 }));
|
|
917
|
+
} else {
|
|
918
|
+
glyph = createElement("svg", { width: 14, height: 14, viewBox: "0 0 14 14", fill: "none", "aria-hidden": true, className: "xl-dock-glyph-wait" },
|
|
919
|
+
createElement("circle", { cx: 7, cy: 7, r: 6.4, stroke: "currentColor", strokeWidth: 1.2, strokeDasharray: "2.4 2.4" }));
|
|
920
|
+
}
|
|
921
|
+
return createElement("li", { className: "xl-dock-item", "data-status": status },
|
|
896
922
|
createElement("span", { className: "xl-dock-glyph", "aria-hidden": true }, glyph),
|
|
897
923
|
createElement("span", {
|
|
898
924
|
className: "xl-dock-content",
|
|
@@ -934,11 +960,15 @@ window.__ModuleLoader__.load({
|
|
|
934
960
|
type: "button", className: "xl-dock-header", "aria-expanded": open,
|
|
935
961
|
onClick: function () { setOpen(function (v) { return !v; }); }
|
|
936
962
|
},
|
|
963
|
+
IconChecklist ? createElement("span", { className: "xl-dock-lead", "aria-hidden": true }, createElement(IconChecklist, null)) : null,
|
|
937
964
|
createElement("span", { className: "xl-dock-title" }, title),
|
|
938
965
|
createElement("span", { className: "xl-dock-progress" }, progress),
|
|
939
|
-
createElement("span", { className: "xl-dock-chev", "aria-hidden": true },
|
|
940
|
-
|
|
941
|
-
|
|
966
|
+
createElement("span", { className: "xl-dock-chev", "aria-hidden": true },
|
|
967
|
+
open
|
|
968
|
+
? (IconChevronDown ? createElement(IconChevronDown, null) : null)
|
|
969
|
+
: (IconChevronUp ? createElement(IconChevronUp, null) : null))),
|
|
970
|
+
open ? createElement("ul", { className: "xl-dock-list" }, list.map(function (it) {
|
|
971
|
+
return createElement(XDockTodoItem, { key: it.content, item: it });
|
|
942
972
|
})) : null));
|
|
943
973
|
}
|
|
944
974
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-think-translate",
|
|
3
3
|
"description": "Display-layer translation for the DSH web app: thinking chain, task cards, and optional answer text, in 8 target languages (local Ollama / Google / Bing, fail-open)",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.10",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"exports": {
|