@docyrus/ui-pro-ai-assistant 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/package.json +2 -3
  2. package/src/components/assistant-animations.tsx +0 -29
  3. package/src/components/assistant-dialogs.tsx +0 -235
  4. package/src/components/code-view.tsx +0 -278
  5. package/src/components/create-agent-task.tsx +0 -104
  6. package/src/components/create-new-work-version.tsx +0 -30
  7. package/src/components/extract-web.tsx +0 -160
  8. package/src/components/forward-to-agent.tsx +0 -90
  9. package/src/components/generate-chart.tsx +0 -101
  10. package/src/components/generative-action-button.tsx +0 -122
  11. package/src/components/generative-tool.tsx +0 -685
  12. package/src/components/generative-ui-object.tsx +0 -210
  13. package/src/components/input-area.tsx +0 -1209
  14. package/src/components/json-schema-layout.tsx +0 -326
  15. package/src/components/list-item-card.tsx +0 -92
  16. package/src/components/mermaid-diagram.tsx +0 -192
  17. package/src/components/preview-image.tsx +0 -47
  18. package/src/components/request-approval.tsx +0 -48
  19. package/src/components/request-user-input.tsx +0 -270
  20. package/src/components/search-web.tsx +0 -319
  21. package/src/components/sheet-command.tsx +0 -88
  22. package/src/components/shell-canvas.tsx +0 -122
  23. package/src/components/show-advanced-data-table.tsx +0 -352
  24. package/src/components/show-generated-content-options.tsx +0 -93
  25. package/src/components/show-people-cards.tsx +0 -180
  26. package/src/components/subagent-tool.tsx +0 -180
  27. package/src/components/text-editor-tool.tsx +0 -328
  28. package/src/components/work-canvas.tsx +0 -88
  29. package/src/components/work-card.tsx +0 -42
  30. package/src/declarations.d.ts +0 -1
  31. package/src/docy-assistant.tsx +0 -1962
  32. package/src/hooks/index.ts +0 -7
  33. package/src/hooks/use-assistant-api.ts +0 -507
  34. package/src/hooks/use-deployment-data.ts +0 -162
  35. package/src/hooks/use-project-state.ts +0 -347
  36. package/src/hooks/use-session-state.ts +0 -207
  37. package/src/hooks/use-speech-recognition.ts +0 -137
  38. package/src/hooks/use-ui-state.ts +0 -185
  39. package/src/hooks/use-works-state.ts +0 -146
  40. package/src/i18n/context.tsx +0 -253
  41. package/src/i18n/index.ts +0 -19
  42. package/src/i18n/locales/de.json +0 -198
  43. package/src/i18n/locales/el.json +0 -198
  44. package/src/i18n/locales/en.json +0 -226
  45. package/src/i18n/locales/es.json +0 -198
  46. package/src/i18n/locales/fr.json +0 -198
  47. package/src/i18n/locales/it.json +0 -198
  48. package/src/i18n/locales/pt.json +0 -198
  49. package/src/i18n/locales/sl.json +0 -198
  50. package/src/i18n/locales/tr.json +0 -211
  51. package/src/i18n/types.ts +0 -23
  52. package/src/i18n/use-translation.ts +0 -17
  53. package/src/index.ts +0 -18
  54. package/src/internal/plate-editor/editor/auth-context.ts +0 -11
  55. package/src/internal/plate-editor/editor/editor-base-kit.tsx +0 -39
  56. package/src/internal/plate-editor/editor/editor-kit.tsx +0 -89
  57. package/src/internal/plate-editor/editor/plate-editor.tsx +0 -75
  58. package/src/internal/plate-editor/editor/plate-types.ts +0 -126
  59. package/src/internal/plate-editor/editor/plugins/ai-kit.tsx +0 -172
  60. package/src/internal/plate-editor/editor/plugins/autoformat-kit.tsx +0 -211
  61. package/src/internal/plate-editor/editor/plugins/basic-blocks-base-kit.tsx +0 -26
  62. package/src/internal/plate-editor/editor/plugins/basic-blocks-kit.tsx +0 -51
  63. package/src/internal/plate-editor/editor/plugins/basic-marks-base-kit.tsx +0 -24
  64. package/src/internal/plate-editor/editor/plugins/basic-marks-kit.tsx +0 -38
  65. package/src/internal/plate-editor/editor/plugins/basic-nodes-kit.tsx +0 -6
  66. package/src/internal/plate-editor/editor/plugins/block-menu-kit.tsx +0 -14
  67. package/src/internal/plate-editor/editor/plugins/block-placeholder-kit.tsx +0 -17
  68. package/src/internal/plate-editor/editor/plugins/block-selection-kit.tsx +0 -31
  69. package/src/internal/plate-editor/editor/plugins/callout-base-kit.tsx +0 -5
  70. package/src/internal/plate-editor/editor/plugins/callout-kit.tsx +0 -7
  71. package/src/internal/plate-editor/editor/plugins/code-block-base-kit.tsx +0 -23
  72. package/src/internal/plate-editor/editor/plugins/code-block-kit.tsx +0 -26
  73. package/src/internal/plate-editor/editor/plugins/column-base-kit.tsx +0 -8
  74. package/src/internal/plate-editor/editor/plugins/column-kit.tsx +0 -7
  75. package/src/internal/plate-editor/editor/plugins/comment-base-kit.tsx +0 -5
  76. package/src/internal/plate-editor/editor/plugins/comment-kit.tsx +0 -174
  77. package/src/internal/plate-editor/editor/plugins/copilot-kit.tsx +0 -68
  78. package/src/internal/plate-editor/editor/plugins/cursor-overlay-kit.tsx +0 -13
  79. package/src/internal/plate-editor/editor/plugins/date-base-kit.tsx +0 -5
  80. package/src/internal/plate-editor/editor/plugins/date-kit.tsx +0 -7
  81. package/src/internal/plate-editor/editor/plugins/discussion-kit.tsx +0 -36
  82. package/src/internal/plate-editor/editor/plugins/dnd-kit.tsx +0 -27
  83. package/src/internal/plate-editor/editor/plugins/docx-export-kit.tsx +0 -43
  84. package/src/internal/plate-editor/editor/plugins/docx-kit.tsx +0 -6
  85. package/src/internal/plate-editor/editor/plugins/emoji-kit.tsx +0 -15
  86. package/src/internal/plate-editor/editor/plugins/exit-break-kit.tsx +0 -12
  87. package/src/internal/plate-editor/editor/plugins/floating-toolbar-kit.tsx +0 -19
  88. package/src/internal/plate-editor/editor/plugins/font-base-kit.tsx +0 -36
  89. package/src/internal/plate-editor/editor/plugins/font-kit.tsx +0 -47
  90. package/src/internal/plate-editor/editor/plugins/indent-base-kit.tsx +0 -19
  91. package/src/internal/plate-editor/editor/plugins/indent-kit.tsx +0 -22
  92. package/src/internal/plate-editor/editor/plugins/link-base-kit.tsx +0 -5
  93. package/src/internal/plate-editor/editor/plugins/link-kit.tsx +0 -35
  94. package/src/internal/plate-editor/editor/plugins/list-base-kit.tsx +0 -24
  95. package/src/internal/plate-editor/editor/plugins/list-kit.tsx +0 -27
  96. package/src/internal/plate-editor/editor/plugins/markdown-kit.tsx +0 -18
  97. package/src/internal/plate-editor/editor/plugins/math-base-kit.tsx +0 -8
  98. package/src/internal/plate-editor/editor/plugins/math-kit.tsx +0 -10
  99. package/src/internal/plate-editor/editor/plugins/media-base-kit.tsx +0 -37
  100. package/src/internal/plate-editor/editor/plugins/media-kit.tsx +0 -53
  101. package/src/internal/plate-editor/editor/plugins/mention-base-kit.tsx +0 -5
  102. package/src/internal/plate-editor/editor/plugins/mention-kit.tsx +0 -36
  103. package/src/internal/plate-editor/editor/plugins/slash-kit.tsx +0 -17
  104. package/src/internal/plate-editor/editor/plugins/suggestion-base-kit.tsx +0 -5
  105. package/src/internal/plate-editor/editor/plugins/suggestion-kit.tsx +0 -95
  106. package/src/internal/plate-editor/editor/plugins/table-base-kit.tsx +0 -20
  107. package/src/internal/plate-editor/editor/plugins/table-kit.tsx +0 -22
  108. package/src/internal/plate-editor/editor/plugins/toc-base-kit.tsx +0 -5
  109. package/src/internal/plate-editor/editor/plugins/toc-kit.tsx +0 -14
  110. package/src/internal/plate-editor/editor/plugins/toggle-base-kit.tsx +0 -5
  111. package/src/internal/plate-editor/editor/plugins/toggle-kit.tsx +0 -9
  112. package/src/internal/plate-editor/editor/transforms.ts +0 -165
  113. package/src/internal/plate-editor/editor/use-chat.ts +0 -152
  114. package/src/internal/plate-editor/hooks/index.ts +0 -3
  115. package/src/internal/plate-editor/hooks/use-copy-to-clipboard.ts +0 -31
  116. package/src/internal/plate-editor/hooks/use-is-touch-device.ts +0 -26
  117. package/src/internal/plate-editor/hooks/use-lock-scroll.ts +0 -21
  118. package/src/internal/plate-editor/hooks/use-media-query.ts +0 -44
  119. package/src/internal/plate-editor/hooks/use-mounted.ts +0 -18
  120. package/src/internal/plate-editor/hooks/use-on-click-outside.ts +0 -114
  121. package/src/internal/plate-editor/hooks/use-upload-file.ts +0 -81
  122. package/src/internal/plate-editor/i18n/context.tsx +0 -58
  123. package/src/internal/plate-editor/i18n/index.ts +0 -3
  124. package/src/internal/plate-editor/i18n/locales/de.json +0 -57
  125. package/src/internal/plate-editor/i18n/locales/el.json +0 -57
  126. package/src/internal/plate-editor/i18n/locales/en.json +0 -57
  127. package/src/internal/plate-editor/i18n/locales/es.json +0 -57
  128. package/src/internal/plate-editor/i18n/locales/fr.json +0 -57
  129. package/src/internal/plate-editor/i18n/locales/it.json +0 -57
  130. package/src/internal/plate-editor/i18n/locales/pt.json +0 -57
  131. package/src/internal/plate-editor/i18n/locales/sl.json +0 -57
  132. package/src/internal/plate-editor/i18n/locales/tr.json +0 -57
  133. package/src/internal/plate-editor/i18n/types.ts +0 -59
  134. package/src/internal/plate-editor/i18n/use-translation.ts +0 -22
  135. package/src/internal/plate-editor/index.ts +0 -39
  136. package/src/internal/plate-editor/lib/ai-output-converter.ts +0 -153
  137. package/src/internal/plate-editor/lib/download-file.ts +0 -17
  138. package/src/internal/plate-editor/plate-ui/ai-chat-editor.tsx +0 -24
  139. package/src/internal/plate-editor/plate-ui/ai-menu.tsx +0 -828
  140. package/src/internal/plate-editor/plate-ui/ai-node.tsx +0 -41
  141. package/src/internal/plate-editor/plate-ui/ai-toolbar-button.tsx +0 -25
  142. package/src/internal/plate-editor/plate-ui/alert-dialog.tsx +0 -145
  143. package/src/internal/plate-editor/plate-ui/align-toolbar-button.tsx +0 -88
  144. package/src/internal/plate-editor/plate-ui/avatar.tsx +0 -3
  145. package/src/internal/plate-editor/plate-ui/block-context-menu.tsx +0 -104
  146. package/src/internal/plate-editor/plate-ui/block-discussion.tsx +0 -364
  147. package/src/internal/plate-editor/plate-ui/block-draggable.tsx +0 -557
  148. package/src/internal/plate-editor/plate-ui/block-list-static.tsx +0 -77
  149. package/src/internal/plate-editor/plate-ui/block-list.tsx +0 -85
  150. package/src/internal/plate-editor/plate-ui/block-menu.tsx +0 -555
  151. package/src/internal/plate-editor/plate-ui/block-selection.tsx +0 -47
  152. package/src/internal/plate-editor/plate-ui/block-suggestion.tsx +0 -469
  153. package/src/internal/plate-editor/plate-ui/blockquote-node-static.tsx +0 -10
  154. package/src/internal/plate-editor/plate-ui/blockquote-node.tsx +0 -11
  155. package/src/internal/plate-editor/plate-ui/button.tsx +0 -201
  156. package/src/internal/plate-editor/plate-ui/calendar.tsx +0 -3
  157. package/src/internal/plate-editor/plate-ui/callout-node-static.tsx +0 -76
  158. package/src/internal/plate-editor/plate-ui/callout-node.tsx +0 -54
  159. package/src/internal/plate-editor/plate-ui/caption.tsx +0 -47
  160. package/src/internal/plate-editor/plate-ui/checkbox.tsx +0 -3
  161. package/src/internal/plate-editor/plate-ui/code-block-node-static.tsx +0 -172
  162. package/src/internal/plate-editor/plate-ui/code-block-node.tsx +0 -226
  163. package/src/internal/plate-editor/plate-ui/code-node-static.tsx +0 -11
  164. package/src/internal/plate-editor/plate-ui/code-node.tsx +0 -12
  165. package/src/internal/plate-editor/plate-ui/column-node-static.tsx +0 -65
  166. package/src/internal/plate-editor/plate-ui/column-node.tsx +0 -24
  167. package/src/internal/plate-editor/plate-ui/command.tsx +0 -202
  168. package/src/internal/plate-editor/plate-ui/comment-node-static.tsx +0 -12
  169. package/src/internal/plate-editor/plate-ui/comment-node.tsx +0 -45
  170. package/src/internal/plate-editor/plate-ui/comment-toolbar-button.tsx +0 -24
  171. package/src/internal/plate-editor/plate-ui/comment.tsx +0 -619
  172. package/src/internal/plate-editor/plate-ui/cursor-overlay.tsx +0 -85
  173. package/src/internal/plate-editor/plate-ui/date-node-static.tsx +0 -43
  174. package/src/internal/plate-editor/plate-ui/date-node.tsx +0 -54
  175. package/src/internal/plate-editor/plate-ui/dialog.tsx +0 -445
  176. package/src/internal/plate-editor/plate-ui/dropdown-menu.tsx +0 -264
  177. package/src/internal/plate-editor/plate-ui/editor-static.tsx +0 -40
  178. package/src/internal/plate-editor/plate-ui/editor.tsx +0 -146
  179. package/src/internal/plate-editor/plate-ui/emoji-node.tsx +0 -48
  180. package/src/internal/plate-editor/plate-ui/emoji-toolbar-button.tsx +0 -626
  181. package/src/internal/plate-editor/plate-ui/equation-node-static.tsx +0 -155
  182. package/src/internal/plate-editor/plate-ui/equation-node.tsx +0 -226
  183. package/src/internal/plate-editor/plate-ui/equation-toolbar-button.tsx +0 -26
  184. package/src/internal/plate-editor/plate-ui/export-toolbar-button.tsx +0 -206
  185. package/src/internal/plate-editor/plate-ui/fixed-toolbar-buttons.tsx +0 -157
  186. package/src/internal/plate-editor/plate-ui/fixed-toolbar.tsx +0 -25
  187. package/src/internal/plate-editor/plate-ui/floating-discussion.tsx +0 -1129
  188. package/src/internal/plate-editor/plate-ui/floating-toolbar-buttons.tsx +0 -129
  189. package/src/internal/plate-editor/plate-ui/floating-toolbar.tsx +0 -97
  190. package/src/internal/plate-editor/plate-ui/font-color-toolbar-button.tsx +0 -209
  191. package/src/internal/plate-editor/plate-ui/font-size-toolbar-button.tsx +0 -152
  192. package/src/internal/plate-editor/plate-ui/ghost-text.tsx +0 -20
  193. package/src/internal/plate-editor/plate-ui/heading-node-static.tsx +0 -52
  194. package/src/internal/plate-editor/plate-ui/heading-node.tsx +0 -56
  195. package/src/internal/plate-editor/plate-ui/highlight-node-static.tsx +0 -9
  196. package/src/internal/plate-editor/plate-ui/highlight-node.tsx +0 -11
  197. package/src/internal/plate-editor/plate-ui/history-toolbar-button.tsx +0 -50
  198. package/src/internal/plate-editor/plate-ui/hover-card.tsx +0 -7
  199. package/src/internal/plate-editor/plate-ui/hr-node-static.tsx +0 -18
  200. package/src/internal/plate-editor/plate-ui/hr-node.tsx +0 -28
  201. package/src/internal/plate-editor/plate-ui/import-toolbar-button.tsx +0 -122
  202. package/src/internal/plate-editor/plate-ui/indent-toolbar-button.tsx +0 -32
  203. package/src/internal/plate-editor/plate-ui/inline-combobox.tsx +0 -409
  204. package/src/internal/plate-editor/plate-ui/input.tsx +0 -37
  205. package/src/internal/plate-editor/plate-ui/insert-toolbar-button.tsx +0 -258
  206. package/src/internal/plate-editor/plate-ui/label.tsx +0 -1
  207. package/src/internal/plate-editor/plate-ui/line-height-toolbar-button.tsx +0 -69
  208. package/src/internal/plate-editor/plate-ui/link-node-static.tsx +0 -15
  209. package/src/internal/plate-editor/plate-ui/link-node.tsx +0 -33
  210. package/src/internal/plate-editor/plate-ui/link-toolbar-button.tsx +0 -28
  211. package/src/internal/plate-editor/plate-ui/link-toolbar.tsx +0 -147
  212. package/src/internal/plate-editor/plate-ui/list-toolbar-button.tsx +0 -177
  213. package/src/internal/plate-editor/plate-ui/mark-toolbar-button.tsx +0 -34
  214. package/src/internal/plate-editor/plate-ui/media-audio-node-static.tsx +0 -21
  215. package/src/internal/plate-editor/plate-ui/media-audio-node.tsx +0 -32
  216. package/src/internal/plate-editor/plate-ui/media-embed-node.tsx +0 -103
  217. package/src/internal/plate-editor/plate-ui/media-file-node-static.tsx +0 -30
  218. package/src/internal/plate-editor/plate-ui/media-file-node.tsx +0 -52
  219. package/src/internal/plate-editor/plate-ui/media-image-node-static.tsx +0 -37
  220. package/src/internal/plate-editor/plate-ui/media-image-node.tsx +0 -183
  221. package/src/internal/plate-editor/plate-ui/media-placeholder-node.tsx +0 -441
  222. package/src/internal/plate-editor/plate-ui/media-preview-dialog.tsx +0 -127
  223. package/src/internal/plate-editor/plate-ui/media-toolbar-button.tsx +0 -227
  224. package/src/internal/plate-editor/plate-ui/media-toolbar.tsx +0 -214
  225. package/src/internal/plate-editor/plate-ui/media-upload-toast.tsx +0 -73
  226. package/src/internal/plate-editor/plate-ui/media-video-node-static.tsx +0 -35
  227. package/src/internal/plate-editor/plate-ui/media-video-node.tsx +0 -119
  228. package/src/internal/plate-editor/plate-ui/mention-node-static.tsx +0 -46
  229. package/src/internal/plate-editor/plate-ui/mention-node.tsx +0 -79
  230. package/src/internal/plate-editor/plate-ui/menu.tsx +0 -539
  231. package/src/internal/plate-editor/plate-ui/mode-toolbar-button.tsx +0 -124
  232. package/src/internal/plate-editor/plate-ui/more-toolbar-button.tsx +0 -34
  233. package/src/internal/plate-editor/plate-ui/paragraph-node-static.tsx +0 -15
  234. package/src/internal/plate-editor/plate-ui/paragraph-node.tsx +0 -16
  235. package/src/internal/plate-editor/plate-ui/popover.tsx +0 -75
  236. package/src/internal/plate-editor/plate-ui/progress.tsx +0 -1
  237. package/src/internal/plate-editor/plate-ui/remote-cursor-overlay.tsx +0 -79
  238. package/src/internal/plate-editor/plate-ui/resize-handle.tsx +0 -86
  239. package/src/internal/plate-editor/plate-ui/separator.tsx +0 -41
  240. package/src/internal/plate-editor/plate-ui/slash-node.tsx +0 -433
  241. package/src/internal/plate-editor/plate-ui/spinner.tsx +0 -1
  242. package/src/internal/plate-editor/plate-ui/suggestion-node-static.tsx +0 -35
  243. package/src/internal/plate-editor/plate-ui/suggestion-node.tsx +0 -166
  244. package/src/internal/plate-editor/plate-ui/suggestion-toolbar-button.tsx +0 -24
  245. package/src/internal/plate-editor/plate-ui/table-node-static.tsx +0 -84
  246. package/src/internal/plate-editor/plate-ui/table-node.tsx +0 -283
  247. package/src/internal/plate-editor/plate-ui/table-toolbar-button.tsx +0 -252
  248. package/src/internal/plate-editor/plate-ui/tabs.tsx +0 -3
  249. package/src/internal/plate-editor/plate-ui/textarea.tsx +0 -57
  250. package/src/internal/plate-editor/plate-ui/toc-node-static.tsx +0 -142
  251. package/src/internal/plate-editor/plate-ui/toc-node.tsx +0 -57
  252. package/src/internal/plate-editor/plate-ui/toc-sidebar.tsx +0 -48
  253. package/src/internal/plate-editor/plate-ui/toggle-node-static.tsx +0 -18
  254. package/src/internal/plate-editor/plate-ui/toggle-node.tsx +0 -33
  255. package/src/internal/plate-editor/plate-ui/toggle-toolbar-button.tsx +0 -24
  256. package/src/internal/plate-editor/plate-ui/toggle.tsx +0 -3
  257. package/src/internal/plate-editor/plate-ui/toolbar.tsx +0 -378
  258. package/src/internal/plate-editor/plate-ui/tooltip.tsx +0 -148
  259. package/src/internal/plate-editor/plate-ui/turn-into-toolbar-button.tsx +0 -175
  260. package/src/internal/plate-editor/types/index.ts +0 -22
  261. package/src/internal/plate-editor/vite.ts +0 -284
  262. package/src/internal/sheets/components/univer-sheets.tsx +0 -1104
  263. package/src/internal/sheets/i18n/context.tsx +0 -183
  264. package/src/internal/sheets/i18n/index.ts +0 -19
  265. package/src/internal/sheets/i18n/locales/de.json +0 -21
  266. package/src/internal/sheets/i18n/locales/el.json +0 -21
  267. package/src/internal/sheets/i18n/locales/en.json +0 -21
  268. package/src/internal/sheets/i18n/locales/es.json +0 -21
  269. package/src/internal/sheets/i18n/locales/fr.json +0 -21
  270. package/src/internal/sheets/i18n/locales/it.json +0 -21
  271. package/src/internal/sheets/i18n/locales/pt.json +0 -21
  272. package/src/internal/sheets/i18n/locales/sl.json +0 -21
  273. package/src/internal/sheets/i18n/locales/tr.json +0 -21
  274. package/src/internal/sheets/i18n/types.ts +0 -23
  275. package/src/internal/sheets/i18n/use-translation.ts +0 -17
  276. package/src/internal/sheets/index.ts +0 -14
  277. package/src/internal/sheets/types/css.d.ts +0 -11
  278. package/src/internal/sheets/types/index.ts +0 -260
  279. package/src/internal/sheets/xlsx.ts +0 -1169
  280. package/src/lib/api-client.ts +0 -77
  281. package/src/lib/assistant-api-actions.ts +0 -549
  282. package/src/lib/assistant-config.tsx +0 -75
  283. package/src/lib/class-utils.ts +0 -40
  284. package/src/lib/index.ts +0 -7
  285. package/src/lib/message-utils.ts +0 -131
  286. package/src/tools/tools-schema.json +0 -512
  287. package/src/types/index.ts +0 -235
  288. package/src/views/assistant-view.tsx +0 -1137
  289. package/src/views/canvas-app.tsx +0 -839
  290. package/src/views/canvas-code.tsx +0 -93
  291. package/src/views/canvas-deep-research.tsx +0 -44
  292. package/src/views/canvas-image.tsx +0 -25
  293. package/src/views/canvas-record-view.tsx +0 -285
  294. package/src/views/canvas-spreadsheet.tsx +0 -125
  295. package/src/views/canvas-text.tsx +0 -52
  296. package/src/views/canvas.tsx +0 -274
  297. package/src/views/chat-panel.tsx +0 -149
  298. package/src/views/index.ts +0 -20
  299. package/src/views/memories-panel.tsx +0 -365
  300. package/src/views/message-list.tsx +0 -370
  301. package/src/views/project-detail.tsx +0 -257
  302. package/src/views/projects-panel.tsx +0 -131
  303. package/src/views/sessions-list.tsx +0 -98
  304. package/src/views/sidebar-content.tsx +0 -256
  305. package/src/views/work-detail.tsx +0 -98
  306. package/src/vite.ts +0 -64
  307. package/src/worker.ts +0 -203
