dsh-plugin-core 0.2.13 → 0.3.0

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.
Files changed (431) hide show
  1. package/README.md +52 -83
  2. package/dist/design/tokens-css.d.ts +1 -1
  3. package/dist/design/tokens-css.d.ts.map +1 -1
  4. package/dist/design/tokens-css.generated.d.ts +2 -0
  5. package/dist/design/tokens-css.generated.d.ts.map +1 -0
  6. package/dist/design/tokens-css.generated.js +4 -0
  7. package/dist/design/tokens-css.generated.js.map +1 -0
  8. package/dist/design/tokens-css.js +1 -252
  9. package/dist/design/tokens-css.js.map +1 -1
  10. package/dist/explorer/FileBrowser.d.ts +41 -0
  11. package/dist/explorer/FileBrowser.d.ts.map +1 -0
  12. package/dist/explorer/FileBrowser.js +659 -0
  13. package/dist/explorer/FileBrowser.js.map +1 -0
  14. package/dist/explorer/explorer-css.d.ts +1 -1
  15. package/dist/explorer/explorer-css.d.ts.map +1 -1
  16. package/dist/explorer/explorer-css.generated.d.ts +2 -0
  17. package/dist/explorer/explorer-css.generated.d.ts.map +1 -0
  18. package/dist/explorer/explorer-css.generated.js +4 -0
  19. package/dist/explorer/explorer-css.generated.js.map +1 -0
  20. package/dist/explorer/explorer-css.js +1 -31
  21. package/dist/explorer/explorer-css.js.map +1 -1
  22. package/dist/explorer/index.d.ts +4 -2
  23. package/dist/explorer/index.d.ts.map +1 -1
  24. package/dist/explorer/index.js +4 -2
  25. package/dist/explorer/index.js.map +1 -1
  26. package/dist/explorer/open.d.ts +103 -0
  27. package/dist/explorer/open.d.ts.map +1 -0
  28. package/dist/explorer/open.js +282 -0
  29. package/dist/explorer/open.js.map +1 -0
  30. package/dist/explorer/preview/BytesPreview.d.ts +13 -0
  31. package/dist/explorer/preview/BytesPreview.d.ts.map +1 -0
  32. package/dist/explorer/preview/BytesPreview.js +56 -0
  33. package/dist/explorer/preview/BytesPreview.js.map +1 -0
  34. package/dist/explorer/preview/HtmlPreview.d.ts +18 -0
  35. package/dist/explorer/preview/HtmlPreview.d.ts.map +1 -0
  36. package/dist/explorer/preview/HtmlPreview.js +112 -0
  37. package/dist/explorer/preview/HtmlPreview.js.map +1 -0
  38. package/dist/explorer/preview/OfficePreview.d.ts +11 -0
  39. package/dist/explorer/preview/OfficePreview.d.ts.map +1 -0
  40. package/dist/explorer/preview/OfficePreview.js +53 -0
  41. package/dist/explorer/preview/OfficePreview.js.map +1 -0
  42. package/dist/explorer/preview/TextPreview.d.ts +17 -0
  43. package/dist/explorer/preview/TextPreview.d.ts.map +1 -0
  44. package/dist/explorer/preview/TextPreview.js +95 -0
  45. package/dist/explorer/preview/TextPreview.js.map +1 -0
  46. package/dist/explorer/preview/index.d.ts +10 -3
  47. package/dist/explorer/preview/index.d.ts.map +1 -1
  48. package/dist/explorer/preview/index.js +52 -55
  49. package/dist/explorer/preview/index.js.map +1 -1
  50. package/dist/explorer/preview/md-labels.d.ts +3 -0
  51. package/dist/explorer/preview/md-labels.d.ts.map +1 -0
  52. package/dist/explorer/preview/md-labels.js +12 -0
  53. package/dist/explorer/preview/md-labels.js.map +1 -0
  54. package/dist/explorer/types.d.ts +186 -4
  55. package/dist/explorer/types.d.ts.map +1 -1
  56. package/dist/explorer/types.js +401 -14
  57. package/dist/explorer/types.js.map +1 -1
  58. package/dist/host/index.d.ts +66 -0
  59. package/dist/host/index.d.ts.map +1 -0
  60. package/dist/host/index.js +60 -0
  61. package/dist/host/index.js.map +1 -0
  62. package/dist/session/SessionViewModal.d.ts +42 -0
  63. package/dist/session/SessionViewModal.d.ts.map +1 -0
  64. package/dist/session/SessionViewModal.js +997 -0
  65. package/dist/session/SessionViewModal.js.map +1 -0
  66. package/dist/session/changes.d.ts +73 -0
  67. package/dist/session/changes.d.ts.map +1 -0
  68. package/dist/session/changes.js +134 -0
  69. package/dist/session/changes.js.map +1 -0
  70. package/dist/session/faces.d.ts +198 -0
  71. package/dist/session/faces.d.ts.map +1 -0
  72. package/dist/session/faces.js +17 -0
  73. package/dist/session/faces.js.map +1 -0
  74. package/dist/session/index.d.ts +5 -23
  75. package/dist/session/index.d.ts.map +1 -1
  76. package/dist/session/index.js +25 -70
  77. package/dist/session/index.js.map +1 -1
  78. package/dist/session/mirror/ChangedFileDiff.d.ts +22 -0
  79. package/dist/session/mirror/ChangedFileDiff.d.ts.map +1 -0
  80. package/dist/session/mirror/ChangedFileDiff.js +157 -0
  81. package/dist/session/mirror/ChangedFileDiff.js.map +1 -0
  82. package/dist/session/mirror/ChangedFilesCard.d.ts +18 -0
  83. package/dist/session/mirror/ChangedFilesCard.d.ts.map +1 -0
  84. package/dist/session/mirror/ChangedFilesCard.js +158 -0
  85. package/dist/session/mirror/ChangedFilesCard.js.map +1 -0
  86. package/dist/session/mirror/ChatGroupSeat.d.ts +24 -0
  87. package/dist/session/mirror/ChatGroupSeat.d.ts.map +1 -0
  88. package/dist/session/mirror/ChatGroupSeat.js +134 -0
  89. package/dist/session/mirror/ChatGroupSeat.js.map +1 -0
  90. package/dist/session/mirror/ChatNodeSeat.d.ts +43 -0
  91. package/dist/session/mirror/ChatNodeSeat.d.ts.map +1 -0
  92. package/dist/session/mirror/ChatNodeSeat.js +133 -0
  93. package/dist/session/mirror/ChatNodeSeat.js.map +1 -0
  94. package/dist/session/mirror/ChatView.d.ts +47 -0
  95. package/dist/session/mirror/ChatView.d.ts.map +1 -0
  96. package/dist/session/mirror/ChatView.js +127 -0
  97. package/dist/session/mirror/ChatView.js.map +1 -0
  98. package/dist/session/mirror/CommandCard.d.ts +20 -0
  99. package/dist/session/mirror/CommandCard.d.ts.map +1 -0
  100. package/dist/session/mirror/CommandCard.js +69 -0
  101. package/dist/session/mirror/CommandCard.js.map +1 -0
  102. package/dist/session/mirror/Deliverables.d.ts +24 -0
  103. package/dist/session/mirror/Deliverables.d.ts.map +1 -0
  104. package/dist/session/mirror/Deliverables.js +134 -0
  105. package/dist/session/mirror/Deliverables.js.map +1 -0
  106. package/dist/session/mirror/GenericCommandCard.d.ts +25 -0
  107. package/dist/session/mirror/GenericCommandCard.d.ts.map +1 -0
  108. package/dist/session/mirror/GenericCommandCard.js +567 -0
  109. package/dist/session/mirror/GenericCommandCard.js.map +1 -0
  110. package/dist/session/mirror/MessageIconActions.d.ts +16 -0
  111. package/dist/session/mirror/MessageIconActions.d.ts.map +1 -0
  112. package/dist/session/mirror/MessageIconActions.js +71 -0
  113. package/dist/session/mirror/MessageIconActions.js.map +1 -0
  114. package/dist/session/mirror/MessageItem.d.ts +66 -0
  115. package/dist/session/mirror/MessageItem.d.ts.map +1 -0
  116. package/dist/session/mirror/MessageItem.js +135 -0
  117. package/dist/session/mirror/MessageItem.js.map +1 -0
  118. package/dist/session/mirror/ReasoningRow.d.ts +11 -0
  119. package/dist/session/mirror/ReasoningRow.d.ts.map +1 -0
  120. package/dist/session/mirror/ReasoningRow.js +49 -0
  121. package/dist/session/mirror/ReasoningRow.js.map +1 -0
  122. package/dist/session/mirror/StatDialog.d.ts +20 -0
  123. package/dist/session/mirror/StatDialog.d.ts.map +1 -0
  124. package/dist/session/mirror/StatDialog.js +36 -0
  125. package/dist/session/mirror/StatDialog.js.map +1 -0
  126. package/dist/session/mirror/TurnProcessNodeView.d.ts +10 -0
  127. package/dist/session/mirror/TurnProcessNodeView.d.ts.map +1 -0
  128. package/dist/session/mirror/TurnProcessNodeView.js +68 -0
  129. package/dist/session/mirror/TurnProcessNodeView.js.map +1 -0
  130. package/dist/session/mirror/TurnTailNodeView.d.ts +32 -0
  131. package/dist/session/mirror/TurnTailNodeView.d.ts.map +1 -0
  132. package/dist/session/mirror/TurnTailNodeView.js +48 -0
  133. package/dist/session/mirror/TurnTailNodeView.js.map +1 -0
  134. package/dist/session/mirror/TurnTriggerNodeView.d.ts +14 -0
  135. package/dist/session/mirror/TurnTriggerNodeView.d.ts.map +1 -0
  136. package/dist/session/mirror/TurnTriggerNodeView.js +87 -0
  137. package/dist/session/mirror/TurnTriggerNodeView.js.map +1 -0
  138. package/dist/session/mirror/TurnUsagePanel.d.ts +21 -0
  139. package/dist/session/mirror/TurnUsagePanel.d.ts.map +1 -0
  140. package/dist/session/mirror/TurnUsagePanel.js +41 -0
  141. package/dist/session/mirror/TurnUsagePanel.js.map +1 -0
  142. package/dist/session/mirror/message-chrome.d.ts +33 -0
  143. package/dist/session/mirror/message-chrome.d.ts.map +1 -0
  144. package/dist/session/mirror/message-chrome.js +158 -0
  145. package/dist/session/mirror/message-chrome.js.map +1 -0
  146. package/dist/session/mirror/process-groups.d.ts +56 -0
  147. package/dist/session/mirror/process-groups.d.ts.map +1 -0
  148. package/dist/session/mirror/process-groups.js +202 -0
  149. package/dist/session/mirror/process-groups.js.map +1 -0
  150. package/dist/session/official-classes.d.ts +28 -0
  151. package/dist/session/official-classes.d.ts.map +1 -0
  152. package/dist/session/official-classes.js +146 -0
  153. package/dist/session/official-classes.js.map +1 -0
  154. package/dist/session/open-session-view.d.ts +17 -0
  155. package/dist/session/open-session-view.d.ts.map +1 -0
  156. package/dist/session/open-session-view.js +136 -0
  157. package/dist/session/open-session-view.js.map +1 -0
  158. package/dist/session/session-css.d.ts +1 -1
  159. package/dist/session/session-css.d.ts.map +1 -1
  160. package/dist/session/session-css.generated.d.ts +2 -0
  161. package/dist/session/session-css.generated.d.ts.map +1 -0
  162. package/dist/session/session-css.generated.js +4 -0
  163. package/dist/session/session-css.generated.js.map +1 -0
  164. package/dist/session/session-css.js +1 -17
  165. package/dist/session/session-css.js.map +1 -1
  166. package/dist/ui/AlertModal.d.ts +28 -0
  167. package/dist/ui/AlertModal.d.ts.map +1 -0
  168. package/dist/ui/AlertModal.js +29 -0
  169. package/dist/ui/AlertModal.js.map +1 -0
  170. package/dist/ui/Button.d.ts.map +1 -1
  171. package/dist/ui/Button.js +14 -1
  172. package/dist/ui/Button.js.map +1 -1
  173. package/dist/ui/Card.d.ts +4 -2
  174. package/dist/ui/Card.d.ts.map +1 -1
  175. package/dist/ui/Card.js +12 -6
  176. package/dist/ui/Card.js.map +1 -1
  177. package/dist/ui/Chip.d.ts +9 -1
  178. package/dist/ui/Chip.d.ts.map +1 -1
  179. package/dist/ui/Chip.js +8 -2
  180. package/dist/ui/Chip.js.map +1 -1
  181. package/dist/ui/CodeViewer.d.ts +36 -0
  182. package/dist/ui/CodeViewer.d.ts.map +1 -0
  183. package/dist/ui/CodeViewer.js +90 -0
  184. package/dist/ui/CodeViewer.js.map +1 -0
  185. package/dist/ui/ConfirmModal.d.ts +30 -0
  186. package/dist/ui/ConfirmModal.d.ts.map +1 -0
  187. package/dist/ui/ConfirmModal.js +23 -0
  188. package/dist/ui/ConfirmModal.js.map +1 -0
  189. package/dist/ui/DateTimePicker.d.ts +45 -0
  190. package/dist/ui/DateTimePicker.d.ts.map +1 -0
  191. package/dist/ui/DateTimePicker.js +447 -0
  192. package/dist/ui/DateTimePicker.js.map +1 -0
  193. package/dist/ui/Field.d.ts +11 -2
  194. package/dist/ui/Field.d.ts.map +1 -1
  195. package/dist/ui/Field.js +15 -5
  196. package/dist/ui/Field.js.map +1 -1
  197. package/dist/ui/MarqueeText.d.ts.map +1 -1
  198. package/dist/ui/MarqueeText.js +3 -1
  199. package/dist/ui/MarqueeText.js.map +1 -1
  200. package/dist/ui/Modal.d.ts +25 -3
  201. package/dist/ui/Modal.d.ts.map +1 -1
  202. package/dist/ui/Modal.js +41 -7
  203. package/dist/ui/Modal.js.map +1 -1
  204. package/dist/ui/ModelPicker.d.ts +25 -12
  205. package/dist/ui/ModelPicker.d.ts.map +1 -1
  206. package/dist/ui/ModelPicker.js +67 -19
  207. package/dist/ui/ModelPicker.js.map +1 -1
  208. package/dist/ui/PanelDock.d.ts +127 -0
  209. package/dist/ui/PanelDock.d.ts.map +1 -0
  210. package/dist/ui/PanelDock.js +297 -0
  211. package/dist/ui/PanelDock.js.map +1 -0
  212. package/dist/ui/Picker.d.ts +8 -2
  213. package/dist/ui/Picker.d.ts.map +1 -1
  214. package/dist/ui/Picker.js +86 -18
  215. package/dist/ui/Picker.js.map +1 -1
  216. package/dist/ui/SectionHead.d.ts +3 -3
  217. package/dist/ui/SectionHead.d.ts.map +1 -1
  218. package/dist/ui/SectionHead.js +4 -4
  219. package/dist/ui/SectionHead.js.map +1 -1
  220. package/dist/ui/Segmented.d.ts +2 -0
  221. package/dist/ui/Segmented.d.ts.map +1 -1
  222. package/dist/ui/Segmented.js +3 -1
  223. package/dist/ui/Segmented.js.map +1 -1
  224. package/dist/ui/Textarea.d.ts +2 -0
  225. package/dist/ui/Textarea.d.ts.map +1 -1
  226. package/dist/ui/Textarea.js +6 -1
  227. package/dist/ui/Textarea.js.map +1 -1
  228. package/dist/ui/Toast.d.ts +41 -8
  229. package/dist/ui/Toast.d.ts.map +1 -1
  230. package/dist/ui/Toast.js +216 -28
  231. package/dist/ui/Toast.js.map +1 -1
  232. package/dist/ui/WorkspacePicker.d.ts +15 -28
  233. package/dist/ui/WorkspacePicker.d.ts.map +1 -1
  234. package/dist/ui/WorkspacePicker.js +18 -27
  235. package/dist/ui/WorkspacePicker.js.map +1 -1
  236. package/dist/ui/card-css.d.ts +1 -1
  237. package/dist/ui/card-css.d.ts.map +1 -1
  238. package/dist/ui/card-css.generated.d.ts +2 -0
  239. package/dist/ui/card-css.generated.d.ts.map +1 -0
  240. package/dist/ui/card-css.generated.js +4 -0
  241. package/dist/ui/card-css.generated.js.map +1 -0
  242. package/dist/ui/card-css.js +1 -35
  243. package/dist/ui/card-css.js.map +1 -1
  244. package/dist/ui/chip-css.d.ts +1 -1
  245. package/dist/ui/chip-css.d.ts.map +1 -1
  246. package/dist/ui/chip-css.generated.d.ts +2 -0
  247. package/dist/ui/chip-css.generated.d.ts.map +1 -0
  248. package/dist/ui/chip-css.generated.js +4 -0
  249. package/dist/ui/chip-css.generated.js.map +1 -0
  250. package/dist/ui/chip-css.js +1 -17
  251. package/dist/ui/chip-css.js.map +1 -1
  252. package/dist/ui/code-viewer-css.d.ts +2 -0
  253. package/dist/ui/code-viewer-css.d.ts.map +1 -0
  254. package/dist/ui/code-viewer-css.generated.d.ts +2 -0
  255. package/dist/ui/code-viewer-css.generated.d.ts.map +1 -0
  256. package/dist/ui/code-viewer-css.generated.js +4 -0
  257. package/dist/ui/code-viewer-css.generated.js.map +1 -0
  258. package/dist/ui/code-viewer-css.js +3 -0
  259. package/dist/ui/code-viewer-css.js.map +1 -0
  260. package/dist/ui/code-viewer-lang.d.ts +15 -0
  261. package/dist/ui/code-viewer-lang.d.ts.map +1 -0
  262. package/dist/ui/code-viewer-lang.js +190 -0
  263. package/dist/ui/code-viewer-lang.js.map +1 -0
  264. package/dist/ui/code-viewer-theme.d.ts +5 -0
  265. package/dist/ui/code-viewer-theme.d.ts.map +1 -0
  266. package/dist/ui/code-viewer-theme.js +138 -0
  267. package/dist/ui/code-viewer-theme.js.map +1 -0
  268. package/dist/ui/controls/back-to-top-css.generated.d.ts +2 -0
  269. package/dist/ui/controls/back-to-top-css.generated.d.ts.map +1 -0
  270. package/dist/ui/controls/back-to-top-css.generated.js +4 -0
  271. package/dist/ui/controls/back-to-top-css.generated.js.map +1 -0
  272. package/dist/ui/controls/button-css.generated.d.ts +2 -0
  273. package/dist/ui/controls/button-css.generated.d.ts.map +1 -0
  274. package/dist/ui/controls/button-css.generated.js +4 -0
  275. package/dist/ui/controls/button-css.generated.js.map +1 -0
  276. package/dist/ui/controls/datetime-css.generated.d.ts +2 -0
  277. package/dist/ui/controls/datetime-css.generated.d.ts.map +1 -0
  278. package/dist/ui/controls/datetime-css.generated.js +4 -0
  279. package/dist/ui/controls/datetime-css.generated.js.map +1 -0
  280. package/dist/ui/controls/field-css.generated.d.ts +2 -0
  281. package/dist/ui/controls/field-css.generated.d.ts.map +1 -0
  282. package/dist/ui/controls/field-css.generated.js +4 -0
  283. package/dist/ui/controls/field-css.generated.js.map +1 -0
  284. package/dist/ui/controls/hint-css.generated.d.ts +2 -0
  285. package/dist/ui/controls/hint-css.generated.d.ts.map +1 -0
  286. package/dist/ui/controls/hint-css.generated.js +4 -0
  287. package/dist/ui/controls/hint-css.generated.js.map +1 -0
  288. package/dist/ui/controls/loading-css.generated.d.ts +2 -0
  289. package/dist/ui/controls/loading-css.generated.d.ts.map +1 -0
  290. package/dist/ui/controls/loading-css.generated.js +4 -0
  291. package/dist/ui/controls/loading-css.generated.js.map +1 -0
  292. package/dist/ui/controls/segmented-css.generated.d.ts +2 -0
  293. package/dist/ui/controls/segmented-css.generated.d.ts.map +1 -0
  294. package/dist/ui/controls/segmented-css.generated.js +4 -0
  295. package/dist/ui/controls/segmented-css.generated.js.map +1 -0
  296. package/dist/ui/controls-css.d.ts +7 -8
  297. package/dist/ui/controls-css.d.ts.map +1 -1
  298. package/dist/ui/controls-css.js +13 -8
  299. package/dist/ui/controls-css.js.map +1 -1
  300. package/dist/ui/css.d.ts +5 -0
  301. package/dist/ui/css.d.ts.map +1 -1
  302. package/dist/ui/css.js +13 -4
  303. package/dist/ui/css.js.map +1 -1
  304. package/dist/ui/datetime-logic.d.ts +100 -0
  305. package/dist/ui/datetime-logic.d.ts.map +1 -0
  306. package/dist/ui/datetime-logic.js +193 -0
  307. package/dist/ui/datetime-logic.js.map +1 -0
  308. package/dist/ui/feedback-css.d.ts +1 -1
  309. package/dist/ui/feedback-css.d.ts.map +1 -1
  310. package/dist/ui/feedback-css.generated.d.ts +2 -0
  311. package/dist/ui/feedback-css.generated.d.ts.map +1 -0
  312. package/dist/ui/feedback-css.generated.js +4 -0
  313. package/dist/ui/feedback-css.generated.js.map +1 -0
  314. package/dist/ui/feedback-css.js +1 -53
  315. package/dist/ui/feedback-css.js.map +1 -1
  316. package/dist/ui/host-data.d.ts +103 -0
  317. package/dist/ui/host-data.d.ts.map +1 -0
  318. package/dist/ui/host-data.js +106 -0
  319. package/dist/ui/host-data.js.map +1 -0
  320. package/dist/ui/host-toast.d.ts +23 -0
  321. package/dist/ui/host-toast.d.ts.map +1 -0
  322. package/dist/ui/host-toast.js +34 -0
  323. package/dist/ui/host-toast.js.map +1 -0
  324. package/dist/ui/index.d.ts +12 -6
  325. package/dist/ui/index.d.ts.map +1 -1
  326. package/dist/ui/index.js +10 -4
  327. package/dist/ui/index.js.map +1 -1
  328. package/dist/ui/marquee-css.d.ts +2 -0
  329. package/dist/ui/marquee-css.d.ts.map +1 -0
  330. package/dist/ui/marquee-css.generated.d.ts +2 -0
  331. package/dist/ui/marquee-css.generated.d.ts.map +1 -0
  332. package/dist/ui/marquee-css.generated.js +4 -0
  333. package/dist/ui/marquee-css.generated.js.map +1 -0
  334. package/dist/ui/marquee-css.js +4 -0
  335. package/dist/ui/marquee-css.js.map +1 -0
  336. package/dist/ui/modal-host.d.ts +30 -0
  337. package/dist/ui/modal-host.d.ts.map +1 -0
  338. package/dist/ui/modal-host.js +101 -0
  339. package/dist/ui/modal-host.js.map +1 -0
  340. package/dist/ui/official.d.ts.map +1 -1
  341. package/dist/ui/official.js +45 -1
  342. package/dist/ui/official.js.map +1 -1
  343. package/dist/ui/panel-dock-css.d.ts +2 -0
  344. package/dist/ui/panel-dock-css.d.ts.map +1 -0
  345. package/dist/ui/panel-dock-css.generated.d.ts +2 -0
  346. package/dist/ui/panel-dock-css.generated.d.ts.map +1 -0
  347. package/dist/ui/panel-dock-css.generated.js +4 -0
  348. package/dist/ui/panel-dock-css.generated.js.map +1 -0
  349. package/dist/ui/panel-dock-css.js +4 -0
  350. package/dist/ui/panel-dock-css.js.map +1 -0
  351. package/dist/ui/panel-dock-logic.d.ts +50 -0
  352. package/dist/ui/panel-dock-logic.d.ts.map +1 -0
  353. package/dist/ui/panel-dock-logic.js +64 -0
  354. package/dist/ui/panel-dock-logic.js.map +1 -0
  355. package/dist/ui/picker-css.d.ts +1 -1
  356. package/dist/ui/picker-css.d.ts.map +1 -1
  357. package/dist/ui/picker-css.generated.d.ts +2 -0
  358. package/dist/ui/picker-css.generated.d.ts.map +1 -0
  359. package/dist/ui/picker-css.generated.js +4 -0
  360. package/dist/ui/picker-css.generated.js.map +1 -0
  361. package/dist/ui/picker-css.js +1 -48
  362. package/dist/ui/picker-css.js.map +1 -1
  363. package/dist/ui/picker-icons.d.ts +12 -0
  364. package/dist/ui/picker-icons.d.ts.map +1 -0
  365. package/dist/ui/picker-icons.js +29 -0
  366. package/dist/ui/picker-icons.js.map +1 -0
  367. package/dist/ui/picker-logic.d.ts +4 -1
  368. package/dist/ui/picker-logic.d.ts.map +1 -1
  369. package/dist/ui/picker-logic.js +1 -2
  370. package/dist/ui/picker-logic.js.map +1 -1
  371. package/dist/ui/resizer.d.ts +3 -1
  372. package/dist/ui/resizer.d.ts.map +1 -1
  373. package/dist/ui/resizer.js +1 -1
  374. package/dist/ui/resizer.js.map +1 -1
  375. package/dist/ui/toast-host.d.ts +24 -0
  376. package/dist/ui/toast-host.d.ts.map +1 -0
  377. package/dist/ui/toast-host.js +20 -0
  378. package/dist/ui/toast-host.js.map +1 -0
  379. package/dist/utils/date.d.ts +8 -0
  380. package/dist/utils/date.d.ts.map +1 -1
  381. package/dist/utils/date.js +16 -0
  382. package/dist/utils/date.js.map +1 -1
  383. package/dist/utils/i18n.d.ts +1 -1
  384. package/dist/utils/i18n.d.ts.map +1 -1
  385. package/dist/utils/i18n.js +437 -18
  386. package/dist/utils/i18n.js.map +1 -1
  387. package/dist/utils/index.d.ts +1 -1
  388. package/dist/utils/index.d.ts.map +1 -1
  389. package/dist/utils/index.js +1 -1
  390. package/dist/utils/index.js.map +1 -1
  391. package/dist/utils/path.d.ts.map +1 -1
  392. package/dist/utils/path.js +1 -0
  393. package/dist/utils/path.js.map +1 -1
  394. package/docs/README.md +12 -5
  395. package/docs/design/architecture.md +38 -8
  396. package/docs/design/copywriting.md +95 -0
  397. package/docs/design/doc-format.md +80 -0
  398. package/docs/design/doc-format.ts +39 -0
  399. package/docs/design/external/dsh-host.md +150 -1
  400. package/docs/design/features.md +4 -17
  401. package/docs/design/methods.md +13 -34
  402. package/docs/design/structure.md +25 -22
  403. package/docs/design/style.md +24 -50
  404. package/docs/help/design.doc.ts +112 -0
  405. package/docs/help/design.md +88 -0
  406. package/docs/help/explorer.doc.ts +136 -0
  407. package/docs/help/explorer.md +68 -0
  408. package/docs/help/index.doc.ts +79 -0
  409. package/docs/help/index.md +28 -0
  410. package/docs/help/integration.doc.ts +114 -0
  411. package/docs/help/integration.md +127 -0
  412. package/docs/help/methods.md +58 -0
  413. package/docs/help/session.doc.ts +154 -0
  414. package/docs/help/session.md +91 -0
  415. package/docs/help/style.md +80 -0
  416. package/docs/help/ui.doc.ts +404 -0
  417. package/docs/help/ui.md +342 -0
  418. package/docs/help/utils.doc.ts +133 -0
  419. package/docs/help/utils.md +96 -0
  420. package/docs/requirements.md +33 -12
  421. package/package.json +44 -3
  422. package/dist/ui/ErrorBoundary.d.ts +0 -22
  423. package/dist/ui/ErrorBoundary.d.ts.map +0 -1
  424. package/dist/ui/ErrorBoundary.js +0 -30
  425. package/dist/ui/ErrorBoundary.js.map +0 -1
  426. package/docs/design/features/design.md +0 -55
  427. package/docs/design/features/explorer.md +0 -73
  428. package/docs/design/features/session.md +0 -70
  429. package/docs/design/features/ui.md +0 -225
  430. package/docs/design/features/utils.md +0 -64
  431. package/docs/examples/integration.md +0 -103
