@deepseek-ai/dsh-client-ui-primitives 0.0.1-rc.2 → 0.0.1-rc.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/README.i18n.yaml CHANGED
@@ -3,4 +3,4 @@
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/client/ui-primitives/README.md
5
5
  README.md: f96e931472a0946bd023b97b034643f079a67e44
6
- README.zh.md: 0db2ac1bccbdc4793c488e1ce621ee5c674d9895
6
+ README.zh.md: bf47fa2bca6f685fc52ca6ff786439a8d51230fc
package/README.zh.md CHANGED
@@ -38,7 +38,7 @@
38
38
 
39
39
  ## 模型体验
40
40
 
41
- 无。该包(package)在浏览器中渲染纯 React 原子组件;这里没有任何内容进入模型请求。
41
+ 无。该包在浏览器中渲染纯 React 原子组件;这里没有任何内容进入模型请求。
42
42
 
43
43
  #### KV Cache 影响
44
44
 
package/lib/index.js CHANGED
@@ -102,6 +102,21 @@ const IconSearchOutline16 = ({ size = 16, className }) => jsxs("svg", {
102
102
  fill: "currentColor"
103
103
  })]
104
104
  });
105
+ /** ic_ds_globe_outline_14 — meridian globe (harness-only figma extract). */
106
+ const IconGlobeOutline14 = ({ size = 14, className }) => jsx("svg", {
107
+ width: size,
108
+ height: size,
109
+ className,
110
+ viewBox: "0 0 14 14",
111
+ fill: "none",
112
+ xmlns: "http://www.w3.org/2000/svg",
113
+ children: jsx("path", {
114
+ fillRule: "evenodd",
115
+ clipRule: "evenodd",
116
+ d: "M7.00018 0.353516C10.6708 0.353535 13.6468 3.32958 13.6469 7.00018C13.6468 10.6708 10.6708 13.6468 7.00018 13.6469C3.32957 13.6468 0.353535 10.6708 0.353516 7.00018C0.353535 3.32957 3.32957 0.353531 7.00018 0.353516ZM5.44643 7.59661C5.49463 8.97506 5.70762 10.191 6.02136 11.0793C6.20141 11.5891 6.40328 11.9585 6.59898 12.1889C6.79501 12.4196 6.93213 12.454 7.00018 12.454C7.06822 12.454 7.20533 12.4197 7.40138 12.1889C7.59708 11.9585 7.79895 11.589 7.979 11.0793C8.29274 10.191 8.50574 8.97506 8.55394 7.59661H5.44643ZM1.57861 7.59661C1.80785 9.70467 3.2386 11.4509 5.1715 12.1388C5.07135 11.9317 4.97972 11.7098 4.89746 11.477C4.53084 10.4391 4.30224 9.0828 4.25357 7.59661H1.57861ZM9.74679 7.59661C9.69813 9.0828 9.46952 10.4391 9.1029 11.477C9.0206 11.7099 8.92818 11.9316 8.82797 12.1388C10.7613 11.4511 12.1925 9.70496 12.4218 7.59661H9.74679ZM5.1706 1.8616C3.23814 2.54963 1.80876 4.29604 1.5795 6.40376H4.25357C4.30224 4.91756 4.53083 3.56129 4.89746 2.5234C4.97968 2.29066 5.07051 2.0686 5.1706 1.8616ZM7.00018 1.54637C6.93213 1.54638 6.79503 1.5807 6.59898 1.81145C6.40332 2.04177 6.20139 2.41058 6.02136 2.92012C5.70754 3.80851 5.49461 5.02499 5.44643 6.40376H8.55394C8.50575 5.025 8.29282 3.80851 7.979 2.92012C7.79898 2.41059 7.59705 2.04177 7.40138 1.81145C7.20531 1.58067 7.06823 1.54637 7.00018 1.54637ZM8.82887 1.8616C8.92902 2.0687 9.02064 2.29053 9.1029 2.5234C9.46953 3.56129 9.69812 4.91756 9.74679 6.40376H12.4209C12.1916 4.29575 10.7618 2.54943 8.82887 1.8616Z",
117
+ fill: "currentColor"
118
+ })
119
+ });
105
120
  /** ic_ds_settings_outline_14 */
106
121
  const IconSettingsOutline14 = ({ size = 14, className }) => jsxs("svg", {
107
122
  width: size,
@@ -855,6 +870,35 @@ const IconCodeOutline16 = ({ size = 16, className }) => jsx("svg", {
855
870
  fill: "currentColor"
856
871
  })
857
872
  });
