@ecsplico/editor 2.1.2 → 3.1.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 (706) hide show
  1. package/CHANGELOG.md +78 -1
  2. package/README.md +39 -156
  3. package/dist/adapters/comments/drizzle.d.ts +1 -1
  4. package/dist/adapters/comments/record.d.ts +15 -0
  5. package/dist/adapters/comments/{client.js → rest-model.js} +3 -3
  6. package/dist/adapters/comments/rest-model.js.map +1 -0
  7. package/dist/adapters/comments/server.d.ts +2 -1
  8. package/dist/adapters/comments/server.js +2 -1
  9. package/dist/adapters/comments/server.js.map +1 -1
  10. package/dist/adapters/comments/types.d.ts +2 -2
  11. package/dist/adapters/document-state.d.ts +23 -0
  12. package/dist/adapters/document-state.js +66 -0
  13. package/dist/adapters/document-state.js.map +1 -0
  14. package/dist/adapters/documents.js +14 -11
  15. package/dist/adapters/documents.js.map +1 -1
  16. package/dist/adapters/drizzle.d.ts +2 -2
  17. package/dist/adapters/drizzle.js +97 -88
  18. package/dist/adapters/drizzle.js.map +1 -1
  19. package/dist/adapters/forge.d.ts +12 -7
  20. package/dist/adapters/forge.js +38 -45
  21. package/dist/adapters/forge.js.map +1 -1
  22. package/dist/adapters/http.d.ts +20 -0
  23. package/dist/adapters/http.js +68 -0
  24. package/dist/adapters/http.js.map +1 -0
  25. package/dist/adapters/index.d.ts +5 -5
  26. package/dist/adapters/json.d.ts +3 -3
  27. package/dist/adapters/json.js +58 -49
  28. package/dist/adapters/json.js.map +1 -1
  29. package/dist/adapters/memory.d.ts +21 -0
  30. package/dist/adapters/memory.js +53 -0
  31. package/dist/adapters/memory.js.map +1 -0
  32. package/dist/adapters/nitro.d.ts +27 -20
  33. package/dist/adapters/nitro.js +59 -163
  34. package/dist/adapters/nitro.js.map +1 -1
  35. package/dist/adapters/react.d.ts +55 -0
  36. package/dist/adapters/react.js +209 -0
  37. package/dist/adapters/react.js.map +1 -0
  38. package/dist/adapters/shared.d.ts +15 -21
  39. package/dist/adapters/shared.js +10 -8
  40. package/dist/adapters/shared.js.map +1 -1
  41. package/dist/adapters/vue.d.ts +15 -30
  42. package/dist/adapters/vue.js +36 -87
  43. package/dist/adapters/vue.js.map +1 -1
  44. package/dist/code/CodeSurface.vue.d.ts +2 -2
  45. package/dist/config/index.d.ts +105 -0
  46. package/dist/config/index.js +95 -0
  47. package/dist/config/index.js.map +1 -0
  48. package/dist/core/abilities.js +1 -0
  49. package/dist/core/abilities.js.map +1 -1
  50. package/dist/{adapters/routes.js → core/api-routes.js} +5 -3
  51. package/dist/core/api-routes.js.map +1 -0
  52. package/dist/core/backend-capability.d.ts +7 -0
  53. package/dist/core/backend-capability.js +17 -0
  54. package/dist/core/backend-capability.js.map +1 -0
  55. package/dist/core/backend-types.d.ts +245 -0
  56. package/dist/core/backend-types.js +17 -0
  57. package/dist/core/backend-types.js.map +1 -0
  58. package/dist/core/backend.d.ts +108 -0
  59. package/dist/core/backend.js +14 -0
  60. package/dist/core/backend.js.map +1 -0
  61. package/dist/core/block-convert.d.ts +7 -5
  62. package/dist/core/block-convert.js +28 -5
  63. package/dist/core/block-convert.js.map +1 -1
  64. package/dist/core/command-types.d.ts +96 -0
  65. package/dist/core/commands.d.ts +40 -0
  66. package/dist/core/commands.js +151 -0
  67. package/dist/core/commands.js.map +1 -0
  68. package/dist/core/context.d.ts +17 -20
  69. package/dist/core/context.js +24 -21
  70. package/dist/core/context.js.map +1 -1
  71. package/dist/core/core-feature.d.ts +22 -7
  72. package/dist/core/core-feature.js +51 -18
  73. package/dist/core/core-feature.js.map +1 -1
  74. package/dist/core/define-editor.d.ts +4 -3
  75. package/dist/core/define-editor.js +14 -7
  76. package/dist/core/define-editor.js.map +1 -1
  77. package/dist/core/document-markdown.js +12 -3
  78. package/dist/core/document-markdown.js.map +1 -1
  79. package/dist/core/editor-ui.d.ts +8 -1
  80. package/dist/core/editor-ui.js +9 -8
  81. package/dist/core/editor-ui.js.map +1 -1
  82. package/dist/core/extension-points.d.ts +3 -15
  83. package/dist/core/feature-context.d.ts +8 -7
  84. package/dist/core/feature-context.js +12 -11
  85. package/dist/core/feature-context.js.map +1 -1
  86. package/dist/core/feature.d.ts +41 -19
  87. package/dist/core/feature.js.map +1 -1
  88. package/dist/core/fences.d.ts +2 -1
  89. package/dist/core/fences.js +3 -2
  90. package/dist/core/fences.js.map +1 -1
  91. package/dist/core/fetch-error.d.ts +1 -1
  92. package/dist/core/fetch-error.js +3 -1
  93. package/dist/core/fetch-error.js.map +1 -1
  94. package/dist/core/hash.d.ts +5 -0
  95. package/dist/core/hash.js +11 -0
  96. package/dist/core/hash.js.map +1 -0
  97. package/dist/core/http-backend.d.ts +11 -0
  98. package/dist/core/http-backend.js +195 -0
  99. package/dist/core/http-backend.js.map +1 -0
  100. package/dist/core/index.d.ts +15 -9
  101. package/dist/core/index.js +13 -9
  102. package/dist/core/palette.d.ts +48 -0
  103. package/dist/core/palette.js +95 -0
  104. package/dist/core/palette.js.map +1 -0
  105. package/dist/core/schema/abilities.d.ts +2 -1
  106. package/dist/core/schema/abilities.js +5 -1
  107. package/dist/core/schema/abilities.js.map +1 -1
  108. package/dist/core/schema/index.d.ts +11 -5
  109. package/dist/core/schema/index.js +13 -8
  110. package/dist/core/schema/index.js.map +1 -1
  111. package/dist/core/schema/mark-flags.d.ts +8 -1
  112. package/dist/core/schema/of-features.d.ts +13 -0
  113. package/dist/core/schema/of-features.js +14 -0
  114. package/dist/core/schema/of-features.js.map +1 -0
  115. package/dist/core/slash.d.ts +8 -6
  116. package/dist/core/slash.js +24 -16
  117. package/dist/core/slash.js.map +1 -1
  118. package/dist/core/surface-session.js +15 -5
  119. package/dist/core/surface-session.js.map +1 -1
  120. package/dist/core/toolbar-items.d.ts +10 -4
  121. package/dist/core/toolbar-items.js +269 -195
  122. package/dist/core/toolbar-items.js.map +1 -1
  123. package/dist/core/transaction-guards.d.ts +21 -0
  124. package/dist/core/transaction-guards.js +49 -0
  125. package/dist/core/transaction-guards.js.map +1 -0
  126. package/dist/core/util.js +11 -0
  127. package/dist/core/util.js.map +1 -0
  128. package/dist/document/DocumentSurface.d.ts +1 -1
  129. package/dist/document/DocumentSurface.vue.d.ts +2 -2
  130. package/dist/features/ai/agent-op-review.d.ts +1 -1
  131. package/dist/features/ai/agent-op-review.js +1 -1
  132. package/dist/features/ai/agent-ops.js +1 -1
  133. package/dist/features/ai/ai-apply.d.ts +2 -2
  134. package/dist/features/ai/ai-apply.js +1 -1
  135. package/dist/features/ai/ai-review.js +1 -1
  136. package/dist/features/ai/ai-sse.d.ts +6 -6
  137. package/dist/features/ai/ai-sse.js +20 -63
  138. package/dist/features/ai/ai-sse.js.map +1 -1
  139. package/dist/features/ai/assistant.d.ts +8 -7
  140. package/dist/features/ai/assistant.js +3 -3
  141. package/dist/features/ai/assistant.js.map +1 -1
  142. package/dist/features/ai/block-actions.d.ts +3 -2
  143. package/dist/features/ai/block-actions.js +3 -2
  144. package/dist/features/ai/block-actions.js.map +1 -1
  145. package/dist/features/ai/components/AiSelectionMenu.js +1 -1
  146. package/dist/features/ai/components/DocumentChatAnswer.js +1 -1
  147. package/dist/features/ai/components/DocumentChatOps.vue.d.ts +1 -1
  148. package/dist/features/ai/components/SettingsModelProfiles.js +8 -8
  149. package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -1
  150. package/dist/features/ai/document-chat-model.d.ts +8 -7
  151. package/dist/features/ai/document-chat-model.js +5 -5
  152. package/dist/features/ai/document-chat-model.js.map +1 -1
  153. package/dist/features/ai/document-chat.js +1 -1
  154. package/dist/features/ai/feature.js +27 -14
  155. package/dist/features/ai/feature.js.map +1 -1
  156. package/dist/features/ai/ghost-autocomplete.d.ts +7 -6
  157. package/dist/features/ai/ghost-autocomplete.js +6 -9
  158. package/dist/features/ai/ghost-autocomplete.js.map +1 -1
  159. package/dist/features/ai/index.d.ts +4 -3
  160. package/dist/features/ai/index.js +10 -10
  161. package/dist/features/ai/model-profiles.d.ts +5 -4
  162. package/dist/features/ai/model-profiles.js +2 -2
  163. package/dist/features/ai/model-profiles.js.map +1 -1
  164. package/dist/features/ai/protocol/block-lines.js +1 -1
  165. package/dist/features/ai/protocol/block-lines.js.map +1 -1
  166. package/dist/features/ai/protocol/chat.js +6 -2
  167. package/dist/features/ai/protocol/chat.js.map +1 -1
  168. package/dist/features/ai/protocol/index.d.ts +3 -2
  169. package/dist/features/ai/protocol/models.d.ts +2 -16
  170. package/dist/features/ai/protocol/models.js.map +1 -1
  171. package/dist/features/ai/rate-limit.d.ts +1 -1
  172. package/dist/features/ai/rate-limit.js +3 -1
  173. package/dist/features/ai/rate-limit.js.map +1 -1
  174. package/dist/features/ai/react/AiSelectionMenu.js +2 -2
  175. package/dist/features/ai/react/AiSidebar.js +4 -4
  176. package/dist/features/ai/react/DocumentChatAnswer.js +1 -1
  177. package/dist/features/ai/react/DocumentChatOps.d.ts +1 -1
  178. package/dist/features/ai/react/DocumentChatOps.js +1 -1
  179. package/dist/features/ai/react/SettingsModelProfiles.js +8 -10
  180. package/dist/features/ai/react/SettingsModelProfiles.js.map +1 -1
  181. package/dist/features/ai/react/use-ai-assistant.d.ts +1 -1
  182. package/dist/features/ai/react/use-ai-assistant.js +3 -3
  183. package/dist/features/ai/react/use-ai-assistant.js.map +1 -1
  184. package/dist/features/ai/react/use-document-chat.js +2 -2
  185. package/dist/features/ai/react/use-document-chat.js.map +1 -1
  186. package/dist/features/ai/react/use-model-profiles.d.ts +2 -1
  187. package/dist/features/ai/selection-flow.d.ts +1 -1
  188. package/dist/features/ai/selection-flow.js +1 -1
  189. package/dist/features/ai/sidebar-flow.d.ts +1 -1
  190. package/dist/features/ai/sidebar-flow.js +1 -1
  191. package/dist/features/ai/use-ai-assistant.d.ts +1 -1
  192. package/dist/features/ai/use-ai-assistant.js +3 -3
  193. package/dist/features/ai/use-ai-assistant.js.map +1 -1
  194. package/dist/features/ai/use-document-chat.js +2 -2
  195. package/dist/features/ai/use-document-chat.js.map +1 -1
  196. package/dist/features/ai/use-model-profiles.d.ts +2 -1
  197. package/dist/features/authors/attribution.d.ts +1 -1
  198. package/dist/features/authors/feature.js +12 -11
  199. package/dist/features/authors/feature.js.map +1 -1
  200. package/dist/features/block-ui/block-actions.d.ts +1 -1
  201. package/dist/features/block-ui/block-actions.js +1 -1
  202. package/dist/features/block-ui/block-actions.js.map +1 -1
  203. package/dist/features/block-ui/components/BlockUi.js +1 -1
  204. package/dist/features/block-ui/feature.js +1 -0
  205. package/dist/features/block-ui/feature.js.map +1 -1
  206. package/dist/features/block-ui/react/BlockUi.js +1 -1
  207. package/dist/features/collab/anchor-resolver.js +1 -1
  208. package/dist/features/collab/feature.js +2 -0
  209. package/dist/features/collab/feature.js.map +1 -1
  210. package/dist/features/comments/components/CommentThreadView.vue.d.ts +2 -1
  211. package/dist/features/comments/feature.js +12 -11
  212. package/dist/features/comments/feature.js.map +1 -1
  213. package/dist/features/comments/index.d.ts +3 -2
  214. package/dist/features/comments/index.js +1 -1
  215. package/dist/features/comments/margin-layout.d.ts +3 -2
  216. package/dist/features/comments/model.d.ts +3 -67
  217. package/dist/features/comments/model.js +2 -2
  218. package/dist/features/comments/model.js.map +1 -1
  219. package/dist/features/comments/react/CommentThreadView.d.ts +3 -2
  220. package/dist/features/comments/react/use-comments.d.ts +2 -1
  221. package/dist/features/comments/react.d.ts +1 -1
  222. package/dist/features/comments/schema.d.ts +2 -52
  223. package/dist/features/comments/schema.js.map +1 -1
  224. package/dist/features/comments/snapshot-equality.js.map +1 -1
  225. package/dist/features/comments/use-comments.d.ts +3 -2
  226. package/dist/features/comments/vue.d.ts +1 -1
  227. package/dist/features/composites/accepted-children.d.ts +1 -0
  228. package/dist/features/composites/accepted-children.js +16 -1
  229. package/dist/features/composites/accepted-children.js.map +1 -1
  230. package/dist/features/composites/ai-brief.js +39 -0
  231. package/dist/features/composites/ai-brief.js.map +1 -1
  232. package/dist/features/composites/bibliography-command.d.ts +11 -0
  233. package/dist/features/composites/bibliography-form.js +90 -0
  234. package/dist/features/composites/bibliography-form.js.map +1 -0
  235. package/dist/features/composites/bibliography.d.ts +33 -0
  236. package/dist/features/composites/bibliography.js +120 -0
  237. package/dist/features/composites/bibliography.js.map +1 -0
  238. package/dist/features/composites/components/BibliographyEditor.js +261 -0
  239. package/dist/features/composites/components/BibliographyEditor.js.map +1 -0
  240. package/dist/features/composites/components/CompositeChrome.js +78 -29
  241. package/dist/features/composites/components/CompositeChrome.js.map +1 -1
  242. package/dist/features/composites/components/CompositeChrome.vue.d.ts +1 -1
  243. package/dist/features/composites/components/CompositeDetails.js +46 -11
  244. package/dist/features/composites/components/CompositeDetails.js.map +1 -1
  245. package/dist/features/composites/components/CompositeDetails.vue.d.ts +2 -1
  246. package/dist/features/composites/components/CompositeFieldEditor.js +64 -5
  247. package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -1
  248. package/dist/features/composites/components/CompositeInspector.js +20 -7
  249. package/dist/features/composites/components/CompositeInspector.js.map +1 -1
  250. package/dist/features/composites/components/CompositeTable.js +13 -4
  251. package/dist/features/composites/components/CompositeTable.js.map +1 -1
  252. package/dist/features/composites/components/CompositeTagsEditor.js +1 -1
  253. package/dist/features/composites/components/CompositeView.js +11 -1
  254. package/dist/features/composites/components/CompositeView.js.map +1 -1
  255. package/dist/features/composites/components/DerivationBadge.js +103 -0
  256. package/dist/features/composites/components/DerivationBadge.js.map +1 -0
  257. package/dist/features/composites/components/ReferenceFieldSelect.js +60 -0
  258. package/dist/features/composites/components/ReferenceFieldSelect.js.map +1 -0
  259. package/dist/features/composites/components/ReferenceView.js +122 -0
  260. package/dist/features/composites/components/ReferenceView.js.map +1 -0
  261. package/dist/features/composites/components/ReferenceView.vue.d.ts +96 -0
  262. package/dist/features/composites/components/SettingsEditingTab.js +1 -1
  263. package/dist/features/composites/convert.js +2 -2
  264. package/dist/features/composites/convert.js.map +1 -1
  265. package/dist/features/composites/derivation.d.ts +61 -0
  266. package/dist/features/composites/derivation.js +98 -0
  267. package/dist/features/composites/derivation.js.map +1 -0
  268. package/dist/features/composites/derived-chrome.js +69 -0
  269. package/dist/features/composites/derived-chrome.js.map +1 -0
  270. package/dist/features/composites/feature.js +159 -109
  271. package/dist/features/composites/feature.js.map +1 -1
  272. package/dist/features/composites/fences.d.ts +4 -3
  273. package/dist/features/composites/fences.js +51 -7
  274. package/dist/features/composites/fences.js.map +1 -1
  275. package/dist/features/composites/index.d.ts +12 -3
  276. package/dist/features/composites/index.js +15 -6
  277. package/dist/features/composites/inspector-model.d.ts +4 -1
  278. package/dist/features/composites/inspector-model.js +8 -4
  279. package/dist/features/composites/inspector-model.js.map +1 -1
  280. package/dist/features/composites/kinds.d.ts +16 -2
  281. package/dist/features/composites/kinds.js +145 -6
  282. package/dist/features/composites/kinds.js.map +1 -1
  283. package/dist/features/composites/legacy.d.ts +4 -1
  284. package/dist/features/composites/legacy.js +56 -1
  285. package/dist/features/composites/legacy.js.map +1 -1
  286. package/dist/features/composites/meta-display.js +45 -2
  287. package/dist/features/composites/meta-display.js.map +1 -1
  288. package/dist/features/composites/meta-keys.d.ts +7 -0
  289. package/dist/features/composites/meta-keys.js +21 -0
  290. package/dist/features/composites/meta-keys.js.map +1 -0
  291. package/dist/features/composites/node-views.d.ts +6 -3
  292. package/dist/features/composites/node-views.js +7 -3
  293. package/dist/features/composites/node-views.js.map +1 -1
  294. package/dist/features/composites/nodes.d.ts +6 -1
  295. package/dist/features/composites/nodes.js +33 -7
  296. package/dist/features/composites/nodes.js.map +1 -1
  297. package/dist/features/composites/react/BibliographyEditor.js +229 -0
  298. package/dist/features/composites/react/BibliographyEditor.js.map +1 -0
  299. package/dist/features/composites/react/CompositeChrome.js +67 -19
  300. package/dist/features/composites/react/CompositeChrome.js.map +1 -1
  301. package/dist/features/composites/react/CompositeDetails.d.ts +2 -1
  302. package/dist/features/composites/react/CompositeDetails.js +45 -6
  303. package/dist/features/composites/react/CompositeDetails.js.map +1 -1
  304. package/dist/features/composites/react/CompositeFieldEditor.d.ts +1 -1
  305. package/dist/features/composites/react/CompositeFieldEditor.js +43 -1
  306. package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -1
  307. package/dist/features/composites/react/CompositeInspector.js +12 -6
  308. package/dist/features/composites/react/CompositeInspector.js.map +1 -1
  309. package/dist/features/composites/react/CompositeStatusMenu.js +1 -1
  310. package/dist/features/composites/react/CompositeSummaryEditor.js +1 -1
  311. package/dist/features/composites/react/CompositeTable.js +16 -2
  312. package/dist/features/composites/react/CompositeTable.js.map +1 -1
  313. package/dist/features/composites/react/CompositeTagsEditor.js +2 -2
  314. package/dist/features/composites/react/CompositeView.js +6 -1
  315. package/dist/features/composites/react/CompositeView.js.map +1 -1
  316. package/dist/features/composites/react/DerivationBadge.js +116 -0
  317. package/dist/features/composites/react/DerivationBadge.js.map +1 -0
  318. package/dist/features/composites/react/ReferenceFieldSelect.js +52 -0
  319. package/dist/features/composites/react/ReferenceFieldSelect.js.map +1 -0
  320. package/dist/features/composites/react/ReferenceView.d.ts +11 -0
  321. package/dist/features/composites/react/ReferenceView.js +115 -0
  322. package/dist/features/composites/react/ReferenceView.js.map +1 -0
  323. package/dist/features/composites/react/SettingsEditingTab.js +2 -2
  324. package/dist/features/composites/react.d.ts +2 -1
  325. package/dist/features/composites/react.js +7 -3
  326. package/dist/features/composites/react.js.map +1 -1
  327. package/dist/features/composites/reference-ai.js +16 -0
  328. package/dist/features/composites/reference-ai.js.map +1 -0
  329. package/dist/features/composites/reference-label.d.ts +19 -0
  330. package/dist/features/composites/reference-label.js +58 -0
  331. package/dist/features/composites/reference-label.js.map +1 -0
  332. package/dist/features/composites/reference-suggestion.d.ts +10 -0
  333. package/dist/features/composites/reference-suggestion.js +41 -0
  334. package/dist/features/composites/reference-suggestion.js.map +1 -0
  335. package/dist/features/composites/reference-text.d.ts +18 -0
  336. package/dist/features/composites/reference-text.js +89 -0
  337. package/dist/features/composites/reference-text.js.map +1 -0
  338. package/dist/features/composites/reference.d.ts +44 -0
  339. package/dist/features/composites/reference.js +148 -0
  340. package/dist/features/composites/reference.js.map +1 -0
  341. package/dist/features/composites/reveal-source.d.ts +32 -0
  342. package/dist/features/composites/reveal-source.js +89 -0
  343. package/dist/features/composites/reveal-source.js.map +1 -0
  344. package/dist/features/composites/rows.d.ts +25 -3
  345. package/dist/features/composites/rows.js +72 -10
  346. package/dist/features/composites/rows.js.map +1 -1
  347. package/dist/features/composites/schema.d.ts +9 -3
  348. package/dist/features/composites/schema.js +11 -4
  349. package/dist/features/composites/schema.js.map +1 -1
  350. package/dist/features/composites/table-model.js +12 -21
  351. package/dist/features/composites/table-model.js.map +1 -1
  352. package/dist/features/composites/vue.d.ts +3 -2
  353. package/dist/features/composites/vue.js +8 -4
  354. package/dist/features/composites/vue.js.map +1 -1
  355. package/dist/features/media/assets.d.ts +2 -0
  356. package/dist/features/media/assets.js +3 -2
  357. package/dist/features/media/assets.js.map +1 -1
  358. package/dist/features/media/components/FileView.js +13 -4
  359. package/dist/features/media/components/FileView.js.map +1 -1
  360. package/dist/features/media/feature.d.ts +3 -3
  361. package/dist/features/media/feature.js +21 -28
  362. package/dist/features/media/feature.js.map +1 -1
  363. package/dist/features/media/file-import.js +2 -2
  364. package/dist/features/media/file-import.js.map +1 -1
  365. package/dist/features/media/index.d.ts +2 -2
  366. package/dist/features/media/index.js +3 -3
  367. package/dist/features/media/react/AudioRecorderModal.js +1 -1
  368. package/dist/features/media/react/FileView.js +19 -2
  369. package/dist/features/media/react/FileView.js.map +1 -1
  370. package/dist/features/media/react.js +1 -1
  371. package/dist/features/media/schema.d.ts +8 -0
  372. package/dist/features/media/schema.js +126 -11
  373. package/dist/features/media/schema.js.map +1 -1
  374. package/dist/features/media/upload.d.ts +16 -14
  375. package/dist/features/media/upload.js +13 -19
  376. package/dist/features/media/upload.js.map +1 -1
  377. package/dist/features/mentions/index.d.ts +4 -3
  378. package/dist/features/mentions/index.js +4 -1
  379. package/dist/features/mentions/index.js.map +1 -1
  380. package/dist/features/mentions/mention-text.d.ts +1 -1
  381. package/dist/features/mentions/mention-text.js.map +1 -1
  382. package/dist/features/mentions/mention.d.ts +0 -6
  383. package/dist/features/mentions/mention.js.map +1 -1
  384. package/dist/features/mentions/metadata-defaults.d.ts +2 -2
  385. package/dist/features/mentions/metadata-defaults.js +3 -9
  386. package/dist/features/mentions/metadata-defaults.js.map +1 -1
  387. package/dist/features/mentions/schema.d.ts +2 -1
  388. package/dist/features/mentions/schema.js.map +1 -1
  389. package/dist/features/tables/feature.d.ts +2 -1
  390. package/dist/features/tables/feature.js +90 -70
  391. package/dist/features/tables/feature.js.map +1 -1
  392. package/dist/features/themes/components/SettingsAppearanceTab.js +6 -9
  393. package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -1
  394. package/dist/features/themes/feature.js +2 -0
  395. package/dist/features/themes/feature.js.map +1 -1
  396. package/dist/features/themes/index.d.ts +2 -1
  397. package/dist/features/themes/react/SettingsAppearanceTab.js +7 -10
  398. package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -1
  399. package/dist/features/themes/schema.d.ts +2 -6
  400. package/dist/features/themes/schema.js.map +1 -1
  401. package/dist/features/themes/theme-runtime.d.ts +1 -1
  402. package/dist/features/themes/theme-runtime.js +4 -2
  403. package/dist/features/themes/theme-runtime.js.map +1 -1
  404. package/dist/features/transcript/TranscriptSegmentView.js +48 -28
  405. package/dist/features/transcript/TranscriptSegmentView.js.map +1 -1
  406. package/dist/features/transcript/feature.js +21 -19
  407. package/dist/features/transcript/feature.js.map +1 -1
  408. package/dist/features/transcript/react/TranscriptSegmentView.js +55 -36
  409. package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -1
  410. package/dist/features/transcript/segment-node.d.ts +2 -0
  411. package/dist/features/transcript/segment-node.js +35 -7
  412. package/dist/features/transcript/segment-node.js.map +1 -1
  413. package/dist/i18n/de/composites.js +91 -1
  414. package/dist/i18n/de/composites.js.map +1 -1
  415. package/dist/i18n/de/integrations.js +49 -8
  416. package/dist/i18n/de/integrations.js.map +1 -1
  417. package/dist/i18n/de/media.js +0 -1
  418. package/dist/i18n/de/media.js.map +1 -1
  419. package/dist/i18n/de/palette.js +22 -0
  420. package/dist/i18n/de/palette.js.map +1 -0
  421. package/dist/i18n/de/tables.js +0 -1
  422. package/dist/i18n/de/tables.js.map +1 -1
  423. package/dist/i18n/de/transcript.js +2 -1
  424. package/dist/i18n/de/transcript.js.map +1 -1
  425. package/dist/i18n/de/tree.js +3 -0
  426. package/dist/i18n/de/tree.js.map +1 -1
  427. package/dist/i18n/de.d.ts +157 -11
  428. package/dist/i18n/de.js +3 -1
  429. package/dist/i18n/de.js.map +1 -1
  430. package/dist/i18n/en/composites.js +89 -1
  431. package/dist/i18n/en/composites.js.map +1 -1
  432. package/dist/i18n/en/integrations.js +49 -8
  433. package/dist/i18n/en/integrations.js.map +1 -1
  434. package/dist/i18n/en/media.js +0 -1
  435. package/dist/i18n/en/media.js.map +1 -1
  436. package/dist/i18n/en/palette.js +22 -0
  437. package/dist/i18n/en/palette.js.map +1 -0
  438. package/dist/i18n/en/tables.js +0 -1
  439. package/dist/i18n/en/tables.js.map +1 -1
  440. package/dist/i18n/en/transcript.js +2 -1
  441. package/dist/i18n/en/transcript.js.map +1 -1
  442. package/dist/i18n/en/tree.js +3 -0
  443. package/dist/i18n/en/tree.js.map +1 -1
  444. package/dist/i18n/en.js +3 -1
  445. package/dist/i18n/en.js.map +1 -1
  446. package/dist/index.d.ts +4 -3
  447. package/dist/integrations/composite-ai/bibliography-fetch.d.ts +31 -0
  448. package/dist/integrations/composite-ai/bibliography-fetch.js +159 -0
  449. package/dist/integrations/composite-ai/bibliography-fetch.js.map +1 -0
  450. package/dist/integrations/composite-ai/composite-fill.d.ts +30 -8
  451. package/dist/integrations/composite-ai/composite-fill.js +97 -56
  452. package/dist/integrations/composite-ai/composite-fill.js.map +1 -1
  453. package/dist/integrations/composite-ai/composite-summary.d.ts +4 -12
  454. package/dist/integrations/composite-ai/composite-summary.js +7 -26
  455. package/dist/integrations/composite-ai/composite-summary.js.map +1 -1
  456. package/dist/integrations/composite-ai/derive.d.ts +29 -0
  457. package/dist/integrations/composite-ai/derive.js +173 -0
  458. package/dist/integrations/composite-ai/derive.js.map +1 -0
  459. package/dist/integrations/composite-ai/index.d.ts +11 -7
  460. package/dist/integrations/composite-ai/index.js +72 -14
  461. package/dist/integrations/composite-ai/index.js.map +1 -1
  462. package/dist/integrations/composite-ai/rendition.d.ts +45 -0
  463. package/dist/integrations/composite-ai/rendition.js +314 -0
  464. package/dist/integrations/composite-ai/rendition.js.map +1 -0
  465. package/dist/integrations/composite-media/index.d.ts +7 -5
  466. package/dist/integrations/composite-media/index.js +86 -13
  467. package/dist/integrations/composite-media/index.js.map +1 -1
  468. package/dist/integrations/transcript-ai/index.d.ts +1 -1
  469. package/dist/integrations/transcript-ai/index.js +5 -2
  470. package/dist/integrations/transcript-ai/index.js.map +1 -1
  471. package/dist/integrations/transcript-ai/protocol.d.ts +2 -12
  472. package/dist/integrations/transcript-ai/protocol.js +0 -2
  473. package/dist/integrations/transcript-ai/protocol.js.map +1 -1
  474. package/dist/integrations/transcript-ai/transcript-cleanup.d.ts +5 -5
  475. package/dist/integrations/transcript-ai/transcript-cleanup.js +7 -10
  476. package/dist/integrations/transcript-ai/transcript-cleanup.js.map +1 -1
  477. package/dist/markdown/MarkdownSurface.vue.d.ts +12 -11
  478. package/dist/markdown/MarkdownSurface2.js +3 -6
  479. package/dist/markdown/MarkdownSurface2.js.map +1 -1
  480. package/dist/markdown/document.js +1 -1
  481. package/dist/markdown/source-mode.d.ts +1 -1
  482. package/dist/nuxt/module.d.ts +1402 -54
  483. package/dist/nuxt/module.js +6 -49
  484. package/dist/nuxt/module.js.map +1 -1
  485. package/dist/nuxt/runtime/install-context.d.ts +7 -3
  486. package/dist/nuxt/runtime/install-context.js +14 -8
  487. package/dist/nuxt/runtime/install-context.js.map +1 -1
  488. package/dist/nuxt/runtime/plugins/editor-context-nuxt-ui.client.ts +2 -2
  489. package/dist/nuxt/runtime/server/plugins/editor-server.js +20 -12
  490. package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -1
  491. package/dist/presets/compose.d.ts +94 -0
  492. package/dist/presets/compose.js +164 -0
  493. package/dist/presets/compose.js.map +1 -0
  494. package/dist/react/AdvancedEditor.d.ts +15 -15
  495. package/dist/react/AdvancedEditor.js +15 -13
  496. package/dist/react/AdvancedEditor.js.map +1 -1
  497. package/dist/react/EditorCommandPalette.d.ts +13 -0
  498. package/dist/react/EditorCommandPalette.js +118 -0
  499. package/dist/react/EditorCommandPalette.js.map +1 -0
  500. package/dist/react/EditorSettingsModal.d.ts +5 -5
  501. package/dist/react/EditorSettingsModal.js +7 -4
  502. package/dist/react/EditorSettingsModal.js.map +1 -1
  503. package/dist/react/EditorSettingsPanel.d.ts +7 -7
  504. package/dist/react/EditorSettingsPanel.js +8 -5
  505. package/dist/react/EditorSettingsPanel.js.map +1 -1
  506. package/dist/react/EditorSurface.d.ts +7 -7
  507. package/dist/react/EditorSurface.js +10 -6
  508. package/dist/react/EditorSurface.js.map +1 -1
  509. package/dist/react/EditorToolbar.d.ts +4 -6
  510. package/dist/react/EditorToolbar.js +29 -37
  511. package/dist/react/EditorToolbar.js.map +1 -1
  512. package/dist/react/SimpleEditor.d.ts +22 -23
  513. package/dist/react/SimpleEditor.js +21 -7
  514. package/dist/react/SimpleEditor.js.map +1 -1
  515. package/dist/react/advanced.d.ts +4 -3
  516. package/dist/react/advanced.js +2 -2
  517. package/dist/react/compose.d.ts +20 -0
  518. package/dist/react/compose.js +49 -0
  519. package/dist/react/compose.js.map +1 -0
  520. package/dist/react/composed-surface.d.ts +39 -0
  521. package/dist/react/composed-surface.js +71 -0
  522. package/dist/react/composed-surface.js.map +1 -0
  523. package/dist/react/context.js +6 -2
  524. package/dist/react/context.js.map +1 -1
  525. package/dist/react/index.d.ts +2 -1
  526. package/dist/react/index.js +2 -1
  527. package/dist/react/key-labels.js +15 -0
  528. package/dist/react/key-labels.js.map +1 -0
  529. package/dist/react/settings.d.ts +1 -1
  530. package/dist/react/simple.d.ts +2 -2
  531. package/dist/react/ui/command.js +36 -1
  532. package/dist/react/ui/command.js.map +1 -1
  533. package/dist/schema/advanced.d.ts +6 -6
  534. package/dist/schema/advanced.js +26 -29
  535. package/dist/schema/advanced.js.map +1 -1
  536. package/dist/server/ai.d.ts +5 -16
  537. package/dist/server/ai.js.map +1 -1
  538. package/dist/server/auth.d.ts +9 -0
  539. package/dist/server/collab-state.d.ts +1 -1
  540. package/dist/server/collab-state.js.map +1 -1
  541. package/dist/server/collab.d.ts +13 -13
  542. package/dist/server/collab.js +34 -18
  543. package/dist/server/collab.js.map +1 -1
  544. package/dist/server/crossref.js +78 -0
  545. package/dist/server/crossref.js.map +1 -0
  546. package/dist/server/errors.d.ts +1 -1
  547. package/dist/server/errors.js +1 -1
  548. package/dist/server/errors.js.map +1 -1
  549. package/dist/server/extract.js +308 -0
  550. package/dist/server/extract.js.map +1 -0
  551. package/dist/server/h3.d.ts +8 -0
  552. package/dist/{nuxt/runtime/server/utils/editor-route.js → server/h3.js} +8 -16
  553. package/dist/server/h3.js.map +1 -0
  554. package/dist/server/handlers/ai.d.ts +32 -10
  555. package/dist/server/handlers/ai.js +172 -37
  556. package/dist/server/handlers/ai.js.map +1 -1
  557. package/dist/server/handlers/context.d.ts +12 -5
  558. package/dist/server/handlers/context.js +10 -4
  559. package/dist/server/handlers/context.js.map +1 -1
  560. package/dist/server/handlers/editor.d.ts +19 -13
  561. package/dist/server/handlers/editor.js +49 -38
  562. package/dist/server/handlers/editor.js.map +1 -1
  563. package/dist/server/handlers/index.d.ts +4 -4
  564. package/dist/server/handlers/index.js +4 -4
  565. package/dist/server/host.d.ts +16 -25
  566. package/dist/server/host.js +58 -41
  567. package/dist/server/host.js.map +1 -1
  568. package/dist/server/index.d.ts +6 -4
  569. package/dist/server/index.js +3 -2
  570. package/dist/server/pdf.js +97 -0
  571. package/dist/server/pdf.js.map +1 -0
  572. package/dist/server/{adapter.d.ts → ports.d.ts} +81 -30
  573. package/dist/server/ports.js +29 -0
  574. package/dist/server/ports.js.map +1 -0
  575. package/dist/server/routes.d.ts +22 -0
  576. package/dist/server/routes.js +144 -0
  577. package/dist/server/routes.js.map +1 -0
  578. package/dist/settings/index.d.ts +1 -1
  579. package/dist/settings/index.js.map +1 -1
  580. package/dist/styles/composites.css +25 -0
  581. package/dist/tree/DocumentTree.js +56 -29
  582. package/dist/tree/DocumentTree.js.map +1 -1
  583. package/dist/tree/react/DocumentTree.js +23 -0
  584. package/dist/tree/react/DocumentTree.js.map +1 -1
  585. package/dist/tree/tree-host.js +2 -2
  586. package/dist/tree/tree-items.js +1 -1
  587. package/dist/vue/AdvancedEditor.js +30 -9
  588. package/dist/vue/AdvancedEditor.js.map +1 -1
  589. package/dist/vue/AdvancedEditor.vue.d.ts +32 -12
  590. package/dist/vue/SimpleEditor.js +62 -16
  591. package/dist/vue/SimpleEditor.js.map +1 -1
  592. package/dist/vue/SimpleEditor.vue.d.ts +39 -9
  593. package/dist/vue/advanced.d.ts +3 -2
  594. package/dist/vue/advanced.js +2 -2
  595. package/dist/vue/components/EditorCommandPalette.js +91 -0
  596. package/dist/vue/components/EditorCommandPalette.js.map +1 -0
  597. package/dist/vue/components/EditorCommandPalette.vue.d.ts +15 -0
  598. package/dist/vue/components/EditorSettingsModal.js +10 -6
  599. package/dist/vue/components/EditorSettingsModal.js.map +1 -1
  600. package/dist/vue/components/EditorSettingsModal.vue.d.ts +4 -4
  601. package/dist/vue/components/EditorSettingsPanel.js +10 -6
  602. package/dist/vue/components/EditorSettingsPanel.js.map +1 -1
  603. package/dist/vue/components/EditorSettingsPanel.vue.d.ts +6 -6
  604. package/dist/vue/components/EditorSurface.js +11 -6
  605. package/dist/vue/components/EditorSurface.js.map +1 -1
  606. package/dist/vue/components/EditorSurface.vue.d.ts +11 -11
  607. package/dist/vue/components/EditorToolbar.js +41 -49
  608. package/dist/vue/components/EditorToolbar.js.map +1 -1
  609. package/dist/vue/components/EditorToolbar.vue.d.ts +2 -4
  610. package/dist/vue/compose.d.ts +17 -0
  611. package/dist/vue/compose.js +51 -0
  612. package/dist/vue/compose.js.map +1 -0
  613. package/dist/vue/context-key.d.ts +6 -0
  614. package/dist/vue/context-key.js +6 -0
  615. package/dist/vue/context-key.js.map +1 -0
  616. package/dist/vue/context.d.ts +8 -6
  617. package/dist/vue/context.js +6 -5
  618. package/dist/vue/context.js.map +1 -1
  619. package/dist/vue/index.d.ts +10 -8
  620. package/dist/vue/index.js +10 -8
  621. package/dist/vue/kit/index.d.ts +2 -2
  622. package/dist/vue/kit/nuxt-ui.js +23 -0
  623. package/dist/vue/kit/nuxt-ui.js.map +1 -1
  624. package/dist/vue/kit/types.d.ts +40 -1
  625. package/package.json +30 -16
  626. package/dist/adapters/comments/client.d.ts +0 -64
  627. package/dist/adapters/comments/client.js.map +0 -1
  628. package/dist/adapters/routes.js.map +0 -1
  629. package/dist/core/toolbar.d.ts +0 -74
  630. package/dist/core/toolbar.js +0 -45
  631. package/dist/core/toolbar.js.map +0 -1
  632. package/dist/integrations/composite-ai/document-transcribe.d.ts +0 -14
  633. package/dist/integrations/composite-ai/document-transcribe.js +0 -89
  634. package/dist/integrations/composite-ai/document-transcribe.js.map +0 -1
  635. package/dist/nuxt/runtime/server/api/ai/chat.post.d.ts +0 -5
  636. package/dist/nuxt/runtime/server/api/ai/chat.post.js +0 -8
  637. package/dist/nuxt/runtime/server/api/ai/chat.post.js.map +0 -1
  638. package/dist/nuxt/runtime/server/api/ai/complete.post.d.ts +0 -5
  639. package/dist/nuxt/runtime/server/api/ai/complete.post.js +0 -8
  640. package/dist/nuxt/runtime/server/api/ai/complete.post.js.map +0 -1
  641. package/dist/nuxt/runtime/server/api/ai/generate.post.d.ts +0 -5
  642. package/dist/nuxt/runtime/server/api/ai/generate.post.js +0 -8
  643. package/dist/nuxt/runtime/server/api/ai/generate.post.js.map +0 -1
  644. package/dist/nuxt/runtime/server/api/ai/models.get.d.ts +0 -5
  645. package/dist/nuxt/runtime/server/api/ai/models.get.js +0 -8
  646. package/dist/nuxt/runtime/server/api/ai/models.get.js.map +0 -1
  647. package/dist/nuxt/runtime/server/api/ai/transcribe.post.d.ts +0 -5
  648. package/dist/nuxt/runtime/server/api/ai/transcribe.post.js +0 -8
  649. package/dist/nuxt/runtime/server/api/ai/transcribe.post.js.map +0 -1
  650. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.d.ts +0 -5
  651. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js +0 -8
  652. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js.map +0 -1
  653. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.d.ts +0 -5
  654. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js +0 -8
  655. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js.map +0 -1
  656. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.d.ts +0 -5
  657. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js +0 -8
  658. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js.map +0 -1
  659. package/dist/nuxt/runtime/server/api/editor/settings.get.d.ts +0 -5
  660. package/dist/nuxt/runtime/server/api/editor/settings.get.js +0 -8
  661. package/dist/nuxt/runtime/server/api/editor/settings.get.js.map +0 -1
  662. package/dist/nuxt/runtime/server/api/editor/settings.put.d.ts +0 -5
  663. package/dist/nuxt/runtime/server/api/editor/settings.put.js +0 -8
  664. package/dist/nuxt/runtime/server/api/editor/settings.put.js.map +0 -1
  665. package/dist/nuxt/runtime/server/api/editor/tags.get.d.ts +0 -5
  666. package/dist/nuxt/runtime/server/api/editor/tags.get.js +0 -8
  667. package/dist/nuxt/runtime/server/api/editor/tags.get.js.map +0 -1
  668. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.d.ts +0 -5
  669. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js +0 -8
  670. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js.map +0 -1
  671. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.d.ts +0 -5
  672. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js +0 -8
  673. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js.map +0 -1
  674. package/dist/nuxt/runtime/server/api/editor/themes/index.get.d.ts +0 -5
  675. package/dist/nuxt/runtime/server/api/editor/themes/index.get.js +0 -8
  676. package/dist/nuxt/runtime/server/api/editor/themes/index.get.js.map +0 -1
  677. package/dist/nuxt/runtime/server/api/editor/themes/index.post.d.ts +0 -5
  678. package/dist/nuxt/runtime/server/api/editor/themes/index.post.js +0 -8
  679. package/dist/nuxt/runtime/server/api/editor/themes/index.post.js.map +0 -1
  680. package/dist/nuxt/runtime/server/api/editor/users.get.d.ts +0 -5
  681. package/dist/nuxt/runtime/server/api/editor/users.get.js +0 -8
  682. package/dist/nuxt/runtime/server/api/editor/users.get.js.map +0 -1
  683. package/dist/nuxt/runtime/server/plugins/collab.d.ts +0 -5
  684. package/dist/nuxt/runtime/server/plugins/collab.js +0 -10
  685. package/dist/nuxt/runtime/server/plugins/collab.js.map +0 -1
  686. package/dist/nuxt/runtime/server/routes/collab/[id].d.ts +0 -5
  687. package/dist/nuxt/runtime/server/routes/collab/[id].js +0 -35
  688. package/dist/nuxt/runtime/server/routes/collab/[id].js.map +0 -1
  689. package/dist/nuxt/runtime/server/utils/editor-route.d.ts +0 -11
  690. package/dist/nuxt/runtime/server/utils/editor-route.js.map +0 -1
  691. package/dist/presets/advanced.d.ts +0 -33
  692. package/dist/presets/advanced.js +0 -50
  693. package/dist/presets/advanced.js.map +0 -1
  694. package/dist/presets/simple.d.ts +0 -9
  695. package/dist/presets/simple.js +0 -12
  696. package/dist/presets/simple.js.map +0 -1
  697. package/dist/react/advanced-preset.d.ts +0 -11
  698. package/dist/react/advanced-preset.js +0 -31
  699. package/dist/react/advanced-preset.js.map +0 -1
  700. package/dist/vue/advanced-preset.d.ts +0 -13
  701. package/dist/vue/advanced-preset.js +0 -33
  702. package/dist/vue/advanced-preset.js.map +0 -1
  703. package/docs/extending.md +0 -538
  704. package/docs/integration.md +0 -632
  705. package/docs/llms.md +0 -383
  706. package/docs/usage.md +0 -1076
