@ecsplico/editor 2.1.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (692) hide show
  1. package/CHANGELOG.md +68 -1
  2. package/README.md +39 -156
  3. package/dist/adapters/comments/drizzle.d.ts +1 -1
  4. package/dist/adapters/comments/{client.js → rest-model.js} +3 -3
  5. package/dist/adapters/comments/rest-model.js.map +1 -0
  6. package/dist/adapters/comments/types.d.ts +2 -2
  7. package/dist/adapters/document-state.d.ts +23 -0
  8. package/dist/adapters/document-state.js +66 -0
  9. package/dist/adapters/document-state.js.map +1 -0
  10. package/dist/adapters/documents.js +14 -11
  11. package/dist/adapters/documents.js.map +1 -1
  12. package/dist/adapters/drizzle.d.ts +2 -2
  13. package/dist/adapters/drizzle.js +97 -88
  14. package/dist/adapters/drizzle.js.map +1 -1
  15. package/dist/adapters/forge.d.ts +12 -7
  16. package/dist/adapters/forge.js +38 -45
  17. package/dist/adapters/forge.js.map +1 -1
  18. package/dist/adapters/http.d.ts +20 -0
  19. package/dist/adapters/http.js +68 -0
  20. package/dist/adapters/http.js.map +1 -0
  21. package/dist/adapters/index.d.ts +5 -5
  22. package/dist/adapters/json.d.ts +3 -3
  23. package/dist/adapters/json.js +58 -49
  24. package/dist/adapters/json.js.map +1 -1
  25. package/dist/adapters/memory.d.ts +21 -0
  26. package/dist/adapters/memory.js +53 -0
  27. package/dist/adapters/memory.js.map +1 -0
  28. package/dist/adapters/nitro.d.ts +23 -20
  29. package/dist/adapters/nitro.js +58 -163
  30. package/dist/adapters/nitro.js.map +1 -1
  31. package/dist/adapters/react.d.ts +55 -0
  32. package/dist/adapters/react.js +209 -0
  33. package/dist/adapters/react.js.map +1 -0
  34. package/dist/adapters/shared.d.ts +15 -21
  35. package/dist/adapters/shared.js +10 -8
  36. package/dist/adapters/shared.js.map +1 -1
  37. package/dist/adapters/vue.d.ts +15 -30
  38. package/dist/adapters/vue.js +36 -87
  39. package/dist/adapters/vue.js.map +1 -1
  40. package/dist/config/index.d.ts +105 -0
  41. package/dist/config/index.js +95 -0
  42. package/dist/config/index.js.map +1 -0
  43. package/dist/core/abilities.js +1 -0
  44. package/dist/core/abilities.js.map +1 -1
  45. package/dist/{adapters/routes.js → core/api-routes.js} +5 -3
  46. package/dist/core/api-routes.js.map +1 -0
  47. package/dist/core/backend-capability.d.ts +7 -0
  48. package/dist/core/backend-capability.js +17 -0
  49. package/dist/core/backend-capability.js.map +1 -0
  50. package/dist/core/backend-types.d.ts +245 -0
  51. package/dist/core/backend-types.js +17 -0
  52. package/dist/core/backend-types.js.map +1 -0
  53. package/dist/core/backend.d.ts +108 -0
  54. package/dist/core/backend.js +14 -0
  55. package/dist/core/backend.js.map +1 -0
  56. package/dist/core/block-convert.d.ts +7 -5
  57. package/dist/core/block-convert.js +28 -5
  58. package/dist/core/block-convert.js.map +1 -1
  59. package/dist/core/command-types.d.ts +89 -0
  60. package/dist/core/commands.d.ts +40 -0
  61. package/dist/core/commands.js +151 -0
  62. package/dist/core/commands.js.map +1 -0
  63. package/dist/core/context.d.ts +17 -20
  64. package/dist/core/context.js +24 -21
  65. package/dist/core/context.js.map +1 -1
  66. package/dist/core/core-feature.d.ts +22 -7
  67. package/dist/core/core-feature.js +51 -18
  68. package/dist/core/core-feature.js.map +1 -1
  69. package/dist/core/define-editor.d.ts +4 -3
  70. package/dist/core/define-editor.js +14 -7
  71. package/dist/core/define-editor.js.map +1 -1
  72. package/dist/core/document-markdown.js +12 -3
  73. package/dist/core/document-markdown.js.map +1 -1
  74. package/dist/core/editor-ui.d.ts +8 -1
  75. package/dist/core/editor-ui.js +9 -8
  76. package/dist/core/editor-ui.js.map +1 -1
  77. package/dist/core/extension-points.d.ts +3 -15
  78. package/dist/core/feature-context.d.ts +8 -7
  79. package/dist/core/feature-context.js +12 -11
  80. package/dist/core/feature-context.js.map +1 -1
  81. package/dist/core/feature.d.ts +35 -19
  82. package/dist/core/feature.js.map +1 -1
  83. package/dist/core/fences.d.ts +2 -1
  84. package/dist/core/fences.js +3 -2
  85. package/dist/core/fences.js.map +1 -1
  86. package/dist/core/fetch-error.d.ts +1 -1
  87. package/dist/core/fetch-error.js +3 -1
  88. package/dist/core/fetch-error.js.map +1 -1
  89. package/dist/core/hash.d.ts +5 -0
  90. package/dist/core/hash.js +11 -0
  91. package/dist/core/hash.js.map +1 -0
  92. package/dist/core/http-backend.d.ts +11 -0
  93. package/dist/core/http-backend.js +195 -0
  94. package/dist/core/http-backend.js.map +1 -0
  95. package/dist/core/index.d.ts +14 -9
  96. package/dist/core/index.js +12 -9
  97. package/dist/core/palette.d.ts +48 -0
  98. package/dist/core/palette.js +95 -0
  99. package/dist/core/palette.js.map +1 -0
  100. package/dist/core/schema/abilities.d.ts +2 -1
  101. package/dist/core/schema/abilities.js +5 -1
  102. package/dist/core/schema/abilities.js.map +1 -1
  103. package/dist/core/schema/index.d.ts +11 -5
  104. package/dist/core/schema/index.js +13 -8
  105. package/dist/core/schema/index.js.map +1 -1
  106. package/dist/core/schema/mark-flags.d.ts +8 -1
  107. package/dist/core/schema/of-features.d.ts +13 -0
  108. package/dist/core/schema/of-features.js +14 -0
  109. package/dist/core/schema/of-features.js.map +1 -0
  110. package/dist/core/slash.d.ts +8 -6
  111. package/dist/core/slash.js +24 -16
  112. package/dist/core/slash.js.map +1 -1
  113. package/dist/core/surface-session.js +13 -5
  114. package/dist/core/surface-session.js.map +1 -1
  115. package/dist/core/toolbar-items.d.ts +10 -4
  116. package/dist/core/toolbar-items.js +269 -195
  117. package/dist/core/toolbar-items.js.map +1 -1
  118. package/dist/core/util.js +11 -0
  119. package/dist/core/util.js.map +1 -0
  120. package/dist/document/DocumentSurface.d.ts +1 -1
  121. package/dist/features/ai/agent-op-review.d.ts +1 -1
  122. package/dist/features/ai/agent-op-review.js +1 -1
  123. package/dist/features/ai/agent-ops.js +1 -1
  124. package/dist/features/ai/ai-apply.d.ts +2 -2
  125. package/dist/features/ai/ai-apply.js +1 -1
  126. package/dist/features/ai/ai-review.js +1 -1
  127. package/dist/features/ai/ai-sse.d.ts +6 -6
  128. package/dist/features/ai/ai-sse.js +20 -63
  129. package/dist/features/ai/ai-sse.js.map +1 -1
  130. package/dist/features/ai/assistant.d.ts +8 -7
  131. package/dist/features/ai/assistant.js +3 -3
  132. package/dist/features/ai/assistant.js.map +1 -1
  133. package/dist/features/ai/block-actions.d.ts +3 -2
  134. package/dist/features/ai/block-actions.js +3 -2
  135. package/dist/features/ai/block-actions.js.map +1 -1
  136. package/dist/features/ai/components/AiSelectionMenu.js +1 -1
  137. package/dist/features/ai/components/DocumentChatAnswer.js +1 -1
  138. package/dist/features/ai/components/DocumentChatOps.vue.d.ts +1 -1
  139. package/dist/features/ai/components/SettingsModelProfiles.js +8 -8
  140. package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -1
  141. package/dist/features/ai/document-chat-model.d.ts +8 -7
  142. package/dist/features/ai/document-chat-model.js +5 -5
  143. package/dist/features/ai/document-chat-model.js.map +1 -1
  144. package/dist/features/ai/document-chat.js +1 -1
  145. package/dist/features/ai/feature.js +27 -14
  146. package/dist/features/ai/feature.js.map +1 -1
  147. package/dist/features/ai/ghost-autocomplete.d.ts +7 -6
  148. package/dist/features/ai/ghost-autocomplete.js +6 -9
  149. package/dist/features/ai/ghost-autocomplete.js.map +1 -1
  150. package/dist/features/ai/index.d.ts +4 -3
  151. package/dist/features/ai/index.js +10 -10
  152. package/dist/features/ai/model-profiles.d.ts +5 -4
  153. package/dist/features/ai/model-profiles.js +2 -2
  154. package/dist/features/ai/model-profiles.js.map +1 -1
  155. package/dist/features/ai/protocol/block-lines.js +1 -1
  156. package/dist/features/ai/protocol/block-lines.js.map +1 -1
  157. package/dist/features/ai/protocol/chat.js +4 -1
  158. package/dist/features/ai/protocol/chat.js.map +1 -1
  159. package/dist/features/ai/protocol/index.d.ts +3 -2
  160. package/dist/features/ai/protocol/models.d.ts +2 -16
  161. package/dist/features/ai/protocol/models.js.map +1 -1
  162. package/dist/features/ai/rate-limit.d.ts +1 -1
  163. package/dist/features/ai/rate-limit.js +3 -1
  164. package/dist/features/ai/rate-limit.js.map +1 -1
  165. package/dist/features/ai/react/AiSelectionMenu.js +2 -2
  166. package/dist/features/ai/react/AiSidebar.js +4 -4
  167. package/dist/features/ai/react/DocumentChatAnswer.js +1 -1
  168. package/dist/features/ai/react/DocumentChatOps.d.ts +1 -1
  169. package/dist/features/ai/react/DocumentChatOps.js +1 -1
  170. package/dist/features/ai/react/SettingsModelProfiles.js +8 -10
  171. package/dist/features/ai/react/SettingsModelProfiles.js.map +1 -1
  172. package/dist/features/ai/react/use-ai-assistant.d.ts +1 -1
  173. package/dist/features/ai/react/use-ai-assistant.js +3 -3
  174. package/dist/features/ai/react/use-ai-assistant.js.map +1 -1
  175. package/dist/features/ai/react/use-document-chat.js +2 -2
  176. package/dist/features/ai/react/use-document-chat.js.map +1 -1
  177. package/dist/features/ai/react/use-model-profiles.d.ts +2 -1
  178. package/dist/features/ai/selection-flow.d.ts +1 -1
  179. package/dist/features/ai/selection-flow.js +1 -1
  180. package/dist/features/ai/sidebar-flow.d.ts +1 -1
  181. package/dist/features/ai/sidebar-flow.js +1 -1
  182. package/dist/features/ai/use-ai-assistant.d.ts +1 -1
  183. package/dist/features/ai/use-ai-assistant.js +3 -3
  184. package/dist/features/ai/use-ai-assistant.js.map +1 -1
  185. package/dist/features/ai/use-document-chat.js +2 -2
  186. package/dist/features/ai/use-document-chat.js.map +1 -1
  187. package/dist/features/ai/use-model-profiles.d.ts +2 -1
  188. package/dist/features/authors/attribution.d.ts +1 -1
  189. package/dist/features/authors/feature.js +12 -11
  190. package/dist/features/authors/feature.js.map +1 -1
  191. package/dist/features/block-ui/block-actions.d.ts +1 -1
  192. package/dist/features/block-ui/block-actions.js +1 -1
  193. package/dist/features/block-ui/block-actions.js.map +1 -1
  194. package/dist/features/block-ui/components/BlockUi.js +1 -1
  195. package/dist/features/block-ui/feature.js +1 -0
  196. package/dist/features/block-ui/feature.js.map +1 -1
  197. package/dist/features/block-ui/react/BlockUi.js +1 -1
  198. package/dist/features/collab/anchor-resolver.js +1 -1
  199. package/dist/features/collab/feature.js +2 -0
  200. package/dist/features/collab/feature.js.map +1 -1
  201. package/dist/features/comments/components/CommentThreadView.vue.d.ts +2 -1
  202. package/dist/features/comments/feature.js +12 -11
  203. package/dist/features/comments/feature.js.map +1 -1
  204. package/dist/features/comments/index.d.ts +3 -2
  205. package/dist/features/comments/index.js +1 -1
  206. package/dist/features/comments/margin-layout.d.ts +3 -2
  207. package/dist/features/comments/model.d.ts +3 -67
  208. package/dist/features/comments/model.js +2 -2
  209. package/dist/features/comments/model.js.map +1 -1
  210. package/dist/features/comments/react/CommentThreadView.d.ts +3 -2
  211. package/dist/features/comments/react/use-comments.d.ts +2 -1
  212. package/dist/features/comments/react.d.ts +1 -1
  213. package/dist/features/comments/schema.d.ts +2 -52
  214. package/dist/features/comments/schema.js.map +1 -1
  215. package/dist/features/comments/snapshot-equality.js.map +1 -1
  216. package/dist/features/comments/use-comments.d.ts +3 -2
  217. package/dist/features/comments/vue.d.ts +1 -1
  218. package/dist/features/composites/accepted-children.d.ts +1 -0
  219. package/dist/features/composites/accepted-children.js +16 -1
  220. package/dist/features/composites/accepted-children.js.map +1 -1
  221. package/dist/features/composites/ai-brief.js +31 -0
  222. package/dist/features/composites/ai-brief.js.map +1 -1
  223. package/dist/features/composites/bibliography-command.d.ts +11 -0
  224. package/dist/features/composites/bibliography-form.js +90 -0
  225. package/dist/features/composites/bibliography-form.js.map +1 -0
  226. package/dist/features/composites/bibliography.d.ts +33 -0
  227. package/dist/features/composites/bibliography.js +120 -0
  228. package/dist/features/composites/bibliography.js.map +1 -0
  229. package/dist/features/composites/components/BibliographyEditor.js +261 -0
  230. package/dist/features/composites/components/BibliographyEditor.js.map +1 -0
  231. package/dist/features/composites/components/CompositeChrome.js +75 -26
  232. package/dist/features/composites/components/CompositeChrome.js.map +1 -1
  233. package/dist/features/composites/components/CompositeDetails.js +46 -11
  234. package/dist/features/composites/components/CompositeDetails.js.map +1 -1
  235. package/dist/features/composites/components/CompositeDetails.vue.d.ts +2 -1
  236. package/dist/features/composites/components/CompositeFieldEditor.js +37 -4
  237. package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -1
  238. package/dist/features/composites/components/CompositeInspector.js +17 -5
  239. package/dist/features/composites/components/CompositeInspector.js.map +1 -1
  240. package/dist/features/composites/components/CompositeTable.js +13 -4
  241. package/dist/features/composites/components/CompositeTable.js.map +1 -1
  242. package/dist/features/composites/components/CompositeTagsEditor.js +1 -1
  243. package/dist/features/composites/components/CompositeView.js +11 -1
  244. package/dist/features/composites/components/CompositeView.js.map +1 -1
  245. package/dist/features/composites/components/DerivationBadge.js +103 -0
  246. package/dist/features/composites/components/DerivationBadge.js.map +1 -0
  247. package/dist/features/composites/components/ReferenceFieldSelect.js +60 -0
  248. package/dist/features/composites/components/ReferenceFieldSelect.js.map +1 -0
  249. package/dist/features/composites/components/ReferenceView.js +122 -0
  250. package/dist/features/composites/components/ReferenceView.js.map +1 -0
  251. package/dist/features/composites/components/ReferenceView.vue.d.ts +96 -0
  252. package/dist/features/composites/components/SettingsEditingTab.js +1 -1
  253. package/dist/features/composites/convert.js +2 -2
  254. package/dist/features/composites/convert.js.map +1 -1
  255. package/dist/features/composites/derivation.d.ts +61 -0
  256. package/dist/features/composites/derivation.js +98 -0
  257. package/dist/features/composites/derivation.js.map +1 -0
  258. package/dist/features/composites/derived-chrome.js +69 -0
  259. package/dist/features/composites/derived-chrome.js.map +1 -0
  260. package/dist/features/composites/feature.js +159 -109
  261. package/dist/features/composites/feature.js.map +1 -1
  262. package/dist/features/composites/fences.d.ts +4 -3
  263. package/dist/features/composites/fences.js +51 -7
  264. package/dist/features/composites/fences.js.map +1 -1
  265. package/dist/features/composites/index.d.ts +12 -3
  266. package/dist/features/composites/index.js +15 -6
  267. package/dist/features/composites/inspector-model.d.ts +4 -1
  268. package/dist/features/composites/inspector-model.js +8 -4
  269. package/dist/features/composites/inspector-model.js.map +1 -1
  270. package/dist/features/composites/kinds.d.ts +8 -1
  271. package/dist/features/composites/kinds.js +145 -6
  272. package/dist/features/composites/kinds.js.map +1 -1
  273. package/dist/features/composites/legacy.d.ts +4 -1
  274. package/dist/features/composites/legacy.js +56 -1
  275. package/dist/features/composites/legacy.js.map +1 -1
  276. package/dist/features/composites/meta-display.js +40 -1
  277. package/dist/features/composites/meta-display.js.map +1 -1
  278. package/dist/features/composites/meta-keys.d.ts +7 -0
  279. package/dist/features/composites/meta-keys.js +21 -0
  280. package/dist/features/composites/meta-keys.js.map +1 -0
  281. package/dist/features/composites/node-views.d.ts +6 -3
  282. package/dist/features/composites/node-views.js +7 -3
  283. package/dist/features/composites/node-views.js.map +1 -1
  284. package/dist/features/composites/nodes.d.ts +6 -1
  285. package/dist/features/composites/nodes.js +33 -7
  286. package/dist/features/composites/nodes.js.map +1 -1
  287. package/dist/features/composites/react/BibliographyEditor.js +229 -0
  288. package/dist/features/composites/react/BibliographyEditor.js.map +1 -0
  289. package/dist/features/composites/react/CompositeChrome.js +65 -17
  290. package/dist/features/composites/react/CompositeChrome.js.map +1 -1
  291. package/dist/features/composites/react/CompositeDetails.d.ts +2 -1
  292. package/dist/features/composites/react/CompositeDetails.js +45 -6
  293. package/dist/features/composites/react/CompositeDetails.js.map +1 -1
  294. package/dist/features/composites/react/CompositeFieldEditor.d.ts +1 -1
  295. package/dist/features/composites/react/CompositeFieldEditor.js +24 -1
  296. package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -1
  297. package/dist/features/composites/react/CompositeInspector.js +11 -5
  298. package/dist/features/composites/react/CompositeInspector.js.map +1 -1
  299. package/dist/features/composites/react/CompositeStatusMenu.js +1 -1
  300. package/dist/features/composites/react/CompositeSummaryEditor.js +1 -1
  301. package/dist/features/composites/react/CompositeTable.js +16 -2
  302. package/dist/features/composites/react/CompositeTable.js.map +1 -1
  303. package/dist/features/composites/react/CompositeTagsEditor.js +2 -2
  304. package/dist/features/composites/react/CompositeView.js +6 -1
  305. package/dist/features/composites/react/CompositeView.js.map +1 -1
  306. package/dist/features/composites/react/DerivationBadge.js +116 -0
  307. package/dist/features/composites/react/DerivationBadge.js.map +1 -0
  308. package/dist/features/composites/react/ReferenceFieldSelect.js +52 -0
  309. package/dist/features/composites/react/ReferenceFieldSelect.js.map +1 -0
  310. package/dist/features/composites/react/ReferenceView.d.ts +11 -0
  311. package/dist/features/composites/react/ReferenceView.js +115 -0
  312. package/dist/features/composites/react/ReferenceView.js.map +1 -0
  313. package/dist/features/composites/react/SettingsEditingTab.js +2 -2
  314. package/dist/features/composites/react.d.ts +2 -1
  315. package/dist/features/composites/react.js +7 -3
  316. package/dist/features/composites/react.js.map +1 -1
  317. package/dist/features/composites/reference-ai.js +16 -0
  318. package/dist/features/composites/reference-ai.js.map +1 -0
  319. package/dist/features/composites/reference-label.d.ts +19 -0
  320. package/dist/features/composites/reference-label.js +58 -0
  321. package/dist/features/composites/reference-label.js.map +1 -0
  322. package/dist/features/composites/reference-suggestion.d.ts +10 -0
  323. package/dist/features/composites/reference-suggestion.js +41 -0
  324. package/dist/features/composites/reference-suggestion.js.map +1 -0
  325. package/dist/features/composites/reference-text.d.ts +18 -0
  326. package/dist/features/composites/reference-text.js +89 -0
  327. package/dist/features/composites/reference-text.js.map +1 -0
  328. package/dist/features/composites/reference.d.ts +44 -0
  329. package/dist/features/composites/reference.js +148 -0
  330. package/dist/features/composites/reference.js.map +1 -0
  331. package/dist/features/composites/reveal-source.d.ts +32 -0
  332. package/dist/features/composites/reveal-source.js +89 -0
  333. package/dist/features/composites/reveal-source.js.map +1 -0
  334. package/dist/features/composites/rows.d.ts +21 -2
  335. package/dist/features/composites/rows.js +63 -9
  336. package/dist/features/composites/rows.js.map +1 -1
  337. package/dist/features/composites/schema.d.ts +9 -3
  338. package/dist/features/composites/schema.js +11 -4
  339. package/dist/features/composites/schema.js.map +1 -1
  340. package/dist/features/composites/table-model.js +12 -21
  341. package/dist/features/composites/table-model.js.map +1 -1
  342. package/dist/features/composites/vue.d.ts +3 -2
  343. package/dist/features/composites/vue.js +8 -4
  344. package/dist/features/composites/vue.js.map +1 -1
  345. package/dist/features/media/assets.d.ts +2 -0
  346. package/dist/features/media/assets.js +3 -2
  347. package/dist/features/media/assets.js.map +1 -1
  348. package/dist/features/media/components/FileView.js +13 -4
  349. package/dist/features/media/components/FileView.js.map +1 -1
  350. package/dist/features/media/feature.d.ts +3 -3
  351. package/dist/features/media/feature.js +21 -28
  352. package/dist/features/media/feature.js.map +1 -1
  353. package/dist/features/media/file-import.js +2 -2
  354. package/dist/features/media/file-import.js.map +1 -1
  355. package/dist/features/media/index.d.ts +2 -2
  356. package/dist/features/media/index.js +2 -2
  357. package/dist/features/media/react/FileView.js +19 -2
  358. package/dist/features/media/react/FileView.js.map +1 -1
  359. package/dist/features/media/schema.d.ts +8 -0
  360. package/dist/features/media/schema.js +126 -11
  361. package/dist/features/media/schema.js.map +1 -1
  362. package/dist/features/media/upload.d.ts +16 -14
  363. package/dist/features/media/upload.js +13 -19
  364. package/dist/features/media/upload.js.map +1 -1
  365. package/dist/features/mentions/index.d.ts +4 -3
  366. package/dist/features/mentions/index.js +4 -1
  367. package/dist/features/mentions/index.js.map +1 -1
  368. package/dist/features/mentions/mention-text.d.ts +1 -1
  369. package/dist/features/mentions/mention-text.js.map +1 -1
  370. package/dist/features/mentions/mention.d.ts +0 -6
  371. package/dist/features/mentions/mention.js.map +1 -1
  372. package/dist/features/mentions/metadata-defaults.d.ts +2 -2
  373. package/dist/features/mentions/metadata-defaults.js +3 -9
  374. package/dist/features/mentions/metadata-defaults.js.map +1 -1
  375. package/dist/features/mentions/schema.d.ts +2 -1
  376. package/dist/features/mentions/schema.js.map +1 -1
  377. package/dist/features/tables/feature.d.ts +2 -1
  378. package/dist/features/tables/feature.js +90 -70
  379. package/dist/features/tables/feature.js.map +1 -1
  380. package/dist/features/themes/components/SettingsAppearanceTab.js +6 -9
  381. package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -1
  382. package/dist/features/themes/feature.js +2 -0
  383. package/dist/features/themes/feature.js.map +1 -1
  384. package/dist/features/themes/index.d.ts +2 -1
  385. package/dist/features/themes/react/SettingsAppearanceTab.js +7 -10
  386. package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -1
  387. package/dist/features/themes/schema.d.ts +2 -6
  388. package/dist/features/themes/schema.js.map +1 -1
  389. package/dist/features/themes/theme-runtime.d.ts +1 -1
  390. package/dist/features/themes/theme-runtime.js +4 -2
  391. package/dist/features/themes/theme-runtime.js.map +1 -1
  392. package/dist/features/transcript/TranscriptSegmentView.js +48 -28
  393. package/dist/features/transcript/TranscriptSegmentView.js.map +1 -1
  394. package/dist/features/transcript/feature.js +21 -19
  395. package/dist/features/transcript/feature.js.map +1 -1
  396. package/dist/features/transcript/react/TranscriptSegmentView.js +55 -36
  397. package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -1
  398. package/dist/features/transcript/segment-node.d.ts +2 -0
  399. package/dist/features/transcript/segment-node.js +35 -7
  400. package/dist/features/transcript/segment-node.js.map +1 -1
  401. package/dist/i18n/de/composites.js +91 -1
  402. package/dist/i18n/de/composites.js.map +1 -1
  403. package/dist/i18n/de/integrations.js +49 -8
  404. package/dist/i18n/de/integrations.js.map +1 -1
  405. package/dist/i18n/de/media.js +0 -1
  406. package/dist/i18n/de/media.js.map +1 -1
  407. package/dist/i18n/de/palette.js +22 -0
  408. package/dist/i18n/de/palette.js.map +1 -0
  409. package/dist/i18n/de/tables.js +0 -1
  410. package/dist/i18n/de/tables.js.map +1 -1
  411. package/dist/i18n/de/transcript.js +2 -1
  412. package/dist/i18n/de/transcript.js.map +1 -1
  413. package/dist/i18n/de/tree.js +3 -0
  414. package/dist/i18n/de/tree.js.map +1 -1
  415. package/dist/i18n/de.d.ts +157 -11
  416. package/dist/i18n/de.js +3 -1
  417. package/dist/i18n/de.js.map +1 -1
  418. package/dist/i18n/en/composites.js +89 -1
  419. package/dist/i18n/en/composites.js.map +1 -1
  420. package/dist/i18n/en/integrations.js +49 -8
  421. package/dist/i18n/en/integrations.js.map +1 -1
  422. package/dist/i18n/en/media.js +0 -1
  423. package/dist/i18n/en/media.js.map +1 -1
  424. package/dist/i18n/en/palette.js +22 -0
  425. package/dist/i18n/en/palette.js.map +1 -0
  426. package/dist/i18n/en/tables.js +0 -1
  427. package/dist/i18n/en/tables.js.map +1 -1
  428. package/dist/i18n/en/transcript.js +2 -1
  429. package/dist/i18n/en/transcript.js.map +1 -1
  430. package/dist/i18n/en/tree.js +3 -0
  431. package/dist/i18n/en/tree.js.map +1 -1
  432. package/dist/i18n/en.js +3 -1
  433. package/dist/i18n/en.js.map +1 -1
  434. package/dist/index.d.ts +4 -3
  435. package/dist/integrations/composite-ai/bibliography-fetch.d.ts +31 -0
  436. package/dist/integrations/composite-ai/bibliography-fetch.js +159 -0
  437. package/dist/integrations/composite-ai/bibliography-fetch.js.map +1 -0
  438. package/dist/integrations/composite-ai/composite-fill.d.ts +30 -8
  439. package/dist/integrations/composite-ai/composite-fill.js +97 -56
  440. package/dist/integrations/composite-ai/composite-fill.js.map +1 -1
  441. package/dist/integrations/composite-ai/composite-summary.d.ts +4 -12
  442. package/dist/integrations/composite-ai/composite-summary.js +7 -26
  443. package/dist/integrations/composite-ai/composite-summary.js.map +1 -1
  444. package/dist/integrations/composite-ai/derive.d.ts +29 -0
  445. package/dist/integrations/composite-ai/derive.js +173 -0
  446. package/dist/integrations/composite-ai/derive.js.map +1 -0
  447. package/dist/integrations/composite-ai/index.d.ts +11 -7
  448. package/dist/integrations/composite-ai/index.js +72 -14
  449. package/dist/integrations/composite-ai/index.js.map +1 -1
  450. package/dist/integrations/composite-ai/rendition.d.ts +45 -0
  451. package/dist/integrations/composite-ai/rendition.js +314 -0
  452. package/dist/integrations/composite-ai/rendition.js.map +1 -0
  453. package/dist/integrations/composite-media/index.d.ts +7 -5
  454. package/dist/integrations/composite-media/index.js +86 -13
  455. package/dist/integrations/composite-media/index.js.map +1 -1
  456. package/dist/integrations/transcript-ai/index.d.ts +1 -1
  457. package/dist/integrations/transcript-ai/index.js +5 -2
  458. package/dist/integrations/transcript-ai/index.js.map +1 -1
  459. package/dist/integrations/transcript-ai/protocol.d.ts +2 -12
  460. package/dist/integrations/transcript-ai/protocol.js +0 -2
  461. package/dist/integrations/transcript-ai/protocol.js.map +1 -1
  462. package/dist/integrations/transcript-ai/transcript-cleanup.d.ts +5 -5
  463. package/dist/integrations/transcript-ai/transcript-cleanup.js +7 -10
  464. package/dist/integrations/transcript-ai/transcript-cleanup.js.map +1 -1
  465. package/dist/markdown/MarkdownSurface.vue.d.ts +6 -5
  466. package/dist/markdown/MarkdownSurface2.js +3 -6
  467. package/dist/markdown/MarkdownSurface2.js.map +1 -1
  468. package/dist/markdown/document.js +1 -1
  469. package/dist/markdown/source-mode.d.ts +1 -1
  470. package/dist/nuxt/module.d.ts +1402 -54
  471. package/dist/nuxt/module.js +6 -49
  472. package/dist/nuxt/module.js.map +1 -1
  473. package/dist/nuxt/runtime/install-context.d.ts +7 -3
  474. package/dist/nuxt/runtime/install-context.js +14 -8
  475. package/dist/nuxt/runtime/install-context.js.map +1 -1
  476. package/dist/nuxt/runtime/plugins/editor-context-nuxt-ui.client.ts +2 -2
  477. package/dist/nuxt/runtime/server/plugins/editor-server.js +20 -12
  478. package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -1
  479. package/dist/presets/compose.d.ts +94 -0
  480. package/dist/presets/compose.js +164 -0
  481. package/dist/presets/compose.js.map +1 -0
  482. package/dist/react/AdvancedEditor.d.ts +15 -15
  483. package/dist/react/AdvancedEditor.js +15 -13
  484. package/dist/react/AdvancedEditor.js.map +1 -1
  485. package/dist/react/EditorCommandPalette.d.ts +13 -0
  486. package/dist/react/EditorCommandPalette.js +118 -0
  487. package/dist/react/EditorCommandPalette.js.map +1 -0
  488. package/dist/react/EditorSettingsModal.d.ts +5 -5
  489. package/dist/react/EditorSettingsModal.js +7 -4
  490. package/dist/react/EditorSettingsModal.js.map +1 -1
  491. package/dist/react/EditorSettingsPanel.d.ts +7 -7
  492. package/dist/react/EditorSettingsPanel.js +8 -5
  493. package/dist/react/EditorSettingsPanel.js.map +1 -1
  494. package/dist/react/EditorSurface.d.ts +7 -7
  495. package/dist/react/EditorSurface.js +10 -6
  496. package/dist/react/EditorSurface.js.map +1 -1
  497. package/dist/react/EditorToolbar.d.ts +4 -6
  498. package/dist/react/EditorToolbar.js +29 -37
  499. package/dist/react/EditorToolbar.js.map +1 -1
  500. package/dist/react/SimpleEditor.d.ts +22 -23
  501. package/dist/react/SimpleEditor.js +21 -7
  502. package/dist/react/SimpleEditor.js.map +1 -1
  503. package/dist/react/advanced.d.ts +4 -3
  504. package/dist/react/advanced.js +2 -2
  505. package/dist/react/compose.d.ts +20 -0
  506. package/dist/react/compose.js +49 -0
  507. package/dist/react/compose.js.map +1 -0
  508. package/dist/react/composed-surface.d.ts +39 -0
  509. package/dist/react/composed-surface.js +71 -0
  510. package/dist/react/composed-surface.js.map +1 -0
  511. package/dist/react/context.js +6 -2
  512. package/dist/react/context.js.map +1 -1
  513. package/dist/react/index.d.ts +2 -1
  514. package/dist/react/index.js +2 -1
  515. package/dist/react/key-labels.js +15 -0
  516. package/dist/react/key-labels.js.map +1 -0
  517. package/dist/react/settings.d.ts +1 -1
  518. package/dist/react/simple.d.ts +2 -2
  519. package/dist/react/ui/command.js +36 -1
  520. package/dist/react/ui/command.js.map +1 -1
  521. package/dist/schema/advanced.d.ts +6 -6
  522. package/dist/schema/advanced.js +26 -29
  523. package/dist/schema/advanced.js.map +1 -1
  524. package/dist/server/ai.d.ts +5 -16
  525. package/dist/server/ai.js.map +1 -1
  526. package/dist/server/auth.d.ts +9 -0
  527. package/dist/server/collab-state.d.ts +1 -1
  528. package/dist/server/collab-state.js.map +1 -1
  529. package/dist/server/collab.d.ts +13 -13
  530. package/dist/server/collab.js +34 -18
  531. package/dist/server/collab.js.map +1 -1
  532. package/dist/server/crossref.js +78 -0
  533. package/dist/server/crossref.js.map +1 -0
  534. package/dist/server/errors.d.ts +1 -1
  535. package/dist/server/errors.js +1 -1
  536. package/dist/server/errors.js.map +1 -1
  537. package/dist/server/extract.js +308 -0
  538. package/dist/server/extract.js.map +1 -0
  539. package/dist/{nuxt/runtime/server/utils/editor-route.js → server/h3.js} +8 -16
  540. package/dist/server/h3.js.map +1 -0
  541. package/dist/server/handlers/ai.d.ts +30 -9
  542. package/dist/server/handlers/ai.js +170 -36
  543. package/dist/server/handlers/ai.js.map +1 -1
  544. package/dist/server/handlers/context.d.ts +12 -5
  545. package/dist/server/handlers/context.js +10 -4
  546. package/dist/server/handlers/context.js.map +1 -1
  547. package/dist/server/handlers/editor.d.ts +19 -13
  548. package/dist/server/handlers/editor.js +49 -38
  549. package/dist/server/handlers/editor.js.map +1 -1
  550. package/dist/server/handlers/index.d.ts +4 -4
  551. package/dist/server/handlers/index.js +4 -4
  552. package/dist/server/host.d.ts +16 -25
  553. package/dist/server/host.js +58 -41
  554. package/dist/server/host.js.map +1 -1
  555. package/dist/server/index.d.ts +6 -4
  556. package/dist/server/index.js +3 -2
  557. package/dist/server/pdf.js +97 -0
  558. package/dist/server/pdf.js.map +1 -0
  559. package/dist/server/{adapter.d.ts → ports.d.ts} +81 -30
  560. package/dist/server/ports.js +29 -0
  561. package/dist/server/ports.js.map +1 -0
  562. package/dist/server/routes.js +144 -0
  563. package/dist/server/routes.js.map +1 -0
  564. package/dist/settings/index.d.ts +1 -1
  565. package/dist/settings/index.js.map +1 -1
  566. package/dist/styles/composites.css +25 -0
  567. package/dist/tree/DocumentTree.js +56 -29
  568. package/dist/tree/DocumentTree.js.map +1 -1
  569. package/dist/tree/react/DocumentTree.js +23 -0
  570. package/dist/tree/react/DocumentTree.js.map +1 -1
  571. package/dist/tree/tree-host.js +2 -2
  572. package/dist/tree/tree-items.js +1 -1
  573. package/dist/vue/AdvancedEditor.js +30 -9
  574. package/dist/vue/AdvancedEditor.js.map +1 -1
  575. package/dist/vue/AdvancedEditor.vue.d.ts +28 -8
  576. package/dist/vue/SimpleEditor.js +62 -16
  577. package/dist/vue/SimpleEditor.js.map +1 -1
  578. package/dist/vue/SimpleEditor.vue.d.ts +37 -7
  579. package/dist/vue/advanced.d.ts +3 -2
  580. package/dist/vue/advanced.js +2 -2
  581. package/dist/vue/components/EditorCommandPalette.js +91 -0
  582. package/dist/vue/components/EditorCommandPalette.js.map +1 -0
  583. package/dist/vue/components/EditorCommandPalette.vue.d.ts +15 -0
  584. package/dist/vue/components/EditorSettingsModal.js +10 -6
  585. package/dist/vue/components/EditorSettingsModal.js.map +1 -1
  586. package/dist/vue/components/EditorSettingsModal.vue.d.ts +4 -4
  587. package/dist/vue/components/EditorSettingsPanel.js +10 -6
  588. package/dist/vue/components/EditorSettingsPanel.js.map +1 -1
  589. package/dist/vue/components/EditorSettingsPanel.vue.d.ts +6 -6
  590. package/dist/vue/components/EditorSurface.js +11 -6
  591. package/dist/vue/components/EditorSurface.js.map +1 -1
  592. package/dist/vue/components/EditorSurface.vue.d.ts +7 -7
  593. package/dist/vue/components/EditorToolbar.js +41 -49
  594. package/dist/vue/components/EditorToolbar.js.map +1 -1
  595. package/dist/vue/components/EditorToolbar.vue.d.ts +2 -4
  596. package/dist/vue/compose.d.ts +17 -0
  597. package/dist/vue/compose.js +51 -0
  598. package/dist/vue/compose.js.map +1 -0
  599. package/dist/vue/context-key.d.ts +6 -0
  600. package/dist/vue/context-key.js +6 -0
  601. package/dist/vue/context-key.js.map +1 -0
  602. package/dist/vue/context.d.ts +8 -6
  603. package/dist/vue/context.js +6 -5
  604. package/dist/vue/context.js.map +1 -1
  605. package/dist/vue/index.d.ts +10 -8
  606. package/dist/vue/index.js +10 -8
  607. package/dist/vue/kit/index.d.ts +2 -2
  608. package/dist/vue/kit/nuxt-ui.js +23 -0
  609. package/dist/vue/kit/nuxt-ui.js.map +1 -1
  610. package/dist/vue/kit/types.d.ts +40 -1
  611. package/package.json +30 -16
  612. package/dist/adapters/comments/client.d.ts +0 -64
  613. package/dist/adapters/comments/client.js.map +0 -1
  614. package/dist/adapters/routes.js.map +0 -1
  615. package/dist/core/toolbar.d.ts +0 -74
  616. package/dist/core/toolbar.js +0 -45
  617. package/dist/core/toolbar.js.map +0 -1
  618. package/dist/integrations/composite-ai/document-transcribe.d.ts +0 -14
  619. package/dist/integrations/composite-ai/document-transcribe.js +0 -89
  620. package/dist/integrations/composite-ai/document-transcribe.js.map +0 -1
  621. package/dist/nuxt/runtime/server/api/ai/chat.post.d.ts +0 -5
  622. package/dist/nuxt/runtime/server/api/ai/chat.post.js +0 -8
  623. package/dist/nuxt/runtime/server/api/ai/chat.post.js.map +0 -1
  624. package/dist/nuxt/runtime/server/api/ai/complete.post.d.ts +0 -5
  625. package/dist/nuxt/runtime/server/api/ai/complete.post.js +0 -8
  626. package/dist/nuxt/runtime/server/api/ai/complete.post.js.map +0 -1
  627. package/dist/nuxt/runtime/server/api/ai/generate.post.d.ts +0 -5
  628. package/dist/nuxt/runtime/server/api/ai/generate.post.js +0 -8
  629. package/dist/nuxt/runtime/server/api/ai/generate.post.js.map +0 -1
  630. package/dist/nuxt/runtime/server/api/ai/models.get.d.ts +0 -5
  631. package/dist/nuxt/runtime/server/api/ai/models.get.js +0 -8
  632. package/dist/nuxt/runtime/server/api/ai/models.get.js.map +0 -1
  633. package/dist/nuxt/runtime/server/api/ai/transcribe.post.d.ts +0 -5
  634. package/dist/nuxt/runtime/server/api/ai/transcribe.post.js +0 -8
  635. package/dist/nuxt/runtime/server/api/ai/transcribe.post.js.map +0 -1
  636. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.d.ts +0 -5
  637. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js +0 -8
  638. package/dist/nuxt/runtime/server/api/ai/transcript-cleanup.post.js.map +0 -1
  639. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.d.ts +0 -5
  640. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js +0 -8
  641. package/dist/nuxt/runtime/server/api/editor/assets/[id]/[name].get.js.map +0 -1
  642. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.d.ts +0 -5
  643. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js +0 -8
  644. package/dist/nuxt/runtime/server/api/editor/assets/[id].post.js.map +0 -1
  645. package/dist/nuxt/runtime/server/api/editor/settings.get.d.ts +0 -5
  646. package/dist/nuxt/runtime/server/api/editor/settings.get.js +0 -8
  647. package/dist/nuxt/runtime/server/api/editor/settings.get.js.map +0 -1
  648. package/dist/nuxt/runtime/server/api/editor/settings.put.d.ts +0 -5
  649. package/dist/nuxt/runtime/server/api/editor/settings.put.js +0 -8
  650. package/dist/nuxt/runtime/server/api/editor/settings.put.js.map +0 -1
  651. package/dist/nuxt/runtime/server/api/editor/tags.get.d.ts +0 -5
  652. package/dist/nuxt/runtime/server/api/editor/tags.get.js +0 -8
  653. package/dist/nuxt/runtime/server/api/editor/tags.get.js.map +0 -1
  654. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.d.ts +0 -5
  655. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js +0 -8
  656. package/dist/nuxt/runtime/server/api/editor/themes/[id].delete.js.map +0 -1
  657. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.d.ts +0 -5
  658. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js +0 -8
  659. package/dist/nuxt/runtime/server/api/editor/themes/[id].get.js.map +0 -1
  660. package/dist/nuxt/runtime/server/api/editor/themes/index.get.d.ts +0 -5
  661. package/dist/nuxt/runtime/server/api/editor/themes/index.get.js +0 -8
  662. package/dist/nuxt/runtime/server/api/editor/themes/index.get.js.map +0 -1
  663. package/dist/nuxt/runtime/server/api/editor/themes/index.post.d.ts +0 -5
  664. package/dist/nuxt/runtime/server/api/editor/themes/index.post.js +0 -8
  665. package/dist/nuxt/runtime/server/api/editor/themes/index.post.js.map +0 -1
  666. package/dist/nuxt/runtime/server/api/editor/users.get.d.ts +0 -5
  667. package/dist/nuxt/runtime/server/api/editor/users.get.js +0 -8
  668. package/dist/nuxt/runtime/server/api/editor/users.get.js.map +0 -1
  669. package/dist/nuxt/runtime/server/plugins/collab.d.ts +0 -5
  670. package/dist/nuxt/runtime/server/plugins/collab.js +0 -10
  671. package/dist/nuxt/runtime/server/plugins/collab.js.map +0 -1
  672. package/dist/nuxt/runtime/server/routes/collab/[id].d.ts +0 -5
  673. package/dist/nuxt/runtime/server/routes/collab/[id].js +0 -35
  674. package/dist/nuxt/runtime/server/routes/collab/[id].js.map +0 -1
  675. package/dist/nuxt/runtime/server/utils/editor-route.d.ts +0 -11
  676. package/dist/nuxt/runtime/server/utils/editor-route.js.map +0 -1
  677. package/dist/presets/advanced.d.ts +0 -33
  678. package/dist/presets/advanced.js +0 -50
  679. package/dist/presets/advanced.js.map +0 -1
  680. package/dist/presets/simple.d.ts +0 -9
  681. package/dist/presets/simple.js +0 -12
  682. package/dist/presets/simple.js.map +0 -1
  683. package/dist/react/advanced-preset.d.ts +0 -11
  684. package/dist/react/advanced-preset.js +0 -31
  685. package/dist/react/advanced-preset.js.map +0 -1
  686. package/dist/vue/advanced-preset.d.ts +0 -13
  687. package/dist/vue/advanced-preset.js +0 -33
  688. package/dist/vue/advanced-preset.js.map +0 -1
  689. package/docs/extending.md +0 -538
  690. package/docs/integration.md +0 -632
  691. package/docs/llms.md +0 -383
  692. package/docs/usage.md +0 -1076
