@deepseek-ai/dsh-client-ui-primitives 0.2.2-alpha.3 → 0.2.2-rc.2

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 (412) hide show
  1. package/README.i18n.yaml +16 -16
  2. package/README.md +21 -14
  3. package/README.zh.md +21 -14
  4. package/lib/HoverCard.module.css +8 -3
  5. package/lib/JsonTree.module.css +7 -17
  6. package/lib/Menu.module.css +157 -37
  7. package/lib/Modal.module.css +16 -0
  8. package/lib/QuotePreview.module.css +37 -0
  9. package/lib/RiskConfirmation.module.css +11 -37
  10. package/lib/Toast.module.css +2 -3
  11. package/lib/Tooltip.module.css +2 -1
  12. package/lib/index.js +1447 -776
  13. package/lib/index.js.map +1 -0
  14. package/lib/markdown/CodeBlock.module.css +64 -0
  15. package/lib/markdown/MarkdownText.module.css +20 -1
  16. package/lib/types/AnimatedRows.d.ts +3 -0
  17. package/lib/types/AnimatedRows.d.ts.map +1 -0
  18. package/lib/types/AnimatedRows.js.map +1 -0
  19. package/lib/types/BrandWordmark.d.ts.map +1 -0
  20. package/lib/types/BrandWordmark.js.map +1 -0
  21. package/lib/types/Button.d.ts.map +1 -0
  22. package/lib/types/Button.js.map +1 -0
  23. package/lib/types/Checkbox.d.ts +3 -1
  24. package/lib/types/Checkbox.d.ts.map +1 -0
  25. package/lib/types/Checkbox.js.map +1 -0
  26. package/lib/types/CodeFileIcon.d.ts.map +1 -0
  27. package/lib/types/CodeFileIcon.js.map +1 -0
  28. package/lib/types/CodeToolbar.d.ts.map +1 -0
  29. package/lib/types/CodeToolbar.js.map +1 -0
  30. package/lib/types/CommandText.d.ts.map +1 -0
  31. package/lib/types/CommandText.js.map +1 -0
  32. package/lib/types/ConfigField.d.ts.map +1 -0
  33. package/lib/types/ConfigField.js.map +1 -0
  34. package/lib/types/ConnectionIndicator.d.ts.map +1 -0
  35. package/lib/types/ConnectionIndicator.js.map +1 -0
  36. package/lib/types/DetailDocument.d.ts.map +1 -0
  37. package/lib/types/DetailDocument.js.map +1 -0
  38. package/lib/types/DiffBlock.d.ts.map +1 -0
  39. package/lib/types/DiffBlock.js.map +1 -0
  40. package/lib/types/DisclosureRow.d.ts.map +1 -0
  41. package/lib/types/DisclosureRow.js.map +1 -0
  42. package/lib/types/DraggableImage.d.ts.map +1 -0
  43. package/lib/types/DraggableImage.js.map +1 -0
  44. package/lib/types/FileTypeIcon.d.ts.map +1 -0
  45. package/lib/types/FileTypeIcon.js.map +1 -0
  46. package/lib/types/FishLogo.d.ts.map +1 -0
  47. package/lib/types/FishLogo.js.map +1 -0
  48. package/lib/types/FoldToggle.d.ts.map +1 -0
  49. package/lib/types/FoldToggle.js.map +1 -0
  50. package/lib/types/HoverCard.d.ts.map +1 -0
  51. package/lib/types/HoverCard.js.map +1 -0
  52. package/lib/types/HoverCardGroup.d.ts.map +1 -0
  53. package/lib/types/HoverCardGroup.js.map +1 -0
  54. package/lib/types/ImageLightbox.d.ts.map +1 -0
  55. package/lib/types/ImageLightbox.js.map +1 -0
  56. package/lib/types/ImagePreview.d.ts.map +1 -0
  57. package/lib/types/ImagePreview.js.map +1 -0
  58. package/lib/types/InlineEditor.d.ts.map +1 -0
  59. package/lib/types/InlineEditor.js.map +1 -0
  60. package/lib/types/Input.d.ts.map +1 -0
  61. package/lib/types/Input.js.map +1 -0
  62. package/lib/types/JsonTree.d.ts.map +1 -0
  63. package/lib/types/JsonTree.js.map +1 -0
  64. package/lib/types/LinkIcon.d.ts.map +1 -0
  65. package/lib/types/LinkIcon.js.map +1 -0
  66. package/lib/types/Menu.d.ts +26 -14
  67. package/lib/types/Menu.d.ts.map +1 -0
  68. package/lib/types/Menu.js.map +1 -0
  69. package/lib/types/MenuGroup.d.ts.map +1 -0
  70. package/lib/types/MenuGroup.js.map +1 -0
  71. package/lib/types/MenuRow.d.ts +37 -0
  72. package/lib/types/MenuRow.d.ts.map +1 -0
  73. package/lib/types/MenuRow.js.map +1 -0
  74. package/lib/types/MenuSurface.d.ts.map +1 -0
  75. package/lib/types/MenuSurface.js.map +1 -0
  76. package/lib/types/Modal.d.ts +3 -1
  77. package/lib/types/Modal.d.ts.map +1 -0
  78. package/lib/types/Modal.js.map +1 -0
  79. package/lib/types/PathLabel.d.ts.map +1 -0
  80. package/lib/types/PathLabel.js.map +1 -0
  81. package/lib/types/PermissionIcon.d.ts.map +1 -0
  82. package/lib/types/PermissionIcon.js.map +1 -0
  83. package/lib/types/Pill.d.ts.map +1 -0
  84. package/lib/types/Pill.js.map +1 -0
  85. package/lib/types/QuotePreview.d.ts +17 -4
  86. package/lib/types/QuotePreview.d.ts.map +1 -0
  87. package/lib/types/QuotePreview.js.map +1 -0
  88. package/lib/types/ReadBlock.d.ts.map +1 -0
  89. package/lib/types/ReadBlock.js.map +1 -0
  90. package/lib/types/ReferenceIcon.d.ts.map +1 -0
  91. package/lib/types/ReferenceIcon.js.map +1 -0
  92. package/lib/types/RiskConfirmation.d.ts.map +1 -0
  93. package/lib/types/RiskConfirmation.js.map +1 -0
  94. package/lib/types/SearchBlock.d.ts.map +1 -0
  95. package/lib/types/SearchBlock.js.map +1 -0
  96. package/lib/types/SegmentedControl.d.ts.map +1 -0
  97. package/lib/types/SegmentedControl.js.map +1 -0
  98. package/lib/types/SegmentedTabs.d.ts.map +1 -0
  99. package/lib/types/SegmentedTabs.js.map +1 -0
  100. package/lib/types/ShortcutKeys.d.ts.map +1 -0
  101. package/lib/types/ShortcutKeys.js.map +1 -0
  102. package/lib/types/SiteGlyph.d.ts.map +1 -0
  103. package/lib/types/SiteGlyph.js.map +1 -0
  104. package/lib/types/StateDot.d.ts.map +1 -0
  105. package/lib/types/StateDot.js.map +1 -0
  106. package/lib/types/SubmenuPanel.d.ts +19 -0
  107. package/lib/types/SubmenuPanel.d.ts.map +1 -0
  108. package/lib/types/SubmenuPanel.js.map +1 -0
  109. package/lib/types/Switch.d.ts.map +1 -0
  110. package/lib/types/Switch.js.map +1 -0
  111. package/lib/types/Tag.d.ts.map +1 -0
  112. package/lib/types/Tag.js.map +1 -0
  113. package/lib/types/TerminalBlock.d.ts.map +1 -0
  114. package/lib/types/TerminalBlock.js.map +1 -0
  115. package/lib/types/TextShimmer.d.ts.map +1 -0
  116. package/lib/types/TextShimmer.js.map +1 -0
  117. package/lib/types/Toast.d.ts.map +1 -0
  118. package/lib/types/Toast.js.map +1 -0
  119. package/lib/types/Tooltip.d.ts.map +1 -0
  120. package/lib/types/Tooltip.js.map +1 -0
  121. package/lib/types/UserMessageBubble.d.ts.map +1 -0
  122. package/lib/types/UserMessageBubble.js.map +1 -0
  123. package/lib/types/WebBlock.d.ts.map +1 -0
  124. package/lib/types/WebBlock.js.map +1 -0
  125. package/lib/types/ZoomControls.d.ts.map +1 -0
  126. package/lib/types/ZoomControls.js.map +1 -0
  127. package/lib/types/ansi.d.ts.map +1 -0
  128. package/lib/types/ansi.js.map +1 -0
  129. package/lib/types/clipboard.d.ts.map +1 -0
  130. package/lib/types/clipboard.js.map +1 -0
  131. package/lib/types/code-file-icon-artwork.d.ts.map +1 -0
  132. package/lib/types/code-file-icon-artwork.js.map +1 -0
  133. package/lib/types/code-file-types.d.ts.map +1 -0
  134. package/lib/types/code-file-types.js.map +1 -0
  135. package/lib/types/code-highlighting.d.ts.map +1 -0
  136. package/lib/types/code-highlighting.js.map +1 -0
  137. package/lib/types/darwin-desktop.d.ts.map +1 -0
  138. package/lib/types/darwin-desktop.js.map +1 -0
  139. package/lib/types/document-zoom.d.ts.map +1 -0
  140. package/lib/types/document-zoom.js.map +1 -0
  141. package/lib/types/file-drag-actions.d.ts.map +1 -0
  142. package/lib/types/file-drag-actions.js.map +1 -0
  143. package/lib/types/file-size.d.ts.map +1 -0
  144. package/lib/types/file-size.js.map +1 -0
  145. package/lib/types/focus.d.ts.map +1 -0
  146. package/lib/types/focus.js.map +1 -0
  147. package/lib/types/guide-artwork.d.ts.map +1 -0
  148. package/lib/types/guide-artwork.js.map +1 -0
  149. package/lib/types/head-tail-cap.d.ts.map +1 -0
  150. package/lib/types/head-tail-cap.js.map +1 -0
  151. package/lib/types/icons/artwork.d.ts +12 -0
  152. package/lib/types/icons/artwork.d.ts.map +1 -0
  153. package/lib/types/icons/artwork.js.map +1 -0
  154. package/lib/types/icons/index.d.ts +12 -0
  155. package/lib/types/icons/index.d.ts.map +1 -0
  156. package/lib/types/icons/index.js.map +1 -0
  157. package/lib/types/icons/props.d.ts.map +1 -0
  158. package/lib/types/icons/props.js.map +1 -0
  159. package/lib/types/icons/shared-artwork.d.ts.map +1 -0
  160. package/lib/types/icons/shared-artwork.js.map +1 -0
  161. package/lib/types/image-drag.d.ts.map +1 -0
  162. package/lib/types/image-drag.js.map +1 -0
  163. package/lib/types/index.d.ts +5 -4
  164. package/lib/types/index.d.ts.map +1 -0
  165. package/lib/types/index.js.map +1 -0
  166. package/lib/types/input-modality.d.ts.map +1 -0
  167. package/lib/types/input-modality.js.map +1 -0
  168. package/lib/types/keyboard-composition.d.ts.map +1 -0
  169. package/lib/types/keyboard-composition.js.map +1 -0
  170. package/lib/types/markdown/CodeBlock.d.ts +8 -1
  171. package/lib/types/markdown/CodeBlock.d.ts.map +1 -0
  172. package/lib/types/markdown/CodeBlock.js.map +1 -0
  173. package/lib/types/markdown/FenceBlocks.d.ts +31 -0
  174. package/lib/types/markdown/FenceBlocks.d.ts.map +1 -0
  175. package/lib/types/markdown/FenceBlocks.js.map +1 -0
  176. package/lib/types/markdown/JsonBlock.d.ts.map +1 -0
  177. package/lib/types/markdown/JsonBlock.js.map +1 -0
  178. package/lib/types/markdown/MarkdownDelegate.d.ts +23 -1
  179. package/lib/types/markdown/MarkdownDelegate.d.ts.map +1 -0
  180. package/lib/types/markdown/MarkdownDelegate.js.map +1 -0
  181. package/lib/types/markdown/MarkdownText.d.ts +2 -0
  182. package/lib/types/markdown/MarkdownText.d.ts.map +1 -0
  183. package/lib/types/markdown/MarkdownText.js.map +1 -0
  184. package/lib/types/markdown/cjkFriendlyStrong.d.ts.map +1 -0
  185. package/lib/types/markdown/cjkFriendlyStrong.js.map +1 -0
  186. package/lib/types/markdown/copy-tex.d.ts +14 -0
  187. package/lib/types/markdown/copy-tex.d.ts.map +1 -0
  188. package/lib/types/markdown/copy-tex.js.map +1 -0
  189. package/lib/types/markdown/diff-fence.d.ts +58 -0
  190. package/lib/types/markdown/diff-fence.d.ts.map +1 -0
  191. package/lib/types/markdown/diff-fence.js.map +1 -0
  192. package/lib/types/markdown/file-link.d.ts.map +1 -0
  193. package/lib/types/markdown/file-link.js.map +1 -0
  194. package/lib/types/markdown/highlight.d.ts +18 -0
  195. package/lib/types/markdown/highlight.d.ts.map +1 -0
  196. package/lib/types/markdown/highlight.js.map +1 -0
  197. package/lib/types/markdown/incremental.d.ts.map +1 -0
  198. package/lib/types/markdown/incremental.js.map +1 -0
  199. package/lib/types/markdown/katex.d.ts.map +1 -0
  200. package/lib/types/markdown/katex.js.map +1 -0
  201. package/lib/types/markdown/local-image-syntax.d.ts.map +1 -0
  202. package/lib/types/markdown/local-image-syntax.js.map +1 -0
  203. package/lib/types/markdown/mathCompatibility.d.ts.map +1 -0
  204. package/lib/types/markdown/mathCompatibility.js.map +1 -0
  205. package/lib/types/markdown/parse.d.ts.map +1 -0
  206. package/lib/types/markdown/parse.js.map +1 -0
  207. package/lib/types/markdown/plain-text.d.ts.map +1 -0
  208. package/lib/types/markdown/plain-text.js.map +1 -0
  209. package/lib/types/markdown/quote-text.d.ts.map +1 -0
  210. package/lib/types/markdown/quote-text.js.map +1 -0
  211. package/lib/types/markdown/render.d.ts.map +1 -0
  212. package/lib/types/markdown/render.js.map +1 -0
  213. package/lib/types/markdown/useViewportHighlighting.d.ts.map +1 -0
  214. package/lib/types/markdown/useViewportHighlighting.js.map +1 -0
  215. package/lib/types/markdown/windows-path-destinations.d.ts.map +1 -0
  216. package/lib/types/markdown/windows-path-destinations.js.map +1 -0
  217. package/lib/types/menu-submenu-position.d.ts +15 -0
  218. package/lib/types/menu-submenu-position.d.ts.map +1 -0
  219. package/lib/types/menu-submenu-position.js.map +1 -0
  220. package/lib/types/overlay-top-margin.d.ts.map +1 -0
  221. package/lib/types/overlay-top-margin.js.map +1 -0
  222. package/lib/types/plugin-artwork.d.ts.map +1 -0
  223. package/lib/types/plugin-artwork.js.map +1 -0
  224. package/lib/types/pointer-grace.d.ts.map +1 -0
  225. package/lib/types/pointer-grace.js.map +1 -0
  226. package/lib/types/rank-by-name.d.ts.map +1 -0
  227. package/lib/types/rank-by-name.js.map +1 -0
  228. package/lib/types/relative-time.d.ts.map +1 -0
  229. package/lib/types/relative-time.js.map +1 -0
  230. package/lib/types/settings-form/SettingsForm.d.ts.map +1 -0
  231. package/lib/types/settings-form/SettingsForm.js.map +1 -0
  232. package/lib/types/settings-form/fields.d.ts.map +1 -0
  233. package/lib/types/settings-form/fields.js.map +1 -0
  234. package/lib/types/settings-form/form-model.d.ts.map +1 -0
  235. package/lib/types/settings-form/form-model.js.map +1 -0
  236. package/lib/types/tooltip-placement.d.ts.map +1 -0
  237. package/lib/types/tooltip-placement.js.map +1 -0
  238. package/lib/types/use-clipboard-copy.d.ts.map +1 -0
  239. package/lib/types/use-clipboard-copy.js.map +1 -0
  240. package/lib/types/useAnchoredMaxHeight.d.ts.map +1 -0
  241. package/lib/types/useAnchoredMaxHeight.js.map +1 -0
  242. package/lib/types/useDismissOnOutsidePointer.d.ts.map +1 -0
  243. package/lib/types/useDismissOnOutsidePointer.js.map +1 -0
  244. package/lib/types/useMenuSubmenu.d.ts +43 -0
  245. package/lib/types/useMenuSubmenu.d.ts.map +1 -0
  246. package/lib/types/useMenuSubmenu.js.map +1 -0
  247. package/lib/types/useModalLayer.d.ts.map +1 -0
  248. package/lib/types/useModalLayer.js.map +1 -0
  249. package/lib/types/useRowDragPreview.d.ts.map +1 -0
  250. package/lib/types/useRowDragPreview.js.map +1 -0
  251. package/lib/types/user-text.d.ts.map +1 -0
  252. package/lib/types/user-text.js.map +1 -0
  253. package/package.json +11 -8
  254. package/src/AnimatedRows.module.css +7 -0
  255. package/src/AnimatedRows.tsx +195 -0
  256. package/src/BrandWordmark.tsx +59 -0
  257. package/src/Button.module.css +84 -0
  258. package/src/Button.tsx +36 -0
  259. package/src/Checkbox.module.css +28 -0
  260. package/src/Checkbox.tsx +34 -0
  261. package/src/CodeCard.module.css +85 -0
  262. package/src/CodeFileIcon.tsx +28 -0
  263. package/src/CodeToolbar.tsx +62 -0
  264. package/src/CommandText.module.css +12 -0
  265. package/src/CommandText.tsx +46 -0
  266. package/src/ConfigField.module.css +12 -0
  267. package/src/ConfigField.tsx +53 -0
  268. package/src/ConnectionIndicator.module.css +120 -0
  269. package/src/ConnectionIndicator.tsx +103 -0
  270. package/src/DetailDocument.module.css +67 -0
  271. package/src/DetailDocument.tsx +120 -0
  272. package/src/DiffBlock.module.css +82 -0
  273. package/src/DiffBlock.tsx +221 -0
  274. package/src/DisclosureRow.module.css +115 -0
  275. package/src/DisclosureRow.tsx +124 -0
  276. package/src/DraggableImage.tsx +26 -0
  277. package/src/FileTypeIcon.module.css +50 -0
  278. package/src/FileTypeIcon.tsx +285 -0
  279. package/src/FishLogo.tsx +28 -0
  280. package/src/FoldToggle.tsx +33 -0
  281. package/src/HoverCard.module.css +108 -0
  282. package/src/HoverCard.tsx +356 -0
  283. package/src/HoverCardGroup.tsx +77 -0
  284. package/src/ImageLightbox.module.css +54 -0
  285. package/src/ImageLightbox.tsx +72 -0
  286. package/src/ImagePreview.module.css +24 -0
  287. package/src/ImagePreview.tsx +36 -0
  288. package/src/InlineEditor.module.css +23 -0
  289. package/src/InlineEditor.tsx +69 -0
  290. package/src/Input.module.css +38 -0
  291. package/src/Input.tsx +24 -0
  292. package/src/JsonTree.module.css +371 -0
  293. package/src/JsonTree.tsx +850 -0
  294. package/src/LinkIcon.tsx +118 -0
  295. package/src/Menu.module.css +443 -0
  296. package/src/Menu.tsx +553 -0
  297. package/src/MenuGroup.module.css +37 -0
  298. package/src/MenuGroup.tsx +103 -0
  299. package/src/MenuRow.tsx +89 -0
  300. package/src/MenuSurface.module.css +65 -0
  301. package/src/MenuSurface.tsx +54 -0
  302. package/src/Modal.module.css +147 -0
  303. package/src/Modal.tsx +96 -0
  304. package/src/PathLabel.module.css +28 -0
  305. package/src/PathLabel.tsx +41 -0
  306. package/src/PermissionIcon.tsx +119 -0
  307. package/src/Pill.module.css +30 -0
  308. package/src/Pill.tsx +36 -0
  309. package/src/QuotePreview.module.css +138 -0
  310. package/src/QuotePreview.tsx +133 -0
  311. package/src/ReadBlock.module.css +45 -0
  312. package/src/ReadBlock.tsx +151 -0
  313. package/src/ReferenceIcon.tsx +49 -0
  314. package/src/RiskConfirmation.module.css +47 -0
  315. package/src/RiskConfirmation.tsx +79 -0
  316. package/src/RowDragPreview.module.css +12 -0
  317. package/src/SearchBlock.module.css +114 -0
  318. package/src/SearchBlock.tsx +281 -0
  319. package/src/SegmentedControl.module.css +81 -0
  320. package/src/SegmentedControl.tsx +140 -0
  321. package/src/SegmentedTabs.module.css +77 -0
  322. package/src/SegmentedTabs.tsx +84 -0
  323. package/src/ShortcutKeys.module.css +33 -0
  324. package/src/ShortcutKeys.tsx +12 -0
  325. package/src/SiteGlyph.tsx +149 -0
  326. package/src/StateDot.module.css +100 -0
  327. package/src/StateDot.tsx +77 -0
  328. package/src/SubmenuPanel.tsx +51 -0
  329. package/src/Switch.module.css +49 -0
  330. package/src/Switch.tsx +42 -0
  331. package/src/Tag.module.css +57 -0
  332. package/src/Tag.tsx +42 -0
  333. package/src/TerminalBlock.module.css +207 -0
  334. package/src/TerminalBlock.tsx +294 -0
  335. package/src/TextShimmer.module.css +88 -0
  336. package/src/TextShimmer.tsx +58 -0
  337. package/src/Toast.module.css +102 -0
  338. package/src/Toast.tsx +101 -0
  339. package/src/Tooltip.module.css +68 -0
  340. package/src/Tooltip.tsx +273 -0
  341. package/src/UserMessageBubble.module.css +11 -0
  342. package/src/UserMessageBubble.tsx +16 -0
  343. package/src/WebBlock.module.css +153 -0
  344. package/src/WebBlock.tsx +196 -0
  345. package/src/ZoomControls.module.css +54 -0
  346. package/src/ZoomControls.tsx +92 -0
  347. package/src/ansi.ts +447 -0
  348. package/src/clipboard.ts +47 -0
  349. package/src/code-file-icon-artwork.manifest.json +71 -0
  350. package/src/code-file-icon-artwork.ts +60 -0
  351. package/src/code-file-types.ts +340 -0
  352. package/src/code-highlighting.ts +25 -0
  353. package/src/css-modules.d.ts +6 -0
  354. package/src/darwin-desktop.ts +11 -0
  355. package/src/document-zoom.ts +12 -0
  356. package/src/file-drag-actions.ts +29 -0
  357. package/src/file-size.ts +16 -0
  358. package/src/focus.ts +44 -0
  359. package/src/guide-artwork.tsx +32 -0
  360. package/src/head-tail-cap.ts +27 -0
  361. package/src/icons/artwork.ts +156 -0
  362. package/src/icons/index.tsx +634 -0
  363. package/src/icons/props.ts +8 -0
  364. package/src/icons/shared-artwork.tsx +71 -0
  365. package/src/image-drag.ts +84 -0
  366. package/src/index.ts +142 -0
  367. package/src/input-modality.ts +59 -0
  368. package/src/keyboard-composition.ts +36 -0
  369. package/src/markdown/CodeBlock.module.css +209 -0
  370. package/src/markdown/CodeBlock.tsx +268 -0
  371. package/src/markdown/FenceBlocks.tsx +51 -0
  372. package/src/markdown/JsonBlock.module.css +34 -0
  373. package/src/markdown/JsonBlock.tsx +36 -0
  374. package/src/markdown/MarkdownDelegate.tsx +102 -0
  375. package/src/markdown/MarkdownText.module.css +511 -0
  376. package/src/markdown/MarkdownText.tsx +218 -0
  377. package/src/markdown/cjkFriendlyStrong.ts +83 -0
  378. package/src/markdown/copy-tex.ts +53 -0
  379. package/src/markdown/diff-fence.ts +212 -0
  380. package/src/markdown/file-link.ts +45 -0
  381. package/src/markdown/highlight.ts +689 -0
  382. package/src/markdown/incremental.ts +360 -0
  383. package/src/markdown/katex.tsx +90 -0
  384. package/src/markdown/local-image-syntax.ts +29 -0
  385. package/src/markdown/mathCompatibility.ts +349 -0
  386. package/src/markdown/parse.ts +49 -0
  387. package/src/markdown/plain-text.ts +121 -0
  388. package/src/markdown/quote-text.ts +10 -0
  389. package/src/markdown/render.tsx +834 -0
  390. package/src/markdown/useViewportHighlighting.ts +72 -0
  391. package/src/markdown/windows-path-destinations.ts +34 -0
  392. package/src/menu-submenu-position.ts +20 -0
  393. package/src/overlay-top-margin.ts +18 -0
  394. package/src/plugin-artwork.tsx +110 -0
  395. package/src/pointer-grace.ts +47 -0
  396. package/src/rank-by-name.ts +93 -0
  397. package/src/relative-time.ts +36 -0
  398. package/src/settings-form/SettingsForm.module.css +53 -0
  399. package/src/settings-form/SettingsForm.tsx +74 -0
  400. package/src/settings-form/fields.module.css +153 -0
  401. package/src/settings-form/fields.tsx +151 -0
  402. package/src/settings-form/form-model.ts +393 -0
  403. package/src/tooltip-placement.ts +60 -0
  404. package/src/use-clipboard-copy.ts +44 -0
  405. package/src/useAnchoredMaxHeight.ts +45 -0
  406. package/src/useDismissOnOutsidePointer.ts +34 -0
  407. package/src/useMenuSubmenu.ts +182 -0
  408. package/src/useModalLayer.ts +108 -0
  409. package/src/useRowDragPreview.ts +76 -0
  410. package/src/user-text.module.css +46 -0
  411. package/src/user-text.tsx +67 -0
  412. package/lib/types/useAnchoredPosition.d.ts +0 -36
