dsh-conversation-navigator 0.1.4 → 0.1.5
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 +12 -18
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -5,7 +5,7 @@ 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 } = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8
|
+
const { Button, IconPanelLeftOutline16, IconChevronUpOutline14, IconRefreshOutline14, IconChevronDownOutline14, IconTriangleRightFill14, IconCloseOutline16 } = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
9
9
|
|
|
10
10
|
/* ---------- own stylesheet (static packages have no styles builtin) ---------- */
|
|
11
11
|
const CSS = `
|
|
@@ -372,17 +372,6 @@ window.__ModuleLoader__.load({
|
|
|
372
372
|
const groupEls = {};
|
|
373
373
|
|
|
374
374
|
/* ---------- header toggle button ---------- */
|
|
375
|
-
function ToggleIcon() {
|
|
376
|
-
return React.createElement("svg", {
|
|
377
|
-
viewBox: "0 0 16 16", width: 14, height: 14, fill: "none",
|
|
378
|
-
stroke: "currentColor", strokeWidth: 1.4, "aria-hidden": true,
|
|
379
|
-
},
|
|
380
|
-
React.createElement("circle", { cx: 3, cy: 3.5, r: 1.1, fill: "currentColor", stroke: "none" }),
|
|
381
|
-
React.createElement("path", { d: "M6.2 3.5h7.8M6.2 8h7.8M6.2 12.5h7.8", strokeLinecap: "round" }),
|
|
382
|
-
React.createElement("circle", { cx: 3, cy: 8, r: 1.1, fill: "currentColor", stroke: "none" }),
|
|
383
|
-
React.createElement("circle", { cx: 3, cy: 12.5, r: 1.1, fill: "currentColor", stroke: "none" }),
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
375
|
function ToggleButton(props) {
|
|
387
376
|
const snap = useStore();
|
|
388
377
|
const outline = props.useSession(selectOutline);
|
|
@@ -400,7 +389,7 @@ window.__ModuleLoader__.load({
|
|
|
400
389
|
return React.createElement(Button, {
|
|
401
390
|
variant: snap.open ? "primary" : "ghost",
|
|
402
391
|
size: "sm",
|
|
403
|
-
icon: React.createElement(
|
|
392
|
+
icon: React.createElement(IconPanelLeftOutline16),
|
|
404
393
|
"aria-pressed": snap.open,
|
|
405
394
|
title: snap.open ? "收起会话导航" : "打开会话导航",
|
|
406
395
|
onClick: () => setState({ open: !snap.open }),
|
|
@@ -546,27 +535,30 @@ window.__ModuleLoader__.load({
|
|
|
546
535
|
variant: "ghost",
|
|
547
536
|
size: "sm",
|
|
548
537
|
className: "cnvnav-close",
|
|
538
|
+
icon: React.createElement(IconCloseOutline16, { size: 14 }),
|
|
549
539
|
title: "收起",
|
|
550
540
|
onClick: () => setState({ open: false }),
|
|
551
|
-
}
|
|
541
|
+
}),
|
|
552
542
|
),
|
|
553
543
|
React.createElement("div", { className: "cnvnav-topbar" },
|
|
554
544
|
React.createElement(Button, {
|
|
555
545
|
variant: "ghost",
|
|
556
546
|
size: "sm",
|
|
557
547
|
className: "cnvnav-bar-btn",
|
|
548
|
+
icon: React.createElement(IconChevronUpOutline14),
|
|
558
549
|
disabled: !snap.hasMore || snap.loadingOlder,
|
|
559
550
|
title: "加载更早的一批轮次",
|
|
560
551
|
onClick: () => loadOlderPage(),
|
|
561
|
-
}, "
|
|
552
|
+
}, "加载更早"),
|
|
562
553
|
React.createElement(Button, {
|
|
563
554
|
variant: "ghost",
|
|
564
555
|
size: "sm",
|
|
565
556
|
className: "cnvnav-bar-btn",
|
|
557
|
+
icon: React.createElement(IconRefreshOutline14),
|
|
566
558
|
disabled: !snap.hasMore || snap.loadingOlder || snap.loadingAll,
|
|
567
559
|
title: "加载全部历史轮次",
|
|
568
560
|
onClick: () => loadAllPages(),
|
|
569
|
-
}, "
|
|
561
|
+
}, "加载全部"),
|
|
570
562
|
),
|
|
571
563
|
React.createElement("div", {
|
|
572
564
|
ref: (el) => { listEl = el; },
|
|
@@ -581,6 +573,7 @@ window.__ModuleLoader__.load({
|
|
|
581
573
|
variant: "ghost",
|
|
582
574
|
size: "sm",
|
|
583
575
|
className: "cnvnav-bar-btn",
|
|
576
|
+
icon: React.createElement(IconChevronDownOutline14),
|
|
584
577
|
onClick: () => {
|
|
585
578
|
const gs = snap.outline !== null ? snap.outline.groups : [];
|
|
586
579
|
if (gs.length === 0) return;
|
|
@@ -588,14 +581,15 @@ window.__ModuleLoader__.load({
|
|
|
588
581
|
const lastItem = lastGroup.items[lastGroup.items.length - 1];
|
|
589
582
|
if (lastItem !== undefined) jumpTo(lastItem.key);
|
|
590
583
|
},
|
|
591
|
-
}, "
|
|
584
|
+
}, "回到最新"),
|
|
592
585
|
React.createElement(Button, {
|
|
593
586
|
variant: "ghost",
|
|
594
587
|
size: "sm",
|
|
595
588
|
className: "cnvnav-bar-btn",
|
|
589
|
+
icon: React.createElement(IconTriangleRightFill14),
|
|
596
590
|
title: "折叠所有已展开的轮次",
|
|
597
591
|
onClick: () => setState({ expanded: {} }),
|
|
598
|
-
}, "
|
|
592
|
+
}, "全部折叠"),
|
|
599
593
|
),
|
|
600
594
|
);
|
|
601
595
|
}
|