@@ -1,3 +1,3 @@
1
- import { advancedEditor } from "./advanced-preset.js";
1
+ import { advancedEditor, composeEditor } from "./compose.js";
2
2
  import _sfc_main from "./AdvancedEditor.js";
3
- export { _sfc_main as AdvancedEditor, advancedEditor };
3
+ export { _sfc_main as AdvancedEditor, advancedEditor, composeEditor };
@@ -0,0 +1,91 @@
1
+ import { editorEntryOf } from "../../core/editor-ui.js";
2
+ import { filterPalette, paletteGroupsOf } from "../../core/palette.js";
3
+ import { useUiKit } from "../kit/use-ui-kit.js";
4
+ import { useEditorI18n } from "../use-editor-i18n.js";
5
+ import { useEditorUi } from "../use-editor-ui.js";
6
+ import { computed, createBlock, createTextVNode, createVNode, defineComponent, openBlock, ref, toDisplayString, toRaw, unref, watch, withCtx } from "vue";
7
+ //#region src/vue/components/EditorCommandPalette.vue
8
+ /**
9
+ * „Befehle“ (⌘K): the commands of the surface's editor (features' and host's, `palette !== false`) in a modal palette,
10
+ * grouped like the toolbar, disabled where `commandState` disables them; a menu command opens its rows as a second
11
+ * level. Mounted by `core-ui` as an overlay of the surface; the surface's `ui.paletteOpen` is its open state.
12
+ */
13
+ const _sfc_main = /*@__PURE__*/ defineComponent({
14
+ __name: "EditorCommandPalette",
15
+ props: { editor: {} },
16
+ setup(__props) {
17
+ const props = __props;
18
+ const { CommandPalette: UCommandPalette, Modal: UModal } = useUiKit();
19
+ const ui = useEditorUi(() => props.editor);
20
+ const { t } = useEditorI18n();
21
+ const all = ref([]);
22
+ const query = ref("");
23
+ const groups = computed(() => filterPalette(all.value, query.value).map((group) => ({
24
+ id: group.id,
25
+ label: group.label,
26
+ ignoreFilter: true,
27
+ items: group.entries.map(itemOf)
28
+ })));
29
+ function close() {
30
+ if (ui.value?.paletteOpen) ui.value.togglePalette();
31
+ }
32
+ function itemOf(entry) {
33
+ const { run } = entry;
34
+ return {
35
+ id: entry.id,
36
+ label: entry.label,
37
+ ...entry.icon && { icon: entry.icon },
38
+ ...entry.kbds && { kbds: entry.kbds },
39
+ ...entry.description !== void 0 && { description: entry.description },
40
+ disabled: entry.disabled,
41
+ ...entry.children ? { children: entry.children.map(itemOf) } : run && { onSelect: () => {
42
+ close();
43
+ run();
44
+ } }
45
+ };
46
+ }
47
+ watch(() => ui.value?.paletteOpen ?? false, (open) => {
48
+ if (!open) return;
49
+ const entry = editorEntryOf(toRaw(props.editor));
50
+ query.value = "";
51
+ all.value = entry ? paletteGroupsOf(toRaw(props.editor), entry) : [];
52
+ }, { immediate: true });
53
+ function onOpenChange(open) {
54
+ if (open !== !!ui.value?.paletteOpen) ui.value?.togglePalette();
55
+ }
56
+ return (_ctx, _cache) => {
57
+ return openBlock(), createBlock(unref(UModal), {
58
+ open: unref(ui)?.paletteOpen ?? false,
59
+ title: unref(t)("palette.title"),
60
+ description: unref(t)("palette.description"),
61
+ "onUpdate:open": onOpenChange
62
+ }, {
63
+ content: withCtx(() => [createVNode(unref(UCommandPalette), {
64
+ "search-term": query.value,
65
+ "onUpdate:searchTerm": _cache[0] || (_cache[0] = ($event) => query.value = $event),
66
+ groups: groups.value,
67
+ placeholder: unref(t)("palette.placeholder"),
68
+ close: "",
69
+ class: "h-80",
70
+ "onUpdate:open": onOpenChange
71
+ }, {
72
+ empty: withCtx(() => [createTextVNode(toDisplayString(unref(t)("palette.empty")), 1)]),
73
+ _: 1
74
+ }, 8, [
75
+ "search-term",
76
+ "groups",
77
+ "placeholder"
78
+ ])]),
79
+ _: 1
80
+ }, 8, [
81
+ "open",
82
+ "title",
83
+ "description"
84
+ ]);
85
+ };
86
+ }
87
+ });
88
+ //#endregion
89
+ export { _sfc_main as default };
90
+
91
+ //# sourceMappingURL=EditorCommandPalette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorCommandPalette.js","names":["_openBlock","_createBlock","_unref","_withCtx","_createVNode","_createTextVNode","_toDisplayString"],"sources":["../../../src/vue/components/EditorCommandPalette.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Editor } from '@tiptap/core'\nimport { computed, ref, toRaw, watch } from 'vue'\nimport { editorEntryOf } from '../../core/editor-ui'\nimport { filterPalette, type PaletteEntry, type PaletteGroup, paletteGroupsOf } from '../../core/palette'\nimport type { CommandPaletteItem } from '../kit/types'\nimport { useUiKit } from '../kit/use-ui-kit'\nimport { useEditorUi } from '../use-editor-ui'\nimport { useEditorI18n } from '../use-editor-i18n'\n\n/**\n * „Befehle“ (⌘K): the commands of the surface's editor (features' and host's, `palette !== false`) in a modal palette,\n * grouped like the toolbar, disabled where `commandState` disables them; a menu command opens its rows as a second\n * level. Mounted by `core-ui` as an overlay of the surface; the surface's `ui.paletteOpen` is its open state.\n */\nconst props = defineProps<{ editor: Editor }>()\n\nconst { CommandPalette: UCommandPalette, Modal: UModal } = useUiKit()\nconst ui = useEditorUi(() => props.editor)\nconst { t } = useEditorI18n()\n\n// The search is `filterPalette`, the same function the React palette uses: the kit widget lists the rows as given\n// (`ignoreFilter`) and only reports what is typed (`searchTerm`). A menu command's second level is the widget's own search.\nconst all = ref<PaletteGroup[]>([])\nconst query = ref('')\nconst groups = computed(() => filterPalette(all.value, query.value).map(group => ({ id: group.id, label: group.label, ignoreFilter: true, items: group.entries.map(itemOf) })))\n\nfunction close() {\n if (ui.value?.paletteOpen) ui.value.togglePalette()\n}\n\nfunction itemOf(entry: PaletteEntry): CommandPaletteItem {\n const { run } = entry\n return {\n id: entry.id,\n label: entry.label,\n ...(entry.icon && { icon: entry.icon }),\n ...(entry.kbds && { kbds: entry.kbds }),\n ...(entry.description !== undefined && { description: entry.description }),\n disabled: entry.disabled,\n ...(entry.children ? { children: entry.children.map(itemOf) } : run && {\n onSelect: () => {\n close()\n run()\n },\n }),\n }\n}\n\n// The state of every command is read when the palette opens, not while it is closed.\nwatch(() => ui.value?.paletteOpen ?? false, (open) => {\n if (!open) return\n const entry = editorEntryOf(toRaw(props.editor))\n query.value = ''\n all.value = entry ? paletteGroupsOf(toRaw(props.editor), entry) : []\n}, { immediate: true })\n\nfunction onOpenChange(open: boolean) {\n if (open !== !!ui.value?.paletteOpen) ui.value?.togglePalette()\n}\n</script>\n\n<template>\n <UModal\n :open=\"ui?.paletteOpen ?? false\"\n :title=\"t('palette.title')\"\n :description=\"t('palette.description')\"\n @update:open=\"onOpenChange\"\n >\n <template #content>\n <UCommandPalette v-model:search-term=\"query\" :groups=\"groups\" :placeholder=\"t('palette.placeholder')\" close class=\"h-80\" @update:open=\"onOpenChange\">\n <template #empty>\n {{ t('palette.empty') }}\n </template>\n </UCommandPalette>\n </template>\n </UModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;EAeA,MAAM,QAAQ;EAEd,MAAM,EAAE,gBAAgB,iBAAiB,OAAO,WAAW,SAAS;EACpE,MAAM,KAAK,kBAAkB,MAAM,MAAM;EACzC,MAAM,EAAE,MAAM,cAAc;EAI5B,MAAM,MAAM,IAAoB,CAAC,CAAC;EAClC,MAAM,QAAQ,IAAI,EAAE;EACpB,MAAM,SAAS,eAAe,cAAc,IAAI,OAAO,MAAM,KAAK,CAAC,CAAC,KAAI,WAAU;GAAE,IAAI,MAAM;GAAI,OAAO,MAAM;GAAO,cAAc;GAAM,OAAO,MAAM,QAAQ,IAAI,MAAM;EAAE,EAAE,CAAC;EAE9K,SAAS,QAAQ;GACf,IAAI,GAAG,OAAO,aAAa,GAAG,MAAM,cAAc;EACpD;EAEA,SAAS,OAAO,OAAyC;GACvD,MAAM,EAAE,QAAQ;GAChB,OAAO;IACL,IAAI,MAAM;IACV,OAAO,MAAM;IACb,GAAI,MAAM,QAAQ,EAAE,MAAM,MAAM,KAAK;IACrC,GAAI,MAAM,QAAQ,EAAE,MAAM,MAAM,KAAK;IACrC,GAAI,MAAM,gBAAgB,KAAA,KAAa,EAAE,aAAa,MAAM,YAAY;IACxE,UAAU,MAAM;IAChB,GAAI,MAAM,WAAW,EAAE,UAAU,MAAM,SAAS,IAAI,MAAM,EAAE,IAAI,OAAO,EACrE,gBAAgB;KACd,MAAM;KACN,IAAI;IACN,EACF;GACF;EACF;EAGA,YAAY,GAAG,OAAO,eAAe,QAAQ,SAAS;GACpD,IAAI,CAAC,MAAM;GACX,MAAM,QAAQ,cAAc,MAAM,MAAM,MAAM,CAAC;GAC/C,MAAM,QAAQ;GACd,IAAI,QAAQ,QAAQ,gBAAgB,MAAM,MAAM,MAAM,GAAG,KAAK,IAAI,CAAC;EACrE,GAAG,EAAE,WAAW,KAAK,CAAC;EAEtB,SAAS,aAAa,MAAe;GACnC,IAAI,SAAS,CAAC,CAAC,GAAG,OAAO,aAAa,GAAG,OAAO,cAAc;EAChE;;GAIE,OAAAA,UAAA,GAAAC,YAaSC,MAAA,MAAA,GAAA;IAZN,MAAMA,MAAA,EAAA,CAAE,EAAE,eAAW;IACrB,OAAOA,MAAA,CAAA,CAAC,CAAA,eAAA;IACR,aAAaA,MAAA,CAAA,CAAC,CAAA,qBAAA;IACd,iBAAa;;IAEH,SAAOC,cAKE,CAJlBC,YAIkBF,MAAA,eAAA,GAAA;KAJO,eAAa,MAAA;KAAA,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,MAAK,QAAA;KAAG,QAAQ,OAAA;KAAS,aAAaA,MAAA,CAAA,CAAC,CAAA,qBAAA;KAAyB,OAAA;KAAM,OAAM;KAAQ,iBAAa;;KAC1H,OAAKC,cACU,CAArBE,gBAAAC,gBAAAJ,MAAA,CAAA,CAAC,CAAA,eAAA,CAAA,GAAA,CAAA,CAAA,CAAA"}
@@ -0,0 +1,15 @@
1
+ import { Editor } from "@tiptap/core";
2
+ //#region src/vue/components/EditorCommandPalette.vue.d.ts
3
+ /**
4
+ * „Befehle“ (⌘K): the commands of the surface's editor (features' and host's, `palette !== false`) in a modal palette,
5
+ * grouped like the toolbar, disabled where `commandState` disables them; a menu command opens its rows as a second
6
+ * level. Mounted by `core-ui` as an overlay of the surface; the surface's `ui.paletteOpen` is its open state.
7
+ */
8
+ type __VLS_Props = {
9
+ editor: Editor;
10
+ };
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
+ declare const _default: typeof __VLS_export;
13
+ //#endregion
14
+ export { _default as default };
15
+ //# sourceMappingURL=EditorCommandPalette.vue.d.ts.map
@@ -1,16 +1,17 @@
1
1
  import { settingsTabsOf } from "../../core/define-editor.js";
