@ecsplico/editor 2.1.2 → 3.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 (692) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/README.md +39 -156
  3. package/dist/adapters/comments/drizzle.d.ts +1 -1
  4. package/dist/adapters/comments/{client.js → rest-model.js} +3 -3
  5. package/dist/adapters/comments/rest-model.js.map +1 -0
  6. package/dist/adapters/comments/types.d.ts +2 -2
  7. package/dist/adapters/document-state.d.ts +23 -0
  8. package/dist/adapters/document-state.js +66 -0
  9. package/dist/adapters/document-state.js.map +1 -0
  10. package/dist/adapters/documents.js +14 -11
  11. package/dist/adapters/documents.js.map +1 -1
  12. package/dist/adapters/drizzle.d.ts +2 -2
  13. package/dist/adapters/drizzle.js +97 -88
  14. package/dist/adapters/drizzle.js.map +1 -1
  15. package/dist/adapters/forge.d.ts +12 -7
  16. package/dist/adapters/forge.js +38 -45
  17. package/dist/adapters/forge.js.map +1 -1
  18. package/dist/adapters/http.d.ts +20 -0
  19. package/dist/adapters/http.js +68 -0
  20. package/dist/adapters/http.js.map +1 -0
  21. package/dist/adapters/index.d.ts +5 -5
  22. package/dist/adapters/json.d.ts +3 -3
  23. package/dist/adapters/json.js +58 -49
  24. package/dist/adapters/json.js.map +1 -1
  25. package/dist/adapters/memory.d.ts +21 -0
  26. package/dist/adapters/memory.js +53 -0
  27. package/dist/adapters/memory.js.map +1 -0
  28. package/dist/adapters/nitro.d.ts +23 -20
  29. package/dist/adapters/nitro.js +58 -163
  30. package/dist/adapters/nitro.js.map +1 -1
  31. package/dist/adapters/react.d.ts +55 -0
  32. package/dist/adapters/react.js +209 -0
  33. package/dist/adapters/react.js.map +1 -0
  34. package/dist/adapters/shared.d.ts +15 -21
  35. package/dist/adapters/shared.js +10 -8
  36. package/dist/adapters/shared.js.map +1 -1
  37. package/dist/adapters/vue.d.ts +15 -30
  38. package/dist/adapters/vue.js +36 -87
  39. package/dist/adapters/vue.js.map +1 -1
  40. package/dist/config/index.d.ts +105 -0
  41. package/dist/config/index.js +95 -0
  42. package/dist/config/index.js.map +1 -0
  43. package/dist/core/abilities.js +1 -0
  44. package/dist/core/abilities.js.map +1 -1
  45. package/dist/{adapters/routes.js → core/api-routes.js} +5 -3
  46. package/dist/core/api-routes.js.map +1 -0
  47. package/dist/core/backend-capability.d.ts +7 -0
  48. package/dist/core/backend-capability.js +17 -0
  49. package/dist/core/backend-capability.js.map +1 -0
  50. package/dist/core/backend-types.d.ts +245 -0
  51. package/dist/core/backend-types.js +17 -0
  52. package/dist/core/backend-types.js.map +1 -0
  53. package/dist/core/backend.d.ts +108 -0
  54. package/dist/core/backend.js +14 -0
  55. package/dist/core/backend.js.map +1 -0
  56. package/dist/core/block-convert.d.ts +7 -5
  57. package/dist/core/block-convert.js +28 -5
  58. package/dist/core/block-convert.js.map +1 -1
  59. package/dist/core/command-types.d.ts +89 -0
  60. package/dist/core/commands.d.ts +40 -0
  61. package/dist/core/commands.js +151 -0
  62. package/dist/core/commands.js.map +1 -0
  63. package/dist/core/context.d.ts +17 -20
  64. package/dist/core/context.js +24 -21
  65. package/dist/core/context.js.map +1 -1
  66. package/dist/core/core-feature.d.ts +22 -7
  67. package/dist/core/core-feature.js +51 -18
  68. package/dist/core/core-feature.js.map +1 -1
  69. package/dist/core/define-editor.d.ts +4 -3
  70. package/dist/core/define-editor.js +14 -7
  71. package/dist/core/define-editor.js.map +1 -1
  72. package/dist/core/document-markdown.js +12 -3
  73. package/dist/core/document-markdown.js.map +1 -1
  74. package/dist/core/editor-ui.d.ts +8 -1
  75. package/dist/core/editor-ui.js +9 -8
  76. package/dist/core/editor-ui.js.map +1 -1
  77. package/dist/core/extension-points.d.ts +3 -15
  78. package/dist/core/feature-context.d.ts +8 -7
  79. package/dist/core/feature-context.js +12 -11
  80. package/dist/core/feature-context.js.map +1 -1
  81. package/dist/core/feature.d.ts +35 -19
  82. package/dist/core/feature.js.map +1 -1
  83. package/dist/core/fences.d.ts +2 -1
  84. package/dist/core/fences.js +3 -2
  85. package/dist/core/fences.js.map +1 -1
  86. package/dist/core/fetch-error.d.ts +1 -1
  87. package/dist/core/fetch-error.js +3 -1
  88. package/dist/core/fetch-error.js.map +1 -1
  89. package/dist/core/hash.d.ts +5 -0
  90. package/dist/core/hash.js +11 -0
  91. package/dist/core/hash.js.map +1 -0
  92. package/dist/core/http-backend.d.ts +11 -0
  93. package/dist/core/http-backend.js +195 -0
  94. package/dist/core/http-backend.js.map +1 -0
  95. package/dist/core/index.d.ts +14 -9
  96. package/dist/core/index.js +12 -9
  97. package/dist/core/palette.d.ts +48 -0
  98. package/dist/core/palette.js +95 -0
  99. package/dist/core/palette.js.map +1 -0
  100. package/dist/core/schema/abilities.d.ts +2 -1
  101. package/dist/core/schema/abilities.js +5 -1
  102. package/dist/core/schema/abilities.js.map +1 -1
  103. package/dist/core/schema/index.d.ts +11 -5
  104. package/dist/core/schema/index.js +13 -8
  105. package/dist/core/schema/index.js.map +1 -1
  106. package/dist/core/schema/mark-flags.d.ts +8 -1
  107. package/dist/core/schema/of-features.d.ts +13 -0
  108. package/dist/core/schema/of-features.js +14 -0
  109. package/dist/core/schema/of-features.js.map +1 -0
  110. package/dist/core/slash.d.ts +8 -6
  111. package/dist/core/slash.js +24 -16
  112. package/dist/core/slash.js.map +1 -1
  113. package/dist/core/surface-session.js +13 -5
  114. package/dist/core/surface-session.js.map +1 -1
  115. package/dist/core/toolbar-items.d.ts +10 -4
  116. package/dist/core/toolbar-items.js +269 -195
  117. package/dist/core/toolbar-items.js.map +1 -1
  118. package/dist/core/util.js +11 -0
  119. package/dist/core/util.js.map +1 -0
  120. package/dist/document/DocumentSurface.d.ts +1 -1
  121. package/dist/features/ai/agent-op-review.d.ts +1 -1
  122. package/dist/features/ai/agent-op-review.js +1 -1
  123. package/dist/features/ai/agent-ops.js +1 -1
  124. package/dist/features/ai/ai-apply.d.ts +2 -2
  125. package/dist/features/ai/ai-apply.js +1 -1
  126. package/dist/features/ai/ai-review.js +1 -1
  127. package/dist/features/ai/ai-sse.d.ts +6 -6
  128. package/dist/features/ai/ai-sse.js +20 -63
  129. package/dist/features/ai/ai-sse.js.map +1 -1
  130. package/dist/features/ai/assistant.d.ts +8 -7
  131. package/dist/features/ai/assistant.js +3 -3
  132. package/dist/features/ai/assistant.js.map +1 -1
  133. package/dist/features/ai/block-actions.d.ts +3 -2
  134. package/dist/features/ai/block-actions.js +3 -2
  135. package/dist/features/ai/block-actions.js.map +1 -1
  136. package/dist/features/ai/components/AiSelectionMenu.js +1 -1
  137. package/dist/features/ai/components/DocumentChatAnswer.js +1 -1
  138. package/dist/features/ai/components/DocumentChatOps.vue.d.ts +1 -1
  139. package/dist/features/ai/components/SettingsModelProfiles.js +8 -8
  140. package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -1
  141. package/dist/features/ai/document-chat-model.d.ts +8 -7
  142. package/dist/features/ai/document-chat-model.js +5 -5
  143. package/dist/features/ai/document-chat-model.js.map +1 -1
  144. package/dist/features/ai/document-chat.js +1 -1
  145. package/dist/features/ai/feature.js +27 -14
  146. package/dist/features/ai/feature.js.map +1 -1
  147. package/dist/features/ai/ghost-autocomplete.d.ts +7 -6
  148. package/dist/features/ai/ghost-autocomplete.js +6 -9
  149. package/dist/features/ai/ghost-autocomplete.js.map +1 -1
  150. package/dist/features/ai/index.d.ts +4 -3
  151. package/dist/features/ai/index.js +10 -10
  152. package/dist/features/ai/model-profiles.d.ts +5 -4
  153. package/dist/features/ai/model-profiles.js +2 -2
  154. package/dist/features/ai/model-profiles.js.map +1 -1
  155. package/dist/features/ai/protocol/block-lines.js +1 -1
  156. package/dist/features/ai/protocol/block-lines.js.map +1 -1
  157. package/dist/features/ai/protocol/chat.js +4 -1
  158. package/dist/features/ai/protocol/chat.js.map +1 -1
  159. package/dist/features/ai/protocol/index.d.ts +3 -2
  160. package/dist/features/ai/protocol/models.d.ts +2 -16
  161. package/dist/features/ai/protocol/models.js.map +1 -1
  162. package/dist/features/ai/rate-limit.d.ts +1 -1
  163. package/dist/features/ai/rate-limit.js +3 -1
  164. package/dist/features/ai/rate-limit.js.map +1 -1
  165. package/dist/features/ai/react/AiSelectionMenu.js +2 -2
  166. package/dist/features/ai/react/AiSidebar.js +4 -4
  167. package/dist/features/ai/react/DocumentChatAnswer.js +1 -1
  168. package/dist/features/ai/react/DocumentChatOps.d.ts +1 -1
  169. package/dist/features/ai/react/DocumentChatOps.js +1 -1
  170. package/dist/features/ai/react/SettingsModelProfiles.js +8 -10
  171. package/dist/features/ai/react/SettingsModelProfiles.js.map +1 -1
  172. package/dist/features/ai/react/use-ai-assistant.d.ts +1 -1
  173. package/dist/features/ai/react/use-ai-assistant.js +3 -3
  174. package/dist/features/ai/react/use-ai-assistant.js.map +1 -1
  175. package/dist/features/ai/react/use-document-chat.js +2 -2
  176. package/dist/features/ai/react/use-document-chat.js.map +1 -1
  177. package/dist/features/ai/react/use-model-profiles.d.ts +2 -1
  178. package/dist/features/ai/selection-flow.d.ts +1 -1
  179. package/dist/features/ai/selection-flow.js +1 -1
  180. package/dist/features/ai/sidebar-flow.d.ts +1 -1
  181. package/dist/features/ai/sidebar-flow.js +1 -1
  182. package/dist/features/ai/use-ai-assistant.d.ts +1 -1
  183. package/dist/features/ai/use-ai-assistant.js +3 -3
  184. package/dist/features/ai/use-ai-assistant.js.map +1 -1
  185. package/dist/features/ai/use-document-chat.js +2 -2
  186. package/dist/features/ai/use-document-chat.js.map +1 -1
  187. package/dist/features/ai/use-model-profiles.d.ts +2 -1
  188. package/dist/features/authors/attribution.d.ts +1 -1
  189. package/dist/features/authors/feature.js +12 -11
  190. package/dist/features/authors/feature.js.map +1 -1
  191. package/dist/features/block-ui/block-actions.d.ts +1 -1
  192. package/dist/features/block-ui/block-actions.js +1 -1
  193. package/dist/features/block-ui/block-actions.js.map +1 -1
  194. package/dist/features/block-ui/components/BlockUi.js +1 -1
  195. package/dist/features/block-ui/feature.js +1 -0
  196. package/dist/features/block-ui/feature.js.map +1 -1
  197. package/dist/features/block-ui/react/BlockUi.js +1 -1
  198. package/dist/features/collab/anchor-resolver.js +1 -1
  199. package/dist/features/collab/feature.js +2 -0
  200. package/dist/features/collab/feature.js.map +1 -1
  201. package/dist/features/comments/components/CommentThreadView.vue.d.ts +2 -1
  202. package/dist/features/comments/feature.js +12 -11
  203. package/dist/features/comments/feature.js.map +1 -1
  204. package/dist/features/comments/index.d.ts +3 -2
  205. package/dist/features/comments/index.js +1 -1
  206. package/dist/features/comments/margin-layout.d.ts +3 -2
  207. package/dist/features/comments/model.d.ts +3 -67
  208. package/dist/features/comments/model.js +2 -2
  209. package/dist/features/comments/model.js.map +1 -1
  210. package/dist/features/comments/react/CommentThreadView.d.ts +3 -2
  211. package/dist/features/comments/react/use-comments.d.ts +2 -1
  212. package/dist/features/comments/react.d.ts +1 -1
  213. package/dist/features/comments/schema.d.ts +2 -52
  214. package/dist/features/comments/schema.js.map +1 -1
  215. package/dist/features/comments/snapshot-equality.js.map +1 -1
  216. package/dist/features/comments/use-comments.d.ts +3 -2
  217. package/dist/features/comments/vue.d.ts +1 -1
  218. package/dist/features/composites/accepted-children.d.ts +1 -0
  219. package/dist/features/composites/accepted-children.js +16 -1
  220. package/dist/features/composites/accepted-children.js.map +1 -1
  221. package/dist/features/composites/ai-brief.js +31 -0
  222. package/dist/features/composites/ai-brief.js.map +1 -1
  223. package/dist/features/composites/bibliography-command.d.ts +11 -0
  224. package/dist/features/composites/bibliography-form.js +90 -0
  225. package/dist/features/composites/bibliography-form.js.map +1 -0
  226. package/dist/features/composites/bibliography.d.ts +33 -0
  227. package/dist/features/composites/bibliography.js +120 -0
  228. package/dist/features/composites/bibliography.js.map +1 -0
  229. package/dist/features/composites/components/BibliographyEditor.js +261 -0
  230. package/dist/features/composites/components/BibliographyEditor.js.map +1 -0
  231. package/dist/features/composites/components/CompositeChrome.js +75 -26
  232. package/dist/features/composites/components/CompositeChrome.js.map +1 -1
  233. package/dist/features/composites/components/CompositeDetails.js +46 -11
  234. package/dist/features/composites/components/CompositeDetails.js.map +1 -1
  235. package/dist/features/composites/components/CompositeDetails.vue.d.ts +2 -1
  236. package/dist/features/composites/components/CompositeFieldEditor.js +37 -4
  237. package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -1
  238. package/dist/features/composites/components/CompositeInspector.js +17 -5
  239. package/dist/features/composites/components/CompositeInspector.js.map +1 -1
  240. package/dist/features/composites/components/CompositeTable.js +13 -4
  241. package/dist/features/composites/components/CompositeTable.js.map +1 -1
  242. package/dist/features/composites/components/CompositeTagsEditor.js +1 -1
  243. package/dist/features/composites/components/CompositeView.js +11 -1
  244. package/dist/features/composites/components/CompositeView.js.map +1 -1
  245. package/dist/features/composites/components/DerivationBadge.js +103 -0
  246. package/dist/features/composites/components/DerivationBadge.js.map +1 -0
  247. package/dist/features/composites/components/ReferenceFieldSelect.js +60 -0
  248. package/dist/features/composites/components/ReferenceFieldSelect.js.map +1 -0
  249. package/dist/features/composites/components/ReferenceView.js +122 -0
  250. package/dist/features/composites/components/ReferenceView.js.map +1 -0
  251. package/dist/features/composites/components/ReferenceView.vue.d.ts +96 -0
  252. package/dist/features/composites/components/SettingsEditingTab.js +1 -1
  253. package/dist/features/composites/convert.js +2 -2
  254. package/dist/features/composites/convert.js.map +1 -1
  255. package/dist/features/composites/derivation.d.ts +61 -0
  256. package/dist/features/composites/derivation.js +98 -0
  257. package/dist/features/composites/derivation.js.map +1 -0
  258. package/dist/features/composites/derived-chrome.js +69 -0
  259. package/dist/features/composites/derived-chrome.js.map +1 -0
  260. package/dist/features/composites/feature.js +159 -109
  261. package/dist/features/composites/feature.js.map +1 -1
  262. package/dist/features/composites/fences.d.ts +4 -3
  263. package/dist/features/composites/fences.js +51 -7
  264. package/dist/features/composites/fences.js.map +1 -1
  265. package/dist/features/composites/index.d.ts +12 -3
  266. package/dist/features/composites/index.js +15 -6
  267. package/dist/features/composites/inspector-model.d.ts +4 -1
  268. package/dist/features/composites/inspector-model.js +8 -4
  269. package/dist/features/composites/inspector-model.js.map +1 -1
  270. package/dist/features/composites/kinds.d.ts +8 -1
  271. package/dist/features/composites/kinds.js +145 -6
  272. package/dist/features/composites/kinds.js.map +1 -1
  273. package/dist/features/composites/legacy.d.ts +4 -1
  274. package/dist/features/composites/legacy.js +56 -1
  275. package/dist/features/composites/legacy.js.map +1 -1
  276. package/dist/features/composites/meta-display.js +40 -1
  277. package/dist/features/composites/meta-display.js.map +1 -1
  278. package/dist/features/composites/meta-keys.d.ts +7 -0
  279. package/dist/features/composites/meta-keys.js +21 -0
  280. package/dist/features/composites/meta-keys.js.map +1 -0
  281. package/dist/features/composites/node-views.d.ts +6 -3
  282. package/dist/features/composites/node-views.js +7 -3
  283. package/dist/features/composites/node-views.js.map +1 -1
  284. package/dist/features/composites/nodes.d.ts +6 -1
  285. package/dist/features/composites/nodes.js +33 -7
  286. package/dist/features/composites/nodes.js.map +1 -1
  287. package/dist/features/composites/react/BibliographyEditor.js +229 -0
  288. package/dist/features/composites/react/BibliographyEditor.js.map +1 -0
  289. package/dist/features/composites/react/CompositeChrome.js +65 -17
  290. package/dist/features/composites/react/CompositeChrome.js.map +1 -1
  291. package/dist/features/composites/react/CompositeDetails.d.ts +2 -1
  292. package/dist/features/composites/react/CompositeDetails.js +45 -6
  293. package/dist/features/composites/react/CompositeDetails.js.map +1 -1
  294. package/dist/features/composites/react/CompositeFieldEditor.d.ts +1 -1
  295. package/dist/features/composites/react/CompositeFieldEditor.js +24 -1
  296. package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -1
  297. package/dist/features/composites/react/CompositeInspector.js +11 -5
  298. package/dist/features/composites/react/CompositeInspector.js.map +1 -1
  299. package/dist/features/composites/react/CompositeStatusMenu.js +1 -1
  300. package/dist/features/composites/react/CompositeSummaryEditor.js +1 -1
  301. package/dist/features/composites/react/CompositeTable.js +16 -2
  302. package/dist/features/composites/react/CompositeTable.js.map +1 -1
  303. package/dist/features/composites/react/CompositeTagsEditor.js +2 -2
  304. package/dist/features/composites/react/CompositeView.js +6 -1
  305. package/dist/features/composites/react/CompositeView.js.map +1 -1
  306. package/dist/features/composites/react/DerivationBadge.js +116 -0
  307. package/dist/features/composites/react/DerivationBadge.js.map +1 -0
  308. package/dist/features/composites/react/ReferenceFieldSelect.js +52 -0
  309. package/dist/features/composites/react/ReferenceFieldSelect.js.map +1 -0
  310. package/dist/features/composites/react/ReferenceView.d.ts +11 -0
  311. package/dist/features/composites/react/ReferenceView.js +115 -0
  312. package/dist/features/composites/react/ReferenceView.js.map +1 -0
  313. package/dist/features/composites/react/SettingsEditingTab.js +2 -2
  314. package/dist/features/composites/react.d.ts +2 -1
  315. package/dist/features/composites/react.js +7 -3
  316. package/dist/features/composites/react.js.map +1 -1
  317. package/dist/features/composites/reference-ai.js +16 -0
  318. package/dist/features/composites/reference-ai.js.map +1 -0
  319. package/dist/features/composites/reference-label.d.ts +19 -0
  320. package/dist/features/composites/reference-label.js +58 -0
  321. package/dist/features/composites/reference-label.js.map +1 -0
  322. package/dist/features/composites/reference-suggestion.d.ts +10 -0
  323. package/dist/features/composites/reference-suggestion.js +41 -0
  324. package/dist/features/composites/reference-suggestion.js.map +1 -0
  325. package/dist/features/composites/reference-text.d.ts +18 -0
  326. package/dist/features/composites/reference-text.js +89 -0
  327. package/dist/features/composites/reference-text.js.map +1 -0
  328. package/dist/features/composites/reference.d.ts +44 -0
  329. package/dist/features/composites/reference.js +148 -0
  330. package/dist/features/composites/reference.js.map +1 -0
  331. package/dist/features/composites/reveal-source.d.ts +32 -0
  332. package/dist/features/composites/reveal-source.js +89 -0
  333. package/dist/features/composites/reveal-source.js.map +1 -0
  334. package/dist/features/composites/rows.d.ts +21 -2
  335. package/dist/features/composites/rows.js +63 -9
  336. package/dist/features/composites/rows.js.map +1 -1
  337. package/dist/features/composites/schema.d.ts +9 -3
  338. package/dist/features/composites/schema.js +11 -4
  339. package/dist/features/composites/schema.js.map +1 -1
  340. package/dist/features/composites/table-model.js +12 -21
  341. package/dist/features/composites/table-model.js.map +1 -1
  342. package/dist/features/composites/vue.d.ts +3 -2
  343. package/dist/features/composites/vue.js +8 -4
  344. package/dist/features/composites/vue.js.map +1 -1
  345. package/dist/features/media/assets.d.ts +2 -0
  346. package/dist/features/media/assets.js +3 -2
  347. package/dist/features/media/assets.js.map +1 -1
  348. package/dist/features/media/components/FileView.js +13 -4
  349. package/dist/features/media/components/FileView.js.map +1 -1
  350. package/dist/features/media/feature.d.ts +3 -3
  351. package/dist/features/media/feature.js +21 -28
  352. package/dist/features/media/feature.js.map +1 -1
  353. package/dist/features/media/file-import.js +2 -2
  354. package/dist/features/media/file-import.js.map +1 -1
  355. package/dist/features/media/index.d.ts +2 -2
  356. package/dist/features/media/index.js +2 -2
  357. package/dist/features/media/react/FileView.js +19 -2
  358. package/dist/features/media/react/FileView.js.map +1 -1
  359. package/dist/features/media/schema.d.ts +8 -0
  360. package/dist/features/media/schema.js +126 -11
  361. package/dist/features/media/schema.js.map +1 -1
  362. package/dist/features/media/upload.d.ts +16 -14
  363. package/dist/features/media/upload.js +13 -19
  364. package/dist/features/media/upload.js.map +1 -1
  365. package/dist/features/mentions/index.d.ts +4 -3
  366. package/dist/features/mentions/index.js +4 -1
  367. package/dist/features/mentions/index.js.map +1 -1
  368. package/dist/features/mentions/mention-text.d.ts +1 -1
  369. package/dist/features/mentions/mention-text.js.map +1 -1
  370. package/dist/features/mentions/mention.d.ts +0 -6
  371. package/dist/features/mentions/mention.js.map +1 -1
  372. package/dist/features/mentions/metadata-defaults.d.ts +2 -2
  373. package/dist/features/mentions/metadata-defaults.js +3 -9
  374. package/dist/features/mentions/metadata-defaults.js.map +1 -1
  375. package/dist/features/mentions/schema.d.ts +2 -1
  376. package/dist/features/mentions/schema.js.map +1 -1
  377. package/dist/features/tables/feature.d.ts +2 -1
  378. package/dist/features/tables/feature.js +90 -70
  379. package/dist/features/tables/feature.js.map +1 -1
  380. package/dist/features/themes/components/SettingsAppearanceTab.js +6 -9
  381. package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -1
  382. package/dist/features/themes/feature.js +2 -0
  383. package/dist/features/themes/feature.js.map +1 -1
  384. package/dist/features/themes/index.d.ts +2 -1
  385. package/dist/features/themes/react/SettingsAppearanceTab.js +7 -10
  386. package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -1
  387. package/dist/features/themes/schema.d.ts +2 -6
  388. package/dist/features/themes/schema.js.map +1 -1
  389. package/dist/features/themes/theme-runtime.d.ts +1 -1
  390. package/dist/features/themes/theme-runtime.js +4 -2
  391. package/dist/features/themes/theme-runtime.js.map +1 -1
  392. package/dist/features/transcript/TranscriptSegmentView.js +48 -28
  393. package/dist/features/transcript/TranscriptSegmentView.js.map +1 -1
  394. package/dist/features/transcript/feature.js +21 -19
  395. package/dist/features/transcript/feature.js.map +1 -1
  396. package/dist/features/transcript/react/TranscriptSegmentView.js +55 -36
  397. package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -1
  398. package/dist/features/transcript/segment-node.d.ts +2 -0
  399. package/dist/features/transcript/segment-node.js +35 -7
  400. package/dist/features/transcript/segment-node.js.map +1 -1
  401. package/dist/i18n/de/composites.js +91 -1
  402. package/dist/i18n/de/composites.js.map +1 -1
  403. package/dist/i18n/de/integrations.js +49 -8
  404. package/dist/i18n/de/integrations.js.map +1 -1
  405. package/dist/i18n/de/media.js +0 -1
  406. package/dist/i18n/de/media.js.map +1 -1
  407. package/dist/i18n/de/palette.js +22 -0
  408. package/dist/i18n/de/palette.js.map +1 -0
  409. package/dist/i18n/de/tables.js +0 -1
  410. package/dist/i18n/de/tables.js.map +1 -1
  411. package/dist/i18n/de/transcript.js +2 -1
  412. package/dist/i18n/de/transcript.js.map +1 -1
  413. package/dist/i18n/de/tree.js +3 -0
  414. package/dist/i18n/de/tree.js.map +1 -1
  415. package/dist/i18n/de.d.ts +157 -11
  416. package/dist/i18n/de.js +3 -1
  417. package/dist/i18n/de.js.map +1 -1
  418. package/dist/i18n/en/composites.js +89 -1
  419. package/dist/i18n/en/composites.js.map +1 -1
  420. package/dist/i18n/en/integrations.js +49 -8
  421. package/dist/i18n/en/integrations.js.map +1 -1
  422. package/dist/i18n/en/media.js +0 -1
  423. package/dist/i18n/en/media.js.map +1 -1
  424. package/dist/i18n/en/palette.js +22 -0
  425. package/dist/i18n/en/palette.js.map +1 -0
  426. package/dist/i18n/en/tables.js +0 -1
  427. package/dist/i18n/en/tables.js.map +1 -1
  428. package/dist/i18n/en/transcript.js +2 -1
  429. package/dist/i18n/en/transcript.js.map +1 -1
  430. package/dist/i18n/en/tree.js +3 -0
  431. package/dist/i18n/en/tree.js.map +1 -1
  432. package/dist/i18n/en.js +3 -1
  433. package/dist/i18n/en.js.map +1 -1
  434. package/dist/index.d.ts +4 -3
  435. package/dist/integrations/composite-ai/bibliography-fetch.d.ts +31 -0
  436. package/dist/integrations/composite-ai/bibliography-fetch.js +159 -0
  437. package/dist/integrations/composite-ai/bibliography-fetch.js.map +1 -0
  438. package/dist/integrations/composite-ai/composite-fill.d.ts +30 -8
  439. package/dist/integrations/composite-ai/composite-fill.js +97 -56
  440. package/dist/integrations/composite-ai/composite-fill.js.map +1 -1
  441. package/dist/integrations/composite-ai/composite-summary.d.ts +4 -12
  442. package/dist/integrations/composite-ai/composite-summary.js +7 -26
  443. package/dist/integrations/composite-ai/composite-summary.js.map +1 -1
  444. package/dist/integrations/composite-ai/derive.d.ts +29 -0
  445. package/dist/integrations/composite-ai/derive.js +173 -0
  446. package/dist/integrations/composite-ai/derive.js.map +1 -0
  447. package/dist/integrations/composite-ai/index.d.ts +11 -7
  448. package/dist/integrations/composite-ai/index.js +72 -14
  449. package/dist/integrations/composite-ai/index.js.map +1 -1
  450. package/dist/integrations/composite-ai/rendition.d.ts +45 -0
  451. package/dist/integrations/composite-ai/rendition.js +314 -0
  452. package/dist/integrations/composite-ai/rendition.js.map +1 -0
  453. package/dist/integrations/composite-media/index.d.ts +7 -5
  454. package/dist/integrations/composite-media/index.js +86 -13
  455. package/dist/integrations/composite-media/index.js.map +1 -1
  456. package/dist/integrations/transcript-ai/index.d.ts +1 -1
  457. package/dist/integrations/transcript-ai/index.js +5 -2
  458. package/dist/integrations/transcript-ai/index.js.map +1 -1
  459. package/dist/integrations/transcript-ai/protocol.d.ts +2 -12
  460. package/dist/integrations/transcript-ai/protocol.js +0 -2
  461. package/dist/integrations/transcript-ai/protocol.js.map +1 -1
  462. package/dist/integrations/transcript-ai/transcript-cleanup.d.ts +5 -5
  463. package/dist/integrations/transcript-ai/transcript-cleanup.js +7 -10
  464. package/dist/integrations/transcript-ai/transcript-cleanup.js.map +1 -1
  465. package/dist/markdown/MarkdownSurface.vue.d.ts +6 -5
  466. package/dist/markdown/MarkdownSurface2.js +3 -6
  467. package/dist/markdown/MarkdownSurface2.js.map +1 -1
  468. package/dist/markdown/document.js +1 -1
  469. package/dist/markdown/source-mode.d.ts +1 -1
  470. package/dist/nuxt/module.d.ts +1402 -54
  471. package/dist/nuxt/module.js +6 -49
  472. package/dist/nuxt/module.js.map +1 -1
  473. package/dist/nuxt/runtime/install-context.d.ts +7 -3
  474. package/dist/nuxt/runtime/install-context.js +14 -8
  475. package/dist/nuxt/runtime/install-context.js.map +1 -1
  476. package/dist/nuxt/runtime/plugins/editor-context-nuxt-ui.client.ts +2 -2
  477. package/dist/nuxt/runtime/server/plugins/editor-server.js +20 -12
  478. package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -1
  479. package/dist/presets/compose.d.ts +94 -0
  480. package/dist/presets/compose.js +164 -0
  481. package/dist/presets/compose.js.map +1 -0
  482. package/dist/react/AdvancedEditor.d.ts +15 -15
  483. package/dist/react/AdvancedEditor.js +15 -13
  484. package/dist/react/AdvancedEditor.js.map +1 -1
  485. package/dist/react/EditorCommandPalette.d.ts +13 -0
  486. package/dist/react/EditorCommandPalette.js +118 -0
  487. package/dist/react/EditorCommandPalette.js.map +1 -0
  488. package/dist/react/EditorSettingsModal.d.ts +5 -5
  489. package/dist/react/EditorSettingsModal.js +7 -4
  490. package/dist/react/EditorSettingsModal.js.map +1 -1
  491. package/dist/react/EditorSettingsPanel.d.ts +7 -7
  492. package/dist/react/EditorSettingsPanel.js +8 -5
  493. package/dist/react/EditorSettingsPanel.js.map +1 -1
  494. package/dist/react/EditorSurface.d.ts +7 -7
  495. package/dist/react/EditorSurface.js +10 -6
  496. package/dist/react/EditorSurface.js.map +1 -1
  497. package/dist/react/EditorToolbar.d.ts +4 -6
  498. package/dist/react/EditorToolbar.js +29 -37
  499. package/dist/react/EditorToolbar.js.map +1 -1
  500. package/dist/react/SimpleEditor.d.ts +22 -23
  501. package/dist/react/SimpleEditor.js +21 -7
  502. package/dist/react/SimpleEditor.js.map +1 -1
  503. package/dist/react/advanced.d.ts +4 -3
  504. package/dist/react/advanced.js +2 -2
  505. package/dist/react/compose.d.ts +20 -0
  506. package/dist/react/compose.js +49 -0
  507. package/dist/react/compose.js.map +1 -0
  508. package/dist/react/composed-surface.d.ts +39 -0
  509. package/dist/react/composed-surface.js +71 -0
  510. package/dist/react/composed-surface.js.map +1 -0
  511. package/dist/react/context.js +6 -2
  512. package/dist/react/context.js.map +1 -1
  513. package/dist/react/index.d.ts +2 -1
  514. package/dist/react/index.js +2 -1
  515. package/dist/react/key-labels.js +15 -0
  516. package/dist/react/key-labels.js.map +1 -0
  517. package/dist/react/settings.d.ts +1 -1
  518. package/dist/react/simple.d.ts +2 -2
  519. package/dist/react/ui/command.js +36 -1
  520. package/dist/react/ui/command.js.map +1 -1
  521. package/dist/schema/advanced.d.ts +6 -6
  522. package/dist/schema/advanced.js +26 -29
  523. package/dist/schema/advanced.js.map +1 -1
  524. package/dist/server/ai.d.ts +5 -16
  525. package/dist/server/ai.js.map +1 -1
  526. package/dist/server/auth.d.ts +9 -0
  527. package/dist/server/collab-state.d.ts +1 -1
  528. package/dist/server/collab-state.js.map +1 -1
  529. package/dist/server/collab.d.ts +13 -13
  530. package/dist/server/collab.js +34 -18
  531. package/dist/server/collab.js.map +1 -1
  532. package/dist/server/crossref.js +78 -0
  533. package/dist/server/crossref.js.map +1 -0
  534. package/dist/server/errors.d.ts +1 -1
  535. package/dist/server/errors.js +1 -1
  536. package/dist/server/errors.js.map +1 -1
  537. package/dist/server/extract.js +308 -0
  538. package/dist/server/extract.js.map +1 -0
  539. package/dist/{nuxt/runtime/server/utils/editor-route.js → server/h3.js} +8 -16
  540. package/dist/server/h3.js.map +1 -0
  541. package/dist/server/handlers/ai.d.ts +30 -9
  542. package/dist/server/handlers/ai.js +170 -36
  543. package/dist/server/handlers/ai.js.map +1 -1
  544. package/dist/server/handlers/context.d.ts +12 -5
  545. package/dist/server/handlers/context.js +10 -4
  546. package/dist/server/handlers/context.js.map +1 -1
  547. package/dist/server/handlers/editor.d.ts +19 -13
  548. package/dist/server/handlers/editor.js +49 -38
  549. package/dist/server/handlers/editor.js.map +1 -1
  550. package/dist/server/handlers/index.d.ts +4 -4
  551. package/dist/server/handlers/index.js +4 -4
  552. package/dist/server/host.d.ts +16 -25
  553. package/dist/server/host.js +58 -41
  554. package/dist/server/host.js.map +1 -1
  555. package/dist/server/index.d.ts +6 -4
  556. package/dist/server/index.js +3 -2
  557. package/dist/server/pdf.js +97 -0
  558. package/dist/server/pdf.js.map +1 -0
  559. package/dist/server/{adapter.d.ts → ports.d.ts} +81 -30
  560. package/dist/server/ports.js +29 -0
  561. package/dist/server/ports.js.map +1 -0
  562. package/dist/server/routes.js +144 -0
  563. package/dist/server/routes.js.map +1 -0
  564. package/dist/settings/index.d.ts +1 -1
  565. package/dist/settings/index.js.map +1 -1
  566. package/dist/styles/composites.css +25 -0
  567. package/dist/tree/DocumentTree.js +56 -29
  568. package/dist/tree/DocumentTree.js.map +1 -1
  569. package/dist/tree/react/DocumentTree.js +23 -0
  570. package/dist/tree/react/DocumentTree.js.map +1 -1
  571. package/dist/tree/tree-host.js +2 -2
  572. package/dist/tree/tree-items.js +1 -1
  573. package/dist/vue/AdvancedEditor.js +30 -9
  574. package/dist/vue/AdvancedEditor.js.map +1 -1
  575. package/dist/vue/AdvancedEditor.vue.d.ts +28 -8
  576. package/dist/vue/SimpleEditor.js +62 -16
  577. package/dist/vue/SimpleEditor.js.map +1 -1
  578. package/dist/vue/SimpleEditor.vue.d.ts +37 -7
  579. package/dist/vue/advanced.d.ts +3 -2
  580. package/dist/vue/advanced.js +2 -2
  581. package/dist/vue/components/EditorCommandPalette.js +91 -0
  582. package/dist/vue/components/EditorCommandPalette.js.map +1 -0
  583. package/dist/vue/components/EditorCommandPalette.vue.d.ts +15 -0
  584. package/dist/vue/components/EditorSettingsModal.js +10 -6
  585. package/dist/vue/components/EditorSettingsModal.js.map +1 -1
  586. package/dist/vue/components/EditorSettingsModal.vue.d.ts +4 -4
  587. package/dist/vue/components/EditorSettingsPanel.js +10 -6
  588. package/dist/vue/components/EditorSettingsPanel.js.map +1 -1
  589. package/dist/vue/components/EditorSettingsPanel.vue.d.ts +6 -6
  590. package/dist/vue/components/EditorSurface.js +11 -6
  591. package/dist/vue/components/EditorSurface.js.map +1 -1
  592. package/dist/vue/components/EditorSurface.vue.d.ts +7 -7
  593. package/dist/vue/components/EditorToolbar.js +41 -49
  594. package/dist/vue/components/EditorToolbar.js.map +1 -1
  595. package/dist/vue/components/EditorToolbar.vue.d.ts +2 -4
  596. package/dist/vue/compose.d.ts +17 -0
  597. package/dist/vue/compose.js +51 -0
  598. package/dist/vue/compose.js.map +1 -0
  599. package/dist/vue/context-key.d.ts +6 -0
  600. package/dist/vue/context-key.js +6 -0
  601. package/dist/vue/context-key.js.map +1 -0
  602. package/dist/vue/context.d.ts +8 -6
  603. package/dist/vue/context.js +6 -5
  604. package/dist/vue/context.js.map +1 -1
  605. package/dist/vue/index.d.ts +10 -8
  606. package/dist/vue/index.js +10 -8
  607. package/dist/vue/kit/index.d.ts +2 -2
  608. package/dist/vue/kit/nuxt-ui.js +23 -0
  609. package/dist/vue/kit/nuxt-ui.js.map +1 -1
  610. package/dist/vue/kit/types.d.ts +40 -1
  611. package/package.json +30 -16
  612. package/dist/adapters/comments/client.d.ts +0 -64
  613. package/dist/adapters/comments/client.js.map +0 -1
  614. package/dist/adapters/routes.js.map +0 -1
  615. package/dist/core/toolbar.d.ts +0 -74
  616. package/dist/core/toolbar.js +0 -45
  617. package/dist/core/toolbar.js.map +0 -1
  618. package/dist/integrations/composite-ai/document-transcribe.d.ts +0 -14
  619. package/dist/integrations/composite-ai/document-transcribe.js +0 -89
  620. package/dist/integrations/composite-ai/document-transcribe.js.map +0 -1
  621. package/dist/nuxt/runtime/server/api/ai/chat.post.d.ts +0 -5
  622. package/dist/nuxt/runtime/server/api/ai/chat.post.js +0 -8
  623. package/dist/nuxt/runtime/server/api/ai/chat.post.js.map +0 -1
  624. package/dist/nuxt/runtime/server/api/ai/complete.post.d.ts +0 -5
  625. package/dist/nuxt/runtime/server/api/ai/complete.post.js +0 -8
  626. package/dist/nuxt/runtime/server/api/ai/complete.post.js.map +0 -1
  627. package/dist/nuxt/runtime/server/api/ai/generate.post.d.ts +0 -5
  628. package/dist/nuxt/runtime/server/api/ai/generate.post.js +0 -8
  629. package/dist/nuxt/runtime/server/api/ai/generate.post.js.map +0 -1
  630. package/dist/nuxt/runtime/server/api/ai/models.get.d.ts +0 -5
  631. package/dist/nuxt/runtime/server/api/ai/models.get.js +0 -8
  632. package/dist/nuxt/runtime/server/api/ai/models.get.js.map +0 -1
  633. package/dist/nuxt/runtime/server/api/ai/transcribe.post.d.ts +0 -5
  634. package/dist/nuxt/runtime/server/api/ai/transcribe.post.js +0 -8
  635. package/dist/nuxt/runtime/server/api/ai/transcribe.post.js.map +0 -1
  636. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.d.ts +0 -5
  637. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js +0 -8
  638. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js.map +0 -1
  639. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.d.ts +0 -5
  640. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js +0 -8
  641. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js.map +0 -1
  642. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.d.ts +0 -5
  643. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js +0 -8
  644. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js.map +0 -1
  645. package/dist/nuxt/runtime/server/api/editor/settings.get.d.ts +0 -5
  646. package/dist/nuxt/runtime/server/api/editor/settings.get.js +0 -8
  647. package/dist/nuxt/runtime/server/api/editor/settings.get.js.map +0 -1
  648. package/dist/nuxt/runtime/server/api/editor/settings.put.d.ts +0 -5
  649. package/dist/nuxt/runtime/server/api/editor/settings.put.js +0 -8
  650. package/dist/nuxt/runtime/server/api/editor/settings.put.js.map +0 -1
  651. package/dist/nuxt/runtime/server/api/editor/tags.get.d.ts +0 -5
  652. package/dist/nuxt/runtime/server/api/editor/tags.get.js +0 -8
  653. package/dist/nuxt/runtime/server/api/editor/tags.get.js.map +0 -1
  654. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.d.ts +0 -5
  655. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js +0 -8
  656. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js.map +0 -1
  657. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.d.ts +0 -5
  658. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js +0 -8
  659. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js.map +0 -1
  660. package/dist/nuxt/runtime/server/api/editor/themes/index.get.d.ts +0 -5
  661. package/dist/nuxt/runtime/server/api/editor/themes/index.get.js +0 -8
  662. package/dist/nuxt/runtime/server/api/editor/themes/index.get.js.map +0 -1
  663. package/dist/nuxt/runtime/server/api/editor/themes/index.post.d.ts +0 -5
  664. package/dist/nuxt/runtime/server/api/editor/themes/index.post.js +0 -8
  665. package/dist/nuxt/runtime/server/api/editor/themes/index.post.js.map +0 -1
  666. package/dist/nuxt/runtime/server/api/editor/users.get.d.ts +0 -5
  667. package/dist/nuxt/runtime/server/api/editor/users.get.js +0 -8
  668. package/dist/nuxt/runtime/server/api/editor/users.get.js.map +0 -1
  669. package/dist/nuxt/runtime/server/plugins/collab.d.ts +0 -5
  670. package/dist/nuxt/runtime/server/plugins/collab.js +0 -10
  671. package/dist/nuxt/runtime/server/plugins/collab.js.map +0 -1
  672. package/dist/nuxt/runtime/server/routes/collab/[id].d.ts +0 -5
  673. package/dist/nuxt/runtime/server/routes/collab/[id].js +0 -35
  674. package/dist/nuxt/runtime/server/routes/collab/[id].js.map +0 -1
  675. package/dist/nuxt/runtime/server/utils/editor-route.d.ts +0 -11
  676. package/dist/nuxt/runtime/server/utils/editor-route.js.map +0 -1
  677. package/dist/presets/advanced.d.ts +0 -33
  678. package/dist/presets/advanced.js +0 -50
  679. package/dist/presets/advanced.js.map +0 -1
  680. package/dist/presets/simple.d.ts +0 -9
  681. package/dist/presets/simple.js +0 -12
  682. package/dist/presets/simple.js.map +0 -1
  683. package/dist/react/advanced-preset.d.ts +0 -11
  684. package/dist/react/advanced-preset.js +0 -31
  685. package/dist/react/advanced-preset.js.map +0 -1
  686. package/dist/vue/advanced-preset.d.ts +0 -13
  687. package/dist/vue/advanced-preset.js +0 -33
  688. package/dist/vue/advanced-preset.js.map +0 -1
  689. package/docs/extending.md +0 -538
  690. package/docs/integration.md +0 -632
  691. package/docs/llms.md +0 -383
  692. package/docs/usage.md +0 -1076
