@ecsplico/editor 0.0.0-stage → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1230) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +21 -0
  3. package/README.md +232 -2
  4. package/dist/code/CodeSurface.d.ts +24 -0
  5. package/dist/code/CodeSurface.js +57 -0
  6. package/dist/code/CodeSurface.js.map +1 -0
  7. package/dist/code/CodeSurface.vue.d.ts +29 -0
  8. package/dist/code/CodeSurface2.js +75 -0
  9. package/dist/code/CodeSurface2.js.map +1 -0
  10. package/dist/code/chrome-theme.js +76 -0
  11. package/dist/code/chrome-theme.js.map +1 -0
  12. package/dist/code/compartments.js +19 -0
  13. package/dist/code/compartments.js.map +1 -0
  14. package/dist/code/editor-factory.d.ts +41 -0
  15. package/dist/code/editor-factory.js +126 -0
  16. package/dist/code/editor-factory.js.map +1 -0
  17. package/dist/code/format-json.d.ts +27 -0
  18. package/dist/code/format-json.js +94 -0
  19. package/dist/code/format-json.js.map +1 -0
  20. package/dist/code/highlight-style.js +118 -0
  21. package/dist/code/highlight-style.js.map +1 -0
  22. package/dist/code/index.d.ts +6 -0
  23. package/dist/code/index.js +6 -0
  24. package/dist/code/jsonl-language.d.ts +6 -0
  25. package/dist/code/jsonl-language.js +33 -0
  26. package/dist/code/jsonl-language.js.map +1 -0
  27. package/dist/code/kind.d.ts +15 -0
  28. package/dist/code/kind.js +142 -0
  29. package/dist/code/kind.js.map +1 -0
  30. package/dist/code/lang-registry.d.ts +31 -0
  31. package/dist/code/lang-registry.js +54 -0
  32. package/dist/code/lang-registry.js.map +1 -0
  33. package/dist/code/react.d.ts +2 -0
  34. package/dist/code/react.js +1 -0
  35. package/dist/code/vue.d.ts +2 -0
  36. package/dist/code/vue.js +1 -0
  37. package/dist/core/abilities.d.ts +32 -0
  38. package/dist/core/abilities.js +160 -0
  39. package/dist/core/abilities.js.map +1 -0
  40. package/dist/core/block-convert.d.ts +59 -0
  41. package/dist/core/block-convert.js +164 -0
  42. package/dist/core/block-convert.js.map +1 -0
  43. package/dist/core/block-drag.d.ts +12 -0
  44. package/dist/core/block-drag.js +62 -0
  45. package/dist/core/block-drag.js.map +1 -0
  46. package/dist/core/block-flash.d.ts +19 -0
  47. package/dist/core/block-flash.js +66 -0
  48. package/dist/core/block-flash.js.map +1 -0
  49. package/dist/core/context.d.ts +63 -0
  50. package/dist/core/context.js +108 -0
  51. package/dist/core/context.js.map +1 -0
  52. package/dist/core/convert.d.ts +96 -0
  53. package/dist/core/convert.js +241 -0
  54. package/dist/core/convert.js.map +1 -0
  55. package/dist/core/core-feature.d.ts +17 -0
  56. package/dist/core/core-feature.js +100 -0
  57. package/dist/core/core-feature.js.map +1 -0
  58. package/dist/core/define-editor.d.ts +23 -0
  59. package/dist/core/define-editor.js +110 -0
  60. package/dist/core/define-editor.js.map +1 -0
  61. package/dist/core/doc-anchors.d.ts +67 -0
  62. package/dist/core/doc-anchors.js +112 -0
  63. package/dist/core/doc-anchors.js.map +1 -0
  64. package/dist/core/document-markdown.d.ts +13 -0
  65. package/dist/core/document-markdown.js +31 -0
  66. package/dist/core/document-markdown.js.map +1 -0
  67. package/dist/core/download.d.ts +5 -0
  68. package/dist/core/download.js +16 -0
  69. package/dist/core/download.js.map +1 -0
  70. package/dist/core/editor-ui.d.ts +45 -0
  71. package/dist/core/editor-ui.js +38 -0
  72. package/dist/core/editor-ui.js.map +1 -0
  73. package/dist/core/extension-points.d.ts +64 -0
  74. package/dist/core/feature-context.d.ts +32 -0
  75. package/dist/core/feature-context.js +46 -0
  76. package/dist/core/feature-context.js.map +1 -0
  77. package/dist/core/feature.d.ts +234 -0
  78. package/dist/core/feature.js +13 -0
  79. package/dist/core/feature.js.map +1 -0
  80. package/dist/core/fences.d.ts +16 -0
  81. package/dist/core/fences.js +105 -0
  82. package/dist/core/fences.js.map +1 -0
  83. package/dist/core/fetch-error.d.ts +5 -0
  84. package/dist/core/fetch-error.js +11 -0
  85. package/dist/core/fetch-error.js.map +1 -0
  86. package/dist/core/index.d.ts +28 -0
  87. package/dist/core/index.js +27 -0
  88. package/dist/core/metadata-types.d.ts +27 -0
  89. package/dist/core/metadata-types.js +10 -0
  90. package/dist/core/metadata-types.js.map +1 -0
  91. package/dist/core/metadata.d.ts +39 -0
  92. package/dist/core/metadata.js +76 -0
  93. package/dist/core/metadata.js.map +1 -0
  94. package/dist/core/notify.d.ts +31 -0
  95. package/dist/core/notify.js +7 -0
  96. package/dist/core/notify.js.map +1 -0
  97. package/dist/core/pipeline.d.ts +52 -0
  98. package/dist/core/pipeline.js +78 -0
  99. package/dist/core/pipeline.js.map +1 -0
  100. package/dist/core/schema/abilities.d.ts +55 -0
  101. package/dist/core/schema/abilities.js +113 -0
  102. package/dist/core/schema/abilities.js.map +1 -0
  103. package/dist/core/schema/block-ids.d.ts +29 -0
  104. package/dist/core/schema/block-ids.js +134 -0
  105. package/dist/core/schema/block-ids.js.map +1 -0
  106. package/dist/core/schema/hex-color.d.ts +5 -0
  107. package/dist/core/schema/hex-color.js +7 -0
  108. package/dist/core/schema/hex-color.js.map +1 -0
  109. package/dist/core/schema/index.d.ts +21 -0
  110. package/dist/core/schema/index.js +33 -0
  111. package/dist/core/schema/index.js.map +1 -0
  112. package/dist/core/schema/mark-flags.d.ts +12 -0
  113. package/dist/core/schema/node-flags.d.ts +23 -0
  114. package/dist/core/schema/node-flags.js +34 -0
  115. package/dist/core/schema/node-flags.js.map +1 -0
  116. package/dist/core/schema/opaque-fence.d.ts +11 -0
  117. package/dist/core/schema/opaque-fence.js +57 -0
  118. package/dist/core/schema/opaque-fence.js.map +1 -0
  119. package/dist/core/schema/strike.d.ts +4 -0
  120. package/dist/core/schema/strike.js +9 -0
  121. package/dist/core/schema/strike.js.map +1 -0
  122. package/dist/core/selection-range.d.ts +13 -0
  123. package/dist/core/selection-range.js +28 -0
  124. package/dist/core/selection-range.js.map +1 -0
  125. package/dist/core/slash.d.ts +24 -0
  126. package/dist/core/slash.js +60 -0
  127. package/dist/core/slash.js.map +1 -0
  128. package/dist/core/store.d.ts +22 -0
  129. package/dist/core/store.js +61 -0
  130. package/dist/core/store.js.map +1 -0
  131. package/dist/core/suggestion-popup.d.ts +63 -0
  132. package/dist/core/suggestion-popup.js +57 -0
  133. package/dist/core/suggestion-popup.js.map +1 -0
  134. package/dist/core/tag-name.js +11 -0
  135. package/dist/core/tag-name.js.map +1 -0
  136. package/dist/core/toolbar-items.d.ts +10 -0
  137. package/dist/core/toolbar-items.js +206 -0
  138. package/dist/core/toolbar-items.js.map +1 -0
  139. package/dist/core/toolbar.d.ts +74 -0
  140. package/dist/core/toolbar.js +45 -0
  141. package/dist/core/toolbar.js.map +1 -0
  142. package/dist/document/DocumentSurface.d.ts +38 -0
  143. package/dist/document/DocumentSurface.js +44 -0
  144. package/dist/document/DocumentSurface.js.map +1 -0
  145. package/dist/document/DocumentSurface.vue.d.ts +56 -0
  146. package/dist/document/DocumentSurface2.js +71 -0
  147. package/dist/document/DocumentSurface2.js.map +1 -0
  148. package/dist/document/react.d.ts +2 -0
  149. package/dist/document/react.js +1 -0
  150. package/dist/document/vue.d.ts +2 -0
  151. package/dist/document/vue.js +1 -0
  152. package/dist/features/ai/agent-op-review.d.ts +69 -0
  153. package/dist/features/ai/agent-op-review.js +182 -0
  154. package/dist/features/ai/agent-op-review.js.map +1 -0
  155. package/dist/features/ai/agent-ops.d.ts +15 -0
  156. package/dist/features/ai/agent-ops.js +228 -0
  157. package/dist/features/ai/agent-ops.js.map +1 -0
  158. package/dist/features/ai/ai-apply.d.ts +76 -0
  159. package/dist/features/ai/ai-apply.js +193 -0
  160. package/dist/features/ai/ai-apply.js.map +1 -0
  161. package/dist/features/ai/ai-menu.d.ts +38 -0
  162. package/dist/features/ai/ai-menu.js +20 -0
  163. package/dist/features/ai/ai-menu.js.map +1 -0
  164. package/dist/features/ai/ai-review.d.ts +136 -0
  165. package/dist/features/ai/ai-review.js +543 -0
  166. package/dist/features/ai/ai-review.js.map +1 -0
  167. package/dist/features/ai/ai-selection-highlight.d.ts +21 -0
  168. package/dist/features/ai/ai-selection-highlight.js +44 -0
  169. package/dist/features/ai/ai-selection-highlight.js.map +1 -0
  170. package/dist/features/ai/ai-sse.d.ts +28 -0
  171. package/dist/features/ai/ai-sse.js +82 -0
  172. package/dist/features/ai/ai-sse.js.map +1 -0
  173. package/dist/features/ai/assistant.d.ts +53 -0
  174. package/dist/features/ai/assistant.js +82 -0
  175. package/dist/features/ai/assistant.js.map +1 -0
  176. package/dist/features/ai/block-actions.d.ts +20 -0
  177. package/dist/features/ai/block-actions.js +55 -0
  178. package/dist/features/ai/block-actions.js.map +1 -0
  179. package/dist/features/ai/components/AiReviewBar.js +145 -0
  180. package/dist/features/ai/components/AiReviewBar.js.map +1 -0
  181. package/dist/features/ai/components/AiReviewBar.vue.d.ts +15 -0
  182. package/dist/features/ai/components/AiSelectionMenu.js +519 -0
  183. package/dist/features/ai/components/AiSelectionMenu.js.map +1 -0
  184. package/dist/features/ai/components/AiSelectionMenu.vue.d.ts +17 -0
  185. package/dist/features/ai/components/AiSidebar.js +378 -0
  186. package/dist/features/ai/components/AiSidebar.js.map +1 -0
  187. package/dist/features/ai/components/AiSidebar.vue.d.ts +26 -0
  188. package/dist/features/ai/components/DocumentChatAnswer.js +67 -0
  189. package/dist/features/ai/components/DocumentChatAnswer.js.map +1 -0
  190. package/dist/features/ai/components/DocumentChatAnswer.vue.d.ts +13 -0
  191. package/dist/features/ai/components/DocumentChatOps.js +113 -0
  192. package/dist/features/ai/components/DocumentChatOps.js.map +1 -0
  193. package/dist/features/ai/components/DocumentChatOps.vue.d.ts +27 -0
  194. package/dist/features/ai/components/ModelQuickSwitch.js +84 -0
  195. package/dist/features/ai/components/ModelQuickSwitch.js.map +1 -0
  196. package/dist/features/ai/components/ModelQuickSwitch.vue.d.ts +23 -0
  197. package/dist/features/ai/components/SettingsAiTab.js +88 -0
  198. package/dist/features/ai/components/SettingsAiTab.js.map +1 -0
  199. package/dist/features/ai/components/SettingsAiTab.vue.d.ts +6 -0
  200. package/dist/features/ai/components/SettingsModelProfiles.js +260 -0
  201. package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -0
  202. package/dist/features/ai/components/SettingsModelProfiles.vue.d.ts +6 -0
  203. package/dist/features/ai/document-chat-model.d.ts +88 -0
  204. package/dist/features/ai/document-chat-model.js +190 -0
  205. package/dist/features/ai/document-chat-model.js.map +1 -0
  206. package/dist/features/ai/document-chat.d.ts +17 -0
  207. package/dist/features/ai/document-chat.js +112 -0
  208. package/dist/features/ai/document-chat.js.map +1 -0
  209. package/dist/features/ai/feature.d.ts +25 -0
  210. package/dist/features/ai/feature.js +89 -0
  211. package/dist/features/ai/feature.js.map +1 -0
  212. package/dist/features/ai/ghost-autocomplete.d.ts +47 -0
  213. package/dist/features/ai/ghost-autocomplete.js +204 -0
  214. package/dist/features/ai/ghost-autocomplete.js.map +1 -0
  215. package/dist/features/ai/index.d.ts +24 -0
  216. package/dist/features/ai/index.js +23 -0
  217. package/dist/features/ai/model-profiles.d.ts +36 -0
  218. package/dist/features/ai/model-profiles.js +111 -0
  219. package/dist/features/ai/model-profiles.js.map +1 -0
  220. package/dist/features/ai/preview-extensions.js +14 -0
  221. package/dist/features/ai/preview-extensions.js.map +1 -0
  222. package/dist/features/ai/protocol/agent-ops.d.ts +120 -0
  223. package/dist/features/ai/protocol/agent-ops.js +298 -0
  224. package/dist/features/ai/protocol/agent-ops.js.map +1 -0
  225. package/dist/features/ai/protocol/chat.d.ts +57 -0
  226. package/dist/features/ai/protocol/chat.js +146 -0
  227. package/dist/features/ai/protocol/chat.js.map +1 -0
  228. package/dist/features/ai/protocol/complete.d.ts +21 -0
  229. package/dist/features/ai/protocol/complete.js +81 -0
  230. package/dist/features/ai/protocol/complete.js.map +1 -0
  231. package/dist/features/ai/protocol/index.d.ts +7 -0
  232. package/dist/features/ai/protocol/index.js +7 -0
  233. package/dist/features/ai/protocol/models.d.ts +48 -0
  234. package/dist/features/ai/protocol/models.js +41 -0
  235. package/dist/features/ai/protocol/models.js.map +1 -0
  236. package/dist/features/ai/protocol/schemas.d.ts +36 -0
  237. package/dist/features/ai/protocol/schemas.js +40 -0
  238. package/dist/features/ai/protocol/schemas.js.map +1 -0
  239. package/dist/features/ai/protocol/tasks.d.ts +107 -0
  240. package/dist/features/ai/protocol/tasks.js +227 -0
  241. package/dist/features/ai/protocol/tasks.js.map +1 -0
  242. package/dist/features/ai/rate-limit.d.ts +9 -0
  243. package/dist/features/ai/rate-limit.js +20 -0
  244. package/dist/features/ai/rate-limit.js.map +1 -0
  245. package/dist/features/ai/react/AiReviewBar.d.ts +12 -0
  246. package/dist/features/ai/react/AiReviewBar.js +156 -0
  247. package/dist/features/ai/react/AiReviewBar.js.map +1 -0
  248. package/dist/features/ai/react/AiSelectionMenu.d.ts +14 -0
  249. package/dist/features/ai/react/AiSelectionMenu.js +513 -0
  250. package/dist/features/ai/react/AiSelectionMenu.js.map +1 -0
  251. package/dist/features/ai/react/AiSidebar.d.ts +19 -0
  252. package/dist/features/ai/react/AiSidebar.js +339 -0
  253. package/dist/features/ai/react/AiSidebar.js.map +1 -0
  254. package/dist/features/ai/react/DocumentChatAnswer.d.ts +10 -0
  255. package/dist/features/ai/react/DocumentChatAnswer.js +70 -0
  256. package/dist/features/ai/react/DocumentChatAnswer.js.map +1 -0
  257. package/dist/features/ai/react/DocumentChatOps.d.ts +19 -0
  258. package/dist/features/ai/react/DocumentChatOps.js +111 -0
  259. package/dist/features/ai/react/DocumentChatOps.js.map +1 -0
  260. package/dist/features/ai/react/ModelQuickSwitch.d.ts +19 -0
  261. package/dist/features/ai/react/ModelQuickSwitch.js +89 -0
  262. package/dist/features/ai/react/ModelQuickSwitch.js.map +1 -0
  263. package/dist/features/ai/react/SettingsAiTab.d.ts +5 -0
  264. package/dist/features/ai/react/SettingsAiTab.js +103 -0
  265. package/dist/features/ai/react/SettingsAiTab.js.map +1 -0
  266. package/dist/features/ai/react/SettingsModelProfiles.d.ts +8 -0
  267. package/dist/features/ai/react/SettingsModelProfiles.js +318 -0
  268. package/dist/features/ai/react/SettingsModelProfiles.js.map +1 -0
  269. package/dist/features/ai/react/use-ai-assistant.d.ts +22 -0
  270. package/dist/features/ai/react/use-ai-assistant.js +36 -0
  271. package/dist/features/ai/react/use-ai-assistant.js.map +1 -0
  272. package/dist/features/ai/react/use-document-chat.d.ts +32 -0
  273. package/dist/features/ai/react/use-document-chat.js +43 -0
  274. package/dist/features/ai/react/use-document-chat.js.map +1 -0
  275. package/dist/features/ai/react/use-model-profiles.d.ts +20 -0
  276. package/dist/features/ai/react/use-model-profiles.js +33 -0
  277. package/dist/features/ai/react/use-model-profiles.js.map +1 -0
  278. package/dist/features/ai/react.d.ts +23 -0
  279. package/dist/features/ai/react.js +28 -0
  280. package/dist/features/ai/react.js.map +1 -0
  281. package/dist/features/ai/sidebar-flow.d.ts +61 -0
  282. package/dist/features/ai/sidebar-flow.js +125 -0
  283. package/dist/features/ai/sidebar-flow.js.map +1 -0
  284. package/dist/features/ai/use-ai-assistant.d.ts +22 -0
  285. package/dist/features/ai/use-ai-assistant.js +39 -0
  286. package/dist/features/ai/use-ai-assistant.js.map +1 -0
  287. package/dist/features/ai/use-document-chat.d.ts +33 -0
  288. package/dist/features/ai/use-document-chat.js +45 -0
  289. package/dist/features/ai/use-document-chat.js.map +1 -0
  290. package/dist/features/ai/use-model-profiles.d.ts +23 -0
  291. package/dist/features/ai/use-model-profiles.js +50 -0
  292. package/dist/features/ai/use-model-profiles.js.map +1 -0
  293. package/dist/features/ai/vue.d.ts +21 -0
  294. package/dist/features/ai/vue.js +28 -0
  295. package/dist/features/ai/vue.js.map +1 -0
  296. package/dist/features/authors/attribution.d.ts +36 -0
  297. package/dist/features/authors/attribution.js +94 -0
  298. package/dist/features/authors/attribution.js.map +1 -0
  299. package/dist/features/authors/author-color-styles.d.ts +12 -0
  300. package/dist/features/authors/author-color-styles.js +24 -0
  301. package/dist/features/authors/author-color-styles.js.map +1 -0
  302. package/dist/features/authors/components/AuthorColorsButton.js +50 -0
  303. package/dist/features/authors/components/AuthorColorsButton.js.map +1 -0
  304. package/dist/features/authors/components/AuthorColorsButton.vue.d.ts +11 -0
  305. package/dist/features/authors/components/AuthorColorsPanel.js +72 -0
  306. package/dist/features/authors/components/AuthorColorsPanel.js.map +1 -0
  307. package/dist/features/authors/components/AuthorColorsPanel.vue.d.ts +11 -0
  308. package/dist/features/authors/components/SettingsAuthorsTab.js +49 -0
  309. package/dist/features/authors/components/SettingsAuthorsTab.js.map +1 -0
  310. package/dist/features/authors/components/SettingsAuthorsTab.vue.d.ts +6 -0
  311. package/dist/features/authors/feature.d.ts +22 -0
  312. package/dist/features/authors/feature.js +47 -0
  313. package/dist/features/authors/feature.js.map +1 -0
  314. package/dist/features/authors/index.d.ts +7 -0
  315. package/dist/features/authors/index.js +6 -0
  316. package/dist/features/authors/react/AuthorColorsButton.d.ts +8 -0
  317. package/dist/features/authors/react/AuthorColorsButton.js +41 -0
  318. package/dist/features/authors/react/AuthorColorsButton.js.map +1 -0
  319. package/dist/features/authors/react/AuthorColorsPanel.d.ts +8 -0
  320. package/dist/features/authors/react/AuthorColorsPanel.js +125 -0
  321. package/dist/features/authors/react/AuthorColorsPanel.js.map +1 -0
  322. package/dist/features/authors/react/SettingsAuthorsTab.d.ts +5 -0
  323. package/dist/features/authors/react/SettingsAuthorsTab.js +92 -0
  324. package/dist/features/authors/react/SettingsAuthorsTab.js.map +1 -0
  325. package/dist/features/authors/react.d.ts +11 -0
  326. package/dist/features/authors/react.js +16 -0
  327. package/dist/features/authors/react.js.map +1 -0
  328. package/dist/features/authors/schema.d.ts +22 -0
  329. package/dist/features/authors/schema.js +70 -0
  330. package/dist/features/authors/schema.js.map +1 -0
  331. package/dist/features/authors/vue.d.ts +10 -0
  332. package/dist/features/authors/vue.js +16 -0
  333. package/dist/features/authors/vue.js.map +1 -0
  334. package/dist/features/block-ui/block-actions.d.ts +17 -0
  335. package/dist/features/block-ui/block-actions.js +37 -0
  336. package/dist/features/block-ui/block-actions.js.map +1 -0
  337. package/dist/features/block-ui/components/BlockActionsOverlay.js +142 -0
  338. package/dist/features/block-ui/components/BlockActionsOverlay.js.map +1 -0
  339. package/dist/features/block-ui/components/BlockActionsOverlay.vue.d.ts +25 -0
  340. package/dist/features/block-ui/components/BlockHandles.js +113 -0
  341. package/dist/features/block-ui/components/BlockHandles.js.map +1 -0
  342. package/dist/features/block-ui/components/BlockUi.js +181 -0
  343. package/dist/features/block-ui/components/BlockUi.js.map +1 -0
  344. package/dist/features/block-ui/components/BlockUi.vue.d.ts +17 -0
  345. package/dist/features/block-ui/feature.d.ts +21 -0
  346. package/dist/features/block-ui/feature.js +23 -0
  347. package/dist/features/block-ui/feature.js.map +1 -0
  348. package/dist/features/block-ui/handle-geometry.js +52 -0
  349. package/dist/features/block-ui/handle-geometry.js.map +1 -0
  350. package/dist/features/block-ui/index.d.ts +3 -0
  351. package/dist/features/block-ui/index.js +3 -0
  352. package/dist/features/block-ui/react/BlockActionsOverlay.d.ts +19 -0
  353. package/dist/features/block-ui/react/BlockActionsOverlay.js +142 -0
  354. package/dist/features/block-ui/react/BlockActionsOverlay.js.map +1 -0
  355. package/dist/features/block-ui/react/BlockHandles.d.ts +15 -0
  356. package/dist/features/block-ui/react/BlockHandles.js +104 -0
  357. package/dist/features/block-ui/react/BlockHandles.js.map +1 -0
  358. package/dist/features/block-ui/react/BlockUi.d.ts +14 -0
  359. package/dist/features/block-ui/react/BlockUi.js +174 -0
  360. package/dist/features/block-ui/react/BlockUi.js.map +1 -0
  361. package/dist/features/block-ui/react.d.ts +11 -0
  362. package/dist/features/block-ui/react.js +13 -0
  363. package/dist/features/block-ui/react.js.map +1 -0
  364. package/dist/features/block-ui/vue.d.ts +9 -0
  365. package/dist/features/block-ui/vue.js +12 -0
  366. package/dist/features/block-ui/vue.js.map +1 -0
  367. package/dist/features/collab/anchor-resolver.d.ts +7 -0
  368. package/dist/features/collab/anchor-resolver.js +92 -0
  369. package/dist/features/collab/anchor-resolver.js.map +1 -0
  370. package/dist/features/collab/feature.d.ts +22 -0
  371. package/dist/features/collab/feature.js +36 -0
  372. package/dist/features/collab/feature.js.map +1 -0
  373. package/dist/features/collab/index.d.ts +3 -0
  374. package/dist/features/collab/index.js +3 -0
  375. package/dist/features/collab/react.d.ts +7 -0
  376. package/dist/features/collab/react.js +10 -0
  377. package/dist/features/collab/react.js.map +1 -0
  378. package/dist/features/collab/vue.d.ts +6 -0
  379. package/dist/features/collab/vue.js +37 -0
  380. package/dist/features/collab/vue.js.map +1 -0
  381. package/dist/features/comments/comments-plugin.d.ts +71 -0
  382. package/dist/features/comments/comments-plugin.js +185 -0
  383. package/dist/features/comments/comments-plugin.js.map +1 -0
  384. package/dist/features/comments/components/CommentBubble.js +54 -0
  385. package/dist/features/comments/components/CommentBubble.js.map +1 -0
  386. package/dist/features/comments/components/CommentBubble.vue.d.ts +14 -0
  387. package/dist/features/comments/components/CommentComposer.js +87 -0
  388. package/dist/features/comments/components/CommentComposer.js.map +1 -0
  389. package/dist/features/comments/components/CommentComposer.vue.d.ts +21 -0
  390. package/dist/features/comments/components/CommentThreadView.js +255 -0
  391. package/dist/features/comments/components/CommentThreadView.js.map +1 -0
  392. package/dist/features/comments/components/CommentThreadView.vue.d.ts +29 -0
  393. package/dist/features/comments/components/CommentsListMenu.js +134 -0
  394. package/dist/features/comments/components/CommentsListMenu.js.map +1 -0
  395. package/dist/features/comments/components/CommentsListMenu.vue.d.ts +10 -0
  396. package/dist/features/comments/components/CommentsMargin.js +291 -0
  397. package/dist/features/comments/components/CommentsMargin.js.map +1 -0
  398. package/dist/features/comments/components/CommentsMargin.vue.d.ts +16 -0
  399. package/dist/features/comments/components/CommentsOverlay.js +39 -0
  400. package/dist/features/comments/components/CommentsOverlay.js.map +1 -0
  401. package/dist/features/comments/components/CommentsPopover.js +124 -0
  402. package/dist/features/comments/components/CommentsPopover.js.map +1 -0
  403. package/dist/features/comments/components/CommentsPopover.vue.d.ts +10 -0
  404. package/dist/features/comments/components/CommentsToolbarButton.js +61 -0
  405. package/dist/features/comments/components/CommentsToolbarButton.js.map +1 -0
  406. package/dist/features/comments/components/SettingsCommentsTab.js +46 -0
  407. package/dist/features/comments/components/SettingsCommentsTab.js.map +1 -0
  408. package/dist/features/comments/components/SettingsCommentsTab.vue.d.ts +6 -0
  409. package/dist/features/comments/feature.d.ts +39 -0
  410. package/dist/features/comments/feature.js +128 -0
  411. package/dist/features/comments/feature.js.map +1 -0
  412. package/dist/features/comments/index.d.ts +6 -0
  413. package/dist/features/comments/index.js +6 -0
  414. package/dist/features/comments/model.d.ts +87 -0
  415. package/dist/features/comments/model.js +390 -0
  416. package/dist/features/comments/model.js.map +1 -0
  417. package/dist/features/comments/react/CommentAvatar.js +24 -0
  418. package/dist/features/comments/react/CommentAvatar.js.map +1 -0
  419. package/dist/features/comments/react/CommentBubble.d.ts +11 -0
  420. package/dist/features/comments/react/CommentBubble.js +43 -0
  421. package/dist/features/comments/react/CommentBubble.js.map +1 -0
  422. package/dist/features/comments/react/CommentComposer.d.ts +15 -0
  423. package/dist/features/comments/react/CommentComposer.js +69 -0
  424. package/dist/features/comments/react/CommentComposer.js.map +1 -0
  425. package/dist/features/comments/react/CommentThreadView.d.ts +24 -0
  426. package/dist/features/comments/react/CommentThreadView.js +249 -0
  427. package/dist/features/comments/react/CommentThreadView.js.map +1 -0
  428. package/dist/features/comments/react/CommentsListMenu.d.ts +8 -0
  429. package/dist/features/comments/react/CommentsListMenu.js +115 -0
  430. package/dist/features/comments/react/CommentsListMenu.js.map +1 -0
  431. package/dist/features/comments/react/CommentsMargin.d.ts +16 -0
  432. package/dist/features/comments/react/CommentsMargin.js +294 -0
  433. package/dist/features/comments/react/CommentsMargin.js.map +1 -0
  434. package/dist/features/comments/react/CommentsOverlay.d.ts +11 -0
  435. package/dist/features/comments/react/CommentsOverlay.js +52 -0
  436. package/dist/features/comments/react/CommentsOverlay.js.map +1 -0
  437. package/dist/features/comments/react/CommentsPopover.d.ts +15 -0
  438. package/dist/features/comments/react/CommentsPopover.js +107 -0
  439. package/dist/features/comments/react/CommentsPopover.js.map +1 -0
  440. package/dist/features/comments/react/CommentsToolbarButton.d.ts +12 -0
  441. package/dist/features/comments/react/CommentsToolbarButton.js +52 -0
  442. package/dist/features/comments/react/CommentsToolbarButton.js.map +1 -0
  443. package/dist/features/comments/react/SettingsCommentsTab.d.ts +5 -0
  444. package/dist/features/comments/react/SettingsCommentsTab.js +77 -0
  445. package/dist/features/comments/react/SettingsCommentsTab.js.map +1 -0
  446. package/dist/features/comments/react/use-comments.d.ts +17 -0
  447. package/dist/features/comments/react/use-comments.js +37 -0
  448. package/dist/features/comments/react/use-comments.js.map +1 -0
  449. package/dist/features/comments/react.d.ts +23 -0
  450. package/dist/features/comments/react.js +28 -0
  451. package/dist/features/comments/react.js.map +1 -0
  452. package/dist/features/comments/schema.d.ts +51 -0
  453. package/dist/features/comments/schema.js +41 -0
  454. package/dist/features/comments/schema.js.map +1 -0
  455. package/dist/features/comments/shortcuts.js +34 -0
  456. package/dist/features/comments/shortcuts.js.map +1 -0
  457. package/dist/features/comments/use-comments.d.ts +37 -0
  458. package/dist/features/comments/use-comments.js +45 -0
  459. package/dist/features/comments/use-comments.js.map +1 -0
  460. package/dist/features/comments/vue.d.ts +20 -0
  461. package/dist/features/comments/vue.js +28 -0
  462. package/dist/features/comments/vue.js.map +1 -0
  463. package/dist/features/composites/ai-brief.d.ts +31 -0
  464. package/dist/features/composites/ai-brief.js +56 -0
  465. package/dist/features/composites/ai-brief.js.map +1 -0
  466. package/dist/features/composites/anchors.d.ts +47 -0
  467. package/dist/features/composites/anchors.js +137 -0
  468. package/dist/features/composites/anchors.js.map +1 -0
  469. package/dist/features/composites/components/CompositeChrome.js +243 -0
  470. package/dist/features/composites/components/CompositeChrome.js.map +1 -0
  471. package/dist/features/composites/components/CompositeChrome.vue.d.ts +19 -0
  472. package/dist/features/composites/components/CompositeDetails.js +158 -0
  473. package/dist/features/composites/components/CompositeDetails.js.map +1 -0
  474. package/dist/features/composites/components/CompositeDetails.vue.d.ts +19 -0
  475. package/dist/features/composites/components/CompositeFieldEditor.js +114 -0
  476. package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -0
  477. package/dist/features/composites/components/CompositeFieldEditor.vue.d.ts +23 -0
  478. package/dist/features/composites/components/CompositeInspector.js +439 -0
  479. package/dist/features/composites/components/CompositeInspector.js.map +1 -0
  480. package/dist/features/composites/components/CompositeInspector.vue.d.ts +32 -0
  481. package/dist/features/composites/components/CompositeStatusMenu.js +51 -0
  482. package/dist/features/composites/components/CompositeStatusMenu.js.map +1 -0
  483. package/dist/features/composites/components/CompositeStatusMenu.vue.d.ts +28 -0
  484. package/dist/features/composites/components/CompositeSummaryEditor.js +79 -0
  485. package/dist/features/composites/components/CompositeSummaryEditor.js.map +1 -0
  486. package/dist/features/composites/components/CompositeSummaryEditor.vue.d.ts +18 -0
  487. package/dist/features/composites/components/CompositeTable.js +348 -0
  488. package/dist/features/composites/components/CompositeTable.js.map +1 -0
  489. package/dist/features/composites/components/CompositeTable.vue.d.ts +15 -0
  490. package/dist/features/composites/components/CompositeTagsEditor.js +95 -0
  491. package/dist/features/composites/components/CompositeTagsEditor.js.map +1 -0
  492. package/dist/features/composites/components/CompositeTagsEditor.vue.d.ts +13 -0
  493. package/dist/features/composites/components/CompositeView.js +46 -0
  494. package/dist/features/composites/components/CompositeView.js.map +1 -0
  495. package/dist/features/composites/components/CompositeView.vue.d.ts +96 -0
  496. package/dist/features/composites/components/SettingsEditingTab.js +119 -0
  497. package/dist/features/composites/components/SettingsEditingTab.js.map +1 -0
  498. package/dist/features/composites/components/SettingsEditingTab.vue.d.ts +11 -0
  499. package/dist/features/composites/convert.d.ts +24 -0
  500. package/dist/features/composites/convert.js +145 -0
  501. package/dist/features/composites/convert.js.map +1 -0
  502. package/dist/features/composites/editing-settings-keys.js +47 -0
  503. package/dist/features/composites/editing-settings-keys.js.map +1 -0
  504. package/dist/features/composites/feature.d.ts +30 -0
  505. package/dist/features/composites/feature.js +305 -0
  506. package/dist/features/composites/feature.js.map +1 -0
  507. package/dist/features/composites/fences.d.ts +20 -0
  508. package/dist/features/composites/fences.js +86 -0
  509. package/dist/features/composites/fences.js.map +1 -0
  510. package/dist/features/composites/heading-composites.d.ts +36 -0
  511. package/dist/features/composites/heading-composites.js +140 -0
  512. package/dist/features/composites/heading-composites.js.map +1 -0
  513. package/dist/features/composites/index.d.ts +20 -0
  514. package/dist/features/composites/index.js +20 -0
  515. package/dist/features/composites/kinds.d.ts +49 -0
  516. package/dist/features/composites/kinds.js +131 -0
  517. package/dist/features/composites/kinds.js.map +1 -0
  518. package/dist/features/composites/legacy.d.ts +8 -0
  519. package/dist/features/composites/legacy.js +25 -0
  520. package/dist/features/composites/legacy.js.map +1 -0
  521. package/dist/features/composites/markdown-export.d.ts +17 -0
  522. package/dist/features/composites/markdown-export.js +49 -0
  523. package/dist/features/composites/markdown-export.js.map +1 -0
  524. package/dist/features/composites/meta-display.js +46 -0
  525. package/dist/features/composites/meta-display.js.map +1 -0
  526. package/dist/features/composites/node-views.d.ts +17 -0
  527. package/dist/features/composites/node-views.js +18 -0
  528. package/dist/features/composites/node-views.js.map +1 -0
  529. package/dist/features/composites/nodes.d.ts +56 -0
  530. package/dist/features/composites/nodes.js +480 -0
  531. package/dist/features/composites/nodes.js.map +1 -0
  532. package/dist/features/composites/outline.d.ts +35 -0
  533. package/dist/features/composites/outline.js +69 -0
  534. package/dist/features/composites/outline.js.map +1 -0
  535. package/dist/features/composites/react/CompositeChrome.d.ts +16 -0
  536. package/dist/features/composites/react/CompositeChrome.js +234 -0
  537. package/dist/features/composites/react/CompositeChrome.js.map +1 -0
  538. package/dist/features/composites/react/CompositeDetails.d.ts +16 -0
  539. package/dist/features/composites/react/CompositeDetails.js +149 -0
  540. package/dist/features/composites/react/CompositeDetails.js.map +1 -0
  541. package/dist/features/composites/react/CompositeFieldEditor.d.ts +18 -0
  542. package/dist/features/composites/react/CompositeFieldEditor.js +131 -0
  543. package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -0
  544. package/dist/features/composites/react/CompositeInspector.d.ts +23 -0
  545. package/dist/features/composites/react/CompositeInspector.js +506 -0
  546. package/dist/features/composites/react/CompositeInspector.js.map +1 -0
  547. package/dist/features/composites/react/CompositeStatusMenu.d.ts +15 -0
  548. package/dist/features/composites/react/CompositeStatusMenu.js +36 -0
  549. package/dist/features/composites/react/CompositeStatusMenu.js.map +1 -0
  550. package/dist/features/composites/react/CompositeSummaryEditor.d.ts +15 -0
  551. package/dist/features/composites/react/CompositeSummaryEditor.js +85 -0
  552. package/dist/features/composites/react/CompositeSummaryEditor.js.map +1 -0
  553. package/dist/features/composites/react/CompositeTable.d.ts +11 -0
  554. package/dist/features/composites/react/CompositeTable.js +342 -0
  555. package/dist/features/composites/react/CompositeTable.js.map +1 -0
  556. package/dist/features/composites/react/CompositeTagsEditor.d.ts +10 -0
  557. package/dist/features/composites/react/CompositeTagsEditor.js +122 -0
  558. package/dist/features/composites/react/CompositeTagsEditor.js.map +1 -0
  559. package/dist/features/composites/react/CompositeView.d.ts +6 -0
  560. package/dist/features/composites/react/CompositeView.js +30 -0
  561. package/dist/features/composites/react/CompositeView.js.map +1 -0
  562. package/dist/features/composites/react/SettingsEditingTab.d.ts +8 -0
  563. package/dist/features/composites/react/SettingsEditingTab.js +153 -0
  564. package/dist/features/composites/react/SettingsEditingTab.js.map +1 -0
  565. package/dist/features/composites/react/use-composite-anchors.d.ts +17 -0
  566. package/dist/features/composites/react/use-composite-anchors.js +46 -0
  567. package/dist/features/composites/react/use-composite-anchors.js.map +1 -0
  568. package/dist/features/composites/react/use-composite-rows.d.ts +11 -0
  569. package/dist/features/composites/react/use-composite-rows.js +26 -0
  570. package/dist/features/composites/react/use-composite-rows.js.map +1 -0
  571. package/dist/features/composites/react.d.ts +24 -0
  572. package/dist/features/composites/react.js +30 -0
  573. package/dist/features/composites/react.js.map +1 -0
  574. package/dist/features/composites/rows-model.d.ts +38 -0
  575. package/dist/features/composites/rows-model.js +92 -0
  576. package/dist/features/composites/rows-model.js.map +1 -0
  577. package/dist/features/composites/rows.d.ts +76 -0
  578. package/dist/features/composites/rows.js +159 -0
  579. package/dist/features/composites/rows.js.map +1 -0
  580. package/dist/features/composites/schema.d.ts +21 -0
  581. package/dist/features/composites/schema.js +26 -0
  582. package/dist/features/composites/schema.js.map +1 -0
  583. package/dist/features/composites/structure-mode.d.ts +11 -0
  584. package/dist/features/composites/structure-mode.js +16 -0
  585. package/dist/features/composites/structure-mode.js.map +1 -0
  586. package/dist/features/composites/structure.d.ts +19 -0
  587. package/dist/features/composites/structure.js +19 -0
  588. package/dist/features/composites/structure.js.map +1 -0
  589. package/dist/features/composites/table-model.js +117 -0
  590. package/dist/features/composites/table-model.js.map +1 -0
  591. package/dist/features/composites/tree-root.d.ts +11 -0
  592. package/dist/features/composites/tree-root.js +16 -0
  593. package/dist/features/composites/tree-root.js.map +1 -0
  594. package/dist/features/composites/use-composite-anchors.d.ts +18 -0
  595. package/dist/features/composites/use-composite-anchors.js +42 -0
  596. package/dist/features/composites/use-composite-anchors.js.map +1 -0
  597. package/dist/features/composites/use-composite-rows.d.ts +25 -0
  598. package/dist/features/composites/use-composite-rows.js +28 -0
  599. package/dist/features/composites/use-composite-rows.js.map +1 -0
  600. package/dist/features/composites/vue.d.ts +23 -0
  601. package/dist/features/composites/vue.js +30 -0
  602. package/dist/features/composites/vue.js.map +1 -0
  603. package/dist/features/media/assets.d.ts +30 -0
  604. package/dist/features/media/assets.js +26 -0
  605. package/dist/features/media/assets.js.map +1 -0
  606. package/dist/features/media/audio-recorder.d.ts +25 -0
  607. package/dist/features/media/audio-recorder.js +123 -0
  608. package/dist/features/media/audio-recorder.js.map +1 -0
  609. package/dist/features/media/components/AudioRecorderModal.js +152 -0
  610. package/dist/features/media/components/AudioRecorderModal.js.map +1 -0
  611. package/dist/features/media/components/AudioRecorderModal.vue.d.ts +15 -0
  612. package/dist/features/media/components/AudioView.js +46 -0
  613. package/dist/features/media/components/AudioView.js.map +1 -0
  614. package/dist/features/media/components/FileView.js +73 -0
  615. package/dist/features/media/components/FileView.js.map +1 -0
  616. package/dist/features/media/components/VideoView.js +47 -0
  617. package/dist/features/media/components/VideoView.js.map +1 -0
  618. package/dist/features/media/feature.d.ts +22 -0
  619. package/dist/features/media/feature.js +101 -0
  620. package/dist/features/media/feature.js.map +1 -0
  621. package/dist/features/media/file-import.d.ts +21 -0
  622. package/dist/features/media/file-import.js +76 -0
  623. package/dist/features/media/file-import.js.map +1 -0
  624. package/dist/features/media/index.d.ts +7 -0
  625. package/dist/features/media/index.js +7 -0
  626. package/dist/features/media/node-views.d.ts +28 -0
  627. package/dist/features/media/node-views.js +28 -0
  628. package/dist/features/media/node-views.js.map +1 -0
  629. package/dist/features/media/react/AudioRecorderModal.d.ts +12 -0
  630. package/dist/features/media/react/AudioRecorderModal.js +147 -0
  631. package/dist/features/media/react/AudioRecorderModal.js.map +1 -0
  632. package/dist/features/media/react/AudioView.js +32 -0
  633. package/dist/features/media/react/AudioView.js.map +1 -0
  634. package/dist/features/media/react/FileView.js +61 -0
  635. package/dist/features/media/react/FileView.js.map +1 -0
  636. package/dist/features/media/react/TitleField.js +30 -0
  637. package/dist/features/media/react/TitleField.js.map +1 -0
  638. package/dist/features/media/react/VideoView.js +33 -0
  639. package/dist/features/media/react/VideoView.js.map +1 -0
  640. package/dist/features/media/react/use-audio-recorder.d.ts +11 -0
  641. package/dist/features/media/react/use-audio-recorder.js +21 -0
  642. package/dist/features/media/react/use-audio-recorder.js.map +1 -0
  643. package/dist/features/media/react.d.ts +19 -0
  644. package/dist/features/media/react.js +37 -0
  645. package/dist/features/media/react.js.map +1 -0
  646. package/dist/features/media/schema.d.ts +59 -0
  647. package/dist/features/media/schema.js +194 -0
  648. package/dist/features/media/schema.js.map +1 -0
  649. package/dist/features/media/upload.d.ts +41 -0
  650. package/dist/features/media/upload.js +106 -0
  651. package/dist/features/media/upload.js.map +1 -0
  652. package/dist/features/media/use-audio-recorder.d.ts +12 -0
  653. package/dist/features/media/use-audio-recorder.js +21 -0
  654. package/dist/features/media/use-audio-recorder.js.map +1 -0
  655. package/dist/features/media/vue.d.ts +19 -0
  656. package/dist/features/media/vue.js +35 -0
  657. package/dist/features/media/vue.js.map +1 -0
  658. package/dist/features/mentions/index.d.ts +22 -0
  659. package/dist/features/mentions/index.js +34 -0
  660. package/dist/features/mentions/index.js.map +1 -0
  661. package/dist/features/mentions/mention-suggestion.d.ts +11 -0
  662. package/dist/features/mentions/mention-suggestion.js +34 -0
  663. package/dist/features/mentions/mention-suggestion.js.map +1 -0
  664. package/dist/features/mentions/mention-text.d.ts +18 -0
  665. package/dist/features/mentions/mention-text.js +75 -0
  666. package/dist/features/mentions/mention-text.js.map +1 -0
  667. package/dist/features/mentions/mention.d.ts +20 -0
  668. package/dist/features/mentions/mention.js +33 -0
  669. package/dist/features/mentions/mention.js.map +1 -0
  670. package/dist/features/mentions/metadata-defaults.d.ts +8 -0
  671. package/dist/features/mentions/metadata-defaults.js +30 -0
  672. package/dist/features/mentions/metadata-defaults.js.map +1 -0
  673. package/dist/features/mentions/normalize.d.ts +10 -0
  674. package/dist/features/mentions/normalize.js +31 -0
  675. package/dist/features/mentions/normalize.js.map +1 -0
  676. package/dist/features/mentions/schema.d.ts +10 -0
  677. package/dist/features/mentions/schema.js +10 -0
  678. package/dist/features/mentions/schema.js.map +1 -0
  679. package/dist/features/mentions/tag-suggestion.d.ts +11 -0
  680. package/dist/features/mentions/tag-suggestion.js +45 -0
  681. package/dist/features/mentions/tag-suggestion.js.map +1 -0
  682. package/dist/features/mentions/tag.d.ts +43 -0
  683. package/dist/features/mentions/tag.js +155 -0
  684. package/dist/features/mentions/tag.js.map +1 -0
  685. package/dist/features/tables/feature.d.ts +14 -0
  686. package/dist/features/tables/feature.js +100 -0
  687. package/dist/features/tables/feature.js.map +1 -0
  688. package/dist/features/tables/index.d.ts +3 -0
  689. package/dist/features/tables/index.js +3 -0
  690. package/dist/features/tables/schema.d.ts +6 -0
  691. package/dist/features/tables/schema.js +27 -0
  692. package/dist/features/tables/schema.js.map +1 -0
  693. package/dist/features/themes/components/SettingsAppearanceTab.js +227 -0
  694. package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -0
  695. package/dist/features/themes/components/SettingsAppearanceTab.vue.d.ts +6 -0
  696. package/dist/features/themes/feature.d.ts +24 -0
  697. package/dist/features/themes/feature.js +25 -0
  698. package/dist/features/themes/feature.js.map +1 -0
  699. package/dist/features/themes/index.d.ts +6 -0
  700. package/dist/features/themes/index.js +6 -0
  701. package/dist/features/themes/react/SettingsAppearanceTab.d.ts +5 -0
  702. package/dist/features/themes/react/SettingsAppearanceTab.js +221 -0
  703. package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -0
  704. package/dist/features/themes/react.d.ts +13 -0
  705. package/dist/features/themes/react.js +15 -0
  706. package/dist/features/themes/react.js.map +1 -0
  707. package/dist/features/themes/schema.d.ts +21 -0
  708. package/dist/features/themes/schema.js +16 -0
  709. package/dist/features/themes/schema.js.map +1 -0
  710. package/dist/features/themes/scope-css.d.ts +5 -0
  711. package/dist/features/themes/scope-css.js +142 -0
  712. package/dist/features/themes/scope-css.js.map +1 -0
  713. package/dist/features/themes/theme-runtime.d.ts +14 -0
  714. package/dist/features/themes/theme-runtime.js +147 -0
  715. package/dist/features/themes/theme-runtime.js.map +1 -0
  716. package/dist/features/themes/vue.d.ts +13 -0
  717. package/dist/features/themes/vue.js +29 -0
  718. package/dist/features/themes/vue.js.map +1 -0
  719. package/dist/features/transcript/TranscriptSegmentView.js +169 -0
  720. package/dist/features/transcript/TranscriptSegmentView.js.map +1 -0
  721. package/dist/features/transcript/TranscriptSegmentView.vue.d.ts +96 -0
  722. package/dist/features/transcript/convert.d.ts +11 -0
  723. package/dist/features/transcript/convert.js +40 -0
  724. package/dist/features/transcript/convert.js.map +1 -0
  725. package/dist/features/transcript/feature.d.ts +25 -0
  726. package/dist/features/transcript/feature.js +59 -0
  727. package/dist/features/transcript/feature.js.map +1 -0
  728. package/dist/features/transcript/index.d.ts +7 -0
  729. package/dist/features/transcript/index.js +7 -0
  730. package/dist/features/transcript/react/TranscriptSegmentView.d.ts +6 -0
  731. package/dist/features/transcript/react/TranscriptSegmentView.js +155 -0
  732. package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -0
  733. package/dist/features/transcript/react.d.ts +9 -0
  734. package/dist/features/transcript/react.js +12 -0
  735. package/dist/features/transcript/react.js.map +1 -0
  736. package/dist/features/transcript/schema.d.ts +9 -0
  737. package/dist/features/transcript/schema.js +9 -0
  738. package/dist/features/transcript/schema.js.map +1 -0
  739. package/dist/features/transcript/segment-node.d.ts +21 -0
  740. package/dist/features/transcript/segment-node.js +113 -0
  741. package/dist/features/transcript/segment-node.js.map +1 -0
  742. package/dist/features/transcript/segment.d.ts +10 -0
  743. package/dist/features/transcript/segment.js +26 -0
  744. package/dist/features/transcript/segment.js.map +1 -0
  745. package/dist/features/transcript/speakers.d.ts +8 -0
  746. package/dist/features/transcript/speakers.js +22 -0
  747. package/dist/features/transcript/speakers.js.map +1 -0
  748. package/dist/features/transcript/vue.d.ts +8 -0
  749. package/dist/features/transcript/vue.js +12 -0
  750. package/dist/features/transcript/vue.js.map +1 -0
  751. package/dist/i18n/de/ai.js +168 -0
  752. package/dist/i18n/de/ai.js.map +1 -0
  753. package/dist/i18n/de/authors.js +21 -0
  754. package/dist/i18n/de/authors.js.map +1 -0
  755. package/dist/i18n/de/block.js +16 -0
  756. package/dist/i18n/de/block.js.map +1 -0
  757. package/dist/i18n/de/comments.js +35 -0
  758. package/dist/i18n/de/comments.js.map +1 -0
  759. package/dist/i18n/de/common.js +10 -0
  760. package/dist/i18n/de/common.js.map +1 -0
  761. package/dist/i18n/de/composites.js +147 -0
  762. package/dist/i18n/de/composites.js.map +1 -0
  763. package/dist/i18n/de/integrations.js +42 -0
  764. package/dist/i18n/de/integrations.js.map +1 -0
  765. package/dist/i18n/de/markdown.js +16 -0
  766. package/dist/i18n/de/markdown.js.map +1 -0
  767. package/dist/i18n/de/media.js +27 -0
  768. package/dist/i18n/de/media.js.map +1 -0
  769. package/dist/i18n/de/mentions.js +10 -0
  770. package/dist/i18n/de/mentions.js.map +1 -0
  771. package/dist/i18n/de/outline.js +9 -0
  772. package/dist/i18n/de/outline.js.map +1 -0
  773. package/dist/i18n/de/settings.js +12 -0
  774. package/dist/i18n/de/settings.js.map +1 -0
  775. package/dist/i18n/de/tables.js +15 -0
  776. package/dist/i18n/de/tables.js.map +1 -0
  777. package/dist/i18n/de/themes.js +26 -0
  778. package/dist/i18n/de/themes.js.map +1 -0
  779. package/dist/i18n/de/toolbar.js +22 -0
  780. package/dist/i18n/de/toolbar.js.map +1 -0
  781. package/dist/i18n/de/transcript.js +10 -0
  782. package/dist/i18n/de/transcript.js.map +1 -0
  783. package/dist/i18n/de/tree.js +31 -0
  784. package/dist/i18n/de/tree.js.map +1 -0
  785. package/dist/i18n/de.d.ts +502 -0
  786. package/dist/i18n/de.js +42 -0
  787. package/dist/i18n/de.js.map +1 -0
  788. package/dist/i18n/en/ai.js +168 -0
  789. package/dist/i18n/en/ai.js.map +1 -0
  790. package/dist/i18n/en/authors.js +21 -0
  791. package/dist/i18n/en/authors.js.map +1 -0
  792. package/dist/i18n/en/block.js +16 -0
  793. package/dist/i18n/en/block.js.map +1 -0
  794. package/dist/i18n/en/comments.js +35 -0
  795. package/dist/i18n/en/comments.js.map +1 -0
  796. package/dist/i18n/en/common.js +10 -0
  797. package/dist/i18n/en/common.js.map +1 -0
  798. package/dist/i18n/en/composites.js +145 -0
  799. package/dist/i18n/en/composites.js.map +1 -0
  800. package/dist/i18n/en/integrations.js +42 -0
  801. package/dist/i18n/en/integrations.js.map +1 -0
  802. package/dist/i18n/en/markdown.js +16 -0
  803. package/dist/i18n/en/markdown.js.map +1 -0
  804. package/dist/i18n/en/media.js +27 -0
  805. package/dist/i18n/en/media.js.map +1 -0
  806. package/dist/i18n/en/mentions.js +10 -0
  807. package/dist/i18n/en/mentions.js.map +1 -0
  808. package/dist/i18n/en/outline.js +9 -0
  809. package/dist/i18n/en/outline.js.map +1 -0
  810. package/dist/i18n/en/settings.js +12 -0
  811. package/dist/i18n/en/settings.js.map +1 -0
  812. package/dist/i18n/en/tables.js +15 -0
  813. package/dist/i18n/en/tables.js.map +1 -0
  814. package/dist/i18n/en/themes.js +26 -0
  815. package/dist/i18n/en/themes.js.map +1 -0
  816. package/dist/i18n/en/toolbar.js +22 -0
  817. package/dist/i18n/en/toolbar.js.map +1 -0
  818. package/dist/i18n/en/transcript.js +10 -0
  819. package/dist/i18n/en/transcript.js.map +1 -0
  820. package/dist/i18n/en/tree.js +31 -0
  821. package/dist/i18n/en/tree.js.map +1 -0
  822. package/dist/i18n/en.js +42 -0
  823. package/dist/i18n/en.js.map +1 -0
  824. package/dist/i18n/index.d.ts +24 -0
  825. package/dist/i18n/index.js +31 -0
  826. package/dist/i18n/index.js.map +1 -0
  827. package/dist/index.d.ts +6 -0
  828. package/dist/index.js +0 -0
  829. package/dist/integrations/composite-ai/composite-fill.d.ts +17 -0
  830. package/dist/integrations/composite-ai/composite-fill.js +129 -0
  831. package/dist/integrations/composite-ai/composite-fill.js.map +1 -0
  832. package/dist/integrations/composite-ai/composite-summary.d.ts +28 -0
  833. package/dist/integrations/composite-ai/composite-summary.js +143 -0
  834. package/dist/integrations/composite-ai/composite-summary.js.map +1 -0
  835. package/dist/integrations/composite-ai/document-transcribe.d.ts +14 -0
  836. package/dist/integrations/composite-ai/document-transcribe.js +89 -0
  837. package/dist/integrations/composite-ai/document-transcribe.js.map +1 -0
  838. package/dist/integrations/composite-ai/index.d.ts +22 -0
  839. package/dist/integrations/composite-ai/index.js +80 -0
  840. package/dist/integrations/composite-ai/index.js.map +1 -0
  841. package/dist/integrations/composite-media/index.d.ts +19 -0
  842. package/dist/integrations/composite-media/index.js +72 -0
  843. package/dist/integrations/composite-media/index.js.map +1 -0
  844. package/dist/integrations/transcript-ai/index.d.ts +16 -0
  845. package/dist/integrations/transcript-ai/index.js +63 -0
  846. package/dist/integrations/transcript-ai/index.js.map +1 -0
  847. package/dist/integrations/transcript-ai/protocol.d.ts +68 -0
  848. package/dist/integrations/transcript-ai/protocol.js +132 -0
  849. package/dist/integrations/transcript-ai/protocol.js.map +1 -0
  850. package/dist/integrations/transcript-ai/transcript-cleanup.d.ts +35 -0
  851. package/dist/integrations/transcript-ai/transcript-cleanup.js +169 -0
  852. package/dist/integrations/transcript-ai/transcript-cleanup.js.map +1 -0
  853. package/dist/markdown/MarkdownSurface.d.ts +25 -0
  854. package/dist/markdown/MarkdownSurface.js +93 -0
  855. package/dist/markdown/MarkdownSurface.js.map +1 -0
  856. package/dist/markdown/MarkdownSurface.vue.d.ts +76 -0
  857. package/dist/markdown/MarkdownSurface2.js +237 -0
  858. package/dist/markdown/MarkdownSurface2.js.map +1 -0
  859. package/dist/markdown/clipboard.d.ts +17 -0
  860. package/dist/markdown/clipboard.js +125 -0
  861. package/dist/markdown/clipboard.js.map +1 -0
  862. package/dist/markdown/document.d.ts +36 -0
  863. package/dist/markdown/document.js +100 -0
  864. package/dist/markdown/document.js.map +1 -0
  865. package/dist/markdown/frontmatter.d.ts +18 -0
  866. package/dist/markdown/frontmatter.js +32 -0
  867. package/dist/markdown/frontmatter.js.map +1 -0
  868. package/dist/markdown/index.d.ts +6 -0
  869. package/dist/markdown/index.js +6 -0
  870. package/dist/markdown/policy.d.ts +34 -0
  871. package/dist/markdown/policy.js +78 -0
  872. package/dist/markdown/policy.js.map +1 -0
  873. package/dist/markdown/react.d.ts +2 -0
  874. package/dist/markdown/react.js +1 -0
  875. package/dist/markdown/source-mode.d.ts +49 -0
  876. package/dist/markdown/source-mode.js +86 -0
  877. package/dist/markdown/source-mode.js.map +1 -0
  878. package/dist/markdown/vue.d.ts +2 -0
  879. package/dist/markdown/vue.js +1 -0
  880. package/dist/nuxt/module.d.ts +62 -0
  881. package/dist/nuxt/module.js +101 -0
  882. package/dist/nuxt/module.js.map +1 -0
  883. package/dist/nuxt/runtime/install-context.d.ts +16 -0
  884. package/dist/nuxt/runtime/install-context.js +25 -0
  885. package/dist/nuxt/runtime/install-context.js.map +1 -0
  886. package/dist/nuxt/runtime/plugins/editor-context-nuxt-ui.client.ts +8 -0
  887. package/dist/nuxt/runtime/server/api/ai/chat.post.d.ts +5 -0
  888. package/dist/nuxt/runtime/server/api/ai/chat.post.js +8 -0
  889. package/dist/nuxt/runtime/server/api/ai/chat.post.js.map +1 -0
  890. package/dist/nuxt/runtime/server/api/ai/complete.post.d.ts +5 -0
  891. package/dist/nuxt/runtime/server/api/ai/complete.post.js +8 -0
  892. package/dist/nuxt/runtime/server/api/ai/complete.post.js.map +1 -0
  893. package/dist/nuxt/runtime/server/api/ai/generate.post.d.ts +5 -0
  894. package/dist/nuxt/runtime/server/api/ai/generate.post.js +8 -0
  895. package/dist/nuxt/runtime/server/api/ai/generate.post.js.map +1 -0
  896. package/dist/nuxt/runtime/server/api/ai/models.get.d.ts +5 -0
  897. package/dist/nuxt/runtime/server/api/ai/models.get.js +8 -0
  898. package/dist/nuxt/runtime/server/api/ai/models.get.js.map +1 -0
  899. package/dist/nuxt/runtime/server/api/ai/transcribe.post.d.ts +5 -0
  900. package/dist/nuxt/runtime/server/api/ai/transcribe.post.js +8 -0
  901. package/dist/nuxt/runtime/server/api/ai/transcribe.post.js.map +1 -0
  902. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.d.ts +5 -0
  903. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js +8 -0
  904. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js.map +1 -0
  905. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.d.ts +5 -0
  906. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js +8 -0
  907. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js.map +1 -0
  908. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.d.ts +5 -0
  909. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js +8 -0
  910. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js.map +1 -0
  911. package/dist/nuxt/runtime/server/api/editor/settings.get.d.ts +5 -0
  912. package/dist/nuxt/runtime/server/api/editor/settings.get.js +8 -0
  913. package/dist/nuxt/runtime/server/api/editor/settings.get.js.map +1 -0
  914. package/dist/nuxt/runtime/server/api/editor/settings.put.d.ts +5 -0
  915. package/dist/nuxt/runtime/server/api/editor/settings.put.js +8 -0
  916. package/dist/nuxt/runtime/server/api/editor/settings.put.js.map +1 -0
  917. package/dist/nuxt/runtime/server/api/editor/tags.get.d.ts +5 -0
  918. package/dist/nuxt/runtime/server/api/editor/tags.get.js +8 -0
  919. package/dist/nuxt/runtime/server/api/editor/tags.get.js.map +1 -0
  920. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.d.ts +5 -0
  921. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js +8 -0
  922. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js.map +1 -0
  923. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.d.ts +5 -0
  924. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js +8 -0
  925. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js.map +1 -0
  926. package/dist/nuxt/runtime/server/api/editor/themes/index.get.d.ts +5 -0
  927. package/dist/nuxt/runtime/server/api/editor/themes/index.get.js +8 -0
  928. package/dist/nuxt/runtime/server/api/editor/themes/index.get.js.map +1 -0
  929. package/dist/nuxt/runtime/server/api/editor/themes/index.post.d.ts +5 -0
  930. package/dist/nuxt/runtime/server/api/editor/themes/index.post.js +8 -0
  931. package/dist/nuxt/runtime/server/api/editor/themes/index.post.js.map +1 -0
  932. package/dist/nuxt/runtime/server/api/editor/users.get.d.ts +5 -0
  933. package/dist/nuxt/runtime/server/api/editor/users.get.js +8 -0
  934. package/dist/nuxt/runtime/server/api/editor/users.get.js.map +1 -0
  935. package/dist/nuxt/runtime/server/plugins/collab.d.ts +5 -0
  936. package/dist/nuxt/runtime/server/plugins/collab.js +10 -0
  937. package/dist/nuxt/runtime/server/plugins/collab.js.map +1 -0
  938. package/dist/nuxt/runtime/server/plugins/editor-server.d.ts +5 -0
  939. package/dist/nuxt/runtime/server/plugins/editor-server.js +20 -0
  940. package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -0
  941. package/dist/nuxt/runtime/server/routes/collab/[id].d.ts +5 -0
  942. package/dist/nuxt/runtime/server/routes/collab/[id].js +35 -0
  943. package/dist/nuxt/runtime/server/routes/collab/[id].js.map +1 -0
  944. package/dist/nuxt/runtime/server/utils/editor-route.d.ts +11 -0
  945. package/dist/nuxt/runtime/server/utils/editor-route.js +49 -0
  946. package/dist/nuxt/runtime/server/utils/editor-route.js.map +1 -0
  947. package/dist/outline/EditorOutline.js +124 -0
  948. package/dist/outline/EditorOutline.js.map +1 -0
  949. package/dist/outline/EditorOutline.vue.d.ts +15 -0
  950. package/dist/outline/heading-outline.d.ts +26 -0
  951. package/dist/outline/heading-outline.js +46 -0
  952. package/dist/outline/heading-outline.js.map +1 -0
  953. package/dist/outline/index.d.ts +2 -0
  954. package/dist/outline/index.js +1 -0
  955. package/dist/outline/react/EditorOutline.d.ts +12 -0
  956. package/dist/outline/react/EditorOutline.js +112 -0
  957. package/dist/outline/react/EditorOutline.js.map +1 -0
  958. package/dist/outline/react.d.ts +2 -0
  959. package/dist/outline/react.js +1 -0
  960. package/dist/outline/vue.d.ts +2 -0
  961. package/dist/outline/vue.js +1 -0
  962. package/dist/presets/advanced.d.ts +33 -0
  963. package/dist/presets/advanced.js +50 -0
  964. package/dist/presets/advanced.js.map +1 -0
  965. package/dist/presets/simple.d.ts +9 -0
  966. package/dist/presets/simple.js +12 -0
  967. package/dist/presets/simple.js.map +1 -0
  968. package/dist/react/AdvancedEditor.d.ts +23 -0
  969. package/dist/react/AdvancedEditor.js +24 -0
  970. package/dist/react/AdvancedEditor.js.map +1 -0
  971. package/dist/react/EditorSettingsModal.d.ts +14 -0
  972. package/dist/react/EditorSettingsModal.js +40 -0
  973. package/dist/react/EditorSettingsModal.js.map +1 -0
  974. package/dist/react/EditorSettingsPanel.d.ts +18 -0
  975. package/dist/react/EditorSettingsPanel.js +40 -0
  976. package/dist/react/EditorSettingsPanel.js.map +1 -0
  977. package/dist/react/EditorSurface.d.ts +61 -0
  978. package/dist/react/EditorSurface.js +277 -0
  979. package/dist/react/EditorSurface.js.map +1 -0
  980. package/dist/react/EditorToolbar.d.ts +15 -0
  981. package/dist/react/EditorToolbar.js +182 -0
  982. package/dist/react/EditorToolbar.js.map +1 -0
  983. package/dist/react/Icon.d.ts +13 -0
  984. package/dist/react/Icon.js +19 -0
  985. package/dist/react/Icon.js.map +1 -0
  986. package/dist/react/SettingsSection.d.ts +10 -0
  987. package/dist/react/SettingsSection.js +22 -0
  988. package/dist/react/SettingsSection.js.map +1 -0
  989. package/dist/react/SimpleEditor.d.ts +27 -0
  990. package/dist/react/SimpleEditor.js +22 -0
  991. package/dist/react/SimpleEditor.js.map +1 -0
  992. package/dist/react/advanced-preset.d.ts +11 -0
  993. package/dist/react/advanced-preset.js +31 -0
  994. package/dist/react/advanced-preset.js.map +1 -0
  995. package/dist/react/advanced.d.ts +4 -0
  996. package/dist/react/advanced.js +3 -0
  997. package/dist/react/context.d.ts +12 -0
  998. package/dist/react/context.js +21 -0
  999. package/dist/react/context.js.map +1 -0
  1000. package/dist/react/editor-ui.d.ts +14 -0
  1001. package/dist/react/editor-ui.js +20 -0
  1002. package/dist/react/editor-ui.js.map +1 -0
  1003. package/dist/react/index.d.ts +17 -0
  1004. package/dist/react/index.js +17 -0
  1005. package/dist/react/notify.d.ts +6 -0
  1006. package/dist/react/notify.js +25 -0
  1007. package/dist/react/notify.js.map +1 -0
  1008. package/dist/react/settings.d.ts +17 -0
  1009. package/dist/react/settings.js +27 -0
  1010. package/dist/react/settings.js.map +1 -0
  1011. package/dist/react/simple.d.ts +2 -0
  1012. package/dist/react/simple.js +1 -0
  1013. package/dist/react/styles/advanced.css +18 -0
  1014. package/dist/react/styles/themes-bridge.css +26 -0
  1015. package/dist/react/styles/ui-vars.css +20 -0
  1016. package/dist/react/suggestion-renderer.d.ts +12 -0
  1017. package/dist/react/suggestion-renderer.js +90 -0
  1018. package/dist/react/suggestion-renderer.js.map +1 -0
  1019. package/dist/react/ui/alert.js +38 -0
  1020. package/dist/react/ui/alert.js.map +1 -0
  1021. package/dist/react/ui/avatar.js +24 -0
  1022. package/dist/react/ui/avatar.js.map +1 -0
  1023. package/dist/react/ui/badge.js +30 -0
  1024. package/dist/react/ui/badge.js.map +1 -0
  1025. package/dist/react/ui/button.js +50 -0
  1026. package/dist/react/ui/button.js.map +1 -0
  1027. package/dist/react/ui/collapsible.js +19 -0
  1028. package/dist/react/ui/collapsible.js.map +1 -0
  1029. package/dist/react/ui/command.js +47 -0
  1030. package/dist/react/ui/command.js.map +1 -0
  1031. package/dist/react/ui/dialog.js +88 -0
  1032. package/dist/react/ui/dialog.js.map +1 -0
  1033. package/dist/react/ui/dropdown-menu.js +70 -0
  1034. package/dist/react/ui/dropdown-menu.js.map +1 -0
  1035. package/dist/react/ui/input-group.js +57 -0
  1036. package/dist/react/ui/input-group.js.map +1 -0
  1037. package/dist/react/ui/input.js +16 -0
  1038. package/dist/react/ui/input.js.map +1 -0
  1039. package/dist/react/ui/label.js +17 -0
  1040. package/dist/react/ui/label.js.map +1 -0
  1041. package/dist/react/ui/popover.js +36 -0
  1042. package/dist/react/ui/popover.js.map +1 -0
  1043. package/dist/react/ui/radio-group.js +29 -0
  1044. package/dist/react/ui/radio-group.js.map +1 -0
  1045. package/dist/react/ui/select.js +88 -0
  1046. package/dist/react/ui/select.js.map +1 -0
  1047. package/dist/react/ui/separator.js +18 -0
  1048. package/dist/react/ui/separator.js.map +1 -0
  1049. package/dist/react/ui/switch.js +21 -0
  1050. package/dist/react/ui/switch.js.map +1 -0
  1051. package/dist/react/ui/table.js +44 -0
  1052. package/dist/react/ui/table.js.map +1 -0
  1053. package/dist/react/ui/tabs.js +41 -0
  1054. package/dist/react/ui/tabs.js.map +1 -0
  1055. package/dist/react/ui/textarea.js +15 -0
  1056. package/dist/react/ui/textarea.js.map +1 -0
  1057. package/dist/react/ui/tooltip.js +37 -0
  1058. package/dist/react/ui/tooltip.js.map +1 -0
  1059. package/dist/react/ui/utils.d.ts +5 -0
  1060. package/dist/react/ui/utils.js +10 -0
  1061. package/dist/react/ui/utils.js.map +1 -0
  1062. package/dist/react/use-editor-i18n.d.ts +12 -0
  1063. package/dist/react/use-editor-i18n.js +17 -0
  1064. package/dist/react/use-editor-i18n.js.map +1 -0
  1065. package/dist/react/use-notifier.d.ts +11 -0
  1066. package/dist/react/use-notifier.js +25 -0
  1067. package/dist/react/use-notifier.js.map +1 -0
  1068. package/dist/react/use-store.d.ts +6 -0
  1069. package/dist/react/use-store.js +10 -0
  1070. package/dist/react/use-store.js.map +1 -0
  1071. package/dist/schema/advanced.d.ts +14 -0
  1072. package/dist/schema/advanced.js +43 -0
  1073. package/dist/schema/advanced.js.map +1 -0
  1074. package/dist/schema/simple.d.ts +10 -0
  1075. package/dist/schema/simple.js +13 -0
  1076. package/dist/schema/simple.js.map +1 -0
  1077. package/dist/server/adapter.d.ts +101 -0
  1078. package/dist/server/ai.d.ts +101 -0
  1079. package/dist/server/ai.js +105 -0
  1080. package/dist/server/ai.js.map +1 -0
  1081. package/dist/server/collab-state.d.ts +16 -0
  1082. package/dist/server/collab-state.js +43 -0
  1083. package/dist/server/collab-state.js.map +1 -0
  1084. package/dist/server/collab.d.ts +68 -0
  1085. package/dist/server/collab.js +187 -0
  1086. package/dist/server/collab.js.map +1 -0
  1087. package/dist/server/errors.d.ts +17 -0
  1088. package/dist/server/errors.js +26 -0
  1089. package/dist/server/errors.js.map +1 -0
  1090. package/dist/server/handlers/ai.d.ts +223 -0
  1091. package/dist/server/handlers/ai.js +422 -0
  1092. package/dist/server/handlers/ai.js.map +1 -0
  1093. package/dist/server/handlers/context.d.ts +64 -0
  1094. package/dist/server/handlers/context.js +85 -0
  1095. package/dist/server/handlers/context.js.map +1 -0
  1096. package/dist/server/handlers/editor.d.ts +107 -0
  1097. package/dist/server/handlers/editor.js +241 -0
  1098. package/dist/server/handlers/editor.js.map +1 -0
  1099. package/dist/server/handlers/index.d.ts +4 -0
  1100. package/dist/server/handlers/index.js +4 -0
  1101. package/dist/server/host.d.ts +61 -0
  1102. package/dist/server/host.js +105 -0
  1103. package/dist/server/host.js.map +1 -0
  1104. package/dist/server/index.d.ts +8 -0
  1105. package/dist/server/index.js +7 -0
  1106. package/dist/server/node.d.ts +24 -0
  1107. package/dist/server/node.js +54 -0
  1108. package/dist/server/node.js.map +1 -0
  1109. package/dist/server/rate-limit.d.ts +22 -0
  1110. package/dist/server/rate-limit.js +34 -0
  1111. package/dist/server/rate-limit.js.map +1 -0
  1112. package/dist/settings/index.d.ts +110 -0
  1113. package/dist/settings/index.js +114 -0
  1114. package/dist/settings/index.js.map +1 -0
  1115. package/dist/settings/values.d.ts +35 -0
  1116. package/dist/settings/values.js +41 -0
  1117. package/dist/settings/values.js.map +1 -0
  1118. package/dist/styles/ai.css +77 -0
  1119. package/dist/styles/authors.css +18 -0
  1120. package/dist/styles/block-ui.css +16 -0
  1121. package/dist/styles/collab.css +26 -0
  1122. package/dist/styles/comments.css +11 -0
  1123. package/dist/styles/composites.css +56 -0
  1124. package/dist/styles/core.css +99 -0
  1125. package/dist/styles/media.css +8 -0
  1126. package/dist/styles/mentions.css +24 -0
  1127. package/dist/styles/tables.css +25 -0
  1128. package/dist/styles/themes.css +622 -0
  1129. package/dist/styles/tokens.css +29 -0
  1130. package/dist/styles/transcript.css +13 -0
  1131. package/dist/tree/DocumentTree.js +595 -0
  1132. package/dist/tree/DocumentTree.js.map +1 -0
  1133. package/dist/tree/DocumentTree.vue.d.ts +36 -0
  1134. package/dist/tree/folder-paths.js +11 -0
  1135. package/dist/tree/folder-paths.js.map +1 -0
  1136. package/dist/tree/index.d.ts +4 -0
  1137. package/dist/tree/index.js +1 -0
  1138. package/dist/tree/react/DocumentTree.d.ts +24 -0
  1139. package/dist/tree/react/DocumentTree.js +579 -0
  1140. package/dist/tree/react/DocumentTree.js.map +1 -0
  1141. package/dist/tree/react/use-tree-view.d.ts +14 -0
  1142. package/dist/tree/react/use-tree-view.js +21 -0
  1143. package/dist/tree/react/use-tree-view.js.map +1 -0
  1144. package/dist/tree/react.d.ts +3 -0
  1145. package/dist/tree/react.js +3 -0
  1146. package/dist/tree/store.d.ts +45 -0
  1147. package/dist/tree/tree-items.js +221 -0
  1148. package/dist/tree/tree-items.js.map +1 -0
  1149. package/dist/tree/tree-view-model.d.ts +29 -0
  1150. package/dist/tree/tree-view-model.js +71 -0
  1151. package/dist/tree/tree-view-model.js.map +1 -0
  1152. package/dist/tree/tree-view.d.ts +15 -0
  1153. package/dist/tree/tree-view.js +21 -0
  1154. package/dist/tree/tree-view.js.map +1 -0
  1155. package/dist/tree/types.d.ts +23 -0
  1156. package/dist/tree/types.js +0 -0
  1157. package/dist/tree/vue.d.ts +3 -0
  1158. package/dist/tree/vue.js +3 -0
  1159. package/dist/vue/AdvancedEditor.js +100 -0
  1160. package/dist/vue/AdvancedEditor.js.map +1 -0
  1161. package/dist/vue/AdvancedEditor.vue.d.ts +71 -0
  1162. package/dist/vue/SimpleEditor.js +61 -0
  1163. package/dist/vue/SimpleEditor.js.map +1 -0
  1164. package/dist/vue/SimpleEditor.vue.d.ts +36 -0
  1165. package/dist/vue/advanced-preset.d.ts +13 -0
  1166. package/dist/vue/advanced-preset.js +33 -0
  1167. package/dist/vue/advanced-preset.js.map +1 -0
  1168. package/dist/vue/advanced.d.ts +3 -0
  1169. package/dist/vue/advanced.js +3 -0
  1170. package/dist/vue/components/EditorSettingsModal.js +69 -0
  1171. package/dist/vue/components/EditorSettingsModal.js.map +1 -0
  1172. package/dist/vue/components/EditorSettingsModal.vue.d.ts +24 -0
  1173. package/dist/vue/components/EditorSettingsPanel.js +58 -0
  1174. package/dist/vue/components/EditorSettingsPanel.js.map +1 -0
  1175. package/dist/vue/components/EditorSettingsPanel.vue.d.ts +29 -0
  1176. package/dist/vue/components/EditorSurface.js +229 -0
  1177. package/dist/vue/components/EditorSurface.js.map +1 -0
  1178. package/dist/vue/components/EditorSurface.vue.d.ts +68 -0
  1179. package/dist/vue/components/EditorToolbar.js +189 -0
  1180. package/dist/vue/components/EditorToolbar.js.map +1 -0
  1181. package/dist/vue/components/EditorToolbar.vue.d.ts +17 -0
  1182. package/dist/vue/components/SettingsSection.js +26 -0
  1183. package/dist/vue/components/SettingsSection.js.map +1 -0
  1184. package/dist/vue/components/SettingsSection.vue.d.ts +21 -0
  1185. package/dist/vue/components/SuggestionList.js +91 -0
  1186. package/dist/vue/components/SuggestionList.js.map +1 -0
  1187. package/dist/vue/components/SuggestionList.vue.d.ts +19 -0
  1188. package/dist/vue/context.d.ts +24 -0
  1189. package/dist/vue/context.js +42 -0
  1190. package/dist/vue/context.js.map +1 -0
  1191. package/dist/vue/index.d.ts +26 -0
  1192. package/dist/vue/index.js +16 -0
  1193. package/dist/vue/kit/index.d.ts +3 -0
  1194. package/dist/vue/kit/index.js +1 -0
  1195. package/dist/vue/kit/nuxt-ui.css +24 -0
  1196. package/dist/vue/kit/nuxt-ui.d.ts +31 -0
  1197. package/dist/vue/kit/nuxt-ui.js +101 -0
  1198. package/dist/vue/kit/nuxt-ui.js.map +1 -0
  1199. package/dist/vue/kit/types.d.ts +370 -0
  1200. package/dist/vue/kit/use-ui-kit.d.ts +12 -0
  1201. package/dist/vue/kit/use-ui-kit.js +17 -0
  1202. package/dist/vue/kit/use-ui-kit.js.map +1 -0
  1203. package/dist/vue/notify.d.ts +12 -0
  1204. package/dist/vue/notify.js +27 -0
  1205. package/dist/vue/notify.js.map +1 -0
  1206. package/dist/vue/settings.d.ts +16 -0
  1207. package/dist/vue/settings.js +64 -0
  1208. package/dist/vue/settings.js.map +1 -0
  1209. package/dist/vue/simple.d.ts +2 -0
  1210. package/dist/vue/simple.js +1 -0
  1211. package/dist/vue/store-ref.d.ts +20 -0
  1212. package/dist/vue/store-ref.js +59 -0
  1213. package/dist/vue/store-ref.js.map +1 -0
  1214. package/dist/vue/suggestion-renderer.d.ts +6 -0
  1215. package/dist/vue/suggestion-renderer.js +20 -0
  1216. package/dist/vue/suggestion-renderer.js.map +1 -0
  1217. package/dist/vue/use-editor-i18n.d.ts +12 -0
  1218. package/dist/vue/use-editor-i18n.js +17 -0
  1219. package/dist/vue/use-editor-i18n.js.map +1 -0
  1220. package/dist/vue/use-editor-ui.d.ts +15 -0
  1221. package/dist/vue/use-editor-ui.js +23 -0
  1222. package/dist/vue/use-editor-ui.js.map +1 -0
  1223. package/dist/vue/use-notifier.d.ts +11 -0
  1224. package/dist/vue/use-notifier.js +19 -0
  1225. package/dist/vue/use-notifier.js.map +1 -0
  1226. package/docs/extending.md +538 -0
  1227. package/docs/integration.md +537 -0
  1228. package/docs/llms.md +375 -0
  1229. package/docs/usage.md +1071 -0
  1230. package/package.json +619 -4