@@ -1,127 +0,0 @@
1
- 'use client';
2
-
3
- import { type ComponentProps } from 'react';
4
-
5
- import {
6
- PreviewImage,
7
- useImagePreview,
8
- useImagePreviewValue,
9
- useScaleInput
10
- } from '@platejs/media/react';
11
- import {
12
- ArrowLeftIcon,
13
- ArrowRightIcon,
14
- CircleArrowDown,
15
- Minimize2,
16
- Minus,
17
- Plus
18
- } from 'lucide-react';
19
- import { useEditorRef } from 'platejs/react';
20
-
21
- import { cn } from '@docyrus/ui-pro-shared/lib/utils';
22
-
23
- import { Button } from './button';
24
-
25
- import { downloadFile } from '../lib/download-file';
26
-
27
- const SCROLL_SPEED = 4;
28
-
29
- export function ImagePreview() {
30
- const editor = useEditorRef();
31
- const isOpen = useImagePreviewValue('isOpen', editor.id);
32
- const scale = useImagePreviewValue('scale');
33
- const isEditingScale = useImagePreviewValue('isEditingScale');
34
- const currentPreview = useImagePreviewValue('currentPreview');
35
- const {
36
- closeProps,
37
- maskLayerProps,
38
- nextDisabled,
39
- nextProps,
40
- prevDisabled,
41
- prevProps,
42
- scaleTextProps,
43
- zommOutProps,
44
- zoomInDisabled,
45
- zoomInProps,
46
- zoomOutDisabled
47
- } = useImagePreview({
48
- scrollSpeed: SCROLL_SPEED
49
- });
50
-
51
- return (
52
- <div
53
- className={cn(
54
- 'fade-in fixed top-0 left-0 z-50 h-screen w-screen animate-in cursor-default text-sm duration-200 ease-in-out',
55
- !isOpen && 'hidden'
56
- )}
57
- onContextMenu={e => e.stopPropagation()}
58
- {...maskLayerProps}>
59
- <div className="absolute inset-0 size-full bg-black/80" />
60
-
61
- <div className="absolute inset-0 flex items-center justify-center">
62
- <div className="relative flex max-h-screen w-full items-center">
63
- <PreviewImage
64
- className={cn(
65
- 'mx-auto block max-h-[calc(100vh-4rem)] w-auto select-none object-contain transition-transform'
66
- )} />
67
- </div>
68
- </div>
69
-
70
- <div
71
- className="-translate-x-1/2 absolute bottom-[30px] left-1/2 z-40 flex justify-center gap-2 text-white"
72
- onClick={e => e.stopPropagation()}>
73
- {!prevDisabled && !nextDisabled && (
74
- <div className="flex rounded-sm bg-black/70">
75
- <Button {...prevProps} disabled={prevDisabled}>
76
- <ArrowLeftIcon className="size-5" />
77
- </Button>
78
- <Button {...nextProps} disabled={nextDisabled}>
79
- <ArrowRightIcon className="size-5" />
80
- </Button>
81
- </div>
82
- )}
83
-
84
- {currentPreview && (
85
- <div className="flex rounded-sm bg-black/70">
86
- <Button
87
- {...zommOutProps}
88
- disabled={zoomOutDisabled}
89
- tooltip="Zoom out">
90
- <Minus className="size-4" />
91
- </Button>
92
- <div className="flex w-[46px] items-center justify-center space-x-1 text-neutral-400">
93
- {isEditingScale ? (
94
- <ScaleInput className="h-[19px] w-full rounded-sm border border-brand/70 bg-transparent text-sm text-white outline-hidden" />
95
- ) : (
96
- <div {...scaleTextProps}>{scale * 100}</div>
97
- )}
98
- <div>%</div>
99
- </div>
100
- <Button
101
- {...zoomInProps}
102
- disabled={zoomInDisabled}
103
- tooltip="Zoom in">
104
- <Plus className="size-4" />
105
- </Button>
106
- <Button
107
- onClick={() => {
108
- void downloadFile(currentPreview.url, currentPreview.id!);
109
- }}
110
- tooltip="Download">
111
- <CircleArrowDown className="size-4" />
112
- </Button>
113
- <Button {...closeProps} tooltip="Close">
114
- <Minimize2 className="size-4" />
115
- </Button>
116
- </div>
117
- )}
118
- </div>
119
- </div>
120
- );
121
- }
122
-
123
- function ScaleInput(props: ComponentProps<'input'>) {
124
- const { props: scaleInputProps, ref } = useScaleInput();
125
-
126
- return <input {...scaleInputProps} {...props} ref={ref} />;
127
- }
@@ -1,227 +0,0 @@
1
- 'use client';
2
-
3
- import { useCallback, useState, type ReactNode } from 'react';
4
-
5
- import { PlaceholderPlugin } from '@platejs/media/react';
6
- import {
7
- AudioLinesIcon,
8
- FileUpIcon,
9
- FilmIcon,
10
- ImageIcon,
11
- LinkIcon
12
- } from 'lucide-react';
13
- import { isUrl, KEYS } from 'platejs';
14
- import { useEditorRef } from 'platejs/react';
15
- import { toast } from 'sonner';
16
- import { useFilePicker } from 'use-file-picker';
17
-
18
- import {
19
- AlertDialog,
20
- AlertDialogAction,
21
- AlertDialogCancel,
22
- AlertDialogContent,
23
- AlertDialogDescription,
24
- AlertDialogFooter,
25
- AlertDialogHeader,
26
- AlertDialogTitle
27
- } from './alert-dialog';
28
- import {
29
- DropdownMenu,
30
- DropdownMenuContent,
31
- DropdownMenuGroup,
32
- DropdownMenuItem,
33
- DropdownMenuPortal,
34
- DropdownMenuTrigger,
35
- type DropdownMenuProps
36
- } from './dropdown-menu';
37
- import { Input } from './input';
38
-
39
- import {
40
- ToolbarSplitButton,
41
- ToolbarSplitButtonPrimary,
42
- ToolbarSplitButtonSecondary
43
- } from './toolbar';
44
-
45
- const MEDIA_CONFIG: Record<
46
- string,
47
- {
48
- accept: string[];
49
- icon: ReactNode;
50
- title: string;
51
- tooltip: string;
52
- }
53
- > = {
54
- [KEYS.audio]: {
55
- accept: ['audio/*'],
56
- icon: <AudioLinesIcon className="size-4" />,
57
- title: 'Insert Audio',
58
- tooltip: 'Audio'
59
- },
60
- [KEYS.file]: {
61
- accept: ['*'],
62
- icon: <FileUpIcon className="size-4" />,
63
- title: 'Insert File',
64
- tooltip: 'File'
65
- },
66
- [KEYS.img]: {
67
- accept: ['image/*'],
68
- icon: <ImageIcon className="size-4" />,
69
- title: 'Insert Image',
70
- tooltip: 'Image'
71
- },
72
- [KEYS.video]: {
73
- accept: ['video/*'],
74
- icon: <FilmIcon className="size-4" />,
75
- title: 'Insert Video',
76
- tooltip: 'Video'
77
- }
78
- };
79
-
80
- export function MediaToolbarButton({
81
- nodeType,
82
- ...props
83
- }: DropdownMenuProps & { nodeType: string }) {
84
- const currentConfig = MEDIA_CONFIG[nodeType];
85
-
86
- const editor = useEditorRef();
87
- const [open, setOpen] = useState(false);
88
- const [dialogOpen, setDialogOpen] = useState(false);
89
-
90
- const { openFilePicker } = useFilePicker({
91
- accept: currentConfig.accept,
92
- multiple: true,
93
- onFilesSelected: (data: { plainFiles?: File[] }) => {
94
- if (!data.plainFiles || data.plainFiles.length === 0) return;
95
- editor.getTransforms(PlaceholderPlugin).insert.media(data.plainFiles as unknown as FileList);
96
- }
97
- });
98
-
99
- return (
100
- <>
101
- <ToolbarSplitButton
102
- onClick={() => {
103
- openFilePicker();
104
- }}
105
- onKeyDown={(e) => {
106
- if (e.key === 'ArrowDown') {
107
- e.preventDefault();
108
- setOpen(true);
109
- }
110
- }}
111
- pressed={open}>
112
- <ToolbarSplitButtonPrimary>
113
- {currentConfig.icon}
114
- </ToolbarSplitButtonPrimary>
115
-
116
- <DropdownMenu
117
- open={open}
118
- onOpenChange={setOpen}
119
- modal={false}
120
- {...props}>
121
- <DropdownMenuTrigger asChild>
122
- <ToolbarSplitButtonSecondary />
123
- </DropdownMenuTrigger>
124
-
125
- <DropdownMenuPortal>
126
- <DropdownMenuContent
127
- onClick={e => e.stopPropagation()}
128
- align="start"
129
- alignOffset={-32}>
130
- <DropdownMenuGroup>
131
- <DropdownMenuItem onSelect={() => openFilePicker()}>
132
- {currentConfig.icon}
133
- Upload from computer
134
- </DropdownMenuItem>
135
- <DropdownMenuItem onSelect={() => setDialogOpen(true)}>
136
- <LinkIcon />
137
- Insert via URL
138
- </DropdownMenuItem>
139
- </DropdownMenuGroup>
140
- </DropdownMenuContent>
141
- </DropdownMenuPortal>
142
- </DropdownMenu>
143
- </ToolbarSplitButton>
144
-
145
- <AlertDialog
146
- open={dialogOpen}
147
- onOpenChange={(value) => {
148
- setDialogOpen(value);
149
- }}>
150
- <AlertDialogContent className="gap-6">
151
- <MediaUrlDialogContent
152
- currentConfig={currentConfig}
153
- nodeType={nodeType}
154
- setOpen={setDialogOpen} />
155
- </AlertDialogContent>
156
- </AlertDialog>
157
- </>
158
- );
159
- }
160
-
161
- function MediaUrlDialogContent({
162
- currentConfig,
163
- nodeType,
164
- setOpen
165
- }: {
166
- currentConfig: (typeof MEDIA_CONFIG)[string];
167
- nodeType: string;
168
- setOpen: (value: boolean) => void;
169
- }) {
170
- const editor = useEditorRef();
171
- const [url, setUrl] = useState('');
172
-
173
- const embedMedia = useCallback(() => {
174
- if (!isUrl(url)) return toast.error('Invalid URL');
175
-
176
- setOpen(false);
177
- editor.tf.insertNodes({
178
- children: [{ text: '' }],
179
- name: nodeType === KEYS.file ? url.split('/').pop() : undefined,
180
- type: nodeType,
181
- url
182
- });
183
- }, [
184
- url,
185
- editor,
186
- nodeType,
187
- setOpen
188
- ]);
189
-
190
- return (
191
- <>
192
- <AlertDialogHeader>
193
- <AlertDialogTitle>{currentConfig.title}</AlertDialogTitle>
194
- </AlertDialogHeader>
195
-
196
- <AlertDialogDescription className="group relative w-full">
197
- <label
198
- className="-translate-y-1/2 absolute top-1/2 block cursor-text px-1 text-muted-foreground/70 text-sm transition-all group-focus-within:pointer-events-none group-focus-within:top-0 group-focus-within:cursor-default group-focus-within:font-medium group-focus-within:text-foreground group-focus-within:text-xs has-[+input:not(:placeholder-shown)]:pointer-events-none has-[+input:not(:placeholder-shown)]:top-0 has-[+input:not(:placeholder-shown)]:cursor-default has-[+input:not(:placeholder-shown)]:font-medium has-[+input:not(:placeholder-shown)]:text-foreground has-[+input:not(:placeholder-shown)]:text-xs"
199
- htmlFor="url">
200
- <span className="inline-flex bg-background px-2">URL</span>
201
- </label>
202
- <Input
203
- id="url"
204
- className="w-full"
205
- value={url}
206
- onChange={e => setUrl(e.target.value)}
207
- onKeyDown={(e) => {
208
- if (e.key === 'Enter') embedMedia();
209
- }}
210
- placeholder=""
211
- type="url"
212
- autoFocus />
213
- </AlertDialogDescription>
214
-
215
- <AlertDialogFooter>
216
- <AlertDialogCancel>Cancel</AlertDialogCancel>
217
- <AlertDialogAction
218
- onClick={(e) => {
219
- e.preventDefault();
220
- embedMedia();
221
- }}>
222
- Accept
223
- </AlertDialogAction>
224
- </AlertDialogFooter>
225
- </>
226
- );
227
- }
@@ -1,214 +0,0 @@
1
- 'use client';
2
-
3
- import { type ComponentProps, type Dispatch, type SetStateAction } from 'react';
4
-
5
- import { type TMediaElement, type TTextAlignProps, KEYS } from 'platejs';
6
-
7
- import { showCaption } from '@platejs/caption/react';
8
- import {
9
- openImagePreview,
10
- useMediaController,
11
- useMediaControllerDropDownMenu,
12
- useMediaControllerState
13
- } from '@platejs/media/react';
14
- import { BlockMenuPlugin } from '@platejs/selection/react';
15
- import {
16
- AlignCenter,
17
- AlignLeft,
18
- AlignRight,
19
- CaptionsIcon,
20
- CircleArrowDownIcon,
21
- MoreHorizontalIcon,
22
- MoveUpRightIcon,
23
- ZoomInIcon
24
- } from 'lucide-react';
25
- import { useEditorRef, useElement } from 'platejs/react';
26
-
27
- import { toast } from 'sonner';
28
-
29
- import { cn } from '@docyrus/ui-pro-shared/lib/utils';
30
-
31
- import {
32
- DropdownMenu,
33
- DropdownMenuContent,
34
- type DropdownMenuProps,
35
- DropdownMenuRadioGroup,
36
- DropdownMenuRadioItem,
37
- DropdownMenuTrigger,
38
- useOpenState
39
- } from './dropdown-menu';
40
-
41
- import { Toolbar, ToolbarButton, toolbarButtonVariants } from './toolbar';
42
-
43
- import { downloadFile } from '../lib/download-file';
44
-
45
- export function MediaToolbar({
46
- className: _className,
47
- ...props
48
- }: ComponentProps<typeof Toolbar>) {
49
- return (
50
- <Toolbar
51
- className={cn(
52
- 'group-data-[readonly=true]/editor:hidden',
53
- 'top-1 right-1 opacity-0 group-hover/media:opacity-100',
54
- 'group-has-data-[resizing=true]/media:opacity-0 group-has-data-[state=open]/media:opacity-100 group-data-[state=open]/context-menu:opacity-0'
55
- )}
56
- {...props}>
57
- <MediaToolbarButtons />
58
- </Toolbar>
59
- );
60
- }
61
-
62
- const alignItems = [
63
- {
64
- icon: AlignLeft,
65
- value: 'left'
66
- },
67
- {
68
- icon: AlignCenter,
69
- value: 'center'
70
- },
71
- {
72
- icon: AlignRight,
73
- value: 'right'
74
- }
75
- ];
76
-
77
- function MediaToolbarButtons() {
78
- const editor = useEditorRef();
79
- const element = useElement<TMediaElement>();
80
- const state = useMediaControllerState();
81
- const { MediaControllerDropDownMenuProps: mediaToolbarDropDownMenuProps }
82
- = useMediaController(state);
83
-
84
- const handleDownload = () => {
85
- toast.promise(downloadFile(element.url, element.id || 'file'), {
86
- error: 'Download failed. Please try again.',
87
- loading: 'Downloading...'
88
- });
89
- };
90
-
91
- return (
92
- <>
93
- <MediaAlignButton {...mediaToolbarDropDownMenuProps} />
94
- <ToolbarButton
95
- onClick={() => showCaption(editor, element)}
96
- size="none"
97
- tooltip="Caption"
98
- variant="media">
99
- <CaptionsIcon />
100
- </ToolbarButton>
101
- {element.type === KEYS.img && (
102
- <ToolbarButton
103
- onClick={() => {
104
- openImagePreview(editor, element);
105
- }}
106
- size="none"
107
- tooltip="Expand"
108
- variant="media">
109
- <ZoomInIcon />
110
- </ToolbarButton>
111
- )}
112
-
113
- {element.type === KEYS.img && (
114
- <ToolbarButton
115
- onClick={handleDownload}
116
- size="none"
117
- tooltip="Download"
118
- variant="media">
119
- <CircleArrowDownIcon />
120
- </ToolbarButton>
121
- )}
122
-
123
- {element.type !== KEYS.img && (
124
- <ToolbarButton
125
- onClick={() => {
126
- window.open(element.url, '_blank');
127
- }}
128
- size="none"
129
- tooltip="Original"
130
- variant="media">
131
- <MoveUpRightIcon />
132
- </ToolbarButton>
133
- )}
134
-
135
- <ToolbarButton
136
- onClick={(e) => {
137
- editor
138
- .getApi(BlockMenuPlugin)
139
- .blockMenu.showContextMenu(element.id as string, {
140
- x: e.clientX,
141
- y: e.clientY
142
- });
143
- }}
144
- size="none"
145
- tooltip="More actions"
146
- variant="media">
147
- <MoreHorizontalIcon />
148
- </ToolbarButton>
149
- </>
150
- );
151
- }
152
-
153
- function MediaAlignButton({
154
- children: _children,
155
- ...props
156
- }: {
157
- setAlignOpen: Dispatch<SetStateAction<boolean>>;
158
- } & DropdownMenuProps) {
159
- const editor = useEditorRef();
160
- const element = useElement<TMediaElement & TTextAlignProps>();
161
- const openState = useOpenState();
162
-
163
- const value = element.align ?? 'left';
164
-
165
- const IconValue
166
- = alignItems.find(item => item.value === value)?.icon ?? AlignLeft;
167
-
168
- useMediaControllerDropDownMenu({
169
- openState,
170
- setAlignOpen: props.setAlignOpen
171
- });
172
-
173
- return (
174
- <DropdownMenu modal={false} {...openState} {...props}>
175
- <DropdownMenuTrigger asChild>
176
- <ToolbarButton
177
- data-state={openState.open ? 'open' : 'closed'}
178
- size="none"
179
- tooltip="Align"
180
- variant="media">
181
- <IconValue className="size-4" />
182
- </ToolbarButton>
183
- </DropdownMenuTrigger>
184
-
185
- <DropdownMenuContent
186
- align="start"
187
- className="min-w-0 rounded-md border-none bg-black/60 p-0 shadow-none"
188
- portal={false}>
189
- <DropdownMenuRadioGroup
190
- className="flex hover:bg-transparent"
191
- onValueChange={(value) => {
192
- editor.tf.setNodes({ align: value as any }, { at: element });
193
- }}
194
- value={value}>
195
- {alignItems.map(({ icon: Icon, value: itemValue }) => (
196
- <DropdownMenuRadioItem
197
- className={cn(
198
- toolbarButtonVariants({
199
- size: 'none',
200
- variant: 'media'
201
- }),
202
- 'size-[26px] opacity-60 hover:opacity-100 data-[state=checked]:bg-black/5 data-[state=checked]:opacity-100'
203
- )}
204
- hideIcon
205
- key={itemValue}
206
- value={itemValue}>
207
- <Icon className="size-4" />
208
- </DropdownMenuRadioItem>
209
- ))}
210
- </DropdownMenuRadioGroup>
211
- </DropdownMenuContent>
212
- </DropdownMenu>
213
- );
214
- }
@@ -1,73 +0,0 @@
1
- 'use client';
2
-
3
- import { useEffect } from 'react';
4
-
5
- import { PlaceholderPlugin, UploadErrorCode } from '@platejs/media/react';
6
- import { usePluginOption } from 'platejs/react';
7
- import { toast } from 'sonner';
8
-
9
- export function MediaUploadToast() {
10
- useUploadErrorToast();
11
-
12
- return null;
13
- }
14
-
15
- const useUploadErrorToast = () => {
16
- const uploadError = usePluginOption(PlaceholderPlugin, 'error');
17
-
18
- useEffect(() => {
19
- if (!uploadError) return;
20
-
21
- const { code, data } = uploadError;
22
-
23
- switch (code) {
24
- case UploadErrorCode.INVALID_FILE_SIZE: {
25
- toast.error(
26
- `The size of files ${data.files
27
- .map(f => f.name)
28
- .join(', ')} is invalid`
29
- );
30
-
31
- break;
32
- }
33
-
34
- case UploadErrorCode.INVALID_FILE_TYPE: {
35
- toast.error(
36
- `The type of files ${data.files
37
- .map(f => f.name)
38
- .join(', ')} is invalid`
39
- );
40
-
41
- break;
42
- }
43
-
44
- case UploadErrorCode.TOO_LARGE: {
45
- toast.error(
46
- `The size of files ${data.files
47
- .map(f => f.name)
48
- .join(', ')} is too large than ${data.maxFileSize}`
49
- );
50
-
51
- break;
52
- }
53
-
54
- case UploadErrorCode.TOO_LESS_FILES: {
55
- toast.error(
56
- `The mini um number of files is ${data.minFileCount} for ${data.fileType}`
57
- );
58
-
59
- break;
60
- }
61
-
62
- case UploadErrorCode.TOO_MANY_FILES: {
63
- toast.error(
64
- `The maximum number of files is ${data.maxFileCount} ${
65
- data.fileType ? `for ${data.fileType}` : ''
66
- }`
67
- );
68
-
69
- break;
70
- }
71
- }
72
- }, [uploadError]);
73
- };
@@ -1,35 +0,0 @@
1
-
2
- import {
3
- NodeApi,
4
- type TCaptionElement,
5
- type TResizableProps,
6
- type TVideoElement
7
- } from 'platejs';
8
- import { SlateElement, type SlateElementProps } from 'platejs/static';
9
-
10
- import { cn } from '@docyrus/ui-pro-shared/lib/utils';
11
-
12
- export function MediaVideoElementStatic(
13
- props: SlateElementProps<TVideoElement & TCaptionElement & TResizableProps>
14
- ) {
15
- const {
16
- align = 'center', caption, url, width
17
- } = props.element;
18
-
19
- return (
20
- <SlateElement className="py-2.5" {...props}>
21
- <div style={{ textAlign: align }}>
22
- <figure
23
- className="group relative m-0 inline-block cursor-default"
24
- style={{ width }}>
25
- <video
26
- className={cn('w-full max-w-full object-cover px-0', 'rounded-sm')}
27
- controls
28
- src={url} />
29
- {caption && <figcaption>{NodeApi.string(caption[0])}</figcaption>}
30
- </figure>
31
- </div>
32
- {props.children}
33
- </SlateElement>
34
- );
35
- }