@@ -0,0 +1,51 @@
1
+ /** Portaled child menu presentation; interaction state belongs to useMenuSubmenu. */
2
+ import type { CSSProperties, ReactNode } from 'react'
3
+ import { createPortal } from 'react-dom'
4
+ import clsx from 'clsx'
5
+ import { menuHoverAllowed, type useMenuSubmenu } from './useMenuSubmenu.ts'
6
+ import { menuIconColumns, MenuRow, renderMenuDecoration } from './MenuRow.tsx'
7
+ import { IconChevronLeftOutlineRegular } from './icons/index.tsx'
8
+ import { MenuSurface } from './MenuSurface.tsx'
9
+ import css from './Menu.module.css'
10
+
11
+ /** Name the parent card anchor, and hide the child card until its layout is known. */
12
+ function anchors(submenu: ReturnType<typeof useMenuSubmenu>, hidden: boolean): CSSProperties & Record<`--dsh-submenu-${string}`, string> {
13
+ return { '--dsh-submenu-parent': submenu.parentAnchor, ...hidden ? { visibility: 'hidden' } : {} }
14
+ }
15
+
16
+ /** Render one child list with a non-selecting back row in single-page placement.
17
+ * @param props - active entry, submenu operations, and shared row presentation options.
18
+ * @returns a body portal that preserves child DOM identity across placement changes.
19
+ */
20
+ export function SubmenuPanel({ entry, submenu, compact, dense, contextual, backLabel, onSelect, onClose, afterSelection }: {
21
+ entry: NonNullable<ReturnType<typeof useMenuSubmenu>['entry']>
22
+ submenu: ReturnType<typeof useMenuSubmenu>
23
+ compact: boolean
24
+ dense: boolean
25
+ contextual: boolean
26
+ backLabel: ReactNode
27
+ onSelect: ((id: string) => void) | undefined
28
+ onClose: () => void
29
+ afterSelection: () => void
30
+ }) {
31
+ const columns = menuIconColumns(entry.submenu, contextual)
32
+ return createPortal(<MenuSurface ref={submenu.panelRef} compact={compact}
33
+ className={clsx(css.submenu, css.scrollable, dense && css.denseList, compact && css.compactList)}
34
+ style={anchors(submenu, submenu.hidden)}
35
+ data-submenu-layout={submenu.measured ? submenu.page ? 'page' : 'side' : undefined}
36
+ data-contextual={contextual ? '' : undefined} role="menu" onPointerEnter={submenu.cancelClose}
37
+ onPointerLeave={(event) => { if (menuHoverAllowed(event)) submenu.leave() }}
38
+ onContextMenu={contextual ? (event) => { event.preventDefault(); event.stopPropagation(); onClose() } : undefined}
39
+ onClick={(event) => { event.stopPropagation(); afterSelection() }}>
40
+ {submenu.page && <>
41
+ <MenuRow data-menu-back="" icon={<IconChevronLeftOutlineRegular className={css.check} />}
42
+ onClick={submenu.returnToParent}>{backLabel}</MenuRow>
43
+ <div className={css.separator} role="separator" />
44
+ </>}
45
+ <div className={css.viewport} role="presentation">
46
+ {entry.submenu.map(sub => 'type' in sub ? renderMenuDecoration(sub)
47
+ : <MenuRow key={sub.id} icon={sub.icon} reserveIcon={columns.has(sub)} disabled={sub.disabled}
48
+ danger={sub.danger} shortcut={sub.shortcut} onClick={() => { onSelect?.(sub.id) }}>{sub.label}</MenuRow>)}
49
+ </div>
50
+ </MenuSurface>, document.body)
51
+ }
@@ -0,0 +1,49 @@
1
+ /* The on/off appearance keys off aria-checked rather than a parallel class, so
2
+ * the visual state cannot disagree with the state assistive technology reads.
3
+ *
4
+ * The capsule track and circular thumb opt out of the global superellipse. */
5
+ .switch {
6
+ box-sizing: border-box;
7
+ position: relative;
8
+ flex: 0 0 auto;
9
+ width: 36px;
10
+ height: 20px;
11
+ padding: 2px;
12
+ border: 0;
13
+ border-radius: 999px;
14
+ corner-shape: round;
15
+ background: var(--dsw-alias-border-l3);
16
+ cursor: pointer;
17
+ }
18
+
19
+ .switch[aria-checked='true'] {
20
+ background: var(--dsw-alias-brand-primary);
21
+ }
22
+
23
+ .switch:disabled {
24
+ cursor: default;
25
+ opacity: 0.5;
26
+ }
27
+
28
+ .switch:focus-visible {
29
+ outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary));
30
+ outline-offset: 2px;
31
+ }
32
+
33
+ .thumb {
34
+ display: block;
35
+ width: 16px;
36
+ height: 16px;
37
+ border-radius: 50%;
38
+ corner-shape: round;
39
+ background: var(--dsw-alias-label-primary-foreground);
40
+ transition: transform 120ms ease;
41
+ }
42
+
43
+ .switch[aria-checked='false'] .thumb {
44
+ background: var(--dsw-alias-switch-thumb);
45
+ }
46
+
47
+ .switch[aria-checked='true'] .thumb {
48
+ transform: translateX(16px);
49
+ }
package/src/Switch.tsx ADDED
@@ -0,0 +1,42 @@
1
+ // Switch: two-state toggle. `label` is required and has no default, so a render
2
+ // site cannot ship the control without an accessible name.
3
+
4
+ import clsx from 'clsx'
5
+ import css from './Switch.module.css'
6
+
7
+ /**
8
+ * Render a toggle switch.
9
+ * @param props.checked - the current state; the control is fully controlled.
10
+ * @param props.onChange - called with the state the click asks for.
11
+ * @param props.label - localized accessible name, owned by the render site.
12
+ * @param props.disabled - whether the control refuses input; owners also set it
13
+ * while a write is in flight, not only when a deployment locks the toggle.
14
+ * @param props.title - localized hover text, typically why the toggle is locked.
15
+ * @param props.className - extra class for layout placement.
16
+ * @returns the switch element.
17
+ */
18
+ export function Switch({ checked, onChange, label, disabled = false, title, className }: {
19
+ checked: boolean
20
+ onChange: (next: boolean) => void
21
+ label: string
22
+ disabled?: boolean
23
+ title?: string | undefined
24
+ // `| undefined` so a caller can forward an optional class straight through
25
+ // under exactOptionalPropertyTypes (a CSS-module lookup is string|undefined).
26
+ className?: string | undefined
27
+ }) {
28
+ return (
29
+ <button
30
+ type="button"
31
+ role="switch"
32
+ aria-checked={checked}
33
+ aria-label={label}
34
+ title={title}
35
+ disabled={disabled}
36
+ className={clsx(css.switch, className)}
37
+ onClick={() => { onChange(!checked) }}
38
+ >
39
+ <span className={css.thumb} />
40
+ </button>
41
+ )
42
+ }
@@ -0,0 +1,57 @@
1
+ /* Capsule geometry is fixed: a tag reads as one size everywhere, and only its
2
+ * palette varies. Tone colors ride background/border/color so a render site can
3
+ * still position the tag with its own class without touching the palette. */
4
+ .tag {
5
+ display: inline-flex;
6
+ align-items: center;
7
+ border-radius: 999px;
8
+ corner-shape: round;
9
+ padding: 1px 8px;
10
+ font-size: 11px;
11
+ line-height: 17px;
12
+ font-weight: 500;
13
+ white-space: nowrap;
14
+ }
15
+
16
+ .tag[data-tone='outline'] {
17
+ border: 0.5px solid var(--dsw-alias-border-l4);
18
+ color: var(--dsw-alias-label-tertiary);
19
+ }
20
+
21
+ .tag[data-tone='solid'] {
22
+ background: var(--dsw-alias-label-primary);
23
+ color: var(--dsw-alias-bg-layer-3);
24
+ }
25
+
26
+ .tag[data-tone='neutral'] {
27
+ background: var(--dsw-alias-bg-module-platform);
28
+ color: var(--dsw-alias-label-secondary);
29
+ }
30
+
31
+ .tag[data-tone='quiet'] {
32
+ color: var(--dsw-alias-label-tertiary);
33
+ }
34
+
35
+ /* Status tones tint their own color for the fill, so a palette change moves
36
+ * fill and text together and neither needs a second token. The tint is 10%,
37
+ * except `warning`, which keeps the 12% the plugin inventory's conditional
38
+ * tag shipped with — matching it is what makes this a pure consolidation. */
39
+ .tag[data-tone='success'] {
40
+ background: color-mix(in srgb, var(--dsw-alias-state-success-primary) 10%, transparent);
41
+ color: var(--dsw-alias-state-success-primary);
42
+ }
43
+
44
+ .tag[data-tone='info'] {
45
+ background: color-mix(in srgb, var(--dsw-alias-state-business-primary) 10%, transparent);
46
+ color: var(--dsw-alias-state-business-primary);
47
+ }
48
+
49
+ .tag[data-tone='warning'] {
50
+ background: color-mix(in srgb, var(--dsw-alias-state-warn-primary) 12%, transparent);
51
+ color: var(--dsw-alias-state-warn-primary);
52
+ }
53
+
54
+ .tag[data-tone='danger'] {
55
+ background: color-mix(in srgb, var(--dsw-alias-state-error-primary) 10%, transparent);
56
+ color: var(--dsw-alias-state-error-primary);
57
+ }
package/src/Tag.tsx ADDED
@@ -0,0 +1,42 @@
1
+ // Tag: read-only capsule badge. The selectable capsule button is `Pill` —
2
+ // a tag takes no `onClick` and no `active`, and carries no copy of its own.
3
+
4
+ import type { ReactNode } from 'react'
5
+ import clsx from 'clsx'
6
+ import css from './Tag.module.css'
7
+
8
+ /** Palette selector; each tone names one shipped appearance. */
9
+ export type TagTone =
10
+ /** Hairline outline on tertiary text: the read-only default. */
11
+ | 'outline'
12
+ /** Inverted fill: one tag per group that names the current selection. */
13
+ | 'solid'
14
+ /** Platform-gray fill: a neutral fact with no status meaning. */
15
+ | 'neutral'
16
+ /** Text only, no fill: a fact stated more quietly than `neutral`. */
17
+ | 'quiet'
18
+ /** Tinted green: a healthy or enabled state. */
19
+ | 'success'
20
+ /** Tinted blue: informational classification, not health. */
21
+ | 'info'
22
+ /** Tinted amber: attention needed, not yet a failure. */
23
+ | 'warning'
24
+ /** Tinted red: a failure. */
25
+ | 'danger'
26
+
27
+ /**
28
+ * Render a read-only tag.
29
+ * @param props.tone - which palette to use (default `outline`).
30
+ * @param props.className - extra class for layout placement.
31
+ * @param props.children - the localized label, owned by the render site.
32
+ * @returns the tag element.
33
+ */
34
+ export function Tag({ tone = 'outline', className, children }: {
35
+ tone?: TagTone
36
+ // `| undefined` so a caller can forward an optional class straight through
37
+ // under exactOptionalPropertyTypes (a CSS-module lookup is string|undefined).
38
+ className?: string | undefined
39
+ children?: ReactNode
40
+ }) {
41
+ return <span className={clsx(css.tag, className)} data-tone={tone}>{children}</span>
42
+ }
@@ -0,0 +1,207 @@
1
+ .block {
2
+ --dsl-terminal-radius: var(--dsw-radius-lg);
3
+ --dsl-terminal-line-height: 22px;
4
+ /* Rebindable by consumers (CodeBlock's --dsl-code-block-content-font
5
+ pattern): a surface wanting the smaller code size rebinds this together
6
+ with --dsl-terminal-line-height on its own container. */
7
+ --dsl-terminal-font: var(--dsw-font-markdown-code-block);
8
+ /* The card's own left inset, holding the run-state dot in a column of its own
9
+ so it never competes with the commands for horizontal space. */
10
+ --dsl-terminal-gutter: 30px;
11
+
12
+ position: relative;
13
+ margin: 16px 0;
14
+ /* The gutter is the card's OWN padding, not a margin: every consumer rewrites
15
+ `margin` wholesale (each render site sets its own indent), which silently
16
+ cancelled the reservation and let the dot fall outside the card into a
17
+ container that clips it. Owning the reservation here keeps the invariant
18
+ with the component that depends on it. */
19
+ padding-left: var(--dsl-terminal-gutter);
20
+ color: var(--dsw-alias-label-primary);
21
+ background: var(--dsw-alias-markdown-code-block);
22
+ border-radius: var(--dsl-terminal-radius);
23
+ /* Clip the banner to the card's own radius: when a consumer adds a border,
24
+ the banner's equal corner radius no longer nests inside it and leaves a
25
+ notch at the corner. Nothing inside renders out of the box. */
26
+ overflow: hidden;
27
+ }
28
+
29
+ /* The status pill and copy control top-align to the FIRST prompt row (their
30
+ heights are capped to the prompt line, so on a multi-line command they sit
31
+ with the first command instead of floating mid-banner). */
32
+ .header {
33
+ display: flex;
34
+ align-items: flex-start;
35
+ gap: 12px;
36
+ /* Pulled back across the card's gutter padding so the banner spans the FULL
37
+ surface, then re-inset by the same amount so the prompt text and the dot
38
+ keep their positions. The banner shares the card's own surface (no banner
39
+ token): the l2 divider below is the section boundary. */
40
+ margin-left: calc(-1 * var(--dsl-terminal-gutter));
41
+ padding: 9px 14px 9px var(--dsl-terminal-gutter);
42
+ border-top-left-radius: var(--dsl-terminal-radius);
43
+ border-top-right-radius: var(--dsl-terminal-radius);
44
+ /* A long multi-line command scrolls inside the banner (same cap as the
45
+ IN/OUT card's sections) instead of pushing the output off screen. */
46
+ max-height: 150px;
47
+ overflow-y: auto;
48
+ }
49
+
50
+ /* Banner scrollbar floats off the card edge like the output's. */
51
+ .header::-webkit-scrollbar-thumb {
52
+ border: 2px solid transparent;
53
+ background-clip: padding-box;
54
+ border-radius: var(--dsw-radius-sm);
55
+ }
56
+
57
+ .header::-webkit-scrollbar-track {
58
+ margin: 6px;
59
+ }
60
+
61
+ /* Full-width l2 hairline between the command banner and the body — the same
62
+ divider the IN/OUT card draws between its sections. A banner-only card (a
63
+ running command that has printed nothing yet) draws none. */
64
+ .block[data-body] .header {
65
+ border-bottom: 0.5px solid var(--dsw-alias-border-l2);
66
+ }
67
+
68
+ /* One row per command line. The prompt column is the only element allowed to
69
+ shrink; the status pill and the copy control keep their intrinsic width. */
70
+ .prompt {
71
+ display: flex;
72
+ flex-direction: column;
73
+ min-width: 0;
74
+ flex: 1;
75
+ font: var(--dsl-terminal-font);
76
+ }
77
+
78
+ .promptLine {
79
+ position: relative;
80
+ display: flex;
81
+ align-items: baseline;
82
+ gap: 8px;
83
+ min-width: 0;
84
+ line-height: var(--dsl-terminal-line-height);
85
+ }
86
+
87
+ /* Out of flow inside the card's own gutter padding, so the reservation and the
88
+ dot move together and no consumer margin can pull them apart; the dot neither
89
+ indents its command nor depends on the command's text metrics to line up.
90
+ Centered against the first visual line box, not the code font's baseline. */
91
+ .runState {
92
+ position: absolute;
93
+ left: calc(-1 * var(--dsl-terminal-gutter) + 8px);
94
+ top: calc(var(--dsl-terminal-line-height) / 2);
95
+ transform: translateY(-50%);
96
+ }
97
+
98
+ /* The dot is aria-hidden; this is its text label for assistive technology. */
99
+ .runStateLabel {
100
+ position: absolute;
101
+ width: 1px;
102
+ height: 1px;
103
+ overflow: hidden;
104
+ clip-path: inset(50%);
105
+ white-space: nowrap;
106
+ }
107
+
108
+ .cwd {
109
+ flex: none;
110
+ color: var(--dsw-alias-label-tertiary);
111
+ }
112
+
113
+ /* Each authored command line scrolls independently of its prompt and status.
114
+ `pre` preserves whitespace; hosts can opt into wrapping with `pre-wrap`. */
115
+ .command {
116
+ --dsl-command-whitespace: var(--dsl-terminal-command-whitespace, pre);
117
+ color: var(--dsw-alias-label-primary);
118
+ }
119
+
120
+ /* Capped to the prompt's line height (Pill's own 24px height would exceed a
121
+ smaller-font prompt row and stretch the banner). Sticky against the
122
+ banner's own scroll so the pill and the copy control stay in reach while a
123
+ long command scrolls underneath. */
124
+ .status {
125
+ flex: none;
126
+ position: sticky;
127
+ top: 0;
128
+ height: var(--dsl-terminal-line-height);
129
+ color: var(--dsw-alias-state-error-primary);
130
+ }
131
+
132
+ .copyButton {
133
+ flex: none;
134
+ position: sticky;
135
+ top: 0;
136
+ /* Card surface, not transparent: the control is sticky over the banner's
137
+ own scroll, so scrolled command text must not bleed through it. */
138
+ background-color: var(--dsw-alias-markdown-code-block);
139
+ border: none;
140
+ padding: 0;
141
+ margin: 0;
142
+ color: var(--dsw-alias-label-secondary);
143
+ cursor: pointer;
144
+ font: var(--dsw-font-xs-13);
145
+ line-height: var(--dsl-terminal-line-height);
146
+ }
147
+
148
+ /* Vertical scrolling lives on the OUTPUT, not the card root: a root scroller
149
+ would run its scrollbar over the banner (and the copy control), while here
150
+ the banner stays pinned and the bar sits inside the output's right padding.
151
+ Unset, the max-height is none and the auto overflow never engages. */
152
+ .output {
153
+ max-height: var(--dsl-terminal-output-max-height, none);
154
+ padding: 12px 14px 12px 0;
155
+ font: var(--dsl-terminal-font);
156
+ overflow-x: auto;
157
+ overflow-y: auto;
158
+ }
159
+
160
+ /* Both output scrollbars (vertical cap, horizontal pre overflow) float 2px
161
+ off the card edge: a transparent border clips the thumb inward so it never
162
+ hugs the rounded corner. */
163
+ .output::-webkit-scrollbar-thumb {
164
+ border: 2px solid transparent;
165
+ background-clip: padding-box;
166
+ border-radius: var(--dsw-radius-sm);
167
+ }
168
+
169
+ /* Track end-margins keep the thumb's travel out of the card's rounded
170
+ corners in both directions. */
171
+ .output::-webkit-scrollbar-track {
172
+ margin: 6px;
173
+ }
174
+
175
+ /* Default `pre`: alignment is the payload of terminal output. Hosts opt
176
+ into wrapping long lines by rebinding the variable to `pre-wrap`, which
177
+ also keeps the output region from ever scrolling sideways; overflow-wrap
178
+ is inert while white-space stays `pre`. */
179
+ .line {
180
+ min-height: var(--dsl-terminal-line-height);
181
+ white-space: var(--dsl-terminal-line-whitespace, pre);
182
+ overflow-wrap: anywhere;
183
+ }
184
+
185
+ .expand {
186
+ display: block;
187
+ width: 100%;
188
+ padding: 0;
189
+ border: none;
190
+ background-color: transparent;
191
+ color: var(--dsw-alias-label-tertiary);
192
+ cursor: pointer;
193
+ font: inherit;
194
+ text-align: left;
195
+ }
196
+
197
+ @media (hover: hover) {
198
+ .expand:hover {
199
+ color: var(--dsw-alias-label-secondary);
200
+ }
201
+ }
202
+
203
+ .empty {
204
+ padding: 12px 14px 12px 0;
205
+ font: var(--dsl-terminal-font);
206
+ color: var(--dsw-alias-label-tertiary);
207
+ }