@@ -1,9 +1,10 @@
1
+ import { defineEditorConfig, publicConfig, serverConfig } from "../config/index.js";
1
2
  import { addPlugin, addServerScanDir, createResolver, defineNuxtModule } from "nuxt/kit";
2
3
  //#region src/nuxt/module.ts
3
4
  /**
4
5
  * Nuxt/Nitro integration of the editor package: the client context plugin (settings persistence, AI configuration),
5
- * the Nitro API routes, the collaboration websocket and the AI configuration with its server-only secrets. The host
6
- * plugs in through `setEditorAdapter()` (`@ecsplico/editor/server`) in a Nitro plugin (auth, loading and storing
6
+ * a server plugin that mounts the editor's routes and the collaboration websocket (`installEditorServer`) and the AI configuration with its server-only secrets. The host
7
+ * plugs in through `setEditorPorts()` (`@ecsplico/editor/server`) in a Nitro plugin (auth, loading and storing
7
8
  * document content). Components are imported explicitly from the package entries; nothing is auto-registered.
8
9
  */
9
10
  var module_default = defineNuxtModule({
@@ -11,33 +12,6 @@ var module_default = defineNuxtModule({
11
12
  name: "tiptap-editor",
12
13
  configKey: "tiptapEditor"
13
14
  },
14
- defaults: {
15
- locale: "de",
16
- collab: { authenticateUpgrade: false },
17
- ai: {
18
- presets: {
19
- sonnet: {
20
- label: "Claude Sonnet 4.5 (OpenRouter)",
21
- endpoint: "https://openrouter.ai/api/v1",
22
- model: "anthropic/claude-sonnet-4.5"
23
- },
24
- flashLite: {
25
- label: "Gemini 2.5 Flash Lite (OpenRouter)",
26
- endpoint: "https://openrouter.ai/api/v1",
27
- model: "google/gemini-2.5-flash-lite"
28
- }
29
- },
30
- slots: {
31
- complete: "flashLite",
32
- rewrite: "sonnet",
33
- generate: "sonnet"
34
- },
35
- rateLimit: {
36
- max: 30,
37
- windowMs: 6e4
38
- }
39
- }
40
- },
41
15
  setup(options, nuxt) {
42
16
  const { resolve } = createResolver(import.meta.url);
43
17
  const packageSrc = resolve("..");
@@ -67,30 +41,13 @@ var module_default = defineNuxtModule({
67
41
  packageSrc
68
42
  ]
69
43
  };
44
+ const config = defineEditorConfig(options);
70
45
  nuxt.options.runtimeConfig.tiptapEditor = {
71
- collab: { authenticateUpgrade: options.collab.authenticateUpgrade },
72
- ai: {
73
- apiKey: "",
74
- presets: Object.fromEntries(Object.entries(options.ai.presets).map(([id, preset]) => [id, {
75
- ...preset,
76
- apiKey: preset.apiKey ?? ""
77
- }])),
78
- slots: options.ai.slots,
79
- rateLimit: options.ai.rateLimit,
80
- ...options.ai.transcription && { transcription: {
81
- ...options.ai.transcription,
82
- apiKey: options.ai.transcription.apiKey ?? ""
83
- } }
84
- },
46
+ ...serverConfig(config),
85
47
  ...nuxt.options.runtimeConfig.tiptapEditor
86
48
  };
87
49
  nuxt.options.runtimeConfig.public.tiptapEditor = {
88
- locale: options.locale,
89
- ...options.messages && { messages: options.messages },
90
- ai: {
91
- slots: options.ai.slots,
92
- transcription: Boolean(options.ai.transcription)
93
- },
50
+ ...publicConfig(config),
94
51
  ...nuxt.options.runtimeConfig.public.tiptapEditor
95
52
  };
96
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","names":[],"sources":["../../src/nuxt/module.ts"],"sourcesContent":["import { addPlugin, addServerScanDir, createResolver, defineNuxtModule } from 'nuxt/kit'\nimport type { Locale, Messages } from '../i18n'\nimport type { ModelSlot } from '../settings'\n\nexport interface ModuleOptions {\n /** Language of the editor's strings: `'de'` (default) or `'en'`. Set once per app; a host that switches languages at run time recreates the editor context. */\n locale: Locale\n /** Overrides of single messages by key (see `MessageKey`), applied on top of the catalog of `locale`; must be JSON-serialisable. */\n messages?: Partial<Messages>\n ai: {\n /**\n * Server-defined model presets (any OpenAI-compatible chat completions endpoint), keyed by preset id. The key is\n * per preset or the shared `apiKey`, both from env only: `NUXT_TIPTAP_EDITOR_AI_PRESETS_<ID>_API_KEY` (`<ID>` = the\n * preset id in upper snake case, e.g. `flashLite` → `FLASH_LITE`) or `NUXT_TIPTAP_EDITOR_AI_API_KEY`. Preset ids\n * must be camelCase so the env names map onto them.\n */\n presets: Record<string, { label: string, endpoint: string, model: string, apiKey?: string }>\n /** Default preset per slot; users may override in settings. The `complete` model must support assistant prefill. */\n slots: Record<ModelSlot, string>\n /** Per-user limit shared by all AI endpoints: at most `max` requests per sliding `windowMs`. */\n rateLimit: { max: number, windowMs: number }\n /**\n * Speech-to-text for audio/video `document` composites: any OpenAI-compatible `<endpoint>/audio/transcriptions`\n * (e.g. OpenAI `whisper-1`; OpenRouter presets do not provide one). Absent = the action and the endpoint are off.\n * The key comes from env only: `NUXT_TIPTAP_EDITOR_AI_TRANSCRIPTION_API_KEY`.\n */\n transcription?: { endpoint: string, model: string, apiKey?: string }\n }\n collab: {\n /**\n * Authenticate the `/collab/:id` websocket upgrade itself (`EditorAdapter.authenticate` with the upgrade request's\n * headers) and refuse it with HTTP 401 for an unknown user. Default `false`: the upgrade always succeeds, the user\n * is authenticated afterwards from the headers or the provider's `token`, and an unauthenticated socket is closed\n * with code 4401. Enable only when every client authenticates by cookie/headers: a client that sends its identity\n * as `collaboration.token` (no cookies) cannot connect then. Env override:\n * `NUXT_TIPTAP_EDITOR_COLLAB_AUTHENTICATE_UPGRADE=true`.\n */\n authenticateUpgrade: boolean\n }\n}\n\n/**\n * Nuxt/Nitro integration of the editor package: the client context plugin (settings persistence, AI configuration),\n * the Nitro API routes, the collaboration websocket and the AI configuration with its server-only secrets. The host\n * plugs in through `setEditorAdapter()` (`@ecsplico/editor/server`) in a Nitro plugin (auth, loading and storing\n * document content). Components are imported explicitly from the package entries; nothing is auto-registered.\n */\nexport default defineNuxtModule<ModuleOptions>({\n meta: { name: 'tiptap-editor', configKey: 'tiptapEditor' },\n defaults: {\n locale: 'de',\n collab: { authenticateUpgrade: false },\n ai: {\n presets: {\n sonnet: { label: 'Claude Sonnet 4.5 (OpenRouter)', endpoint: 'https://openrouter.ai/api/v1', model: 'anthropic/claude-sonnet-4.5' },\n flashLite: { label: 'Gemini 2.5 Flash Lite (OpenRouter)', endpoint: 'https://openrouter.ai/api/v1', model: 'google/gemini-2.5-flash-lite' },\n },\n slots: { complete: 'flashLite', rewrite: 'sonnet', generate: 'sonnet' },\n rateLimit: { max: 30, windowMs: 60_000 },\n },\n },\n setup(options, nuxt) {\n const { resolve } = createResolver(import.meta.url)\n // `resolve('..')` is the package root of the built output (`dist`) or of `src` in this repository's app: both\n // hold the stylesheets and the unbundled `nuxt/runtime` files, which Nuxt compiles for the client and Nitro for the server.\n const packageSrc = resolve('..')\n nuxt.options.build.transpile.push(packageSrc)\n // The Nuxt UI token map comes first: the feature sheets (and an Obsidian theme, `themes.css`, last) read and may override `--sk-*`.\n nuxt.options.css.push(resolve('../vue/kit/nuxt-ui.css'))\n nuxt.options.css.push(\n resolve('../styles/core.css'),\n resolve('../styles/media.css'),\n resolve('../styles/mentions.css'),\n resolve('../styles/authors.css'),\n resolve('../styles/comments.css'),\n resolve('../styles/transcript.css'),\n resolve('../styles/composites.css'),\n resolve('../styles/ai.css'),\n resolve('../styles/collab.css'),\n resolve('../styles/block-ui.css'),\n resolve('../styles/themes.css'),\n )\n addPlugin({ src: resolve('./runtime/plugins/editor-context-nuxt-ui.client.ts'), mode: 'client' })\n addServerScanDir(resolve('./runtime/server'))\n // Tailwind only scans the app layers listed in Nuxt UI's generated `ui.css` (`@source \"<layer>/app/**/*\"`), so the\n // utility classes used by the package's components would never be generated. Append its source. `@nuxt/ui` must be\n // registered before this module.\n nuxt.hook('modules:done', () => {\n const uiCss = nuxt.options.build.templates.find(t => t.filename === 'ui.css')\n if (!uiCss?.getContents) throw new Error('tiptap-editor: @nuxt/ui muss vor diesem Modul registriert sein (ui.css-Template fehlt)')\n const getContents = uiCss.getContents\n uiCss.getContents = async data => `@source \"${packageSrc}/**/*\";\\n${await getContents(data)}`\n })\n nuxt.options.nitro.experimental = { ...nuxt.options.nitro.experimental, websocket: true }\n // Nitro bundles the package (the runtime files import `h3` and `nitropack/runtime`, which the host's Nitro resolves): never leave it external.\n nuxt.options.nitro.externals = { ...nuxt.options.nitro.externals, inline: [...(nuxt.options.nitro.externals?.inline ?? []), '@ecsplico/editor', packageSrc] }\n nuxt.options.runtimeConfig.tiptapEditor = {\n collab: { authenticateUpgrade: options.collab.authenticateUpgrade },\n ai: {\n apiKey: '',\n // Every preset gets an empty `apiKey`, so its env variable has a key to override.\n presets: Object.fromEntries(Object.entries(options.ai.presets).map(([id, preset]) => [id, { ...preset, apiKey: preset.apiKey ?? '' }])),\n slots: options.ai.slots,\n rateLimit: options.ai.rateLimit,\n // `apiKey` defaults to '' so its env variable has a key to override.\n ...(options.ai.transcription && { transcription: { ...options.ai.transcription, apiKey: options.ai.transcription.apiKey ?? '' } }),\n },\n ...(nuxt.options.runtimeConfig.tiptapEditor as object | undefined),\n }\n // Default slot presets for the client before `GET /api/ai/models` has answered; read by the client context plugin.\n nuxt.options.runtimeConfig.public.tiptapEditor = {\n locale: options.locale,\n ...(options.messages && { messages: options.messages }),\n ai: { slots: options.ai.slots, transcription: Boolean(options.ai.transcription) },\n ...(nuxt.options.runtimeConfig.public.tiptapEditor as object | undefined),\n }\n },\n})\n"],"mappings":";;;;;;;;AA+CA,IAAA,iBAAe,iBAAgC;CAC7C,MAAM;EAAE,MAAM;EAAiB,WAAW;CAAe;CACzD,UAAU;EACR,QAAQ;EACR,QAAQ,EAAE,qBAAqB,MAAM;EACrC,IAAI;GACF,SAAS;IACP,QAAQ;KAAE,OAAO;KAAkC,UAAU;KAAgC,OAAO;IAA8B;IAClI,WAAW;KAAE,OAAO;KAAsC,UAAU;KAAgC,OAAO;IAA+B;GAC5I;GACA,OAAO;IAAE,UAAU;IAAa,SAAS;IAAU,UAAU;GAAS;GACtE,WAAW;IAAE,KAAK;IAAI,UAAU;GAAO;EACzC;CACF;CACA,MAAM,SAAS,MAAM;EACnB,MAAM,EAAE,YAAY,eAAe,YAAY,GAAG;EAGlD,MAAM,aAAa,QAAQ,IAAI;EAC/B,KAAK,QAAQ,MAAM,UAAU,KAAK,UAAU;EAE5C,KAAK,QAAQ,IAAI,KAAK,QAAQ,wBAAwB,CAAC;EACvD,KAAK,QAAQ,IAAI,KACf,QAAQ,oBAAoB,GAC5B,QAAQ,qBAAqB,GAC7B,QAAQ,wBAAwB,GAChC,QAAQ,uBAAuB,GAC/B,QAAQ,wBAAwB,GAChC,QAAQ,0BAA0B,GAClC,QAAQ,0BAA0B,GAClC,QAAQ,kBAAkB,GAC1B,QAAQ,sBAAsB,GAC9B,QAAQ,wBAAwB,GAChC,QAAQ,sBAAsB,CAChC;EACA,UAAU;GAAE,KAAK,QAAQ,oDAAoD;GAAG,MAAM;EAAS,CAAC;EAChG,iBAAiB,QAAQ,kBAAkB,CAAC;EAI5C,KAAK,KAAK,sBAAsB;GAC9B,MAAM,QAAQ,KAAK,QAAQ,MAAM,UAAU,MAAK,MAAK,EAAE,aAAa,QAAQ;GAC5E,IAAI,CAAC,OAAO,aAAa,MAAM,IAAI,MAAM,wFAAwF;GACjI,MAAM,cAAc,MAAM;GAC1B,MAAM,cAAc,OAAM,SAAQ,YAAY,WAAW,WAAW,MAAM,YAAY,IAAI;EAC5F,CAAC;EACD,KAAK,QAAQ,MAAM,eAAe;GAAE,GAAG,KAAK,QAAQ,MAAM;GAAc,WAAW;EAAK;EAExF,KAAK,QAAQ,MAAM,YAAY;GAAE,GAAG,KAAK,QAAQ,MAAM;GAAW,QAAQ;IAAC,GAAI,KAAK,QAAQ,MAAM,WAAW,UAAU,CAAC;IAAI;IAAoB;GAAU;EAAE;EAC5J,KAAK,QAAQ,cAAc,eAAe;GACxC,QAAQ,EAAE,qBAAqB,QAAQ,OAAO,oBAAoB;GAClE,IAAI;IACF,QAAQ;IAER,SAAS,OAAO,YAAY,OAAO,QAAQ,QAAQ,GAAG,OAAO,CAAC,CAAC,KAAK,CAAC,IAAI,YAAY,CAAC,IAAI;KAAE,GAAG;KAAQ,QAAQ,OAAO,UAAU;IAAG,CAAC,CAAC,CAAC;IACtI,OAAO,QAAQ,GAAG;IAClB,WAAW,QAAQ,GAAG;IAEtB,GAAI,QAAQ,GAAG,iBAAiB,EAAE,eAAe;KAAE,GAAG,QAAQ,GAAG;KAAe,QAAQ,QAAQ,GAAG,cAAc,UAAU;IAAG,EAAE;GAClI;GACA,GAAI,KAAK,QAAQ,cAAc;EACjC;EAEA,KAAK,QAAQ,cAAc,OAAO,eAAe;GAC/C,QAAQ,QAAQ;GAChB,GAAI,QAAQ,YAAY,EAAE,UAAU,QAAQ,SAAS;GACrD,IAAI;IAAE,OAAO,QAAQ,GAAG;IAAO,eAAe,QAAQ,QAAQ,GAAG,aAAa;GAAE;GAChF,GAAI,KAAK,QAAQ,cAAc,OAAO;EACxC;CACF;AACF,CAAC"}
1
+ {"version":3,"file":"module.js","names":[],"sources":["../../src/nuxt/module.ts"],"sourcesContent":["import { addPlugin, addServerScanDir, createResolver, defineNuxtModule } from 'nuxt/kit'\nimport { defineEditorConfig, type EditorConfigInput, publicConfig, serverConfig } from '../config'\n\n/** Module options (`tiptapEditor` in `nuxt.config`): the editor's configuration with every key optional, see `EditorConfig`. */\nexport type ModuleOptions = EditorConfigInput\n\n/**\n * Nuxt/Nitro integration of the editor package: the client context plugin (settings persistence, AI configuration),\n * a server plugin that mounts the editor's routes and the collaboration websocket (`installEditorServer`) and the AI configuration with its server-only secrets. The host\n * plugs in through `setEditorPorts()` (`@ecsplico/editor/server`) in a Nitro plugin (auth, loading and storing\n * document content). Components are imported explicitly from the package entries; nothing is auto-registered.\n */\nexport default defineNuxtModule<ModuleOptions>({\n meta: { name: 'tiptap-editor', configKey: 'tiptapEditor' },\n setup(options, nuxt) {\n const { resolve } = createResolver(import.meta.url)\n // `resolve('..')` is the package root of the built output (`dist`) or of `src` in this repository's app: both\n // hold the stylesheets and the unbundled `nuxt/runtime` files, which Nuxt compiles for the client and Nitro for the server.\n const packageSrc = resolve('..')\n nuxt.options.build.transpile.push(packageSrc)\n // The Nuxt UI token map comes first: the feature sheets (and an Obsidian theme, `themes.css`, last) read and may override `--sk-*`.\n nuxt.options.css.push(resolve('../vue/kit/nuxt-ui.css'))\n nuxt.options.css.push(\n resolve('../styles/core.css'),\n resolve('../styles/media.css'),\n resolve('../styles/mentions.css'),\n resolve('../styles/authors.css'),\n resolve('../styles/comments.css'),\n resolve('../styles/transcript.css'),\n resolve('../styles/composites.css'),\n resolve('../styles/ai.css'),\n resolve('../styles/collab.css'),\n resolve('../styles/block-ui.css'),\n resolve('../styles/themes.css'),\n )\n addPlugin({ src: resolve('./runtime/plugins/editor-context-nuxt-ui.client.ts'), mode: 'client' })\n addServerScanDir(resolve('./runtime/server'))\n // Tailwind only scans the app layers listed in Nuxt UI's generated `ui.css` (`@source \"<layer>/app/**/*\"`), so the\n // utility classes used by the package's components would never be generated. Append its source. `@nuxt/ui` must be\n // registered before this module.\n nuxt.hook('modules:done', () => {\n const uiCss = nuxt.options.build.templates.find(t => t.filename === 'ui.css')\n if (!uiCss?.getContents) throw new Error('tiptap-editor: @nuxt/ui muss vor diesem Modul registriert sein (ui.css-Template fehlt)')\n const getContents = uiCss.getContents\n uiCss.getContents = async data => `@source \"${packageSrc}/**/*\";\\n${await getContents(data)}`\n })\n nuxt.options.nitro.experimental = { ...nuxt.options.nitro.experimental, websocket: true }\n // Nitro bundles the package (the runtime files import `h3` and `nitropack/runtime`, which the host's Nitro resolves): never leave it external.\n nuxt.options.nitro.externals = { ...nuxt.options.nitro.externals, inline: [...(nuxt.options.nitro.externals?.inline ?? []), '@ecsplico/editor', packageSrc] }\n const config = defineEditorConfig(options)\n // The server view keeps an empty `apiKey` on the shared key, every preset and the transcription, so their `NUXT_TIPTAP_EDITOR_AI_*` env variables have a key to override.\n nuxt.options.runtimeConfig.tiptapEditor = {\n ...serverConfig(config),\n ...(nuxt.options.runtimeConfig.tiptapEditor as object | undefined),\n }\n // Default slot presets for the client before `GET /api/ai/models` has answered; read by the client context plugin.\n nuxt.options.runtimeConfig.public.tiptapEditor = {\n ...publicConfig(config),\n ...(nuxt.options.runtimeConfig.public.tiptapEditor as object | undefined),\n }\n },\n})\n"],"mappings":";;;;;;;;;AAYA,IAAA,iBAAe,iBAAgC;CAC7C,MAAM;EAAE,MAAM;EAAiB,WAAW;CAAe;CACzD,MAAM,SAAS,MAAM;EACnB,MAAM,EAAE,YAAY,eAAe,YAAY,GAAG;EAGlD,MAAM,aAAa,QAAQ,IAAI;EAC/B,KAAK,QAAQ,MAAM,UAAU,KAAK,UAAU;EAE5C,KAAK,QAAQ,IAAI,KAAK,QAAQ,wBAAwB,CAAC;EACvD,KAAK,QAAQ,IAAI,KACf,QAAQ,oBAAoB,GAC5B,QAAQ,qBAAqB,GAC7B,QAAQ,wBAAwB,GAChC,QAAQ,uBAAuB,GAC/B,QAAQ,wBAAwB,GAChC,QAAQ,0BAA0B,GAClC,QAAQ,0BAA0B,GAClC,QAAQ,kBAAkB,GAC1B,QAAQ,sBAAsB,GAC9B,QAAQ,wBAAwB,GAChC,QAAQ,sBAAsB,CAChC;EACA,UAAU;GAAE,KAAK,QAAQ,oDAAoD;GAAG,MAAM;EAAS,CAAC;EAChG,iBAAiB,QAAQ,kBAAkB,CAAC;EAI5C,KAAK,KAAK,sBAAsB;GAC9B,MAAM,QAAQ,KAAK,QAAQ,MAAM,UAAU,MAAK,MAAK,EAAE,aAAa,QAAQ;GAC5E,IAAI,CAAC,OAAO,aAAa,MAAM,IAAI,MAAM,wFAAwF;GACjI,MAAM,cAAc,MAAM;GAC1B,MAAM,cAAc,OAAM,SAAQ,YAAY,WAAW,WAAW,MAAM,YAAY,IAAI;EAC5F,CAAC;EACD,KAAK,QAAQ,MAAM,eAAe;GAAE,GAAG,KAAK,QAAQ,MAAM;GAAc,WAAW;EAAK;EAExF,KAAK,QAAQ,MAAM,YAAY;GAAE,GAAG,KAAK,QAAQ,MAAM;GAAW,QAAQ;IAAC,GAAI,KAAK,QAAQ,MAAM,WAAW,UAAU,CAAC;IAAI;IAAoB;GAAU;EAAE;EAC5J,MAAM,SAAS,mBAAmB,OAAO;EAEzC,KAAK,QAAQ,cAAc,eAAe;GACxC,GAAG,aAAa,MAAM;GACtB,GAAI,KAAK,QAAQ,cAAc;EACjC;EAEA,KAAK,QAAQ,cAAc,OAAO,eAAe;GAC/C,GAAG,aAAa,MAAM;GACtB,GAAI,KAAK,QAAQ,cAAc,OAAO;EACxC;CACF;AACF,CAAC"}
@@ -1,16 +1,20 @@
1
1
  import { VueUiKit } from "../../vue/kit/types.js";
2
2
  import { App } from "vue";
3
+ import { $Fetch } from "ofetch";
3
4
  //#region src/nuxt/runtime/install-context.d.ts
4
5
  /**
5
6
  * Installs the editor context on a Nuxt app (client only: TipTap does not render on the server). Settings are kept per
6
7
  * account through the host's `/api/editor/settings`; the AI configuration is the module's public runtime config,
7
- * passed on as inert data. Features request through ofetch, which is what Nuxt's `$fetch` is on the client. `locale`
8
+ * passed on as inert data. The backend is the HTTP adapter over Nuxt's `$fetch` with `probe: true`: it asks the server
9
+ * which capabilities it serves and drops the others (no comments port, no themes, …), so compositions pruned by `backend`
10
+ * match the server. The returned promise settles once that is known; await it in the plugin so no editor mounts before. `locale`
8
11
  * and `messages` are the module's options of the same name. The kit is passed in by the plugin file the module registers
9
- * (`nuxtUiKit()`). Only the Vue app is read, so the parameter is structural: a host's
12
+ * (`nuxtUiKit()`). Only the Vue app and `$fetch` are read, so the parameter is structural: a host's
10
13
  * augmented `NuxtApp` (plugins adding `$router`, `$auth`, ...) and the `_NuxtApp` a plugin receives both fit.
11
14
  */
12
15
  export declare function installEditorContext(nuxtApp: {
13
16
  vueApp: App;
14
- }, kit: VueUiKit): void;
17
+ $fetch?: $Fetch;
18
+ }, kit: VueUiKit): Promise<void>;
15
19
  //#endregion
16
20
  //# sourceMappingURL=install-context.d.ts.map
@@ -1,23 +1,29 @@
1
+ import { createHttpBackend } from "../../adapters/http.js";
1
2
  import { createEditor } from "../../vue/context.js";
2
3
  import { useRuntimeConfig } from "#app";
3
4
  //#region src/nuxt/runtime/install-context.ts
4
5
  /**
5
6
  * Installs the editor context on a Nuxt app (client only: TipTap does not render on the server). Settings are kept per
6
7
  * account through the host's `/api/editor/settings`; the AI configuration is the module's public runtime config,
7
- * passed on as inert data. Features request through ofetch, which is what Nuxt's `$fetch` is on the client. `locale`
8
+ * passed on as inert data. The backend is the HTTP adapter over Nuxt's `$fetch` with `probe: true`: it asks the server
9
+ * which capabilities it serves and drops the others (no comments port, no themes, …), so compositions pruned by `backend`
10
+ * match the server. The returned promise settles once that is known; await it in the plugin so no editor mounts before. `locale`
8
11
  * and `messages` are the module's options of the same name. The kit is passed in by the plugin file the module registers
9
- * (`nuxtUiKit()`). Only the Vue app is read, so the parameter is structural: a host's
12
+ * (`nuxtUiKit()`). Only the Vue app and `$fetch` are read, so the parameter is structural: a host's
10
13
  * augmented `NuxtApp` (plugins adding `$router`, `$auth`, ...) and the `_NuxtApp` a plugin receives both fit.
11
14
  */
12
- function installEditorContext(nuxtApp, kit) {
13
- const { ai, locale, messages } = useRuntimeConfig().public.tiptapEditor;
15
+ async function installEditorContext(nuxtApp, kit) {
16
+ const config = useRuntimeConfig().public.tiptapEditor;
17
+ const backend = createHttpBackend({
18
+ probe: true,
19
+ ...nuxtApp.$fetch && { fetch: nuxtApp.$fetch }
20
+ });
14
21
  nuxtApp.vueApp.use(createEditor({
15
22
  kit,
16
- settings: { remote: true },
17
- ...ai && { ai },
18
- ...locale && { locale },
19
- ...messages && { messages }
23
+ backend,
24
+ ...config
20
25
  }));
26
+ await backend.ready;
21
27
  }
22
28
  //#endregion
23
29
  export { installEditorContext };
@@ -1 +1 @@
1
- {"version":3,"file":"install-context.js","names":[],"sources":["../../../src/nuxt/runtime/install-context.ts"],"sourcesContent":["import type { App } from 'vue'\nimport { useRuntimeConfig } from '#app'\nimport type { EditorAiConfig } from '../../core/context'\nimport type { Locale, Messages } from '../../i18n'\nimport { createEditor } from '../../vue/context'\nimport type { VueUiKit } from '../../vue/kit/types'\n\n/**\n * Installs the editor context on a Nuxt app (client only: TipTap does not render on the server). Settings are kept per\n * account through the host's `/api/editor/settings`; the AI configuration is the module's public runtime config,\n * passed on as inert data. Features request through ofetch, which is what Nuxt's `$fetch` is on the client. `locale`\n * and `messages` are the module's options of the same name. The kit is passed in by the plugin file the module registers\n * (`nuxtUiKit()`). Only the Vue app is read, so the parameter is structural: a host's\n * augmented `NuxtApp` (plugins adding `$router`, `$auth`, ...) and the `_NuxtApp` a plugin receives both fit.\n */\nexport function installEditorContext(nuxtApp: { vueApp: App }, kit: VueUiKit): void {\n const { ai, locale, messages } = useRuntimeConfig().public.tiptapEditor as { ai?: EditorAiConfig, locale?: Locale, messages?: Partial<Messages> }\n nuxtApp.vueApp.use(createEditor({ kit, settings: { remote: true }, ...(ai && { ai }), ...(locale && { locale }), ...(messages && { messages }) }))\n}\n"],"mappings":";;;;;;;;;;;AAeA,SAAgB,qBAAqB,SAA0B,KAAqB;CAClF,MAAM,EAAE,IAAI,QAAQ,aAAa,iBAAiB,CAAC,CAAC,OAAO;CAC3D,QAAQ,OAAO,IAAI,aAAa;EAAE;EAAK,UAAU,EAAE,QAAQ,KAAK;EAAG,GAAI,MAAM,EAAE,GAAG;EAAI,GAAI,UAAU,EAAE,OAAO;EAAI,GAAI,YAAY,EAAE,SAAS;CAAG,CAAC,CAAC;AACnJ"}
1
+ {"version":3,"file":"install-context.js","names":[],"sources":["../../../src/nuxt/runtime/install-context.ts"],"sourcesContent":["import type { $Fetch } from 'ofetch'\nimport type { App } from 'vue'\nimport { useRuntimeConfig } from '#app'\nimport { createHttpBackend } from '../../adapters/http'\nimport type { EditorPublicConfig } from '../../config'\nimport { createEditor } from '../../vue/context'\nimport type { VueUiKit } from '../../vue/kit/types'\n\n/**\n * Installs the editor context on a Nuxt app (client only: TipTap does not render on the server). Settings are kept per\n * account through the host's `/api/editor/settings`; the AI configuration is the module's public runtime config,\n * passed on as inert data. The backend is the HTTP adapter over Nuxt's `$fetch` with `probe: true`: it asks the server\n * which capabilities it serves and drops the others (no comments port, no themes, …), so compositions pruned by `backend`\n * match the server. The returned promise settles once that is known; await it in the plugin so no editor mounts before. `locale`\n * and `messages` are the module's options of the same name. The kit is passed in by the plugin file the module registers\n * (`nuxtUiKit()`). Only the Vue app and `$fetch` are read, so the parameter is structural: a host's\n * augmented `NuxtApp` (plugins adding `$router`, `$auth`, ...) and the `_NuxtApp` a plugin receives both fit.\n */\nexport async function installEditorContext(nuxtApp: { vueApp: App, $fetch?: $Fetch }, kit: VueUiKit): Promise<void> {\n const config = useRuntimeConfig().public.tiptapEditor as EditorPublicConfig\n const backend = createHttpBackend({ probe: true, ...(nuxtApp.$fetch && { fetch: nuxtApp.$fetch }) })\n nuxtApp.vueApp.use(createEditor({ kit, backend, ...config }))\n await backend.ready\n}\n"],"mappings":";;;;;;;;;;;;;;AAkBA,eAAsB,qBAAqB,SAA2C,KAA8B;CAClH,MAAM,SAAS,iBAAiB,CAAC,CAAC,OAAO;CACzC,MAAM,UAAU,kBAAkB;EAAE,OAAO;EAAM,GAAI,QAAQ,UAAU,EAAE,OAAO,QAAQ,OAAO;CAAG,CAAC;CACnG,QAAQ,OAAO,IAAI,aAAa;EAAE;EAAK;EAAS,GAAG;CAAO,CAAC,CAAC;CAC5D,MAAM,QAAQ;AAChB"}
@@ -3,6 +3,6 @@ import { installEditorContext } from '../install-context'
3
3
  import { defineNuxtPlugin } from '#app'
4
4
 
5
5
  // Registered by the module; see `install-context.ts`.
6
- export default defineNuxtPlugin((nuxtApp) => {
7
- installEditorContext(nuxtApp, nuxtUiKit())
6
+ export default defineNuxtPlugin(async (nuxtApp) => {
7
+ await installEditorContext(nuxtApp, nuxtUiKit())
8
8
  })
@@ -1,18 +1,26 @@
1
- import { configureEditorServer } from "../../../../server/host.js";
1
+ import { useEditorPorts, useEditorSchema } from "../../../../server/host.js";
2
+ import { installEditorServer } from "../../../../adapters/nitro.js";
2
3
  import { defineNitroPlugin, useRuntimeConfig } from "nitropack/runtime";
3
4
  //#region src/nuxt/runtime/server/plugins/editor-server.ts
4
- var editor_server_default = defineNitroPlugin(() => {
5
- const { ai } = useRuntimeConfig().tiptapEditor;
6
- configureEditorServer({
7
- ai: {
8
- presets: ai.presets,
9
- apiKey: ai.apiKey,
10
- slots: ai.slots,
11
- transcription: ai.transcription,
12
- missingKeyHint: (id) => ` (NUXT_TIPTAP_EDITOR_AI_PRESETS_${id.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toUpperCase()}_API_KEY oder NUXT_TIPTAP_EDITOR_AI_API_KEY)`
13
- },
14
- rateLimit: ai.rateLimit
5
+ var editor_server_default = defineNitroPlugin((nitroApp) => {
6
+ let server;
7
+ nitroApp.hooks.hook("request", () => {
8
+ server ??= install();
15
9
  });
10
+ function install() {
11
+ const { ai, rateLimit, collab } = useRuntimeConfig().tiptapEditor;
12
+ const ports = useEditorPorts();
13
+ return installEditorServer(nitroApp, {
14
+ ports,
15
+ collab: ports.collabState ? collab : false,
16
+ ai: {
17
+ ...ai,
18
+ missingKeyHint: (id) => ` (NUXT_TIPTAP_EDITOR_AI_PRESETS_${id.replace(/([a-z0-9])([A-Z])/g, "$1_$2").toUpperCase()}_API_KEY oder NUXT_TIPTAP_EDITOR_AI_API_KEY)`
19
+ },
20
+ rateLimit,
21
+ schema: useEditorSchema()
22
+ });
23
+ }
16
24
  });
17
25
  //#endregion
18
26
  export { editor_server_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"editor-server.js","names":[],"sources":["../../../../../src/nuxt/runtime/server/plugins/editor-server.ts"],"sourcesContent":["// Nitro's auto-imports are not applied to files under node_modules (the built package), so every Nitro/h3 helper is imported explicitly.\nimport { defineNitroPlugin, useRuntimeConfig } from 'nitropack/runtime'\nimport { configureEditorServer } from '../../../../server/host'\n\n// The AI configuration (presets, keys, slots, transcription) and the rate limit come from the module's runtime config.\nexport default defineNitroPlugin(() => {\n const { ai } = useRuntimeConfig().tiptapEditor\n configureEditorServer({\n ai: {\n presets: ai.presets,\n apiKey: ai.apiKey,\n slots: ai.slots,\n // Absent from the runtime config unless the module option is set, so it is missing from the generated config type.\n transcription: (ai as { transcription?: { endpoint: string, model: string, apiKey?: string } }).transcription,\n // Env names use the preset id in upper snake case (`flashLite` → `FLASH_LITE`), like Nuxt's runtime config mapping.\n missingKeyHint: id => ` (NUXT_TIPTAP_EDITOR_AI_PRESETS_${id.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toUpperCase()}_API_KEY oder NUXT_TIPTAP_EDITOR_AI_API_KEY)`,\n },\n rateLimit: ai.rateLimit,\n })\n})\n"],"mappings":";;;AAKA,IAAA,wBAAe,wBAAwB;CACrC,MAAM,EAAE,OAAO,iBAAiB,CAAC,CAAC;CAClC,sBAAsB;EACpB,IAAI;GACF,SAAS,GAAG;GACZ,QAAQ,GAAG;GACX,OAAO,GAAG;GAEV,eAAgB,GAAgF;GAEhG,iBAAgB,OAAM,mCAAmC,GAAG,QAAQ,sBAAsB,OAAO,CAAC,CAAC,YAAY,EAAE;EACnH;EACA,WAAW,GAAG;CAChB,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"editor-server.js","names":[],"sources":["../../../../../src/nuxt/runtime/server/plugins/editor-server.ts"],"sourcesContent":["// Nitro's auto-imports are not applied to files under node_modules (the built package), so every Nitro/h3 helper is imported explicitly.\nimport { defineNitroPlugin, useRuntimeConfig } from 'nitropack/runtime'\nimport { type EditorServer, installEditorServer } from '../../../../adapters/nitro'\nimport type { EditorServerConfig } from '../../../../config'\nimport { useEditorPorts, useEditorSchema } from '../../../../server/host'\n\n// Mounts the editor's routes and the collaboration websocket (`installEditorServer`) over the ports the host registered\n// with `setEditorPorts()`, and takes the AI configuration (presets, keys, slots, transcription), the rate limit and\n// `collab.authenticateUpgrade` from the module's runtime config.\n//\n// The host registers its ports in a Nitro plugin of its own, and Nitro does not order plugins of different layers and\n// modules reliably; the first request is the first moment every plugin has run (the routes it served before this\n// were file-based and read the ports per request, too). A failed install is retried by the next request.\nexport default defineNitroPlugin((nitroApp) => {\n let server: EditorServer | undefined\n nitroApp.hooks.hook('request', () => {\n server ??= install()\n })\n\n function install(): EditorServer {\n // The module's `serverConfig(defineEditorConfig(options))`, with the host's runtime-config and env overrides applied.\n const { ai, rateLimit, collab } = useRuntimeConfig().tiptapEditor as EditorServerConfig\n const ports = useEditorPorts()\n return installEditorServer(nitroApp, {\n ports,\n // Without persisted collaboration state the editor runs without the websocket (documents still load and save over HTTP).\n collab: ports.collabState ? collab : false,\n // Env names use the preset id in upper snake case (`flashLite` → `FLASH_LITE`), like Nuxt's runtime config mapping.\n ai: { ...ai, missingKeyHint: id => ` (NUXT_TIPTAP_EDITOR_AI_PRESETS_${id.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toUpperCase()}_API_KEY oder NUXT_TIPTAP_EDITOR_AI_API_KEY)` },\n rateLimit,\n schema: useEditorSchema(),\n })\n }\n})\n"],"mappings":";;;;AAaA,IAAA,wBAAe,mBAAmB,aAAa;CAC7C,IAAI;CACJ,SAAS,MAAM,KAAK,iBAAiB;EACnC,WAAW,QAAQ;CACrB,CAAC;CAED,SAAS,UAAwB;EAE/B,MAAM,EAAE,IAAI,WAAW,WAAW,iBAAiB,CAAC,CAAC;EACrD,MAAM,QAAQ,eAAe;EAC7B,OAAO,oBAAoB,UAAU;GACnC;GAEA,QAAQ,MAAM,cAAc,SAAS;GAErC,IAAI;IAAE,GAAG;IAAI,iBAAgB,OAAM,mCAAmC,GAAG,QAAQ,sBAAsB,OAAO,CAAC,CAAC,YAAY,EAAE;GAA8C;GAC5K;GACA,QAAQ,gBAAgB;EAC1B,CAAC;CACH;AACF,CAAC"}
@@ -0,0 +1,94 @@
1
+ import { EditorBackend } from "../core/backend.js";
2
+ import { EditorFeature, EditorPreset } from "../core/feature.js";
3
+ import { CommentsFeatureOptions } from "../features/comments/feature.js";
4
+ import { CompositeKind } from "../features/composites/kinds.js";
5
+ import { CompositeFeatureOptions } from "../features/composites/feature.js";
6
+ //#region src/presets/compose.d.ts
7
+ /** The id of a catalog feature (`CONTENT`, `INTERACTION`, `AI`) or of a host feature passed to `remove`. */
8
+ export type FeatureId = string;
9
+ /** How much document model the editor has: `basic` = `core-content`, `rich` = the full content catalog. */
10
+ export type ContentLevel = 'basic' | 'rich';
11
+ /** How much editing UX the editor has: `minimal` = `core-ui`, `full` = every interaction feature. */
12
+ export type InteractionLevel = 'minimal' | 'full';
13
+ /** The content features of each level, in canonical (schema) order. */
14
+ export declare const CONTENT: Record<ContentLevel, readonly FeatureId[]>;
15
+ /** The interaction features of each level, in canonical order. */
16
+ export declare const INTERACTION: Record<InteractionLevel, readonly FeatureId[]>;
17
+ /** The AI features (`ai: true`): the AI feature and the integrations that need it; each is installed when its `requires` are met. */
18
+ export declare const AI: readonly FeatureId[];
19
+ /**
20
+ * The features a UI layer binds, keyed by id; the other catalog features are framework-free and built here. The AI
21
+ * features are bound too, although `composite-ai` and `transcript-ai` have no components: the layer owns every import of
22
+ * `features/ai`, so a composition without `ai` binds none of them and its bundle holds no AI code. Each binding is a
23
+ * factory, called only for a feature the composition selects (`themes` reads the current Vue app when built, so
24
+ * unselected features are never built). `composites` receives the composition's `compositeKinds`, `comments` its
25
+ * `comments` options. `core-ui` takes no parameter here: the framework-free `simpleEditor()` has no command palette;
26
+ * a layer that has one (the `SimpleEditor` surfaces) builds `coreUiFeature({ palette })` itself.
27
+ */
28
+ export interface UiBindings<C> {
29
+ 'core-ui': () => EditorFeature<C>;
30
+ 'media': () => EditorFeature<C>;
31
+ 'transcript': () => EditorFeature<C>;
32
+ 'composites': (options: CompositeFeatureOptions) => EditorFeature<C>;
33
+ 'authors': () => EditorFeature<C>;
34
+ 'comments': (options: CommentsFeatureOptions) => EditorFeature<C>;
35
+ 'ai': () => EditorFeature<C>;
36
+ 'composite-ai': () => EditorFeature<C>;
37
+ 'transcript-ai': () => EditorFeature<C>;
38
+ 'collab': () => EditorFeature<C>;
39
+ 'block-ui': () => EditorFeature<C>;
40
+ 'themes': () => EditorFeature<C>;
41
+ }
42
+ /** What `composeEditor` builds the editor from. */
43
+ export interface ComposeOptions<C> {
44
+ /** The document model: a level or the content feature ids to install (`core-content` is always installed). */
45
+ content: ContentLevel | readonly FeatureId[];
46
+ /** The editing UX: a level or the interaction feature ids (`core-ui` is installed with any non-empty list); `[]` = a viewer without any interaction feature. */
47
+ interaction: InteractionLevel | readonly FeatureId[];
48
+ /** Installs `ai` and every integration whose `requires` are met (composite-AI iff composites, transcript-AI iff transcript). */
49
+ ai: boolean;
50
+ /** The backend the editor runs on: features needing a capability it lacks are omitted. Absent = nothing is pruned by capability. */
51
+ backend?: EditorBackend;
52
+ /**
53
+ * The host supplies the collaboration session itself (the surface's `collaboration` prop, e.g. from its own Hocuspocus
54
+ * provider), so `collab` and `comments` need no `collaboration` capability from the backend. Only a backend that must
55
+ * open the collaboration (`useEditorDocument(id, { collaboration: true })`) has to offer it. Default `false`.
56
+ */
57
+ collaboration?: boolean;
58
+ /** Host features, appended after the catalog in the given order. */
59
+ add?: readonly EditorFeature<C>[];
60
+ /** Features left out (catalog or host); features that require them are omitted as well. */
61
+ remove?: readonly FeatureId[];
62
+ /** The composite kinds („Bausteine“) offered in the editor (default: the built-in kinds); read once. */
63
+ compositeKinds?: readonly CompositeKind[];
64
+ /** Options of the comments feature, e.g. a host `model` (then comments need no `collab`). */
65
+ comments?: CommentsFeatureOptions;
66
+ }
67
+ /** The composed preset and the features that were selected but dropped, in composition order, with the reason. */
68
+ export interface ComposedEditor<C> extends EditorPreset<C> {
69
+ readonly omitted: readonly {
70
+ id: FeatureId;
71
+ reason: string;
72
+ }[];
73
+ }
74
+ /**
75
+ * Composes an editor from three dimensions plus the backend's capabilities, over the UI bindings of a layer.
76
+ *
77
+ * The feature list is `content` + `interaction` (+ the AI features when `ai`) + `add`, minus `remove`. `core-content` is
78
+ * always part of it and `core-ui` of every non-empty interaction list. Features that require a missing feature, or a
79
+ * backend capability `options.backend` lacks, are dropped until the list is stable and reported in `omitted` (so
80
+ * `ai: true` over a backend without `ai` installs no AI and says why). The catalog features keep their canonical order
81
+ * (content, interaction, AI), host features follow in the order given; the result is validated by `defineEditor`.
82
+ * Throws when an id of `content` is not a content feature, an id of `interaction` not an interaction feature, an id
83
+ * names no catalog feature, `remove` names `core-content`, or a selected feature has no binding in `ui`.
84
+ */
85
+ export declare function composeEditor<C>(ui: Partial<UiBindings<C>>, options: ComposeOptions<C>): ComposedEditor<C>;
86
+ /**
87
+ * The simple editor: `core-content` and `core-ui` (formatting, headings, lists, quotes, code, undo/redo). No backend, no AI,
88
+ * no collaboration, and no ⌘K command palette (`coreUiFeature()` gets no `palette` component here, the framework-free
89
+ * layer has none; the `SimpleEditor` components and the `composeEditor` of `/vue/advanced` and `/react/advanced` bind it).
90
+ * Component-free (`ComposedEditor<never>`), so both the Vue and the React surface accept it.
91
+ */
92
+ export declare const simpleEditor: () => ComposedEditor<never>;
93
+ //#endregion
94
+ //# sourceMappingURL=compose.d.ts.map
@@ -0,0 +1,164 @@
1
+ import { defineEditor } from "../core/define-editor.js";
2
+ import { coreContentFeature, coreUiFeature } from "../core/core-feature.js";
3
+ import { CommentMark } from "../features/comments/schema.js";
4
+ import { mentionsFeature } from "../features/mentions/index.js";
5
+ import { tablesFeature } from "../features/tables/feature.js";
6
+ import { compositeMediaFeature } from "../integrations/composite-media/index.js";
7
+ //#region src/presets/compose.ts
8
+ /** The content features of each level, in canonical (schema) order. */
9
+ const CONTENT = {
10
+ basic: ["core-content"],
11
+ rich: [
12
+ "core-content",
13
+ "media",
14
+ "transcript",
15
+ "composites",
16
+ "mentions",
17
+ "authors",
18
+ "tables",
19
+ "composite-media"
20
+ ]
21
+ };
22
+ /** The interaction features of each level, in canonical order. */
23
+ const INTERACTION = {
24
+ minimal: ["core-ui"],
25
+ full: [
26
+ "core-ui",
27
+ "collab",
28
+ "comments",
29
+ "block-ui",
30
+ "themes"
31
+ ]
32
+ };
33
+ /** The AI features (`ai: true`): the AI feature and the integrations that need it; each is installed when its `requires` are met. */
34
+ const AI = [
35
+ "ai",
36
+ "composite-ai",
37
+ "transcript-ai"
38
+ ];
39
+ /** Canonical feature order: content, interaction, AI. The composed feature list, its schema order and its toolbar order follow it. */
40
+ const CANONICAL = [
41
+ ...CONTENT.rich,
42
+ ...INTERACTION.full,
43
+ ...AI
44
+ ];
45
+ function fail(message) {
46
+ throw new Error(`@ecsplico/editor: composeEditor: ${message}`);
47
+ }
48
+ /**
49
+ * Builds the catalog feature `id`. A framework binding the composition needs but `ui` lacks fails here, naming it.
50
+ * `ui` is partial on purpose: a host that never selects a feature (a viewer has no `block-ui`) binds only the rest, so
51
+ * the bundle holds no code of the others.
52
+ */
53
+ function build(id, ui, options) {
54
+ const bound = (key) => ui[key] ?? fail(`no UI binding for feature "${key}"`);
55
+ switch (id) {
56
+ case "core-content": return coreContentFeature();
57
+ case "mentions": return mentionsFeature();
58
+ case "tables": return tablesFeature();
59
+ case "composite-media": return compositeMediaFeature();
60
+ case "core-ui": return bound("core-ui")();
61
+ case "composite-ai": return bound("composite-ai")();
62
+ case "transcript-ai": return bound("transcript-ai")();
63
+ case "media": return bound("media")();
64
+ case "transcript": return bound("transcript")();
65
+ case "composites": return bound("composites")(options.compositeKinds ? { kinds: options.compositeKinds } : {});
66
+ case "authors": return bound("authors")();
67
+ case "comments": return bound("comments")(options.comments ?? {});
68
+ case "ai": return bound("ai")();
69
+ case "collab": return bound("collab")();
70
+ case "block-ui": return bound("block-ui")();
71
+ case "themes": return bound("themes")();
72
+ default: return fail(`unknown catalog feature "${id}" (host features go in \`add\`)`);
73
+ }
74
+ }
75
+ /** Why `feature` cannot stay in a composition holding `ids` over `backend`, or `undefined`. A host session satisfies `collaboration`. */
76
+ function unmet(feature, ids, options) {
77
+ const { backend } = options;
78
+ for (const capability of feature.backend ?? []) {
79
+ if (capability === "collaboration" && options.collaboration) continue;
80
+ if (backend && backend[capability] === void 0) return `backend "${backend.name}" lacks "${capability}"`;
81
+ }
82
+ for (const required of feature.requires ?? []) if (!ids.has(required)) return `requires "${required}"`;
83
+ }
84
+ /**
85
+ * The comment mark is part of the document model (stored documents carry it), but only the `comments` feature brings it.
86
+ * A composition that keeps `authors` (every rich one) yet has no `comments` (a viewer, a backend without collaboration,
87
+ * `remove`) gets the mark through `authors`, inert there, so such documents still load. The catalog is the one place
88
+ * that may couple the two features; each stays importable on its own.
89
+ */
90
+ function withCommentMark(features) {
91
+ if (features.some((feature) => feature.id === "comments")) return [...features];
92
+ return features.map((feature) => feature.id !== "authors" ? feature : {
93
+ ...feature,
94
+ schemaExtensions: () => [...feature.schemaExtensions?.() ?? [], CommentMark],
95
+ extensions: (ctx) => [...feature.extensions?.(ctx) ?? [], CommentMark]
96
+ });
97
+ }
98
+ /**
99
+ * Composes an editor from three dimensions plus the backend's capabilities, over the UI bindings of a layer.
100
+ *
101
+ * The feature list is `content` + `interaction` (+ the AI features when `ai`) + `add`, minus `remove`. `core-content` is
102
+ * always part of it and `core-ui` of every non-empty interaction list. Features that require a missing feature, or a
103
+ * backend capability `options.backend` lacks, are dropped until the list is stable and reported in `omitted` (so
104
+ * `ai: true` over a backend without `ai` installs no AI and says why). The catalog features keep their canonical order
105
+ * (content, interaction, AI), host features follow in the order given; the result is validated by `defineEditor`.
106
+ * Throws when an id of `content` is not a content feature, an id of `interaction` not an interaction feature, an id
107
+ * names no catalog feature, `remove` names `core-content`, or a selected feature has no binding in `ui`.
108
+ */
109
+ function composeEditor(ui, options) {
110
+ if (options.remove?.includes("core-content")) fail("\"core-content\" cannot be removed");
111
+ const removed = new Set(options.remove ?? []);
112
+ const catalog = /* @__PURE__ */ new Map();
113
+ const select = (ids, dimension) => {
114
+ for (const id of ids) {
115
+ if (removed.has(id) || catalog.has(id)) continue;
116
+ const feature = build(id, ui, options);
117
+ if (feature.dimension !== dimension) fail(`"${id}" is not ${dimension === "ai" ? "an AI" : `a${dimension === "interaction" ? "n" : ""} ${dimension}`} feature`);
118
+ catalog.set(id, feature);
119
+ }
120
+ };
121
+ const content = typeof options.content === "string" ? CONTENT[options.content] : options.content;
122
+ const interaction = typeof options.interaction === "string" ? INTERACTION[options.interaction] : options.interaction;
123
+ select(["core-content", ...content], "content");
124
+ select(interaction.length ? ["core-ui", ...interaction] : [], "interaction");
125
+ select(options.ai ? AI : [], "ai");
126
+ const all = [...[...catalog.values()].sort((a, b) => CANONICAL.indexOf(a.id) - CANONICAL.indexOf(b.id)), ...(options.add ?? []).filter((feature) => !removed.has(feature.id))];
127
+ const reasons = /* @__PURE__ */ new Map();
128
+ let alive = all;
129
+ for (;;) {
130
+ const ids = new Set(alive.map((feature) => feature.id));
131
+ const dropped = /* @__PURE__ */ new Map();
132
+ for (const feature of alive) {
133
+ const reason = unmet(feature, ids, options);
134
+ if (reason) dropped.set(feature.id, reason);
135
+ }
136
+ if (!dropped.size) break;
137
+ for (const [id, reason] of dropped) reasons.set(id, reason);
138
+ alive = alive.filter((feature) => !dropped.has(feature.id));
139
+ }
140
+ const preset = defineEditor({ features: withCommentMark(alive) });
141
+ const omitted = all.flatMap((feature) => reasons.has(feature.id) ? [{
142
+ id: feature.id,
143
+ reason: reasons.get(feature.id)
144
+ }] : []);
145
+ return Object.freeze({
146
+ ...preset,
147
+ omitted: Object.freeze(omitted)
148
+ });
149
+ }
150
+ /**
151
+ * The simple editor: `core-content` and `core-ui` (formatting, headings, lists, quotes, code, undo/redo). No backend, no AI,
152
+ * no collaboration, and no ⌘K command palette (`coreUiFeature()` gets no `palette` component here, the framework-free
153
+ * layer has none; the `SimpleEditor` components and the `composeEditor` of `/vue/advanced` and `/react/advanced` bind it).
154
+ * Component-free (`ComposedEditor<never>`), so both the Vue and the React surface accept it.
155
+ */
156
+ const simpleEditor = () => composeEditor({ "core-ui": coreUiFeature }, {
157
+ content: "basic",
158
+ interaction: "minimal",
159
+ ai: false
160
+ });
161
+ //#endregion
162
+ export { AI, CONTENT, INTERACTION, composeEditor, simpleEditor };
163
+
164
+ //# sourceMappingURL=compose.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"compose.js","names":[],"sources":["../../src/presets/compose.ts"],"sourcesContent":["import type { EditorBackend } from '../core/backend'\nimport { coreContentFeature, coreUiFeature } from '../core/core-feature'\nimport { defineEditor } from '../core/define-editor'\nimport type { EditorFeature, EditorPreset } from '../core/feature'\nimport type { CommentsFeatureOptions } from '../features/comments/feature'\nimport { CommentMark } from '../features/comments/schema'\nimport type { CompositeFeatureOptions } from '../features/composites/feature'\nimport type { CompositeKind } from '../features/composites/kinds'\nimport { mentionsFeature } from '../features/mentions'\nimport { tablesFeature } from '../features/tables'\nimport { compositeMediaFeature } from '../integrations/composite-media'\n\n/** The id of a catalog feature (`CONTENT`, `INTERACTION`, `AI`) or of a host feature passed to `remove`. */\nexport type FeatureId = string\n\n/** How much document model the editor has: `basic` = `core-content`, `rich` = the full content catalog. */\nexport type ContentLevel = 'basic' | 'rich'\n\n/** How much editing UX the editor has: `minimal` = `core-ui`, `full` = every interaction feature. */\nexport type InteractionLevel = 'minimal' | 'full'\n\n/** The content features of each level, in canonical (schema) order. */\nexport const CONTENT: Record<ContentLevel, readonly FeatureId[]> = {\n basic: ['core-content'],\n rich: ['core-content', 'media', 'transcript', 'composites', 'mentions', 'authors', 'tables', 'composite-media'],\n}\n\n/** The interaction features of each level, in canonical order. */\nexport const INTERACTION: Record<InteractionLevel, readonly FeatureId[]> = {\n minimal: ['core-ui'],\n full: ['core-ui', 'collab', 'comments', 'block-ui', 'themes'],\n}\n\n/** The AI features (`ai: true`): the AI feature and the integrations that need it; each is installed when its `requires` are met. */\nexport const AI: readonly FeatureId[] = ['ai', 'composite-ai', 'transcript-ai']\n\n/** Canonical feature order: content, interaction, AI. The composed feature list, its schema order and its toolbar order follow it. */\nconst CANONICAL: readonly FeatureId[] = [...CONTENT.rich, ...INTERACTION.full, ...AI]\n\n/**\n * The features a UI layer binds, keyed by id; the other catalog features are framework-free and built here. The AI\n * features are bound too, although `composite-ai` and `transcript-ai` have no components: the layer owns every import of\n * `features/ai`, so a composition without `ai` binds none of them and its bundle holds no AI code. Each binding is a\n * factory, called only for a feature the composition selects (`themes` reads the current Vue app when built, so\n * unselected features are never built). `composites` receives the composition's `compositeKinds`, `comments` its\n * `comments` options. `core-ui` takes no parameter here: the framework-free `simpleEditor()` has no command palette;\n * a layer that has one (the `SimpleEditor` surfaces) builds `coreUiFeature({ palette })` itself.\n */\nexport interface UiBindings<C> {\n 'core-ui': () => EditorFeature<C>\n 'media': () => EditorFeature<C>\n 'transcript': () => EditorFeature<C>\n 'composites': (options: CompositeFeatureOptions) => EditorFeature<C>\n 'authors': () => EditorFeature<C>\n 'comments': (options: CommentsFeatureOptions) => EditorFeature<C>\n 'ai': () => EditorFeature<C>\n 'composite-ai': () => EditorFeature<C>\n 'transcript-ai': () => EditorFeature<C>\n 'collab': () => EditorFeature<C>\n 'block-ui': () => EditorFeature<C>\n 'themes': () => EditorFeature<C>\n}\n\n/** What `composeEditor` builds the editor from. */\nexport interface ComposeOptions<C> {\n /** The document model: a level or the content feature ids to install (`core-content` is always installed). */\n content: ContentLevel | readonly FeatureId[]\n /** The editing UX: a level or the interaction feature ids (`core-ui` is installed with any non-empty list); `[]` = a viewer without any interaction feature. */\n interaction: InteractionLevel | readonly FeatureId[]\n /** Installs `ai` and every integration whose `requires` are met (composite-AI iff composites, transcript-AI iff transcript). */\n ai: boolean\n /** The backend the editor runs on: features needing a capability it lacks are omitted. Absent = nothing is pruned by capability. */\n backend?: EditorBackend\n /**\n * The host supplies the collaboration session itself (the surface's `collaboration` prop, e.g. from its own Hocuspocus\n * provider), so `collab` and `comments` need no `collaboration` capability from the backend. Only a backend that must\n * open the collaboration (`useEditorDocument(id, { collaboration: true })`) has to offer it. Default `false`.\n */\n collaboration?: boolean\n /** Host features, appended after the catalog in the given order. */\n add?: readonly EditorFeature<C>[]\n /** Features left out (catalog or host); features that require them are omitted as well. */\n remove?: readonly FeatureId[]\n /** The composite kinds („Bausteine“) offered in the editor (default: the built-in kinds); read once. */\n compositeKinds?: readonly CompositeKind[]\n /** Options of the comments feature, e.g. a host `model` (then comments need no `collab`). */\n comments?: CommentsFeatureOptions\n}\n\n/** The composed preset and the features that were selected but dropped, in composition order, with the reason. */\nexport interface ComposedEditor<C> extends EditorPreset<C> {\n readonly omitted: readonly { id: FeatureId, reason: string }[]\n}\n\nfunction fail(message: string): never {\n throw new Error(`@ecsplico/editor: composeEditor: ${message}`)\n}\n\n/**\n * Builds the catalog feature `id`. A framework binding the composition needs but `ui` lacks fails here, naming it.\n * `ui` is partial on purpose: a host that never selects a feature (a viewer has no `block-ui`) binds only the rest, so\n * the bundle holds no code of the others.\n */\nfunction build<C>(id: FeatureId, ui: Partial<UiBindings<C>>, options: ComposeOptions<C>): EditorFeature<C> {\n const bound = <K extends keyof UiBindings<C>>(key: K): UiBindings<C>[K] => ui[key] ?? fail(`no UI binding for feature \"${key}\"`)\n switch (id) {\n case 'core-content': return coreContentFeature()\n case 'mentions': return mentionsFeature()\n case 'tables': return tablesFeature()\n case 'composite-media': return compositeMediaFeature()\n case 'core-ui': return bound('core-ui')()\n case 'composite-ai': return bound('composite-ai')()\n case 'transcript-ai': return bound('transcript-ai')()\n case 'media': return bound('media')()\n case 'transcript': return bound('transcript')()\n case 'composites': return bound('composites')(options.compositeKinds ? { kinds: options.compositeKinds } : {})\n case 'authors': return bound('authors')()\n case 'comments': return bound('comments')(options.comments ?? {})\n case 'ai': return bound('ai')()\n case 'collab': return bound('collab')()\n case 'block-ui': return bound('block-ui')()\n case 'themes': return bound('themes')()\n default: return fail(`unknown catalog feature \"${id}\" (host features go in \\`add\\`)`)\n }\n}\n\n/** Why `feature` cannot stay in a composition holding `ids` over `backend`, or `undefined`. A host session satisfies `collaboration`. */\nfunction unmet(feature: Pick<EditorFeature, 'backend' | 'requires'>, ids: ReadonlySet<FeatureId>, options: Pick<ComposeOptions<unknown>, 'backend' | 'collaboration'>): string | undefined {\n const { backend } = options\n for (const capability of feature.backend ?? []) {\n if (capability === 'collaboration' && options.collaboration) continue\n if (backend && backend[capability] === undefined) return `backend \"${backend.name}\" lacks \"${capability}\"`\n }\n for (const required of feature.requires ?? []) {\n if (!ids.has(required)) return `requires \"${required}\"`\n }\n return undefined\n}\n\n/**\n * The comment mark is part of the document model (stored documents carry it), but only the `comments` feature brings it.\n * A composition that keeps `authors` (every rich one) yet has no `comments` (a viewer, a backend without collaboration,\n * `remove`) gets the mark through `authors`, inert there, so such documents still load. The catalog is the one place\n * that may couple the two features; each stays importable on its own.\n */\nfunction withCommentMark<C>(features: readonly EditorFeature<C>[]): EditorFeature<C>[] {\n if (features.some(feature => feature.id === 'comments')) return [...features]\n return features.map(feature => feature.id !== 'authors'\n ? feature\n : {\n ...feature,\n schemaExtensions: () => [...(feature.schemaExtensions?.() ?? []), CommentMark],\n extensions: ctx => [...(feature.extensions?.(ctx) ?? []), CommentMark],\n })\n}\n\n/**\n * Composes an editor from three dimensions plus the backend's capabilities, over the UI bindings of a layer.\n *\n * The feature list is `content` + `interaction` (+ the AI features when `ai`) + `add`, minus `remove`. `core-content` is\n * always part of it and `core-ui` of every non-empty interaction list. Features that require a missing feature, or a\n * backend capability `options.backend` lacks, are dropped until the list is stable and reported in `omitted` (so\n * `ai: true` over a backend without `ai` installs no AI and says why). The catalog features keep their canonical order\n * (content, interaction, AI), host features follow in the order given; the result is validated by `defineEditor`.\n * Throws when an id of `content` is not a content feature, an id of `interaction` not an interaction feature, an id\n * names no catalog feature, `remove` names `core-content`, or a selected feature has no binding in `ui`.\n */\nexport function composeEditor<C>(ui: Partial<UiBindings<C>>, options: ComposeOptions<C>): ComposedEditor<C> {\n if (options.remove?.includes('core-content')) fail('\"core-content\" cannot be removed')\n const removed = new Set(options.remove ?? [])\n const catalog = new Map<FeatureId, EditorFeature<C>>()\n const select = (ids: readonly FeatureId[], dimension: 'content' | 'interaction' | 'ai') => {\n for (const id of ids) {\n if (removed.has(id) || catalog.has(id)) continue\n const feature = build(id, ui, options)\n if (feature.dimension !== dimension) fail(`\"${id}\" is not ${dimension === 'ai' ? 'an AI' : `a${dimension === 'interaction' ? 'n' : ''} ${dimension}`} feature`)\n catalog.set(id, feature)\n }\n }\n const content = typeof options.content === 'string' ? CONTENT[options.content] : options.content\n const interaction = typeof options.interaction === 'string' ? INTERACTION[options.interaction] : options.interaction\n select(['core-content', ...content], 'content')\n select(interaction.length ? ['core-ui', ...interaction] : [], 'interaction')\n select(options.ai ? AI : [], 'ai')\n\n const ordered = [...catalog.values()].sort((a, b) => CANONICAL.indexOf(a.id) - CANONICAL.indexOf(b.id))\n const all: EditorFeature<C>[] = [...ordered, ...(options.add ?? []).filter(feature => !removed.has(feature.id))]\n\n const reasons = new Map<FeatureId, string>()\n let alive = all\n for (;;) {\n const ids = new Set(alive.map(feature => feature.id))\n const dropped = new Map<FeatureId, string>()\n for (const feature of alive) {\n const reason = unmet(feature, ids, options)\n if (reason) dropped.set(feature.id, reason)\n }\n if (!dropped.size) break\n for (const [id, reason] of dropped) reasons.set(id, reason)\n alive = alive.filter(feature => !dropped.has(feature.id))\n }\n\n const preset = defineEditor({ features: withCommentMark(alive) })\n const omitted = all.flatMap(feature => reasons.has(feature.id) ? [{ id: feature.id, reason: reasons.get(feature.id)! }] : [])\n return Object.freeze({ ...preset, omitted: Object.freeze(omitted) })\n}\n\n/**\n * The simple editor: `core-content` and `core-ui` (formatting, headings, lists, quotes, code, undo/redo). No backend, no AI,\n * no collaboration, and no ⌘K command palette (`coreUiFeature()` gets no `palette` component here, the framework-free\n * layer has none; the `SimpleEditor` components and the `composeEditor` of `/vue/advanced` and `/react/advanced` bind it).\n * Component-free (`ComposedEditor<never>`), so both the Vue and the React surface accept it.\n */\nexport const simpleEditor = (): ComposedEditor<never> => composeEditor<never>({ 'core-ui': coreUiFeature }, { content: 'basic', interaction: 'minimal', ai: false })\n"],"mappings":";;;;;;;;AAsBA,MAAa,UAAsD;CACjE,OAAO,CAAC,cAAc;CACtB,MAAM;EAAC;EAAgB;EAAS;EAAc;EAAc;EAAY;EAAW;EAAU;CAAiB;AAChH;;AAGA,MAAa,cAA8D;CACzE,SAAS,CAAC,SAAS;CACnB,MAAM;EAAC;EAAW;EAAU;EAAY;EAAY;CAAQ;AAC9D;;AAGA,MAAa,KAA2B;CAAC;CAAM;CAAgB;AAAe;;AAG9E,MAAM,YAAkC;CAAC,GAAG,QAAQ;CAAM,GAAG,YAAY;CAAM,GAAG;AAAE;AAyDpF,SAAS,KAAK,SAAwB;CACpC,MAAM,IAAI,MAAM,oCAAoC,SAAS;AAC/D;;;;;;AAOA,SAAS,MAAS,IAAe,IAA4B,SAA8C;CACzG,MAAM,SAAwC,QAA6B,GAAG,QAAQ,KAAK,8BAA8B,IAAI,EAAE;CAC/H,QAAQ,IAAR;EACE,KAAK,gBAAgB,OAAO,mBAAmB;EAC/C,KAAK,YAAY,OAAO,gBAAgB;EACxC,KAAK,UAAU,OAAO,cAAc;EACpC,KAAK,mBAAmB,OAAO,sBAAsB;EACrD,KAAK,WAAW,OAAO,MAAM,SAAS,CAAC,CAAC;EACxC,KAAK,gBAAgB,OAAO,MAAM,cAAc,CAAC,CAAC;EAClD,KAAK,iBAAiB,OAAO,MAAM,eAAe,CAAC,CAAC;EACpD,KAAK,SAAS,OAAO,MAAM,OAAO,CAAC,CAAC;EACpC,KAAK,cAAc,OAAO,MAAM,YAAY,CAAC,CAAC;EAC9C,KAAK,cAAc,OAAO,MAAM,YAAY,CAAC,CAAC,QAAQ,iBAAiB,EAAE,OAAO,QAAQ,eAAe,IAAI,CAAC,CAAC;EAC7G,KAAK,WAAW,OAAO,MAAM,SAAS,CAAC,CAAC;EACxC,KAAK,YAAY,OAAO,MAAM,UAAU,CAAC,CAAC,QAAQ,YAAY,CAAC,CAAC;EAChE,KAAK,MAAM,OAAO,MAAM,IAAI,CAAC,CAAC;EAC9B,KAAK,UAAU,OAAO,MAAM,QAAQ,CAAC,CAAC;EACtC,KAAK,YAAY,OAAO,MAAM,UAAU,CAAC,CAAC;EAC1C,KAAK,UAAU,OAAO,MAAM,QAAQ,CAAC,CAAC;EACtC,SAAS,OAAO,KAAK,4BAA4B,GAAG,gCAAgC;CACtF;AACF;;AAGA,SAAS,MAAM,SAAsD,KAA6B,SAAyF;CACzL,MAAM,EAAE,YAAY;CACpB,KAAK,MAAM,cAAc,QAAQ,WAAW,CAAC,GAAG;EAC9C,IAAI,eAAe,mBAAmB,QAAQ,eAAe;EAC7D,IAAI,WAAW,QAAQ,gBAAgB,KAAA,GAAW,OAAO,YAAY,QAAQ,KAAK,WAAW,WAAW;CAC1G;CACA,KAAK,MAAM,YAAY,QAAQ,YAAY,CAAC,GAC1C,IAAI,CAAC,IAAI,IAAI,QAAQ,GAAG,OAAO,aAAa,SAAS;AAGzD;;;;;;;AAQA,SAAS,gBAAmB,UAA2D;CACrF,IAAI,SAAS,MAAK,YAAW,QAAQ,OAAO,UAAU,GAAG,OAAO,CAAC,GAAG,QAAQ;CAC5E,OAAO,SAAS,KAAI,YAAW,QAAQ,OAAO,YAC1C,UACA;EACE,GAAG;EACH,wBAAwB,CAAC,GAAI,QAAQ,mBAAmB,KAAK,CAAC,GAAI,WAAW;EAC7E,aAAY,QAAO,CAAC,GAAI,QAAQ,aAAa,GAAG,KAAK,CAAC,GAAI,WAAW;CACvE,CAAC;AACP;;;;;;;;;;;;AAaA,SAAgB,cAAiB,IAA4B,SAA+C;CAC1G,IAAI,QAAQ,QAAQ,SAAS,cAAc,GAAG,KAAK,oCAAkC;CACrF,MAAM,UAAU,IAAI,IAAI,QAAQ,UAAU,CAAC,CAAC;CAC5C,MAAM,0BAAU,IAAI,IAAiC;CACrD,MAAM,UAAU,KAA2B,cAAgD;EACzF,KAAK,MAAM,MAAM,KAAK;GACpB,IAAI,QAAQ,IAAI,EAAE,KAAK,QAAQ,IAAI,EAAE,GAAG;GACxC,MAAM,UAAU,MAAM,IAAI,IAAI,OAAO;GACrC,IAAI,QAAQ,cAAc,WAAW,KAAK,IAAI,GAAG,WAAW,cAAc,OAAO,UAAU,IAAI,cAAc,gBAAgB,MAAM,GAAG,GAAG,YAAY,SAAS;GAC9J,QAAQ,IAAI,IAAI,OAAO;EACzB;CACF;CACA,MAAM,UAAU,OAAO,QAAQ,YAAY,WAAW,QAAQ,QAAQ,WAAW,QAAQ;CACzF,MAAM,cAAc,OAAO,QAAQ,gBAAgB,WAAW,YAAY,QAAQ,eAAe,QAAQ;CACzG,OAAO,CAAC,gBAAgB,GAAG,OAAO,GAAG,SAAS;CAC9C,OAAO,YAAY,SAAS,CAAC,WAAW,GAAG,WAAW,IAAI,CAAC,GAAG,aAAa;CAC3E,OAAO,QAAQ,KAAK,KAAK,CAAC,GAAG,IAAI;CAGjC,MAAM,MAA0B,CAAC,GADjB,CAAC,GAAG,QAAQ,OAAO,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,UAAU,QAAQ,EAAE,EAAE,IAAI,UAAU,QAAQ,EAAE,EAAE,CAC3D,GAAG,IAAI,QAAQ,OAAO,CAAC,EAAA,CAAG,QAAO,YAAW,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC,CAAC;CAE/G,MAAM,0BAAU,IAAI,IAAuB;CAC3C,IAAI,QAAQ;CACZ,SAAS;EACP,MAAM,MAAM,IAAI,IAAI,MAAM,KAAI,YAAW,QAAQ,EAAE,CAAC;EACpD,MAAM,0BAAU,IAAI,IAAuB;EAC3C,KAAK,MAAM,WAAW,OAAO;GAC3B,MAAM,SAAS,MAAM,SAAS,KAAK,OAAO;GAC1C,IAAI,QAAQ,QAAQ,IAAI,QAAQ,IAAI,MAAM;EAC5C;EACA,IAAI,CAAC,QAAQ,MAAM;EACnB,KAAK,MAAM,CAAC,IAAI,WAAW,SAAS,QAAQ,IAAI,IAAI,MAAM;EAC1D,QAAQ,MAAM,QAAO,YAAW,CAAC,QAAQ,IAAI,QAAQ,EAAE,CAAC;CAC1D;CAEA,MAAM,SAAS,aAAa,EAAE,UAAU,gBAAgB,KAAK,EAAE,CAAC;CAChE,MAAM,UAAU,IAAI,SAAQ,YAAW,QAAQ,IAAI,QAAQ,EAAE,IAAI,CAAC;EAAE,IAAI,QAAQ;EAAI,QAAQ,QAAQ,IAAI,QAAQ,EAAE;CAAG,CAAC,IAAI,CAAC,CAAC;CAC5H,OAAO,OAAO,OAAO;EAAE,GAAG;EAAQ,SAAS,OAAO,OAAO,OAAO;CAAE,CAAC;AACrE;;;;;;;AAQA,MAAa,qBAA4C,cAAqB,EAAE,WAAW,cAAc,GAAG;CAAE,SAAS;CAAS,aAAa;CAAW,IAAI;AAAM,CAAC"}
@@ -1,23 +1,23 @@
1
- import { EditorSurfaceHandle, EditorSurfaceProps } from "./EditorSurface.js";
2
- import { CompositeKind } from "../features/composites/kinds.js";
1
+ import { ComposedEditorHandle, ComposedEditorProps } from "./composed-surface.js";
3
2
  //#region src/react/AdvancedEditor.d.ts
4
3
  /**
5
4
  * Props of the advanced editor: the surface's own (collaboration session or standalone `value`/`onChange`, metadata,
6
- * abilities, extensions, block actions, slash commands, `documentId`/`upload`, `editable`, `settingsUi`, the open
7
- * state of the sidebar and comments margin, `onReady` and the other callbacks) except the preset, which the advanced
8
- * editor owns, plus the composite kinds.
5
+ * abilities, extensions, block actions, commands, `documentId`, `editable`, `settingsUi`, the open state of the sidebar
6
+ * and comments margin, `onReady` and the other callbacks) except the preset, plus the composition: `content`,
7
+ * `interaction`, `ai`, `add`, `remove`, `backend` and the composite kinds. The defaults are the advanced editor's:
8
+ * `content: 'rich'`, `interaction: 'full'`, `ai: true`.
9
9
  */
10
- export interface AdvancedEditorProps extends Omit<EditorSurfaceProps, 'preset'> {
11
- /** Composite kinds („Bausteine“) offered in the editor (default: `defaultCompositeKinds(t)`); read once at mount. */
12
- compositeKinds?: readonly CompositeKind[];
13
- }
10
+ export type AdvancedEditorProps = ComposedEditorProps;
14
11
  /**
15
- * The advanced editor on the React surface: `advancedEditor()` mounted through `EditorSurface`. The feature list is
16
- * fixed at mount like the kinds it is built from; hosts remount (`key`) to change either. Place `EditorToolbar`
17
- * (with the same `preset`: build it with `advancedEditor()` and pass it to both) and, with `settingsUi: 'external'`,
18
- * `EditorSettingsModal`/`EditorSettingsPanel` beside it; `useEditorUi(editor)` reaches the chrome of a ready editor.
19
- * Collaboration is active only when a `collaboration` session is passed; mount `Toaster` once for notices.
12
+ * The advanced editor on the React surface: `composeEditor({ content: 'rich', interaction: 'full', ai: true })` mounted
13
+ * through `EditorSurface`; every dimension is overridable by its prop, and the backend (default: the editor context's)
14
+ * prunes what it cannot serve. The ref's `preset` is the composed preset (`omitted` lists the dropped features). The
15
+ * composition is fixed at mount like the kinds it is built from; hosts remount (`key`) to change it. Place
16
+ * `EditorToolbar` and, with `settingsUi: 'external'`, `EditorSettingsModal`/`EditorSettingsPanel` beside it and give
17
+ * them the editor from `onReady`; `useEditorUi(editor)` reaches the chrome of a ready editor. Collaboration is active
18
+ * only when a `collaboration` session is passed; mount `Toaster` once for notices.
20
19
  */
21
- export declare const AdvancedEditor: import("react").ForwardRefExoticComponent<AdvancedEditorProps & import("react").RefAttributes<EditorSurfaceHandle>>;
20
+ export declare const AdvancedEditor: import("react").ForwardRefExoticComponent<ComposedEditorProps & import("react").RefAttributes<ComposedEditorHandle>>;
22
21
  //#endregion
22
+ export type { ComposedEditorHandle as AdvancedEditorHandle };
23
23
  //# sourceMappingURL=AdvancedEditor.d.ts.map