@@ -0,0 +1,91 @@
1
+ <!-- 本文件由 scripts/gen-docs.mjs 自动生成,请勿手改;改对应的 .doc.ts 后重跑 node scripts/gen-docs.mjs -->
2
+
3
+ # session —— 会话预览
4
+
5
+ > EN: session — session preview
6
+
7
+ 导出:SessionViewModal、openSessionView
8
+
9
+ ## 会话预览
10
+
11
+ > EN: Session preview
12
+
13
+ 把一次会话渲染成**只读弹窗**,观感与官方会话页一致。先用 `openSessionView` 建数据链得到 `view`(不可解析返回 `null`),再交给 `SessionViewModal`;**关闭时必须 `view.dispose()`**。
14
+
15
+ > EN: Renders one session as a **read-only dialog** that looks like the official session page. First `openSessionView` builds the chain and returns a `view` (`null` when unresolvable), then hand it to `SessionViewModal`; **call `view.dispose()` on close**.
16
+
17
+ 数据全由调用方注入,组件不自己取。`archived` 从官方 `workspaces` 快照的 `archivedSessionIds` 读取并订阅刷新。归档会话走同一条链,同样可读。
18
+
19
+ > EN: All data is injected by the caller; the component fetches nothing. Read `archived` from `archivedSessionIds` on the official `workspaces` snapshot and keep it subscribed. Archived sessions travel the same chain and read fine.
20
+
21
+ 快照只读,框内不能打字续聊。续聊 = `forkSession` 开分支 + `openHostSession` 跳官方会话区;暂存输入框的确定走 `onContinue`(fork + 发首轮 + 跳转)。
22
+
23
+ > EN: The snapshot is read-only, so you cannot type inside the dialog. Continuing means `forkSession` + `openHostSession`; the staging input’s confirm goes through `onContinue` (fork + first turn + navigate).
24
+
25
+ 文件出口只有一个:工具卡路径、行内引用、交付卡都走 `onOpenFile`;不传则链接降级为纯文本。预览由调用方开在**页面右侧**(`openFilePreview` 的 dock),弹窗不需要任何遮罩参数。
26
+
27
+ > EN: There is exactly one file exit: tool-card paths, inline mentions and delivered cards all go through `onOpenFile`; without it links degrade to plain text. The caller opens the preview as a **page-level right column** (the `openFilePreview` dock) — the dialog takes no mask props.
28
+
29
+ 限制:官方样式未注入时回退自绘观感(功能不受影响);长会话一次全渲染,用「加载更早记录」向前翻页;👍👎 反馈走官方 slots,弹窗没有该插槽。
30
+
31
+ > EN: Limits: without official styles injected, the self-drawn look applies (functionality unaffected); long sessions render whole, paged backward via "load earlier"; 👍👎 feedback goes through official slots, which this dialog lacks.
32
+
33
+ | 参数 | 类型 | 必填 | 默认 | 说明(zh) | 说明(en) |
34
+ |---|---|---|---|---|---|
35
+ | `openSessionView` | `(sessions, uiConversation, id, retainSource?) => SessionViewTarget \| null` | 是 | — | 建数据链:retain → binding → open → target(chat);不可解析返回 null | Builds the chain retain → binding → open → target(chat); null when unresolvable |
36
+ | `target` | `SnapshotFace<ChatViewFace \| undefined>` | — | — | chat 快照订阅面(供 useSyncExternalStore) | Chat snapshot surface (for useSyncExternalStore) |
37
+ | `session` | `SnapshotFace<SessionSnapshotFace>` | — | — | 会话自身快照(加载态 / 是否翻尽) | Snapshot of the session itself (loading state, paged-out) |
38
+ | `loadOlder` | `() => void` | — | — | 向前翻一页更早的历史 | Page backward through older history |
39
+ | `dispose` | `() => void` | — | — | 释放 retain 引用;弹窗关闭必调 | Release the retain reference; call on close |
40
+
41
+ | 参数 | 类型 | 必填 | 默认 | 说明(zh) | 说明(en) |
42
+ |---|---|---|---|---|---|
43
+ | `sessionId` | `string` | 是 | — | 要预览的会话 | The session to preview |
44
+ | `view` | `SessionViewTarget` | 是 | — | openSessionView 的返回值 | What openSessionView returned |
45
+ | `onClose` | `() => void` | 是 | — | 关闭回调;由调用方在里面调 view.dispose() | Close callback; the caller calls view.dispose() inside it |
46
+ | `heading` | `string` | 否 | 「会话预览」 | 弹窗标题,通常传宿主 sessions.list 的 displayTitle;会话 id 显示在标题下方副标题行(等宽小字) | Dialog title, usually the displayTitle from the host sessions.list; the session id sits on the monospace subtitle line below it |
47
+ | `archived` | `boolean` | 否 | false | 已归档时标题旁显示归档徽标,且「继续对话」先弹 fork 确认框;未归档则直跳官方会话页 | When true an archive badge appears beside the title and "Continue" asks to fork first; when false it jumps straight to the official session page |
48
+ | `forkSession` | `(sessionId, atSeq?) => Promise<string>` | — | — | 开分支并返回子会话 id;缺 openHostSession 则不渲染「继续对话」 | Fork and resolve the child session id; without openHostSession "Continue" does not render |
49
+ | `openHostSession` | `(sessionId: string) => void` | — | — | 跳官方会话区(uiWorkspace.openSession) | Jump into the official session area (uiWorkspace.openSession) |
50
+ | `onContinue` | `(message: string) => Promise<void>` | — | — | 暂存输入框的确定:调用方完成 fork + 发首轮 + 跳转;缺省 = 不渲染输入框 | Staging input confirm: caller forks, sends the first turn, navigates; absent = no input rendered |
51
+ | `onOpenFile` | `(path: string, sessionId: string) => void` | — | — | 文件打开出口(工具卡 fileLink / 行内引用 / 交付卡共用);第二参是文件所属会话 id,别拿别的会话去定位;缺省 = 链接纯文本 | File-open exit shared by fileLinks, mentions and delivered cards; the second arg is the owning session id — locate the file there, not elsewhere; absent = plain text |
52
+ | `onOpenReview` | `(locator: ChangedFileReviewLocator) => void` | — | — | 变更文件的审阅出口(等价官方 openReview);缺省 = 变更卡整张不可点 | Review exit for changed files (equals official openReview); absent = the change card is not clickable |
53
+ | `t` | `Translate` | — | 内置 | 覆盖文案(内置字典已含全部会话文案,中英) | Override copy (the built-in dictionary has all session copy, zh+en) |
54
+
55
+ ```tsx id="session-usage"
56
+ import { openSessionView, SessionViewModal } from 'dsh-plugin-core/session'
57
+
58
+ // 宿主服务由调用方注入:sessions ← dsh-api-session-controller、
59
+ // uiConversation ← dsh-client-ui-conversation
60
+ const view = openSessionView(sessions, uiConversation, sessionId, 'dsh-task-reminder')
61
+ if (view !== null) {
62
+ h(SessionViewModal, {
63
+ sessionId,
64
+ view,
65
+ heading: '镜像升级日报', // 标题,缺省「会话预览」
66
+ onClose: () => { view.dispose(); setOpen(false) }, // 关闭必须 dispose
67
+ // 续聊(可选):fork 开分支 → 跳官方会话区;两者缺一即不渲染该入口
68
+ forkSession: (id, atSeq) => sessions.fork({ sessionId: id, increaseTitle: true, atSeq }),
69
+ openHostSession: (id) => uiWorkspace.openSession(id),
70
+ // 暂存输入框(可选):由调用方 fork + 发首轮 + 跳转
71
+ onContinue: async (message) => {
72
+ const child = await forkSession(sessionId)
73
+ await hostContinue(child, message)
74
+ openHostSession(child)
75
+ },
76
+ onOpenFile: (path) => openFilePreview(path), // 文件打开出口
77
+ archived, // 是否已归档
78
+ t, // 可选,覆盖文案
79
+ })
80
+ }
81
+ ```
82
+
83
+ ```ts id="session-data-chain"
84
+ // 数据链(越往上越早):
85
+ // sessions.retain(id, { source }) 物化 scope
86
+ // → sessions.binding(id) 取绑定
87
+ // → session.open() 幂等拉历史尾页
88
+ // → uiConversation.binding(binding).target('chat')
89
+ // 拿 ChatSnapshot:order + nodes(keyed 流)
90
+ // 用完必须 view.dispose(),否则会话 scope 不回收。
91
+ ```
@@ -0,0 +1,80 @@
1
+ # 样式(怎么用 `design`)
2
+
3
+ > EN: Styles (using `design`)
4
+
5
+ 本包的样式是**运行时注入**的 TS 字符串:核心提供一套 token 与注入器,控件只认 token。
6
+ 你这一侧要做的就是建一个 kit、必要时换肤。
7
+
8
+ EN: Styles ship as **runtime-injected TS strings**: core provides tokens plus an injector, and controls read
9
+ tokens only. On your side this means creating one kit and optionally reskinning it.
10
+
11
+ ## 前缀规则
12
+
13
+ > EN: Prefix rules
14
+
15
+ 变量与类名**全生态统一 `dshpc`**,固定不变,不存在按插件替换这回事。
16
+
17
+ EN: Both variables and class names are fixed as `dshpc` across the whole ecosystem; there is no per-plugin rename.
18
+
19
+ | 名称 | 规则 |
20
+ |---|---|
21
+ | 变量 `--dshpc-*` | 直接使用;token 定义与控件样式都写这个前缀 |
22
+ | 类名 `dshpc-*` | 与控件硬编码的 className 一致,改动需两边同步 |
23
+
24
+ EN: Variables `--dshpc-*` are used directly; class names `dshpc-*` mirror the hardcoded classNames in controls.
25
+
26
+ > **已知限制**:两种用法都不影响——多个插件引不同版本的 core 时,同名规则会互相覆盖,因此用 `createStyleKit({ id })` 隔离。
27
+ > EN: **Known limit**: plugins on different core versions share identical rule names and overwrite each other;
28
+ > isolation comes from the style tag id (`createStyleKit({ id })`).
29
+
30
+ ## 明暗判据(硬约束)
31
+
32
+ > EN: Dark-mode predicate (hard constraint)
33
+
34
+ ```ts
35
+ export const DARK_THEME_SELECTOR = 'body[data-ds-dark-theme]'
36
+ ```
37
+
38
+ - 由**宿主启动脚本**写入 body,反映**用户在客户端里的选择**。
39
+ - **不要用 `prefers-color-scheme`**:它跟的是系统,不是用户在宿主里的选择。系统亮色 + 用户在 DSH 里选暗色时,
40
+ 跟 `prefers-color-scheme` 会显示成亮色,与宿主不一致。
41
+
42
+ EN: The host bootstrap writes that attribute; it tracks the user’s in-client choice. Never use
43
+ `prefers-color-scheme` — it tracks the OS, which can disagree with the host and render the wrong theme.
44
+
45
+ ## token 清单
46
+
47
+ > EN: Token inventory
48
+
49
+ 分类(命名口径稳定,token 名原样使用):
50
+
51
+ EN: Categories below; token names are stable and used as-is.
52
+
53
+ | 类别 | 例 |
54
+ |---|---|
55
+ | 前景 / 背景面 | `--dshpc-fg` `--dshpc-fg-3` `--dshpc-fg-4` `--dshpc-surface-1` `--dshpc-surface-2` `--dshpc-surface-sunken` `--dshpc-surface-menu` `--dshpc-surface-base` |
56
+ | 边框 | `--dshpc-border` `--dshpc-border-faint` |
57
+ | 间距 | `--dshpc-space-1` … `--dshpc-space-3` |
58
+ | 字号 / 行高 | `--dshpc-font-sm` `--dshpc-font-lg` `--dshpc-line-sm` `--dshpc-line-md` `--dshpc-line-lg` |
59
+ | 语义色 | `--dshpc-business` `--dshpc-success` `--dshpc-danger` `--dshpc-warning` `--dshpc-link` |
60
+ | 语义面 | `--dshpc-open-bg` `--dshpc-open-bg-soft` `--dshpc-chip-bg` `--dshpc-chip-bg-hover` |
61
+ | 代码 | `--dshpc-code-surface` `--dshpc-code-font` |
62
+
63
+ 完整清单以 `src/design/tokens-css.ts` 为准(真源在代码,不在这里抄第二份)。
64
+ 查某个变量叫什么:`kit.cssVar('fg')` 或直接 grep `tokens-css.ts`。
65
+
66
+ EN: The authoritative list lives in `src/design/tokens-css.ts`. Look up a variable with `kit.cssVar('fg')`
67
+ or by grepping `tokens-css.ts`.
68
+
69
+ ## 定制边界
70
+
71
+ > EN: Customization surface
72
+
73
+ - **换肤**:给同一批变量名赋新值(在你自己域名下覆盖),不需要 fork。
74
+ - **加域**:`kit.registerStyle('widget', css)`;同一域重复登记 = 覆盖。
75
+ - **`tokens` 域恒排最前**(变量定义必须先于消费它的规则),kit 内部已保证顺序。
76
+ - 皮肤写在调用方自己的样式域里;组件只认 token,不认调用方的具体颜色。
77
+
78
+ EN: Reskin by reassigning the same variables inside your own style domain (no fork needed). Add a domain with
79
+ `kit.registerStyle('widget', css)`; re-registering a domain overwrites it. The `tokens` domain always comes
80
+ first — core maintains that ordering. Skin lives in the caller’s domain; components only read tokens.
@@ -0,0 +1,404 @@
1
+ // ui 子包的使用帮助 —— 真源(TS 数据模块)。内容全在此一处,demo 与 md 都从这份派生。
2
+ import type { DocTopic } from '../design/doc-format.js'
3
+
4
+ const setup = `import { createStyleKit } from 'dsh-plugin-core/design'
5
+ import { ensureControls, setStyleKit } from 'dsh-plugin-core/ui'
6
+
7
+ setStyleKit(createStyleKit({ id: 'dsh-task-reminder-ui' }))
8
+ ensureControls()`
9
+
10
+ const cardExample = `import { Card, Chip, StripCard } from 'dsh-plugin-core/ui'
11
+
12
+ h(Card, {
13
+ accent: 'warning',
14
+ action: h(Button, { size: 'sm', variant: 'ghost' }, '跳过'),
15
+ },
16
+ h('div', null, '标题'),
17
+ h(Chip, null, '#npm'),
18
+ )
19
+
20
+ h(StripCard, {
21
+ accent: 'success',
22
+ expanded: open, onToggle: () => setOpen(!open),
23
+ panel: h('div', null, '展开详情'),
24
+ }, h('div', null, '标题 + 元信息'))`
25
+
26
+ const panelDockExample = `const dock = createPanelDock({ maxPanels: 3 }) // 一次,挂在插件级
27
+
28
+ // 页面里:结构就在这儿写,不塞进任何调用参数
29
+ h('div', { style: { display: 'flex' } },
30
+ h(Main, null), // flex:1 1 auto; min-width:0
31
+ h(PanelDock, { dock },
32
+ h(DockPanel, { id: 'files', title: '工作区' }, h(FilePanel)),
33
+ h(DockPanel, { id: 'preview', header: h(PreviewBar) }, h(PreviewBody)),
34
+ h(DockPanel, { id: 'raw', header: null, closeButton: 'floating' }, h(RawBody)),
35
+ ),
36
+ )
37
+ // 之后任何地方:dock.open('files') / dock.close('files')`
38
+
39
+ const workspacePickerExample = `import { WorkspacePicker, connectHost } from 'dsh-plugin-core/ui'
40
+
41
+ // apply(ctx) 里:connectHost(ctx)
42
+ h(WorkspacePicker, { value: cur, onChange: setCur, clearable: true })`
43
+
44
+ const dateTimePickerExample = `import { DateTimePicker } from 'dsh-plugin-core/ui'
45
+
46
+ // 单个时刻,精确到分(起始端归零:14:30 ⇒ 14:30:00.000)
47
+ h(DateTimePicker, { precision: 'minute', value: startAt, onChange: setStartAt })
48
+
49
+ // 时间段:一个整条触发器(两个日期区 + 灰隔条 -),day 精度下结束端补到当天最后一刻
50
+ h(DateTimePicker, {
51
+ mode: 'range',
52
+ precision: 'day',
53
+ value: range,
54
+ onChange: setRange, // → ['2026-10-24T00:00:00.000', '2026-10-24T23:59:59.999']
55
+ })`
56
+
57
+ const doc: DocTopic = {
58
+ title: { zh: 'ui —— 基础控件', en: 'ui — base controls' },
59
+ exports: [
60
+ 'Button', 'IconButton', 'Segmented', 'Input', 'PrefixedInput', 'NumberInput', 'Textarea',
61
+ 'Checkbox', 'fieldMetricsOf', 'Picker', 'WorkspacePicker', 'ModelPicker', 'DateTimePicker', 'Card', 'StripCard',
62
+ 'Chip', 'Modal', 'FieldHint', 'setTooltipRenderer', 'showToast', 'notify', 'showHostToast',
63
+ 'Loading', 'RunningBlocks', 'SectionHead', 'MarqueeText', 'LiveText',
64
+ 'BackToTop', 'startResizeLayoutWidth', 'PanelDock', 'createPanelDock', 'DockPanel',
65
+ 'ensureControls', 'setStyleKit',
66
+ ],
67
+ sections: [
68
+ {
69
+ id: 'ui-overview',
70
+ heading: { zh: '概览', en: 'Overview' },
71
+ prose: [
72
+ {
73
+ zh: '依赖 design。装的是「用 token 搭出来的零件」,直接用,不再自己写原生控件。纯零件不自己取数:选项、当前值都经 props 给(数据通道是插件私有的)。',
74
+ en: 'Depends on design. "Parts built from tokens" — use them instead of writing native controls. No self-fetching: options and value come via props (the data channel is plugin-private).',
75
+ },
76
+ {
77
+ zh: '入口零 `@deepseek-ai/*` 依赖(非宿主环境 import 不崩)。官方 primitives 走独立子路径 `dsh-plugin-core/ui/official`,封装一律从这条通路引。',
78
+ en: 'The entry keeps zero `@deepseek-ai/*` deps (imports never crash outside the host). Official primitives come through the separate subpath `dsh-plugin-core/ui/official`; import them only from there.',
79
+ },
80
+ {
81
+ zh: '定制边界:props 就是定制面,要改行为请组合 props,不要 fork 源码;追加 class/style 只允许补布局,皮肤走 token 覆盖;缺控件请先提需求。',
82
+ en: 'Customization: props are the surface — compose them instead of forking source; appended class/style may only patch layout, skins go through token overrides; raise a request before writing a missing control yourself.',
83
+ },
84
+ ],
85
+ code: [{ id: 'ui-setup', lang: 'ts', src: setup }],
86
+ },
87
+ {
88
+ id: 'button',
89
+ heading: { zh: 'Button / IconButton / Segmented', en: 'Button / IconButton / Segmented' },
90
+ prose: [
91
+ {
92
+ zh: 'Button 10 档外观(实心 / 线框 / 无底)。hover / active 走 token 派生色(不用 opacity)。',
93
+ en: 'Button offers 10 variant tiers (solid / outline / bare). hover/active use token-derived colors (no opacity).',
94
+ },
95
+ {
96
+ zh: 'IconButton:variant: plain|outline|danger(默认 plain)、size(默认 lg)、icon(必填)、label(必填,无障碍名兼 title)。',
97
+ en: 'IconButton: variant plain|outline|danger (default plain), size (default lg), icon (required), label (required, doubles as a11y name and title).',
98
+ },
99
+ {
100
+ zh: 'Segmented:`items`(必填)支持单选 / 多选,另有 `size`(默认 lg)、`variant`(default / inset)。选中片 = 抬起底色 + 1px 描边 + 浮起阴影。',
101
+ en: 'Segmented: `items` (required) supports single or multiple selection, plus `size` (default lg) and `variant` (default / inset). Selected = raised background + 1px border + lift shadow.',
102
+ },
103
+ ],
104
+ api: [
105
+ {
106
+ id: 'ui-button',
107
+ rows: [
108
+ { name: 'variant', type: "上表 10 档(primary/secondary/danger/success/warning/info/outline/danger-outline/ghost/link)", def: "'outline'", desc: { zh: '外观档', en: 'Appearance tier' } },
109
+ { name: 'size', type: "'sm' | 'md' | 'lg'", def: "'lg'", desc: { zh: '高度档(24 / 28 / 32,有边无边同高)', en: 'Height tier (24 / 28 / 32, same height with or without border)' } },
110
+ { name: 'icon', type: 'ReactNode', def: '—', desc: { zh: '前置图标(官方图标组件 / 字符串均可)', en: 'Leading icon (official icon component or string)' } },
111
+ { name: 'iconRight', type: 'ReactNode', def: '—', desc: { zh: '后置图标(展开箭头、外链)', en: 'Trailing icon (expand arrow, external link)' } },
112
+ { name: 'color', type: 'string', def: '—', desc: { zh: '自定义主色:实心档作底色,线框 / 无底档作主色', en: 'Custom main color: background for solid tiers, main color for outline/bare' } },
113
+ { name: 'loading', type: 'boolean', def: "'false'", desc: { zh: '文案前显示同色小圈,并自动 disabled', en: 'Shows a same-color spinner before the label and auto-disables' } },
114
+ { name: 'block', type: 'boolean', def: "'false'", desc: { zh: '撑满父宽', en: 'Fill parent width' } },
115
+ { name: 'children', type: 'ReactNode', def: '—', desc: { zh: '文案(由调用方按语言给:中文出中文、英文出英文,中英混排也支持)', en: 'Label (caller supplies per locale: zh shows zh, en shows en, mixed is supported)' } },
116
+ { name: '…rest', type: '原生 button 属性', def: '—', desc: { zh: 'type / disabled / title / aria-* / onClick 原样透传', en: 'type / disabled / title / aria-* / onClick passed through' } },
117
+ ],
118
+ },
119
+ ],
120
+ },
121
+ {
122
+ id: 'input',
123
+ heading: { zh: 'Input 家族(Field.ts)', en: 'Input family (Field.ts)' },
124
+ api: [
125
+ {
126
+ id: 'ui-input',
127
+ rows: [
128
+ { name: 'Input', type: 'value onChange(v) size(默认 sm) error disabled type placeholder inputRef onKeyDown onBlur aria-label title hint', def: '—', desc: { zh: '基础输入框;error 描红;hint 给字符串即自动挂标准问号提示', en: 'Basic input; error turns it red; passing hint as a string auto-attaches a standard question-mark hint' } },
129
+ { name: 'PrefixedInput', type: '同 Input + prefix: string', def: '—', desc: { zh: '前置文案(https:// / C:\\)', en: 'Leading text (https:// / C:\\)' } },
130
+ { name: 'NumberInput', type: 'value: number onChange(v) min max step(默认 1) inputWidth suffix label decreaseLabel increaseLabel hint', def: '—', desc: { zh: '已 clamp;失焦回弹草稿', en: 'Already clamped; reverts to draft on blur' } },
131
+ { name: 'Textarea', type: 'value onChange(v) placeholder error disabled rows spellCheck(默认关) aria-label hint', def: '—', desc: { zh: 'hint 的问号钉在右下角(单行控件则在行尾垂直居中)', en: 'hint’s question mark pins to the bottom-right (for single-line controls it centers at the row end)' } },
132
+ { name: 'Checkbox', type: 'checked onChange(next) label accentColor disabled', def: '—', desc: { zh: '—', en: '—' } },
133
+ { name: 'fieldMetricsOf(size)', type: '→ { height, font, line, icon, gap }', def: '—', desc: { zh: '自己搭同款输入框时对齐尺寸', en: 'Match dimensions when building your own same-style input' } },
134
+ ],
135
+ },
136
+ ],
137
+ },
138
+ {
139
+ id: 'picker',
140
+ heading: { zh: 'Picker / WorkspacePicker / ModelPicker', en: 'Picker / WorkspacePicker / ModelPicker' },
141
+ prose: [
142
+ {
143
+ zh: 'Picker:单 / 多选、上限、搜索、分组、空态,自绘。键盘:Esc 关、↑↓ 移游标、Enter 选。纯逻辑可单用:`toGroups` / `filterGroups` / `toggleValue`。',
144
+ en: 'Picker: single/multiple selection, cap, search, grouping, empty state — self-drawn. Keyboard: Esc closes, ↑↓ move the cursor, Enter selects. Logic reusable standalone: `toGroups` / `filterGroups` / `toggleValue`.',
145
+ },
146
+ {
147
+ zh: 'WorkspacePicker:数据自带的领域选择器。在插件 apply 里调一次 `connectHost(ctx)`,组件即订阅官方 `workspaces` 快照。未接线 = 空态,不编造数据。',
148
+ en: 'WorkspacePicker: a domain picker that brings its own data. Call `connectHost(ctx)` once in the plugin apply and it subscribes to the official `workspaces` snapshot. Unwired = empty state, never fabricated data.',
149
+ },
150
+ {
151
+ zh: 'ModelPicker:数据自带,`variant` 为 `grouped`(默认)/ `cascade`;`onChange` 一律发 `provider/id` 形式的模型 value。目录来自宿主 `serveModelCatalog`。',
152
+ en: 'ModelPicker: brings its own data; `variant` is `grouped` (default) or `cascade`; `onChange` always emits the model value as `provider/id`. Catalog comes from the host `serveModelCatalog`.',
153
+ },
154
+ ],
155
+ api: [
156
+ {
157
+ id: 'ui-picker',
158
+ rows: [
159
+ { name: 'groups / options', type: 'PickerGroup[] / PickerOption[]', def: '—', desc: { zh: '二选一;options 会被当成一个无标题组', en: 'One of the two; options is treated as a single untitled group' } },
160
+ { name: 'value / defaultValue', type: 'string | string[]', def: '—', desc: { zh: '给了 value 即受控;否则内部管', en: 'Passing value makes it controlled; otherwise it manages internally' } },
161
+ { name: 'onChange', type: '(v: string | string[]) => void', def: '—', desc: { zh: '单选回 string,多选回 string[]', en: 'Single returns string, multiple returns string[]' } },
162
+ { name: 'mode', type: "'single' | 'multiple'", def: "'single'", desc: { zh: '—', en: '—' } },
163
+ { name: 'max', type: 'number', def: '—', desc: { zh: '多选上限;到上限其余项置灰 + 提示(不静默截断)', en: 'Multiple-select cap; at cap others grey out + a hint (no silent truncation)' } },
164
+ { name: 'searchable', type: 'boolean', def: "'false'", desc: { zh: '显示搜索框;展开菜单时自动聚焦搜索框', en: 'Shows a search box; auto-focuses it when the menu opens' } },
165
+ { name: 'align', type: "'left' | 'center'", def: "'left'", desc: { zh: '触发器文字对齐', en: 'Trigger text alignment' } },
166
+ { name: 'clearable', type: 'boolean', def: "'false'", desc: { zh: '单选时列表顶部多一项「不选」', en: 'In single mode, adds a "none" item at the top of the list' } },
167
+ { name: 'placeholder', type: 'string', def: '内置「请选择」', desc: { zh: '—', en: '—' } },
168
+ { name: 'degraded', type: 'boolean', def: "'false'", desc: { zh: '候选可能不完整 ⇒ 顶部如实提示,不编造', en: 'Candidates may be incomplete ⇒ honest top hint, no fabrication' } },
169
+ { name: 'size', type: "'sm' | 'md' | 'lg'", def: "'md'", desc: { zh: '—', en: '—' } },
170
+ { name: 'placement', type: "'down' | 'up'", def: "'down'", desc: { zh: '触发器靠近视口底部时用 up', en: 'Use up when the trigger is near the viewport bottom' } },
171
+ { name: 'closeOnSelect', type: 'boolean', def: '多选 false / 单选恒关', desc: { zh: '选中后是否收起', en: 'Whether to collapse after selection' } },
172
+ { name: 'showLabels', type: 'boolean', def: "'true'", desc: { zh: '多选时触发器列出已选项,而非只显示「已选 N 项」', en: 'In multiple mode the trigger lists selected items instead of just "N selected"' } },
173
+ { name: 'icon', type: 'ReactNode', def: '—', desc: { zh: '触发器文字前的图标', en: 'Icon before the trigger text' } },
174
+ { name: 'hint', type: 'string', def: '—', desc: { zh: '问号提示文字:自动在触发器后挂标准 FieldHint', en: 'Hint text: auto-attaches a standard FieldHint after the trigger' } },
175
+ { name: 'className', type: 'string', def: '—', desc: { zh: '定制宽度 / 外边距', en: 'Custom width / margin' } },
176
+ { name: 'ariaLabel', type: 'string', def: '—', desc: { zh: '无障碍名', en: 'Accessible name' } },
177
+ { name: 'translate', type: 'Translate', def: '内置', desc: { zh: '覆盖文案', en: 'Override copy' } },
178
+ ],
179
+ },
180
+ {
181
+ id: 'ui-workspace-picker',
182
+ rows: [
183
+ { name: 'value / defaultValue / onChange', type: '选中值为 workspaceId(不是 title);\'\' = 「所有工作区」', def: '—', desc: { zh: '不筛', en: 'No filter' } },
184
+ { name: 'allowDefault / defaultLabel', type: '「所有工作区」默认项:默认提供、置顶、只在单选出现;选中发 \'\';false 关掉', def: '—', desc: { zh: '文案可改', en: 'Text is customizable' } },
185
+ { name: 'mode / max', type: '单选 / 多选 / 上限(到上限已选项仍可反选)', def: '—', desc: { zh: '—', en: '—' } },
186
+ { name: 'placeholder', type: 'string', def: '默认「工作区」', desc: { zh: '想叫「选择工作区」就传它', en: 'Pass it if you want "选择工作区"' } },
187
+ { name: 'icon', type: 'ReactNode', def: '—', desc: { zh: '触发器前置图标:不传 = 默认文件夹;null = 不显示;传元素 = 自定义', en: 'Leading trigger icon: omitted = default folder; null = hidden; element = custom' } },
188
+ ],
189
+ },
190
+ {
191
+ id: 'ui-model-picker',
192
+ rows: [
193
+ { name: 'variant', type: "'grouped' | 'cascade'", def: "'grouped'", desc: { zh: 'grouped = 一个下拉完全独立;cascade = 两个下拉联动(先选供应商,模型列表跟着筛;换供应商清空已选)', en: 'grouped = one standalone dropdown; cascade = two linked dropdowns (pick provider first, model list filters; switching provider clears selection)' } },
194
+ { name: 'allowDefault / defaultLabel', type: '「默认模型」选项:默认提供;false 关闭;选中发 \'\'', def: '—', desc: { zh: '文案可传 defaultLabel', en: 'Pass defaultLabel for the text' } },
195
+ { name: 'placeholder', type: 'string', def: '默认「模型」', desc: { zh: 'icon:不传 = 默认星形;null = 不显示;传元素 = 自定义', en: 'icon: omitted = default star; null = hidden; element = custom' } },
196
+ { name: '透传 Picker', type: 'value / defaultValue / onChange / clearable / searchable / hint / size / placement / className / disabled / degraded / translate', def: '—', desc: { zh: '同 Picker 同名参数', en: 'Same-named params as Picker' } },
197
+ ],
198
+ },
199
+ ],
200
+ code: [{ id: 'ui-workspacepicker-example', lang: 'tsx', src: workspacePickerExample }],
201
+ },
202
+ {
203
+ id: 'datetime-picker',
204
+ heading: { zh: 'DateTimePicker(日期时间选择)', en: 'DateTimePicker (date & time)' },
205
+ prose: [
206
+ {
207
+ zh: '一个控件覆盖全部诉求:`mode` 选 `single`(一个时刻)/ `range`(时间段——触发器是**一个整条**:两个日期区 + 中间样式画的灰隔条,点整条展开;弹层里左右两块独立日历分别选);`precision` 选 `day` / `hour` / `minute` / `second`。值为本地 ISO(`YYYY-MM-DDTHH:mm:ss.SSS`),毫秒恒三位。',
208
+ en: 'One control covers everything: `mode` picks `single` (one instant) or `range` (a span — the trigger is **one bar**: two date zones + a CSS-drawn grey separator, click anywhere to expand; two independent calendars side by side in the popup); `precision` picks `day` / `hour` / `minute` / `second`. Values are local ISO (`YYYY-MM-DDTHH:mm:ss.SSS`), milliseconds always three digits.',
209
+ },
210
+ {
211
+ zh: '补全口径:起始端把未选单位归零(day ⇒ `00:00:00.000`),结束端拉满(day ⇒ `23:59:59.999`;hour ⇒ `H:59:59.999`;second 不动)。数据库只收到秒时 `23:59:59.999` 退化为「当天最后一秒」,语义不坏,无需特殊处理。',
212
+ en: 'Fill rules: the start floors unselected units (day ⇒ `00:00:00.000`), the end ceils them (day ⇒ `23:59:59.999`; hour ⇒ `H:59:59.999`; second stays exact). If a DB stores seconds only, `23:59:59.999` degrades to "last second of the day" — semantics intact, nothing special to do.',
213
+ },
214
+ {
215
+ zh: '显示口径:传出的数据恒是完整本地 ISO(到毫秒),但**显示只到 precision**——day 只出日期(不出现时分秒),hour / minute 到分,second 才出秒。调用方传的精度就是用户看到的精度。',
216
+ en: 'Display rule: emitted data is always a complete local ISO (to milliseconds), but **display stops at the precision** — day shows the date only (no clock), hour/minute stop at minutes, second shows seconds. The precision you pass is exactly what the user sees.',
217
+ },
218
+ {
219
+ zh: '弹层与 Picker 同机制(floating-ui 浮层、贴边翻转、点外关闭、无遮罩):两个端框 + 两块独立月历(左开始、右结束,各选各的,不标跨度)+ 每端自己的时/分/秒步进(▲▼、直接键入、↑↓ 键——不用逐格点 60 分钟;**时间不强制先选日期**,「确定」时没选日期就不传数据)。快捷键:day 精度叫「今天」(只置日期),带时分秒的叫「现在」(日期 + 时间一起置,之后可再改)。草稿态,「确定」才 onChange;Esc / 点外 = 丢弃。日历键盘:方向键移动、PageUp/Down 换月、Home/End 月内首尾、Enter 选中。结束早于开始时「确定」置灰并提示。',
220
+ en: 'The popup shares Picker’s mechanics (floating-ui layer, edge flip, outside-click close, no mask): two end boxes + two independent calendars (left = start, right = end, each picks its own, no span marking) + per-end hour/minute/second steppers (▲▼, direct typing, ↑↓ keys — no clicking through 60 minutes; **time never requires picking a date first** — on confirm, no date means no data emitted). Quick button: "Today" at day precision (date only), "Now" when hours/minutes/seconds are on (sets date + time together, editable afterwards). Draft state; onChange only on confirm; Esc / outside = discard. Calendar keys: arrows move, PageUp/Down change month, Home/End jump to month bounds, Enter selects. When end precedes start, confirm greys out with a hint.',
221
+ },
222
+ ],
223
+ api: [
224
+ {
225
+ id: 'ui-datetime-picker',
226
+ rows: [
227
+ { name: 'mode', type: "'single' | 'range'", def: "'single'", desc: { zh: 'single = 一个时刻;range = 一个整条触发器(两个日期区 + 灰隔条)', en: 'single = one instant; range = one-bar trigger (two date zones + grey separator)' } },
228
+ { name: 'precision', type: "'day' | 'hour' | 'minute' | 'second'", def: "'day'", desc: { zh: '时间精度;day 不显示时分秒步进', en: 'Time precision; day hides the steppers' } },
229
+ { name: 'value / defaultValue', type: 'single: string | null;range: [start, end] | null', def: '—', desc: { zh: '本地 ISO;给了 value 即受控', en: 'Local ISO; passing value makes it controlled' } },
230
+ { name: 'onChange', type: '(v: string | [string, string] | null) => void', def: '—', desc: { zh: '「确定」时提交;「清除」发 null', en: 'Emitted on confirm; clear emits null' } },
231
+ { name: 'disabled / size / placeholder', type: "boolean / 'sm' | 'md' | 'lg' / string", def: "false / 'md' / 内置「请选择日期时间」", desc: { zh: '与 Picker 同名参数对齐', en: 'Aligned with Picker’s same-named params' } },
232
+ { name: 'hint / className / ariaLabel / translate', type: 'string / string / string / Translate', def: '—', desc: { zh: '同 Picker 同名参数', en: 'Same-named params as Picker' } },
233
+ ],
234
+ },
235
+ ],
236
+ code: [{ id: 'ui-datetimepicker-example', lang: 'tsx', src: dateTimePickerExample }],
237
+ },
238
+ {
239
+ id: 'tooltip',
240
+ heading: { zh: 'FieldHint(问号提示)', en: 'FieldHint (hint)' },
241
+ prose: [
242
+ {
243
+ zh: '独立组件,标题 / 输入框后随处可挂。气泡是官方 Tooltip 本体,启动时用 `setTooltipRenderer((p) => h(OfficialTooltip, p))` 注入,其余 props 透传。',
244
+ en: 'Standalone — hang it after a title or input. The bubble is the official Tooltip, injected at startup via `setTooltipRenderer((p) => h(OfficialTooltip, p))`; other props pass through.',
245
+ },
246
+ {
247
+ zh: '未注入 renderer 的环境只显示问号图标,不出气泡。',
248
+ en: 'Without a renderer only the question-mark icon shows, no bubble.',
249
+ },
250
+ ],
251
+ },
252
+ {
253
+ id: 'card',
254
+ heading: { zh: 'Card / StripCard', en: 'Card / StripCard' },
255
+ prose: [
256
+ {
257
+ zh: '两种外观,两个组件:Card = surface 底 + 1px 边框 + 圆角(padding 14px,左 12 使竖条贴边);StripCard = 同色浅底 + 占位边框 + 方角。',
258
+ en: 'Two appearances, two components: Card = surface background + 1px border + rounded corners (padding 14px, left 12 so the strip hugs the edge); StripCard = same-hue light background + placeholder border + square corners.',
259
+ },
260
+ {
261
+ zh: '头部整体垂直居中,`action` 里裸放一个元素即居中。颜色全走 token,明暗跟随宿主。',
262
+ en: 'The header centers vertically as a whole; drop a bare element into `action` and it centers. Colors come from tokens, so light/dark follows the host.',
263
+ },
264
+ ],
265
+ api: [
266
+ {
267
+ id: 'ui-card',
268
+ rows: [
269
+ { name: 'accent', type: "5 档 or 任意 CSS 色值(business/success/warning/danger/neutral)", def: "'business'", desc: { zh: '档位映射到 design 的 token;也可传 \'#f59e0b\' 这类自定义值', en: 'Tiers map to design tokens; also accepts custom values like \'#f59e0b\'' } },
270
+ { name: 'expanded', type: 'boolean', def: "'false'", desc: { zh: '展开态(箭头朝向 + panel 显隐)', en: 'Expanded state (arrow direction + panel show/hide)' } },
271
+ { name: 'onToggle', type: '() => void', def: '—', desc: { zh: '传了才显示右侧折叠箭头;展开状态由调用方管', en: 'Only shows the right collapse arrow if provided; caller owns the expanded state' } },
272
+ { name: 'action', type: 'ReactNode', def: '—', desc: { zh: '右上角操作区', en: 'Top-right action area' } },
273
+ { name: 'children', type: 'ReactNode', def: '—', desc: { zh: '主内容,排版随你', en: 'Main content, layout is yours' } },
274
+ { name: 'panel', type: 'ReactNode', def: '—', desc: { zh: '展开后才显示的额外内容', en: 'Extra content shown only when expanded' } },
275
+ { name: 'className / style', type: '—', def: '—', desc: { zh: '追加类 / 样式', en: 'Append class / style' } },
276
+ ],
277
+ },
278
+ ],
279
+ code: [{ id: 'ui-card-example', lang: 'tsx', src: cardExample }],
280
+ },
281
+ {
282
+ id: 'chip',
283
+ heading: { zh: 'Chip', en: 'Chip' },
284
+ prose: [
285
+ {
286
+ zh: '小标签。`tone`:neutral(默认)/ business / success / warning / danger;`size`:sm(默认)/ md(12px)。传 `onClick` 才可点。',
287
+ en: 'A small tag. `tone`: neutral (default) / business / success / warning / danger; `size`: sm (default) / md (12px). Pass `onClick` to make it clickable.',
288
+ },
289
+ {
290
+ zh: '边界:只做「胶囊标签」。纯图标的小按钮请用 IconButton,别拿 Chip 当图标底板。',
291
+ en: 'Boundary: pill tags only. For an icon-only button use IconButton; never use Chip as an icon baseplate.',
292
+ },
293
+ ],
294
+ },
295
+ {
296
+ id: 'feedback',
297
+ heading: { zh: '反馈件', en: 'Feedback' },
298
+ prose: [
299
+ {
300
+ zh: '底层是 Sonner。toast 宿主是 globalThis 单例(`Symbol.for(\'dsh-plugin-core/toast-host\')`):首个副本建容器,其余把 payload 交它渲染。',
301
+ en: 'Backed by Sonner. The toast host is a singleton on globalThis (`Symbol.for(\'dsh-plugin-core/toast-host\')`): the first copy mounts the container, the rest hand their payload to it.',
302
+ },
303
+ {
304
+ zh: '三条取舍(照用别改):① 样式取首个副本;② position 全局共享;③ 不做卸载回收。无 document 的环境静默跳过。',
305
+ en: 'Three trade-offs (accept them): ① styling comes from the first copy; ② position is shared per screen; ③ no unload reclamation. Environments without document skip silently.',
306
+ },
307
+ {
308
+ zh: 'Modal 是自绘 overlay,不走 react-dom portal。',
309
+ en: 'Modal is a self-drawn overlay, not a react-dom portal.',
310
+ },
311
+ {
312
+ zh: '遮罩右边界读 `--dshpc-page-inset-right`(多个 dock 求和),自动让开右侧分栏,弹窗在**剩余区域**居中。弹窗无需任何遮罩参数;也别自己量分栏宽度(挂载异步,恒为 0)。',
313
+ en: 'The mask’s right edge reads `--dshpc-page-inset-right` (summed across docks) and yields to the right column, centering the dialog in the **remaining** area. The dialog needs no mask props; never measure the column yourself (mounting is async, it always reads 0).',
314
+ },
315
+ ],
316
+ api: [
317
+ {
318
+ id: 'ui-feedback',
319
+ rows: [
320
+ { name: 'showToast(message, opts?)', type: '', def: '', desc: { zh: '官方 Sonner 原生(对比 / demo 用)。opts: `{ variant?, durationMs?, color?, onDismiss?, position? }`,6 向定位,明暗跟随宿主', en: 'Raw official Sonner (comparison / demo). opts `{ variant?, durationMs?, color?, onDismiss?, position? }`, 6-way placement, theme follows host' } },
321
+ { name: 'notify(message, opts?)', type: '', def: '', desc: { zh: '默认用这个。opts: `{ variant?, description?, durationMs?, position?, actions? }`,actions 用自带 Button(1–2 个)', en: 'Use this by default. opts `{ variant?, description?, durationMs?, position?, actions? }`, actions use our own Button (1–2)' } },
322
+ { name: 'showHostToast(message, opts?)', type: '', def: '', desc: { zh: '宿主原生 Toast,走 `dsh-plugin-core/ui/host` 子路径。opts: `{ tone?, holdMs?, actions?, onDismiss? }`', en: 'Host-native Toast from the `dsh-plugin-core/ui/host` subpath. opts `{ tone?, holdMs?, actions?, onDismiss? }`' } },
323
+ { name: 'Loading({ anchorId? })', type: '', def: '', desc: { zh: '贴到主内容容器右下角的加载指示;anchorId 默认 dshpc-main', en: 'Loading indicator pinned to the main container’s bottom-right; anchorId defaults to dshpc-main' } },
324
+ { name: 'RunningBlocks()', type: '', def: '', desc: { zh: '运行中的占位块', en: 'Placeholder blocks while running' } },
325
+ { name: 'SectionHead({ icon, title, right? })', type: '', def: '', desc: { zh: '分区标题', en: 'Section heading' } },
326
+ { name: 'MarqueeText({ text, style?, title?, className? })', type: '', def: '', desc: { zh: '超长省略、hover 滚动', en: 'Ellipsis on overflow, scroll on hover' } },
327
+ { name: 'LiveText({ render, style? })', type: '', def: '', desc: { zh: '定时重渲染(相对时间这类)', en: 'Periodic re-render (for relative time etc.)' } },
328
+ { name: 'BackToTop({ anchorId? })', type: '', def: '', desc: { zh: '回到顶部,贴主容器右缘外侧', en: 'Back-to-top, outside the main container’s right edge' } },
329
+ { name: 'startResizeLayoutWidth(opts)', type: '', def: '', desc: { zh: '拖拽调整布局宽度(root 不传则回落 #dshpc-root)', en: 'Drag to resize layout width (falls back to #dshpc-root if root omitted)' } },
330
+ ],
331
+ },
332
+ {
333
+ id: 'ui-modal',
334
+ rows: [
335
+ { name: 'title', type: 'ReactNode', def: '—', desc: { zh: '标题', en: 'Title' } },
336
+ { name: 'subtitle', type: 'ReactNode', def: '—', desc: { zh: '标题**下方**的副标题行(等宽小字;会话 id 这类标识放这里,别塞正文)', en: 'Subtitle line **under** the title (monospace caption; put identifiers such as a session id here, not in the body)' } },
337
+ { name: 'headerExtra', type: 'ReactNode', def: '—', desc: { zh: '标题**同一行**右侧的小块(徽标 / 计数):紧跟标题,不跨标题与副标题两行居中', en: 'Small block (badge / count) on the **same line** as the title: it sits right after the title, never centered across the title and subtitle lines' } },
338
+ { name: 'headerActions', type: 'ReactNode', def: '—', desc: { zh: '头部右侧动作区(关闭钮之外)', en: 'Header actions area (besides the close button)' } },
339
+ { name: 'onClose', type: '() => void', def: '—', desc: { zh: '不传则不显示关闭钮', en: 'No close button if omitted' } },
340
+ { name: 'closeOnMask', type: 'boolean', def: "'true'", desc: { zh: '点遮罩关闭;误触代价大的场景设 false', en: 'Close on mask click; set false where mis-clicks are costly' } },
341
+ { name: 'escClose', type: 'boolean', def: "'true'", desc: { zh: 'Esc 关闭', en: 'Close on Esc' } },
342
+ { name: 'maxWidth', type: 'string', def: '按 size', desc: { zh: '任意 CSS 值,覆盖 size 的宽度上限;不要用 vw(遮罩已按右侧分栏让位)', en: 'Any CSS value, overriding the size’s max width; avoid vw (the mask already yielded to the right column)' } },
343
+ { name: 'hideHeader', type: 'boolean', def: "'false'", desc: { zh: '不渲染头部(沉浸式)', en: 'Skip header (immersive)' } },
344
+ { name: 'footer', type: 'ReactNode', def: '—', desc: { zh: '底栏(按钮区)', en: 'Footer (button area)' } },
345
+ { name: 'children', type: 'ReactNode', def: '—', desc: { zh: '主体', en: 'Body' } },
346
+ ],
347
+ },
348
+ ],
349
+ },
350
+ {
351
+ id: 'layout',
352
+ heading: { zh: 'PanelDock(停靠分栏)', en: 'PanelDock (dock)' },
353
+ prose: [
354
+ {
355
+ zh: '右侧分栏的通用壳,是**布局成员**而非浮层:占宽挤窄主区,要由调用方放进自己的 flex 根。分工:结构写在调用点(children),显隐归状态(`open` / `close` 只传 id)。',
356
+ en: 'A generic shell for right-side columns — a **layout member**, not an overlay: it takes width and narrows the main area, so the caller puts it in their own flex root. Split of work: structure at the call site (children), visibility in state (`open`/`close` take only an id).',
357
+ },
358
+ {
359
+ zh: '面板高度默认视口高;嵌在定高容器里时由调用方给 `--dshpc-dock-h`。不支持:同名多实例、tab 切换条、自动淘汰、浮层——标签切换请消费方在自己的面板内容里实现。',
360
+ en: 'Panel height defaults to viewport height; in a fixed-height container the caller sets `--dshpc-dock-h`. Not supported: same-name duplicates, tab bars, auto-eviction, floating layers — tab switching belongs in the consumer’s own panel content.',
361
+ },
362
+ {
363
+ zh: '占宽契约:已开栏宽之和实时写进根元素 `--dshpc-page-inset-right`(拖拽逐帧更新,全关即移除),全屏遮罩据此让位;同页多个 dock 求和。',
364
+ en: 'Width contract: the sum of open widths goes to `--dshpc-page-inset-right` on the root element (every frame while dragging, removed when all close), and full-screen masks yield to it; multiple docks on one page are summed.',
365
+ },
366
+ ],
367
+ api: [
368
+ {
369
+ id: 'ui-paneldock-create',
370
+ rows: [
371
+ { name: 'maxPanels', type: 'number', def: '3', desc: { zh: '同时存在的栏数上限', en: 'Max simultaneous panels' } },
372
+ { name: 'defaultWidth / minWidth', type: 'number', def: '460 / 320', desc: { zh: '兜底宽度与下限(面板自己给了就以面板为准)', en: 'Fallback width and floor (panel’s own value wins if given)' } },
373
+ { name: 'storageKey', type: 'string', def: "'dshpc-dock'", desc: { zh: '宽度记忆前缀;传 false 关闭', en: 'Width-memory prefix; false disables' } },
374
+ ],
375
+ },
376
+ {
377
+ id: 'ui-paneldock-panel',
378
+ rows: [
379
+ { name: 'id', type: 'string', def: '—', desc: { zh: '组名(寻址键),同名唯一', en: 'Group name (address key), unique per name' } },
380
+ { name: 'title / icon', type: 'ReactNode', def: '—', desc: { zh: '内置头的标题与标题前图标', en: 'Built-in header title and icon before it' } },
381
+ { name: 'extra', type: 'ReactNode', def: '—', desc: { zh: '标题右侧的任意内容(不只是按钮)', en: 'Any content to the right of the title (not just buttons)' } },
382
+ { name: 'header', type: 'ReactNode | null', def: '—', desc: { zh: '整块替换头部:不传 = 内置头;null = 不要头部;其他 = 你的头', en: 'Whole-header replacement: omitted = built-in; null = no header; else = your header' } },
383
+ { name: 'closable / closeButton / closeIcon', type: '—', def: '—', desc: { zh: '关钮开关;位置 auto/header/floating/none', en: 'Close-button toggle; position auto/header/floating/none' } },
384
+ { name: 'width / minWidth / maxWidth', type: 'number', def: '—', desc: { zh: '宽度与可拖动区间', en: 'Width and draggable range' } },
385
+ { name: 'ariaLabel', type: 'string', def: '—', desc: { zh: '无头部时的无障碍名', en: 'A11y name when no header' } },
386
+ ],
387
+ },
388
+ {
389
+ id: 'ui-paneldock-events',
390
+ rows: [
391
+ { name: 'onOpen', type: '({ id, created: true })', def: '—', desc: { zh: '首次打开', en: 'First open' } },
392
+ { name: 'onBeforeClose', type: '({ id, reason: \'button\' | \'api\' }) => false?', def: '—', desc: { zh: '关闭之前,返回 false 可取消', en: 'Before close; returning false cancels' } },
393
+ { name: 'onClose', type: '({ id, reason })', def: '—', desc: { zh: '已关闭', en: 'Closed' } },
394
+ { name: 'onResize', type: '({ id, width })', def: '—', desc: { zh: '拖宽松手', en: 'Drag released' } },
395
+ { name: 'onLimitReached', type: '({ id })', def: '—', desc: { zh: '到上限被拒', en: 'Rejected at cap' } },
396
+ ],
397
+ },
398
+ ],
399
+ code: [{ id: 'ui-paneldock-example', lang: 'ts', src: panelDockExample }],
400
+ },
401
+ ],
402
+ }
403
+
404
+ export default doc