873
+ /** ic_ds_cordis_plugin_outline_14 */
874
+ const IconCordisPluginOutline14 = ({ size = 14, className }) => jsxs("svg", {
875
+ width: size,
876
+ height: size,
877
+ className,
878
+ viewBox: "0 0 14 14",
879
+ fill: "none",
880
+ xmlns: "http://www.w3.org/2000/svg",
881
+ children: [jsxs("g", {
882
+ clipPath: "url(#clip0_1840_45990)",
883
+ children: [jsx("path", {
884
+ d: "M3.03426 5.66661L1.70084 7.00003L3.0315 8.33069L2.14762 9.21457L-0.0669245 7.00003L2.15038 4.78273L3.03426 5.66661ZM7 14.067L4.77924 11.8462L5.66313 10.9623L7 12.2992L8.33342 10.9658L9.2173 11.8496L7 14.067ZM11.8489 9.21803L10.965 8.33414L12.2992 7.00003L10.9623 5.66316L11.8462 4.77927L14.0669 7.00003L11.8489 9.21803ZM8.33066 3.03153L7 1.70087L5.66589 3.03498L4.782 2.1511L7 -0.0668945L9.21454 2.14765L8.33066 3.03153Z",
885
+ fill: "currentColor"
886
+ }), jsx("rect", {
887
+ x: "5.98535",
888
+ y: "5.98535",
889
+ width: "2.02942",
890
+ height: "2.02942",
891
+ fill: "currentColor"
892
+ })]
893
+ }), jsx("defs", { children: jsx("clipPath", {
894
+ id: "clip0_1840_45990",
895
+ children: jsx("rect", {
896
+ width: "14",
897
+ height: "14",
898
+ fill: "currentColor"
899
+ })
900
+ }) })]
901
+ });
858
902
  /** ic_ds_api_outline (figma extract) */