@@ -1,64 +0,0 @@
1
- import { AuthorIdentity } from "../../core/feature.js";
2
- import "../../core/index.js";
3
- import { CommentsModel } from "../../features/comments/model.js";
4
- import "../../features/comments/index.js";
5
- import { Editor } from "@tiptap/core";
6
- //#region src/adapters/comments/client.d.ts
7
- /** The part of a `Response` the model reads; `globalThis.fetch` fits. */
8
- export interface CommentsFetchResponse {
9
- ok: boolean;
10
- status: number;
11
- json(): Promise<unknown>;
12
- }
13
- export type CommentsFetch = (url: string, init?: {
14
- method?: string;
15
- headers?: Record<string, string>;
16
- body?: string;
17
- }) => Promise<CommentsFetchResponse>;
18
- export interface RestCommentsModelOptions {
19
- /** How requests are sent: `globalThis.fetch`, or a wrapper that adds the base URL and credentials. */
20
- fetch: CommentsFetch;
21
- /** The document the threads belong to. */
22
- documentId: string;
23
- /** The document's comments endpoint (`GET` → `Discussion`, `POST` → `CommentAction`); default `/comments/<encoded documentId>`. */
24
- endpoint?: string;
25
- /** Who writes: the author of new comments and the only one who may edit or delete them; `null` while nobody is signed in (no comments then). */
26
- user: AuthorIdentity | null | (() => AuthorIdentity | null);
27
- /** Whether the user may compose and change comments now; readers of a read-only document may be allowed. */
28
- canComment: boolean | (() => boolean);
29
- /** The editor the threads belong to; may return no editor yet or a destroyed one. */
30
- getEditor: () => Editor | undefined;
31
- /** Milliseconds a changed anchor waits before it is written back (typing moves many); default 500. `idle()` writes at once. */
32
- persistDelay?: number;
33
- /** Called with every failed request; the model reloads the threads afterwards, so the local state falls back to the server's. */
34
- onError?: (error: Error) => void;
35
- }
36
- export interface RestCommentsModel extends CommentsModel {
37
- /** Fetches the threads again and resolves their anchors against the current document. */
38
- reload(): Promise<void>;
39
- /** Resolves once every change made so far has been sent (and the threads loaded, if a load was requested). */
40
- idle(): Promise<void>;
41
- }
42
- /**
43
- * The comments of one editor over a REST endpoint, as a `CommentsModel` (the host passes `() => model` as the
44
- * `model` factory of `commentsFeature`/`commentsFeatureCore`; one instance serves the plugin and every hook).
45
- *
46
- * - **Load.** `refresh()` (called by the feature once the editor exists) fetches `GET endpoint`; each annotation's
47
- * anchor is resolved against the document (exact offsets, else quote and context search). An anchor that moved is
48
- * re-captured and written back; an anchor whose text is gone becomes an `orphan` (the thread stays, without a range)
49
- * and an orphan whose text is back with the same surroundings is re-attached. While the document is still empty the
50
- * resolving waits for its content.
51
- * - **Edits.** Every transaction carries all anchors with it (`mapAnchor`), so ranges, quotes and contexts follow the
52
- * text; changed anchors are written back after `persistDelay`. Text deleted under an anchor orphans it for good (it is
53
- * never silently re-attached to other text during editing; `reload()` re-attaches it when its text and context
54
- * are found again, e.g. after the content was replaced).
55
- * - **Writes** are applied locally at once and sent in order; a failed request is reported to `onError` and the threads
56
- * are reloaded. Without a `user` or while `canComment` is false nothing is written. Only the author may edit or
57
- * delete a comment.
58
- * - **Lifecycle.** The model follows the editor `getEditor` names until that editor is destroyed; `dispose()` writes
59
- * pending anchor changes and does not stop it (the feature and its hooks share the instance and dispose it on their
60
- * own schedule).
61
- */
62
- export declare function createRestCommentsModel(options: RestCommentsModelOptions): RestCommentsModel;
63
- //#endregion
64
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","names":[],"sources":["../../../src/adapters/comments/client.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport type { Transaction } from '@tiptap/pm/state'\nimport { type AuthorIdentity, createStore, releaseRanges, resolveRange } from '../../core'\nimport { cancelCommentDraft, COMMENT_LIMITS, type CommentReply, type CommentsModel, type CommentsSnapshot, type CommentThread as EditorThread, commentsKey, type DocRange, setActiveComment, startCommentDraft } from '../../features/comments'\nimport { EMPTY_SNAPSHOT, NO_POSITIONS, NO_RANGES, NO_THREADS, sameOrphanAt, sameRange, sameRanges, sameUser } from '../../features/comments/snapshot-equality'\nimport { captureAnchor, capturePoint, type PortableAnchor, resolveAnchor, mapAnchor } from '../anchors'\nimport type { Annotation, Comment, CommentAction, CommentThread, Discussion } from './types'\n\n// A `CommentsModel` for the editor's comments feature (`commentsFeature({ model })`) whose threads live behind a REST\n// endpoint (`handleCommentsRequest` serves it) instead of the document's Y.Doc. The text a thread hangs on is a\n// portable anchor (`../anchors`), not a `comment` mark: anchors are resolved against the document when the threads\n// load, follow every edit of the editor, and are written back to the endpoint when they moved.\n\n/** The part of a `Response` the model reads; `globalThis.fetch` fits. */\nexport interface CommentsFetchResponse {\n ok: boolean\n status: number\n json(): Promise<unknown>\n}\n\nexport type CommentsFetch = (url: string, init?: { method?: string, headers?: Record<string, string>, body?: string }) => Promise<CommentsFetchResponse>\n\nexport interface RestCommentsModelOptions {\n /** How requests are sent: `globalThis.fetch`, or a wrapper that adds the base URL and credentials. */\n fetch: CommentsFetch\n /** The document the threads belong to. */\n documentId: string\n /** The document's comments endpoint (`GET` → `Discussion`, `POST` → `CommentAction`); default `/comments/<encoded documentId>`. */\n endpoint?: string\n /** Who writes: the author of new comments and the only one who may edit or delete them; `null` while nobody is signed in (no comments then). */\n user: AuthorIdentity | null | (() => AuthorIdentity | null)\n /** Whether the user may compose and change comments now; readers of a read-only document may be allowed. */\n canComment: boolean | (() => boolean)\n /** The editor the threads belong to; may return no editor yet or a destroyed one. */\n getEditor: () => Editor | undefined\n /** Milliseconds a changed anchor waits before it is written back (typing moves many); default 500. `idle()` writes at once. */\n persistDelay?: number\n /** Called with every failed request; the model reloads the threads afterwards, so the local state falls back to the server's. */\n onError?: (error: Error) => void\n}\n\nexport interface RestCommentsModel extends CommentsModel {\n /** Fetches the threads again and resolves their anchors against the current document. */\n reload(): Promise<void>\n /** Resolves once every change made so far has been sent (and the threads loaded, if a load was requested). */\n idle(): Promise<void>\n}\n\n/** Neutral colour of authors that stored no colour. */\nconst FALLBACK_COLOR = '#6b7280'\n/** Characters of context that must agree for an orphan to be re-attached on load. */\nconst REATTACH_CONTEXT = 24\n\nconst newId = (prefix: string) => `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`\n/** The `error` message of a refused request's JSON body. */\nfunction errorOf(body: unknown): unknown {\n return typeof body === 'object' && body !== null && 'error' in body ? body.error : undefined\n}\n\nfunction isDiscussion(value: unknown): value is Discussion {\n return typeof value === 'object' && value !== null && 'annotations' in value && Array.isArray(value.annotations) && 'threads' in value && Array.isArray(value.threads)\n}\n\nconst sameJson = (a: unknown, b: unknown) => JSON.stringify(a) === JSON.stringify(b)\n\nconst authorOf = (comment: Comment): EditorThread['author'] => ({ id: comment.authorId, name: comment.authorName ?? comment.authorId, color: comment.authorColor ?? FALLBACK_COLOR })\n\nfunction quoteOf(anchor: PortableAnchor | undefined): string {\n if (!anchor) return ''\n if (anchor.kind === 'range') return anchor.quote\n if (anchor.kind === 'orphan') return anchor.quote ?? (anchor.previous.kind === 'range' ? anchor.previous.quote : '')\n return ''\n}\n\nfunction viewOf(thread: CommentThread, anchor: PortableAnchor | undefined): EditorThread {\n const [first, ...replies] = thread.comments\n return {\n id: thread.id,\n author: first ? authorOf(first) : { id: '', name: '', color: FALLBACK_COLOR },\n text: first?.body ?? '',\n createdAt: first?.createdAt ?? '',\n ...(first?.editedAt !== undefined && { editedAt: first.editedAt }),\n quote: quoteOf(anchor),\n resolved: thread.status === 'resolved',\n replies: replies.map((reply): CommentReply => ({\n id: reply.id,\n author: authorOf(reply),\n text: reply.body,\n createdAt: reply.createdAt,\n ...(reply.editedAt !== undefined && { editedAt: reply.editedAt }),\n })),\n }\n}\n\nfunction rangeOf(anchor: PortableAnchor | undefined): DocRange | null {\n if (!anchor || anchor.kind === 'orphan') return null\n return anchor.kind === 'range' ? { from: anchor.from, to: anchor.to } : { from: anchor.position, to: anchor.position }\n}\n\n/** A document is \"empty\" while the host has not put its content in yet: nothing to resolve anchors against. */\nconst isBlank = (doc: { textContent: string }) => doc.textContent === ''\n\n/** Whether the text at `candidate` still reads like the context `previous` was written in (one side suffices). */\nfunction contextAgrees(candidate: PortableAnchor, previous: PortableAnchor): boolean {\n if (candidate.kind === 'orphan' || previous.kind === 'orphan') return false\n const before = previous.contextBefore?.slice(-REATTACH_CONTEXT)\n const after = previous.contextAfter?.slice(0, REATTACH_CONTEXT)\n if (!before && !after) return true\n return (!!before && !!candidate.contextBefore?.endsWith(before)) || (!!after && !!candidate.contextAfter?.startsWith(after))\n}\n\n/**\n * The comments of one editor over a REST endpoint, as a `CommentsModel` (the host passes `() => model` as the\n * `model` factory of `commentsFeature`/`commentsFeatureCore`; one instance serves the plugin and every hook).\n *\n * - **Load.** `refresh()` (called by the feature once the editor exists) fetches `GET endpoint`; each annotation's\n * anchor is resolved against the document (exact offsets, else quote and context search). An anchor that moved is\n * re-captured and written back; an anchor whose text is gone becomes an `orphan` (the thread stays, without a range)\n * and an orphan whose text is back with the same surroundings is re-attached. While the document is still empty the\n * resolving waits for its content.\n * - **Edits.** Every transaction carries all anchors with it (`mapAnchor`), so ranges, quotes and contexts follow the\n * text; changed anchors are written back after `persistDelay`. Text deleted under an anchor orphans it for good (it is\n * never silently re-attached to other text during editing; `reload()` re-attaches it when its text and context\n * are found again, e.g. after the content was replaced).\n * - **Writes** are applied locally at once and sent in order; a failed request is reported to `onError` and the threads\n * are reloaded. Without a `user` or while `canComment` is false nothing is written. Only the author may edit or\n * delete a comment.\n * - **Lifecycle.** The model follows the editor `getEditor` names until that editor is destroyed; `dispose()` writes\n * pending anchor changes and does not stop it (the feature and its hooks share the instance and dispose it on their\n * own schedule).\n */\nexport function createRestCommentsModel(options: RestCommentsModelOptions): RestCommentsModel {\n const { fetch, documentId, getEditor, onError } = options\n const endpoint = options.endpoint ?? `/comments/${encodeURIComponent(documentId)}`\n const persistDelay = options.persistDelay ?? 500\n const store = createStore<CommentsSnapshot>(EMPTY_SNAPSHOT)\n\n const userNow = () => (typeof options.user === 'function' ? options.user() : options.user)\n const canCommentNow = () => (typeof options.canComment === 'function' ? options.canComment() : options.canComment)\n /** Editors that announced their destruction: their view is still alive while `destroy` is emitted. */\n const gone = new WeakSet<Editor>()\n const current = () => {\n const instance = getEditor()\n return instance && !instance.isDestroyed && !gone.has(instance) ? instance : undefined\n }\n\n // -- Data: what the endpoint holds (annotation anchors are the local truth until written back) -----------------------\n let threads: readonly CommentThread[] = []\n let anchors = new Map<string, PortableAnchor>()\n /** The anchor each annotation has on the server, serialised. */\n const persisted = new Map<string, string>()\n const dirty = new Set<string>()\n /**\n * Where the text of an annotation that became an orphan during this session was: the deletion point, mapped through\n * every later edit. Keyed by annotation id (`orphanAt` in the snapshot is keyed by thread id; `orphanPositions` translates).\n * Deletion points are session-local: `load()` clears them, and an anchor that arrives already orphaned has none, because\n * the server stores no deletion point. Such threads get no `orphanAt` entry and sit after the placed ones in the margin.\n */\n const deletedAt = new Map<string, number>()\n /** Anchors wait for the document content (resolve on load) before they get a range. */\n let unresolved = false\n /** A load was requested / the first one succeeded: writes wait for it, so a load never overwrites a newer local change. */\n let loaded = false\n let ready = false\n\n // -- Requests: one queue, so a reply never overtakes its thread's creation ---------------------------------------------\n let chain: Promise<void> = Promise.resolve()\n let timer: ReturnType<typeof setTimeout> | undefined\n\n function enqueue(task: () => Promise<void>, reloadOnError = true): void {\n chain = chain.then(task).catch((error: unknown) => {\n onError?.(error instanceof Error ? error : new Error(String(error)))\n if (reloadOnError) enqueue(load, false)\n })\n }\n\n async function request(init?: { method: string, body: CommentAction }): Promise<unknown> {\n const response = await fetch(endpoint, init && { method: init.method, headers: { 'content-type': 'application/json' }, body: JSON.stringify(init.body) })\n if (!response.ok) {\n const detail = await response.json().then(errorOf, () => undefined)\n throw new Error(`@ecsplico/editor: comments request ${init?.method ?? 'GET'} ${endpoint} failed: ${response.status}${typeof detail === 'string' ? ` ${detail}` : ''}`)\n }\n return response.json()\n }\n\n const send = (body: CommentAction) => enqueue(async () => void await request({ method: 'POST', body }))\n\n function writeAnchors(): void {\n timer = undefined\n if (!userNow() || !ready || !canCommentNow()) {\n dirty.clear()\n return\n }\n for (const id of dirty) {\n const anchor = anchors.get(id)\n const threadId = threads.find(thread => thread.annotationId === id)?.id\n if (!anchor || !threadId || persisted.get(id) === JSON.stringify(anchor)) continue\n persisted.set(id, JSON.stringify(anchor))\n send({ action: 'update-annotation', annotation: { id, threadId, anchor } })\n }\n dirty.clear()\n }\n\n function markDirty(id: string): void {\n dirty.add(id)\n if (timer === undefined) timer = setTimeout(writeAnchors, persistDelay)\n }\n\n function flush(): void {\n clearTimeout(timer)\n writeAnchors()\n }\n\n // -- Anchors ------------------------------------------------------------------------------------------------------------\n\n /** `anchor` read against `editor`'s document: the moved/re-captured anchor, an orphan, or the same object. */\n function resolveOne(editor: Editor, anchor: PortableAnchor): PortableAnchor {\n const live = anchor.kind === 'orphan' ? anchor.previous : anchor\n const found = resolveAnchor(editor.state.doc, live)\n if (!found) {\n return anchor.kind === 'orphan'\n ? anchor\n : { kind: 'orphan', previous: anchor, quote: quoteOf(anchor) || undefined, contextBefore: anchor.contextBefore, contextAfter: anchor.contextAfter, reason: 'unresolvable' }\n }\n const next = live.kind === 'range' ? captureAnchor(editor, found) : capturePoint(editor, found.from)\n if (anchor.kind === 'orphan' && !contextAgrees(next, live)) return anchor\n return sameJson(next, anchor) ? anchor : next\n }\n\n function resolveAll(editor: Editor): void {\n if (isBlank(editor.state.doc)) {\n unresolved = anchors.size > 0\n return\n }\n unresolved = false\n for (const [id, anchor] of anchors) {\n const next = resolveOne(editor, anchor)\n if (next !== anchor) {\n anchors.set(id, next)\n if (next.kind !== 'orphan') deletedAt.delete(id)\n markDirty(id)\n }\n }\n }\n\n function carry(transactions: readonly Transaction[]): void {\n for (const transaction of transactions) {\n if (!transaction.docChanged) continue\n for (const [id, position] of deletedAt) deletedAt.set(id, transaction.mapping.map(position, 1))\n for (const [id, anchor] of anchors) {\n const next = mapAnchor(anchor, transaction)\n if (next !== anchor) {\n anchors.set(id, next)\n if (next.kind === 'orphan' && anchor.kind !== 'orphan') {\n deletedAt.set(id, transaction.mapping.map(anchor.kind === 'range' ? anchor.from : anchor.position, 1))\n }\n markDirty(id)\n }\n }\n }\n }\n\n // -- Snapshot -----------------------------------------------------------------------------------------------------------\n\n function rangesOf(editor: Editor | undefined): ReadonlyMap<string, DocRange> {\n if (!editor || unresolved) return NO_RANGES\n const size = editor.state.doc.content.size\n const ranges = new Map<string, DocRange>()\n for (const thread of threads) {\n const range = rangeOf(anchors.get(thread.annotationId))\n if (range && range.from <= size) ranges.set(thread.id, { from: range.from, to: Math.min(range.to, size) })\n }\n return ranges\n }\n\n /**\n * The snapshot's `orphanAt`, keyed by thread id: where each open thread without a text range was, read from `deletedAt`\n * (keyed by annotation id). Empty when there is no tracked deletion point; threads loaded already orphaned never have one\n * (the server stores none) and are left out, so they sit after the placed ones in the margin.\n */\n function orphanPositions(editor: Editor | undefined, ranges: ReadonlyMap<string, DocRange>): ReadonlyMap<string, number> {\n if (!editor || unresolved || deletedAt.size === 0) return NO_POSITIONS\n const size = editor.state.doc.content.size\n let found: Map<string, number> | undefined\n for (const thread of threads) {\n if (thread.status === 'resolved' || ranges.has(thread.id)) continue\n const position = deletedAt.get(thread.annotationId)\n if (position !== undefined && position <= size) (found ??= new Map()).set(thread.id, position)\n }\n return found ?? NO_POSITIONS\n }\n\n function recompute(): void {\n const editor = current()\n const previous = store.get()\n const user = userNow()\n const available = user !== null\n const canComment = available && ready && canCommentNow()\n const views = threads.map(thread => viewOf(thread, anchors.get(thread.annotationId)))\n const nextRanges = rangesOf(editor)\n const ranges = sameRanges(nextRanges, previous.ranges) ? previous.ranges : nextRanges\n const nextOrphanAt = orphanPositions(editor, ranges)\n const orphanAt = sameOrphanAt(nextOrphanAt, previous.orphanAt) ? previous.orphanAt : nextOrphanAt\n const plugin = editor && commentsKey.getState(editor.state)\n const active = plugin?.active ?? null\n const anchor = plugin?.draft\n const draft = editor && anchor ? resolveRange(editor.state, anchor) : null\n const draftQuote = editor && draft ? editor.state.doc.textBetween(draft.from, draft.to, ' ').slice(0, COMMENT_LIMITS.quote) : ''\n const sameViews = (views.length === previous.threads.length && views.every((view, index) => sameJson(view, previous.threads[index])))\n const threadsOut = sameViews ? previous.threads : views\n\n if (\n available === previous.available && canComment === previous.canComment && sameUser(user, previous.user) && threadsOut === previous.threads\n && ranges === previous.ranges && orphanAt === previous.orphanAt && active === previous.active && sameRange(draft, previous.draft) && draftQuote === previous.draftQuote\n ) return\n\n const kept = threadsOut === previous.threads && ranges === previous.ranges\n store.set({\n available,\n canComment,\n user,\n threads: threadsOut,\n ranges,\n orphanAt,\n active,\n draft: sameRange(draft, previous.draft) ? previous.draft : draft,\n draftQuote,\n open: kept\n ? previous.open\n : threadsOut\n .filter(thread => !thread.resolved)\n .sort((a, b) => (ranges.get(a.id)?.from ?? Infinity) - (ranges.get(b.id)?.from ?? Infinity) || a.createdAt.localeCompare(b.createdAt)),\n resolved: threadsOut === previous.threads ? previous.resolved : threadsOut.filter(thread => thread.resolved).sort((a, b) => b.createdAt.localeCompare(a.createdAt)),\n })\n }\n\n // -- Editor binding -----------------------------------------------------------------------------------------------------\n\n let bound: Editor | undefined\n\n function onTransaction({ transaction, appendedTransactions }: { transaction: Transaction, appendedTransactions?: readonly Transaction[] }): void {\n const editor = bound\n if (editor && anchors.size) {\n const all = [transaction, ...(appendedTransactions ?? [])]\n if (all.some(tr => tr.docChanged)) {\n if (isBlank(editor.state.doc)) unresolved = true\n else if (unresolved) resolveAll(editor)\n else carry(all)\n }\n }\n recompute()\n }\n\n function onDestroy(): void {\n if (bound) gone.add(bound)\n unbind()\n recompute()\n }\n\n function unbind(): void {\n bound?.off('transaction', onTransaction)\n bound?.off('update', recompute)\n bound?.off('destroy', onDestroy)\n bound = undefined\n }\n\n function refresh(): void {\n const editor = current()\n if (editor !== bound) {\n unbind()\n bound = editor\n editor?.on('transaction', onTransaction)\n // `setEditable` emits `update` only, and `canComment` may follow it.\n editor?.on('update', recompute)\n editor?.on('destroy', onDestroy)\n if (editor && loaded) resolveAll(editor)\n }\n if (!loaded) {\n loaded = true\n enqueue(load, false)\n }\n recompute()\n }\n\n function dispose(): void {\n flush()\n }\n\n async function load(): Promise<void> {\n const discussion = await request()\n if (!isDiscussion(discussion)) throw new Error(`@ecsplico/editor: comments request GET ${endpoint} did not answer a discussion`)\n threads = discussion.threads\n anchors = new Map(discussion.annotations.map((annotation: Annotation) => [annotation.id, annotation.anchor]))\n persisted.clear()\n for (const [id, anchor] of anchors) persisted.set(id, JSON.stringify(anchor))\n dirty.clear()\n deletedAt.clear()\n ready = true\n const editor = current()\n unresolved = anchors.size > 0\n if (editor) resolveAll(editor)\n recompute()\n }\n\n function reload(): Promise<void> {\n flush()\n loaded = true\n enqueue(load, false)\n return idle()\n }\n\n async function idle(): Promise<void> {\n flush()\n const seen = chain\n await seen\n // A request that failed queued a reload, a finished one may have moved anchors.\n if (chain !== seen || timer !== undefined || dirty.size > 0) await idle()\n }\n\n // -- Mutations ----------------------------------------------------------------------------------------------------------\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 writer(): AuthorIdentity | null {\n const user = userNow()\n return user && ready && canCommentNow() ? user : null\n }\n\n const commentOf = (user: AuthorIdentity, body: string): Comment => ({ id: newId('cm'), body, authorId: user.id, authorName: user.name, authorColor: user.color, createdAt: new Date().toISOString() })\n\n function setThreads(next: readonly CommentThread[]): void {\n threads = next\n recompute()\n }\n\n const threadById = (id: string) => threads.find(thread => thread.id === id)\n\n function replaceThread(id: string, change: (thread: CommentThread) => CommentThread): void {\n setThreads(threads.map(thread => (thread.id === id ? change(thread) : thread)))\n }\n\n function add(text: string): string | null {\n const editor = current()\n const user = writer()\n const body = clean(text)\n const draft = editor && commentsKey.getState(editor.state)?.draft\n const range = editor && draft ? resolveRange(editor.state, draft) : null\n if (!editor || !user || !draft || !range || range.from >= range.to || !body) return null\n const threadId = newId('ct')\n const annotation: Annotation = { id: newId('ca'), threadId, anchor: captureAnchor(editor, range) }\n const comment = commentOf(user, body)\n editor.view.dispatch(editor.state.tr.setMeta(commentsKey, { draft: null, active: threadId }).setMeta('addToHistory', false))\n releaseRanges(editor, [draft])\n anchors.set(annotation.id, annotation.anchor)\n persisted.set(annotation.id, JSON.stringify(annotation.anchor))\n threads = [...threads, { id: threadId, annotationId: annotation.id, status: 'open', comments: [comment] }]\n recompute()\n send({ action: 'create', annotation, thread: { id: threadId, annotationId: annotation.id, initialComment: comment } })\n return threadId\n }\n\n function reply(threadId: string, text: string): void {\n const user = writer()\n const body = clean(text)\n if (!user || !body || !threadById(threadId)) return\n const comment = commentOf(user, body)\n replaceThread(threadId, thread => ({ ...thread, comments: [...thread.comments, comment] }))\n send({ action: 'reply', threadId, comment })\n }\n\n function edit(threadId: string, replyId: string | null, text: string): void {\n const user = writer()\n const body = clean(text)\n const thread = threadById(threadId)\n const target = thread && (replyId === null ? thread.comments[0] : thread.comments.find(comment => comment.id === replyId))\n if (!user || !body || !thread || !target || target.authorId !== user.id || target.body === body) return\n const editedAt = new Date().toISOString()\n replaceThread(threadId, item => ({ ...item, comments: item.comments.map(comment => (comment.id === target.id ? { ...comment, body, editedAt } : comment)) }))\n send({ action: 'edit', threadId, commentId: target.id, body, editedAt })\n }\n\n const activeThread = () => {\n const editor = current()\n return editor ? commentsKey.getState(editor.state)?.active ?? null : null\n }\n\n function setResolved(threadId: string, resolved: boolean): void {\n const thread = threadById(threadId)\n if (!writer() || !thread || (thread.status === 'resolved') === resolved) return\n const status = resolved ? 'resolved' : 'open'\n replaceThread(threadId, item => ({ ...item, status }))\n if (resolved && activeThread() === threadId) activate(null)\n send({ action: 'status', threadId, status })\n }\n\n function remove(threadId: string): void {\n const user = writer()\n const thread = threadById(threadId)\n if (!user || !thread || thread.comments[0]?.authorId !== user.id) return\n if (activeThread() === threadId) activate(null)\n anchors.delete(thread.annotationId)\n persisted.delete(thread.annotationId)\n dirty.delete(thread.annotationId)\n deletedAt.delete(thread.annotationId)\n setThreads(threads.filter(item => item.id !== threadId))\n send({ action: 'remove', threadId })\n }\n\n function removeReply(threadId: string, replyId: string): void {\n const user = writer()\n const thread = threadById(threadId)\n const target = thread?.comments.slice(1).find(comment => comment.id === replyId)\n if (!user || !thread || !target || target.authorId !== user.id) return\n replaceThread(threadId, item => ({ ...item, comments: item.comments.filter(comment => comment.id !== replyId) }))\n send({ action: 'remove-comment', threadId, commentId: replyId })\n }\n\n function activate(id: string | null, activateOptions: { reveal?: boolean } = {}): void {\n const editor = current()\n if (editor) setActiveComment(editor, id, activateOptions)\n }\n\n function startDraft(): void {\n const editor = current()\n if (editor && writer()) startCommentDraft(editor)\n }\n\n function cancelDraft(): void {\n const editor = current()\n if (editor) cancelCommentDraft(editor)\n }\n\n return { state: store, refresh, dispose, add, reply, edit, setResolved, remove, removeReply, activate, startDraft, cancelDraft,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vB,IAAI,QAAQ,iBAAiB,QAAQ,IAAI,eAAe;CAC1D;CAEA,SAAS,aAAmB;EAC1B,MAAM,SAAS,QAAQ;EACvB,IAAI,UAAU,OAAO,GAAG,kBAAkB,MAAM;CAClD;CAEA,SAAS,cAAoB;EAC3B,MAAM,SAAS,QAAQ;EACvB,IAAI,QAAQ,mBAAmB,MAAM;CACvC;CAEA,OAAO;EAAE,OAAO;EAAO;EAAS;EAAS;EAAK;EAAO;EAAM;EAAa;EAAQ;EAAa;EAAU;EAAY;EAAa;EAAQ;CAAK;AAC/I"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"routes.js","names":[],"sources":["../../src/adapters/routes.ts"],"sourcesContent":["// The wire paths shared by the Nitro host (`./server/nitro`) and the Vue composable (`./vue`). The editor's own\n// client calls the `/api/editor/*` and `/api/ai/*` paths of `@ecsplico/editor`; the two document paths below are this\n// package's contract between the two entries. Pure strings: this module imports nothing, so neither entry drags the\n// other's framework in.\n\nexport const EDITOR_API = '/api/editor'\nexport const AI_API = '/api/ai'\nexport const COLLAB_PATH = '/collab'\n\n/** Route pattern of a document's content (`GET` → TipTap JSON, `PUT` → stores it). */\nexport const DOCUMENT_ROUTE = `${EDITOR_API}/documents/:id`\n/** Route pattern of a document's comments endpoint (`handleCommentsRequest`). */\nexport const COMMENTS_ROUTE = `${EDITOR_API}/comments/:id`\n\n/** The content URL of document `id`. */\nexport const documentUrl = (id: string) => DOCUMENT_ROUTE.replace(':id', encodeURIComponent(id))\n/** The comments URL of document `id`. */\nexport const commentsUrl = (id: string) => COMMENTS_ROUTE.replace(':id', encodeURIComponent(id))\n"],"mappings":";AAKA,MAAa,aAAa;AAC1B,MAAa,SAAS;AACtB,MAAa,cAAc;;AAG3B,MAAa,iBAAiB,GAAG,WAAW;;AAE5C,MAAa,iBAAiB,GAAG,WAAW;;AAG5C,MAAa,eAAe,OAAe,eAAe,QAAQ,OAAO,mBAAmB,EAAE,CAAC;;AAE/F,MAAa,eAAe,OAAe,eAAe,QAAQ,OAAO,mBAAmB,EAAE,CAAC"}
@@ -1,74 +0,0 @@
1
- import { Ability } from "./schema/abilities.js";
2
- import { ChainedCommands, Editor } from "@tiptap/core";
3
- //#region src/core/toolbar.d.ts
4
- /** One row of a dropdown a toolbar item or block action opens; the framework layer renders it. */
5
- export interface MenuItem {
6
- type?: 'label' | 'separator';
7
- label?: string;
8
- description?: string;
9
- /** Iconify name, e.g. `i-lucide-heading-1`. */
10
- icon?: string;
11
- disabled?: boolean;
12
- onSelect?: () => void;
13
- }
14
- interface ToolbarItemBase {
15
- /** Unique within its group. */
16
- id: string;
17
- /** Tooltip and aria-label. */
18
- label: string;
19
- /** Iconify name, e.g. `i-lucide-bold`. */
20
- icon: string;
21
- /** Shortcut keys shown in the tooltip, e.g. `['meta', 'b']`. */
22
- kbds?: string[];
23
- /** Ability the item needs at the caret; turning an active toggle off never does. Unset: ungated. */
24
- ability?: Ability;
25
- /** Position within the group (ascending, stable); built-ins use their visual sequence. */
26
- order?: number;
27
- /** Whether the item is on at the caret (toggle style). */
28
- active?: (editor: Editor) => boolean;
29
- /** Extra condition for disabling the item. */
30
- disabled?: (editor: Editor) => boolean;
31
- /** Hides the item; evaluated only with a live editor. */
32
- visible?: (editor: Editor) => boolean;
33
- }
34
- /**
35
- * One button: `run` on click, `menu` (a dropdown of the items it returns), or `component`: a component that renders
36
- * the whole button itself (with its own popover, badge or state) and receives `{ editor }`. A component item is placed
37
- * in its group like any other and honors `visible`; `label` and `icon` only describe it (the component draws its own
38
- * tooltip), and `ability`, `active`, `disabled` are not applied.
39
- */
40
- export type ToolbarItem<C = unknown> = ToolbarItemBase & ({
41
- run: (editor: Editor) => void;
42
- menu?: never;
43
- component?: never;
44
- } | {
45
- menu: (editor: Editor) => MenuItem[];
46
- run?: never;
47
- component?: never;
48
- } | {
49
- component: C;
50
- run?: never;
51
- menu?: never;
52
- });
53
- /** A visually joined set of buttons; groups of the same `id` from different features merge into one. */
54
- export interface ToolbarGroup<C = unknown> {
55
- id: string;
56
- /** Position among the groups (ascending, stable). */
57
- order?: number;
58
- /** Hides the group; evaluated only with a live editor. */
59
- visible?: (editor: Editor) => boolean;
60
- items: ToolbarItem<C>[];
61
- }
62
- /**
63
- * A toolbar item over a command chain: `run` focuses the editor and executes `command`; the item is disabled while
64
- * `can()` says the command is structurally impossible (also an empty undo history).
65
- */
66
- export declare function commandItem(def: Omit<ToolbarItemBase, 'active' | 'disabled'> & {
67
- command: (chain: ChainedCommands) => ChainedCommands;
68
- isActive?: (editor: Editor) => boolean;
69
- }): ToolbarItem<never>;
70
- /** Merges groups of the same id and sorts groups and items by `order` (stable); the first group of an id keeps its position. */
71
- export declare function mergeToolbarGroups<C>(groups: readonly ToolbarGroup<C>[]): ToolbarGroup<C>[];
72
- //#endregion
73
- export {};
74
- //# sourceMappingURL=toolbar.d.ts.map
@@ -1,45 +0,0 @@
1
- //#region src/core/toolbar.ts
2
- /**
3
- * A toolbar item over a command chain: `run` focuses the editor and executes `command`; the item is disabled while
4
- * `can()` says the command is structurally impossible (also an empty undo history).
5
- */
6
- function commandItem(def) {
7
- const { command, isActive, ...item } = def;
8
- return {
9
- ...item,
10
- ...isActive && { active: isActive },
11
- disabled: (editor) => !command(editor.can().chain()).run(),
12
- run: (editor) => {
13
- command(editor.chain().focus()).run();
14
- }
15
- };
16
- }
17
- const byOrder = (a, b) => (a.order ?? 0) - (b.order ?? 0);
18
- /** Merges groups of the same id and sorts groups and items by `order` (stable); the first group of an id keeps its position. */
19
- function mergeToolbarGroups(groups) {
20
- const merged = /* @__PURE__ */ new Map();
21
- for (const group of groups) {
22
- const existing = merged.get(group.id);
23
- if (!existing) {
24
- merged.set(group.id, {
25
- ...group,
26
- items: [...group.items]
27
- });
28
- continue;
29
- }
30
- existing.items.push(...group.items);
31
- existing.order ??= group.order;
32
- if (group.visible) {
33
- const previous = existing.visible;
34
- existing.visible = previous ? (editor) => previous(editor) && group.visible(editor) : group.visible;
35
- }
36
- }
37
- return [...merged.values()].sort(byOrder).map((group) => ({
38
- ...group,
39
- items: [...group.items].sort(byOrder)
40
- }));
41
- }
42
- //#endregion
43
- export { commandItem, mergeToolbarGroups };
44
-
45
- //# sourceMappingURL=toolbar.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toolbar.js","names":[],"sources":["../../src/core/toolbar.ts"],"sourcesContent":["import type { ChainedCommands, Editor } from '@tiptap/core'\nimport type { Ability } from './schema/abilities'\n\n// Toolbar descriptors: features contribute groups, the framework layer's toolbar renders them. `C` is that layer's component type.\n\n/** One row of a dropdown a toolbar item or block action opens; the framework layer renders it. */\nexport interface MenuItem {\n type?: 'label' | 'separator'\n label?: string\n description?: string\n /** Iconify name, e.g. `i-lucide-heading-1`. */\n icon?: string\n disabled?: boolean\n onSelect?: () => void\n}\n\ninterface ToolbarItemBase {\n /** Unique within its group. */\n id: string\n /** Tooltip and aria-label. */\n label: string\n /** Iconify name, e.g. `i-lucide-bold`. */\n icon: string\n /** Shortcut keys shown in the tooltip, e.g. `['meta', 'b']`. */\n kbds?: string[]\n /** Ability the item needs at the caret; turning an active toggle off never does. Unset: ungated. */\n ability?: Ability\n /** Position within the group (ascending, stable); built-ins use their visual sequence. */\n order?: number\n /** Whether the item is on at the caret (toggle style). */\n active?: (editor: Editor) => boolean\n /** Extra condition for disabling the item. */\n disabled?: (editor: Editor) => boolean\n /** Hides the item; evaluated only with a live editor. */\n visible?: (editor: Editor) => boolean\n}\n\n/**\n * One button: `run` on click, `menu` (a dropdown of the items it returns), or `component`: a component that renders\n * the whole button itself (with its own popover, badge or state) and receives `{ editor }`. A component item is placed\n * in its group like any other and honors `visible`; `label` and `icon` only describe it (the component draws its own\n * tooltip), and `ability`, `active`, `disabled` are not applied.\n */\nexport type ToolbarItem<C = unknown> = ToolbarItemBase & (\n | { run: (editor: Editor) => void, menu?: never, component?: never }\n | { menu: (editor: Editor) => MenuItem[], run?: never, component?: never }\n | { component: C, run?: never, menu?: never }\n)\n\n/** A visually joined set of buttons; groups of the same `id` from different features merge into one. */\nexport interface ToolbarGroup<C = unknown> {\n id: string\n /** Position among the groups (ascending, stable). */\n order?: number\n /** Hides the group; evaluated only with a live editor. */\n visible?: (editor: Editor) => boolean\n items: ToolbarItem<C>[]\n}\n\n/**\n * A toolbar item over a command chain: `run` focuses the editor and executes `command`; the item is disabled while\n * `can()` says the command is structurally impossible (also an empty undo history).\n */\nexport function commandItem(def: Omit<ToolbarItemBase, 'active' | 'disabled'> & {\n command: (chain: ChainedCommands) => ChainedCommands\n isActive?: (editor: Editor) => boolean\n}): ToolbarItem<never> {\n const { command, isActive, ...item } = def\n return {\n ...item,\n ...(isActive && { active: isActive }),\n disabled: editor => !command(editor.can().chain()).run(),\n run: (editor) => { command(editor.chain().focus()).run() },\n }\n}\n\nconst byOrder = <T extends { order?: number }>(a: T, b: T) => (a.order ?? 0) - (b.order ?? 0)\n\n/** Merges groups of the same id and sorts groups and items by `order` (stable); the first group of an id keeps its position. */\nexport function mergeToolbarGroups<C>(groups: readonly ToolbarGroup<C>[]): ToolbarGroup<C>[] {\n const merged = new Map<string, ToolbarGroup<C>>()\n for (const group of groups) {\n const existing = merged.get(group.id)\n if (!existing) {\n merged.set(group.id, { ...group, items: [...group.items] })\n continue\n }\n existing.items.push(...group.items)\n existing.order ??= group.order\n if (group.visible) {\n const previous = existing.visible\n existing.visible = previous ? editor => previous(editor) && group.visible!(editor) : group.visible\n }\n }\n return [...merged.values()].sort(byOrder).map(group => ({ ...group, items: [...group.items].sort(byOrder) }))\n}\n"],"mappings":";;;;;AA+DA,SAAgB,YAAY,KAGL;CACrB,MAAM,EAAE,SAAS,UAAU,GAAG,SAAS;CACvC,OAAO;EACL,GAAG;EACH,GAAI,YAAY,EAAE,QAAQ,SAAS;EACnC,WAAU,WAAU,CAAC,QAAQ,OAAO,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;EACvD,MAAM,WAAW;GAAE,QAAQ,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI;EAAE;CAC3D;AACF;AAEA,MAAM,WAAyC,GAAM,OAAU,EAAE,SAAS,MAAM,EAAE,SAAS;;AAG3F,SAAgB,mBAAsB,QAAuD;CAC3F,MAAM,yBAAS,IAAI,IAA6B;CAChD,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,WAAW,OAAO,IAAI,MAAM,EAAE;EACpC,IAAI,CAAC,UAAU;GACb,OAAO,IAAI,MAAM,IAAI;IAAE,GAAG;IAAO,OAAO,CAAC,GAAG,MAAM,KAAK;GAAE,CAAC;GAC1D;EACF;EACA,SAAS,MAAM,KAAK,GAAG,MAAM,KAAK;EAClC,SAAS,UAAU,MAAM;EACzB,IAAI,MAAM,SAAS;GACjB,MAAM,WAAW,SAAS;GAC1B,SAAS,UAAU,YAAW,WAAU,SAAS,MAAM,KAAK,MAAM,QAAS,MAAM,IAAI,MAAM;EAC7F;CACF;CACA,OAAO,CAAC,GAAG,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,KAAI,WAAU;EAAE,GAAG;EAAO,OAAO,CAAC,GAAG,MAAM,KAAK,CAAC,CAAC,KAAK,OAAO;CAAE,EAAE;AAC9G"}
@@ -1,14 +0,0 @@
1
- import { Translate } from "../../i18n/index.js";
2
- import { Notifier } from "../../core/notify.js";
3
- import { Editor } from "@tiptap/core";
4
- import { $Fetch } from "ofetch";
5
- //#region src/integrations/composite-ai/document-transcribe.d.ts
6
- /**
7
- * Transcribes the audio/video of the `document` composite at `pos` (`POST /api/ai/transcribe`) and stores the text in its
8
- * `meta.transcript`, showing the meta row. The composite is anchored through its description when the request starts,
9
- * so edits while it runs do not misplace the result. Notices go through `notify`, in the language of `t`; the progress notice stays until the
10
- * request ends (`notify.dismiss`).
11
- */
12
- export declare function transcribeDocument(editor: Editor, pos: number, fetch: $Fetch, notify: Notifier, t: Translate): Promise<void>;
13
- //#endregion
14
- //# sourceMappingURL=document-transcribe.d.ts.map
@@ -1,89 +0,0 @@
1
- import { blockIdOf } from "../../core/schema/block-ids.js";
2
- import { captureRange, releaseRanges, resolveRange } from "../../core/doc-anchors.js";
3
- import { fetchErrorMessage } from "../../core/fetch-error.js";
4
- import { isRateLimited, notifyAiRateLimited } from "../../features/ai/rate-limit.js";
5
- import { COMPOSITE_BODY_START, mediaAssetOf } from "./composite-summary.js";
6
- //#region src/integrations/composite-ai/document-transcribe.ts
7
- /**
8
- * Transcribes the audio/video of the `document` composite at `pos` (`POST /api/ai/transcribe`) and stores the text in its
9
- * `meta.transcript`, showing the meta row. The composite is anchored through its description when the request starts,
10
- * so edits while it runs do not misplace the result. Notices go through `notify`, in the language of `t`; the progress notice stays until the
11
- * request ends (`notify.dismiss`).
12
- */
13
- async function transcribeDocument(editor, pos, fetch, notify, t) {
14
- const composite = editor.state.doc.nodeAt(pos);
15
- const asset = composite && mediaAssetOf(composite);
16
- if (composite?.type.name !== "composite" || !asset || composite.childCount < COMPOSITE_BODY_START) return;
17
- const descriptionPos = pos + 1 + composite.child(0).nodeSize;
18
- const anchor = captureRange(editor, {
19
- from: descriptionPos + 1,
20
- to: descriptionPos + 1 + composite.child(1).content.size
21
- });
22
- const toastId = `transcribe-${blockIdOf(composite) ?? asset.name}`;
23
- const controller = new AbortController();
24
- const abort = () => controller.abort();
25
- editor.on("destroy", abort);
26
- notify({
27
- id: toastId,
28
- title: t("integrations.documentTranscribe.running"),
29
- kind: "info",
30
- icon: "i-lucide-loader-circle",
31
- duration: 0
32
- });
33
- try {
34
- const { text } = await fetch("/api/ai/transcribe", {
35
- method: "POST",
36
- body: asset,
37
- signal: controller.signal
38
- });
39
- if (editor.isDestroyed) return;
40
- if (!text.trim()) {
41
- notify({
42
- title: t("integrations.documentTranscribe.empty.title"),
43
- description: t("integrations.documentTranscribe.empty.description"),
44
- kind: "error"
45
- });
46
- return;
47
- }
48
- const range = resolveRange(editor.state, anchor);
49
- const $from = range && editor.state.doc.resolve(range.from);
50
- if (!range || !$from || $from.parent.type.name !== "compositeDescription") {
51
- notify({
52
- title: t("integrations.documentTranscribe.gone.title"),
53
- description: t("integrations.documentTranscribe.gone.description"),
54
- kind: "error"
55
- });
56
- return;
57
- }
58
- const compositePos = $from.before($from.depth - 1);
59
- const { attrs } = $from.node($from.depth - 1);
60
- editor.view.dispatch(editor.state.tr.setNodeMarkup(compositePos, void 0, {
61
- ...attrs,
62
- meta: {
63
- ...attrs.meta,
64
- transcript: text.trim()
65
- }
66
- }));
67
- notify({
68
- title: t("integrations.documentTranscribe.done"),
69
- kind: "success",
70
- icon: "i-lucide-captions"
71
- });
72
- } catch (err) {
73
- if (controller.signal.aborted || editor.isDestroyed) return;
74
- if (isRateLimited(err)) notifyAiRateLimited(notify, t);
75
- else notify({
76
- title: t("integrations.documentTranscribe.failed"),
77
- description: fetchErrorMessage(err),
78
- kind: "error"
79
- });
80
- } finally {
81
- notify.dismiss?.(toastId);
82
- editor.off("destroy", abort);
83
- releaseRanges(editor, [anchor]);
84
- }
85
- }
86
- //#endregion
87
- export { transcribeDocument };
88
-
89
- //# sourceMappingURL=document-transcribe.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"document-transcribe.js","names":[],"sources":["../../../src/integrations/composite-ai/document-transcribe.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport type { $Fetch } from 'ofetch'\nimport { captureRange, fetchErrorMessage, releaseRanges, resolveRange } from '../../core'\nimport type { Translate } from '../../i18n'\nimport type { Notifier } from '../../core/notify'\nimport { blockIdOf } from '../../core/schema'\nimport { isRateLimited, notifyAiRateLimited } from '../../features/ai'\nimport { COMPOSITE_BODY_START, mediaAssetOf } from './composite-summary'\n\n/**\n * Transcribes the audio/video of the `document` composite at `pos` (`POST /api/ai/transcribe`) and stores the text in its\n * `meta.transcript`, showing the meta row. The composite is anchored through its description when the request starts,\n * so edits while it runs do not misplace the result. Notices go through `notify`, in the language of `t`; the progress notice stays until the\n * request ends (`notify.dismiss`).\n */\nexport async function transcribeDocument(editor: Editor, pos: number, fetch: $Fetch, notify: Notifier, t: Translate): Promise<void> {\n const composite = editor.state.doc.nodeAt(pos)\n const asset = composite && mediaAssetOf(composite)\n if (composite?.type.name !== 'composite' || !asset || composite.childCount < COMPOSITE_BODY_START) return\n const descriptionPos = pos + 1 + composite.child(0).nodeSize\n const anchor = captureRange(editor, { from: descriptionPos + 1, to: descriptionPos + 1 + composite.child(1).content.size })\n const toastId = `transcribe-${blockIdOf(composite) ?? asset.name}`\n\n const controller = new AbortController()\n const abort = () => controller.abort()\n editor.on('destroy', abort)\n notify({ id: toastId, title: t('integrations.documentTranscribe.running'), kind: 'info', icon: 'i-lucide-loader-circle', duration: 0 })\n try {\n const { text } = await fetch<{ text: string }>('/api/ai/transcribe', {\n method: 'POST',\n body: asset,\n signal: controller.signal,\n })\n if (editor.isDestroyed) return\n if (!text.trim()) {\n notify({ title: t('integrations.documentTranscribe.empty.title'), description: t('integrations.documentTranscribe.empty.description'), kind: 'error' })\n return\n }\n\n const range = resolveRange(editor.state, anchor)\n const $from = range && editor.state.doc.resolve(range.from)\n if (!range || !$from || $from.parent.type.name !== 'compositeDescription') {\n notify({ title: t('integrations.documentTranscribe.gone.title'), description: t('integrations.documentTranscribe.gone.description'), kind: 'error' })\n return\n }\n const compositePos = $from.before($from.depth - 1)\n const { attrs } = $from.node($from.depth - 1)\n editor.view.dispatch(editor.state.tr.setNodeMarkup(compositePos, undefined, {\n ...attrs,\n meta: { ...attrs.meta, transcript: text.trim() },\n }))\n notify({ title: t('integrations.documentTranscribe.done'), kind: 'success', icon: 'i-lucide-captions' })\n }\n catch (err) {\n if (controller.signal.aborted || editor.isDestroyed) return\n if (isRateLimited(err)) notifyAiRateLimited(notify, t)\n else notify({ title: t('integrations.documentTranscribe.failed'), description: fetchErrorMessage(err), kind: 'error' })\n }\n finally {\n notify.dismiss?.(toastId)\n editor.off('destroy', abort)\n releaseRanges(editor, [anchor])\n }\n}\n"],"mappings":";;;;;;;;;;;;AAeA,eAAsB,mBAAmB,QAAgB,KAAa,OAAe,QAAkB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K,MAAM,QAAQ,CAAC;EAC5C,OAAO,KAAK,SAAS,OAAO,MAAM,GAAG,cAAc,cAAc,KAAA,GAAW;GAC1E,GAAG;GACH,MAAM;IAAE,GAAG,MAAM;IAAM,YAAY,KAAK,KAAK;GAAE;EACjD,CAAC,CAAC;EACF,OAAO;GAAE,OAAO,EAAE,sCAAsC;GAAG,MAAM;GAAW,MAAM;EAAoB,CAAC;CACzG,SACO,KAAK;EACV,IAAI,WAAW,OAAO,WAAW,OAAO,aAAa;EACrD,IAAI,cAAc,GAAG,GAAG,oBAAoB,QAAQ,CAAC;OAChD,OAAO;GAAE,OAAO,EAAE,wCAAwC;GAAG,aAAa,kBAAkB,GAAG;GAAG,MAAM;EAAQ,CAAC;CACxH,UACQ;EACN,OAAO,UAAU,OAAO;EACxB,OAAO,IAAI,WAAW,KAAK;EAC3B,cAAc,QAAQ,CAAC,MAAM,CAAC;CAChC;AACF"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/ai/chat.post.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=chat.post.d.ts.map
@@ -1,8 +0,0 @@
1
- import { chatPost } from "../../../../../server/handlers/ai.js";
2
- import { defineEditorRoute } from "../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/ai/chat.post.ts
4
- var chat_post_default = defineEditorRoute(chatPost);
5
- //#endregion
6
- export { chat_post_default as default };
7
-
8
- //# sourceMappingURL=chat.post.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chat.post.js","names":[],"sources":["../../../../../../src/nuxt/runtime/server/api/ai/chat.post.ts"],"sourcesContent":["import { defineEditorRoute } from '../../utils/editor-route'\nimport { chatPost } from '../../../../../server/handlers'\n\nexport default defineEditorRoute(chatPost)\n"],"mappings":";;;AAGA,IAAA,oBAAe,kBAAkB,QAAQ"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/ai/complete.post.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=complete.post.d.ts.map
@@ -1,8 +0,0 @@
1
- import { completePost } from "../../../../../server/handlers/ai.js";
2
- import { defineEditorRoute } from "../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/ai/complete.post.ts
4
- var complete_post_default = defineEditorRoute(completePost);
5
- //#endregion
6
- export { complete_post_default as default };
7
-
8
- //# sourceMappingURL=complete.post.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"complete.post.js","names":[],"sources":["../../../../../../src/nuxt/runtime/server/api/ai/complete.post.ts"],"sourcesContent":["import { defineEditorRoute } from '../../utils/editor-route'\nimport { completePost } from '../../../../../server/handlers'\n\nexport default defineEditorRoute(completePost)\n"],"mappings":";;;AAGA,IAAA,wBAAe,kBAAkB,YAAY"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/ai/generate.post.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=generate.post.d.ts.map
@@ -1,8 +0,0 @@
1
- import { generatePost } from "../../../../../server/handlers/ai.js";
2
- import { defineEditorRoute } from "../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/ai/generate.post.ts
4
- var generate_post_default = defineEditorRoute(generatePost);
5
- //#endregion
6
- export { generate_post_default as default };
7
-
8
- //# sourceMappingURL=generate.post.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate.post.js","names":[],"sources":["../../../../../../src/nuxt/runtime/server/api/ai/generate.post.ts"],"sourcesContent":["import { defineEditorRoute } from '../../utils/editor-route'\nimport { generatePost } from '../../../../../server/handlers'\n\nexport default defineEditorRoute(generatePost)\n"],"mappings":";;;AAGA,IAAA,wBAAe,kBAAkB,YAAY"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/ai/models.get.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=models.get.d.ts.map
@@ -1,8 +0,0 @@
1
- import { modelsGet } from "../../../../../server/handlers/ai.js";
2
- import { defineEditorRoute } from "../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/ai/models.get.ts
4
- var models_get_default = defineEditorRoute(modelsGet);
5
- //#endregion
6
- export { models_get_default as default };
7
-
8
- //# sourceMappingURL=models.get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.get.js","names":[],"sources":["../../../../../../src/nuxt/runtime/server/api/ai/models.get.ts"],"sourcesContent":["import { defineEditorRoute } from '../../utils/editor-route'\nimport { modelsGet } from '../../../../../server/handlers'\n\nexport default defineEditorRoute(modelsGet)\n"],"mappings":";;;AAGA,IAAA,qBAAe,kBAAkB,SAAS"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/ai/transcribe.post.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=transcribe.post.d.ts.map
@@ -1,8 +0,0 @@
1
- import { transcribePost } from "../../../../../server/handlers/ai.js";
2
- import { defineEditorRoute } from "../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/ai/transcribe.post.ts
4
- var transcribe_post_default = defineEditorRoute(transcribePost);
5
- //#endregion
6
- export { transcribe_post_default as default };
7
-
8
- //# sourceMappingURL=transcribe.post.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transcribe.post.js","names":[],"sources":["../../../../../../src/nuxt/runtime/server/api/ai/transcribe.post.ts"],"sourcesContent":["import { defineEditorRoute } from '../../utils/editor-route'\nimport { transcribePost } from '../../../../../server/handlers'\n\nexport default defineEditorRoute(transcribePost)\n"],"mappings":";;;AAGA,IAAA,0BAAe,kBAAkB,cAAc"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/ai/transcript-cleanup.post.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=transcript-cleanup.post.d.ts.map
@@ -1,8 +0,0 @@
1
- import { transcriptCleanupPost } from "../../../../../server/handlers/ai.js";
2
- import { defineEditorRoute } from "../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/ai/transcript-cleanup.post.ts
4
- var transcript_cleanup_post_default = defineEditorRoute(transcriptCleanupPost);
5
- //#endregion
6
- export { transcript_cleanup_post_default as default };
7
-
8
- //# sourceMappingURL=transcript-cleanup.post.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transcript-cleanup.post.js","names":[],"sources":["../../../../../../src/nuxt/runtime/server/api/ai/transcript-cleanup.post.ts"],"sourcesContent":["import { defineEditorRoute } from '../../utils/editor-route'\nimport { transcriptCleanupPost } from '../../../../../server/handlers'\n\nexport default defineEditorRoute(transcriptCleanupPost)\n"],"mappings":";;;AAGA,IAAA,kCAAe,kBAAkB,qBAAqB"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/editor/assets/[id]/[name].get.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=[name].get.d.ts.map
@@ -1,8 +0,0 @@
1
- import { assetGet } from "../../../../../../../server/handlers/editor.js";
2
- import { defineEditorRoute } from "../../../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/editor/assets/[id]/[name].get.ts
4
- var _name__get_default = defineEditorRoute(assetGet);
5
- //#endregion
6
- export { _name__get_default as default };
7
-
8
- //# sourceMappingURL=[name].get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"[name].get.js","names":[],"sources":["../../../../../../../../src/nuxt/runtime/server/api/editor/assets/[id]/[name].get.ts"],"sourcesContent":["import { defineEditorRoute } from '../../../../utils/editor-route'\nimport { assetGet } from '../../../../../../../server/handlers'\n\nexport default defineEditorRoute(assetGet)\n"],"mappings":";;;AAGA,IAAA,qBAAe,kBAAkB,QAAQ"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/editor/assets/[id].post.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=[id].post.d.ts.map
@@ -1,8 +0,0 @@
1
- import { assetPost } from "../../../../../../server/handlers/editor.js";
2
- import { defineEditorRoute } from "../../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/editor/assets/[id].post.ts
4
- var _id__post_default = defineEditorRoute(assetPost);
5
- //#endregion
6
- export { _id__post_default as default };
7
-
8
- //# sourceMappingURL=[id].post.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"[id].post.js","names":[],"sources":["../../../../../../../src/nuxt/runtime/server/api/editor/assets/[id].post.ts"],"sourcesContent":["import { defineEditorRoute } from '../../../utils/editor-route'\nimport { assetPost } from '../../../../../../server/handlers'\n\nexport default defineEditorRoute(assetPost)\n"],"mappings":";;;AAGA,IAAA,oBAAe,kBAAkB,SAAS"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/editor/settings.get.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=settings.get.d.ts.map
@@ -1,8 +0,0 @@
1
- import { settingsGet } from "../../../../../server/handlers/editor.js";
2
- import { defineEditorRoute } from "../../utils/editor-route.js";
3
- //#region src/nuxt/runtime/server/api/editor/settings.get.ts
4
- var settings_get_default = defineEditorRoute(settingsGet);
5
- //#endregion
6
- export { settings_get_default as default };
7
-
8
- //# sourceMappingURL=settings.get.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"settings.get.js","names":[],"sources":["../../../../../../src/nuxt/runtime/server/api/editor/settings.get.ts"],"sourcesContent":["import { defineEditorRoute } from '../../utils/editor-route'\nimport { settingsGet } from '../../../../../server/handlers'\n\nexport default defineEditorRoute(settingsGet)\n"],"mappings":";;;AAGA,IAAA,uBAAe,kBAAkB,WAAW"}
@@ -1,5 +0,0 @@
1
- //#region src/nuxt/runtime/server/api/editor/settings.put.d.ts
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string | Uint8Array<ArrayBufferLike> | ReadableStream<Uint8Array<ArrayBufferLike>> | null>>;
3
- //#endregion
4
- export { _default as default };
5
- //# sourceMappingURL=settings.put.d.ts.map