@@ -0,0 +1,390 @@
1
+ import { newBlockId } from "../../core/schema/block-ids.js";
2
+ import { createStore } from "../../core/store.js";
3
+ import { releaseRanges, resolveRange } from "../../core/doc-anchors.js";
4
+ import { editorEntryOf } from "../../core/editor-ui.js";
5
+ import { cancelCommentDraft, commentsDoc, commentsKey, commentsUser, setActiveComment, startCommentDraft } from "./comments-plugin.js";
6
+ import { COMMENTS_FIELD, COMMENT_LIMITS } from "./schema.js";
7
+ import * as Y from "yjs";
8
+ //#region src/features/comments/model.ts
9
+ const NO_RANGES = /* @__PURE__ */ new Map();
10
+ const NO_THREADS = [];
11
+ const EMPTY = {
12
+ available: false,
13
+ canComment: false,
14
+ user: null,
15
+ threads: NO_THREADS,
16
+ ranges: NO_RANGES,
17
+ active: null,
18
+ draft: null,
19
+ draftQuote: "",
20
+ open: NO_THREADS,
21
+ resolved: NO_THREADS
22
+ };
23
+ /** A thread's `Y.Map` as plain data; `replies` converted explicitly so it is always a plain array. */
24
+ function snapshotOf(thread) {
25
+ const replies = thread.get("replies");
26
+ return {
27
+ ...thread.toJSON(),
28
+ replies: replies instanceof Y.Array ? replies.toArray() : []
29
+ };
30
+ }
31
+ function sameRange(a, b) {
32
+ return a === b || !!a && !!b && a.from === b.from && a.to === b.to;
33
+ }
34
+ function sameRanges(a, b) {
35
+ if (a === b) return true;
36
+ if (a.size !== b.size) return false;
37
+ for (const [id, range] of a) if (!sameRange(range, b.get(id) ?? null)) return false;
38
+ return true;
39
+ }
40
+ function sameUser(a, b) {
41
+ return a === b || !!a && !!b && a.id === b.id && a.name === b.name && a.color === b.color;
42
+ }
43
+ /**
44
+ * The comment threads of a collaborative editor, stored in its Y.Doc (`COMMENTS_FIELD`, one nested `Y.Map` per thread,
45
+ * replies in a nested `Y.Array`), so they sync live with the document and persist with its Yjs state. Keeps the
46
+ * `Comments` plugin's `known`/`hidden` thread ids in step with the store (highlights), exposes the plugin's ranges,
47
+ * active thread and draft, and the mutations. Mutations are no-ops without collaboration or user; editing and
48
+ * deleting are limited to the user's own comments and replies (a client-side rule: the Y.Doc itself has no ACL).
49
+ * `getEditor` names the editor to work on (it may change over time and may return a destroyed or no editor).
50
+ */
51
+ function createCommentsModel(getEditor) {
52
+ const store = createStore(EMPTY);
53
+ const current = () => {
54
+ const instance = getEditor();
55
+ return instance && !instance.isDestroyed ? instance : void 0;
56
+ };
57
+ let bound;
58
+ let observed;
59
+ let threads = NO_THREADS;
60
+ let syncQueued = false;
61
+ let told = NO_THREADS;
62
+ function unobserve() {
63
+ observed?.map.unobserveDeep(onThreadsChanged);
64
+ observed = void 0;
65
+ }
66
+ function onThreadsChanged() {
67
+ if (!observed) return;
68
+ threads = [...observed.map.values()].filter((t) => t instanceof Y.Map).map(snapshotOf);
69
+ recompute();
70
+ queueSync();
71
+ }
72
+ function onTransaction() {
73
+ recompute();
74
+ }
75
+ function unbind() {
76
+ bound?.off("transaction", onTransaction);
77
+ bound?.off("update", onTransaction);
78
+ bound = void 0;
79
+ }
80
+ /** The snapshot of the editor's current state; the previous object when nothing changed. */
81
+ function recompute() {
82
+ const instance = current();
83
+ if (!instance) {
84
+ store.set(EMPTY);
85
+ return;
86
+ }
87
+ const previous = store.get();
88
+ const ydoc = commentsDoc(instance);
89
+ const user = commentsUser(instance);
90
+ const plugin = commentsKey.getState(instance.state);
91
+ const ranges = plugin?.ranges ?? NO_RANGES;
92
+ const active = plugin?.active ?? null;
93
+ const anchor = plugin?.draft;
94
+ const draft = anchor ? resolveRange(instance.state, anchor) : null;
95
+ const draftQuote = draft ? instance.state.doc.textBetween(draft.from, draft.to, " ").slice(0, COMMENT_LIMITS.quote) : "";
96
+ const available = !!ydoc && !!user;
97
+ const canComment = available && instance.isEditable;
98
+ const sameThreads = threads === previous.threads;
99
+ const sameRangeMap = sameRanges(ranges, previous.ranges);
100
+ if (available === previous.available && canComment === previous.canComment && sameUser(user, previous.user) && sameThreads && sameRangeMap && active === previous.active && sameRange(draft, previous.draft) && draftQuote === previous.draftQuote) return;
101
+ const open = sameThreads && sameRangeMap ? previous.open : threads.filter((t) => !t.resolved).sort((a, b) => (ranges.get(a.id)?.from ?? Infinity) - (ranges.get(b.id)?.from ?? Infinity) || a.createdAt.localeCompare(b.createdAt));
102
+ const resolved = sameThreads ? previous.resolved : threads.filter((t) => t.resolved).sort((a, b) => b.createdAt.localeCompare(a.createdAt));
103
+ store.set({
104
+ available,
105
+ canComment,
106
+ user,
107
+ threads,
108
+ ranges: sameRangeMap ? previous.ranges : ranges,
109
+ active,
110
+ draft: sameRange(draft, previous.draft) ? previous.draft : draft,
111
+ draftQuote,
112
+ open,
113
+ resolved
114
+ });
115
+ }
116
+ function queueSync() {
117
+ if (syncQueued) return;
118
+ syncQueued = true;
119
+ queueMicrotask(() => {
120
+ syncQueued = false;
121
+ syncPlugin();
122
+ });
123
+ }
124
+ function syncPlugin() {
125
+ const instance = current();
126
+ if (!instance || instance !== bound) return;
127
+ const value = commentsKey.getState(instance.state);
128
+ if (!value) return;
129
+ const known = new Set(threads.map((t) => t.id));
130
+ const hidden = new Set(threads.filter((t) => t.resolved).map((t) => t.id));
131
+ const meta = {
132
+ known,
133
+ hidden
134
+ };
135
+ const before = value.active ? told.find((t) => t.id === value.active) : void 0;
136
+ if (value.active && before && !before.resolved && (!known.has(value.active) || hidden.has(value.active))) meta.active = null;
137
+ told = threads;
138
+ instance.view.dispatch(instance.state.tr.setMeta(commentsKey, meta).setMeta("addToHistory", false));
139
+ }
140
+ /** Follows the editor `getEditor` names now, and the Y.Doc of its collaboration session. */
141
+ function refresh() {
142
+ const instance = current();
143
+ if (instance !== bound) {
144
+ unbind();
145
+ unobserve();
146
+ bound = instance;
147
+ threads = NO_THREADS;
148
+ told = NO_THREADS;
149
+ instance?.on("transaction", onTransaction);
150
+ instance?.on("update", onTransaction);
151
+ queueSync();
152
+ }
153
+ const ydoc = instance ? commentsDoc(instance) : null;
154
+ if ((observed?.doc ?? null) !== ydoc) {
155
+ unobserve();
156
+ if (ydoc) {
157
+ const map = ydoc.getMap(COMMENTS_FIELD);
158
+ observed = {
159
+ doc: ydoc,
160
+ map
161
+ };
162
+ map.observeDeep(onThreadsChanged);
163
+ threads = [...map.values()].filter((t) => t instanceof Y.Map).map(snapshotOf);
164
+ } else threads = NO_THREADS;
165
+ queueSync();
166
+ }
167
+ recompute();
168
+ }
169
+ function dispose() {
170
+ unbind();
171
+ unobserve();
172
+ threads = NO_THREADS;
173
+ told = NO_THREADS;
174
+ store.set(EMPTY);
175
+ }
176
+ /** Editor, thread map and user while comments are available; null otherwise. */
177
+ function writable() {
178
+ const instance = current();
179
+ const ydoc = instance && commentsDoc(instance);
180
+ const author = instance && commentsUser(instance);
181
+ if (!instance || !ydoc || !author) return null;
182
+ return {
183
+ editor: instance,
184
+ ydoc,
185
+ map: ydoc.getMap(COMMENTS_FIELD),
186
+ user: {
187
+ id: author.id,
188
+ name: author.name,
189
+ color: author.color
190
+ }
191
+ };
192
+ }
193
+ /** Trimmed and cut to the limit; '' when nothing is left. */
194
+ const clean = (text) => text.trim().slice(0, COMMENT_LIMITS.text);
195
+ function threadMap(map, threadId) {
196
+ const thread = map.get(threadId);
197
+ return thread instanceof Y.Map ? thread : null;
198
+ }
199
+ function repliesOf(thread) {
200
+ const replies = thread.get("replies");
201
+ return replies instanceof Y.Array ? replies : null;
202
+ }
203
+ function add(text) {
204
+ const ctx = writable();
205
+ const body = clean(text);
206
+ const anchor = ctx && commentsKey.getState(ctx.editor.state)?.draft;
207
+ const range = ctx && anchor ? resolveRange(ctx.editor.state, anchor) : null;
208
+ const type = ctx?.editor.schema.marks.comment;
209
+ if (!ctx || !anchor || !range || range.from >= range.to || !body || !type) return null;
210
+ const id = newBlockId();
211
+ const { state } = ctx.editor;
212
+ const quote = state.doc.textBetween(range.from, range.to, " ").slice(0, COMMENT_LIMITS.quote);
213
+ const tr = state.tr.addMark(range.from, range.to, type.create({ id }));
214
+ if (!tr.docChanged) return null;
215
+ const meta = {
216
+ draft: null,
217
+ active: id
218
+ };
219
+ ctx.editor.view.dispatch(tr.setMeta(commentsKey, meta).setMeta("addToHistory", false));
220
+ releaseRanges(ctx.editor, [anchor]);
221
+ const thread = new Y.Map();
222
+ thread.set("id", id);
223
+ thread.set("author", ctx.user);
224
+ thread.set("text", body);
225
+ thread.set("createdAt", (/* @__PURE__ */ new Date()).toISOString());
226
+ thread.set("quote", quote);
227
+ thread.set("resolved", false);
228
+ thread.set("replies", new Y.Array());
229
+ ctx.map.set(id, thread);
230
+ return id;
231
+ }
232
+ function reply(threadId, text) {
233
+ const ctx = writable();
234
+ const body = clean(text);
235
+ const thread = ctx && threadMap(ctx.map, threadId);
236
+ const replies = thread && repliesOf(thread);
237
+ if (!ctx || !replies || !body) return;
238
+ replies.push([{
239
+ id: newBlockId(),
240
+ author: ctx.user,
241
+ text: body,
242
+ createdAt: (/* @__PURE__ */ new Date()).toISOString()
243
+ }]);
244
+ }
245
+ function edit(threadId, replyId, text) {
246
+ const ctx = writable();
247
+ const body = clean(text);
248
+ const thread = ctx && threadMap(ctx.map, threadId);
249
+ if (!ctx || !thread || !body) return;
250
+ const now = (/* @__PURE__ */ new Date()).toISOString();
251
+ if (replyId === null) {
252
+ if (thread.get("author")?.id !== ctx.user.id || thread.get("text") === body) return;
253
+ ctx.ydoc.transact(() => {
254
+ thread.set("text", body);
255
+ thread.set("editedAt", now);
256
+ });
257
+ return;
258
+ }
259
+ const replies = repliesOf(thread);
260
+ const index = replies ? replies.toArray().findIndex((r) => r.id === replyId) : -1;
261
+ const previous = replies && index >= 0 ? replies.get(index) : void 0;
262
+ if (!replies || !previous || previous.author.id !== ctx.user.id || previous.text === body) return;
263
+ ctx.ydoc.transact(() => {
264
+ replies.delete(index, 1);
265
+ replies.insert(index, [{
266
+ ...previous,
267
+ text: body,
268
+ editedAt: now
269
+ }]);
270
+ });
271
+ }
272
+ function setResolved(threadId, value) {
273
+ const ctx = writable();
274
+ const thread = ctx && threadMap(ctx.map, threadId);
275
+ if (!ctx || !thread) return;
276
+ thread.set("resolved", value);
277
+ if (value && commentsKey.getState(ctx.editor.state)?.active === threadId) setActiveComment(ctx.editor, null);
278
+ }
279
+ function remove(threadId) {
280
+ const ctx = writable();
281
+ const thread = ctx && threadMap(ctx.map, threadId);
282
+ if (!ctx || !thread || thread.get("author")?.id !== ctx.user.id) return;
283
+ const { state } = ctx.editor;
284
+ const tr = state.tr;
285
+ state.doc.descendants((node, pos) => {
286
+ if (!node.isText) return;
287
+ const mark = node.marks.find((m) => m.type.name === "comment" && m.attrs.id === threadId);
288
+ if (mark) tr.removeMark(pos, pos + node.nodeSize, mark);
289
+ });
290
+ if (commentsKey.getState(state)?.active === threadId) tr.setMeta(commentsKey, { active: null });
291
+ if (tr.docChanged || tr.getMeta(commentsKey)) ctx.editor.view.dispatch(tr.setMeta("addToHistory", false));
292
+ ctx.map.delete(threadId);
293
+ }
294
+ function removeReply(threadId, replyId) {
295
+ const ctx = writable();
296
+ const thread = ctx && threadMap(ctx.map, threadId);
297
+ const replies = thread && repliesOf(thread);
298
+ if (!ctx || !replies) return;
299
+ const index = replies.toArray().findIndex((r) => r.id === replyId);
300
+ if (index >= 0 && replies.get(index).author.id === ctx.user.id) replies.delete(index, 1);
301
+ }
302
+ function activate(id, options = {}) {
303
+ const instance = current();
304
+ if (instance) setActiveComment(instance, id, options);
305
+ }
306
+ function startDraft() {
307
+ const ctx = writable();
308
+ if (ctx) startCommentDraft(ctx.editor);
309
+ }
310
+ function cancelDraft() {
311
+ const instance = current();
312
+ if (instance) cancelCommentDraft(instance);
313
+ }
314
+ return {
315
+ state: store,
316
+ refresh,
317
+ dispose,
318
+ add,
319
+ reply,
320
+ edit,
321
+ setResolved,
322
+ remove,
323
+ removeReply,
324
+ activate,
325
+ startDraft,
326
+ cancelDraft
327
+ };
328
+ }
329
+ const modelFactories = /* @__PURE__ */ new WeakMap();
330
+ /** Registers the host model factory of `ctx` (the comments feature does this; hosts pass `model` to the feature). */
331
+ function provideCommentsModel(ctx, factory) {
332
+ modelFactories.set(ctx, factory);
333
+ }
334
+ /** The host model factory the comments feature of `ctx` was configured with; undefined for the default Y.Doc model. */
335
+ function commentsModelOf(ctx) {
336
+ return modelFactories.get(ctx);
337
+ }
338
+ /**
339
+ * The comments model the framework hooks (`useComments`) use: the model of the surface `getEditor` belongs to
340
+ * (`commentsModelOf` of its feature context: the host's `model` factory) and `createCommentsModel` for every other
341
+ * editor. It follows the editor over time: when the editor changes to one of a surface with another model, the inner
342
+ * model is replaced (disposed, created, refreshed) and `state` carries on with the new one. The factory runs once per
343
+ * consumer of this function, so a host model that must share state across them keeps it outside the factory.
344
+ */
345
+ function createEditorCommentsModel(getEditor) {
346
+ const store = createStore(EMPTY);
347
+ let inner;
348
+ function release() {
349
+ inner?.stop();
350
+ inner?.model.dispose();
351
+ inner = void 0;
352
+ }
353
+ /** The inner model for the editor now; a replacement when its surface brings another factory. */
354
+ function current() {
355
+ const entry = editorEntryOf(getEditor());
356
+ const factory = (entry && commentsModelOf(entry.ctx)) ?? createCommentsModel;
357
+ if (inner?.factory !== factory) {
358
+ release();
359
+ const model = factory(getEditor);
360
+ inner = {
361
+ model,
362
+ factory,
363
+ stop: model.state.subscribe((snapshot) => store.set(snapshot))
364
+ };
365
+ store.set(model.state.get());
366
+ }
367
+ return inner.model;
368
+ }
369
+ return {
370
+ state: store,
371
+ refresh: () => current().refresh(),
372
+ dispose: () => {
373
+ release();
374
+ store.set(EMPTY);
375
+ },
376
+ add: (text) => current().add(text),
377
+ reply: (threadId, text) => current().reply(threadId, text),
378
+ edit: (threadId, replyId, text) => current().edit(threadId, replyId, text),
379
+ setResolved: (threadId, resolved) => current().setResolved(threadId, resolved),
380
+ remove: (threadId) => current().remove(threadId),
381
+ removeReply: (threadId, replyId) => current().removeReply(threadId, replyId),
382
+ activate: (id, options) => current().activate(id, options),
383
+ startDraft: () => current().startDraft(),
384
+ cancelDraft: () => current().cancelDraft()
385
+ };
386
+ }
387
+ //#endregion
388
+ export { commentsModelOf, createCommentsModel, createEditorCommentsModel, provideCommentsModel };
389
+
390
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","names":[],"sources":["../../../src/features/comments/model.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport * as Y from 'yjs'\nimport type { AuthorIdentity, FeatureContext } from '../../core'\nimport { editorEntryOf, releaseRanges, resolveRange } from '../../core'\nimport { newBlockId } from '../../core/schema'\nimport { createStore, type ReadonlyStore } from '../../core/store'\nimport { cancelCommentDraft, commentsDoc, commentsKey, type CommentsMeta, commentsUser, setActiveComment, startCommentDraft } from './comments-plugin'\nimport { COMMENT_LIMITS, COMMENTS_FIELD, type CommentReply, type CommentThread } from './schema'\n\nexport type DocRange = { from: number, to: number }\n\n/** What a comments UI renders: replaced (a new object) whenever any part of it changes, so a store subscriber re-renders only then. */\nexport interface CommentsSnapshot {\n /** Comments need a collaborative editor whose `Comments` extension has a user (a host model decides for itself). */\n available: boolean\n /**\n * Whether the user may compose a comment now: the default model says `available` and the editor is editable, a host\n * model may allow readers of a read-only document to comment.\n */\n canComment: boolean\n user: AuthorIdentity | null\n /** Plain snapshots of all threads in the Y.Doc, replaced on every change. */\n threads: readonly CommentThread[]\n /** Current text range per thread id (threads without one are orphans). */\n ranges: ReadonlyMap<string, DocRange>\n active: string | null\n /** Current range of the draft a new comment is being written for. */\n draft: DocRange | null\n /** The draft's text as the new thread will keep it (`quote`). */\n draftQuote: string\n /** Unresolved threads in document order, orphans last; resolved ones newest first. */\n open: readonly CommentThread[]\n resolved: readonly CommentThread[]\n}\n\n/** The mutations of the comments of one editor; no-ops without collaboration or a user. */\nexport interface CommentsActions {\n /** Creates a thread on the draft range; its id, or null without a (non-empty) draft or text. */\n add: (text: string) => string | null\n reply: (threadId: string, text: string) => void\n /** Changes the text of the user's own thread (`replyId` null) or reply. */\n edit: (threadId: string, replyId: string | null, text: string) => void\n /** Resolves or reopens a thread (anyone may). */\n setResolved: (threadId: string, resolved: boolean) => void\n /** Deletes the user's own thread with its marks / the user's own reply. */\n remove: (threadId: string) => void\n removeReply: (threadId: string, replyId: string) => void\n /** Activates a thread (`null`: none); `reveal` selects and scrolls to its text. */\n activate: (id: string | null, options?: { reveal?: boolean }) => void\n /** Starts a comment on the current selection (the layout shows the composer while `draft` is set). */\n startDraft: () => void\n cancelDraft: () => void\n}\n\n/**\n * The comments of one editor, framework-free: `state` is the observable snapshot, `refresh()` brings it up to date\n * (the framework hook calls it when the editor it watches changes; the model itself listens to that editor's\n * transactions from then on), `dispose()` detaches the editor and Y.Doc listeners and may be followed by `refresh()` again\n * (StrictMode mounts twice).\n */\nexport interface CommentsModel extends CommentsActions {\n readonly state: ReadonlyStore<CommentsSnapshot>\n refresh: () => void\n dispose: () => void\n}\n\nconst NO_RANGES: ReadonlyMap<string, DocRange> = new Map()\nconst NO_THREADS: readonly CommentThread[] = []\n\nconst EMPTY: CommentsSnapshot = {\n available: false,\n canComment: false,\n user: null,\n threads: NO_THREADS,\n ranges: NO_RANGES,\n active: null,\n draft: null,\n draftQuote: '',\n open: NO_THREADS,\n resolved: NO_THREADS,\n}\n\n/** A thread's `Y.Map` as plain data; `replies` converted explicitly so it is always a plain array. */\nfunction snapshotOf(thread: Y.Map<unknown>): CommentThread {\n const replies = thread.get('replies')\n return { ...(thread.toJSON() as CommentThread), replies: replies instanceof Y.Array ? replies.toArray() as CommentReply[] : [] }\n}\n\nfunction sameRange(a: DocRange | null, b: DocRange | null): boolean {\n return a === b || (!!a && !!b && a.from === b.from && a.to === b.to)\n}\n\nfunction sameRanges(a: ReadonlyMap<string, DocRange>, b: ReadonlyMap<string, DocRange>): boolean {\n if (a === b) return true\n if (a.size !== b.size) return false\n for (const [id, range] of a) {\n if (!sameRange(range, b.get(id) ?? null)) return false\n }\n return true\n}\n\nfunction sameUser(a: AuthorIdentity | null, b: AuthorIdentity | null): boolean {\n return a === b || (!!a && !!b && a.id === b.id && a.name === b.name && a.color === b.color)\n}\n\n/**\n * The comment threads of a collaborative editor, stored in its Y.Doc (`COMMENTS_FIELD`, one nested `Y.Map` per thread,\n * replies in a nested `Y.Array`), so they sync live with the document and persist with its Yjs state. Keeps the\n * `Comments` plugin's `known`/`hidden` thread ids in step with the store (highlights), exposes the plugin's ranges,\n * active thread and draft, and the mutations. Mutations are no-ops without collaboration or user; editing and\n * deleting are limited to the user's own comments and replies (a client-side rule: the Y.Doc itself has no ACL).\n * `getEditor` names the editor to work on (it may change over time and may return a destroyed or no editor).\n */\nexport function createCommentsModel(getEditor: () => Editor | undefined): CommentsModel {\n const store = createStore<CommentsSnapshot>(EMPTY)\n\n const current = () => {\n const instance = getEditor()\n return instance && !instance.isDestroyed ? instance : undefined\n }\n\n // The editor whose transactions are followed, and the Y.Map of threads observed.\n let bound: Editor | undefined\n let observed: { doc: Y.Doc, map: Y.Map<unknown> } | undefined\n let threads: readonly CommentThread[] = NO_THREADS\n let syncQueued = false\n // The thread list the plugin was last told about, for the deactivation rule.\n let told: readonly CommentThread[] = NO_THREADS\n\n function unobserve() {\n observed?.map.unobserveDeep(onThreadsChanged)\n observed = undefined\n }\n\n function onThreadsChanged() {\n if (!observed) return\n threads = [...observed.map.values()].filter((t): t is Y.Map<unknown> => t instanceof Y.Map).map(snapshotOf)\n recompute()\n queueSync()\n }\n\n function onTransaction() {\n recompute()\n }\n\n function unbind() {\n bound?.off('transaction', onTransaction)\n // `setEditable` emits `update` only, and `canComment` follows `isEditable`.\n bound?.off('update', onTransaction)\n bound = undefined\n }\n\n /** The snapshot of the editor's current state; the previous object when nothing changed. */\n function recompute() {\n const instance = current()\n if (!instance) {\n store.set(EMPTY)\n return\n }\n const previous = store.get()\n const ydoc = commentsDoc(instance)\n const user = commentsUser(instance)\n const plugin = commentsKey.getState(instance.state)\n const ranges = plugin?.ranges ?? NO_RANGES\n const active = plugin?.active ?? null\n const anchor = plugin?.draft\n const draft = anchor ? resolveRange(instance.state, anchor) : null\n const draftQuote = draft ? instance.state.doc.textBetween(draft.from, draft.to, ' ').slice(0, COMMENT_LIMITS.quote) : ''\n const available = !!ydoc && !!user\n const canComment = available && instance.isEditable\n\n const sameThreads = threads === previous.threads\n const sameRangeMap = sameRanges(ranges, previous.ranges)\n if (\n available === previous.available && canComment === previous.canComment && sameUser(user, previous.user) && sameThreads && sameRangeMap\n && active === previous.active && sameRange(draft, previous.draft) && draftQuote === previous.draftQuote\n ) return\n\n const kept = sameThreads && sameRangeMap\n const open = kept\n ? previous.open\n : threads\n .filter(t => !t.resolved)\n .sort((a, b) => (ranges.get(a.id)?.from ?? Infinity) - (ranges.get(b.id)?.from ?? Infinity) || a.createdAt.localeCompare(b.createdAt))\n const resolved = sameThreads\n ? previous.resolved\n : threads.filter(t => t.resolved).sort((a, b) => b.createdAt.localeCompare(a.createdAt))\n store.set({\n available,\n canComment,\n user,\n threads,\n ranges: sameRangeMap ? previous.ranges : ranges,\n active,\n draft: sameRange(draft, previous.draft) ? previous.draft : draft,\n draftQuote,\n open,\n resolved,\n })\n }\n\n // Highlights appear and disappear on every client as threads arrive, get resolved or deleted. The active thread\n // stays highlighted even when resolved (a resolved thread activated from its card), so a thread that turns resolved\n // or disappears while active is deactivated here, on every client, not only on the one that resolved or deleted it.\n // Queued (not dispatched from inside the Yjs observer or a transaction listener).\n function queueSync() {\n if (syncQueued) return\n syncQueued = true\n queueMicrotask(() => {\n syncQueued = false\n syncPlugin()\n })\n }\n\n function syncPlugin() {\n const instance = current()\n if (!instance || instance !== bound) return\n const value = commentsKey.getState(instance.state)\n if (!value) return\n const known = new Set(threads.map(t => t.id))\n const hidden = new Set(threads.filter(t => t.resolved).map(t => t.id))\n const meta: CommentsMeta = { known, hidden }\n const before = value.active ? told.find(t => t.id === value.active) : undefined\n if (value.active && before && !before.resolved && (!known.has(value.active) || hidden.has(value.active))) meta.active = null\n told = threads\n instance.view.dispatch(instance.state.tr.setMeta(commentsKey, meta).setMeta('addToHistory', false))\n }\n\n /** Follows the editor `getEditor` names now, and the Y.Doc of its collaboration session. */\n function refresh() {\n const instance = current()\n if (instance !== bound) {\n unbind()\n unobserve()\n bound = instance\n threads = NO_THREADS\n told = NO_THREADS\n instance?.on('transaction', onTransaction)\n instance?.on('update', onTransaction)\n // The new editor's plugin knows no threads yet.\n queueSync()\n }\n const ydoc = instance ? commentsDoc(instance) : null\n if ((observed?.doc ?? null) !== ydoc) {\n unobserve()\n if (ydoc) {\n const map = ydoc.getMap<unknown>(COMMENTS_FIELD)\n observed = { doc: ydoc, map }\n map.observeDeep(onThreadsChanged)\n threads = [...map.values()].filter((t): t is Y.Map<unknown> => t instanceof Y.Map).map(snapshotOf)\n }\n else {\n threads = NO_THREADS\n }\n queueSync()\n }\n recompute()\n }\n\n function dispose() {\n unbind()\n unobserve()\n threads = NO_THREADS\n told = NO_THREADS\n store.set(EMPTY)\n }\n\n /** Editor, thread map and user while comments are available; null otherwise. */\n function writable() {\n const instance = current()\n const ydoc = instance && commentsDoc(instance)\n const author = instance && commentsUser(instance)\n if (!instance || !ydoc || !author) return null\n return { editor: instance, ydoc, map: ydoc.getMap<unknown>(COMMENTS_FIELD), user: { id: author.id, name: author.name, color: author.color } }\n }\n\n /** Trimmed and cut to the limit; '' when nothing is left. */\n const clean = (text: string) => text.trim().slice(0, COMMENT_LIMITS.text)\n\n function threadMap(map: Y.Map<unknown>, threadId: string): Y.Map<unknown> | null {\n const thread = map.get(threadId)\n return thread instanceof Y.Map ? thread : null\n }\n\n function repliesOf(thread: Y.Map<unknown>): Y.Array<CommentReply> | null {\n const replies = thread.get('replies')\n return replies instanceof Y.Array ? replies as Y.Array<CommentReply> : null\n }\n\n function add(text: string): string | null {\n const ctx = writable()\n const body = clean(text)\n const anchor = ctx && commentsKey.getState(ctx.editor.state)?.draft\n const range = ctx && anchor ? resolveRange(ctx.editor.state, anchor) : null\n const type = ctx?.editor.schema.marks.comment\n if (!ctx || !anchor || !range || range.from >= range.to || !body || !type) return null\n const id = newBlockId()\n const { state } = ctx.editor\n const quote = state.doc.textBetween(range.from, range.to, ' ').slice(0, COMMENT_LIMITS.quote)\n const tr = state.tr.addMark(range.from, range.to, type.create({ id }))\n // Text that takes no marks (code block, inline code): no thread that would start out without a range.\n if (!tr.docChanged) return null\n // Not undoable: the mark is the thread's anchor, not an edit of the text.\n const meta: CommentsMeta = { draft: null, active: id }\n ctx.editor.view.dispatch(tr.setMeta(commentsKey, meta).setMeta('addToHistory', false))\n releaseRanges(ctx.editor, [anchor])\n const thread = new Y.Map<unknown>()\n thread.set('id', id)\n thread.set('author', ctx.user)\n thread.set('text', body)\n thread.set('createdAt', new Date().toISOString())\n thread.set('quote', quote)\n thread.set('resolved', false)\n thread.set('replies', new Y.Array<CommentReply>())\n ctx.map.set(id, thread)\n return id\n }\n\n function reply(threadId: string, text: string): void {\n const ctx = writable()\n const body = clean(text)\n const thread = ctx && threadMap(ctx.map, threadId)\n const replies = thread && repliesOf(thread)\n if (!ctx || !replies || !body) return\n replies.push([{ id: newBlockId(), author: ctx.user, text: body, createdAt: new Date().toISOString() }])\n }\n\n function edit(threadId: string, replyId: string | null, text: string): void {\n const ctx = writable()\n const body = clean(text)\n const thread = ctx && threadMap(ctx.map, threadId)\n if (!ctx || !thread || !body) return\n const now = new Date().toISOString()\n if (replyId === null) {\n if ((thread.get('author') as CommentThread['author'] | undefined)?.id !== ctx.user.id || thread.get('text') === body) return\n ctx.ydoc.transact(() => {\n thread.set('text', body)\n thread.set('editedAt', now)\n })\n return\n }\n const replies = repliesOf(thread)\n const index = replies ? replies.toArray().findIndex(r => r.id === replyId) : -1\n const previous = replies && index >= 0 ? replies.get(index) : undefined\n if (!replies || !previous || previous.author.id !== ctx.user.id || previous.text === body) return\n ctx.ydoc.transact(() => {\n replies.delete(index, 1)\n replies.insert(index, [{ ...previous, text: body, editedAt: now }])\n })\n }\n\n function setResolved(threadId: string, value: boolean): void {\n const ctx = writable()\n const thread = ctx && threadMap(ctx.map, threadId)\n if (!ctx || !thread) return\n thread.set('resolved', value)\n if (value && commentsKey.getState(ctx.editor.state)?.active === threadId) setActiveComment(ctx.editor, null)\n }\n\n function remove(threadId: string): void {\n const ctx = writable()\n const thread = ctx && threadMap(ctx.map, threadId)\n if (!ctx || !thread || (thread.get('author') as CommentThread['author'] | undefined)?.id !== ctx.user.id) return\n const { state } = ctx.editor\n const tr = state.tr\n state.doc.descendants((node, pos) => {\n if (!node.isText) return\n const mark = node.marks.find(m => m.type.name === 'comment' && m.attrs.id === threadId)\n if (mark) tr.removeMark(pos, pos + node.nodeSize, mark)\n })\n if (commentsKey.getState(state)?.active === threadId) tr.setMeta(commentsKey, { active: null } satisfies CommentsMeta)\n if (tr.docChanged || tr.getMeta(commentsKey)) ctx.editor.view.dispatch(tr.setMeta('addToHistory', false))\n ctx.map.delete(threadId)\n }\n\n function removeReply(threadId: string, replyId: string): void {\n const ctx = writable()\n const thread = ctx && threadMap(ctx.map, threadId)\n const replies = thread && repliesOf(thread)\n if (!ctx || !replies) return\n const index = replies.toArray().findIndex(r => r.id === replyId)\n if (index >= 0 && replies.get(index).author.id === ctx.user.id) replies.delete(index, 1)\n }\n\n function activate(id: string | null, options: { reveal?: boolean } = {}): void {\n const instance = current()\n if (instance) setActiveComment(instance, id, options)\n }\n\n function startDraft(): void {\n const ctx = writable()\n if (ctx) startCommentDraft(ctx.editor)\n }\n\n function cancelDraft(): void {\n const instance = current()\n if (instance) cancelCommentDraft(instance)\n }\n\n return { state: store, refresh, dispose, add, reply, edit, setResolved, remove, removeReply, activate, startDraft, cancelDraft }\n}\n\n/** Creates the comments model of one editor, as a host supplies it to `commentsFeatureCore`. */\nexport type CommentsModelFactory = (getEditor: () => Editor | undefined) => CommentsModel\n\n// The host's model factory per surface context, set by the comments feature while the surface builds its extensions.\nconst modelFactories = new WeakMap<FeatureContext, CommentsModelFactory>()\n\n/** Registers the host model factory of `ctx` (the comments feature does this; hosts pass `model` to the feature). */\nexport function provideCommentsModel(ctx: FeatureContext, factory: CommentsModelFactory): void {\n modelFactories.set(ctx, factory)\n}\n\n/** The host model factory the comments feature of `ctx` was configured with; undefined for the default Y.Doc model. */\nexport function commentsModelOf(ctx: FeatureContext): CommentsModelFactory | undefined {\n return modelFactories.get(ctx)\n}\n\n/**\n * The comments model the framework hooks (`useComments`) use: the model of the surface `getEditor` belongs to\n * (`commentsModelOf` of its feature context: the host's `model` factory) and `createCommentsModel` for every other\n * editor. It follows the editor over time: when the editor changes to one of a surface with another model, the inner\n * model is replaced (disposed, created, refreshed) and `state` carries on with the new one. The factory runs once per\n * consumer of this function, so a host model that must share state across them keeps it outside the factory.\n */\nexport function createEditorCommentsModel(getEditor: () => Editor | undefined): CommentsModel {\n const store = createStore<CommentsSnapshot>(EMPTY)\n let inner: { model: CommentsModel, factory: CommentsModelFactory, stop: () => void } | undefined\n\n function release() {\n inner?.stop()\n inner?.model.dispose()\n inner = undefined\n }\n\n /** The inner model for the editor now; a replacement when its surface brings another factory. */\n function current(): CommentsModel {\n const entry = editorEntryOf(getEditor())\n const factory = (entry && commentsModelOf(entry.ctx)) ?? createCommentsModel\n if (inner?.factory !== factory) {\n release()\n const model = factory(getEditor)\n inner = { model, factory, stop: model.state.subscribe(snapshot => store.set(snapshot)) }\n store.set(model.state.get())\n }\n return inner!.model\n }\n\n return {\n state: store,\n refresh: () => current().refresh(),\n dispose: () => {\n release()\n store.set(EMPTY)\n },\n add: text => current().add(text),\n reply: (threadId, text) => current().reply(threadId, text),\n edit: (threadId, replyId, text) => current().edit(threadId, replyId, text),\n setResolved: (threadId, resolved) => current().setResolved(threadId, resolved),\n remove: threadId => current().remove(threadId),\n removeReply: (threadId, replyId) => current().removeReply(threadId, replyId),\n activate: (id, options) => current().activate(id, options),\n startDraft: () => current().startDraft(),\n cancelDraft: () => current().cancelDraft(),\n }\n}\n"],"mappings":";;;;;;;;AAkEA,MAAM,4BAA2C,IAAI,IAAI;AACzD,MAAM,aAAuC,CAAC;AAE9C,MAAM,QAA0B;CAC9B,WAAW;CACX,YAAY;CACZ,MAAM;CACN,SAAS;CACT,QAAQ;CACR,QAAQ;CACR,OAAO;CACP,YAAY;CACZ,MAAM;CACN,UAAU;AACZ;;AAGA,SAAS,WAAW,QAAuC;CACzD,MAAM,UAAU,OAAO,IAAI,SAAS;CACpC,OAAO;EAAE,GAAI,OAAO,OAAO;EAAqB,SAAS,mBAAmB,EAAE,QAAQ,QAAQ,QAAQ,IAAsB,CAAC;CAAE;AACjI;AAEA,SAAS,UAAU,GAAoB,GAA6B;CAClE,OAAO,MAAM,KAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE;AACnE;AAEA,SAAS,WAAW,GAAkC,GAA2C;CAC/F,IAAI,MAAM,GAAG,OAAO;CACpB,IAAI,EAAE,SAAS,EAAE,MAAM,OAAO;CAC9B,KAAK,MAAM,CAAC,IAAI,UAAU,GACxB,IAAI,CAAC,UAAU,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,GAAG,OAAO;CAEnD,OAAO;AACT;AAEA,SAAS,SAAS,GAA0B,GAAmC;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utils.js";
2
+ import { Avatar, AvatarFallback } from "../../../react/ui/avatar.js";
3
+ import { jsx } from "react/jsx-runtime";
4
+ //#region src/features/comments/react/CommentAvatar.tsx
5
+ const SIZES = {
6
+ "2xs": "size-4 text-[0.5rem]",
7
+ "xs": "size-5 text-[0.625rem]"
8
+ };
9
+ /** The author's initials on the author's colour; the counterpart of Nuxt UI's `UAvatar` with `text`. */
10
+ function CommentAvatar({ name, color, size }) {
11
+ return /* @__PURE__ */ jsx(Avatar, {
12
+ title: name,
13
+ className: cn("shrink-0", SIZES[size]),
14
+ children: /* @__PURE__ */ jsx(AvatarFallback, {
15
+ className: "font-medium text-white",
16
+ style: { backgroundColor: color },
17
+ children: name.slice(0, 2).toUpperCase()
18
+ })
19
+ });
20
+ }
21
+ //#endregion
22
+ export { CommentAvatar };
23
+
24
+ //# sourceMappingURL=CommentAvatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentAvatar.js","names":[],"sources":["../../../../src/features/comments/react/CommentAvatar.tsx"],"sourcesContent":["import { Avatar, AvatarFallback } from '../../../react/ui/avatar'\nimport { cn } from '../../../react/ui/utils'\n\nconst SIZES = { '2xs': 'size-4 text-[0.5rem]', 'xs': 'size-5 text-[0.625rem]' } as const\n\n/** The author's initials on the author's colour; the counterpart of Nuxt UI's `UAvatar` with `text`. */\nexport function CommentAvatar({ name, color, size }: { name: string, color: string, size: keyof typeof SIZES }) {\n return (\n <Avatar title={name} className={cn('shrink-0', SIZES[size])}>\n <AvatarFallback className=\"font-medium text-white\" style={{ backgroundColor: color }}>{name.slice(0, 2).toUpperCase()}</AvatarFallback>\n </Avatar>\n )\n}\n"],"mappings":";;;;AAGA,MAAM,QAAQ;CAAE,OAAO;CAAwB,MAAM;AAAyB;;AAG9E,SAAgB,cAAc,EAAE,MAAM,OAAO,QAAmE;CAC9G,OACE,oBAAC,QAAD;EAAQ,OAAO;EAAM,WAAW,GAAG,YAAY,MAAM,KAAK;EACxD,UAAA,oBAAC,gBAAD;GAAgB,WAAU;GAAyB,OAAO,EAAE,iBAAiB,MAAM;GAAI,UAAA,KAAK,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY;EAAkB,CAAA;CAChI,CAAA;AAEZ"}
@@ -0,0 +1,11 @@
1
+ import { Editor } from "@tiptap/core";
2
+ //#region src/features/comments/react/CommentBubble.d.ts
3
+ /**
4
+ * Bubble menu entry „Kommentar“ on a text selection where the user may comment: starts a comment on the selection (the
5
+ * layout shows the composer). It sits below the selection, where the AI feature's bubble (above it) leaves room.
6
+ */
7
+ export declare function CommentBubble({ editor }: {
8
+ editor: Editor;
9
+ }): import("react").JSX.Element;
10
+ //#endregion
11
+ //# sourceMappingURL=CommentBubble.d.ts.map
@@ -0,0 +1,43 @@
1
+ import { useEditorI18n } from "../../../react/use-editor-i18n.js";
2
+ import { Icon } from "../../../react/Icon.js";
3
+ import { Button } from "../../../react/ui/button.js";
4
+ import { commentsCanComment, commentsState, startCommentDraft } from "../comments-plugin.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { BubbleMenu } from "@tiptap/react/menus";
7
+ //#region src/features/comments/react/CommentBubble.tsx
8
+ const shouldShow = ({ editor, element, view, state, from, to }) => {
9
+ if (!commentsCanComment(editor) || state.selection.empty) return false;
10
+ if (commentsState(state)?.draft) return false;
11
+ if (!view.hasFocus() && !element.contains(document.activeElement)) return false;
12
+ return state.doc.textBetween(from, to, " ").trim().length > 0;
13
+ };
14
+ /**
15
+ * Bubble menu entry „Kommentar“ on a text selection where the user may comment: starts a comment on the selection (the
16
+ * layout shows the composer). It sits below the selection, where the AI feature's bubble (above it) leaves room.
17
+ */
18
+ function CommentBubble({ editor }) {
19
+ const { t } = useEditorI18n();
20
+ return /* @__PURE__ */ jsx(BubbleMenu, {
21
+ editor,
22
+ pluginKey: "commentBubble",
23
+ shouldShow,
24
+ options: {
25
+ placement: "bottom",
26
+ offset: 8
27
+ },
28
+ className: "z-10",
29
+ children: /* @__PURE__ */ jsx("div", {
30
+ className: "flex rounded-md border border-border bg-background p-0.5 shadow-md",
31
+ children: /* @__PURE__ */ jsxs(Button, {
32
+ size: "sm",
33
+ variant: "ghost",
34
+ onClick: () => startCommentDraft(editor),
35
+ children: [/* @__PURE__ */ jsx(Icon, { name: "i-lucide-message-square-plus" }), t("comments.bubble")]
36
+ })
37
+ })
38
+ });
39
+ }
40
+ //#endregion
41
+ export { CommentBubble };
42
+
43
+ //# sourceMappingURL=CommentBubble.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentBubble.js","names":[],"sources":["../../../../src/features/comments/react/CommentBubble.tsx"],"sourcesContent":["import type { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu'\nimport type { Editor } from '@tiptap/core'\nimport { BubbleMenu } from '@tiptap/react/menus'\nimport { Icon } from '../../../react/Icon'\nimport { Button } from '../../../react/ui/button'\nimport { useEditorI18n } from '../../../react/use-editor-i18n'\nimport { commentsCanComment, commentsState, startCommentDraft } from '../comments-plugin'\n\nconst shouldShow: NonNullable<BubbleMenuPluginProps['shouldShow']> = ({ editor, element, view, state, from, to }) => {\n // Comments need an editor with comments available (a collaborative one with a user, or a host model) that the user may comment on.\n if (!commentsCanComment(editor) || state.selection.empty) return false\n if (commentsState(state)?.draft) return false\n if (!view.hasFocus() && !element.contains(document.activeElement)) return false\n return state.doc.textBetween(from, to, ' ').trim().length > 0\n}\n\n/**\n * Bubble menu entry „Kommentar“ on a text selection where the user may comment: starts a comment on the selection (the\n * layout shows the composer). It sits below the selection, where the AI feature's bubble (above it) leaves room.\n */\nexport function CommentBubble({ editor }: { editor: Editor }) {\n const { t } = useEditorI18n()\n return (\n <BubbleMenu editor={editor} pluginKey=\"commentBubble\" shouldShow={shouldShow} options={{ placement: 'bottom', offset: 8 }} className=\"z-10\">\n <div className=\"flex rounded-md border border-border bg-background p-0.5 shadow-md\">\n <Button size=\"sm\" variant=\"ghost\" onClick={() => startCommentDraft(editor)}>\n <Icon name=\"i-lucide-message-square-plus\" />\n {t('comments.bubble')}\n </Button>\n </div>\n </BubbleMenu>\n )\n}\n"],"mappings":";;;;;;;AAQA,MAAM,cAAgE,EAAE,QAAQ,SAAS,MAAM,OAAO,MAAM,SAAS;CAEnH,IAAI,CAAC,mBAAmB,MAAM,KAAK,MAAM,UAAU,OAAO,OAAO;CACjE,IAAI,cAAc,KAAK,CAAC,EAAE,OAAO,OAAO;CACxC,IAAI,CAAC,KAAK,SAAS,KAAK,CAAC,QAAQ,SAAS,SAAS,aAAa,GAAG,OAAO;CAC1E,OAAO,MAAM,IAAI,YAAY,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS;AAC9D;;;;;AAMA,SAAgB,cAAc,EAAE,UAA8B;CAC5D,MAAM,EAAE,MAAM,cAAc;CAC5B,OACE,oBAAC,YAAD;EAAoB;EAAQ,WAAU;EAA4B;EAAY,SAAS;GAAE,WAAW;GAAU,QAAQ;EAAE;EAAG,WAAU;EACnI,UAAA,oBAAC,OAAD;GAAK,WAAU;GACb,UAAA,qBAAC,QAAD;IAAQ,MAAK;IAAK,SAAQ;IAAQ,eAAe,kBAAkB,MAAM;IAAzE,UAAA,CACE,oBAAC,MAAD,EAAM,MAAK,+BAAgC,CAAA,GAC1C,EAAE,iBAAiB,CACd;;EACL,CAAA;CACK,CAAA;AAEhB"}
@@ -0,0 +1,15 @@
1
+ //#region src/features/comments/react/CommentComposer.d.ts
2
+ /**
3
+ * Writes a new comment on the draft (`quote`: its text): „Kommentieren“ (Mod-Enter) calls `onSubmit` with the text,
4
+ * „Abbrechen“ (Esc) `onCancel`. Layout-independent; the layout calls `useComments().add` / `cancelDraft`.
5
+ * `dense`: compact, frameless rendering for a popover (one-line quote, small controls).
6
+ */
7
+ export declare function CommentComposer({ quote, dense, className, onSubmit, onCancel }: {
8
+ quote: string;
9
+ dense?: boolean;
10
+ className?: string;
11
+ onSubmit: (text: string) => void;
12
+ onCancel: () => void;
13
+ }): import("react").JSX.Element;
14
+ //#endregion
15
+ //# sourceMappingURL=CommentComposer.d.ts.map
@@ -0,0 +1,69 @@
1
+ import { useEditorI18n } from "../../../react/use-editor-i18n.js";
2
+ import { cn } from "../../../react/ui/utils.js";
3
+ import { Button } from "../../../react/ui/button.js";
4
+ import { Textarea } from "../../../react/ui/textarea.js";
5
+ import { COMMENT_LIMITS } from "../schema.js";
6
+ import { useState } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/features/comments/react/CommentComposer.tsx
9
+ /**
10
+ * Writes a new comment on the draft (`quote`: its text): „Kommentieren“ (Mod-Enter) calls `onSubmit` with the text,
11
+ * „Abbrechen“ (Esc) `onCancel`. Layout-independent; the layout calls `useComments().add` / `cancelDraft`.
12
+ * `dense`: compact, frameless rendering for a popover (one-line quote, small controls).
13
+ */
14
+ function CommentComposer({ quote, dense, className, onSubmit, onCancel }) {
15
+ const { t } = useEditorI18n();
16
+ const [text, setText] = useState("");
17
+ function submit() {
18
+ if (text.trim()) onSubmit(text);
19
+ }
20
+ function onKeyDown(event) {
21
+ if (event.nativeEvent.isComposing) return;
22
+ if (event.key === "Enter" && (event.metaKey || event.ctrlKey)) {
23
+ event.preventDefault();
24
+ submit();
25
+ } else if (event.key === "Escape") {
26
+ event.preventDefault();
27
+ onCancel();
28
+ }
29
+ }
30
+ return /* @__PURE__ */ jsxs("div", {
31
+ className: cn("flex flex-col text-sm", dense ? "gap-1.5" : "gap-2 rounded-md border border-border bg-background p-3", className),
32
+ children: [
33
+ quote && /* @__PURE__ */ jsx("p", {
34
+ className: cn("border-l-2 border-(--sk-warning) pl-2 text-muted-foreground italic", dense ? "truncate text-xs" : "line-clamp-2"),
35
+ title: dense ? quote : void 0,
36
+ children: quote
37
+ }),
38
+ /* @__PURE__ */ jsx(Textarea, {
39
+ value: text,
40
+ onChange: (event) => setText(event.target.value),
41
+ autoFocus: true,
42
+ rows: 2,
43
+ maxLength: COMMENT_LIMITS.text,
44
+ placeholder: t("comments.composer.placeholder"),
45
+ "aria-label": t("comments.composer.label"),
46
+ className: cn("max-h-48 w-full resize-none overflow-y-auto", dense ? "min-h-10 px-2 py-1 text-xs md:text-xs" : "min-h-14 text-sm md:text-sm"),
47
+ onKeyDown
48
+ }),
49
+ /* @__PURE__ */ jsxs("div", {
50
+ className: cn("flex justify-end", dense ? "gap-1" : "gap-2"),
51
+ children: [/* @__PURE__ */ jsx(Button, {
52
+ size: dense ? "xs" : "sm",
53
+ variant: "ghost",
54
+ onClick: onCancel,
55
+ children: t("comments.cancel")
56
+ }), /* @__PURE__ */ jsx(Button, {
57
+ size: dense ? "xs" : "sm",
58
+ disabled: !text.trim(),
59
+ onClick: submit,
60
+ children: t("comments.composer.submit")
61
+ })]
62
+ })
63
+ ]
64
+ });
65
+ }
66
+ //#endregion
67
+ export { CommentComposer };
68
+
69
+ //# sourceMappingURL=CommentComposer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentComposer.js","names":[],"sources":["../../../../src/features/comments/react/CommentComposer.tsx"],"sourcesContent":["import { type KeyboardEvent, useState } from 'react'\nimport { Button } from '../../../react/ui/button'\nimport { Textarea } from '../../../react/ui/textarea'\nimport { cn } from '../../../react/ui/utils'\nimport { useEditorI18n } from '../../../react/use-editor-i18n'\nimport { COMMENT_LIMITS } from '../schema'\n\n/**\n * Writes a new comment on the draft (`quote`: its text): „Kommentieren“ (Mod-Enter) calls `onSubmit` with the text,\n * „Abbrechen“ (Esc) `onCancel`. Layout-independent; the layout calls `useComments().add` / `cancelDraft`.\n * `dense`: compact, frameless rendering for a popover (one-line quote, small controls).\n */\nexport function CommentComposer({ quote, dense, className, onSubmit, onCancel }: {\n quote: string\n dense?: boolean\n className?: string\n onSubmit: (text: string) => void\n onCancel: () => void\n}) {\n const { t } = useEditorI18n()\n const [text, setText] = useState('')\n\n function submit() {\n if (text.trim()) onSubmit(text)\n }\n\n function onKeyDown(event: KeyboardEvent<HTMLTextAreaElement>) {\n if (event.nativeEvent.isComposing) return\n if (event.key === 'Enter' && (event.metaKey || event.ctrlKey)) {\n event.preventDefault()\n submit()\n }\n else if (event.key === 'Escape') {\n event.preventDefault()\n onCancel()\n }\n }\n\n return (\n <div\n className={cn('flex flex-col text-sm', dense ? 'gap-1.5' : 'gap-2 rounded-md border border-border bg-background p-3', className)}\n >\n {quote && (\n <p\n className={cn('border-l-2 border-(--sk-warning) pl-2 text-muted-foreground italic', dense ? 'truncate text-xs' : 'line-clamp-2')}\n title={dense ? quote : undefined}\n >\n {quote}\n </p>\n )}\n <Textarea\n value={text}\n onChange={event => setText(event.target.value)}\n autoFocus\n rows={2}\n maxLength={COMMENT_LIMITS.text}\n placeholder={t('comments.composer.placeholder')}\n aria-label={t('comments.composer.label')}\n className={cn('max-h-48 w-full resize-none overflow-y-auto', dense ? 'min-h-10 px-2 py-1 text-xs md:text-xs' : 'min-h-14 text-sm md:text-sm')}\n onKeyDown={onKeyDown}\n />\n <div className={cn('flex justify-end', dense ? 'gap-1' : 'gap-2')}>\n <Button size={dense ? 'xs' : 'sm'} variant=\"ghost\" onClick={onCancel}>{t('comments.cancel')}</Button>\n <Button size={dense ? 'xs' : 'sm'} disabled={!text.trim()} onClick={submit}>{t('comments.composer.submit')}</Button>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAYA,SAAgB,gBAAgB,EAAE,OAAO,OAAO,WAAW,UAAU,YAMlE;CACD,MAAM,EAAE,MAAM,cAAc;CAC5B,MAAM,CAAC,MAAM,WAAW,SAAS,EAAE;CAEnC,SAAS,SAAS;EAChB,IAAI,KAAK,KAAK,GAAG,SAAS,IAAI;CAChC;CAEA,SAAS,UAAU,OAA2C;EAC5D,IAAI,MAAM,YAAY,aAAa;EACnC,IAAI,MAAM,QAAQ,YAAY,MAAM,WAAW,MAAM,UAAU;GAC7D,MAAM,eAAe;GACrB,OAAO;EACT,OACK,IAAI,MAAM,QAAQ,UAAU;GAC/B,MAAM,eAAe;GACrB,SAAS;EACX;CACF;CAEA,OACE,qBAAC,OAAD;EACE,WAAW,GAAG,yB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