859
903
  const IconApiOutline14 = ({ size = 14, className }) => jsxs("svg", {
860
904
  width: size,
@@ -1453,6 +1497,7 @@ const MEASURE_STYLE = {
1453
1497
  * @param props.anchor - the trigger element (rendered in place).
1454
1498
  * @param props.items - selectable rows and optional separators.
1455
1499
  * @param props.selectedId - row shown as selected.
1500
+ * @param props.selectedIds - rows shown as selected when a menu contains independent option groups.
1456
1501
  * @param props.onSelect - row click callback (not called for disabled rows or submenu parents that only open children).
1457
1502
  * @param props.onClose - invoked on outside click or Escape.
1458
1503
  * @param props.align - list alignment against the anchor (default 'start').
@@ -1465,6 +1510,7 @@ const MEASURE_STYLE = {
1465
1510
  * both trigger and list for the pointer grace (default false keeps it open
1466
1511
  * until outside click/Escape/selection). The grace makes the 4px trigger->list
1467
1512
  * gap and a brief overshoot survivable; coming back cancels the close.
1513
+ * @param props.dense - reduce vertical row spacing without changing the standard typography or card width.
1468
1514
  * @param props.compact - use reduced menu typography and spacing.
1469
1515
  * @param props.getAnchorRect - portal mode only: supply the anchor rect
1470
1516
  * directly (e.g. from a host-owned trigger button) instead of measuring the
@@ -1476,7 +1522,7 @@ const MEASURE_STYLE = {
1476
1522
  * by a hairline; they stay visible while the items above scroll.
1477
1523
  * @returns anchor wrapper with the conditional list.
1478
1524
  */
1479
- function Menu({ open, anchor, items, selectedId, onSelect, onClose, align = "start", side = "bottom", portal = false, closeOnPointerLeave = false, compact = false, getAnchorRect, footer, className }) {
1525
+ function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose, align = "start", side = "bottom", portal = false, closeOnPointerLeave = false, dense = false, compact = false, getAnchorRect, footer, className }) {
1480
1526
  const rootRef = useRef(null);
1481
1527
  const listRef = useRef(null);
1482
1528
  const [openSubmenuId, setOpenSubmenuId] = useState(null);
@@ -1570,6 +1616,7 @@ function Menu({ open, anchor, items, selectedId, onSelect, onClose, align = "sta
1570
1616
  }, entry.id);
1571
1617
  const hasSub = entry.submenu !== void 0 && entry.submenu.length > 0;
1572
1618
  const subOpen = hasSub && openSubmenuId === entry.id;
1619
+ const selected = entry.id === selectedId || selectedIds?.includes(entry.id) === true;
1573
1620
  return jsxs("div", {
1574
1621
  className: Menu_module_css_default.itemWrap,
1575
1622
  onMouseEnter: () => {
@@ -1581,7 +1628,7 @@ function Menu({ open, anchor, items, selectedId, onSelect, onClose, align = "sta
1581
1628
  children: [jsxs("button", {
1582
1629
  type: "button",
1583
1630
  role: "menuitem",
1584
- className: clsx(Menu_module_css_default.item, entry.id === selectedId && Menu_module_css_default.selected, entry.danger === true && Menu_module_css_default.danger),
1631
+ className: clsx(Menu_module_css_default.item, selected && Menu_module_css_default.selected, entry.danger === true && Menu_module_css_default.danger),
1585
1632
  disabled: entry.disabled,
1586
1633
  "aria-haspopup": hasSub ? "menu" : void 0,
1587
1634
  "aria-expanded": hasSub ? subOpen : void 0,
@@ -1604,7 +1651,7 @@ function Menu({ open, anchor, items, selectedId, onSelect, onClose, align = "sta
1604
1651
  className: Menu_module_css_default.itemLabel,
1605
1652
  children: entry.label
1606
1653
  }),
1607
- entry.id === selectedId && jsx(IconCheckOutline16, { className: Menu_module_css_default.check })
1654
+ selected && jsx(IconCheckOutline16, { className: Menu_module_css_default.check })
1608
1655
  ]
1609
1656
  }), subOpen && entry.submenu !== void 0 && jsx("div", {
1610
1657
  className: clsx(Menu_module_css_default.submenu, compact && Menu_module_css_default.compactList),
@@ -1630,7 +1677,7 @@ function Menu({ open, anchor, items, selectedId, onSelect, onClose, align = "sta
1630
1677
  };
1631
1678
  const list = open && jsxs("div", {
1632
1679
  ref: listRef,
1633
- className: clsx(Menu_module_css_default.list, compact && Menu_module_css_default.compactList, scrollable && Menu_module_css_default.scrollable, portal && Menu_module_css_default.portal, side === "top" && !portal && Menu_module_css_default.sideTop, align === "end" && !portal && Menu_module_css_default.alignEnd),
1680
+ className: clsx(Menu_module_css_default.list, dense && Menu_module_css_default.denseList, compact && Menu_module_css_default.compactList, scrollable && Menu_module_css_default.scrollable, portal && Menu_module_css_default.portal, side === "top" && !portal && Menu_module_css_default.sideTop, align === "end" && !portal && Menu_module_css_default.alignEnd),
1634
1681
  style: portal ? fixedPos ?? MEASURE_STYLE : void 0,
1635
1682
  role: "menu",
1636
1683
  onClick: (e) => {
@@ -5805,4 +5852,4 @@ function extractMarkdownPlainText(markdown, options = {}) {
5805
5852
  }
5806
5853
  }
5807
5854
  //#endregion
5808
- export { BrandWordmark, Button, CodeBlock, ConnectionBanner, DEFAULT_DIFF_MAX_LINES, DEFAULT_READ_MAX_LINES, DEFAULT_SEARCH_MAX_LINES, DEFAULT_TERMINAL_MAX_LINES, DiffBlock, DisclosureRow, FishLogo, HoverCard, IconAgentPresetOutline16, IconApiOutline14, IconArchiveOutline20, IconBranchOutline16, IconBrowseOutline16, IconCheckOutline14, IconCheckOutline16, IconChecklistOutline14, IconChevronDownOutline14, IconChevronLeftOutline14, IconChevronRightOutline14, IconChevronUpOutline14, IconCloseFill14, IconCloseOutline16, IconCodeOutline16, IconCopyOutline16, IconDarkOutline16, IconDataOutline16, IconDislikeFill16, IconDislikeOutline16, IconDownloadOutline16, IconEditOutline16, IconEllipsisOutline16, IconEnhanceOutline16, IconFolderClose16, IconFolderOpen16, IconFolderOpenOutline16, IconFollowsystemOutline16, IconFullscreenOutline16, IconGoalOutline16, IconInspectOutline12, IconLightOutline16, IconLikeFill16, IconLikeOutline16, IconLinkOutline14, IconLinkOutline16, IconListPenOutline16, IconLoadingOutline16, IconNewChatOutline16, IconPanelLeftOutline16, IconPaperclipOutline16, IconPauseOutline16, IconPersonalizationOutline16, IconPlayOutline16, IconPlusOutline16, IconProjectAddOutline16, IconQuestionOutline14, IconQueueOutline14, IconRefreshOutline14, IconRefreshOutline16, IconRightUpOutline14, IconRightUpOutline16, IconSearchOutline16, IconSendOutline14, IconSendOutline16, IconSettingsOutline14, IconSettingsOutline16, IconShareOutline16, IconSkillOutline16, IconSparkle16, IconStopFill16, IconThinkOutline14, IconThinkOutline16, IconTrashOutline16, IconTreeCorner8x10, IconTriangleRightFill14, IconUserOutline16, IconWarningOutline16, Input, JsonBlock, JsonTree, MarkdownText, Menu, MessageText, Modal, OnboardingSurface, Pill, ReadBlock, RiskConfirmation, SearchBlock, StateDot, TerminalBlock, Toast, Tooltip, WebBlock, extractMarkdownPlainText, useAnchoredMaxHeight, writeClipboard };
5855
+ export { BrandWordmark, Button, CodeBlock, ConnectionBanner, DEFAULT_DIFF_MAX_LINES, DEFAULT_READ_MAX_LINES, DEFAULT_SEARCH_MAX_LINES, DEFAULT_TERMINAL_MAX_LINES, DiffBlock, DisclosureRow, FishLogo, HoverCard, IconAgentPresetOutline16, IconApiOutline14, IconArchiveOutline20, IconBranchOutline16, IconBrowseOutline16, IconCheckOutline14, IconCheckOutline16, IconChecklistOutline14, IconChevronDownOutline14, IconChevronLeftOutline14, IconChevronRightOutline14, IconChevronUpOutline14, IconCloseFill14, IconCloseOutline16, IconCodeOutline16, IconCopyOutline16, IconCordisPluginOutline14, IconDarkOutline16, IconDataOutline16, IconDislikeFill16, IconDislikeOutline16, IconDownloadOutline16, IconEditOutline16, IconEllipsisOutline16, IconEnhanceOutline16, IconFolderClose16, IconFolderOpen16, IconFolderOpenOutline16, IconFollowsystemOutline16, IconFullscreenOutline16, IconGlobeOutline14, IconGoalOutline16, IconInspectOutline12, IconLightOutline16, IconLikeFill16, IconLikeOutline16, IconLinkOutline14, IconLinkOutline16, IconListPenOutline16, IconLoadingOutline16, IconNewChatOutline16, IconPanelLeftOutline16, IconPaperclipOutline16, IconPauseOutline16, IconPersonalizationOutline16, IconPlayOutline16, IconPlusOutline16, IconProjectAddOutline16, IconQuestionOutline14, IconQueueOutline14, IconRefreshOutline14, IconRefreshOutline16, IconRightUpOutline14, IconRightUpOutline16, IconSearchOutline16, IconSendOutline14, IconSendOutline16, IconSettingsOutline14, IconSettingsOutline16, IconShareOutline16, IconSkillOutline16, IconSparkle16, IconStopFill16, IconThinkOutline14, IconThinkOutline16, IconTrashOutline16, IconTreeCorner8x10, IconTriangleRightFill14, IconUserOutline16, IconWarningOutline16, Input, JsonBlock, JsonTree, MarkdownText, Menu, MessageText, Modal, OnboardingSurface, Pill, ReadBlock, RiskConfirmation, SearchBlock, StateDot, TerminalBlock, Toast, Tooltip, WebBlock, extractMarkdownPlainText, useAnchoredMaxHeight, writeClipboard };
@@ -30,6 +30,7 @@ export type MenuEntry = MenuItem | MenuSeparator | MenuLabel;
30
30
  * @param props.anchor - the trigger element (rendered in place).
31
31
  * @param props.items - selectable rows and optional separators.
32
32
  * @param props.selectedId - row shown as selected.
33
+ * @param props.selectedIds - rows shown as selected when a menu contains independent option groups.
33
34
  * @param props.onSelect - row click callback (not called for disabled rows or submenu parents that only open children).
34
35
  * @param props.onClose - invoked on outside click or Escape.
35
36
  * @param props.align - list alignment against the anchor (default 'start').
@@ -42,6 +43,7 @@ export type MenuEntry = MenuItem | MenuSeparator | MenuLabel;
42
43
  * both trigger and list for the pointer grace (default false keeps it open
43
44
  * until outside click/Escape/selection). The grace makes the 4px trigger->list
44
45
  * gap and a brief overshoot survivable; coming back cancels the close.
46
+ * @param props.dense - reduce vertical row spacing without changing the standard typography or card width.
45
47
  * @param props.compact - use reduced menu typography and spacing.
46
48
  * @param props.getAnchorRect - portal mode only: supply the anchor rect
47
49
  * directly (e.g. from a host-owned trigger button) instead of measuring the
@@ -53,18 +55,20 @@ export type MenuEntry = MenuItem | MenuSeparator | MenuLabel;
53
55
  * by a hairline; they stay visible while the items above scroll.
54
56
  * @returns anchor wrapper with the conditional list.
55
57
  */
56
- export declare function Menu({ open, anchor, items, selectedId, onSelect, onClose, align, side, portal, closeOnPointerLeave, compact, getAnchorRect, footer, className }: {
58
+ export declare function Menu({ open, anchor, items, selectedId, selectedIds, onSelect, onClose, align, side, portal, closeOnPointerLeave, dense, compact, getAnchorRect, footer, className }: {
57
59
  open: boolean;
58
60
  anchor: ReactNode;
59
61
  items: readonly MenuEntry[];
60
62
  footer?: readonly MenuEntry[];
61
63
  selectedId?: string | undefined;
64
+ selectedIds?: readonly string[] | undefined;
62
65
  onSelect: (id: string) => void;
63
66
  onClose: () => void;
64
67
  align?: 'start' | 'end';
65
68
  side?: 'bottom' | 'top' | 'right';
66
69
  portal?: boolean;
67
70
  closeOnPointerLeave?: boolean;
71
+ dense?: boolean;
68
72
  compact?: boolean;
69
73
  getAnchorRect?: () => DOMRect | null;
70
74
  className?: string;
@@ -9,6 +9,8 @@ export type { IconProps } from './props.ts';
9
9
  export declare const IconNewChatOutline16: ({ size, className }: IconProps) => import("react").JSX.Element;
10
10
  /** ic_ds_search_outline_16 */
11
11
  export declare const IconSearchOutline16: ({ size, className }: IconProps) => import("react").JSX.Element;
12
+ /** ic_ds_globe_outline_14 — meridian globe (harness-only figma extract). */
13
+ export declare const IconGlobeOutline14: ({ size, className }: IconProps) => import("react").JSX.Element;
12
14
  /** ic_ds_settings_outline_14 */
13
15
  export declare const IconSettingsOutline14: ({ size, className }: IconProps) => import("react").JSX.Element;
14
16
  /** ic_ds_settings_outline_16 */
@@ -99,6 +101,8 @@ export declare const IconPauseOutline16: ({ size, className }: IconProps) => imp
99
101
  export declare const IconFullscreenOutline16: ({ size, className }: IconProps) => import("react").JSX.Element;
100
102
  /** ic_ds_code_outline_16 */
101
103
  export declare const IconCodeOutline16: ({ size, className }: IconProps) => import("react").JSX.Element;
104
+ /** ic_ds_cordis_plugin_outline_14 */
105
+ export declare const IconCordisPluginOutline14: ({ size, className }: IconProps) => import("react").JSX.Element;
102
106
  /** ic_ds_api_outline (figma extract) */
103
107
  export declare const IconApiOutline14: ({ size, className }: IconProps) => import("react").JSX.Element;
104
108
  /** ic_ds_personalization_outline_16 (figma extract) */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-client-ui-primitives",
3
3
  "description": "Pure React atoms for the dsh web UI: controls, icons, markdown, and JSON inspectors (zero cordis)",
4
- "version": "0.0.1-rc.2",
4
+ "version": "0.0.1-rc.3",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -51,8 +51,8 @@
51
51
  "devDependencies": {
52
52
  "@types/react": "~18.3.1",
53
53
  "@types/react-dom": "~18.3.0",
54
- "@deepseek-ai/cordis": "^4.0.1-rc.1",
55
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2"
54
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
55
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
56
56
  },
57
57
  "files": [
58
58
  "lib/index.js",
@@ -60,7 +60,7 @@
60
60
  "lib/types/**/*.d.ts"
61
61
  ],
62
62
  "peerDependencies": {
63
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
64
- "@deepseek-ai/cordis": "^4.0.1-rc.1"
63
+ "@deepseek-ai/cordis": "^4.0.1-rc.1",
64
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3"
65
65
  }
66
66
  }