dishui 0.0.64 → 0.0.66

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 (504) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +10 -11
  2. package/dist/chart.js +12 -46
  3. package/dist/code-editor.js +16 -43
  4. package/dist/components/Badge/index.js +11 -13
  5. package/dist/components/Badge/index.js.map +1 -1
  6. package/dist/components/Button/index.js +62 -86
  7. package/dist/components/Button/index.js.map +1 -1
  8. package/dist/components/Card/index.d.ts +87 -0
  9. package/dist/components/Card/index.js +178 -44
  10. package/dist/components/Card/index.js.map +1 -1
  11. package/dist/components/Chart/Chart.js +25 -25
  12. package/dist/components/Chart/Chart.js.map +1 -1
  13. package/dist/components/Checkbox/index.js +57 -63
  14. package/dist/components/Checkbox/index.js.map +1 -1
  15. package/dist/components/ChoicePicker/index.d.ts +44 -0
  16. package/dist/components/ChoicePicker/index.js +81 -0
  17. package/dist/components/ChoicePicker/index.js.map +1 -0
  18. package/dist/components/Column/index.d.ts +28 -0
  19. package/dist/components/Column/index.js +30 -0
  20. package/dist/components/Column/index.js.map +1 -0
  21. package/dist/components/DateTimeInput/index.d.ts +44 -0
  22. package/dist/components/DateTimeInput/index.js +48 -0
  23. package/dist/components/DateTimeInput/index.js.map +1 -0
  24. package/dist/components/Demo/index.js +107 -107
  25. package/dist/components/Demo/index.js.map +1 -1
  26. package/dist/components/Divider/index.d.ts +20 -0
  27. package/dist/components/Divider/index.js +30 -0
  28. package/dist/components/Divider/index.js.map +1 -0
  29. package/dist/components/EmptyState/index.d.ts +4 -1
  30. package/dist/components/EmptyState/index.js +24 -24
  31. package/dist/components/EmptyState/index.js.map +1 -1
  32. package/dist/components/FileUploader/DropZone.js +134 -136
  33. package/dist/components/FileUploader/DropZone.js.map +1 -1
  34. package/dist/components/FileUploader/FileItem.js +159 -163
  35. package/dist/components/FileUploader/FileItem.js.map +1 -1
  36. package/dist/components/FileUploader/FileUploader.js +126 -127
  37. package/dist/components/FileUploader/FileUploader.js.map +1 -1
  38. package/dist/components/FileUploader/UploadQueue.js +62 -62
  39. package/dist/components/FileUploader/UploadQueue.js.map +1 -1
  40. package/dist/components/FloatWindow/index.d.ts +28 -0
  41. package/dist/components/GridLayout/index.d.ts +42 -0
  42. package/dist/components/Icon/index.d.ts +24 -0
  43. package/dist/components/Icon/index.js +26 -0
  44. package/dist/components/Icon/index.js.map +1 -0
  45. package/dist/components/Image/index.d.ts +33 -0
  46. package/dist/components/Image/index.js +44 -0
  47. package/dist/components/Image/index.js.map +1 -0
  48. package/dist/components/Input/index.js +196 -197
  49. package/dist/components/Input/index.js.map +1 -1
  50. package/dist/components/Label/index.js +62 -73
  51. package/dist/components/Label/index.js.map +1 -1
  52. package/dist/components/Layout/index.js +134 -139
  53. package/dist/components/Layout/index.js.map +1 -1
  54. package/dist/components/List/index.js +45 -43
  55. package/dist/components/List/index.js.map +1 -1
  56. package/dist/components/Markdown/Markdown.js +106 -103
  57. package/dist/components/Markdown/Markdown.js.map +1 -1
  58. package/dist/components/Markdown/codeThemes.js +24 -33
  59. package/dist/components/Markdown/codeThemes.js.map +1 -1
  60. package/dist/components/Markdown/markdownComponents.js +203 -208
  61. package/dist/components/Markdown/markdownComponents.js.map +1 -1
  62. package/dist/components/Markdown/parseCodeBlockMeta.js +22 -22
  63. package/dist/components/Markdown/parseCodeBlockMeta.js.map +1 -1
  64. package/dist/components/Markdown/useMarkdownSource.js +46 -46
  65. package/dist/components/Markdown/useMarkdownSource.js.map +1 -1
  66. package/dist/components/Markdown/useMarkmapRenderer.js +35 -36
  67. package/dist/components/Markdown/useMarkmapRenderer.js.map +1 -1
  68. package/dist/components/Markdown/useMermaidRenderer.js +41 -42
  69. package/dist/components/Markdown/useMermaidRenderer.js.map +1 -1
  70. package/dist/components/Modal/index.d.ts +7 -3
  71. package/dist/components/Modal/index.js +82 -70
  72. package/dist/components/Modal/index.js.map +1 -1
  73. package/dist/components/MultipleChoice/index.d.ts +44 -0
  74. package/dist/components/MultipleChoice/index.js +52 -0
  75. package/dist/components/MultipleChoice/index.js.map +1 -0
  76. package/dist/components/Notification/index.d.ts +17 -0
  77. package/dist/components/Page/index.d.ts +58 -0
  78. package/dist/components/Page/index.js +43 -0
  79. package/dist/components/Page/index.js.map +1 -0
  80. package/dist/components/PageHeader/index.js +28 -28
  81. package/dist/components/PageHeader/index.js.map +1 -1
  82. package/dist/components/ProtectedRoute/index.js +8 -9
  83. package/dist/components/ProtectedRoute/index.js.map +1 -1
  84. package/dist/components/Row/index.d.ts +28 -0
  85. package/dist/components/Row/index.js +30 -0
  86. package/dist/components/Row/index.js.map +1 -0
  87. package/dist/components/Select/index.js +251 -257
  88. package/dist/components/Select/index.js.map +1 -1
  89. package/dist/components/SidebarToggleButton/index.js +56 -59
  90. package/dist/components/SidebarToggleButton/index.js.map +1 -1
  91. package/dist/components/Slider/index.d.ts +39 -0
  92. package/dist/components/Slider/index.js +52 -0
  93. package/dist/components/Slider/index.js.map +1 -0
  94. package/dist/components/StatCard/index.d.ts +31 -1
  95. package/dist/components/StatCard/index.js +189 -58
  96. package/dist/components/StatCard/index.js.map +1 -1
  97. package/dist/components/Switch/index.d.ts +34 -0
  98. package/dist/components/Switch/index.js +55 -0
  99. package/dist/components/Switch/index.js.map +1 -0
  100. package/dist/components/Tab/index.d.ts +40 -0
  101. package/dist/components/Table/index.js +109 -103
  102. package/dist/components/Table/index.js.map +1 -1
  103. package/dist/components/Tabs/index.d.ts +19 -5
  104. package/dist/components/Tabs/index.js +30 -21
  105. package/dist/components/Tabs/index.js.map +1 -1
  106. package/dist/components/Text/index.d.ts +43 -0
  107. package/dist/components/Text/index.js +55 -0
  108. package/dist/components/Text/index.js.map +1 -0
  109. package/dist/components/Tooltip/index.d.ts +23 -0
  110. package/dist/components/Tooltip/index.js +34 -0
  111. package/dist/components/Tooltip/index.js.map +1 -0
  112. package/dist/components/Tree/Tree.js +205 -205
  113. package/dist/components/Tree/Tree.js.map +1 -1
  114. package/dist/components/pro/ArticleContextMenu/index.js +86 -87
  115. package/dist/components/pro/ArticleContextMenu/index.js.map +1 -1
  116. package/dist/components/pro/ArticleControl/ArticleControl2.js +250 -250
  117. package/dist/components/pro/ArticleControl/ArticleControl2.js.map +1 -1
  118. package/dist/components/pro/ArticleControl/buildHeadingTree.js +31 -32
  119. package/dist/components/pro/ArticleControl/buildHeadingTree.js.map +1 -1
  120. package/dist/components/pro/ArticleControl/useArticleToc.js +100 -102
  121. package/dist/components/pro/ArticleControl/useArticleToc.js.map +1 -1
  122. package/dist/components/pro/Calendar/Calendar.d.ts +10 -0
  123. package/dist/components/pro/Calendar/hooks/useCalendarDrag.d.ts +47 -0
  124. package/dist/components/pro/Calendar/hooks/useCalendarState.d.ts +56 -0
  125. package/dist/components/pro/Calendar/index.d.ts +7 -0
  126. package/dist/components/pro/Calendar/types.d.ts +151 -0
  127. package/dist/components/pro/Calendar/utils.d.ts +94 -0
  128. package/dist/components/pro/Chat/Chat.d.ts +6 -0
  129. package/dist/components/pro/Chat/index.d.ts +2 -0
  130. package/dist/components/pro/Chat/types.d.ts +84 -0
  131. package/dist/components/pro/CodeEditor/editors/CodeEditor.js +287 -320
  132. package/dist/components/pro/CodeEditor/editors/CodeEditor.js.map +1 -1
  133. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js +167 -221
  134. package/dist/components/pro/CodeEditor/editors/MarkdownEditor.js.map +1 -1
  135. package/dist/components/pro/CodeEditor/editors/markdownExtensions.js +594 -613
  136. package/dist/components/pro/CodeEditor/editors/markdownExtensions.js.map +1 -1
  137. package/dist/components/pro/CodeEditor/extensions/contextMenu.js +54 -55
  138. package/dist/components/pro/CodeEditor/extensions/contextMenu.js.map +1 -1
  139. package/dist/components/pro/CodeEditor/extensions/index.js +152 -160
  140. package/dist/components/pro/CodeEditor/extensions/index.js.map +1 -1
  141. package/dist/components/pro/CodeEditor/langs/index.js +7 -15
  142. package/dist/components/pro/CodeEditor/langs/index.js.map +1 -1
  143. package/dist/components/pro/CodeEditor/langs/javascript.js +11 -48
  144. package/dist/components/pro/CodeEditor/langs/javascript.js.map +1 -1
  145. package/dist/components/pro/CodeEditor/langs/python.js +4 -40
  146. package/dist/components/pro/CodeEditor/langs/python.js.map +1 -1
  147. package/dist/components/pro/CodeEditor/langs/snippets.js +118 -147
  148. package/dist/components/pro/CodeEditor/langs/snippets.js.map +1 -1
  149. package/dist/components/pro/CodeEditor/panels/FootnotePanel.js +153 -153
  150. package/dist/components/pro/CodeEditor/panels/FootnotePanel.js.map +1 -1
  151. package/dist/components/pro/CodeEditor/panels/HistoryPanel.js +180 -190
  152. package/dist/components/pro/CodeEditor/panels/HistoryPanel.js.map +1 -1
  153. package/dist/components/pro/CodeEditor/panels/OutlinePanel.js +130 -137
  154. package/dist/components/pro/CodeEditor/panels/OutlinePanel.js.map +1 -1
  155. package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js +228 -242
  156. package/dist/components/pro/CodeEditor/panels/TableOfContentsPanel.js.map +1 -1
  157. package/dist/components/pro/CodeEditor/panels/VariablePanel.js +208 -248
  158. package/dist/components/pro/CodeEditor/panels/VariablePanel.js.map +1 -1
  159. package/dist/components/pro/CodeEditor/themes.js +513 -483
  160. package/dist/components/pro/CodeEditor/themes.js.map +1 -1
  161. package/dist/components/pro/CodeEditor/types.d.ts +1 -1
  162. package/dist/components/pro/CodeEditor/utils.js +171 -175
  163. package/dist/components/pro/CodeEditor/utils.js.map +1 -1
  164. package/dist/components/pro/DataTable/DataTable.js +305 -305
  165. package/dist/components/pro/DataTable/DataTable.js.map +1 -1
  166. package/dist/components/pro/DataTable/Filters.js +299 -314
  167. package/dist/components/pro/DataTable/Filters.js.map +1 -1
  168. package/dist/components/pro/DataTable/PivotPanel.js +203 -204
  169. package/dist/components/pro/DataTable/PivotPanel.js.map +1 -1
  170. package/dist/components/pro/DataTable/PivotView.js +142 -141
  171. package/dist/components/pro/DataTable/PivotView.js.map +1 -1
  172. package/dist/components/pro/DataTable/components/BulkActions.js +42 -42
  173. package/dist/components/pro/DataTable/components/BulkActions.js.map +1 -1
  174. package/dist/components/pro/DataTable/components/ColumnSelector.js +84 -84
  175. package/dist/components/pro/DataTable/components/ColumnSelector.js.map +1 -1
  176. package/dist/components/pro/DataTable/components/FilterBar.js +58 -58
  177. package/dist/components/pro/DataTable/components/FilterBar.js.map +1 -1
  178. package/dist/components/pro/DataTable/components/TableBody.js +93 -94
  179. package/dist/components/pro/DataTable/components/TableBody.js.map +1 -1
  180. package/dist/components/pro/DataTable/components/TableHeader.js +78 -78
  181. package/dist/components/pro/DataTable/components/TableHeader.js.map +1 -1
  182. package/dist/components/pro/DataTable/components/TablePagination.js +77 -77
  183. package/dist/components/pro/DataTable/components/TablePagination.js.map +1 -1
  184. package/dist/components/pro/DataTable/components/TableToolbar.js +40 -40
  185. package/dist/components/pro/DataTable/components/TableToolbar.js.map +1 -1
  186. package/dist/components/pro/DataTable/extension.js +5 -5
  187. package/dist/components/pro/DataTable/extension.js.map +1 -1
  188. package/dist/components/pro/DataTable/pivotEngine.js +84 -92
  189. package/dist/components/pro/DataTable/pivotEngine.js.map +1 -1
  190. package/dist/components/pro/DataTable/pivotExtension.js +93 -93
  191. package/dist/components/pro/DataTable/pivotExtension.js.map +1 -1
  192. package/dist/components/pro/DataTable/rowDetailExtension.js +30 -30
  193. package/dist/components/pro/DataTable/rowDetailExtension.js.map +1 -1
  194. package/dist/components/pro/DataTable/tanstack-table.js +45 -62
  195. package/dist/components/pro/DataTable/tanstack-table.js.map +1 -1
  196. package/dist/components/pro/DataTable/treeDataUtils.js +37 -48
  197. package/dist/components/pro/DataTable/treeDataUtils.js.map +1 -1
  198. package/dist/components/pro/DataTable/useColumnDragReorder.js +68 -68
  199. package/dist/components/pro/DataTable/useColumnDragReorder.js.map +1 -1
  200. package/dist/components/pro/DataTable/utils.js +156 -168
  201. package/dist/components/pro/DataTable/utils.js.map +1 -1
  202. package/dist/components/pro/FileExplorer/Breadcrumb.js +180 -180
  203. package/dist/components/pro/FileExplorer/Breadcrumb.js.map +1 -1
  204. package/dist/components/pro/FileExplorer/CreateDialog.js +78 -78
  205. package/dist/components/pro/FileExplorer/CreateDialog.js.map +1 -1
  206. package/dist/components/pro/FileExplorer/FileExplorer.js +202 -205
  207. package/dist/components/pro/FileExplorer/FileExplorer.js.map +1 -1
  208. package/dist/components/pro/FileExplorer/FileIcon.js +190 -190
  209. package/dist/components/pro/FileExplorer/FileIcon.js.map +1 -1
  210. package/dist/components/pro/FileExplorer/GridView.js +100 -100
  211. package/dist/components/pro/FileExplorer/GridView.js.map +1 -1
  212. package/dist/components/pro/FileExplorer/ListView.js +209 -209
  213. package/dist/components/pro/FileExplorer/ListView.js.map +1 -1
  214. package/dist/components/pro/FileExplorer/Toolbar.js +199 -199
  215. package/dist/components/pro/FileExplorer/Toolbar.js.map +1 -1
  216. package/dist/components/pro/Flow/Flow.js +920 -946
  217. package/dist/components/pro/Flow/Flow.js.map +1 -1
  218. package/dist/components/pro/Flow/FlowCanvas.js +1626 -1663
  219. package/dist/components/pro/Flow/FlowCanvas.js.map +1 -1
  220. package/dist/components/pro/Flow/archify/build.js +85 -94
  221. package/dist/components/pro/Flow/archify/build.js.map +1 -1
  222. package/dist/components/pro/Flow/archify/convert.js +512 -519
  223. package/dist/components/pro/Flow/archify/convert.js.map +1 -1
  224. package/dist/components/pro/Flow/archify/palette.js +87 -104
  225. package/dist/components/pro/Flow/archify/palette.js.map +1 -1
  226. package/dist/components/pro/Flow/archify/presets.js +34 -37
  227. package/dist/components/pro/Flow/archify/presets.js.map +1 -1
  228. package/dist/components/pro/Flow/archify/spec.js +7 -7
  229. package/dist/components/pro/Flow/archify/spec.js.map +1 -1
  230. package/dist/components/pro/Flow/canvas/AlignmentGuides.js +25 -25
  231. package/dist/components/pro/Flow/canvas/AlignmentGuides.js.map +1 -1
  232. package/dist/components/pro/Flow/canvas/GridRenderer.js +54 -55
  233. package/dist/components/pro/Flow/canvas/GridRenderer.js.map +1 -1
  234. package/dist/components/pro/Flow/canvas/MiniMapRenderer.js +54 -58
  235. package/dist/components/pro/Flow/canvas/MiniMapRenderer.js.map +1 -1
  236. package/dist/components/pro/Flow/canvas/PixiApp.js +105 -102
  237. package/dist/components/pro/Flow/canvas/PixiApp.js.map +1 -1
  238. package/dist/components/pro/Flow/canvas/SelectionOverlay.js +38 -38
  239. package/dist/components/pro/Flow/canvas/SelectionOverlay.js.map +1 -1
  240. package/dist/components/pro/Flow/canvas/ViewportContainer.js +117 -117
  241. package/dist/components/pro/Flow/canvas/ViewportContainer.js.map +1 -1
  242. package/dist/components/pro/Flow/constants.js +266 -278
  243. package/dist/components/pro/Flow/constants.js.map +1 -1
  244. package/dist/components/pro/Flow/context/FlowAIContext.js +27 -28
  245. package/dist/components/pro/Flow/context/FlowAIContext.js.map +1 -1
  246. package/dist/components/pro/Flow/context/FlowContext.js +60 -61
  247. package/dist/components/pro/Flow/context/FlowContext.js.map +1 -1
  248. package/dist/components/pro/Flow/context/FlowUIContext.js +115 -117
  249. package/dist/components/pro/Flow/context/FlowUIContext.js.map +1 -1
  250. package/dist/components/pro/Flow/edges/EdgeRenderer.js +135 -138
  251. package/dist/components/pro/Flow/edges/EdgeRenderer.js.map +1 -1
  252. package/dist/components/pro/Flow/edges/edgeMarkers.js +11 -14
  253. package/dist/components/pro/Flow/edges/edgeMarkers.js.map +1 -1
  254. package/dist/components/pro/Flow/edges/edgePaths.js +351 -367
  255. package/dist/components/pro/Flow/edges/edgePaths.js.map +1 -1
  256. package/dist/components/pro/Flow/hooks/useAlignmentGuides.js +49 -52
  257. package/dist/components/pro/Flow/hooks/useAlignmentGuides.js.map +1 -1
  258. package/dist/components/pro/Flow/hooks/useClipboard.js +154 -154
  259. package/dist/components/pro/Flow/hooks/useClipboard.js.map +1 -1
  260. package/dist/components/pro/Flow/hooks/useCompactMode.js +17 -17
  261. package/dist/components/pro/Flow/hooks/useCompactMode.js.map +1 -1
  262. package/dist/components/pro/Flow/hooks/useDeleteSelection.js +40 -40
  263. package/dist/components/pro/Flow/hooks/useDeleteSelection.js.map +1 -1
  264. package/dist/components/pro/Flow/hooks/useDraggablePanel.js +51 -51
  265. package/dist/components/pro/Flow/hooks/useDraggablePanel.js.map +1 -1
  266. package/dist/components/pro/Flow/hooks/useEdgeMutations.js +157 -157
  267. package/dist/components/pro/Flow/hooks/useEdgeMutations.js.map +1 -1
  268. package/dist/components/pro/Flow/hooks/useFlowImportExport.js +190 -201
  269. package/dist/components/pro/Flow/hooks/useFlowImportExport.js.map +1 -1
  270. package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js +32 -38
  271. package/dist/components/pro/Flow/hooks/useKeyboardShortcuts.js.map +1 -1
  272. package/dist/components/pro/Flow/hooks/useLayoutActions.js +172 -182
  273. package/dist/components/pro/Flow/hooks/useLayoutActions.js.map +1 -1
  274. package/dist/components/pro/Flow/hooks/useLineMutations.js +57 -57
  275. package/dist/components/pro/Flow/hooks/useLineMutations.js.map +1 -1
  276. package/dist/components/pro/Flow/hooks/useMindMap.js +229 -238
  277. package/dist/components/pro/Flow/hooks/useMindMap.js.map +1 -1
  278. package/dist/components/pro/Flow/hooks/useNodeMutations.js +102 -102
  279. package/dist/components/pro/Flow/hooks/useNodeMutations.js.map +1 -1
  280. package/dist/components/pro/Flow/hooks/usePdfExport.js +55 -56
  281. package/dist/components/pro/Flow/hooks/usePdfExport.js.map +1 -1
  282. package/dist/components/pro/Flow/hooks/usePixiApp.js +55 -57
  283. package/dist/components/pro/Flow/hooks/usePixiApp.js.map +1 -1
  284. package/dist/components/pro/Flow/hooks/useResizablePanel.js +31 -31
  285. package/dist/components/pro/Flow/hooks/useResizablePanel.js.map +1 -1
  286. package/dist/components/pro/Flow/hooks/useSelection.js +69 -69
  287. package/dist/components/pro/Flow/hooks/useSelection.js.map +1 -1
  288. package/dist/components/pro/Flow/hooks/useUndoRedo.js +27 -27
  289. package/dist/components/pro/Flow/hooks/useUndoRedo.js.map +1 -1
  290. package/dist/components/pro/Flow/hooks/useViewport.js +28 -28
  291. package/dist/components/pro/Flow/hooks/useViewport.js.map +1 -1
  292. package/dist/components/pro/Flow/lines/FreehandTool.js +63 -63
  293. package/dist/components/pro/Flow/lines/FreehandTool.js.map +1 -1
  294. package/dist/components/pro/Flow/lines/GeometricLineTool.js +80 -80
  295. package/dist/components/pro/Flow/lines/GeometricLineTool.js.map +1 -1
  296. package/dist/components/pro/Flow/lines/LineRenderer.js +88 -88
  297. package/dist/components/pro/Flow/lines/LineRenderer.js.map +1 -1
  298. package/dist/components/pro/Flow/lines/lineSmoothing.js +32 -34
  299. package/dist/components/pro/Flow/lines/lineSmoothing.js.map +1 -1
  300. package/dist/components/pro/Flow/nodes/DataNodeView.js +236 -222
  301. package/dist/components/pro/Flow/nodes/DataNodeView.js.map +1 -1
  302. package/dist/components/pro/Flow/nodes/MediaContent.js +236 -246
  303. package/dist/components/pro/Flow/nodes/MediaContent.js.map +1 -1
  304. package/dist/components/pro/Flow/nodes/MediaOverlay.js +63 -63
  305. package/dist/components/pro/Flow/nodes/MediaOverlay.js.map +1 -1
  306. package/dist/components/pro/Flow/nodes/Model3DView.js +111 -113
  307. package/dist/components/pro/Flow/nodes/Model3DView.js.map +1 -1
  308. package/dist/components/pro/Flow/nodes/NodeHandles.js +74 -80
  309. package/dist/components/pro/Flow/nodes/NodeHandles.js.map +1 -1
  310. package/dist/components/pro/Flow/nodes/NodeRenderer.js +303 -314
  311. package/dist/components/pro/Flow/nodes/NodeRenderer.js.map +1 -1
  312. package/dist/components/pro/Flow/nodes/NodeText.js +25 -29
  313. package/dist/components/pro/Flow/nodes/NodeText.js.map +1 -1
  314. package/dist/components/pro/Flow/nodes/aiClient.js +124 -137
  315. package/dist/components/pro/Flow/nodes/aiClient.js.map +1 -1
  316. package/dist/components/pro/Flow/nodes/animAnchors.js +42 -49
  317. package/dist/components/pro/Flow/nodes/animAnchors.js.map +1 -1
  318. package/dist/components/pro/Flow/nodes/dataUtils.js +246 -267
  319. package/dist/components/pro/Flow/nodes/dataUtils.js.map +1 -1
  320. package/dist/components/pro/Flow/nodes/nodeUtils.js +23 -28
  321. package/dist/components/pro/Flow/nodes/nodeUtils.js.map +1 -1
  322. package/dist/components/pro/Flow/nodes/shapes.js +556 -591
  323. package/dist/components/pro/Flow/nodes/shapes.js.map +1 -1
  324. package/dist/components/pro/Flow/nodes/svgIconTexture.js +37 -39
  325. package/dist/components/pro/Flow/nodes/svgIconTexture.js.map +1 -1
  326. package/dist/components/pro/Flow/nodes/svgIcons.js +684 -689
  327. package/dist/components/pro/Flow/nodes/svgIcons.js.map +1 -1
  328. package/dist/components/pro/Flow/panels/AIPanel.js +464 -491
  329. package/dist/components/pro/Flow/panels/AIPanel.js.map +1 -1
  330. package/dist/components/pro/Flow/panels/Breadcrumb.js +41 -41
  331. package/dist/components/pro/Flow/panels/Breadcrumb.js.map +1 -1
  332. package/dist/components/pro/Flow/panels/ContextMenu.js +37 -37
  333. package/dist/components/pro/Flow/panels/ContextMenu.js.map +1 -1
  334. package/dist/components/pro/Flow/panels/DataInspectorSection.js +428 -432
  335. package/dist/components/pro/Flow/panels/DataInspectorSection.js.map +1 -1
  336. package/dist/components/pro/Flow/panels/ExpandableTextarea.js +61 -62
  337. package/dist/components/pro/Flow/panels/ExpandableTextarea.js.map +1 -1
  338. package/dist/components/pro/Flow/panels/FlowPanelGroup.js +114 -114
  339. package/dist/components/pro/Flow/panels/FlowPanelGroup.js.map +1 -1
  340. package/dist/components/pro/Flow/panels/FlowToolbar.js +347 -391
  341. package/dist/components/pro/Flow/panels/FlowToolbar.js.map +1 -1
  342. package/dist/components/pro/Flow/panels/InspectorPanel.js +1792 -1798
  343. package/dist/components/pro/Flow/panels/InspectorPanel.js.map +1 -1
  344. package/dist/components/pro/Flow/panels/OutlinePanel.js +242 -244
  345. package/dist/components/pro/Flow/panels/OutlinePanel.js.map +1 -1
  346. package/dist/components/pro/Flow/panels/PresentationMode.js +137 -138
  347. package/dist/components/pro/Flow/panels/PresentationMode.js.map +1 -1
  348. package/dist/components/pro/Flow/panels/ProjectTitle.js +46 -46
  349. package/dist/components/pro/Flow/panels/ProjectTitle.js.map +1 -1
  350. package/dist/components/pro/Flow/panels/ShapePalette.js +557 -567
  351. package/dist/components/pro/Flow/panels/ShapePalette.js.map +1 -1
  352. package/dist/components/pro/Flow/panels/toolbarIcons.d.ts +0 -1
  353. package/dist/components/pro/Flow/panels/toolbarIcons.js +508 -557
  354. package/dist/components/pro/Flow/panels/toolbarIcons.js.map +1 -1
  355. package/dist/components/pro/Flow/types.js +26 -26
  356. package/dist/components/pro/Flow/types.js.map +1 -1
  357. package/dist/components/pro/Flow/utils/dashedLine.js +113 -117
  358. package/dist/components/pro/Flow/utils/dashedLine.js.map +1 -1
  359. package/dist/components/pro/Flow/utils/gradient.js +55 -55
  360. package/dist/components/pro/Flow/utils/gradient.js.map +1 -1
  361. package/dist/components/pro/Flow/utils/pdfExport.js +50 -89
  362. package/dist/components/pro/Flow/utils/pdfExport.js.map +1 -1
  363. package/dist/components/pro/Flow/utils/themeColor.js +185 -195
  364. package/dist/components/pro/Flow/utils/themeColor.js.map +1 -1
  365. package/dist/components/pro/Gantt/Gantt.d.ts +7 -0
  366. package/dist/components/pro/Gantt/hooks/useGanttDrag.d.ts +31 -0
  367. package/dist/components/pro/Gantt/hooks/useGanttState.d.ts +58 -0
  368. package/dist/components/pro/Gantt/index.d.ts +6 -0
  369. package/dist/components/pro/Gantt/types.d.ts +478 -0
  370. package/dist/components/pro/Gantt/utils.d.ts +124 -0
  371. package/dist/components/pro/Resizable/Resizable.d.ts +30 -0
  372. package/dist/components/pro/Resizable/index.d.ts +2 -0
  373. package/dist/components/pro/RichTextEditor/AIRewrite.js +323 -334
  374. package/dist/components/pro/RichTextEditor/AIRewrite.js.map +1 -1
  375. package/dist/components/pro/RichTextEditor/BlockHandle.js +314 -316
  376. package/dist/components/pro/RichTextEditor/BlockHandle.js.map +1 -1
  377. package/dist/components/pro/RichTextEditor/BubbleToolbar.js +97 -97
  378. package/dist/components/pro/RichTextEditor/BubbleToolbar.js.map +1 -1
  379. package/dist/components/pro/RichTextEditor/CommentDialog.js +88 -88
  380. package/dist/components/pro/RichTextEditor/CommentDialog.js.map +1 -1
  381. package/dist/components/pro/RichTextEditor/CommentPanel.js +240 -240
  382. package/dist/components/pro/RichTextEditor/CommentPanel.js.map +1 -1
  383. package/dist/components/pro/RichTextEditor/CommentPopover.js +234 -234
  384. package/dist/components/pro/RichTextEditor/CommentPopover.js.map +1 -1
  385. package/dist/components/pro/RichTextEditor/ContextMenu.js +251 -252
  386. package/dist/components/pro/RichTextEditor/ContextMenu.js.map +1 -1
  387. package/dist/components/pro/RichTextEditor/RichTextEditor.js +267 -271
  388. package/dist/components/pro/RichTextEditor/RichTextEditor.js.map +1 -1
  389. package/dist/components/pro/RichTextEditor/SlashMenu.js +214 -214
  390. package/dist/components/pro/RichTextEditor/SlashMenu.js.map +1 -1
  391. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js +44 -75
  392. package/dist/components/pro/RichTextEditor/Toolbar/ColorPicker.js.map +1 -1
  393. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js +261 -261
  394. package/dist/components/pro/RichTextEditor/Toolbar/FloatingDialogMenu.js.map +1 -1
  395. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js +172 -526
  396. package/dist/components/pro/RichTextEditor/Toolbar/MarkdownTemplates.js.map +1 -1
  397. package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js +112 -114
  398. package/dist/components/pro/RichTextEditor/Toolbar/SelectDropdown.js.map +1 -1
  399. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js +194 -194
  400. package/dist/components/pro/RichTextEditor/Toolbar/TableOpsMenu.js.map +1 -1
  401. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js +970 -973
  402. package/dist/components/pro/RichTextEditor/Toolbar/Toolbar.js.map +1 -1
  403. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js +11 -12
  404. package/dist/components/pro/RichTextEditor/Toolbar/ToolbarButton.js.map +1 -1
  405. package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js +310 -344
  406. package/dist/components/pro/RichTextEditor/extensions/CodeBlockView.js.map +1 -1
  407. package/dist/components/pro/RichTextEditor/extensions/CommentMark.js +38 -39
  408. package/dist/components/pro/RichTextEditor/extensions/CommentMark.js.map +1 -1
  409. package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js +620 -625
  410. package/dist/components/pro/RichTextEditor/extensions/FloatingDialog.js.map +1 -1
  411. package/dist/components/pro/RichTextEditor/extensions/FontSize.js +25 -25
  412. package/dist/components/pro/RichTextEditor/extensions/FontSize.js.map +1 -1
  413. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js +167 -176
  414. package/dist/components/pro/RichTextEditor/extensions/MarkdownBlock.js.map +1 -1
  415. package/dist/components/pro/RichTextEditor/types.js +75 -75
  416. package/dist/components/pro/RichTextEditor/types.js.map +1 -1
  417. package/dist/contexts/AppContext.d.ts +1 -1
  418. package/dist/contexts/AppContext.js +216 -221
  419. package/dist/contexts/AppContext.js.map +1 -1
  420. package/dist/data-table.js +15 -41
  421. package/dist/data-table.js.map +1 -1
  422. package/dist/dishui.css +1 -1
  423. package/dist/flow.js +27 -83
  424. package/dist/hooks/useClickOutside.js +18 -18
  425. package/dist/hooks/useClickOutside.js.map +1 -1
  426. package/dist/hooks/useContainerElement.js +9 -9
  427. package/dist/hooks/useContainerElement.js.map +1 -1
  428. package/dist/hooks/useControllableState.js +33 -35
  429. package/dist/hooks/useControllableState.js.map +1 -1
  430. package/dist/hooks/useCopyToClipboard.js +16 -16
  431. package/dist/hooks/useCopyToClipboard.js.map +1 -1
  432. package/dist/hooks/useDebounce.js +14 -14
  433. package/dist/hooks/useDebounce.js.map +1 -1
  434. package/dist/hooks/useDraggable.js +50 -50
  435. package/dist/hooks/useDraggable.js.map +1 -1
  436. package/dist/hooks/useTableColumns.js +39 -42
  437. package/dist/hooks/useTableColumns.js.map +1 -1
  438. package/dist/hooks/useTableData.js +67 -68
  439. package/dist/hooks/useTableData.js.map +1 -1
  440. package/dist/index-nostyled.d.ts +8 -0
  441. package/dist/index.d.ts +29 -1
  442. package/dist/index.js +106 -236
  443. package/dist/layouts/MainLayout.js +56 -56
  444. package/dist/layouts/MainLayout.js.map +1 -1
  445. package/dist/layouts/Navbar.js +214 -214
  446. package/dist/layouts/Navbar.js.map +1 -1
  447. package/dist/layouts/Sidebar.js +184 -165
  448. package/dist/layouts/Sidebar.js.map +1 -1
  449. package/dist/layouts/headbar/Headbar.js +25 -25
  450. package/dist/layouts/headbar/Headbar.js.map +1 -1
  451. package/dist/layouts/headbar/HeadbarLangSwitcher.js +39 -39
  452. package/dist/layouts/headbar/HeadbarLangSwitcher.js.map +1 -1
  453. package/dist/layouts/headbar/HeadbarSearch.js +120 -120
  454. package/dist/layouts/headbar/HeadbarSearch.js.map +1 -1
  455. package/dist/layouts/headbar/HeadbarThemeSwitcher.js +27 -27
  456. package/dist/layouts/headbar/HeadbarThemeSwitcher.js.map +1 -1
  457. package/dist/layouts/headbar/HeadbarTitle.js +26 -26
  458. package/dist/layouts/headbar/HeadbarTitle.js.map +1 -1
  459. package/dist/lite.js +9 -24
  460. package/dist/markdown.js +4 -9
  461. package/dist/pages/components/Calendar/index.d.ts +3 -0
  462. package/dist/pages/components/Calendar/index.en.d.ts +3 -0
  463. package/dist/pages/components/Calendar/index.zh.d.ts +3 -0
  464. package/dist/pages/components/Chat/index.d.ts +3 -0
  465. package/dist/pages/components/Chat/index.en.d.ts +3 -0
  466. package/dist/pages/components/Chat/index.zh.d.ts +3 -0
  467. package/dist/pages/components/FloatWindow/index.d.ts +3 -0
  468. package/dist/pages/components/FloatWindow/index.en.d.ts +3 -0
  469. package/dist/pages/components/FloatWindow/index.zh.d.ts +3 -0
  470. package/dist/pages/components/Gantt/index.d.ts +3 -0
  471. package/dist/pages/components/Gantt/index.en.d.ts +3 -0
  472. package/dist/pages/components/Gantt/index.zh.d.ts +3 -0
  473. package/dist/pages/components/GridLayout/index.d.ts +3 -0
  474. package/dist/pages/components/GridLayout/index.en.d.ts +3 -0
  475. package/dist/pages/components/GridLayout/index.zh.d.ts +3 -0
  476. package/dist/pages/components/Notification/index.d.ts +3 -0
  477. package/dist/pages/components/Notification/index.en.d.ts +3 -0
  478. package/dist/pages/components/Notification/index.zh.d.ts +3 -0
  479. package/dist/pages/components/Resizable/index.d.ts +3 -0
  480. package/dist/pages/components/Resizable/index.en.d.ts +3 -0
  481. package/dist/pages/components/Resizable/index.zh.d.ts +3 -0
  482. package/dist/pages/components/Tab/index.d.ts +3 -0
  483. package/dist/pages/components/Tab/index.en.d.ts +3 -0
  484. package/dist/pages/components/Tab/index.zh.d.ts +3 -0
  485. package/dist/styles/themeStyles.js +87 -86
  486. package/dist/styles/themeStyles.js.map +1 -1
  487. package/dist/utils/cn.d.ts +13 -0
  488. package/dist/utils/cn.js +16 -0
  489. package/dist/utils/cn.js.map +1 -0
  490. package/dist/utils/i18n.js +690 -602
  491. package/dist/utils/i18n.js.map +1 -1
  492. package/dist/utils/menu.js +94 -94
  493. package/dist/utils/menu.js.map +1 -1
  494. package/dist/utils/rehype-code-meta.js +14 -14
  495. package/dist/utils/rehype-code-meta.js.map +1 -1
  496. package/dist/utils/remark-code-meta.js +9 -9
  497. package/dist/utils/remark-code-meta.js.map +1 -1
  498. package/dist/utils/routerBuilder.js +59 -58
  499. package/dist/utils/routerBuilder.js.map +1 -1
  500. package/dist/utils/selection.js +28 -29
  501. package/dist/utils/selection.js.map +1 -1
  502. package/dist/utils/themes.js +275 -255
  503. package/dist/utils/themes.js.map +1 -1
  504. package/package.json +23 -10
