dsh-conversation-navigator 0.1.6 → 0.1.8
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 +64 -6
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -5,7 +5,65 @@ window.__ModuleLoader__.load({
|
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
const React = require("react");
|
|
8
|
-
const { Button,
|
|
8
|
+
const { Button, IconCloseOutline16 } = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
9
|
+
|
|
10
|
+
/* ---------- custom icons (DSH outline style, unique to this panel) ---------- */
|
|
11
|
+
function ToggleIcon() {
|
|
12
|
+
return React.createElement("svg", {
|
|
13
|
+
viewBox: "0 0 14 14", width: 14, height: 14, fill: "none",
|
|
14
|
+
stroke: "currentColor", strokeWidth: 1.4, strokeLinecap: "round",
|
|
15
|
+
"aria-hidden": true,
|
|
16
|
+
},
|
|
17
|
+
React.createElement("circle", { cx: 3.5, cy: 3, r: 1, fill: "currentColor", stroke: "none" }),
|
|
18
|
+
React.createElement("path", { d: "M6.5 3H12" }),
|
|
19
|
+
React.createElement("circle", { cx: 3.5, cy: 7, r: 1, fill: "currentColor", stroke: "none" }),
|
|
20
|
+
React.createElement("path", { d: "M6.5 7H12" }),
|
|
21
|
+
React.createElement("circle", { cx: 3.5, cy: 11, r: 1, fill: "currentColor", stroke: "none" }),
|
|
22
|
+
React.createElement("path", { d: "M6.5 11H12" }),
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
function LoadEarlierIcon() {
|
|
26
|
+
return React.createElement("svg", {
|
|
27
|
+
viewBox: "0 0 14 14", width: 14, height: 14, fill: "none",
|
|
28
|
+
stroke: "currentColor", strokeWidth: 1.4, strokeLinecap: "round", strokeLinejoin: "round",
|
|
29
|
+
"aria-hidden": true,
|
|
30
|
+
},
|
|
31
|
+
React.createElement("path", { d: "M7 11V5M4 7.5l3-3 3 3" }),
|
|
32
|
+
React.createElement("line", { x1: 2, y1: 3, x2: 12, y2: 3 }),
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
function LoadAllIcon() {
|
|
36
|
+
return React.createElement("svg", {
|
|
37
|
+
viewBox: "0 0 14 14", width: 14, height: 14, fill: "none",
|
|
38
|
+
stroke: "currentColor", strokeWidth: 1.3, strokeLinecap: "round", strokeLinejoin: "round",
|
|
39
|
+
"aria-hidden": true,
|
|
40
|
+
},
|
|
41
|
+
React.createElement("path", { d: "M7 2l5 3-5 3-5-3 5-3z" }),
|
|
42
|
+
React.createElement("path", { d: "M2 5v3l5 3 5-3V5" }),
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function JumpLatestIcon() {
|
|
46
|
+
return React.createElement("svg", {
|
|
47
|
+
viewBox: "0 0 14 14", width: 14, height: 14, fill: "none",
|
|
48
|
+
stroke: "currentColor", strokeWidth: 1.4, strokeLinecap: "round", strokeLinejoin: "round",
|
|
49
|
+
"aria-hidden": true,
|
|
50
|
+
},
|
|
51
|
+
React.createElement("path", { d: "M7 3V9M4 7l3 3 3-3" }),
|
|
52
|
+
React.createElement("line", { x1: 2, y1: 11, x2: 12, y2: 11 }),
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function CollapseAllIcon() {
|
|
56
|
+
return React.createElement("svg", {
|
|
57
|
+
viewBox: "0 0 14 14", width: 14, height: 14, fill: "none",
|
|
58
|
+
stroke: "currentColor", strokeWidth: 1.2, strokeLinecap: "round",
|
|
59
|
+
"aria-hidden": true,
|
|
60
|
+
},
|
|
61
|
+
React.createElement("line", { x1: 2.5, y1: 2, x2: 11.5, y2: 2 }),
|
|
62
|
+
React.createElement("line", { x1: 2.5, y1: 5, x2: 11.5, y2: 5 }),
|
|
63
|
+
React.createElement("line", { x1: 2.5, y1: 8, x2: 11.5, y2: 8 }),
|
|
64
|
+
React.createElement("line", { x1: 2.5, y1: 11, x2: 11.5, y2: 11 }),
|
|
65
|
+
);
|
|
66
|
+
}
|
|
9
67
|
|
|
10
68
|
/* ---------- own stylesheet (static packages have no styles builtin) ---------- */
|
|
11
69
|
const CSS = `
|
|
@@ -389,7 +447,7 @@ window.__ModuleLoader__.load({
|
|
|
389
447
|
return React.createElement(Button, {
|
|
390
448
|
variant: snap.open ? "primary" : "ghost",
|
|
391
449
|
size: "sm",
|
|
392
|
-
icon: React.createElement(
|
|
450
|
+
icon: React.createElement(ToggleIcon),
|
|
393
451
|
"aria-pressed": snap.open,
|
|
394
452
|
title: snap.open ? "收起会话导航" : "打开会话导航",
|
|
395
453
|
onClick: () => setState({ open: !snap.open }),
|
|
@@ -545,7 +603,7 @@ window.__ModuleLoader__.load({
|
|
|
545
603
|
variant: "ghost",
|
|
546
604
|
size: "sm",
|
|
547
605
|
className: "cnvnav-bar-btn",
|
|
548
|
-
icon: React.createElement(
|
|
606
|
+
icon: React.createElement(LoadEarlierIcon),
|
|
549
607
|
disabled: !snap.hasMore || snap.loadingOlder,
|
|
550
608
|
title: "加载更早的一批轮次",
|
|
551
609
|
onClick: () => loadOlderPage(),
|
|
@@ -554,7 +612,7 @@ window.__ModuleLoader__.load({
|
|
|
554
612
|
variant: "ghost",
|
|
555
613
|
size: "sm",
|
|
556
614
|
className: "cnvnav-bar-btn",
|
|
557
|
-
icon: React.createElement(
|
|
615
|
+
icon: React.createElement(LoadAllIcon),
|
|
558
616
|
disabled: !snap.hasMore || snap.loadingOlder || snap.loadingAll,
|
|
559
617
|
title: "加载全部历史轮次",
|
|
560
618
|
onClick: () => loadAllPages(),
|
|
@@ -573,7 +631,7 @@ window.__ModuleLoader__.load({
|
|
|
573
631
|
variant: "ghost",
|
|
574
632
|
size: "sm",
|
|
575
633
|
className: "cnvnav-bar-btn",
|
|
576
|
-
icon: React.createElement(
|
|
634
|
+
icon: React.createElement(JumpLatestIcon),
|
|
577
635
|
onClick: () => {
|
|
578
636
|
const gs = snap.outline !== null ? snap.outline.groups : [];
|
|
579
637
|
if (gs.length === 0) return;
|
|
@@ -586,7 +644,7 @@ window.__ModuleLoader__.load({
|
|
|
586
644
|
variant: "ghost",
|
|
587
645
|
size: "sm",
|
|
588
646
|
className: "cnvnav-bar-btn",
|
|
589
|
-
icon: React.createElement(
|
|
647
|
+
icon: React.createElement(CollapseAllIcon),
|
|
590
648
|
title: "折叠所有已展开的轮次",
|
|
591
649
|
onClick: () => setState({ expanded: {} }),
|
|
592
650
|
}, "全部折叠"),
|