2
+ import { editorEntryOf } from "../../core/editor-ui.js";
2
3
  import { useUiKit } from "../kit/use-ui-kit.js";
3
4
  import { useEditorSettings } from "../settings.js";
4
5
  import { useEditorContext } from "../context.js";
5
6
  import { useEditorI18n } from "../use-editor-i18n.js";
6
7
  import _sfc_main$1 from "./EditorSettingsPanel.js";
7
- import { computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, mergeModels, openBlock, unref, useModel, withCtx } from "vue";
8
+ import { computed, createBlock, createCommentVNode, createElementVNode, createVNode, defineComponent, mergeModels, openBlock, toRaw, unref, useModel, withCtx } from "vue";
8
9
  //#region src/vue/components/EditorSettingsModal.vue
9
10
  const _hoisted_1 = { class: "flex w-full justify-end" };
10
- /** „Einstellungen“: `EditorSettingsPanel` in a modal. Renders nothing when the preset contributes no settings tab. */
11
+ /** „Einstellungen“: `EditorSettingsPanel` in a modal. Renders nothing without an editor or when its preset contributes no settings tab. */
11
12
  const _sfc_main = /*@__PURE__*/ defineComponent({
12
13
  __name: "EditorSettingsModal",
13
- props: /*@__PURE__*/ mergeModels({ preset: {} }, {
14
+ props: /*@__PURE__*/ mergeModels({ editor: {} }, {
14
15
  "open": {
15
16
  type: Boolean,
16
17
  default: false
@@ -29,7 +30,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
29
30
  const app = useEditorContext();
30
31
  const { t } = useEditorI18n();
31
32
  const { synced } = useEditorSettings();
32
- const hasTabs = computed(() => settingsTabsOf(props.preset, app).length > 0);
33
+ const hasTabs = computed(() => {
34
+ const preset = editorEntryOf(props.editor && toRaw(props.editor))?.preset;
35
+ return !!preset && settingsTabsOf(preset, app).length > 0;
36
+ });
33
37
  return (_ctx, _cache) => {
34
38
  return hasTabs.value ? (openBlock(), createBlock(unref(UModal), {
35
39
  key: 0,
@@ -45,9 +49,9 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
45
49
  body: withCtx(() => [createVNode(_sfc_main$1, {
46
50
  tab: tab.value,
47
51
  "onUpdate:tab": _cache[0] || (_cache[0] = ($event) => tab.value = $event),
48
- preset: __props.preset,
52
+ editor: __props.editor,
49
53
  "content-class": "h-[32rem] overflow-y-auto pt-4 pr-2"
50
- }, null, 8, ["tab", "preset"])]),
54
+ }, null, 8, ["tab", "editor"])]),
51
55
  footer: withCtx(() => [createElementVNode("div", _hoisted_1, [createVNode(unref(UButton), {
52
56
  label: unref(t)("common.close"),
53
57
  color: "neutral",
@@ -1 +1 @@
1
- {"version":3,"file":"EditorSettingsModal.js","names":["_useModel","_openBlock","_createBlock","_unref","_withCtx","_createVNode","EditorSettingsPanel","_createElementVNode","_createCommentVNode"],"sources":["../../../src/vue/components/EditorSettingsModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useUiKit } from '../kit/use-ui-kit'\nimport { computed } from 'vue'\nimport { settingsTabsOf } from '../../core/define-editor'\nimport type { EditorPreset } from '../../core/feature'\nimport { useEditorContext } from '../context'\nimport { useEditorI18n } from '../use-editor-i18n'\nimport { useEditorSettings } from '../settings'\nimport EditorSettingsPanel from './EditorSettingsPanel.vue'\n\n/** „Einstellungen“: `EditorSettingsPanel` in a modal. Renders nothing when the preset contributes no settings tab. */\nconst props = defineProps<{\n /** The preset whose features contribute the tabs (the surface's `preset`). */\n preset: EditorPreset\n}>()\n\nconst { Button: UButton, Modal: UModal } = useUiKit()\n\nconst open = defineModel<boolean>('open', { default: false })\n/** Shown tab id (see `EditorSettingsPanel`). */\nconst tab = defineModel<string | undefined>('tab', { default: undefined })\n\nconst app = useEditorContext()\nconst { t } = useEditorI18n()\nconst { synced } = useEditorSettings()\nconst hasTabs = computed(() => settingsTabsOf(props.preset, app).length > 0)\n</script>\n\n<template>\n <UModal\n v-if=\"hasTabs\"\n :open=\"open\"\n :title=\"t('settings.title')\"\n :description=\"t(synced ? 'settings.scope.account' : 'settings.scope.browser')\"\n :ui=\"{ overlay: 'bg-[color-mix(in_oklab,var(--sk-bg-elevated)_60%,transparent)] backdrop-blur-sm', content: 'sm:w-[42rem] sm:max-w-[42rem]' }\"\n @update:open=\"open = $event\"\n >\n <template #body>\n <EditorSettingsPanel v-model:tab=\"tab\" :preset=\"preset\" content-class=\"h-[32rem] overflow-y-auto pt-4 pr-2\" />\n </template>\n <template #footer>\n <div class=\"flex w-full justify-end\">\n <UButton :label=\"t('common.close')\" color=\"neutral\" variant=\"ghost\" @click=\"open = false\" />\n </div>\n </template>\n </UModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;EAWA,MAAM,QAAQ;EAKd,MAAM,EAAE,QAAQ,SAAS,OAAO,WAAW,SAAS;EAEpD,MAAM,OAAOA,SAAoB,SAAC,MAA0B;;EAE5D,MAAM,MAAMA,SAA+B,SAAC,KAA6B;EAEzE,MAAM,MAAM,iBAAiB;EAC7B,MAAM,EAAE,MAAM,cAAc;EAC5B,MAAM,EAAE,WAAW,kBAAkB;EACrC,MAAM,UAAU,eAAe,eAAe,MAAM,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC;;GAKjE,OAAA,QAAA,SADRC,UAAA,GAAAC,YAgBSC,MAAA,MAAA,GAAA;;IAdN,MAAM,KAAA;IACN,OAAOA,MAAA,CAAA,CAAC,CAAA,gBAAA;IACR,aAAaA,MAAA,CAAA,CAAC,CAACA,MAAA,MAAA,IAAM,2BAAA,wBAAA;IACrB,IAAI;KAAA,SAAA;KAAA,SAAA;IAAA;IACJ,iBAAW,OAAA,OAAA,OAAA,MAAA,WAAE,KAAA,QAAO;;IAEV,MAAIC,cACiG,CAA9GC,YAA8GC,aAAA;KAAjF,KAAK,IAAA;KAAA,gBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,IAAG,QAAA;KAAG,QAAQ,QAAA;KAAQ,iBAAc;;IAE7D,QAAMF,cAGT,CAFNG,mBAEM,OAFN,YAEM,CADJF,YAA4FF,MAAA,OAAA,GAAA;KAAlF,OAAOA,MAAA,CAAA,CAAC,CAAA,cAAA;KAAkB,OAAM;KAAU,SAAQ;KAAS,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAA,QAAI"}
1
+ {"version":3,"file":"EditorSettingsModal.js","names":["_useModel","_openBlock","_createBlock","_unref","_withCtx","_createVNode","EditorSettingsPanel","_createElementVNode","_createCommentVNode"],"sources":["../../../src/vue/components/EditorSettingsModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useUiKit } from '../kit/use-ui-kit'\nimport { computed, toRaw } from 'vue'\nimport type { Editor } from '@tiptap/core'\nimport { settingsTabsOf } from '../../core/define-editor'\nimport { editorEntryOf } from '../../core/editor-ui'\nimport { useEditorContext } from '../context'\nimport { useEditorI18n } from '../use-editor-i18n'\nimport { useEditorSettings } from '../settings'\nimport EditorSettingsPanel from './EditorSettingsPanel.vue'\n\n/** „Einstellungen“: `EditorSettingsPanel` in a modal. Renders nothing without an editor or when its preset contributes no settings tab. */\nconst props = defineProps<{\n /** The editor whose preset (registered by its surface, from its `ready` event) contributes the tabs. */\n editor?: Editor\n}>()\n\nconst { Button: UButton, Modal: UModal } = useUiKit()\n\nconst open = defineModel<boolean>('open', { default: false })\n/** Shown tab id (see `EditorSettingsPanel`). */\nconst tab = defineModel<string | undefined>('tab', { default: undefined })\n\nconst app = useEditorContext()\nconst { t } = useEditorI18n()\nconst { synced } = useEditorSettings()\nconst hasTabs = computed(() => {\n const preset = editorEntryOf(props.editor && toRaw(props.editor))?.preset\n return !!preset && settingsTabsOf(preset, app).length > 0\n})\n</script>\n\n<template>\n <UModal\n v-if=\"hasTabs\"\n :open=\"open\"\n :title=\"t('settings.title')\"\n :description=\"t(synced ? 'settings.scope.account' : 'settings.scope.browser')\"\n :ui=\"{ overlay: 'bg-[color-mix(in_oklab,var(--sk-bg-elevated)_60%,transparent)] backdrop-blur-sm', content: 'sm:w-[42rem] sm:max-w-[42rem]' }\"\n @update:open=\"open = $event\"\n >\n <template #body>\n <EditorSettingsPanel v-model:tab=\"tab\" :editor=\"editor\" content-class=\"h-[32rem] overflow-y-auto pt-4 pr-2\" />\n </template>\n <template #footer>\n <div class=\"flex w-full justify-end\">\n <UButton :label=\"t('common.close')\" color=\"neutral\" variant=\"ghost\" @click=\"open = false\" />\n </div>\n </template>\n </UModal>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;EAYA,MAAM,QAAQ;EAKd,MAAM,EAAE,QAAQ,SAAS,OAAO,WAAW,SAAS;EAEpD,MAAM,OAAOA,SAAoB,SAAC,MAA0B;;EAE5D,MAAM,MAAMA,SAA+B,SAAC,KAA6B;EAEzE,MAAM,MAAM,iBAAiB;EAC7B,MAAM,EAAE,MAAM,cAAc;EAC5B,MAAM,EAAE,WAAW,kBAAkB;EACrC,MAAM,UAAU,eAAe;GAC7B,MAAM,SAAS,cAAc,MAAM,UAAU,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE;GACnE,OAAO,CAAC,CAAC,UAAU,eAAe,QAAQ,GAAG,CAAC,CAAC,SAAS;EAC1D,CAAC;;GAKS,OAAA,QAAA,SADRC,UAAA,GAAAC,YAgBSC,MAAA,MAAA,GAAA;;IAdN,MAAM,KAAA;IACN,OAAOA,MAAA,CAAA,CAAC,CAAA,gBAAA;IACR,aAAaA,MAAA,CAAA,CAAC,CAACA,MAAA,MAAA,IAAM,2BAAA,wBAAA;IACrB,IAAI;KAAA,SAAA;KAAA,SAAA;IAAA;IACJ,iBAAW,OAAA,OAAA,OAAA,MAAA,WAAE,KAAA,QAAO;;IAEV,MAAIC,cACiG,CAA9GC,YAA8GC,aAAA;KAAjF,KAAK,IAAA;KAAA,gBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,IAAG,QAAA;KAAG,QAAQ,QAAA;KAAQ,iBAAc;;IAE7D,QAAMF,cAGT,CAFNG,mBAEM,OAFN,YAEM,CADJF,YAA4FF,MAAA,OAAA,GAAA;KAAlF,OAAOA,MAAA,CAAA,CAAC,CAAA,cAAA;KAAkB,OAAM;KAAU,SAAQ;KAAS,SAAK,OAAA,OAAA,OAAA,MAAA,WAAE,KAAA,QAAI"}
@@ -1,9 +1,9 @@
1
- import { EditorPreset } from "../../core/feature.js";
1
+ import { Editor } from "@tiptap/core";
2
2
  //#region src/vue/components/EditorSettingsModal.vue.d.ts
3
- /** „Einstellungen“: `EditorSettingsPanel` in a modal. Renders nothing when the preset contributes no settings tab. */
3
+ /** „Einstellungen“: `EditorSettingsPanel` in a modal. Renders nothing without an editor or when its preset contributes no settings tab. */
4
4
  type __VLS_Props = {
5
- /** The preset whose features contribute the tabs (the surface's `preset`). */
6
- preset: EditorPreset;
5
+ /** The editor whose preset (registered by its surface, from its `ready` event) contributes the tabs. */
6
+ editor?: Editor;
7
7
  };
8
8
  type __VLS_ModelProps = {
9
9
  'open'?: boolean;
@@ -1,21 +1,22 @@
1
1
  import { settingsTabsOf } from "../../core/define-editor.js";
2
+ import { editorEntryOf } from "../../core/editor-ui.js";
2
3
  import { useUiKit } from "../kit/use-ui-kit.js";
3
4
  import { useEditorContext } from "../context.js";
4
- import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, openBlock, resolveDynamicComponent, unref, useModel } from "vue";
5
+ import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, openBlock, resolveDynamicComponent, toRaw, unref, useModel } from "vue";
5
6
  //#region src/vue/components/EditorSettingsPanel.vue
6
7
  const _hoisted_1 = {
7
8
  key: 0,
8
9
  class: "flex w-full flex-col"
9
10
  };
10
11
  /**
11
- * The settings of an editor: one tab per settings tab the preset's features contribute (composites: `editing`, AI:
12
- * `ai`). Place it anywhere; it renders nothing when the preset contributes no tab. The values live in the app's shared
13
- * settings (`useEditorSettings`), so panels of several editors edit the same preferences.
12
+ * The settings of an editor: one tab per settings tab the features of its preset contribute (composites: `editing`,
13
+ * AI: `ai`). Place it anywhere; it renders nothing without an editor or when the preset contributes no tab. The values
14
+ * live in the app's shared settings (`useEditorSettings`), so panels of several editors edit the same preferences.
14
15
  */
15
16
  const _sfc_main = /*@__PURE__*/ defineComponent({
16
17
  __name: "EditorSettingsPanel",
17
18
  props: /*@__PURE__*/ mergeModels({
18
- preset: {},
19
+ editor: {},
19
20
  contentClass: { default: "pt-4" }
20
21
  }, {
21
22
  "tab": { default: void 0 },
@@ -28,7 +29,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
28
29
  /** Shown tab id; a missing or removed id shows the first contributed tab. */
29
30
  const tab = useModel(__props, "tab");
30
31
  const app = useEditorContext();
31
- const tabs = computed(() => settingsTabsOf(props.preset, app));
32
+ const tabs = computed(() => {
33
+ const preset = editorEntryOf(props.editor && toRaw(props.editor))?.preset;
34
+ return preset ? settingsTabsOf(preset, app) : [];
35
+ });
32
36
  const active = computed(() => tabs.value.find((candidate) => candidate.id === tab.value) ?? tabs.value[0]);
33
37
  const items = computed(() => tabs.value.map(({ id, label, icon }) => ({
34
38
  label,
@@ -1 +1 @@
1
- {"version":3,"file":"EditorSettingsPanel.js","names":["_useModel","_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_normalizeClass","_createBlock","_resolveDynamicComponent","_mergeProps","_createCommentVNode"],"sources":["../../../src/vue/components/EditorSettingsPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useUiKit } from '../kit/use-ui-kit'\nimport type { TabItem } from '../kit/types'\nimport { type Component, computed } from 'vue'\nimport { settingsTabsOf } from '../../core/define-editor'\nimport type { EditorPreset } from '../../core/feature'\nimport { useEditorContext } from '../context'\n\n/**\n * The settings of an editor: one tab per settings tab the preset's features contribute (composites: `editing`, AI:\n * `ai`). Place it anywhere; it renders nothing when the preset contributes no tab. The values live in the app's shared\n * settings (`useEditorSettings`), so panels of several editors edit the same preferences.\n */\nconst props = withDefaults(defineProps<{\n /** The preset whose features contribute the tabs (the surface's `preset`). */\n preset: EditorPreset\n /** Classes of the tab content area, e.g. a fixed height with scrolling. */\n contentClass?: string\n}>(), { contentClass: 'pt-4' })\n\nconst { Tabs: UTabs } = useUiKit()\n\n/** Shown tab id; a missing or removed id shows the first contributed tab. */\nconst tab = defineModel<string | undefined>('tab', { default: undefined })\n\nconst app = useEditorContext()\nconst tabs = computed(() => settingsTabsOf(props.preset, app))\nconst active = computed(() => tabs.value.find(candidate => candidate.id === tab.value) ?? tabs.value[0])\nconst items = computed<TabItem[]>(() => tabs.value.map(({ id, label, icon }) => ({ label, value: id, ...(icon && { icon }) })))\n// The descriptors are framework-agnostic (`component: unknown`); in this Vue panel they are Vue components.\nconst activeComponent = computed(() => active.value?.component as Component | undefined)\n</script>\n\n<template>\n <div v-if=\"active\" class=\"flex w-full flex-col\">\n <UTabs\n :model-value=\"active.id\"\n :items=\"items\"\n :content=\"false\"\n orientation=\"horizontal\"\n variant=\"link\"\n class=\"w-full\"\n @update:model-value=\"tab = String($event)\"\n />\n <div :class=\"contentClass\" data-settings-panel-content>\n <component :is=\"activeComponent\" :key=\"active.id\" v-bind=\"active.props\" />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,QAAQ;EAOd,MAAM,EAAE,MAAM,UAAU,SAAS;;EAGjC,MAAM,MAAMA,SAA+B,SAAC,KAA6B;EAEzE,MAAM,MAAM,iBAAiB;EAC7B,MAAM,OAAO,eAAe,eAAe,MAAM,QAAQ,GAAG,CAAC;EAC7D,MAAM,SAAS,eAAe,KAAK,MAAM,MAAK,cAAa,UAAU,OAAO,IAAI,KAAK,KAAK,KAAK,MAAM,EAAE;EACvG,MAAM,QAAQ,eAA0B,KAAK,MAAM,KAAK,EAAE,IAAI,OAAO,YAAY;GAAE;GAAO,OAAO;GAAI,GAAI,QAAQ,EAAE,KAAK;EAAG,EAAE,CAAC;EAE9H,MAAM,kBAAkB,eAAe,OAAO,OAAO,SAAkC;;GAI1E,OAAA,OAAA,SAAXC,UAAA,GAAAC,mBAaM,OAbN,YAaM,CAZJC,YAQEC,MAAA,KAAA,GAAA;IAPC,eAAa,OAAA,MAAO;IACpB,OAAO,MAAA;IACP,SAAS;IACV,aAAY;IACZ,SAAQ;IACR,OAAM;IACL,uBAAkB,OAAA,OAAA,OAAA,MAAA,WAAE,IAAA,QAAM,OAAO,MAAM;GAE1C,GAAA,MAAA,GAAA,CAAA,eAAA,OAAA,CAAA,GAAAC,mBAEM,OAAA;IAFA,OAAKC,eAAE,QAAA,YAAY;IAAE,+BAAA;GACzB,GAAA,EAAAL,UAAA,GAAAM,YAA0EC,wBAA1D,gBAAA,KAAe,GAA/BC,WAA0E,EAAxC,KAAK,OAAA,MAAO,GAAY,GAAA,OAAA,MAAO,KAAK,GAAA,MAAA,EAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,mBAAA,QAAA,IAAA"}
1
+ {"version":3,"file":"EditorSettingsPanel.js","names":["_useModel","_openBlock","_createElementBlock","_createVNode","_unref","_createElementVNode","_normalizeClass","_createBlock","_resolveDynamicComponent","_mergeProps","_createCommentVNode"],"sources":["../../../src/vue/components/EditorSettingsPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { useUiKit } from '../kit/use-ui-kit'\nimport type { TabItem } from '../kit/types'\nimport type { Editor } from '@tiptap/core'\nimport { type Component, computed, toRaw } from 'vue'\nimport { settingsTabsOf } from '../../core/define-editor'\nimport { editorEntryOf } from '../../core/editor-ui'\nimport { useEditorContext } from '../context'\n\n/**\n * The settings of an editor: one tab per settings tab the features of its preset contribute (composites: `editing`,\n * AI: `ai`). Place it anywhere; it renders nothing without an editor or when the preset contributes no tab. The values\n * live in the app's shared settings (`useEditorSettings`), so panels of several editors edit the same preferences.\n */\nconst props = withDefaults(defineProps<{\n /** The editor whose preset (registered by its surface, from its `ready` event) contributes the tabs. */\n editor?: Editor\n /** Classes of the tab content area, e.g. a fixed height with scrolling. */\n contentClass?: string\n}>(), { contentClass: 'pt-4' })\n\nconst { Tabs: UTabs } = useUiKit()\n\n/** Shown tab id; a missing or removed id shows the first contributed tab. */\nconst tab = defineModel<string | undefined>('tab', { default: undefined })\n\nconst app = useEditorContext()\nconst tabs = computed(() => {\n const preset = editorEntryOf(props.editor && toRaw(props.editor))?.preset\n return preset ? settingsTabsOf(preset, app) : []\n})\nconst active = computed(() => tabs.value.find(candidate => candidate.id === tab.value) ?? tabs.value[0])\nconst items = computed<TabItem[]>(() => tabs.value.map(({ id, label, icon }) => ({ label, value: id, ...(icon && { icon }) })))\n// The descriptors are framework-agnostic (`component: unknown`); in this Vue panel they are Vue components.\nconst activeComponent = computed(() => active.value?.component as Component | undefined)\n</script>\n\n<template>\n <div v-if=\"active\" class=\"flex w-full flex-col\">\n <UTabs\n :model-value=\"active.id\"\n :items=\"items\"\n :content=\"false\"\n orientation=\"horizontal\"\n variant=\"link\"\n class=\"w-full\"\n @update:model-value=\"tab = String($event)\"\n />\n <div :class=\"contentClass\" data-settings-panel-content>\n <component :is=\"activeComponent\" :key=\"active.id\" v-bind=\"active.props\" />\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAcA,MAAM,QAAQ;EAOd,MAAM,EAAE,MAAM,UAAU,SAAS;;EAGjC,MAAM,MAAMA,SAA+B,SAAC,KAA6B;EAEzE,MAAM,MAAM,iBAAiB;EAC7B,MAAM,OAAO,eAAe;GAC1B,MAAM,SAAS,cAAc,MAAM,UAAU,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE;GACnE,OAAO,SAAS,eAAe,QAAQ,GAAG,IAAI,CAAC;EACjD,CAAC;EACD,MAAM,SAAS,eAAe,KAAK,MAAM,MAAK,cAAa,UAAU,OAAO,IAAI,KAAK,KAAK,KAAK,MAAM,EAAE;EACvG,MAAM,QAAQ,eAA0B,KAAK,MAAM,KAAK,EAAE,IAAI,OAAO,YAAY;GAAE;GAAO,OAAO;GAAI,GAAI,QAAQ,EAAE,KAAK;EAAG,EAAE,CAAC;EAE9H,MAAM,kBAAkB,eAAe,OAAO,OAAO,SAAkC;;GAI1E,OAAA,OAAA,SAAXC,UAAA,GAAAC,mBAaM,OAbN,YAaM,CAZJC,YAQEC,MAAA,KAAA,GAAA;IAPC,eAAa,OAAA,MAAO;IACpB,OAAO,MAAA;IACP,SAAS;IACV,aAAY;IACZ,SAAQ;IACR,OAAM;IACL,uBAAkB,OAAA,OAAA,OAAA,MAAA,WAAE,IAAA,QAAM,OAAO,MAAM;GAE1C,GAAA,MAAA,GAAA,CAAA,eAAA,OAAA,CAAA,GAAAC,mBAEM,OAAA;IAFA,OAAKC,eAAE,QAAA,YAAY;IAAE,+BAAA;GACzB,GAAA,EAAAL,UAAA,GAAAM,YAA0EC,wBAA1D,gBAAA,KAAe,GAA/BC,WAA0E,EAAxC,KAAK,OAAA,MAAO,GAAY,GAAA,OAAA,MAAO,KAAK,GAAA,MAAA,EAAA,EAAA,GAAA,CAAA,CAAA,CAAA,KAAA,mBAAA,QAAA,IAAA"}
@@ -1,13 +1,13 @@
1
- import { EditorPreset } from "../../core/feature.js";
1
+ import { Editor } from "@tiptap/core";
2
2
  //#region src/vue/components/EditorSettingsPanel.vue.d.ts
3
3
  /**
4
- * The settings of an editor: one tab per settings tab the preset's features contribute (composites: `editing`, AI:
5
- * `ai`). Place it anywhere; it renders nothing when the preset contributes no tab. The values live in the app's shared
6
- * settings (`useEditorSettings`), so panels of several editors edit the same preferences.
4
+ * The settings of an editor: one tab per settings tab the features of its preset contribute (composites: `editing`,
5
+ * AI: `ai`). Place it anywhere; it renders nothing without an editor or when the preset contributes no tab. The values
6
+ * live in the app's shared settings (`useEditorSettings`), so panels of several editors edit the same preferences.
7
7
  */
8
8
  type __VLS_Props = {
9
- /** The preset whose features contribute the tabs (the surface's `preset`). */
10
- preset: EditorPreset;
9
+ /** The editor whose preset (registered by its surface, from its `ready` event) contributes the tabs. */
10
+ editor?: Editor;
11
11
  /** Classes of the tab content area, e.g. a fixed height with scrolling. */
12
12
  contentClass?: string;
13
13
  };
@@ -21,9 +21,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
21
21
  abilities: {},
22
22
  extensions: {},
23
23
  blockActions: {},
24
- slashCommands: {},
24
+ commands: {},
25
25
  documentId: {},
26
- upload: {},
27
26
  editable: {
28
27
  type: Boolean,
29
28
  default: true
@@ -68,6 +67,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
68
67
  const app = useEditorContext();
69
68
  const settingsOpen = ref(false);
70
69
  const settingsTab = ref();
70
+ const paletteOpen = ref(false);
71
71
  const ui = {
72
72
  openSettings: (tab) => {
73
73
  if (!settingsTabsOf(preset, app).length) return;
@@ -86,6 +86,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
86
86
  },
87
87
  get commentsOpen() {
88
88
  return commentsOpen.value;
89
+ },
90
+ togglePalette: () => {
91
+ paletteOpen.value = !paletteOpen.value;
92
+ },
93
+ get paletteOpen() {
94
+ return paletteOpen.value;
89
95
  }
90
96
  };
91
97
  provide(EDITOR_UI, ui);
@@ -103,9 +109,8 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
103
109
  editable: props.editable,
104
110
  metadata: props.metadata,
105
111
  documentId: props.documentId,
106
- upload: props.upload,
107
112
  abilities: props.abilities,
108
- slashCommands: props.slashCommands,
113
+ commands: props.commands,
109
114
  extensions: props.extensions,
110
115
  blockActions: props.blockActions,
111
116
  onChange: (content) => emit("update:modelValue", content),
@@ -153,11 +158,11 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
153
158
  "onUpdate:open": _cache[0] || (_cache[0] = ($event) => settingsOpen.value = $event),
154
159
  tab: settingsTab.value,
155
160
  "onUpdate:tab": _cache[1] || (_cache[1] = ($event) => settingsTab.value = $event),
156
- preset: unref(preset)
161
+ editor: unref(editor)
157
162
  }, null, 8, [
158
163
  "open",
159
164
  "tab",
160
- "preset"
165
+ "editor"
161
166
  ])) : createCommentVNode("v-if", true)
162
167
  ], 64)) : createCommentVNode("v-if", true);
163
168
  };
@@ -1 +1 @@
1
- {"version":3,"file":"EditorSurface.js","names":["_useModel","_unref","_openBlock","_createElementBlock","_Fragment","_createElementVNode","_createVNode","_renderList","_createBlock","_resolveDynamicComponent","EditorSettingsModal","_createCommentVNode"],"sources":["../../../src/vue/components/EditorSurface.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { AnyExtension, Editor, JSONContent } from '@tiptap/vue-3'\nimport { EditorContent, useEditor } from '@tiptap/vue-3'\nimport { type Component, onBeforeUnmount, provide, ref, toRaw, watch } from 'vue'\nimport { settingsTabsOf } from '../../core/define-editor'\nimport type { EditorUi } from '../../core/editor-ui'\nimport { useEditorContext } from '../context'\nimport { attachNotifier } from '../notify'\nimport { useUiKit } from '../kit/use-ui-kit'\nimport { EDITOR_UI } from '../use-editor-ui'\nimport type { AbilitiesOptions, BlockAction, SlashCommandItem } from '../../core/extension-points'\nimport type { CollaborationSession, EditorPreset, UploadFn } from '../../core/feature'\nimport type { EditorMetadata, MetadataItem } from '../../core/metadata-types'\nimport { createSurfaceSession } from '../../core/surface-session'\nimport { vueSuggestionRenderer } from '../suggestion-renderer'\nimport EditorSettingsModal from './EditorSettingsModal.vue'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n /** The features this editor is made of (`simpleEditor()`, `defineEditor(...)`); fixed at mount, remount (`key`) to change it. */\n preset: EditorPreset\n /** Collaborative mode: the Y.Doc is the document. Needs a preset with the collaboration feature; fixed at mount. */\n collaboration?: CollaborationSession\n /** Standalone mode (without `collaboration`): TipTap JSON via `v-model`; the editor keeps its own undo history. */\n modelValue?: JSONContent\n /** Host lists (`mentions`, `hashtags`, `speakers`, custom) features' suggestions search. */\n metadata?: EditorMetadata\n /** Deep-merged into the `Abilities` defaults; read once at setup. */\n abilities?: Partial<AbilitiesOptions>\n /** Added after the features' extensions; read once at setup. */\n extensions?: AnyExtension[]\n /** Hover actions shown after the features' own; shown by an installed block-UI feature. */\n blockActions?: BlockAction[]\n /** Builds the `/` menu from the features' commands; absent = the features' commands. Read once at setup. */\n slashCommands?: (defaults: SlashCommandItem[]) => SlashCommandItem[]\n /** Document whose package stores uploads (media feature). Read once at setup. */\n documentId?: string\n /** Stores an uploaded file and returns its URL (media feature). Read once at setup. */\n upload?: UploadFn\n editable?: boolean\n /** `internal`: the surface owns its settings UI; `external`: it emits `settingsOpen` and the host shows the panel. */\n settingsUi?: 'internal' | 'external'\n}>(), { editable: true, settingsUi: 'internal' })\n\nconst emit = defineEmits<{\n 'ready': [editor: Editor]\n 'update:modelValue': [content: JSONContent]\n 'metadataCreate': [list: string, item: MetadataItem]\n /** The JSON handed in (initially or later) does not fit this editor's schema; the last valid document stays. */\n 'contentError': [error: Error]\n /** `settingsUi: 'external'`: the editor asks the host to open its settings (on `tab` when given). */\n 'settingsOpen': [tab?: string]\n}>()\n\n/** Whether this editor's AI sidebar is open (`toggleSidebar`): hosts bind it (`v-model:sidebar-open`). */\nconst sidebarOpen = defineModel<boolean>('sidebarOpen', { default: false })\n/**\n * Whether this editor's comments margin is open (`toggleComments`, Mod-Shift-m of the comments feature): hosts bind it\n * (`v-model:comments-open`). The AI sidebar and the margin exclude each other: whichever opens last closes the other.\n */\nconst commentsOpen = defineModel<boolean>('commentsOpen', { default: false })\nwatch(sidebarOpen, (open) => {\n if (open) commentsOpen.value = false\n})\nwatch(commentsOpen, (open) => {\n if (open) sidebarOpen.value = false\n})\n\nconst { preset } = props\nconst app = useEditorContext()\n\n\n// The editor's chrome for its subtree (EDITOR_UI) and, registered by editor instance once it exists, for components\n// a host places beside it (EditorToolbar, outline, sidebar).\nconst settingsOpen = ref(false)\nconst settingsTab = ref<string | undefined>()\nconst ui: EditorUi = {\n openSettings: (tab) => {\n // Nothing to open without a contributed tab.\n if (!settingsTabsOf(preset, app).length) return\n if (props.settingsUi === 'external') {\n emit('settingsOpen', tab)\n return\n }\n if (tab) settingsTab.value = tab\n settingsOpen.value = true\n },\n toggleSidebar: () => {\n sidebarOpen.value = !sidebarOpen.value\n },\n toggleComments: () => {\n commentsOpen.value = !commentsOpen.value\n },\n get commentsOpen() {\n return commentsOpen.value\n },\n}\nprovide(EDITOR_UI, ui)\n\n// Captured in setup: features raise notices later, outside it.\nconst kitNotify = useUiKit().notifier()\nattachNotifier(app.notify, kitNotify)\n\n// Everything framework-free: mode, context, extensions, content validation, setup lifecycle. The mode is fixed at\n// setup; hosts switch it by remounting (`key`).\nconst session = createSurfaceSession({\n app,\n preset,\n ui,\n notify: kitNotify,\n suggestionRenderer: vueSuggestionRenderer,\n getEditor: () => editor.value,\n collaboration: props.collaboration,\n // Raw: a reactive host value would put Vue proxies into node attributes.\n value: props.modelValue && toRaw(props.modelValue),\n editable: props.editable,\n metadata: props.metadata,\n documentId: props.documentId,\n upload: props.upload,\n abilities: props.abilities,\n slashCommands: props.slashCommands,\n extensions: props.extensions,\n blockActions: props.blockActions,\n onChange: content => emit('update:modelValue', content),\n onMetadataCreate: (list, item) => emit('metadataCreate', list, item),\n onContentError: error => emit('contentError', error),\n // The registered instance is the one `useEditor` created: the vue-3 `Editor` subclass.\n onReady: instance => emit('ready', instance as Editor),\n})\n// Descriptors are framework-agnostic (`overlays: unknown[]`); in this Vue surface they are Vue components.\nconst overlays = session.overlays as readonly Component[]\n\n// Setup contributions run during setup (also on the server) and are torn down when the surface unmounts.\nsession.activate()\n\nconst editor = useEditor(session.editorOptions)\n\nwatch(() => props.modelValue, value => session.setValue(value && toRaw(value)))\nwatch(() => props.editable, editable => session.setEditable(editable))\nwatch(() => props.metadata, metadata => session.setMetadata(metadata))\n\n// `useEditor` creates the instance in onMounted; announce it once it exists (its chrome registered first, so a host\n// toolbar that receives it through `ready` finds the chrome).\nlet unregister: (() => void) | undefined\nconst stopReady = watch(editor, (instance) => {\n if (!instance) return\n unregister = session.register(toRaw(instance))\n stopReady()\n})\n\nonBeforeUnmount(() => {\n unregister?.()\n session.deactivate()\n editor.value?.destroy()\n})\n\ndefineExpose({ editor, settingsOpen, settingsTab })\n</script>\n\n<template>\n <template v-if=\"editor\">\n <div class=\"relative\">\n <EditorContent :editor=\"editor\" class=\"relative\" />\n </div>\n <component :is=\"overlay\" v-for=\"(overlay, index) in overlays\" :key=\"index\" :editor=\"editor\" />\n <EditorSettingsModal v-if=\"settingsUi === 'internal'\" v-model:open=\"settingsOpen\" v-model:tab=\"settingsTab\" :preset=\"preset\" />\n </template>\n</template>\n"],"mappings":"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"}
1
+ {"version":3,"file":"EditorSurface.js","names":["_useModel","_unref","_openBlock","_createElementBlock","_Fragment","_createElementVNode","_createVNode","_renderList","_createBlock","_resolveDynamicComponent","EditorSettingsModal","_createCommentVNode"],"sources":["../../../src/vue/components/EditorSurface.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { AnyExtension, Editor, JSONContent } from '@tiptap/vue-3'\nimport { EditorContent, useEditor } from '@tiptap/vue-3'\nimport { type Component, onBeforeUnmount, provide, ref, toRaw, watch } from 'vue'\nimport { settingsTabsOf } from '../../core/define-editor'\nimport type { EditorUi } from '../../core/editor-ui'\nimport { useEditorContext } from '../context'\nimport { attachNotifier } from '../notify'\nimport { useUiKit } from '../kit/use-ui-kit'\nimport { EDITOR_UI } from '../use-editor-ui'\nimport type { CommandDef } from '../../core/commands'\nimport type { AbilitiesOptions, BlockAction } from '../../core/extension-points'\nimport type { CollaborationSession, EditorPreset } from '../../core/feature'\nimport type { EditorMetadata, MetadataItem } from '../../core/metadata-types'\nimport { createSurfaceSession } from '../../core/surface-session'\nimport { vueSuggestionRenderer } from '../suggestion-renderer'\nimport EditorSettingsModal from './EditorSettingsModal.vue'\n\ndefineOptions({ inheritAttrs: false })\n\nconst props = withDefaults(defineProps<{\n /** The features this editor is made of (`simpleEditor()`, `defineEditor(...)`); fixed at mount, remount (`key`) to change it. */\n preset: EditorPreset\n /** Collaborative mode: the Y.Doc is the document. Needs a preset with the collaboration feature; fixed at mount. */\n collaboration?: CollaborationSession\n /** Standalone mode (without `collaboration`): TipTap JSON via `v-model`; the editor keeps its own undo history. */\n modelValue?: JSONContent\n /** Host lists (`mentions`, `hashtags`, `speakers`, custom) features' suggestions search. */\n metadata?: EditorMetadata\n /** Deep-merged into the `Abilities` defaults; read once at setup. */\n abilities?: Partial<AbilitiesOptions>\n /** Added after the features' extensions; read once at setup. */\n extensions?: AnyExtension[]\n /** Hover actions shown after the features' own; shown by an installed block-UI feature. */\n blockActions?: BlockAction[]\n /** Builds the final commands (and with them the `/` menu) from the features' commands; absent = the features' commands. Read once at setup. */\n commands?: (defaults: CommandDef[]) => CommandDef[]\n /** Document whose package stores uploads (`backend.assets`, media feature). Read once at setup. */\n documentId?: string\n editable?: boolean\n /** `internal`: the surface owns its settings UI; `external`: it emits `settingsOpen` and the host shows the panel. */\n settingsUi?: 'internal' | 'external'\n}>(), { editable: true, settingsUi: 'internal' })\n\nconst emit = defineEmits<{\n 'ready': [editor: Editor]\n 'update:modelValue': [content: JSONContent]\n 'metadataCreate': [list: string, item: MetadataItem]\n /** The JSON handed in (initially or later) does not fit this editor's schema; the last valid document stays. */\n 'contentError': [error: Error]\n /** `settingsUi: 'external'`: the editor asks the host to open its settings (on `tab` when given). */\n 'settingsOpen': [tab?: string]\n}>()\n\n/** Whether this editor's AI sidebar is open (`toggleSidebar`): hosts bind it (`v-model:sidebar-open`). */\nconst sidebarOpen = defineModel<boolean>('sidebarOpen', { default: false })\n/**\n * Whether this editor's comments margin is open (`toggleComments`, Mod-Shift-m of the comments feature): hosts bind it\n * (`v-model:comments-open`). The AI sidebar and the margin exclude each other: whichever opens last closes the other.\n */\nconst commentsOpen = defineModel<boolean>('commentsOpen', { default: false })\nwatch(sidebarOpen, (open) => {\n if (open) commentsOpen.value = false\n})\nwatch(commentsOpen, (open) => {\n if (open) sidebarOpen.value = false\n})\n\nconst { preset } = props\nconst app = useEditorContext()\n\n// The editor's chrome for its subtree (EDITOR_UI) and, registered by editor instance once it exists, for components\n// a host places beside it (EditorToolbar, outline, sidebar).\nconst settingsOpen = ref(false)\nconst settingsTab = ref<string | undefined>()\n// The ⌘K palette (the `core-ui` overlay, when the preset has one) shows while this is true.\nconst paletteOpen = ref(false)\nconst ui: EditorUi = {\n openSettings: (tab) => {\n // Nothing to open without a contributed tab.\n if (!settingsTabsOf(preset, app).length) return\n if (props.settingsUi === 'external') {\n emit('settingsOpen', tab)\n return\n }\n if (tab) settingsTab.value = tab\n settingsOpen.value = true\n },\n toggleSidebar: () => {\n sidebarOpen.value = !sidebarOpen.value\n },\n toggleComments: () => {\n commentsOpen.value = !commentsOpen.value\n },\n get commentsOpen() {\n return commentsOpen.value\n },\n togglePalette: () => {\n paletteOpen.value = !paletteOpen.value\n },\n get paletteOpen() {\n return paletteOpen.value\n },\n}\nprovide(EDITOR_UI, ui)\n\n// Captured in setup: features raise notices later, outside it.\nconst kitNotify = useUiKit().notifier()\nattachNotifier(app.notify, kitNotify)\n\n// Everything framework-free: mode, context, extensions, content validation, setup lifecycle. The mode is fixed at\n// setup; hosts switch it by remounting (`key`).\nconst session = createSurfaceSession({\n app,\n preset,\n ui,\n notify: kitNotify,\n suggestionRenderer: vueSuggestionRenderer,\n getEditor: () => editor.value,\n collaboration: props.collaboration,\n // Raw: a reactive host value would put Vue proxies into node attributes.\n value: props.modelValue && toRaw(props.modelValue),\n editable: props.editable,\n metadata: props.metadata,\n documentId: props.documentId,\n abilities: props.abilities,\n commands: props.commands,\n extensions: props.extensions,\n blockActions: props.blockActions,\n onChange: content => emit('update:modelValue', content),\n onMetadataCreate: (list, item) => emit('metadataCreate', list, item),\n onContentError: error => emit('contentError', error),\n // The registered instance is the one `useEditor` created: the vue-3 `Editor` subclass.\n onReady: instance => emit('ready', instance as Editor),\n})\n// Descriptors are framework-agnostic (`overlays: unknown[]`); in this Vue surface they are Vue components.\nconst overlays = session.overlays as readonly Component[]\n\n// Setup contributions run during setup (also on the server) and are torn down when the surface unmounts.\nsession.activate()\n\nconst editor = useEditor(session.editorOptions)\n\nwatch(() => props.modelValue, value => session.setValue(value && toRaw(value)))\nwatch(() => props.editable, editable => session.setEditable(editable))\nwatch(() => props.metadata, metadata => session.setMetadata(metadata))\n\n// `useEditor` creates the instance in onMounted; announce it once it exists (its chrome registered first, so a host\n// toolbar that receives it through `ready` finds the chrome).\nlet unregister: (() => void) | undefined\nconst stopReady = watch(editor, (instance) => {\n if (!instance) return\n unregister = session.register(toRaw(instance))\n stopReady()\n})\n\nonBeforeUnmount(() => {\n unregister?.()\n session.deactivate()\n editor.value?.destroy()\n})\n\ndefineExpose({ editor, settingsOpen, settingsTab })\n</script>\n\n<template>\n <template v-if=\"editor\">\n <div class=\"relative\">\n <EditorContent :editor=\"editor\" class=\"relative\" />\n </div>\n <component :is=\"overlay\" v-for=\"(overlay, index) in overlays\" :key=\"index\" :editor=\"editor\" />\n <EditorSettingsModal v-if=\"settingsUi === 'internal'\" v-model:open=\"settingsOpen\" v-model:tab=\"settingsTab\" :editor=\"editor\" />\n </template>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBA,MAAM,QAAQ;EAwBd,MAAM,OAAO;;EAWb,MAAM,cAAcA,SAAoB,SAAC,aAAiC;;;;;EAK1E,MAAM,eAAeA,SAAoB,SAAC,cAAkC;EAC5E,MAAM,cAAc,SAAS;GAC3B,IAAI,MAAM,aAAa,QAAQ;EACjC,CAAC;EACD,MAAM,eAAe,SAAS;GAC5B,IAAI,MAAM,YAAY,QAAQ;EAChC,CAAC;EAED,MAAM,EAAE,WAAW;EACnB,MAAM,MAAM,iBAAiB;EAI7B,MAAM,eAAe,IAAI,KAAK;EAC9B,MAAM,cAAc,IAAwB;EAE5C,MAAM,cAAc,IAAI,KAAK;EAC7B,MAAM,KAAe;GACnB,eAAe,QAAQ;IAErB,IAAI,CAAC,eAAe,QAAQ,GAAG,CAAC,CAAC,QAAQ;IACzC,IAAI,MAAM,eAAe,YAAY;KACnC,KAAK,gBAAgB,GAAG;KACxB;IACF;IACA,IAAI,KAAK,YAAY,QAAQ;IAC7B,aAAa,QAAQ;GACvB;GACA,qBAAqB;IACnB,YAAY,QAAQ,CAAC,YAAY;GACnC;GACA,sBAAsB;IACpB,aAAa,QAAQ,CAAC,aAAa;GACrC;GACA,IAAI,eAAe;IACjB,OAAO,aAAa;GACtB;GACA,qBAAqB;IACnB,YAAY,QAAQ,CAAC,YAAY;GACnC;GACA,IAAI,cAAc;IAChB,OAAO,YAAY;GACrB;EACF;EACA,QAAQ,WAAW,EAAE;EAGrB,MAAM,YAAY,SAAS,CAAC,CAAC,SAAS;EACtC,eAAe,IAAI,QAAQ,SAAS;EAIpC,MAAM,UAAU,qBAAqB;GACnC;GACA;GACA;GACA,QAAQ;GACR,oBAAoB;GACpB,iBAAiB,OAAO;GACxB,eAAe,MAAM;GAErB,OAAO,MAAM,cAAc,MAAM,MAAM,UAAU;GACjD,UAAU,MAAM;GAChB,UAAU,MAAM;GAChB,YAAY,MAAM;GAClB,WAAW,MAAM;GACjB,UAAU,MAAM;GAChB,YAAY,MAAM;GAClB,cAAc,MAAM;GACpB,WAAU,YAAW,KAAK,qBAAqB,OAAO;GACtD,mBAAmB,MAAM,SAAS,KAAK,kBAAkB,MAAM,IAAI;GACnE,iBAAgB,UAAS,KAAK,gBAAgB,KAAK;GAEnD,UAAS,aAAY,KAAK,SAAS,QAAkB;EACvD,CAAC;EAED,MAAM,WAAW,QAAQ;EAGzB,QAAQ,SAAS;EAEjB,MAAM,SAAS,UAAU,QAAQ,aAAa;EAE9C,YAAY,MAAM,aAAY,UAAS,QAAQ,SAAS,SAAS,MAAM,KAAK,CAAC,CAAC;EAC9E,YAAY,MAAM,WAAU,aAAY,QAAQ,YAAY,QAAQ,CAAC;EACrE,YAAY,MAAM,WAAU,aAAY,QAAQ,YAAY,QAAQ,CAAC;EAIrE,IAAI;EACJ,MAAM,YAAY,MAAM,SAAS,aAAa;GAC5C,IAAI,CAAC,UAAU;GACf,aAAa,QAAQ,SAAS,MAAM,QAAQ,CAAC;GAC7C,UAAU;EACZ,CAAC;EAED,sBAAsB;GACpB,aAAa;GACb,QAAQ,WAAW;GACnB,OAAO,OAAO,QAAQ;EACxB,CAAC;EAED,SAAa;GAAE;GAAQ;GAAc;EAAY,CAAC;;GAIhC,OAAAC,MAAA,MAAA,KAAhBC,UAAA,GAAAC,mBAMWC,UAAA,EAAA,KAAA,EAAA,GAAA;IALTC,mBAEM,OAFN,YAEM,CADJC,YAAmDL,MAAA,aAAA,GAAA;KAAnC,QAAQA,MAAA,MAAA;KAAQ,OAAM;;KAExCC,UAAA,IAAA,GAAAC,mBAA8FC,UAAA,MAAAG,WAA1CN,MAAA,QAAA,IAAnB,SAAS,UAAK;KAA/C,OAAAC,UAAA,GAAAM,YAA8FC,wBAA9E,OAAO,GAAA;MAAwC,KAAK;MAAQ,QAAQR,MAAA,MAAA;;;IACzD,QAAA,eAAU,cAArCC,UAAA,GAAAM,YAA+HE,aAAA;;KAAjE,MAAM,aAAA;KAAA,iBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,aAAY,QAAA;KAAU,KAAK,YAAA;KAAA,gBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,YAAW,QAAA;KAAG,QAAQT,MAAA,MAAA"}
@@ -1,6 +1,8 @@
1
- import { AbilitiesOptions, BlockAction, SlashCommandItem } from "../../core/extension-points.js";
1
+ import { CommandDef } from "../../core/command-types.js";
2
+ import { AbilitiesOptions, BlockAction } from "../../core/extension-points.js";
2
3
  import { EditorMetadata, MetadataItem } from "../../core/metadata-types.js";
3
- import { CollaborationSession, EditorPreset, UploadFn } from "../../core/feature.js";
4
+ import { CollaborationSession, EditorPreset } from "../../core/feature.js";
5
+ import "../../core/commands.js";
4
6
  import { AnyExtension, Editor, JSONContent } from "@tiptap/vue-3";
5
7
  //#region src/vue/components/EditorSurface.vue.d.ts
6
8
  type __VLS_Props = {
@@ -18,12 +20,10 @@ type __VLS_Props = {
18
20
  extensions?: AnyExtension[];
19
21
  /** Hover actions shown after the features' own; shown by an installed block-UI feature. */
20
22
  blockActions?: BlockAction[];
21
- /** Builds the `/` menu from the features' commands; absent = the features' commands. Read once at setup. */
22
- slashCommands?: (defaults: SlashCommandItem[]) => SlashCommandItem[];
23
- /** Document whose package stores uploads (media feature). Read once at setup. */
23
+ /** Builds the final commands (and with them the `/` menu) from the features' commands; absent = the features' commands. Read once at setup. */
24
+ commands?: (defaults: CommandDef[]) => CommandDef[];
25
+ /** Document whose package stores uploads (`backend.assets`, media feature). Read once at setup. */
24
26
  documentId?: string;
25
- /** Stores an uploaded file and returns its URL (media feature). Read once at setup. */
26
- upload?: UploadFn;
27
27
  editable?: boolean;
28
28
  /** `internal`: the surface owns its settings UI; `external`: it emits `settingsOpen` and the host shows the panel. */
29
29
  settingsUi?: 'internal' | 'external';
@@ -1,7 +1,5 @@
1
- import { abilitiesAtSelection } from "../../core/abilities.js";
2
- import { mergeToolbarGroups } from "../../core/toolbar.js";
3
- import { contributions } from "../../core/define-editor.js";
4
1
  import { borrowedFeatureContext, editorEntryOf } from "../../core/editor-ui.js";
2
+ import { commandState, toolbarOf } from "../../core/commands.js";
5
3
  import { useUiKit } from "../kit/use-ui-kit.js";
6
4
  import { useEditorContext } from "../context.js";
7
5
  import { useEditorI18n } from "../use-editor-i18n.js";
@@ -17,15 +15,12 @@ const _hoisted_2 = {
17
15
  };
18
16
  /**
19
17
  * The toolbar of an editor, placed anywhere on the page. `editor` is the instance it works on (from the surface's
20
- * `ready` event); the preset registered for that instance supplies the groups, `preset` renders them (disabled) while
21
- * there is no editor yet. Never reads a global active editor.
18
+ * `ready` event); the preset registered for that instance (`editorEntryOf`) supplies the groups. Without an editor
19
+ * (not mounted yet, or read-only by the host's choice) it renders no groups. Never reads a global active editor.
22
20
  */
23
21
  const _sfc_main = /*@__PURE__*/ defineComponent({
24
22
  __name: "EditorToolbar",
25
- props: {
26
- editor: {},
27
- preset: {}
28
- },
23
+ props: { editor: {} },
29
24
  setup(__props) {
30
25
  const props = __props;
31
26
  const { Button: UButton, DropdownMenu: UDropdownMenu, FieldGroup: UFieldGroup, Tooltip: UTooltip } = useUiKit();
@@ -43,38 +38,35 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
43
38
  if (!preset) return [];
44
39
  const cached = built.get(preset);
45
40
  if (cached) return cached;
46
- const build = () => mergeToolbarGroups(contributions(preset, "toolbar").flatMap((factory) => factory(ctx)));
41
+ const build = () => toolbarOf(preset, ctx);
47
42
  const groups = instance ? instance.appContext.app.runWithContext(build) : build();
48
43
  built.set(preset, groups);
49
44
  return groups;
50
45
  }
51
- groupsOf(props.preset);
46
+ const NO_EDITOR = {
47
+ visible: true,
48
+ enabled: false,
49
+ active: false
50
+ };
52
51
  const visibleGroups = computed(() => {
53
- const editor = props.editor;
54
- return groupsOf(editorEntryOf(editor && toRaw(editor))?.preset ?? props.preset).filter((group) => !editor || !group.visible || group.visible(editor)).map((group) => ({
52
+ const editor = props.editor && toRaw(props.editor);
53
+ return groupsOf(editorEntryOf(editor)?.preset).filter((group) => !editor || !group.visible || group.visible(editor)).map((group) => ({
55
54
  group,
56
- items: group.items.filter((item) => !editor || !item.visible || item.visible(editor))
55
+ items: group.items.map((cmd) => ({
56
+ cmd,
57
+ state: editor ? commandState(editor, cmd, "selection") : NO_EDITOR
58
+ })).filter(({ state }) => state.visible)
57
59
  })).filter(({ items }) => items.length > 0);
58
60
  });
59
- const abilities = computed(() => props.editor ? abilitiesAtSelection(props.editor) : /* @__PURE__ */ new Set());
60
- function active(item) {
61
- return !!props.editor && !!item.active?.(props.editor);
62
- }
63
- function disabled(item) {
64
- const editor = props.editor;
65
- if (!editor) return true;
66
- if (item.disabled?.(editor)) return true;
67
- return !active(item) && !!item.ability && !abilities.value.has(item.ability);
68
- }
69
- function run(item) {
70
- if (props.editor) item.run?.(props.editor);
61
+ function run(cmd) {
62
+ if (props.editor && "run" in cmd) cmd.run(props.editor);
71
63
  }
72
- function menuOf(item) {
73
- return props.editor && item.menu ? item.menu(props.editor) : [];
64
+ function menuOf(cmd) {
65
+ return props.editor && "menu" in cmd ? cmd.menu(props.editor) : [];
74
66
  }
75
67
  /** Descriptors are framework-agnostic (`component: unknown`); in this Vue toolbar they are Vue components. */
76
- function componentOf(item) {
77
- return item.component;
68
+ function componentOf(cmd) {
69
+ return "component" in cmd ? cmd.component : void 0;
78
70
  }
79
71
  return (_ctx, _cache) => {
80
72
  return openBlock(), createElementBlock("div", {
@@ -83,25 +75,25 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
83
75
  "aria-label": unref(t)("toolbar.label")
84
76
  }, [(openBlock(true), createElementBlock(Fragment, null, renderList(visibleGroups.value, ({ group, items }, gi) => {
85
77
  return openBlock(), createElementBlock(Fragment, { key: group.id }, [gi > 0 ? (openBlock(), createElementBlock("span", _hoisted_2)) : createCommentVNode("v-if", true), createVNode(unref(UFieldGroup), { size: "sm" }, {
86
- default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(items, (item) => {
87
- return openBlock(), createElementBlock(Fragment, { key: item.id }, [componentOf(item) ? (openBlock(), createBlock(resolveDynamicComponent(componentOf(item)), {
78
+ default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(items, ({ cmd, state }) => {
79
+ return openBlock(), createElementBlock(Fragment, { key: cmd.id }, [componentOf(cmd) ? (openBlock(), createBlock(resolveDynamicComponent(componentOf(cmd)), {
88
80
  key: 0,
89
81
  editor: props.editor
90
- }, null, 8, ["editor"])) : item.menu ? (openBlock(), createBlock(unref(UDropdownMenu), {
82
+ }, null, 8, ["editor"])) : "menu" in cmd ? (openBlock(), createBlock(unref(UDropdownMenu), {
91
83
  key: 1,
92
- items: menuOf(item)
84
+ items: menuOf(cmd)
93
85
  }, {
94
86
  default: withCtx(() => [createVNode(unref(UTooltip), {
95
- text: item.label,
96
- kbds: item.kbds
87
+ text: cmd.label,
88
+ kbds: cmd.kbds
97
89
  }, {
98
90
  default: withCtx(() => [(openBlock(), createBlock(unref(UButton), {
99
- key: item.icon,
91
+ key: cmd.icon,
100
92
  color: "neutral",
101
93
  variant: "ghost",
102
- icon: item.icon,
103
- "aria-label": item.label,
104
- disabled: disabled(item),
94
+ icon: cmd.icon,
95
+ "aria-label": cmd.label,
96
+ disabled: !state.enabled,
105
97
  onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"]))
106
98
  }, null, 8, [
107
99
  "icon",
@@ -113,22 +105,22 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
113
105
  _: 2
114
106
  }, 1032, ["items"])) : (openBlock(), createBlock(unref(UTooltip), {
115
107
  key: 2,
116
- text: item.label,
117
- kbds: item.kbds
108
+ text: cmd.label,
109
+ kbds: cmd.kbds
118
110
  }, {
119
111
  default: withCtx(() => [(openBlock(), createBlock(unref(UButton), {
120
- key: item.icon,
112
+ key: cmd.icon,
121
113
  color: "neutral",
122
114
  variant: "ghost",
123
115
  "active-color": "primary",
124
116
  "active-variant": "soft",
125
- icon: item.icon,
126
- "aria-label": item.label,
127
- active: active(item),
128
- "aria-pressed": item.active ? active(item) : void 0,
129
- disabled: disabled(item),
117
+ icon: cmd.icon,
118
+ "aria-label": cmd.label,
119
+ active: state.active,
120
+ "aria-pressed": cmd.active ? state.active : void 0,
121
+ disabled: !state.enabled,
130
122
  onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {}, ["prevent"])),
131
- onClick: ($event) => run(item)
123
+ onClick: ($event) => run(cmd)
132
124
  }, null, 8, [
133
125
  "icon",
134
126
  "aria-label",