@@ -1,976 +1,973 @@
1
- import { defaultLabels as E } from "../types.js";
2
- import { getNextFloatZIndex as V } from "../extensions/FloatingDialog.js";
3
- import { ToolbarButton as o, ToolbarDivider as a } from "./ToolbarButton.js";
4
- import { ColorPicker as m } from "./ColorPicker.js";
5
- import { FONT_FAMILIES as O, FONT_SIZES as R, SelectDropdown as C } from "./SelectDropdown.js";
6
- import { MarkdownTemplateMenu as U } from "./MarkdownTemplates.js";
7
- import { FloatingDialogMenu as D } from "./FloatingDialogMenu.js";
8
- import { TableOpsMenu as N } from "./TableOpsMenu.js";
9
- import { useCallback as d, useEffect as P, useState as q } from "react";
10
- import { Fragment as u, jsx as e, jsxs as i } from "react/jsx-runtime";
11
- var ne = ({ editor: t, config: l, labels: A, hasAI: B, onAIClick: v, onFormatPainterChange: g, children: M }) => {
12
- const n = {
13
- ...E,
14
- ...A
15
- }, [h, p] = q(null), c = {
16
- textFormat: l?.textFormat ?? !0,
17
- heading: l?.heading ?? !0,
18
- alignment: l?.alignment ?? !0,
19
- list: l?.list ?? !0,
20
- insert: l?.insert ?? !0,
21
- color: l?.color ?? !0,
22
- history: l?.history ?? !0,
23
- ai: l?.ai ?? !0,
24
- tableOps: l?.tableOps ?? !0,
25
- fontStyle: l?.fontStyle ?? !0,
26
- formatPainter: l?.formatPainter ?? !0
27
- }, b = d(() => {
28
- const r = t.getAttributes("link").href, s = window.prompt(n.insertLinkUrl, r);
29
- if (s !== null) {
30
- if (s === "") {
31
- t.chain().focus().extendMarkRange("link").unsetLink().run();
32
- return;
33
- }
34
- t.chain().focus().extendMarkRange("link").setLink({ href: s }).run();
35
- }
36
- }, [t, n.insertLinkUrl]), W = d(() => {
37
- const r = window.prompt(n.insertImageUrl);
38
- r && t.chain().focus().setImage({ src: r }).run();
39
- }, [t, n.insertImageUrl]), S = d(() => {
40
- t.chain().focus().insertTable({
41
- rows: 3,
42
- cols: 3,
43
- withHeaderRow: !0
44
- }).run();
45
- }, [t]), j = d(() => {
46
- t.chain().focus().insertContent({
47
- type: "codeBlock",
48
- attrs: { language: "r-markdown" },
49
- content: [{
50
- type: "text",
51
- text: `# Markdown
52
-
53
- Write your **markdown** here.`
54
- }]
55
- }).run();
56
- }, [t]), z = d((r) => {
57
- t.chain().focus().insertContent({
58
- type: "codeBlock",
59
- attrs: { language: "r-markdown" },
60
- content: [{
61
- type: "text",
62
- text: r
63
- }]
64
- }).run();
65
- }, [t]), F = d((r = "block") => {
66
- const s = r === "float" ? {
67
- x: 40,
68
- y: 40,
69
- zIndex: V(t)
70
- } : r === "block" ? {} : { width: 240 };
71
- t.chain().focus().insertContent({
72
- type: "floatingDialog",
73
- attrs: {
74
- title: "Note",
75
- layout: r,
76
- ...s
77
- },
78
- content: [{ type: "paragraph" }]
79
- }).run();
80
- }, [t]), T = d(() => {
81
- if (h) {
82
- p(null), g?.(!1);
83
- return;
84
- }
85
- const { from: r, to: s } = t.state.selection;
86
- if (r === s) return;
87
- const f = [];
88
- t.state.doc.nodesBetween(r, s, (k) => {
89
- k.marks && k.marks.forEach((x) => {
90
- f.push({
91
- type: x.type.name,
92
- attrs: x.attrs
93
- });
94
- });
95
- }), p(f), g?.(!0);
96
- }, [
97
- t,
98
- h,
99
- g
100
- ]);
101
- P(() => {
102
- if (!h) return;
103
- const r = t.view.dom, s = () => {
104
- const { from: k, to: x } = t.state.selection;
105
- if (k === x || !h) return;
106
- const { tr: y } = t.state;
107
- y.removeMark(k, x);
108
- for (const w of h) {
109
- const L = t.schema.marks[w.type];
110
- L && y.addMark(k, x, L.create(w.attrs));
111
- }
112
- t.view.dispatch(y), p(null), g?.(!1);
113
- }, f = () => {
114
- requestAnimationFrame(s);
115
- };
116
- return r.addEventListener("mouseup", f), () => {
117
- r.removeEventListener("mouseup", f);
118
- };
119
- }, [
120
- t,
121
- h,
122
- g
123
- ]);
124
- const H = t.getAttributes("textStyle").fontFamily || "", I = t.getAttributes("textStyle").fontSize || "";
125
- return /* @__PURE__ */ i("div", {
126
- className: "rte-toolbar",
127
- children: [
128
- c.history && /* @__PURE__ */ i(u, { children: [
129
- /* @__PURE__ */ e(o, {
130
- onClick: () => t.chain().focus().undo().run(),
131
- disabled: !t.can().undo(),
132
- title: n.undo,
133
- children: /* @__PURE__ */ i("svg", {
134
- width: "16",
135
- height: "16",
136
- viewBox: "0 0 24 24",
137
- fill: "none",
138
- stroke: "currentColor",
139
- strokeWidth: "2",
140
- strokeLinecap: "round",
141
- strokeLinejoin: "round",
142
- children: [/* @__PURE__ */ e("polyline", { points: "1 4 1 10 7 10" }), /* @__PURE__ */ e("path", { d: "M3.51 15a9 9 0 102.13-9.36L1 10" })]
143
- })
144
- }),
145
- /* @__PURE__ */ e(o, {
146
- onClick: () => t.chain().focus().redo().run(),
147
- disabled: !t.can().redo(),
148
- title: n.redo,
149
- children: /* @__PURE__ */ i("svg", {
150
- width: "16",
151
- height: "16",
152
- viewBox: "0 0 24 24",
153
- fill: "none",
154
- stroke: "currentColor",
155
- strokeWidth: "2",
156
- strokeLinecap: "round",
157
- strokeLinejoin: "round",
158
- children: [/* @__PURE__ */ e("polyline", { points: "23 4 23 10 17 10" }), /* @__PURE__ */ e("path", { d: "M20.49 15a9 9 0 11-2.13-9.36L23 10" })]
159
- })
160
- }),
161
- /* @__PURE__ */ e(a, {})
162
- ] }),
163
- c.fontStyle && /* @__PURE__ */ i(u, { children: [
164
- /* @__PURE__ */ e(C, {
165
- value: H,
166
- options: O,
167
- onChange: (r) => {
168
- r ? t.chain().focus().setFontFamily(r).run() : t.chain().focus().unsetFontFamily().run();
169
- },
170
- title: n.fontFamily,
171
- width: 120
172
- }),
173
- /* @__PURE__ */ e(C, {
174
- value: I,
175
- options: R,
176
- onChange: (r) => {
177
- r ? t.chain().focus().setFontSize(r).run() : t.chain().focus().unsetFontSize().run();
178
- },
179
- title: n.fontSize,
180
- width: 80
181
- }),
182
- /* @__PURE__ */ e(a, {})
183
- ] }),
184
- c.textFormat && /* @__PURE__ */ i(u, { children: [
185
- /* @__PURE__ */ e(o, {
186
- onClick: () => t.chain().focus().toggleBold().run(),
187
- isActive: t.isActive("bold"),
188
- title: n.bold,
189
- children: /* @__PURE__ */ i("svg", {
190
- width: "16",
191
- height: "16",
192
- viewBox: "0 0 24 24",
193
- fill: "none",
194
- stroke: "currentColor",
195
- strokeWidth: "2.5",
196
- strokeLinecap: "round",
197
- strokeLinejoin: "round",
198
- children: [/* @__PURE__ */ e("path", { d: "M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z" }), /* @__PURE__ */ e("path", { d: "M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z" })]
199
- })
200
- }),
201
- /* @__PURE__ */ e(o, {
202
- onClick: () => t.chain().focus().toggleItalic().run(),
203
- isActive: t.isActive("italic"),
204
- title: n.italic,
205
- children: /* @__PURE__ */ i("svg", {
206
- width: "16",
207
- height: "16",
208
- viewBox: "0 0 24 24",
209
- fill: "none",
210
- stroke: "currentColor",
211
- strokeWidth: "2",
212
- strokeLinecap: "round",
213
- strokeLinejoin: "round",
214
- children: [
215
- /* @__PURE__ */ e("line", {
216
- x1: "19",
217
- y1: "4",
218
- x2: "10",
219
- y2: "4"
220
- }),
221
- /* @__PURE__ */ e("line", {
222
- x1: "14",
223
- y1: "20",
224
- x2: "5",
225
- y2: "20"
226
- }),
227
- /* @__PURE__ */ e("line", {
228
- x1: "15",
229
- y1: "4",
230
- x2: "9",
231
- y2: "20"
232
- })
233
- ]
234
- })
235
- }),
236
- /* @__PURE__ */ e(o, {
237
- onClick: () => t.chain().focus().toggleUnderline().run(),
238
- isActive: t.isActive("underline"),
239
- title: n.underline,
240
- children: /* @__PURE__ */ i("svg", {
241
- width: "16",
242
- height: "16",
243
- viewBox: "0 0 24 24",
244
- fill: "none",
245
- stroke: "currentColor",
246
- strokeWidth: "2",
247
- strokeLinecap: "round",
248
- strokeLinejoin: "round",
249
- children: [/* @__PURE__ */ e("path", { d: "M6 3v7a6 6 0 006 6 6 6 0 006-6V3" }), /* @__PURE__ */ e("line", {
250
- x1: "4",
251
- y1: "21",
252
- x2: "20",
253
- y2: "21"
254
- })]
255
- })
256
- }),
257
- /* @__PURE__ */ e(o, {
258
- onClick: () => t.chain().focus().toggleStrike().run(),
259
- isActive: t.isActive("strike"),
260
- title: n.strikethrough,
261
- children: /* @__PURE__ */ i("svg", {
262
- width: "16",
263
- height: "16",
264
- viewBox: "0 0 24 24",
265
- fill: "none",
266
- stroke: "currentColor",
267
- strokeWidth: "2",
268
- strokeLinecap: "round",
269
- strokeLinejoin: "round",
270
- children: [
271
- /* @__PURE__ */ e("path", { d: "M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 7.2 3.3" }),
272
- /* @__PURE__ */ e("path", { d: "M13 15.1c0 2.8-2.6 3.6-5.3 3.6-1.8-.1-3.9-.5-6.2-.9" }),
273
- /* @__PURE__ */ e("line", {
274
- x1: "4",
275
- y1: "12",
276
- x2: "20",
277
- y2: "12"
278
- })
279
- ]
280
- })
281
- }),
282
- /* @__PURE__ */ e(o, {
283
- onClick: () => t.chain().focus().toggleSubscript().run(),
284
- isActive: t.isActive("subscript"),
285
- title: n.subscript,
286
- children: /* @__PURE__ */ i("span", {
287
- style: {
288
- fontSize: "13px",
289
- fontWeight: 600
290
- },
291
- children: ["X", /* @__PURE__ */ e("sub", {
292
- style: { fontSize: "9px" },
293
- children: "2"
294
- })]
295
- })
296
- }),
297
- /* @__PURE__ */ e(o, {
298
- onClick: () => t.chain().focus().toggleSuperscript().run(),
299
- isActive: t.isActive("superscript"),
300
- title: n.superscript,
301
- children: /* @__PURE__ */ i("span", {
302
- style: {
303
- fontSize: "13px",
304
- fontWeight: 600
305
- },
306
- children: ["X", /* @__PURE__ */ e("sup", {
307
- style: { fontSize: "9px" },
308
- children: "2"
309
- })]
310
- })
311
- }),
312
- c.formatPainter && /* @__PURE__ */ e(o, {
313
- onClick: T,
314
- isActive: !!h,
315
- title: h ? n.formatPainterActive : n.formatPainter,
316
- children: /* @__PURE__ */ i("svg", {
317
- width: "16",
318
- height: "16",
319
- viewBox: "0 0 24 24",
320
- fill: "none",
321
- stroke: "currentColor",
322
- strokeWidth: "2",
323
- strokeLinecap: "round",
324
- strokeLinejoin: "round",
325
- children: [
326
- /* @__PURE__ */ e("path", { d: "M19 3H5a2 2 0 00-2 2v2a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z" }),
327
- /* @__PURE__ */ e("path", { d: "M10 7v4a2 2 0 01-2 2H7" }),
328
- /* @__PURE__ */ e("path", { d: "M7 13l-3 8" }),
329
- /* @__PURE__ */ e("path", { d: "M4 21h6" })
330
- ]
331
- })
332
- }),
333
- /* @__PURE__ */ e(a, {})
334
- ] }),
335
- c.heading && /* @__PURE__ */ i(u, { children: [[
336
- 1,
337
- 2,
338
- 3,
339
- 4,
340
- 5,
341
- 6
342
- ].map((r) => /* @__PURE__ */ e(o, {
343
- onClick: () => t.chain().focus().toggleHeading({ level: r }).run(),
344
- isActive: t.isActive("heading", { level: r }),
345
- title: `${n.heading} ${r}`,
346
- children: /* @__PURE__ */ i("span", {
347
- style: {
348
- fontSize: "12px",
349
- fontWeight: 700
350
- },
351
- children: ["H", r]
352
- })
353
- }, r)), /* @__PURE__ */ e(a, {})] }),
354
- c.alignment && /* @__PURE__ */ i(u, { children: [
355
- /* @__PURE__ */ e(o, {
356
- onClick: () => t.chain().focus().setTextAlign("left").run(),
357
- isActive: t.isActive({ textAlign: "left" }),
358
- title: n.alignLeft,
359
- children: /* @__PURE__ */ i("svg", {
360
- width: "16",
361
- height: "16",
362
- viewBox: "0 0 24 24",
363
- fill: "none",
364
- stroke: "currentColor",
365
- strokeWidth: "2",
366
- strokeLinecap: "round",
367
- strokeLinejoin: "round",
368
- children: [
369
- /* @__PURE__ */ e("line", {
370
- x1: "17",
371
- y1: "10",
372
- x2: "3",
373
- y2: "10"
374
- }),
375
- /* @__PURE__ */ e("line", {
376
- x1: "21",
377
- y1: "6",
378
- x2: "3",
379
- y2: "6"
380
- }),
381
- /* @__PURE__ */ e("line", {
382
- x1: "21",
383
- y1: "14",
384
- x2: "3",
385
- y2: "14"
386
- }),
387
- /* @__PURE__ */ e("line", {
388
- x1: "17",
389
- y1: "18",
390
- x2: "3",
391
- y2: "18"
392
- })
393
- ]
394
- })
395
- }),
396
- /* @__PURE__ */ e(o, {
397
- onClick: () => t.chain().focus().setTextAlign("center").run(),
398
- isActive: t.isActive({ textAlign: "center" }),
399
- title: n.alignCenter,
400
- children: /* @__PURE__ */ i("svg", {
401
- width: "16",
402
- height: "16",
403
- viewBox: "0 0 24 24",
404
- fill: "none",
405
- stroke: "currentColor",
406
- strokeWidth: "2",
407
- strokeLinecap: "round",
408
- strokeLinejoin: "round",
409
- children: [
410
- /* @__PURE__ */ e("line", {
411
- x1: "18",
412
- y1: "10",
413
- x2: "6",
414
- y2: "10"
415
- }),
416
- /* @__PURE__ */ e("line", {
417
- x1: "21",
418
- y1: "6",
419
- x2: "3",
420
- y2: "6"
421
- }),
422
- /* @__PURE__ */ e("line", {
423
- x1: "21",
424
- y1: "14",
425
- x2: "3",
426
- y2: "14"
427
- }),
428
- /* @__PURE__ */ e("line", {
429
- x1: "18",
430
- y1: "18",
431
- x2: "6",
432
- y2: "18"
433
- })
434
- ]
435
- })
436
- }),
437
- /* @__PURE__ */ e(o, {
438
- onClick: () => t.chain().focus().setTextAlign("right").run(),
439
- isActive: t.isActive({ textAlign: "right" }),
440
- title: n.alignRight,
441
- children: /* @__PURE__ */ i("svg", {
442
- width: "16",
443
- height: "16",
444
- viewBox: "0 0 24 24",
445
- fill: "none",
446
- stroke: "currentColor",
447
- strokeWidth: "2",
448
- strokeLinecap: "round",
449
- strokeLinejoin: "round",
450
- children: [
451
- /* @__PURE__ */ e("line", {
452
- x1: "21",
453
- y1: "10",
454
- x2: "7",
455
- y2: "10"
456
- }),
457
- /* @__PURE__ */ e("line", {
458
- x1: "21",
459
- y1: "6",
460
- x2: "3",
461
- y2: "6"
462
- }),
463
- /* @__PURE__ */ e("line", {
464
- x1: "21",
465
- y1: "14",
466
- x2: "3",
467
- y2: "14"
468
- }),
469
- /* @__PURE__ */ e("line", {
470
- x1: "21",
471
- y1: "18",
472
- x2: "7",
473
- y2: "18"
474
- })
475
- ]
476
- })
477
- }),
478
- /* @__PURE__ */ e(o, {
479
- onClick: () => t.chain().focus().setTextAlign("justify").run(),
480
- isActive: t.isActive({ textAlign: "justify" }),
481
- title: n.alignJustify,
482
- children: /* @__PURE__ */ i("svg", {
483
- width: "16",
484
- height: "16",
485
- viewBox: "0 0 24 24",
486
- fill: "none",
487
- stroke: "currentColor",
488
- strokeWidth: "2",
489
- strokeLinecap: "round",
490
- strokeLinejoin: "round",
491
- children: [
492
- /* @__PURE__ */ e("line", {
493
- x1: "21",
494
- y1: "10",
495
- x2: "3",
496
- y2: "10"
497
- }),
498
- /* @__PURE__ */ e("line", {
499
- x1: "21",
500
- y1: "6",
501
- x2: "3",
502
- y2: "6"
503
- }),
504
- /* @__PURE__ */ e("line", {
505
- x1: "21",
506
- y1: "14",
507
- x2: "3",
508
- y2: "14"
509
- }),
510
- /* @__PURE__ */ e("line", {
511
- x1: "21",
512
- y1: "18",
513
- x2: "3",
514
- y2: "18"
515
- })
516
- ]
517
- })
518
- }),
519
- /* @__PURE__ */ e(a, {})
520
- ] }),
521
- c.list && /* @__PURE__ */ i(u, { children: [
522
- /* @__PURE__ */ e(o, {
523
- onClick: () => t.chain().focus().toggleBulletList().run(),
524
- isActive: t.isActive("bulletList"),
525
- title: n.bulletList,
526
- children: /* @__PURE__ */ i("svg", {
527
- width: "16",
528
- height: "16",
529
- viewBox: "0 0 24 24",
530
- fill: "none",
531
- stroke: "currentColor",
532
- strokeWidth: "2",
533
- strokeLinecap: "round",
534
- strokeLinejoin: "round",
535
- children: [
536
- /* @__PURE__ */ e("line", {
537
- x1: "8",
538
- y1: "6",
539
- x2: "21",
540
- y2: "6"
541
- }),
542
- /* @__PURE__ */ e("line", {
543
- x1: "8",
544
- y1: "12",
545
- x2: "21",
546
- y2: "12"
547
- }),
548
- /* @__PURE__ */ e("line", {
549
- x1: "8",
550
- y1: "18",
551
- x2: "21",
552
- y2: "18"
553
- }),
554
- /* @__PURE__ */ e("circle", {
555
- cx: "4",
556
- cy: "6",
557
- r: "1",
558
- fill: "currentColor"
559
- }),
560
- /* @__PURE__ */ e("circle", {
561
- cx: "4",
562
- cy: "12",
563
- r: "1",
564
- fill: "currentColor"
565
- }),
566
- /* @__PURE__ */ e("circle", {
567
- cx: "4",
568
- cy: "18",
569
- r: "1",
570
- fill: "currentColor"
571
- })
572
- ]
573
- })
574
- }),
575
- /* @__PURE__ */ e(o, {
576
- onClick: () => t.chain().focus().toggleOrderedList().run(),
577
- isActive: t.isActive("orderedList"),
578
- title: n.orderedList,
579
- children: /* @__PURE__ */ i("svg", {
580
- width: "16",
581
- height: "16",
582
- viewBox: "0 0 24 24",
583
- fill: "none",
584
- stroke: "currentColor",
585
- strokeWidth: "2",
586
- strokeLinecap: "round",
587
- strokeLinejoin: "round",
588
- children: [
589
- /* @__PURE__ */ e("line", {
590
- x1: "10",
591
- y1: "6",
592
- x2: "21",
593
- y2: "6"
594
- }),
595
- /* @__PURE__ */ e("line", {
596
- x1: "10",
597
- y1: "12",
598
- x2: "21",
599
- y2: "12"
600
- }),
601
- /* @__PURE__ */ e("line", {
602
- x1: "10",
603
- y1: "18",
604
- x2: "21",
605
- y2: "18"
606
- }),
607
- /* @__PURE__ */ e("text", {
608
- x: "2",
609
- y: "8",
610
- fontSize: "8",
611
- fill: "currentColor",
612
- stroke: "none",
613
- fontWeight: "bold",
614
- children: "1"
615
- }),
616
- /* @__PURE__ */ e("text", {
617
- x: "2",
618
- y: "14",
619
- fontSize: "8",
620
- fill: "currentColor",
621
- stroke: "none",
622
- fontWeight: "bold",
623
- children: "2"
624
- }),
625
- /* @__PURE__ */ e("text", {
626
- x: "2",
627
- y: "20",
628
- fontSize: "8",
629
- fill: "currentColor",
630
- stroke: "none",
631
- fontWeight: "bold",
632
- children: "3"
633
- })
634
- ]
635
- })
636
- }),
637
- /* @__PURE__ */ e(o, {
638
- onClick: () => t.chain().focus().toggleTaskList().run(),
639
- isActive: t.isActive("taskList"),
640
- title: n.taskList,
641
- children: /* @__PURE__ */ i("svg", {
642
- width: "16",
643
- height: "16",
644
- viewBox: "0 0 24 24",
645
- fill: "none",
646
- stroke: "currentColor",
647
- strokeWidth: "2",
648
- strokeLinecap: "round",
649
- strokeLinejoin: "round",
650
- children: [
651
- /* @__PURE__ */ e("rect", {
652
- x: "3",
653
- y: "5",
654
- width: "6",
655
- height: "6",
656
- rx: "1"
657
- }),
658
- /* @__PURE__ */ e("path", { d: "M5 8l1.5 1.5L9 6.5" }),
659
- /* @__PURE__ */ e("line", {
660
- x1: "12",
661
- y1: "8",
662
- x2: "21",
663
- y2: "8"
664
- }),
665
- /* @__PURE__ */ e("rect", {
666
- x: "3",
667
- y: "14",
668
- width: "6",
669
- height: "6",
670
- rx: "1"
671
- }),
672
- /* @__PURE__ */ e("line", {
673
- x1: "12",
674
- y1: "17",
675
- x2: "21",
676
- y2: "17"
677
- })
678
- ]
679
- })
680
- }),
681
- /* @__PURE__ */ e(a, {})
682
- ] }),
683
- c.insert && /* @__PURE__ */ i(u, { children: [
684
- /* @__PURE__ */ e(o, {
685
- onClick: () => t.chain().focus().toggleBlockquote().run(),
686
- isActive: t.isActive("blockquote"),
687
- title: n.blockquote,
688
- children: /* @__PURE__ */ i("svg", {
689
- width: "16",
690
- height: "16",
691
- viewBox: "0 0 24 24",
692
- fill: "none",
693
- stroke: "currentColor",
694
- strokeWidth: "2",
695
- strokeLinecap: "round",
696
- strokeLinejoin: "round",
697
- children: [/* @__PURE__ */ e("path", { d: "M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z" }), /* @__PURE__ */ e("path", { d: "M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z" })]
698
- })
699
- }),
700
- /* @__PURE__ */ e(o, {
701
- onClick: () => t.chain().focus().toggleNode("codeBlock", "paragraph").run(),
702
- isActive: t.isActive("codeBlock"),
703
- title: n.codeBlock,
704
- children: /* @__PURE__ */ i("svg", {
705
- width: "16",
706
- height: "16",
707
- viewBox: "0 0 24 24",
708
- fill: "none",
709
- stroke: "currentColor",
710
- strokeWidth: "2",
711
- strokeLinecap: "round",
712
- strokeLinejoin: "round",
713
- children: [/* @__PURE__ */ e("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ e("polyline", { points: "8 6 2 12 8 18" })]
714
- })
715
- }),
716
- /* @__PURE__ */ e(o, {
717
- onClick: () => {
718
- t.chain().focus().insertContent({
719
- type: "codeBlock",
720
- attrs: { language: "r-mermaid" },
721
- content: [{
722
- type: "text",
723
- text: `graph TD
724
- A[Start] --> B[End]`
725
- }]
726
- }).run();
727
- },
728
- title: n.mermaidBlock,
729
- children: /* @__PURE__ */ i("svg", {
730
- width: "16",
731
- height: "16",
732
- viewBox: "0 0 24 24",
733
- fill: "none",
734
- stroke: "currentColor",
735
- strokeWidth: "2",
736
- strokeLinecap: "round",
737
- strokeLinejoin: "round",
738
- children: [
739
- /* @__PURE__ */ e("circle", {
740
- cx: "6",
741
- cy: "6",
742
- r: "3"
743
- }),
744
- /* @__PURE__ */ e("circle", {
745
- cx: "18",
746
- cy: "6",
747
- r: "3"
748
- }),
749
- /* @__PURE__ */ e("circle", {
750
- cx: "12",
751
- cy: "18",
752
- r: "3"
753
- }),
754
- /* @__PURE__ */ e("line", {
755
- x1: "6",
756
- y1: "9",
757
- x2: "12",
758
- y2: "15"
759
- }),
760
- /* @__PURE__ */ e("line", {
761
- x1: "18",
762
- y1: "9",
763
- x2: "12",
764
- y2: "15"
765
- })
766
- ]
767
- })
768
- }),
769
- /* @__PURE__ */ e(o, {
770
- onClick: b,
771
- isActive: t.isActive("link"),
772
- title: n.link,
773
- children: /* @__PURE__ */ i("svg", {
774
- width: "16",
775
- height: "16",
776
- viewBox: "0 0 24 24",
777
- fill: "none",
778
- stroke: "currentColor",
779
- strokeWidth: "2",
780
- strokeLinecap: "round",
781
- strokeLinejoin: "round",
782
- children: [/* @__PURE__ */ e("path", { d: "M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ e("path", { d: "M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71" })]
783
- })
784
- }),
785
- /* @__PURE__ */ e(o, {
786
- onClick: W,
787
- title: n.image,
788
- children: /* @__PURE__ */ i("svg", {
789
- width: "16",
790
- height: "16",
791
- viewBox: "0 0 24 24",
792
- fill: "none",
793
- stroke: "currentColor",
794
- strokeWidth: "2",
795
- strokeLinecap: "round",
796
- strokeLinejoin: "round",
797
- children: [
798
- /* @__PURE__ */ e("rect", {
799
- x: "3",
800
- y: "3",
801
- width: "18",
802
- height: "18",
803
- rx: "2",
804
- ry: "2"
805
- }),
806
- /* @__PURE__ */ e("circle", {
807
- cx: "8.5",
808
- cy: "8.5",
809
- r: "1.5"
810
- }),
811
- /* @__PURE__ */ e("polyline", { points: "21 15 16 10 5 21" })
812
- ]
813
- })
814
- }),
815
- /* @__PURE__ */ e(o, {
816
- onClick: S,
817
- title: n.table,
818
- children: /* @__PURE__ */ i("svg", {
819
- width: "16",
820
- height: "16",
821
- viewBox: "0 0 24 24",
822
- fill: "none",
823
- stroke: "currentColor",
824
- strokeWidth: "2",
825
- strokeLinecap: "round",
826
- strokeLinejoin: "round",
827
- children: [
828
- /* @__PURE__ */ e("rect", {
829
- x: "3",
830
- y: "3",
831
- width: "18",
832
- height: "18",
833
- rx: "2"
834
- }),
835
- /* @__PURE__ */ e("line", {
836
- x1: "3",
837
- y1: "9",
838
- x2: "21",
839
- y2: "9"
840
- }),
841
- /* @__PURE__ */ e("line", {
842
- x1: "3",
843
- y1: "15",
844
- x2: "21",
845
- y2: "15"
846
- }),
847
- /* @__PURE__ */ e("line", {
848
- x1: "9",
849
- y1: "3",
850
- x2: "9",
851
- y2: "21"
852
- }),
853
- /* @__PURE__ */ e("line", {
854
- x1: "15",
855
- y1: "3",
856
- x2: "15",
857
- y2: "21"
858
- })
859
- ]
860
- })
861
- }),
862
- c.tableOps && /* @__PURE__ */ e(N, {
863
- editor: t,
864
- labels: n
865
- }),
866
- /* @__PURE__ */ e(o, {
867
- onClick: () => t.chain().focus().setHorizontalRule().run(),
868
- title: n.horizontalRule,
869
- children: /* @__PURE__ */ e("svg", {
870
- width: "16",
871
- height: "16",
872
- viewBox: "0 0 24 24",
873
- fill: "none",
874
- stroke: "currentColor",
875
- strokeWidth: "2",
876
- strokeLinecap: "round",
877
- children: /* @__PURE__ */ e("line", {
878
- x1: "3",
879
- y1: "12",
880
- x2: "21",
881
- y2: "12"
882
- })
883
- })
884
- }),
885
- /* @__PURE__ */ e(o, {
886
- onClick: j,
887
- title: n.markdownBlock,
888
- children: /* @__PURE__ */ i("svg", {
889
- width: "16",
890
- height: "16",
891
- viewBox: "0 0 24 24",
892
- fill: "none",
893
- stroke: "currentColor",
894
- strokeWidth: "2",
895
- strokeLinecap: "round",
896
- strokeLinejoin: "round",
897
- children: [
898
- /* @__PURE__ */ e("path", { d: "M2 3h20v18H2z" }),
899
- /* @__PURE__ */ e("path", { d: "M5 15V9l3 3.5L11 9v6" }),
900
- /* @__PURE__ */ e("path", { d: "M17 9l-2.5 3H17v3" })
901
- ]
902
- })
903
- }),
904
- /* @__PURE__ */ e(U, {
905
- labels: n,
906
- onSelect: z
907
- }),
908
- /* @__PURE__ */ e(D, {
909
- labels: n,
910
- onInsert: F
911
- }),
912
- /* @__PURE__ */ e(a, {})
913
- ] }),
914
- c.color && /* @__PURE__ */ i(u, { children: [
915
- /* @__PURE__ */ e(m, {
916
- value: t.getAttributes("textStyle").color || "",
917
- onChange: (r) => {
918
- r ? t.chain().focus().setColor(r).run() : t.chain().focus().unsetColor().run();
919
- },
920
- title: n.color,
921
- icon: /* @__PURE__ */ e("svg", {
922
- width: "16",
923
- height: "16",
924
- viewBox: "0 0 24 24",
925
- fill: "none",
926
- stroke: "currentColor",
927
- strokeWidth: "2",
928
- strokeLinecap: "round",
929
- strokeLinejoin: "round",
930
- children: /* @__PURE__ */ e("path", { d: "M12 2L2 22h20L12 2z" })
931
- })
932
- }),
933
- /* @__PURE__ */ e(m, {
934
- value: t.getAttributes("highlight").color || "",
935
- onChange: (r) => {
936
- r ? t.chain().focus().toggleHighlight({ color: r }).run() : t.chain().focus().unsetHighlight().run();
937
- },
938
- title: n.highlight,
939
- icon: /* @__PURE__ */ i("svg", {
940
- width: "16",
941
- height: "16",
942
- viewBox: "0 0 24 24",
943
- fill: "none",
944
- stroke: "currentColor",
945
- strokeWidth: "2",
946
- strokeLinecap: "round",
947
- strokeLinejoin: "round",
948
- children: [/* @__PURE__ */ e("path", { d: "M12 20h9" }), /* @__PURE__ */ e("path", { d: "M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" })]
949
- })
950
- }),
951
- /* @__PURE__ */ e(a, {})
952
- ] }),
953
- c.ai && B && v && /* @__PURE__ */ e(o, {
954
- onClick: v,
955
- title: n.ai,
956
- children: /* @__PURE__ */ i("svg", {
957
- width: "16",
958
- height: "16",
959
- viewBox: "0 0 24 24",
960
- fill: "none",
961
- stroke: "currentColor",
962
- strokeWidth: "2",
963
- strokeLinecap: "round",
964
- strokeLinejoin: "round",
965
- children: [/* @__PURE__ */ e("path", { d: "M9.5 2A2.5 2.5 0 0112 4.5v15a2.5 2.5 0 01-4.96.44 2.5 2.5 0 01-2.96-3.08 3 3 0 01-.34-5.58 2.5 2.5 0 011.32-4.24 2.5 2.5 0 011.98-3A2.5 2.5 0 019.5 2z" }), /* @__PURE__ */ e("path", { d: "M14.5 2A2.5 2.5 0 0012 4.5v15a2.5 2.5 0 004.96.44 2.5 2.5 0 002.96-3.08 3 3 0 00.34-5.58 2.5 2.5 0 00-1.32-4.24 2.5 2.5 0 00-1.98-3A2.5 2.5 0 0014.5 2z" })]
966
- })
967
- }),
968
- M
969
- ]
970
- });
971
- };
972
- export {
973
- ne as default
1
+ import { defaultLabels as e } from "../types.js";
2
+ import { getNextFloatZIndex as t } from "../extensions/FloatingDialog.js";
3
+ import { ToolbarButton as n, ToolbarDivider as r } from "./ToolbarButton.js";
4
+ import { ColorPicker as i } from "./ColorPicker.js";
5
+ import { FONT_FAMILIES as a, FONT_SIZES as o, SelectDropdown as s } from "./SelectDropdown.js";
6
+ import { MarkdownTemplateMenu as c } from "./MarkdownTemplates.js";
7
+ import { FloatingDialogMenu as l } from "./FloatingDialogMenu.js";
8
+ import { TableOpsMenu as u } from "./TableOpsMenu.js";
9
+ import { useCallback as d, useEffect as f, useState as p } from "react";
10
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
11
+ //#region src/components/pro/RichTextEditor/Toolbar/Toolbar.tsx
12
+ var _ = ({ editor: _, config: v, labels: y, hasAI: b, onAIClick: x, onFormatPainterChange: S, children: C }) => {
13
+ let w = {
14
+ ...e,
15
+ ...y
16
+ }, [T, E] = p(null), D = {
17
+ textFormat: v?.textFormat ?? !0,
18
+ heading: v?.heading ?? !0,
19
+ alignment: v?.alignment ?? !0,
20
+ list: v?.list ?? !0,
21
+ insert: v?.insert ?? !0,
22
+ color: v?.color ?? !0,
23
+ history: v?.history ?? !0,
24
+ ai: v?.ai ?? !0,
25
+ tableOps: v?.tableOps ?? !0,
26
+ fontStyle: v?.fontStyle ?? !0,
27
+ formatPainter: v?.formatPainter ?? !0
28
+ }, O = d(() => {
29
+ let e = _.getAttributes("link").href, t = window.prompt(w.insertLinkUrl, e);
30
+ if (t !== null) {
31
+ if (t === "") {
32
+ _.chain().focus().extendMarkRange("link").unsetLink().run();
33
+ return;
34
+ }
35
+ _.chain().focus().extendMarkRange("link").setLink({ href: t }).run();
36
+ }
37
+ }, [_, w.insertLinkUrl]), k = d(() => {
38
+ let e = window.prompt(w.insertImageUrl);
39
+ e && _.chain().focus().setImage({ src: e }).run();
40
+ }, [_, w.insertImageUrl]), A = d(() => {
41
+ _.chain().focus().insertTable({
42
+ rows: 3,
43
+ cols: 3,
44
+ withHeaderRow: !0
45
+ }).run();
46
+ }, [_]), j = d(() => {
47
+ _.chain().focus().insertContent({
48
+ type: "codeBlock",
49
+ attrs: { language: "r-markdown" },
50
+ content: [{
51
+ type: "text",
52
+ text: "# Markdown\n\nWrite your **markdown** here."
53
+ }]
54
+ }).run();
55
+ }, [_]), M = d((e) => {
56
+ _.chain().focus().insertContent({
57
+ type: "codeBlock",
58
+ attrs: { language: "r-markdown" },
59
+ content: [{
60
+ type: "text",
61
+ text: e
62
+ }]
63
+ }).run();
64
+ }, [_]), N = d((e = "block") => {
65
+ let n = e === "float" ? {
66
+ x: 40,
67
+ y: 40,
68
+ zIndex: t(_)
69
+ } : e === "block" ? {} : { width: 240 };
70
+ _.chain().focus().insertContent({
71
+ type: "floatingDialog",
72
+ attrs: {
73
+ title: "Note",
74
+ layout: e,
75
+ ...n
76
+ },
77
+ content: [{ type: "paragraph" }]
78
+ }).run();
79
+ }, [_]), P = d(() => {
80
+ if (T) {
81
+ E(null), S?.(!1);
82
+ return;
83
+ }
84
+ let { from: e, to: t } = _.state.selection;
85
+ if (e === t) return;
86
+ let n = [];
87
+ _.state.doc.nodesBetween(e, t, (e) => {
88
+ e.marks && e.marks.forEach((e) => {
89
+ n.push({
90
+ type: e.type.name,
91
+ attrs: e.attrs
92
+ });
93
+ });
94
+ }), E(n), S?.(!0);
95
+ }, [
96
+ _,
97
+ T,
98
+ S
99
+ ]);
100
+ f(() => {
101
+ if (!T) return;
102
+ let e = _.view.dom, t = () => {
103
+ let { from: e, to: t } = _.state.selection;
104
+ if (e === t || !T) return;
105
+ let { tr: n } = _.state;
106
+ n.removeMark(e, t);
107
+ for (let r of T) {
108
+ let i = _.schema.marks[r.type];
109
+ i && n.addMark(e, t, i.create(r.attrs));
110
+ }
111
+ _.view.dispatch(n), E(null), S?.(!1);
112
+ }, n = () => {
113
+ requestAnimationFrame(t);
114
+ };
115
+ return e.addEventListener("mouseup", n), () => {
116
+ e.removeEventListener("mouseup", n);
117
+ };
118
+ }, [
119
+ _,
120
+ T,
121
+ S
122
+ ]);
123
+ let F = _.getAttributes("textStyle").fontFamily || "", I = _.getAttributes("textStyle").fontSize || "";
124
+ return /* @__PURE__ */ g("div", {
125
+ className: "rte-toolbar",
126
+ children: [
127
+ D.history && /* @__PURE__ */ g(m, { children: [
128
+ /* @__PURE__ */ h(n, {
129
+ onClick: () => _.chain().focus().undo().run(),
130
+ disabled: !_.can().undo(),
131
+ title: w.undo,
132
+ children: /* @__PURE__ */ g("svg", {
133
+ width: "16",
134
+ height: "16",
135
+ viewBox: "0 0 24 24",
136
+ fill: "none",
137
+ stroke: "currentColor",
138
+ strokeWidth: "2",
139
+ strokeLinecap: "round",
140
+ strokeLinejoin: "round",
141
+ children: [/* @__PURE__ */ h("polyline", { points: "1 4 1 10 7 10" }), /* @__PURE__ */ h("path", { d: "M3.51 15a9 9 0 102.13-9.36L1 10" })]
142
+ })
143
+ }),
144
+ /* @__PURE__ */ h(n, {
145
+ onClick: () => _.chain().focus().redo().run(),
146
+ disabled: !_.can().redo(),
147
+ title: w.redo,
148
+ children: /* @__PURE__ */ g("svg", {
149
+ width: "16",
150
+ height: "16",
151
+ viewBox: "0 0 24 24",
152
+ fill: "none",
153
+ stroke: "currentColor",
154
+ strokeWidth: "2",
155
+ strokeLinecap: "round",
156
+ strokeLinejoin: "round",
157
+ children: [/* @__PURE__ */ h("polyline", { points: "23 4 23 10 17 10" }), /* @__PURE__ */ h("path", { d: "M20.49 15a9 9 0 11-2.13-9.36L23 10" })]
158
+ })
159
+ }),
160
+ /* @__PURE__ */ h(r, {})
161
+ ] }),
162
+ D.fontStyle && /* @__PURE__ */ g(m, { children: [
163
+ /* @__PURE__ */ h(s, {
164
+ value: F,
165
+ options: a,
166
+ onChange: (e) => {
167
+ e ? _.chain().focus().setFontFamily(e).run() : _.chain().focus().unsetFontFamily().run();
168
+ },
169
+ title: w.fontFamily,
170
+ width: 120
171
+ }),
172
+ /* @__PURE__ */ h(s, {
173
+ value: I,
174
+ options: o,
175
+ onChange: (e) => {
176
+ e ? _.chain().focus().setFontSize(e).run() : _.chain().focus().unsetFontSize().run();
177
+ },
178
+ title: w.fontSize,
179
+ width: 80
180
+ }),
181
+ /* @__PURE__ */ h(r, {})
182
+ ] }),
183
+ D.textFormat && /* @__PURE__ */ g(m, { children: [
184
+ /* @__PURE__ */ h(n, {
185
+ onClick: () => _.chain().focus().toggleBold().run(),
186
+ isActive: _.isActive("bold"),
187
+ title: w.bold,
188
+ children: /* @__PURE__ */ g("svg", {
189
+ width: "16",
190
+ height: "16",
191
+ viewBox: "0 0 24 24",
192
+ fill: "none",
193
+ stroke: "currentColor",
194
+ strokeWidth: "2.5",
195
+ strokeLinecap: "round",
196
+ strokeLinejoin: "round",
197
+ children: [/* @__PURE__ */ h("path", { d: "M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z" }), /* @__PURE__ */ h("path", { d: "M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z" })]
198
+ })
199
+ }),
200
+ /* @__PURE__ */ h(n, {
201
+ onClick: () => _.chain().focus().toggleItalic().run(),
202
+ isActive: _.isActive("italic"),
203
+ title: w.italic,
204
+ children: /* @__PURE__ */ g("svg", {
205
+ width: "16",
206
+ height: "16",
207
+ viewBox: "0 0 24 24",
208
+ fill: "none",
209
+ stroke: "currentColor",
210
+ strokeWidth: "2",
211
+ strokeLinecap: "round",
212
+ strokeLinejoin: "round",
213
+ children: [
214
+ /* @__PURE__ */ h("line", {
215
+ x1: "19",
216
+ y1: "4",
217
+ x2: "10",
218
+ y2: "4"
219
+ }),
220
+ /* @__PURE__ */ h("line", {
221
+ x1: "14",
222
+ y1: "20",
223
+ x2: "5",
224
+ y2: "20"
225
+ }),
226
+ /* @__PURE__ */ h("line", {
227
+ x1: "15",
228
+ y1: "4",
229
+ x2: "9",
230
+ y2: "20"
231
+ })
232
+ ]
233
+ })
234
+ }),
235
+ /* @__PURE__ */ h(n, {
236
+ onClick: () => _.chain().focus().toggleUnderline().run(),
237
+ isActive: _.isActive("underline"),
238
+ title: w.underline,
239
+ children: /* @__PURE__ */ g("svg", {
240
+ width: "16",
241
+ height: "16",
242
+ viewBox: "0 0 24 24",
243
+ fill: "none",
244
+ stroke: "currentColor",
245
+ strokeWidth: "2",
246
+ strokeLinecap: "round",
247
+ strokeLinejoin: "round",
248
+ children: [/* @__PURE__ */ h("path", { d: "M6 3v7a6 6 0 006 6 6 6 0 006-6V3" }), /* @__PURE__ */ h("line", {
249
+ x1: "4",
250
+ y1: "21",
251
+ x2: "20",
252
+ y2: "21"
253
+ })]
254
+ })
255
+ }),
256
+ /* @__PURE__ */ h(n, {
257
+ onClick: () => _.chain().focus().toggleStrike().run(),
258
+ isActive: _.isActive("strike"),
259
+ title: w.strikethrough,
260
+ children: /* @__PURE__ */ g("svg", {
261
+ width: "16",
262
+ height: "16",
263
+ viewBox: "0 0 24 24",
264
+ fill: "none",
265
+ stroke: "currentColor",
266
+ strokeWidth: "2",
267
+ strokeLinecap: "round",
268
+ strokeLinejoin: "round",
269
+ children: [
270
+ /* @__PURE__ */ h("path", { d: "M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7 0-5.3.7-5.3 3.6 0 1.5 1.8 3.3 7.2 3.3" }),
271
+ /* @__PURE__ */ h("path", { d: "M13 15.1c0 2.8-2.6 3.6-5.3 3.6-1.8-.1-3.9-.5-6.2-.9" }),
272
+ /* @__PURE__ */ h("line", {
273
+ x1: "4",
274
+ y1: "12",
275
+ x2: "20",
276
+ y2: "12"
277
+ })
278
+ ]
279
+ })
280
+ }),
281
+ /* @__PURE__ */ h(n, {
282
+ onClick: () => _.chain().focus().toggleSubscript().run(),
283
+ isActive: _.isActive("subscript"),
284
+ title: w.subscript,
285
+ children: /* @__PURE__ */ g("span", {
286
+ style: {
287
+ fontSize: "13px",
288
+ fontWeight: 600
289
+ },
290
+ children: ["X", /* @__PURE__ */ h("sub", {
291
+ style: { fontSize: "9px" },
292
+ children: "2"
293
+ })]
294
+ })
295
+ }),
296
+ /* @__PURE__ */ h(n, {
297
+ onClick: () => _.chain().focus().toggleSuperscript().run(),
298
+ isActive: _.isActive("superscript"),
299
+ title: w.superscript,
300
+ children: /* @__PURE__ */ g("span", {
301
+ style: {
302
+ fontSize: "13px",
303
+ fontWeight: 600
304
+ },
305
+ children: ["X", /* @__PURE__ */ h("sup", {
306
+ style: { fontSize: "9px" },
307
+ children: "2"
308
+ })]
309
+ })
310
+ }),
311
+ D.formatPainter && /* @__PURE__ */ h(n, {
312
+ onClick: P,
313
+ isActive: !!T,
314
+ title: T ? w.formatPainterActive : w.formatPainter,
315
+ children: /* @__PURE__ */ g("svg", {
316
+ width: "16",
317
+ height: "16",
318
+ viewBox: "0 0 24 24",
319
+ fill: "none",
320
+ stroke: "currentColor",
321
+ strokeWidth: "2",
322
+ strokeLinecap: "round",
323
+ strokeLinejoin: "round",
324
+ children: [
325
+ /* @__PURE__ */ h("path", { d: "M19 3H5a2 2 0 00-2 2v2a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z" }),
326
+ /* @__PURE__ */ h("path", { d: "M10 7v4a2 2 0 01-2 2H7" }),
327
+ /* @__PURE__ */ h("path", { d: "M7 13l-3 8" }),
328
+ /* @__PURE__ */ h("path", { d: "M4 21h6" })
329
+ ]
330
+ })
331
+ }),
332
+ /* @__PURE__ */ h(r, {})
333
+ ] }),
334
+ D.heading && /* @__PURE__ */ g(m, { children: [[
335
+ 1,
336
+ 2,
337
+ 3,
338
+ 4,
339
+ 5,
340
+ 6
341
+ ].map((e) => /* @__PURE__ */ h(n, {
342
+ onClick: () => _.chain().focus().toggleHeading({ level: e }).run(),
343
+ isActive: _.isActive("heading", { level: e }),
344
+ title: `${w.heading} ${e}`,
345
+ children: /* @__PURE__ */ g("span", {
346
+ style: {
347
+ fontSize: "12px",
348
+ fontWeight: 700
349
+ },
350
+ children: ["H", e]
351
+ })
352
+ }, e)), /* @__PURE__ */ h(r, {})] }),
353
+ D.alignment && /* @__PURE__ */ g(m, { children: [
354
+ /* @__PURE__ */ h(n, {
355
+ onClick: () => _.chain().focus().setTextAlign("left").run(),
356
+ isActive: _.isActive({ textAlign: "left" }),
357
+ title: w.alignLeft,
358
+ children: /* @__PURE__ */ g("svg", {
359
+ width: "16",
360
+ height: "16",
361
+ viewBox: "0 0 24 24",
362
+ fill: "none",
363
+ stroke: "currentColor",
364
+ strokeWidth: "2",
365
+ strokeLinecap: "round",
366
+ strokeLinejoin: "round",
367
+ children: [
368
+ /* @__PURE__ */ h("line", {
369
+ x1: "17",
370
+ y1: "10",
371
+ x2: "3",
372
+ y2: "10"
373
+ }),
374
+ /* @__PURE__ */ h("line", {
375
+ x1: "21",
376
+ y1: "6",
377
+ x2: "3",
378
+ y2: "6"
379
+ }),
380
+ /* @__PURE__ */ h("line", {
381
+ x1: "21",
382
+ y1: "14",
383
+ x2: "3",
384
+ y2: "14"
385
+ }),
386
+ /* @__PURE__ */ h("line", {
387
+ x1: "17",
388
+ y1: "18",
389
+ x2: "3",
390
+ y2: "18"
391
+ })
392
+ ]
393
+ })
394
+ }),
395
+ /* @__PURE__ */ h(n, {
396
+ onClick: () => _.chain().focus().setTextAlign("center").run(),
397
+ isActive: _.isActive({ textAlign: "center" }),
398
+ title: w.alignCenter,
399
+ children: /* @__PURE__ */ g("svg", {
400
+ width: "16",
401
+ height: "16",
402
+ viewBox: "0 0 24 24",
403
+ fill: "none",
404
+ stroke: "currentColor",
405
+ strokeWidth: "2",
406
+ strokeLinecap: "round",
407
+ strokeLinejoin: "round",
408
+ children: [
409
+ /* @__PURE__ */ h("line", {
410
+ x1: "18",
411
+ y1: "10",
412
+ x2: "6",
413
+ y2: "10"
414
+ }),
415
+ /* @__PURE__ */ h("line", {
416
+ x1: "21",
417
+ y1: "6",
418
+ x2: "3",
419
+ y2: "6"
420
+ }),
421
+ /* @__PURE__ */ h("line", {
422
+ x1: "21",
423
+ y1: "14",
424
+ x2: "3",
425
+ y2: "14"
426
+ }),
427
+ /* @__PURE__ */ h("line", {
428
+ x1: "18",
429
+ y1: "18",
430
+ x2: "6",
431
+ y2: "18"
432
+ })
433
+ ]
434
+ })
435
+ }),
436
+ /* @__PURE__ */ h(n, {
437
+ onClick: () => _.chain().focus().setTextAlign("right").run(),
438
+ isActive: _.isActive({ textAlign: "right" }),
439
+ title: w.alignRight,
440
+ children: /* @__PURE__ */ g("svg", {
441
+ width: "16",
442
+ height: "16",
443
+ viewBox: "0 0 24 24",
444
+ fill: "none",
445
+ stroke: "currentColor",
446
+ strokeWidth: "2",
447
+ strokeLinecap: "round",
448
+ strokeLinejoin: "round",
449
+ children: [
450
+ /* @__PURE__ */ h("line", {
451
+ x1: "21",
452
+ y1: "10",
453
+ x2: "7",
454
+ y2: "10"
455
+ }),
456
+ /* @__PURE__ */ h("line", {
457
+ x1: "21",
458
+ y1: "6",
459
+ x2: "3",
460
+ y2: "6"
461
+ }),
462
+ /* @__PURE__ */ h("line", {
463
+ x1: "21",
464
+ y1: "14",
465
+ x2: "3",
466
+ y2: "14"
467
+ }),
468
+ /* @__PURE__ */ h("line", {
469
+ x1: "21",
470
+ y1: "18",
471
+ x2: "7",
472
+ y2: "18"
473
+ })
474
+ ]
475
+ })
476
+ }),
477
+ /* @__PURE__ */ h(n, {
478
+ onClick: () => _.chain().focus().setTextAlign("justify").run(),
479
+ isActive: _.isActive({ textAlign: "justify" }),
480
+ title: w.alignJustify,
481
+ children: /* @__PURE__ */ g("svg", {
482
+ width: "16",
483
+ height: "16",
484
+ viewBox: "0 0 24 24",
485
+ fill: "none",
486
+ stroke: "currentColor",
487
+ strokeWidth: "2",
488
+ strokeLinecap: "round",
489
+ strokeLinejoin: "round",
490
+ children: [
491
+ /* @__PURE__ */ h("line", {
492
+ x1: "21",
493
+ y1: "10",
494
+ x2: "3",
495
+ y2: "10"
496
+ }),
497
+ /* @__PURE__ */ h("line", {
498
+ x1: "21",
499
+ y1: "6",
500
+ x2: "3",
501
+ y2: "6"
502
+ }),
503
+ /* @__PURE__ */ h("line", {
504
+ x1: "21",
505
+ y1: "14",
506
+ x2: "3",
507
+ y2: "14"
508
+ }),
509
+ /* @__PURE__ */ h("line", {
510
+ x1: "21",
511
+ y1: "18",
512
+ x2: "3",
513
+ y2: "18"
514
+ })
515
+ ]
516
+ })
517
+ }),
518
+ /* @__PURE__ */ h(r, {})
519
+ ] }),
520
+ D.list && /* @__PURE__ */ g(m, { children: [
521
+ /* @__PURE__ */ h(n, {
522
+ onClick: () => _.chain().focus().toggleBulletList().run(),
523
+ isActive: _.isActive("bulletList"),
524
+ title: w.bulletList,
525
+ children: /* @__PURE__ */ g("svg", {
526
+ width: "16",
527
+ height: "16",
528
+ viewBox: "0 0 24 24",
529
+ fill: "none",
530
+ stroke: "currentColor",
531
+ strokeWidth: "2",
532
+ strokeLinecap: "round",
533
+ strokeLinejoin: "round",
534
+ children: [
535
+ /* @__PURE__ */ h("line", {
536
+ x1: "8",
537
+ y1: "6",
538
+ x2: "21",
539
+ y2: "6"
540
+ }),
541
+ /* @__PURE__ */ h("line", {
542
+ x1: "8",
543
+ y1: "12",
544
+ x2: "21",
545
+ y2: "12"
546
+ }),
547
+ /* @__PURE__ */ h("line", {
548
+ x1: "8",
549
+ y1: "18",
550
+ x2: "21",
551
+ y2: "18"
552
+ }),
553
+ /* @__PURE__ */ h("circle", {
554
+ cx: "4",
555
+ cy: "6",
556
+ r: "1",
557
+ fill: "currentColor"
558
+ }),
559
+ /* @__PURE__ */ h("circle", {
560
+ cx: "4",
561
+ cy: "12",
562
+ r: "1",
563
+ fill: "currentColor"
564
+ }),
565
+ /* @__PURE__ */ h("circle", {
566
+ cx: "4",
567
+ cy: "18",
568
+ r: "1",
569
+ fill: "currentColor"
570
+ })
571
+ ]
572
+ })
573
+ }),
574
+ /* @__PURE__ */ h(n, {
575
+ onClick: () => _.chain().focus().toggleOrderedList().run(),
576
+ isActive: _.isActive("orderedList"),
577
+ title: w.orderedList,
578
+ children: /* @__PURE__ */ g("svg", {
579
+ width: "16",
580
+ height: "16",
581
+ viewBox: "0 0 24 24",
582
+ fill: "none",
583
+ stroke: "currentColor",
584
+ strokeWidth: "2",
585
+ strokeLinecap: "round",
586
+ strokeLinejoin: "round",
587
+ children: [
588
+ /* @__PURE__ */ h("line", {
589
+ x1: "10",
590
+ y1: "6",
591
+ x2: "21",
592
+ y2: "6"
593
+ }),
594
+ /* @__PURE__ */ h("line", {
595
+ x1: "10",
596
+ y1: "12",
597
+ x2: "21",
598
+ y2: "12"
599
+ }),
600
+ /* @__PURE__ */ h("line", {
601
+ x1: "10",
602
+ y1: "18",
603
+ x2: "21",
604
+ y2: "18"
605
+ }),
606
+ /* @__PURE__ */ h("text", {
607
+ x: "2",
608
+ y: "8",
609
+ fontSize: "8",
610
+ fill: "currentColor",
611
+ stroke: "none",
612
+ fontWeight: "bold",
613
+ children: "1"
614
+ }),
615
+ /* @__PURE__ */ h("text", {
616
+ x: "2",
617
+ y: "14",
618
+ fontSize: "8",
619
+ fill: "currentColor",
620
+ stroke: "none",
621
+ fontWeight: "bold",
622
+ children: "2"
623
+ }),
624
+ /* @__PURE__ */ h("text", {
625
+ x: "2",
626
+ y: "20",
627
+ fontSize: "8",
628
+ fill: "currentColor",
629
+ stroke: "none",
630
+ fontWeight: "bold",
631
+ children: "3"
632
+ })
633
+ ]
634
+ })
635
+ }),
636
+ /* @__PURE__ */ h(n, {
637
+ onClick: () => _.chain().focus().toggleTaskList().run(),
638
+ isActive: _.isActive("taskList"),
639
+ title: w.taskList,
640
+ children: /* @__PURE__ */ g("svg", {
641
+ width: "16",
642
+ height: "16",
643
+ viewBox: "0 0 24 24",
644
+ fill: "none",
645
+ stroke: "currentColor",
646
+ strokeWidth: "2",
647
+ strokeLinecap: "round",
648
+ strokeLinejoin: "round",
649
+ children: [
650
+ /* @__PURE__ */ h("rect", {
651
+ x: "3",
652
+ y: "5",
653
+ width: "6",
654
+ height: "6",
655
+ rx: "1"
656
+ }),
657
+ /* @__PURE__ */ h("path", { d: "M5 8l1.5 1.5L9 6.5" }),
658
+ /* @__PURE__ */ h("line", {
659
+ x1: "12",
660
+ y1: "8",
661
+ x2: "21",
662
+ y2: "8"
663
+ }),
664
+ /* @__PURE__ */ h("rect", {
665
+ x: "3",
666
+ y: "14",
667
+ width: "6",
668
+ height: "6",
669
+ rx: "1"
670
+ }),
671
+ /* @__PURE__ */ h("line", {
672
+ x1: "12",
673
+ y1: "17",
674
+ x2: "21",
675
+ y2: "17"
676
+ })
677
+ ]
678
+ })
679
+ }),
680
+ /* @__PURE__ */ h(r, {})
681
+ ] }),
682
+ D.insert && /* @__PURE__ */ g(m, { children: [
683
+ /* @__PURE__ */ h(n, {
684
+ onClick: () => _.chain().focus().toggleBlockquote().run(),
685
+ isActive: _.isActive("blockquote"),
686
+ title: w.blockquote,
687
+ children: /* @__PURE__ */ g("svg", {
688
+ width: "16",
689
+ height: "16",
690
+ viewBox: "0 0 24 24",
691
+ fill: "none",
692
+ stroke: "currentColor",
693
+ strokeWidth: "2",
694
+ strokeLinecap: "round",
695
+ strokeLinejoin: "round",
696
+ children: [/* @__PURE__ */ h("path", { d: "M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V21z" }), /* @__PURE__ */ h("path", { d: "M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3z" })]
697
+ })
698
+ }),
699
+ /* @__PURE__ */ h(n, {
700
+ onClick: () => _.chain().focus().toggleNode("codeBlock", "paragraph").run(),
701
+ isActive: _.isActive("codeBlock"),
702
+ title: w.codeBlock,
703
+ children: /* @__PURE__ */ g("svg", {
704
+ width: "16",
705
+ height: "16",
706
+ viewBox: "0 0 24 24",
707
+ fill: "none",
708
+ stroke: "currentColor",
709
+ strokeWidth: "2",
710
+ strokeLinecap: "round",
711
+ strokeLinejoin: "round",
712
+ children: [/* @__PURE__ */ h("polyline", { points: "16 18 22 12 16 6" }), /* @__PURE__ */ h("polyline", { points: "8 6 2 12 8 18" })]
713
+ })
714
+ }),
715
+ /* @__PURE__ */ h(n, {
716
+ onClick: () => {
717
+ _.chain().focus().insertContent({
718
+ type: "codeBlock",
719
+ attrs: { language: "r-mermaid" },
720
+ content: [{
721
+ type: "text",
722
+ text: "graph TD\n A[Start] --> B[End]"
723
+ }]
724
+ }).run();
725
+ },
726
+ title: w.mermaidBlock,
727
+ children: /* @__PURE__ */ g("svg", {
728
+ width: "16",
729
+ height: "16",
730
+ viewBox: "0 0 24 24",
731
+ fill: "none",
732
+ stroke: "currentColor",
733
+ strokeWidth: "2",
734
+ strokeLinecap: "round",
735
+ strokeLinejoin: "round",
736
+ children: [
737
+ /* @__PURE__ */ h("circle", {
738
+ cx: "6",
739
+ cy: "6",
740
+ r: "3"
741
+ }),
742
+ /* @__PURE__ */ h("circle", {
743
+ cx: "18",
744
+ cy: "6",
745
+ r: "3"
746
+ }),
747
+ /* @__PURE__ */ h("circle", {
748
+ cx: "12",
749
+ cy: "18",
750
+ r: "3"
751
+ }),
752
+ /* @__PURE__ */ h("line", {
753
+ x1: "6",
754
+ y1: "9",
755
+ x2: "12",
756
+ y2: "15"
757
+ }),
758
+ /* @__PURE__ */ h("line", {
759
+ x1: "18",
760
+ y1: "9",
761
+ x2: "12",
762
+ y2: "15"
763
+ })
764
+ ]
765
+ })
766
+ }),
767
+ /* @__PURE__ */ h(n, {
768
+ onClick: O,
769
+ isActive: _.isActive("link"),
770
+ title: w.link,
771
+ children: /* @__PURE__ */ g("svg", {
772
+ width: "16",
773
+ height: "16",
774
+ viewBox: "0 0 24 24",
775
+ fill: "none",
776
+ stroke: "currentColor",
777
+ strokeWidth: "2",
778
+ strokeLinecap: "round",
779
+ strokeLinejoin: "round",
780
+ children: [/* @__PURE__ */ h("path", { d: "M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71" }), /* @__PURE__ */ h("path", { d: "M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71" })]
781
+ })
782
+ }),
783
+ /* @__PURE__ */ h(n, {
784
+ onClick: k,
785
+ title: w.image,
786
+ children: /* @__PURE__ */ g("svg", {
787
+ width: "16",
788
+ height: "16",
789
+ viewBox: "0 0 24 24",
790
+ fill: "none",
791
+ stroke: "currentColor",
792
+ strokeWidth: "2",
793
+ strokeLinecap: "round",
794
+ strokeLinejoin: "round",
795
+ children: [
796
+ /* @__PURE__ */ h("rect", {
797
+ x: "3",
798
+ y: "3",
799
+ width: "18",
800
+ height: "18",
801
+ rx: "2",
802
+ ry: "2"
803
+ }),
804
+ /* @__PURE__ */ h("circle", {
805
+ cx: "8.5",
806
+ cy: "8.5",
807
+ r: "1.5"
808
+ }),
809
+ /* @__PURE__ */ h("polyline", { points: "21 15 16 10 5 21" })
810
+ ]
811
+ })
812
+ }),
813
+ /* @__PURE__ */ h(n, {
814
+ onClick: A,
815
+ title: w.table,
816
+ children: /* @__PURE__ */ g("svg", {
817
+ width: "16",
818
+ height: "16",
819
+ viewBox: "0 0 24 24",
820
+ fill: "none",
821
+ stroke: "currentColor",
822
+ strokeWidth: "2",
823
+ strokeLinecap: "round",
824
+ strokeLinejoin: "round",
825
+ children: [
826
+ /* @__PURE__ */ h("rect", {
827
+ x: "3",
828
+ y: "3",
829
+ width: "18",
830
+ height: "18",
831
+ rx: "2"
832
+ }),
833
+ /* @__PURE__ */ h("line", {
834
+ x1: "3",
835
+ y1: "9",
836
+ x2: "21",
837
+ y2: "9"
838
+ }),
839
+ /* @__PURE__ */ h("line", {
840
+ x1: "3",
841
+ y1: "15",
842
+ x2: "21",
843
+ y2: "15"
844
+ }),
845
+ /* @__PURE__ */ h("line", {
846
+ x1: "9",
847
+ y1: "3",
848
+ x2: "9",
849
+ y2: "21"
850
+ }),
851
+ /* @__PURE__ */ h("line", {
852
+ x1: "15",
853
+ y1: "3",
854
+ x2: "15",
855
+ y2: "21"
856
+ })
857
+ ]
858
+ })
859
+ }),
860
+ D.tableOps && /* @__PURE__ */ h(u, {
861
+ editor: _,
862
+ labels: w
863
+ }),
864
+ /* @__PURE__ */ h(n, {
865
+ onClick: () => _.chain().focus().setHorizontalRule().run(),
866
+ title: w.horizontalRule,
867
+ children: /* @__PURE__ */ h("svg", {
868
+ width: "16",
869
+ height: "16",
870
+ viewBox: "0 0 24 24",
871
+ fill: "none",
872
+ stroke: "currentColor",
873
+ strokeWidth: "2",
874
+ strokeLinecap: "round",
875
+ children: /* @__PURE__ */ h("line", {
876
+ x1: "3",
877
+ y1: "12",
878
+ x2: "21",
879
+ y2: "12"
880
+ })
881
+ })
882
+ }),
883
+ /* @__PURE__ */ h(n, {
884
+ onClick: j,
885
+ title: w.markdownBlock,
886
+ children: /* @__PURE__ */ g("svg", {
887
+ width: "16",
888
+ height: "16",
889
+ viewBox: "0 0 24 24",
890
+ fill: "none",
891
+ stroke: "currentColor",
892
+ strokeWidth: "2",
893
+ strokeLinecap: "round",
894
+ strokeLinejoin: "round",
895
+ children: [
896
+ /* @__PURE__ */ h("path", { d: "M2 3h20v18H2z" }),
897
+ /* @__PURE__ */ h("path", { d: "M5 15V9l3 3.5L11 9v6" }),
898
+ /* @__PURE__ */ h("path", { d: "M17 9l-2.5 3H17v3" })
899
+ ]
900
+ })
901
+ }),
902
+ /* @__PURE__ */ h(c, {
903
+ labels: w,
904
+ onSelect: M
905
+ }),
906
+ /* @__PURE__ */ h(l, {
907
+ labels: w,
908
+ onInsert: N
909
+ }),
910
+ /* @__PURE__ */ h(r, {})
911
+ ] }),
912
+ D.color && /* @__PURE__ */ g(m, { children: [
913
+ /* @__PURE__ */ h(i, {
914
+ value: _.getAttributes("textStyle").color || "",
915
+ onChange: (e) => {
916
+ e ? _.chain().focus().setColor(e).run() : _.chain().focus().unsetColor().run();
917
+ },
918
+ title: w.color,
919
+ icon: /* @__PURE__ */ h("svg", {
920
+ width: "16",
921
+ height: "16",
922
+ viewBox: "0 0 24 24",
923
+ fill: "none",
924
+ stroke: "currentColor",
925
+ strokeWidth: "2",
926
+ strokeLinecap: "round",
927
+ strokeLinejoin: "round",
928
+ children: /* @__PURE__ */ h("path", { d: "M12 2L2 22h20L12 2z" })
929
+ })
930
+ }),
931
+ /* @__PURE__ */ h(i, {
932
+ value: _.getAttributes("highlight").color || "",
933
+ onChange: (e) => {
934
+ e ? _.chain().focus().toggleHighlight({ color: e }).run() : _.chain().focus().unsetHighlight().run();
935
+ },
936
+ title: w.highlight,
937
+ icon: /* @__PURE__ */ g("svg", {
938
+ width: "16",
939
+ height: "16",
940
+ viewBox: "0 0 24 24",
941
+ fill: "none",
942
+ stroke: "currentColor",
943
+ strokeWidth: "2",
944
+ strokeLinecap: "round",
945
+ strokeLinejoin: "round",
946
+ children: [/* @__PURE__ */ h("path", { d: "M12 20h9" }), /* @__PURE__ */ h("path", { d: "M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4L16.5 3.5z" })]
947
+ })
948
+ }),
949
+ /* @__PURE__ */ h(r, {})
950
+ ] }),
951
+ D.ai && b && x && /* @__PURE__ */ h(n, {
952
+ onClick: x,
953
+ title: w.ai,
954
+ children: /* @__PURE__ */ g("svg", {
955
+ width: "16",
956
+ height: "16",
957
+ viewBox: "0 0 24 24",
958
+ fill: "none",
959
+ stroke: "currentColor",
960
+ strokeWidth: "2",
961
+ strokeLinecap: "round",
962
+ strokeLinejoin: "round",
963
+ children: [/* @__PURE__ */ h("path", { d: "M9.5 2A2.5 2.5 0 0112 4.5v15a2.5 2.5 0 01-4.96.44 2.5 2.5 0 01-2.96-3.08 3 3 0 01-.34-5.58 2.5 2.5 0 011.32-4.24 2.5 2.5 0 011.98-3A2.5 2.5 0 019.5 2z" }), /* @__PURE__ */ h("path", { d: "M14.5 2A2.5 2.5 0 0012 4.5v15a2.5 2.5 0 004.96.44 2.5 2.5 0 002.96-3.08 3 3 0 00.34-5.58 2.5 2.5 0 00-1.32-4.24 2.5 2.5 0 00-1.98-3A2.5 2.5 0 0014.5 2z" })]
964
+ })
965
+ }),
966
+ C
967
+ ]
968
+ });
974
969
  };
970
+ //#endregion
971
+ export { _ as default };
975
972
 
976
973
  //# sourceMappingURL=Toolbar.js.map