@ecsplico/editor 3.5.1 → 4.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 (583) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/adapters/direct-ai.d.ts +4 -4
  3. package/dist/adapters/direct-ai.js +2 -2
  4. package/dist/adapters/direct-ai.js.map +1 -1
  5. package/dist/adapters/document-state.d.ts +1 -1
  6. package/dist/adapters/document-state.js.map +1 -1
  7. package/dist/adapters/forge.d.ts +2 -2
  8. package/dist/adapters/forge.js.map +1 -1
  9. package/dist/adapters/nitro.d.ts +11 -3
  10. package/dist/adapters/nitro.js +3 -1
  11. package/dist/adapters/nitro.js.map +1 -1
  12. package/dist/adapters/shared.d.ts +6 -6
  13. package/dist/adapters/shared.js.map +1 -1
  14. package/dist/code/CodeSurface.vue.d.ts +3 -3
  15. package/dist/config/index.d.ts +14 -14
  16. package/dist/config/index.js +8 -8
  17. package/dist/config/index.js.map +1 -1
  18. package/dist/core/backend-types.d.ts +3 -3
  19. package/dist/core/backend-types.js.map +1 -1
  20. package/dist/core/backend.d.ts +4 -4
  21. package/dist/core/backend.js.map +1 -1
  22. package/dist/core/block-convert.d.ts +1 -1
  23. package/dist/core/block-convert.js +5 -5
  24. package/dist/core/block-convert.js.map +1 -1
  25. package/dist/core/block-transfer.d.ts +8 -4
  26. package/dist/core/block-transfer.js +23 -14
  27. package/dist/core/block-transfer.js.map +1 -1
  28. package/dist/core/capabilities.d.ts +113 -0
  29. package/dist/core/capabilities.js +155 -0
  30. package/dist/core/capabilities.js.map +1 -0
  31. package/dist/core/command-types.d.ts +1 -1
  32. package/dist/core/context.js.map +1 -1
  33. package/dist/core/convert.d.ts +5 -5
  34. package/dist/core/convert.js +5 -5
  35. package/dist/core/convert.js.map +1 -1
  36. package/dist/core/core-feature.js +1 -1
  37. package/dist/core/define-editor.d.ts +2 -2
  38. package/dist/core/define-editor.js +34 -6
  39. package/dist/core/define-editor.js.map +1 -1
  40. package/dist/core/derivation.d.ts +119 -0
  41. package/dist/core/derivation.js +187 -0
  42. package/dist/core/derivation.js.map +1 -0
  43. package/dist/core/derive.d.ts +61 -0
  44. package/dist/core/derive.js +69 -0
  45. package/dist/core/derive.js.map +1 -0
  46. package/dist/core/extension-points.d.ts +16 -0
  47. package/dist/core/feature-context.d.ts +5 -1
  48. package/dist/core/feature-context.js +10 -3
  49. package/dist/core/feature-context.js.map +1 -1
  50. package/dist/core/feature.d.ts +41 -19
  51. package/dist/core/feature.js.map +1 -1
  52. package/dist/core/fences.js +1 -1
  53. package/dist/core/fences.js.map +1 -1
  54. package/dist/core/index.d.ts +6 -2
  55. package/dist/core/index.js +5 -1
  56. package/dist/core/pipeline.d.ts +14 -5
  57. package/dist/core/pipeline.js +19 -7
  58. package/dist/core/pipeline.js.map +1 -1
  59. package/dist/core/properties.d.ts +22 -0
  60. package/dist/core/properties.js +17 -0
  61. package/dist/core/properties.js.map +1 -0
  62. package/dist/core/schema/block-ids.js +5 -5
  63. package/dist/core/schema/block-ids.js.map +1 -1
  64. package/dist/core/schema/index.d.ts +2 -1
  65. package/dist/core/schema/index.js +2 -1
  66. package/dist/core/schema/index.js.map +1 -1
  67. package/dist/core/schema/opaque-fence.d.ts +4 -4
  68. package/dist/core/schema/opaque-fence.js +7 -7
  69. package/dist/core/schema/opaque-fence.js.map +1 -1
  70. package/dist/core/schema/persisted-names.d.ts +58 -0
  71. package/dist/core/schema/persisted-names.js +96 -0
  72. package/dist/core/schema/persisted-names.js.map +1 -0
  73. package/dist/core/toolbar-items.js +1 -1
  74. package/dist/core/toolbar-items.js.map +1 -1
  75. package/dist/core/util.js +5 -1
  76. package/dist/core/util.js.map +1 -1
  77. package/dist/document/DocumentSurface.vue.d.ts +3 -3
  78. package/dist/features/ai/agent-ops.js +1 -1
  79. package/dist/features/ai/ai-review.js +1 -1
  80. package/dist/features/ai/assistant.d.ts +4 -4
  81. package/dist/features/ai/assistant.js +1 -1
  82. package/dist/features/ai/assistant.js.map +1 -1
  83. package/dist/features/ai/components/AiSelectionMenu.js +1 -1
  84. package/dist/features/ai/components/AiSelectionMenu.js.map +1 -1
  85. package/dist/features/ai/components/ModelQuickSwitch.js +7 -7
  86. package/dist/features/ai/components/ModelQuickSwitch.js.map +1 -1
  87. package/dist/features/ai/components/ModelQuickSwitch.vue.d.ts +4 -4
  88. package/dist/features/ai/components/SettingsAiTab.js +8 -8
  89. package/dist/features/ai/components/SettingsAiTab.js.map +1 -1
  90. package/dist/features/ai/components/SettingsModelProfiles.js +1 -1
  91. package/dist/features/ai/components/SettingsModelProfiles.js.map +1 -1
  92. package/dist/features/ai/document-chat-model.d.ts +2 -2
  93. package/dist/features/ai/document-chat-model.js +5 -5
  94. package/dist/features/ai/document-chat-model.js.map +1 -1
  95. package/dist/features/ai/document-chat.js +2 -2
  96. package/dist/features/ai/document-chat.js.map +1 -1
  97. package/dist/features/ai/feature.d.ts +2 -2
  98. package/dist/features/ai/feature.js +2 -2
  99. package/dist/features/ai/feature.js.map +1 -1
  100. package/dist/features/ai/ghost-autocomplete.d.ts +4 -4
  101. package/dist/features/ai/ghost-autocomplete.js +1 -1
  102. package/dist/features/ai/ghost-autocomplete.js.map +1 -1
  103. package/dist/features/ai/index.d.ts +3 -3
  104. package/dist/features/ai/index.js +2 -2
  105. package/dist/features/ai/model-profiles.d.ts +9 -9
  106. package/dist/features/ai/model-profiles.js +13 -13
  107. package/dist/features/ai/model-profiles.js.map +1 -1
  108. package/dist/features/ai/protocol/agent-ops.d.ts +2 -2
  109. package/dist/features/ai/protocol/agent-ops.js +1 -1
  110. package/dist/features/ai/protocol/agent-ops.js.map +1 -1
  111. package/dist/features/ai/protocol/block-lines.d.ts +7 -7
  112. package/dist/features/ai/protocol/block-lines.js +10 -10
  113. package/dist/features/ai/protocol/block-lines.js.map +1 -1
  114. package/dist/features/ai/protocol/chat.d.ts +5 -5
  115. package/dist/features/ai/protocol/chat.js +12 -12
  116. package/dist/features/ai/protocol/chat.js.map +1 -1
  117. package/dist/features/ai/protocol/generate.d.ts +1 -1
  118. package/dist/features/ai/protocol/generate.js +1 -1
  119. package/dist/features/ai/protocol/generate.js.map +1 -1
  120. package/dist/features/ai/protocol/index.d.ts +3 -3
  121. package/dist/features/ai/protocol/index.js +2 -2
  122. package/dist/features/ai/protocol/models.d.ts +3 -3
  123. package/dist/features/ai/protocol/models.js +3 -3
  124. package/dist/features/ai/protocol/models.js.map +1 -1
  125. package/dist/features/ai/protocol/schemas.d.ts +1 -1
  126. package/dist/features/ai/protocol/schemas.js +1 -1
  127. package/dist/features/ai/protocol/schemas.js.map +1 -1
  128. package/dist/features/ai/protocol/tasks.d.ts +5 -5
  129. package/dist/features/ai/protocol/tasks.js +12 -12
  130. package/dist/features/ai/protocol/tasks.js.map +1 -1
  131. package/dist/features/ai/react/AiSelectionMenu.js.map +1 -1
  132. package/dist/features/ai/react/ModelQuickSwitch.d.ts +4 -4
  133. package/dist/features/ai/react/ModelQuickSwitch.js +6 -6
  134. package/dist/features/ai/react/ModelQuickSwitch.js.map +1 -1
  135. package/dist/features/ai/react/SettingsAiTab.d.ts +1 -1
  136. package/dist/features/ai/react/SettingsAiTab.js +8 -8
  137. package/dist/features/ai/react/SettingsAiTab.js.map +1 -1
  138. package/dist/features/ai/react/SettingsModelProfiles.d.ts +1 -1
  139. package/dist/features/ai/react/SettingsModelProfiles.js +1 -1
  140. package/dist/features/ai/react/SettingsModelProfiles.js.map +1 -1
  141. package/dist/features/ai/react/use-ai-assistant.d.ts +1 -1
  142. package/dist/features/ai/react/use-ai-assistant.js +1 -1
  143. package/dist/features/ai/react/use-ai-assistant.js.map +1 -1
  144. package/dist/features/ai/react/use-model-profiles.d.ts +5 -5
  145. package/dist/features/ai/react/use-model-profiles.js +2 -2
  146. package/dist/features/ai/react/use-model-profiles.js.map +1 -1
  147. package/dist/features/ai/use-ai-assistant.d.ts +1 -1
  148. package/dist/features/ai/use-ai-assistant.js +1 -1
  149. package/dist/features/ai/use-ai-assistant.js.map +1 -1
  150. package/dist/features/ai/use-model-profiles.d.ts +4 -4
  151. package/dist/features/ai/use-model-profiles.js +2 -2
  152. package/dist/features/ai/use-model-profiles.js.map +1 -1
  153. package/dist/features/block-ui/block-actions.d.ts +8 -4
  154. package/dist/features/block-ui/block-actions.js +38 -22
  155. package/dist/features/block-ui/block-actions.js.map +1 -1
  156. package/dist/features/block-ui/block-target.d.ts +29 -0
  157. package/dist/features/block-ui/block-target.js +63 -0
  158. package/dist/features/block-ui/block-target.js.map +1 -0
  159. package/dist/features/block-ui/components/BlockHandles.js +3 -3
  160. package/dist/features/block-ui/components/BlockHandles.js.map +1 -1
  161. package/dist/features/block-ui/components/BlockUi.js +11 -23
  162. package/dist/features/block-ui/components/BlockUi.js.map +1 -1
  163. package/dist/features/block-ui/feature.d.ts +3 -2
  164. package/dist/features/block-ui/feature.js +3 -2
  165. package/dist/features/block-ui/feature.js.map +1 -1
  166. package/dist/features/block-ui/handle-geometry.js +12 -23
  167. package/dist/features/block-ui/handle-geometry.js.map +1 -1
  168. package/dist/features/block-ui/index.d.ts +2 -1
  169. package/dist/features/block-ui/index.js +2 -1
  170. package/dist/features/block-ui/react/BlockHandles.d.ts +1 -1
  171. package/dist/features/block-ui/react/BlockHandles.js +4 -4
  172. package/dist/features/block-ui/react/BlockHandles.js.map +1 -1
  173. package/dist/features/block-ui/react/BlockUi.js +13 -25
  174. package/dist/features/block-ui/react/BlockUi.js.map +1 -1
  175. package/dist/features/comments/model.js +1 -1
  176. package/dist/features/composites/accepted-children.d.ts +5 -4
  177. package/dist/features/composites/accepted-children.js +26 -26
  178. package/dist/features/composites/accepted-children.js.map +1 -1
  179. package/dist/features/composites/ai-brief.d.ts +4 -4
  180. package/dist/features/composites/ai-brief.js +14 -12
  181. package/dist/features/composites/ai-brief.js.map +1 -1
  182. package/dist/features/composites/anchors.d.ts +1 -1
  183. package/dist/features/composites/anchors.js.map +1 -1
  184. package/dist/features/composites/baskets.d.ts +1 -1
  185. package/dist/features/composites/baskets.js.map +1 -1
  186. package/dist/features/composites/bibliography-command.d.ts +1 -1
  187. package/dist/features/composites/bibliography-form.js +1 -1
  188. package/dist/features/composites/bibliography-form.js.map +1 -1
  189. package/dist/features/composites/bibliography.js.map +1 -1
  190. package/dist/features/composites/block-types-json.d.ts +38 -0
  191. package/dist/features/composites/block-types-json.js +122 -0
  192. package/dist/features/composites/block-types-json.js.map +1 -0
  193. package/dist/features/composites/block-types.d.ts +119 -0
  194. package/dist/features/composites/block-types.js +343 -0
  195. package/dist/features/composites/block-types.js.map +1 -0
  196. package/dist/features/composites/capabilities.js +109 -0
  197. package/dist/features/composites/capabilities.js.map +1 -0
  198. package/dist/features/composites/components/BibliographyEditor.js +5 -5
  199. package/dist/features/composites/components/BibliographyEditor.js.map +1 -1
  200. package/dist/features/composites/components/CompositeBasketMenu.js +2 -2
  201. package/dist/features/composites/components/CompositeBasketMenu.js.map +1 -1
  202. package/dist/features/composites/components/CompositeChrome.js +18 -8
  203. package/dist/features/composites/components/CompositeChrome.js.map +1 -1
  204. package/dist/features/composites/components/CompositeChrome.vue.d.ts +1 -1
  205. package/dist/features/composites/components/CompositeDetails.js +11 -10
  206. package/dist/features/composites/components/CompositeDetails.js.map +1 -1
  207. package/dist/features/composites/components/CompositeDetails.vue.d.ts +1 -1
  208. package/dist/features/composites/components/CompositeFieldEditor.js +7 -7
  209. package/dist/features/composites/components/CompositeFieldEditor.js.map +1 -1
  210. package/dist/features/composites/components/CompositeFieldEditor.vue.d.ts +5 -5
  211. package/dist/features/composites/components/CompositeInspector.js +136 -113
  212. package/dist/features/composites/components/CompositeInspector.js.map +1 -1
  213. package/dist/features/composites/components/CompositeInspector.vue.d.ts +3 -3
  214. package/dist/features/composites/components/CompositeStatusMenu.js +2 -2
  215. package/dist/features/composites/components/CompositeStatusMenu.js.map +1 -1
  216. package/dist/features/composites/components/CompositeSummaryEditor.js +1 -1
  217. package/dist/features/composites/components/CompositeSummaryEditor.js.map +1 -1
  218. package/dist/features/composites/components/CompositeSummaryEditor.vue.d.ts +1 -1
  219. package/dist/features/composites/components/CompositeTable.js +2 -2
  220. package/dist/features/composites/components/CompositeTable.js.map +1 -1
  221. package/dist/features/composites/components/CompositeTagsEditor.js +1 -1
  222. package/dist/features/composites/components/CompositeTagsEditor.js.map +1 -1
  223. package/dist/features/composites/components/CompositeTagsEditor.vue.d.ts +1 -1
  224. package/dist/features/composites/components/CompositeView.js +19 -17
  225. package/dist/features/composites/components/CompositeView.js.map +1 -1
  226. package/dist/features/composites/components/DerivationBadge.js +15 -6
  227. package/dist/features/composites/components/DerivationBadge.js.map +1 -1
  228. package/dist/features/composites/components/FocusChip.js +1 -1
  229. package/dist/features/composites/components/FocusChip.js.map +1 -1
  230. package/dist/features/composites/components/FocusChip.vue.d.ts +1 -1
  231. package/dist/features/composites/components/ReferenceFieldSelect.js +3 -3
  232. package/dist/features/composites/components/ReferenceFieldSelect.js.map +1 -1
  233. package/dist/features/composites/components/ReferenceView.js +1 -1
  234. package/dist/features/composites/components/ReferenceView.js.map +1 -1
  235. package/dist/features/composites/components/SettingsEditingTab.js +18 -18
  236. package/dist/features/composites/components/SettingsEditingTab.js.map +1 -1
  237. package/dist/features/composites/components/SettingsEditingTab.vue.d.ts +3 -3
  238. package/dist/features/composites/convert.d.ts +4 -4
  239. package/dist/features/composites/convert.js +27 -28
  240. package/dist/features/composites/convert.js.map +1 -1
  241. package/dist/features/composites/derived-chrome.js +34 -28
  242. package/dist/features/composites/derived-chrome.js.map +1 -1
  243. package/dist/features/composites/editing-settings-keys.js +6 -6
  244. package/dist/features/composites/editing-settings-keys.js.map +1 -1
  245. package/dist/features/composites/feature.d.ts +10 -10
  246. package/dist/features/composites/feature.js +58 -46
  247. package/dist/features/composites/feature.js.map +1 -1
  248. package/dist/features/composites/fences.d.ts +3 -3
  249. package/dist/features/composites/fences.js +18 -13
  250. package/dist/features/composites/fences.js.map +1 -1
  251. package/dist/features/composites/focus.d.ts +10 -10
  252. package/dist/features/composites/focus.js +11 -11
  253. package/dist/features/composites/focus.js.map +1 -1
  254. package/dist/features/composites/heading-composites.d.ts +5 -5
  255. package/dist/features/composites/heading-composites.js +13 -16
  256. package/dist/features/composites/heading-composites.js.map +1 -1
  257. package/dist/features/composites/index.d.ts +20 -18
  258. package/dist/features/composites/index.js +9 -7
  259. package/dist/features/composites/inspector-model.d.ts +45 -22
  260. package/dist/features/composites/inspector-model.js +53 -14
  261. package/dist/features/composites/inspector-model.js.map +1 -1
  262. package/dist/features/composites/legacy.d.ts +5 -4
  263. package/dist/features/composites/legacy.js +16 -23
  264. package/dist/features/composites/legacy.js.map +1 -1
  265. package/dist/features/composites/markdown-export.js +3 -3
  266. package/dist/features/composites/markdown-export.js.map +1 -1
  267. package/dist/features/composites/merge.d.ts +8 -7
  268. package/dist/features/composites/merge.js +39 -12
  269. package/dist/features/composites/merge.js.map +1 -1
  270. package/dist/features/composites/meta-display.js +5 -5
  271. package/dist/features/composites/meta-display.js.map +1 -1
  272. package/dist/features/composites/meta-keys.d.ts +5 -5
  273. package/dist/features/composites/meta-keys.js +8 -8
  274. package/dist/features/composites/meta-keys.js.map +1 -1
  275. package/dist/features/composites/node-views.d.ts +3 -3
  276. package/dist/features/composites/node-views.js +2 -2
  277. package/dist/features/composites/node-views.js.map +1 -1
  278. package/dist/features/composites/nodes.d.ts +13 -13
  279. package/dist/features/composites/nodes.js +100 -77
  280. package/dist/features/composites/nodes.js.map +1 -1
  281. package/dist/features/composites/outline.d.ts +15 -12
  282. package/dist/features/composites/outline.js +24 -21
  283. package/dist/features/composites/outline.js.map +1 -1
  284. package/dist/features/composites/properties.d.ts +51 -0
  285. package/dist/features/composites/properties.js +89 -0
  286. package/dist/features/composites/properties.js.map +1 -0
  287. package/dist/features/composites/react/BibliographyEditor.js +5 -5
  288. package/dist/features/composites/react/BibliographyEditor.js.map +1 -1
  289. package/dist/features/composites/react/CompositeBasketMenu.js +2 -2
  290. package/dist/features/composites/react/CompositeBasketMenu.js.map +1 -1
  291. package/dist/features/composites/react/CompositeChrome.d.ts +1 -1
  292. package/dist/features/composites/react/CompositeChrome.js +15 -6
  293. package/dist/features/composites/react/CompositeChrome.js.map +1 -1
  294. package/dist/features/composites/react/CompositeDetails.d.ts +1 -1
  295. package/dist/features/composites/react/CompositeDetails.js +11 -10
  296. package/dist/features/composites/react/CompositeDetails.js.map +1 -1
  297. package/dist/features/composites/react/CompositeFieldEditor.d.ts +5 -5
  298. package/dist/features/composites/react/CompositeFieldEditor.js +6 -6
  299. package/dist/features/composites/react/CompositeFieldEditor.js.map +1 -1
  300. package/dist/features/composites/react/CompositeInspector.d.ts +3 -3
  301. package/dist/features/composites/react/CompositeInspector.js +142 -128
  302. package/dist/features/composites/react/CompositeInspector.js.map +1 -1
  303. package/dist/features/composites/react/CompositeStatusMenu.js +2 -2
  304. package/dist/features/composites/react/CompositeStatusMenu.js.map +1 -1
  305. package/dist/features/composites/react/CompositeSummaryEditor.d.ts +1 -1
  306. package/dist/features/composites/react/CompositeSummaryEditor.js +1 -1
  307. package/dist/features/composites/react/CompositeSummaryEditor.js.map +1 -1
  308. package/dist/features/composites/react/CompositeTable.d.ts +1 -1
  309. package/dist/features/composites/react/CompositeTable.js +3 -3
  310. package/dist/features/composites/react/CompositeTable.js.map +1 -1
  311. package/dist/features/composites/react/CompositeTagsEditor.d.ts +1 -1
  312. package/dist/features/composites/react/CompositeTagsEditor.js +1 -1
  313. package/dist/features/composites/react/CompositeTagsEditor.js.map +1 -1
  314. package/dist/features/composites/react/CompositeView.js +17 -15
  315. package/dist/features/composites/react/CompositeView.js.map +1 -1
  316. package/dist/features/composites/react/DerivationBadge.js +13 -4
  317. package/dist/features/composites/react/DerivationBadge.js.map +1 -1
  318. package/dist/features/composites/react/FocusChip.d.ts +1 -1
  319. package/dist/features/composites/react/FocusChip.js +1 -1
  320. package/dist/features/composites/react/FocusChip.js.map +1 -1
  321. package/dist/features/composites/react/ReferenceFieldSelect.js +3 -3
  322. package/dist/features/composites/react/ReferenceFieldSelect.js.map +1 -1
  323. package/dist/features/composites/react/ReferenceView.d.ts +1 -1
  324. package/dist/features/composites/react/ReferenceView.js +1 -1
  325. package/dist/features/composites/react/ReferenceView.js.map +1 -1
  326. package/dist/features/composites/react/SettingsEditingTab.d.ts +4 -4
  327. package/dist/features/composites/react/SettingsEditingTab.js +20 -20
  328. package/dist/features/composites/react/SettingsEditingTab.js.map +1 -1
  329. package/dist/features/composites/react.js +1 -1
  330. package/dist/features/composites/react.js.map +1 -1
  331. package/dist/features/composites/reference-ai.js +1 -1
  332. package/dist/features/composites/reference-ai.js.map +1 -1
  333. package/dist/features/composites/reference-label.d.ts +3 -3
  334. package/dist/features/composites/reference-label.js +6 -6
  335. package/dist/features/composites/reference-label.js.map +1 -1
  336. package/dist/features/composites/reference-suggestion.d.ts +1 -1
  337. package/dist/features/composites/reference-suggestion.js +3 -3
  338. package/dist/features/composites/reference-suggestion.js.map +1 -1
  339. package/dist/features/composites/reference-text.d.ts +2 -2
  340. package/dist/features/composites/reference-text.js +4 -4
  341. package/dist/features/composites/reference-text.js.map +1 -1
  342. package/dist/features/composites/reference.d.ts +3 -3
  343. package/dist/features/composites/reference.js +1 -1
  344. package/dist/features/composites/reference.js.map +1 -1
  345. package/dist/features/composites/reveal-source.d.ts +3 -3
  346. package/dist/features/composites/reveal-source.js +6 -6
  347. package/dist/features/composites/reveal-source.js.map +1 -1
  348. package/dist/features/composites/rows-model.d.ts +2 -2
  349. package/dist/features/composites/rows-model.js +4 -3
  350. package/dist/features/composites/rows-model.js.map +1 -1
  351. package/dist/features/composites/rows.d.ts +16 -28
  352. package/dist/features/composites/rows.js +20 -54
  353. package/dist/features/composites/rows.js.map +1 -1
  354. package/dist/features/composites/schema.d.ts +12 -11
  355. package/dist/features/composites/schema.js +10 -9
  356. package/dist/features/composites/schema.js.map +1 -1
  357. package/dist/features/composites/source.d.ts +20 -0
  358. package/dist/features/composites/source.js +40 -0
  359. package/dist/features/composites/source.js.map +1 -0
  360. package/dist/features/composites/split.d.ts +11 -11
  361. package/dist/features/composites/split.js +20 -20
  362. package/dist/features/composites/split.js.map +1 -1
  363. package/dist/features/composites/structure-mode.js +3 -3
  364. package/dist/features/composites/structure-mode.js.map +1 -1
  365. package/dist/features/composites/table-model.js +2 -2
  366. package/dist/features/composites/table-model.js.map +1 -1
  367. package/dist/features/composites/use-composite-inspector.js +3 -1
  368. package/dist/features/composites/use-composite-inspector.js.map +1 -1
  369. package/dist/features/composites/use-composite-rows.d.ts +2 -2
  370. package/dist/features/composites/use-composite-rows.js.map +1 -1
  371. package/dist/features/composites/vue.js +1 -1
  372. package/dist/features/composites/vue.js.map +1 -1
  373. package/dist/features/image-studio/components/ImageStudioDialog.js +1 -1
  374. package/dist/features/image-studio/components/ImageStudioDialog.js.map +1 -1
  375. package/dist/features/image-studio/components/ImageStudioDialog.vue.d.ts +1 -1
  376. package/dist/features/image-studio/components/ImageStudioView.js.map +1 -1
  377. package/dist/features/image-studio/feature.d.ts +1 -1
  378. package/dist/features/image-studio/feature.js +1 -1
  379. package/dist/features/image-studio/feature.js.map +1 -1
  380. package/dist/features/image-studio/node-core.d.ts +3 -3
  381. package/dist/features/image-studio/node-core.js +1 -1
  382. package/dist/features/image-studio/node-core.js.map +1 -1
  383. package/dist/features/image-studio/node-store.d.ts +1 -1
  384. package/dist/features/image-studio/node-store.js +1 -1
  385. package/dist/features/image-studio/node-store.js.map +1 -1
  386. package/dist/features/image-studio/react/ImageStudioDialog.d.ts +1 -1
  387. package/dist/features/image-studio/react/ImageStudioDialog.js +1 -1
  388. package/dist/features/image-studio/react/ImageStudioDialog.js.map +1 -1
  389. package/dist/features/image-studio/react/ImageStudioView.js +1 -1
  390. package/dist/features/image-studio/react/ImageStudioView.js.map +1 -1
  391. package/dist/features/image-studio/react/store.d.ts +3 -3
  392. package/dist/features/image-studio/react/store.js.map +1 -1
  393. package/dist/features/image-studio/react.d.ts +1 -1
  394. package/dist/features/image-studio/react.js +1 -1
  395. package/dist/features/image-studio/react.js.map +1 -1
  396. package/dist/features/image-studio/schema.d.ts +1 -1
  397. package/dist/features/image-studio/schema.js +1 -1
  398. package/dist/features/image-studio/schema.js.map +1 -1
  399. package/dist/features/image-studio/state.d.ts +3 -3
  400. package/dist/features/image-studio/state.js +2 -2
  401. package/dist/features/image-studio/state.js.map +1 -1
  402. package/dist/features/image-studio/store.d.ts +3 -3
  403. package/dist/features/image-studio/vue.d.ts +1 -1
  404. package/dist/features/image-studio/vue.js +1 -1
  405. package/dist/features/image-studio/vue.js.map +1 -1
  406. package/dist/features/media/index.js +1 -1
  407. package/dist/features/media/react/AudioRecorderModal.js +1 -1
  408. package/dist/features/media/react.js +1 -1
  409. package/dist/features/mentions/tag.js +2 -1
  410. package/dist/features/mentions/tag.js.map +1 -1
  411. package/dist/features/themes/components/SettingsAppearanceTab.js +1 -1
  412. package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -1
  413. package/dist/features/themes/feature.d.ts +1 -1
  414. package/dist/features/themes/feature.js.map +1 -1
  415. package/dist/features/themes/react/SettingsAppearanceTab.d.ts +1 -1
  416. package/dist/features/themes/react/SettingsAppearanceTab.js +1 -1
  417. package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -1
  418. package/dist/features/themes/theme-runtime.js +1 -1
  419. package/dist/features/themes/theme-runtime.js.map +1 -1
  420. package/dist/features/transcript/TranscriptSegmentView.js +1 -1
  421. package/dist/features/transcript/TranscriptSegmentView.js.map +1 -1
  422. package/dist/features/transcript/react/TranscriptSegmentView.js +1 -1
  423. package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -1
  424. package/dist/features/transcript/segment-node.js.map +1 -1
  425. package/dist/features/transfer/feature.js +1 -1
  426. package/dist/features/transfer/feature.js.map +1 -1
  427. package/dist/features/transfer/transforms.d.ts +4 -4
  428. package/dist/features/transfer/transforms.js +12 -12
  429. package/dist/features/transfer/transforms.js.map +1 -1
  430. package/dist/i18n/de/ai.js +4 -4
  431. package/dist/i18n/de/ai.js.map +1 -1
  432. package/dist/i18n/de/authors.js +1 -1
  433. package/dist/i18n/de/authors.js.map +1 -1
  434. package/dist/i18n/de/comments.js +1 -1
  435. package/dist/i18n/de/comments.js.map +1 -1
  436. package/dist/i18n/de/composites.js +62 -59
  437. package/dist/i18n/de/composites.js.map +1 -1
  438. package/dist/i18n/de/image-studio.js +2 -2
  439. package/dist/i18n/de/image-studio.js.map +1 -1
  440. package/dist/i18n/de/integrations.js +20 -20
  441. package/dist/i18n/de/integrations.js.map +1 -1
  442. package/dist/i18n/de/markdown.js +1 -1
  443. package/dist/i18n/de/markdown.js.map +1 -1
  444. package/dist/i18n/de/palette.js +1 -1
  445. package/dist/i18n/de/palette.js.map +1 -1
  446. package/dist/i18n/de/themes.js +3 -3
  447. package/dist/i18n/de/themes.js.map +1 -1
  448. package/dist/i18n/de/transfer.js +2 -2
  449. package/dist/i18n/de/transfer.js.map +1 -1
  450. package/dist/i18n/de/tree.js +6 -6
  451. package/dist/i18n/de/tree.js.map +1 -1
  452. package/dist/i18n/de.d.ts +101 -98
  453. package/dist/i18n/en/ai.js +2 -2
  454. package/dist/i18n/en/ai.js.map +1 -1
  455. package/dist/i18n/en/composites.js +64 -61
  456. package/dist/i18n/en/composites.js.map +1 -1
  457. package/dist/i18n/en/integrations.js +9 -9
  458. package/dist/i18n/en/integrations.js.map +1 -1
  459. package/dist/i18n/en/markdown.js +1 -1
  460. package/dist/i18n/en/markdown.js.map +1 -1
  461. package/dist/i18n/en/palette.js +1 -1
  462. package/dist/i18n/en/palette.js.map +1 -1
  463. package/dist/i18n/en/themes.js +4 -4
  464. package/dist/i18n/en/themes.js.map +1 -1
  465. package/dist/i18n/en/tree.js +5 -5
  466. package/dist/i18n/en/tree.js.map +1 -1
  467. package/dist/index.d.ts +4 -1
  468. package/dist/integrations/composite-ai/bibliography-fetch.d.ts +6 -6
  469. package/dist/integrations/composite-ai/bibliography-fetch.js +19 -19
  470. package/dist/integrations/composite-ai/bibliography-fetch.js.map +1 -1
  471. package/dist/integrations/composite-ai/composite-fill.d.ts +4 -4
  472. package/dist/integrations/composite-ai/composite-fill.js +5 -5
  473. package/dist/integrations/composite-ai/composite-fill.js.map +1 -1
  474. package/dist/integrations/composite-ai/composite-summary.d.ts +2 -2
  475. package/dist/integrations/composite-ai/composite-summary.js +5 -5
  476. package/dist/integrations/composite-ai/composite-summary.js.map +1 -1
  477. package/dist/integrations/composite-ai/derive.d.ts +17 -17
  478. package/dist/integrations/composite-ai/derive.js +27 -26
  479. package/dist/integrations/composite-ai/derive.js.map +1 -1
  480. package/dist/integrations/composite-ai/index.d.ts +14 -15
  481. package/dist/integrations/composite-ai/index.js +98 -77
  482. package/dist/integrations/composite-ai/index.js.map +1 -1
  483. package/dist/integrations/composite-ai/outline-sanitize.d.ts +1 -1
  484. package/dist/integrations/composite-ai/outline-sanitize.js +1 -1
  485. package/dist/integrations/composite-ai/outline-sanitize.js.map +1 -1
  486. package/dist/integrations/composite-ai/rendition.d.ts +9 -9
  487. package/dist/integrations/composite-ai/rendition.js +27 -27
  488. package/dist/integrations/composite-ai/rendition.js.map +1 -1
  489. package/dist/integrations/composite-ai/split.d.ts +8 -8
  490. package/dist/integrations/composite-ai/split.js +12 -12
  491. package/dist/integrations/composite-ai/split.js.map +1 -1
  492. package/dist/integrations/composite-ai/transfer-transforms.d.ts +2 -2
  493. package/dist/integrations/composite-ai/transfer-transforms.js +12 -12
  494. package/dist/integrations/composite-ai/transfer-transforms.js.map +1 -1
  495. package/dist/integrations/composite-media/index.d.ts +4 -3
  496. package/dist/integrations/composite-media/index.js +20 -14
  497. package/dist/integrations/composite-media/index.js.map +1 -1
  498. package/dist/markdown/MarkdownSurface.vue.d.ts +7 -7
  499. package/dist/markdown/document.js +1 -1
  500. package/dist/markdown/document.js.map +1 -1
  501. package/dist/nuxt/module.d.ts +30 -24
  502. package/dist/nuxt/module.js.map +1 -1
  503. package/dist/nuxt/runtime/server/plugins/editor-server.js +3 -2
  504. package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -1
  505. package/dist/presets/compose.d.ts +6 -6
  506. package/dist/presets/compose.js +8 -5
  507. package/dist/presets/compose.js.map +1 -1
  508. package/dist/react/AdvancedEditor.d.ts +2 -2
  509. package/dist/react/AdvancedEditor.js +1 -1
  510. package/dist/react/AdvancedEditor.js.map +1 -1
  511. package/dist/react/compose.d.ts +1 -1
  512. package/dist/react/compose.js +2 -2
  513. package/dist/react/compose.js.map +1 -1
  514. package/dist/react/composed-surface.d.ts +5 -5
  515. package/dist/react/composed-surface.js +2 -2
  516. package/dist/react/composed-surface.js.map +1 -1
  517. package/dist/server/ai.d.ts +7 -7
  518. package/dist/server/ai.js +1 -1
  519. package/dist/server/ai.js.map +1 -1
  520. package/dist/server/auth.d.ts +1 -1
  521. package/dist/server/collab-state.d.ts +1 -1
  522. package/dist/server/collab-state.js.map +1 -1
  523. package/dist/server/collab.d.ts +4 -4
  524. package/dist/server/collab.js +22 -17
  525. package/dist/server/collab.js.map +1 -1
  526. package/dist/server/handlers/ai.d.ts +9 -6
  527. package/dist/server/handlers/ai.js +13 -17
  528. package/dist/server/handlers/ai.js.map +1 -1
  529. package/dist/server/handlers/context.d.ts +4 -0
  530. package/dist/server/handlers/context.js.map +1 -1
  531. package/dist/server/handlers/editor.d.ts +33 -32
  532. package/dist/server/handlers/editor.js +13 -8
  533. package/dist/server/handlers/editor.js.map +1 -1
  534. package/dist/server/handlers/images.d.ts +1 -1
  535. package/dist/server/handlers/images.js +1 -1
  536. package/dist/server/handlers/images.js.map +1 -1
  537. package/dist/server/host.d.ts +4 -0
  538. package/dist/server/host.js +10 -2
  539. package/dist/server/host.js.map +1 -1
  540. package/dist/server/index.d.ts +3 -3
  541. package/dist/server/ports.d.ts +8 -8
  542. package/dist/server/ports.js.map +1 -1
  543. package/dist/settings/index.d.ts +20 -19
  544. package/dist/settings/index.js +25 -24
  545. package/dist/settings/index.js.map +1 -1
  546. package/dist/settings/migrate.d.ts +18 -0
  547. package/dist/settings/migrate.js +46 -0
  548. package/dist/settings/migrate.js.map +1 -0
  549. package/dist/settings/values.d.ts +12 -12
  550. package/dist/settings/values.js +11 -11
  551. package/dist/settings/values.js.map +1 -1
  552. package/dist/styles/composites.css +10 -10
  553. package/dist/tree/DocumentTree.js +12 -5
  554. package/dist/tree/DocumentTree.js.map +1 -1
  555. package/dist/tree/drop-rules.js +5 -5
  556. package/dist/tree/drop-rules.js.map +1 -1
  557. package/dist/tree/react/DocumentTree.js +14 -5
  558. package/dist/tree/react/DocumentTree.js.map +1 -1
  559. package/dist/tree/tree-host.js +6 -6
  560. package/dist/tree/tree-host.js.map +1 -1
  561. package/dist/tree/tree-items.js +34 -28
  562. package/dist/tree/tree-items.js.map +1 -1
  563. package/dist/tree/tree-model.js +16 -16
  564. package/dist/tree/tree-model.js.map +1 -1
  565. package/dist/tree/tree-rows.js +2 -2
  566. package/dist/tree/tree-rows.js.map +1 -1
  567. package/dist/tree/tree-view-model.d.ts +2 -2
  568. package/dist/tree/tree-view-model.js.map +1 -1
  569. package/dist/vue/AdvancedEditor.js +2 -2
  570. package/dist/vue/AdvancedEditor.js.map +1 -1
  571. package/dist/vue/AdvancedEditor.vue.d.ts +10 -10
  572. package/dist/vue/SimpleEditor.vue.d.ts +4 -4
  573. package/dist/vue/components/EditorSurface.vue.d.ts +4 -4
  574. package/dist/vue/compose.d.ts +1 -1
  575. package/dist/vue/compose.js +2 -2
  576. package/dist/vue/compose.js.map +1 -1
  577. package/package.json +1 -1
  578. package/dist/features/composites/derivation.d.ts +0 -62
  579. package/dist/features/composites/derivation.js +0 -102
  580. package/dist/features/composites/derivation.js.map +0 -1
  581. package/dist/features/composites/kinds.d.ts +0 -83
  582. package/dist/features/composites/kinds.js +0 -285
  583. package/dist/features/composites/kinds.js.map +0 -1
@@ -1,10 +1,10 @@
1
- import { DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, KIND_ICON_VISIBILITIES, STRUCTURE_MODES, TREE_ROOTS } from "../../../settings/values.js";
1
+ import { BLOCK_TYPE_ICON_VISIBILITIES, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, STRUCTURE_MODES, TREE_ROOTS } from "../../../settings/values.js";
2
2
  import { SPLIT_TARGET_CHARS_MAX, clampSplitTargetChars } from "../../../settings/index.js";
3
3
  import { useUiKit } from "../../../vue/kit/use-ui-kit.js";
4
4
  import { useEditorSettings } from "../../../vue/settings.js";
5
5
  import { useEditorI18n } from "../../../vue/use-editor-i18n.js";
6
6
  import { STRUCTURE_MODE_KEYS } from "../structure-mode.js";
7
- import { DRAG_HANDLE_KEYS, HEADING_SCOPE_KEYS, KIND_ICON_KEYS, optionItems } from "../editing-settings-keys.js";
7
+ import { BLOCK_TYPE_ICON_KEYS, DRAG_HANDLE_KEYS, HEADING_SCOPE_KEYS, optionItems } from "../editing-settings-keys.js";
8
8
  import { TREE_ROOT_KEYS } from "../tree-root.js";
9
9
  import _sfc_main$1 from "../../../vue/components/SettingsSection.js";
10
10
  import { computed, createElementBlock, createElementVNode, createVNode, defineComponent, openBlock, ref, unref, watch, withCtx, withKeys } from "vue";
@@ -15,10 +15,10 @@ const _hoisted_3 = { class: "py-3" };
15
15
  const _hoisted_4 = { class: "py-3" };
16
16
  const _hoisted_5 = { class: "py-3" };
17
17
  const _hoisted_6 = { class: "py-3" };
18
- /** „Bearbeiten“: Gliederung (structure mode, conversion scope), Bausteine defaults and the visibility of the block handles. */
18
+ /** „Bearbeiten“: Gliederung (structure mode, conversion scope), Typed blocks defaults and the visibility of the block handles. */
19
19
  const _sfc_main = /*@__PURE__*/ defineComponent({
20
20
  __name: "SettingsEditingTab",
21
- props: { kinds: {} },
21
+ props: { blockTypes: {} },
22
22
  setup(__props) {
23
23
  const props = __props;
24
24
  const { FormField: UFormField, Input: UInput, RadioGroup: URadioGroup, Select: USelect } = useUiKit();
@@ -27,12 +27,12 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
27
27
  const scopeItems = computed(() => optionItems(HEADING_CONVERSION_SCOPES, HEADING_SCOPE_KEYS, t));
28
28
  const structureItems = computed(() => optionItems(STRUCTURE_MODES, STRUCTURE_MODE_KEYS, t));
29
29
  const treeRootItems = computed(() => optionItems(TREE_ROOTS, TREE_ROOT_KEYS, t));
30
- const kindIconItems = computed(() => optionItems(KIND_ICON_VISIBILITIES, KIND_ICON_KEYS, t));
30
+ const blockTypeIconItems = computed(() => optionItems(BLOCK_TYPE_ICON_VISIBILITIES, BLOCK_TYPE_ICON_KEYS, t));
31
31
  const dragHandleItems = computed(() => optionItems(DRAG_HANDLE_VISIBILITIES, DRAG_HANDLE_KEYS, t));
32
- const kindItems = computed(() => props.kinds.map((kind) => ({
33
- label: kind.label,
34
- icon: kind.icon,
35
- value: kind.id
32
+ const blockTypeItems = computed(() => props.blockTypes.map((blockType) => ({
33
+ label: blockType.label,
34
+ icon: blockType.icon,
35
+ value: blockType.id
36
36
  })));
37
37
  const splitTarget = ref(String(settings.value.blocks.splitTargetChars));
38
38
  watch(() => settings.value.blocks.splitTargetChars, (value) => {
@@ -85,13 +85,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
85
85
  createVNode(unref(UFormField), {
86
86
  orientation: "horizontal",
87
87
  class: "py-3",
88
- label: unref(t)("composites.settings.defaultKind.label"),
89
- description: unref(t)("composites.settings.defaultKind.description")
88
+ label: unref(t)("composites.settings.defaultBlockType.label"),
89
+ description: unref(t)("composites.settings.defaultBlockType.description")
90
90
  }, {
91
91
  default: withCtx(() => [createVNode(unref(USelect), {
92
- modelValue: unref(settings).blocks.defaultKind,
93
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(settings).blocks.defaultKind = $event),
94
- items: kindItems.value,
92
+ modelValue: unref(settings).blocks.defaultBlockType,
93
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => unref(settings).blocks.defaultBlockType = $event),
94
+ items: blockTypeItems.value,
95
95
  class: "w-64"
96
96
  }, null, 8, ["modelValue", "items"])]),
97
97
  _: 1
@@ -123,10 +123,10 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
123
123
  _: 1
124
124
  }, 8, ["label"]),
125
125
  createElementVNode("div", _hoisted_5, [createVNode(unref(URadioGroup), {
126
- modelValue: unref(settings).blocks.kindIcon,
127
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(settings).blocks.kindIcon = $event),
128
- legend: unref(t)("composites.settings.kindIcon.legend"),
129
- items: kindIconItems.value
126
+ modelValue: unref(settings).blocks.blockTypeIcon,
127
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => unref(settings).blocks.blockTypeIcon = $event),
128
+ legend: unref(t)("composites.settings.blockTypeIcon.legend"),
129
+ items: blockTypeIconItems.value
130
130
  }, null, 8, [
131
131
  "modelValue",
132
132
  "legend",
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsEditingTab.js","names":["_openBlock","_createElementBlock","_createVNode","SettingsSection","_unref","_withCtx","_createElementVNode","_withKeys"],"sources":["../../../../src/features/composites/components/SettingsEditingTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport SettingsSection from '../../../vue/components/SettingsSection.vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorSettings } from '../../../vue/settings'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { clampSplitTargetChars, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, KIND_ICON_VISIBILITIES, SPLIT_TARGET_CHARS_MAX, SPLIT_TARGET_CHARS_MIN, STRUCTURE_MODES, TREE_ROOTS } from '../../../settings'\nimport { DRAG_HANDLE_KEYS, HEADING_SCOPE_KEYS, KIND_ICON_KEYS, optionItems } from '../editing-settings-keys'\nimport type { CompositeKind } from '../kinds'\nimport { STRUCTURE_MODE_KEYS } from '../structure-mode'\nimport { TREE_ROOT_KEYS } from '../tree-root'\n\n/** „Bearbeiten“: Gliederung (structure mode, conversion scope), Bausteine defaults and the visibility of the block handles. */\nconst props = defineProps<{ kinds: readonly CompositeKind[] }>()\n\nconst { FormField: UFormField, Input: UInput, RadioGroup: URadioGroup, Select: USelect } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst { settings } = useEditorSettings()\n\nconst scopeItems = computed(() => optionItems(HEADING_CONVERSION_SCOPES, HEADING_SCOPE_KEYS, t))\nconst structureItems = computed(() => optionItems(STRUCTURE_MODES, STRUCTURE_MODE_KEYS, t))\nconst treeRootItems = computed(() => optionItems(TREE_ROOTS, TREE_ROOT_KEYS, t))\nconst kindIconItems = computed(() => optionItems(KIND_ICON_VISIBILITIES, KIND_ICON_KEYS, t))\nconst dragHandleItems = computed(() => optionItems(DRAG_HANDLE_VISIBILITIES, DRAG_HANDLE_KEYS, t))\n\nconst kindItems = computed(() => props.kinds.map(kind => ({ label: kind.label, icon: kind.icon, value: kind.id })))\n\n// The target size is edited as text and written back clamped to its range when the field is left, so a half-typed number never reaches the settings.\nconst splitTarget = ref(String(settings.value.blocks.splitTargetChars))\nwatch(() => settings.value.blocks.splitTargetChars, (value) => { splitTarget.value = String(value) })\nfunction commitSplitTarget() {\n const next = clampSplitTargetChars(splitTarget.value, settings.value.blocks.splitTargetChars)\n settings.value.blocks.splitTargetChars = next\n splitTarget.value = String(next)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-8\">\n <SettingsSection :title=\"t('composites.settings.structure.title')\">\n <div class=\"py-3\">\n <URadioGroup v-model=\"settings.blocks.structure\" :legend=\"t('composites.settings.structure.legend')\" :items=\"structureItems\" />\n </div>\n <div class=\"py-3\">\n <URadioGroup\n v-model=\"settings.editing.headingConversionScope\"\n :legend=\"t('composites.settings.scope.legend')\"\n :items=\"scopeItems\"\n />\n </div>\n </SettingsSection>\n\n <SettingsSection :title=\"t('composites.settings.sidebar.title')\">\n <div class=\"py-3\">\n <URadioGroup v-model=\"settings.blocks.treeRoot\" :legend=\"t('composites.settings.treeRoot.legend')\" :items=\"treeRootItems\" />\n </div>\n </SettingsSection>\n\n <SettingsSection :title=\"t('composites.settings.composites.title')\">\n <UFormField\n orientation=\"horizontal\"\n class=\"py-3\"\n :label=\"t('composites.settings.defaultKind.label')\"\n :description=\"t('composites.settings.defaultKind.description')\"\n >\n <USelect v-model=\"settings.blocks.defaultKind\" :items=\"kindItems\" class=\"w-64\" />\n </UFormField>\n <UFormField orientation=\"horizontal\" class=\"py-3\" :label=\"t('settings.editing.splitTargetChars')\">\n <UInput\n :model-value=\"splitTarget\"\n type=\"number\"\n :min=\"SPLIT_TARGET_CHARS_MIN\"\n :max=\"SPLIT_TARGET_CHARS_MAX\"\n :step=\"100\"\n :aria-label=\"t('settings.editing.splitTargetChars')\"\n class=\"w-32\"\n @blur=\"commitSplitTarget\"\n @keydown.enter=\"commitSplitTarget\"\n @update:model-value=\"(value: unknown) => { splitTarget = String(value) }\"\n />\n </UFormField>\n <div class=\"py-3\">\n <URadioGroup v-model=\"settings.blocks.kindIcon\" :legend=\"t('composites.settings.kindIcon.legend')\" :items=\"kindIconItems\" />\n </div>\n <div class=\"py-3\">\n <URadioGroup v-model=\"settings.blocks.dragHandle\" :legend=\"t('composites.settings.dragHandle.legend')\" :items=\"dragHandleItems\" />\n </div>\n </SettingsSection>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,QAAQ;EAEd,MAAM,EAAE,WAAW,YAAY,OAAO,QAAQ,YAAY,aAAa,QAAQ,YAAY,SAAS;EACpG,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,EAAE,aAAa,kBAAkB;EAEvC,MAAM,aAAa,eAAe,YAAY,2BAA2B,oBAAoB,CAAC,CAAC;EAC/F,MAAM,iBAAiB,eAAe,YAAY,iBAAiB,qBAAqB,CAAC,CAAC;EAC1F,MAAM,gBAAgB,eAAe,YAAY,YAAY,gBAAgB,CAAC,CAAC;EAC/E,MAAM,gBAAgB,eAAe,YAAY,wBAAwB,gBAAgB,CAAC,CAAC;EAC3F,MAAM,kBAAkB,eAAe,YAAY,0BAA0B,kBAAkB,CAAC,CAAC;EAE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A,QAAA,CAAQ,CAAC,OAAO;OAAhB,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,MAAA,QAAA,CAAQ,CAAC,OAAO,WAAQ;OAAG,QAAQA,MAAA,CAAA,CAAC,CAAA,qCAAA;OAA0C,OAAO,cAAA;;;;;;MAE7GE,mBAEM,OAFN,YAEM,CADJJ,YAAkIE,MAAA,WAAA,GAAA;OAA5G,YAAAA,MAAA,QAAA,CAAQ,CAAC,OAAO;OAAhB,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,MAAA,QAAA,CAAQ,CAAC,OAAO,aAAU;OAAG,QAAQA,MAAA,CAAA,CAAC,CAAA,uCAAA;OAA4C,OAAO,gBAAA"}
1
+ {"version":3,"file":"SettingsEditingTab.js","names":["_openBlock","_createElementBlock","_createVNode","SettingsSection","_unref","_withCtx","_createElementVNode","_withKeys"],"sources":["../../../../src/features/composites/components/SettingsEditingTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, ref, watch } from 'vue'\nimport SettingsSection from '../../../vue/components/SettingsSection.vue'\nimport { useUiKit } from '../../../vue/kit/use-ui-kit'\nimport { useEditorSettings } from '../../../vue/settings'\nimport { useEditorI18n } from '../../../vue/use-editor-i18n'\nimport { BLOCK_TYPE_ICON_VISIBILITIES, clampSplitTargetChars, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, SPLIT_TARGET_CHARS_MAX, SPLIT_TARGET_CHARS_MIN, STRUCTURE_MODES, TREE_ROOTS } from '../../../settings'\nimport { BLOCK_TYPE_ICON_KEYS, DRAG_HANDLE_KEYS, HEADING_SCOPE_KEYS, optionItems } from '../editing-settings-keys'\nimport type { BlockType } from '../block-types'\nimport { STRUCTURE_MODE_KEYS } from '../structure-mode'\nimport { TREE_ROOT_KEYS } from '../tree-root'\n\n/** „Bearbeiten“: Gliederung (structure mode, conversion scope), Typed blocks defaults and the visibility of the block handles. */\nconst props = defineProps<{ blockTypes: readonly BlockType[] }>()\n\nconst { FormField: UFormField, Input: UInput, RadioGroup: URadioGroup, Select: USelect } = useUiKit()\nconst { t } = useEditorI18n()\n\nconst { settings } = useEditorSettings()\n\nconst scopeItems = computed(() => optionItems(HEADING_CONVERSION_SCOPES, HEADING_SCOPE_KEYS, t))\nconst structureItems = computed(() => optionItems(STRUCTURE_MODES, STRUCTURE_MODE_KEYS, t))\nconst treeRootItems = computed(() => optionItems(TREE_ROOTS, TREE_ROOT_KEYS, t))\nconst blockTypeIconItems = computed(() => optionItems(BLOCK_TYPE_ICON_VISIBILITIES, BLOCK_TYPE_ICON_KEYS, t))\nconst dragHandleItems = computed(() => optionItems(DRAG_HANDLE_VISIBILITIES, DRAG_HANDLE_KEYS, t))\n\nconst blockTypeItems = computed(() => props.blockTypes.map(blockType => ({ label: blockType.label, icon: blockType.icon, value: blockType.id })))\n\n// The target size is edited as text and written back clamped to its range when the field is left, so a half-typed number never reaches the settings.\nconst splitTarget = ref(String(settings.value.blocks.splitTargetChars))\nwatch(() => settings.value.blocks.splitTargetChars, (value) => { splitTarget.value = String(value) })\nfunction commitSplitTarget() {\n const next = clampSplitTargetChars(splitTarget.value, settings.value.blocks.splitTargetChars)\n settings.value.blocks.splitTargetChars = next\n splitTarget.value = String(next)\n}\n</script>\n\n<template>\n <div class=\"flex flex-col gap-8\">\n <SettingsSection :title=\"t('composites.settings.structure.title')\">\n <div class=\"py-3\">\n <URadioGroup v-model=\"settings.blocks.structure\" :legend=\"t('composites.settings.structure.legend')\" :items=\"structureItems\" />\n </div>\n <div class=\"py-3\">\n <URadioGroup\n v-model=\"settings.editing.headingConversionScope\"\n :legend=\"t('composites.settings.scope.legend')\"\n :items=\"scopeItems\"\n />\n </div>\n </SettingsSection>\n\n <SettingsSection :title=\"t('composites.settings.sidebar.title')\">\n <div class=\"py-3\">\n <URadioGroup v-model=\"settings.blocks.treeRoot\" :legend=\"t('composites.settings.treeRoot.legend')\" :items=\"treeRootItems\" />\n </div>\n </SettingsSection>\n\n <SettingsSection :title=\"t('composites.settings.composites.title')\">\n <UFormField\n orientation=\"horizontal\"\n class=\"py-3\"\n :label=\"t('composites.settings.defaultBlockType.label')\"\n :description=\"t('composites.settings.defaultBlockType.description')\"\n >\n <USelect v-model=\"settings.blocks.defaultBlockType\" :items=\"blockTypeItems\" class=\"w-64\" />\n </UFormField>\n <UFormField orientation=\"horizontal\" class=\"py-3\" :label=\"t('settings.editing.splitTargetChars')\">\n <UInput\n :model-value=\"splitTarget\"\n type=\"number\"\n :min=\"SPLIT_TARGET_CHARS_MIN\"\n :max=\"SPLIT_TARGET_CHARS_MAX\"\n :step=\"100\"\n :aria-label=\"t('settings.editing.splitTargetChars')\"\n class=\"w-32\"\n @blur=\"commitSplitTarget\"\n @keydown.enter=\"commitSplitTarget\"\n @update:model-value=\"(value: unknown) => { splitTarget = String(value) }\"\n />\n </UFormField>\n <div class=\"py-3\">\n <URadioGroup v-model=\"settings.blocks.blockTypeIcon\" :legend=\"t('composites.settings.blockTypeIcon.legend')\" :items=\"blockTypeIconItems\" />\n </div>\n <div class=\"py-3\">\n <URadioGroup v-model=\"settings.blocks.dragHandle\" :legend=\"t('composites.settings.dragHandle.legend')\" :items=\"dragHandleItems\" />\n </div>\n </SettingsSection>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;EAaA,MAAM,QAAQ;EAEd,MAAM,EAAE,WAAW,YAAY,OAAO,QAAQ,YAAY,aAAa,QAAQ,YAAY,SAAS;EACpG,MAAM,EAAE,MAAM,cAAc;EAE5B,MAAM,EAAE,aAAa,kBAAkB;EAEvC,MAAM,aAAa,eAAe,YAAY,2BAA2B,oBAAoB,CAAC,CAAC;EAC/F,MAAM,iBAAiB,eAAe,YAAY,iBAAiB,qBAAqB,CAAC,CAAC;EAC1F,MAAM,gBAAgB,eAAe,YAAY,YAAY,gBAAgB,CAAC,CAAC;EAC/E,MAAM,qBAAqB,eAAe,YAAY,8BAA8B,sBAAsB,CAAC,CAAC;EAC5G,MAAM,kBAAkB,eAAe,Y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YAA2IE,MAAA,WAAA,GAAA;OAArH,YAAAA,MAAA,QAAA,CAAQ,CAAC,OAAO;OAAhB,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,MAAA,QAAA,CAAQ,CAAC,OAAO,gBAAa;OAAG,QAAQA,MAAA,CAAA,CAAC,CAAA,0CAAA;OAA+C,OAAO,mBAAA;;;;;;MAEvHE,mBAEM,OAFN,YAEM,CADJJ,YAAkIE,MAAA,WAAA,GAAA;OAA5G,YAAAA,MAAA,QAAA,CAAQ,CAAC,OAAO;OAAhB,uBAAA,OAAA,OAAA,OAAA,MAAA,WAAA,MAAA,QAAA,CAAQ,CAAC,OAAO,aAAU;OAAG,QAAQA,MAAA,CAAA,CAAC,CAAA,uCAAA;OAA4C,OAAO,gBAAA"}
@@ -1,8 +1,8 @@
1
- import { CompositeKind } from "../kinds.js";
1
+ import { BlockType } from "../block-types.js";
2
2
  //#region src/features/composites/components/SettingsEditingTab.vue.d.ts
3
- /** „Bearbeiten“: Gliederung (structure mode, conversion scope), Bausteine defaults and the visibility of the block handles. */
3
+ /** „Bearbeiten“: Gliederung (structure mode, conversion scope), Typed blocks defaults and the visibility of the block handles. */
4
4
  type __VLS_Props = {
5
- kinds: readonly CompositeKind[];
5
+ blockTypes: readonly BlockType[];
6
6
  };
7
7
  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>;
8
8
  declare const _default: typeof __VLS_export;
@@ -1,6 +1,6 @@
1
1
  import { ConvertTarget } from "../../core/convert.js";
2
2
  import { ConversionProvider } from "../../core/feature.js";
3
- import { CompositeKind } from "./kinds.js";
3
+ import { BlockType } from "./block-types.js";
4
4
  import { Node, Schema } from "@tiptap/pm/model";
5
5
  //#region src/features/composites/convert.d.ts
6
6
  /**
@@ -10,15 +10,15 @@ import { Node, Schema } from "@tiptap/pm/model";
10
10
  * changes, the target is not a composite or core target or a node is not a textblock, list, quote or composite.
11
11
  * Never looks outside `nodes`: a heading's group is the caller's business.
12
12
  */
13
- export declare function convertCompositeBlocks(schema: Schema, nodes: Node[], target: ConvertTarget, kinds: readonly CompositeKind[]): Node[] | null;
13
+ export declare function convertCompositeBlocks(schema: Schema, nodes: Node[], target: ConvertTarget, kinds: readonly BlockType[]): Node[] | null;
14
14
  /**
15
15
  * The composite feature's providers, in menu order. The first claims composites as source blocks (`handlesSource`): it
16
16
  * offers the core targets for them and executes every conversion of a composite, including kind changes. The second
17
- * owns the `composite:<kind>` targets: blocks and kind switches. `kinds` are the host's configured kinds; without them the
17
+ * owns the `typedBlock:<kind>` targets: blocks and kind switches. `kinds` are the host's configured kinds; without them the
18
18
  * built-in kinds apply, and their labels (the menu entries) follow the language of the `t` the menu renders with. What
19
19
  * a conversion writes into the document (the `Label: Wert` line of a composite's meta) uses the built-in kinds in the
20
20
  * default language, since `convert` runs without a translator.
21
21
  */
22
- export declare function compositeConversions(kinds?: readonly CompositeKind[]): readonly ConversionProvider[];
22
+ export declare function compositeConversions(kinds?: readonly BlockType[]): readonly ConversionProvider[];
23
23
  //#endregion
24
24
  //# sourceMappingURL=convert.d.ts.map
@@ -1,14 +1,13 @@
1
+ import { TYPED_BLOCK, TYPED_BLOCK_DESCRIPTION, TYPED_BLOCK_TAGS, TYPED_BLOCK_TITLE } from "../../core/schema/persisted-names.js";
1
2
  import { CORE_TARGET_IDS, childrenOf, createConverter, finishConversion, isCoreTarget, isCurrentTarget, isListNode, isQuoteNode, isTextblockNode, parseCoreTarget, textblockSpecOf } from "../../core/convert.js";
2
- import { compositeKind, defaultCompositeKinds, fallbackCompositeKinds } from "./kinds.js";
3
+ import { blockTypeOf, defaultBlockTypes, fallbackBlockTypes } from "./block-types.js";
3
4
  import { keptMeta } from "./meta-keys.js";
4
5
  import { compositeChromeBlocks, flattenCompositesToHeadings, headingGroupRange } from "./heading-composites.js";
5
6
  import "./nodes.js";
6
7
  import { Fragment } from "@tiptap/pm/model";
7
8
  //#region src/features/composites/convert.ts
8
- const COMPOSITE = "composite";
9
- const TITLE = "compositeTitle";
10
- const COMPOSITE_PREFIX = "composite:";
11
- const isComposite = (node) => node.type.name === COMPOSITE;
9
+ const TYPED_BLOCK_PREFIX = "typedBlock:";
10
+ const isComposite = (node) => node.type.name === TYPED_BLOCK;
12
11
  /** The conversion targets of the core provider, offered for composites (they unwrap into them). */
13
12
  const UNWRAP_TARGETS = CORE_TARGET_IDS.flatMap((id) => parseCoreTarget(id) ?? []);
14
13
  /**
@@ -41,35 +40,35 @@ function convertCompositeBlocks(schema, nodes, target, kinds) {
41
40
  });
42
41
  function toComposite(head, rest, kind) {
43
42
  if (isComposite(head)) {
44
- const meta = keptMeta(compositeKind(kinds, kind), head.attrs.meta);
43
+ const meta = keptMeta(blockTypeOf(kinds, kind), head.attrs.meta);
45
44
  return head.type.create({
46
45
  ...head.attrs,
47
- kind,
46
+ blockType: kind,
48
47
  meta
49
48
  }, [...childrenOf(head), ...rest]);
50
49
  }
51
50
  let title = Fragment.empty;
52
51
  let body = [];
53
- if (isTextblockNode(head)) title = converter.inline(head, TITLE);
52
+ if (isTextblockNode(head)) title = converter.inline(head, TYPED_BLOCK_TITLE);
54
53
  else if (isQuoteNode(head)) body = childrenOf(head);
55
54
  else {
56
55
  const [item, ...more] = childrenOf(head);
57
56
  const [itemHead, ...itemRest] = item ? childrenOf(item) : [];
58
- if (itemHead && isTextblockNode(itemHead)) title = converter.inline(itemHead, TITLE);
57
+ if (itemHead && isTextblockNode(itemHead)) title = converter.inline(itemHead, TYPED_BLOCK_TITLE);
59
58
  else if (itemHead) itemRest.unshift(itemHead);
60
59
  body = [...itemRest, ...more.length ? [head.type.create(null, more)] : []];
61
60
  }
62
61
  body = [...body, ...rest];
63
62
  if (!body.length) body = [paragraph.create()];
64
- return n[COMPOSITE].create({ kind }, [
65
- n[TITLE].create(null, title),
66
- n.compositeDescription.create(),
67
- n.compositeTags.create(),
63
+ return n[TYPED_BLOCK].create({ blockType: kind }, [
64
+ n[TYPED_BLOCK_TITLE].create(null, title),
65
+ n[TYPED_BLOCK_DESCRIPTION].create(),
66
+ n[TYPED_BLOCK_TAGS].create(),
68
67
  ...body
69
68
  ]);
70
69
  }
71
70
  let output;
72
- if (target.type === "composite") output = [toComposite(first, nodes.slice(1), target.kind)];
71
+ if (target.type === "typedBlock") output = [toComposite(first, nodes.slice(1), target.blockType)];
73
72
  else if (!isCoreTarget(target)) return null;
74
73
  else if (target.type === "bulletList" || target.type === "orderedList") output = converter.toList(nodes, target.type);
75
74
  else if (target.type === "blockquote") output = converter.toQuote(nodes);
@@ -84,7 +83,7 @@ function convertAt(kinds) {
84
83
  return (state, $start, target) => {
85
84
  const parent = $start.parent;
86
85
  const from = $start.index();
87
- const to = target.type === "composite" && parent.child(from).type.name === "heading" ? headingGroupRange(parent, from).to : from + 1;
86
+ const to = target.type === "typedBlock" && parent.child(from).type.name === "heading" ? headingGroupRange(parent, from).to : from + 1;
88
87
  const nodes = [];
89
88
  for (let index = from; index < to; index++) nodes.push(parent.child(index));
90
89
  const blocks = convertCompositeBlocks(state.schema, nodes, target, kinds);
@@ -98,13 +97,13 @@ function convertAt(kinds) {
98
97
  /**
99
98
  * The composite feature's providers, in menu order. The first claims composites as source blocks (`handlesSource`): it
100
99
  * offers the core targets for them and executes every conversion of a composite, including kind changes. The second
101
- * owns the `composite:<kind>` targets: blocks and kind switches. `kinds` are the host's configured kinds; without them the
100
+ * owns the `typedBlock:<kind>` targets: blocks and kind switches. `kinds` are the host's configured kinds; without them the
102
101
  * built-in kinds apply, and their labels (the menu entries) follow the language of the `t` the menu renders with. What
103
102
  * a conversion writes into the document (the `Label: Wert` line of a composite's meta) uses the built-in kinds in the
104
103
  * default language, since `convert` runs without a translator.
105
104
  */
106
105
  function compositeConversions(kinds) {
107
- const structure = kinds ?? fallbackCompositeKinds();
106
+ const structure = kinds ?? fallbackBlockTypes();
108
107
  const convert = convertAt(structure);
109
108
  return [{
110
109
  handlesSource: isComposite,
@@ -114,23 +113,23 @@ function compositeConversions(kinds) {
114
113
  convert
115
114
  }, {
116
115
  targets: (_editor, node) => {
117
- if (!(isTextblockNode(node) || isListNode(node) || isQuoteNode(node) || isComposite(node)) || !node.type.schema.nodes[COMPOSITE]) return [];
118
- return structure.map((kind) => ({
119
- type: "composite",
120
- kind: kind.id
116
+ if (!(isTextblockNode(node) || isListNode(node) || isQuoteNode(node) || isComposite(node)) || !node.type.schema.nodes["typedBlock"]) return [];
117
+ return structure.map((blockType) => ({
118
+ type: "typedBlock",
119
+ blockType: blockType.id
121
120
  })).filter((target) => !isCurrentTarget(node, target));
122
121
  },
123
122
  parseTarget: (id) => {
124
- if (!id.startsWith(COMPOSITE_PREFIX)) return null;
125
- const kind = id.slice(10);
126
- return structure.some((known) => known.id === kind) ? {
127
- type: "composite",
128
- kind
123
+ if (!id.startsWith(TYPED_BLOCK_PREFIX)) return null;
124
+ const blockTypeId = id.slice(11);
125
+ return structure.some((known) => known.id === blockTypeId) ? {
126
+ type: "typedBlock",
127
+ blockType: blockTypeId
129
128
  } : null;
130
129
  },
131
130
  label: (target, t) => {
132
- if (target.type !== "composite") return null;
133
- const kind = compositeKind(kinds ?? defaultCompositeKinds(t), target.kind);
131
+ if (target.type !== "typedBlock") return null;
132
+ const kind = blockTypeOf(kinds ?? defaultBlockTypes(t), target.blockType);
134
133
  return {
135
134
  label: t("composites.convert.kind", { kind: kind.label }),
136
135
  icon: kind.icon
@@ -1 +1 @@
1
- {"version":3,"file":"convert.js","names":[],"sources":["../../../src/features/composites/convert.ts"],"sourcesContent":["import { Fragment, type Node as PMNode, type Schema } from '@tiptap/pm/model'\nimport {\n CORE_TARGET_IDS,\n childrenOf,\n type ConvertTarget,\n createConverter,\n finishConversion,\n isCoreTarget,\n isCurrentTarget,\n isListNode,\n isQuoteNode,\n isTextblockNode,\n parseCoreTarget,\n textblockSpecOf,\n} from '../../core/convert'\nimport type { ConversionProvider } from '../../core/feature'\nimport { compositeChromeBlocks, flattenCompositesToHeadings, headingGroupRange } from './heading-composites'\nimport { type CompositeKind, compositeKind, defaultCompositeKinds, fallbackCompositeKinds } from './kinds'\nimport { keptMeta } from './meta-keys'\nimport { COMPOSITE_CHROME_COUNT } from './nodes'\n\n// Vue-free and server-importable: the composite family's block conversions — wrapping blocks into a composite,\n// switching its kind and unwrapping it into plain blocks — as `ConversionProvider`s of the composite feature.\n\nconst COMPOSITE = 'composite'\nconst TITLE = 'compositeTitle'\nconst COMPOSITE_PREFIX = 'composite:'\n\nconst isComposite = (node: PMNode) => node.type.name === COMPOSITE\n\n/** The conversion targets of the core provider, offered for composites (they unwrap into them). */\nconst UNWRAP_TARGETS: readonly ConvertTarget[] = CORE_TARGET_IDS.flatMap(id => parseCoreTarget(id) ?? [])\n\n/**\n * Blocks `nodes` (siblings) converted to `target`. A composite takes the first block as title and the rest as body;\n * composites unwrap into the core targets (title first, description as italic paragraph, tags as a paragraph of tag\n * chips, meta as a `Label: Wert` line); into a heading, nested composites become sub-headings. Null when nothing\n * changes, the target is not a composite or core target or a node is not a textblock, list, quote or composite.\n * Never looks outside `nodes`: a heading's group is the caller's business.\n */\nexport function convertCompositeBlocks(schema: Schema, nodes: PMNode[], target: ConvertTarget, kinds: readonly CompositeKind[]): PMNode[] | null {\n const first = nodes[0]\n if (!first || !schema.nodes[target.type]) return null\n if (!nodes.every(node => isTextblockNode(node) || isListNode(node) || isQuoteNode(node) || isComposite(node))) return null\n if (nodes.length === 1 && isCurrentTarget(first, target)) return null\n const n = schema.nodes\n const paragraph = n.paragraph!\n\n /** A composite as plain blocks: title paragraph (an empty one only with `keepEmptyTitle`), description, tags, meta, body. */\n function unwrapComposite(composite: PMNode, keepEmptyTitle: boolean, headingLevel?: number): PMNode[] {\n const title = composite.child(0)\n const blocks: PMNode[] = []\n if (keepEmptyTitle || title.content.size) blocks.push(paragraph.create(null, title.content))\n blocks.push(...compositeChromeBlocks(schema, composite, kinds))\n let body = childrenOf(composite, COMPOSITE_CHROME_COUNT)\n if (headingLevel !== undefined) body = flattenCompositesToHeadings(schema, body, true, headingLevel + 1, kinds) ?? body\n return [...blocks, ...body]\n }\n\n const converter = createConverter(schema, { is: isComposite, unwrap: unwrapComposite })\n\n function toComposite(head: PMNode, rest: PMNode[], kind: string): PMNode {\n if (isComposite(head)) {\n // Another kind: the same node; `meta` keeps the fields of the new kind plus `derivation` and `bib`. Further blocks join its body.\n const meta = keptMeta(compositeKind(kinds, kind), head.attrs.meta as Record<string, unknown>)\n return head.type.create({ ...head.attrs, kind, meta }, [...childrenOf(head), ...rest])\n }\n let title = Fragment.empty\n let body: PMNode[] = []\n if (isTextblockNode(head)) title = converter.inline(head, TITLE)\n else if (isQuoteNode(head)) body = childrenOf(head)\n else {\n // List: the first item's paragraph is the title, its other blocks and the remaining items (same list type) the body.\n const [item, ...more] = childrenOf(head)\n const [itemHead, ...itemRest] = item ? childrenOf(item) : []\n if (itemHead && isTextblockNode(itemHead)) title = converter.inline(itemHead, TITLE)\n else if (itemHead) itemRest.unshift(itemHead)\n body = [...itemRest, ...(more.length ? [head.type.create(null, more)] : [])]\n }\n body = [...body, ...rest]\n if (!body.length) body = [paragraph.create()]\n return n[COMPOSITE]!.create({ kind }, [n[TITLE]!.create(null, title), n.compositeDescription!.create(), n.compositeTags!.create(), ...body])\n }\n\n let output: PMNode[]\n if (target.type === 'composite') output = [toComposite(first, nodes.slice(1), target.kind)]\n else if (!isCoreTarget(target)) return null\n else if (target.type === 'bulletList' || target.type === 'orderedList') output = converter.toList(nodes, target.type)\n else if (target.type === 'blockquote') output = converter.toQuote(nodes)\n else output = converter.toTextblocks(nodes, textblockSpecOf(target))\n return finishConversion(nodes, output)\n}\n\n/**\n * The conversion of the block right after `$start` into `target`: the range it replaces (a heading becoming a composite\n * takes its group along, which turns into the composite's body) and the converted blocks.\n */\nfunction convertAt(kinds: readonly CompositeKind[]): ConversionProvider['convert'] {\n return (state, $start, target) => {\n const parent = $start.parent\n const from = $start.index()\n const to = target.type === 'composite' && parent.child(from).type.name === 'heading' ? headingGroupRange(parent, from).to : from + 1\n const nodes: PMNode[] = []\n for (let index = from; index < to; index++) nodes.push(parent.child(index))\n const blocks = convertCompositeBlocks(state.schema, nodes, target, kinds)\n return blocks ? { from: $start.pos, to: nodes.reduce((end, node) => end + node.nodeSize, $start.pos), blocks } : null\n }\n}\n\n/**\n * The composite feature's providers, in menu order. The first claims composites as source blocks (`handlesSource`): it\n * offers the core targets for them and executes every conversion of a composite, including kind changes. The second\n * owns the `composite:<kind>` targets: blocks and kind switches. `kinds` are the host's configured kinds; without them the\n * built-in kinds apply, and their labels (the menu entries) follow the language of the `t` the menu renders with. What\n * a conversion writes into the document (the `Label: Wert` line of a composite's meta) uses the built-in kinds in the\n * default language, since `convert` runs without a translator.\n */\nexport function compositeConversions(kinds?: readonly CompositeKind[]): readonly ConversionProvider[] {\n const structure = kinds ?? fallbackCompositeKinds()\n const convert = convertAt(structure)\n const unwrap: ConversionProvider = {\n handlesSource: isComposite,\n targets: (_editor, node) => isComposite(node) ? UNWRAP_TARGETS.filter(target => node.type.schema.nodes[target.type]) : [],\n parseTarget: () => null,\n label: () => null,\n convert,\n }\n const wrap: ConversionProvider = {\n targets: (_editor, node) => {\n if (!(isTextblockNode(node) || isListNode(node) || isQuoteNode(node) || isComposite(node)) || !node.type.schema.nodes[COMPOSITE]) return []\n return structure.map((kind): ConvertTarget => ({ type: 'composite', kind: kind.id })).filter(target => !isCurrentTarget(node, target))\n },\n parseTarget: (id) => {\n if (!id.startsWith(COMPOSITE_PREFIX)) return null\n const kind = id.slice(COMPOSITE_PREFIX.length)\n return structure.some(known => known.id === kind) ? { type: 'composite', kind } : null\n },\n label: (target, t) => {\n if (target.type !== 'composite') return null\n const kind = compositeKind(kinds ?? defaultCompositeKinds(t), target.kind)\n return { label: t('composites.convert.kind', { kind: kind.label }), icon: kind.icon }\n },\n convert,\n }\n return [unwrap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AO;GACnB,IAAI,CAAC,GAAG,WAAW,gBAAgB,GAAG,OAAO;GAC7C,MAAM,OAAO,GAAG,MAAM,EAAuB;GAC7C,OAAO,UAAU,MAAK,UAAS,MAAM,OAAO,IAAI,IAAI;IAAE,MAAM;IAAa;GAAK,IAAI;EACpF;EACA,QAAQ,QAAQ,MAAM;GACpB,IAAI,OAAO,SAAS,aAAa,OAAO;GACxC,MAAM,OAAO,cAAc,SAAS,sBAAsB,CAAC,GAAG,OAAO,IAAI;GACzE,OAAO;IAAE,OAAO,EAAE,2BAA2B,EAAE,MAAM,KAAK,MAAM,CAAC;IAAG,MAAM,KAAK;GAAK;EACtF;EACA;CAEiB,CAAC;AACtB"}
1
+ {"version":3,"file":"convert.js","names":[],"sources":["../../../src/features/composites/convert.ts"],"sourcesContent":["import { Fragment, type Node as PMNode, type Schema } from '@tiptap/pm/model'\nimport {\n CORE_TARGET_IDS,\n childrenOf,\n type ConvertTarget,\n createConverter,\n finishConversion,\n isCoreTarget,\n isCurrentTarget,\n isListNode,\n isQuoteNode,\n isTextblockNode,\n parseCoreTarget,\n textblockSpecOf,\n} from '../../core/convert'\nimport type { ConversionProvider } from '../../core/feature'\nimport { TYPED_BLOCK, TYPED_BLOCK_DESCRIPTION, TYPED_BLOCK_TAGS, TYPED_BLOCK_TITLE } from '../../core/schema/persisted-names'\nimport { compositeChromeBlocks, flattenCompositesToHeadings, headingGroupRange } from './heading-composites'\nimport { type BlockType, blockTypeOf, defaultBlockTypes, fallbackBlockTypes } from './block-types'\nimport { keptMeta } from './meta-keys'\nimport { COMPOSITE_CHROME_COUNT } from './nodes'\n\n// Vue-free and server-importable: the composite family's block conversions — wrapping blocks into a composite,\n// switching its kind and unwrapping it into plain blocks — as `ConversionProvider`s of the composite feature.\n\nconst TYPED_BLOCK_PREFIX = 'typedBlock:'\n\nconst isComposite = (node: PMNode) => node.type.name === TYPED_BLOCK\n\n/** The conversion targets of the core provider, offered for composites (they unwrap into them). */\nconst UNWRAP_TARGETS: readonly ConvertTarget[] = CORE_TARGET_IDS.flatMap(id => parseCoreTarget(id) ?? [])\n\n/**\n * Blocks `nodes` (siblings) converted to `target`. A composite takes the first block as title and the rest as body;\n * composites unwrap into the core targets (title first, description as italic paragraph, tags as a paragraph of tag\n * chips, meta as a `Label: Wert` line); into a heading, nested composites become sub-headings. Null when nothing\n * changes, the target is not a composite or core target or a node is not a textblock, list, quote or composite.\n * Never looks outside `nodes`: a heading's group is the caller's business.\n */\nexport function convertCompositeBlocks(schema: Schema, nodes: PMNode[], target: ConvertTarget, kinds: readonly BlockType[]): PMNode[] | null {\n const first = nodes[0]\n if (!first || !schema.nodes[target.type]) return null\n if (!nodes.every(node => isTextblockNode(node) || isListNode(node) || isQuoteNode(node) || isComposite(node))) return null\n if (nodes.length === 1 && isCurrentTarget(first, target)) return null\n const n = schema.nodes\n const paragraph = n.paragraph!\n\n /** A composite as plain blocks: title paragraph (an empty one only with `keepEmptyTitle`), description, tags, meta, body. */\n function unwrapComposite(composite: PMNode, keepEmptyTitle: boolean, headingLevel?: number): PMNode[] {\n const title = composite.child(0)\n const blocks: PMNode[] = []\n if (keepEmptyTitle || title.content.size) blocks.push(paragraph.create(null, title.content))\n blocks.push(...compositeChromeBlocks(schema, composite, kinds))\n let body = childrenOf(composite, COMPOSITE_CHROME_COUNT)\n if (headingLevel !== undefined) body = flattenCompositesToHeadings(schema, body, true, headingLevel + 1, kinds) ?? body\n return [...blocks, ...body]\n }\n\n const converter = createConverter(schema, { is: isComposite, unwrap: unwrapComposite })\n\n function toComposite(head: PMNode, rest: PMNode[], kind: string): PMNode {\n if (isComposite(head)) {\n // Another kind: the same node; `meta` keeps the fields of the new kind plus `derivation` and `bib`. Further blocks join its body.\n const meta = keptMeta(blockTypeOf(kinds, kind), head.attrs.meta as Record<string, unknown>)\n return head.type.create({ ...head.attrs, blockType: kind, meta }, [...childrenOf(head), ...rest])\n }\n let title = Fragment.empty\n let body: PMNode[] = []\n if (isTextblockNode(head)) title = converter.inline(head, TYPED_BLOCK_TITLE)\n else if (isQuoteNode(head)) body = childrenOf(head)\n else {\n // List: the first item's paragraph is the title, its other blocks and the remaining items (same list type) the body.\n const [item, ...more] = childrenOf(head)\n const [itemHead, ...itemRest] = item ? childrenOf(item) : []\n if (itemHead && isTextblockNode(itemHead)) title = converter.inline(itemHead, TYPED_BLOCK_TITLE)\n else if (itemHead) itemRest.unshift(itemHead)\n body = [...itemRest, ...(more.length ? [head.type.create(null, more)] : [])]\n }\n body = [...body, ...rest]\n if (!body.length) body = [paragraph.create()]\n return n[TYPED_BLOCK]!.create({ blockType: kind }, [n[TYPED_BLOCK_TITLE]!.create(null, title), n[TYPED_BLOCK_DESCRIPTION]!.create(), n[TYPED_BLOCK_TAGS]!.create(), ...body])\n }\n\n let output: PMNode[]\n if (target.type === 'typedBlock') output = [toComposite(first, nodes.slice(1), target.blockType)]\n else if (!isCoreTarget(target)) return null\n else if (target.type === 'bulletList' || target.type === 'orderedList') output = converter.toList(nodes, target.type)\n else if (target.type === 'blockquote') output = converter.toQuote(nodes)\n else output = converter.toTextblocks(nodes, textblockSpecOf(target))\n return finishConversion(nodes, output)\n}\n\n/**\n * The conversion of the block right after `$start` into `target`: the range it replaces (a heading becoming a composite\n * takes its group along, which turns into the composite's body) and the converted blocks.\n */\nfunction convertAt(kinds: readonly BlockType[]): ConversionProvider['convert'] {\n return (state, $start, target) => {\n const parent = $start.parent\n const from = $start.index()\n const to = target.type === 'typedBlock' && parent.child(from).type.name === 'heading' ? headingGroupRange(parent, from).to : from + 1\n const nodes: PMNode[] = []\n for (let index = from; index < to; index++) nodes.push(parent.child(index))\n const blocks = convertCompositeBlocks(state.schema, nodes, target, kinds)\n return blocks ? { from: $start.pos, to: nodes.reduce((end, node) => end + node.nodeSize, $start.pos), blocks } : null\n }\n}\n\n/**\n * The composite feature's providers, in menu order. The first claims composites as source blocks (`handlesSource`): it\n * offers the core targets for them and executes every conversion of a composite, including kind changes. The second\n * owns the `typedBlock:<kind>` targets: blocks and kind switches. `kinds` are the host's configured kinds; without them the\n * built-in kinds apply, and their labels (the menu entries) follow the language of the `t` the menu renders with. What\n * a conversion writes into the document (the `Label: Wert` line of a composite's meta) uses the built-in kinds in the\n * default language, since `convert` runs without a translator.\n */\nexport function compositeConversions(kinds?: readonly BlockType[]): readonly ConversionProvider[] {\n const structure = kinds ?? fallbackBlockTypes()\n const convert = convertAt(structure)\n const unwrap: ConversionProvider = {\n handlesSource: isComposite,\n targets: (_editor, node) => isComposite(node) ? UNWRAP_TARGETS.filter(target => node.type.schema.nodes[target.type]) : [],\n parseTarget: () => null,\n label: () => null,\n convert,\n }\n const wrap: ConversionProvider = {\n targets: (_editor, node) => {\n if (!(isTextblockNode(node) || isListNode(node) || isQuoteNode(node) || isComposite(node)) || !node.type.schema.nodes[TYPED_BLOCK]) return []\n return structure.map((blockType): ConvertTarget => ({ type: 'typedBlock', blockType: blockType.id })).filter(target => !isCurrentTarget(node, target))\n },\n parseTarget: (id) => {\n if (!id.startsWith(TYPED_BLOCK_PREFIX)) return null\n const blockTypeId = id.slice(TYPED_BLOCK_PREFIX.length)\n return structure.some(known => known.id === blockTypeId) ? { type: 'typedBlock', blockType: blockTypeId } : null\n },\n label: (target, t) => {\n if (target.type !== 'typedBlock') return null\n const kind = blockTypeOf(kinds ?? defaultBlockTypes(t), target.blockType)\n return { label: t('composites.convert.kind', { kind: kind.label }), icon: kind.icon }\n },\n convert,\n }\n return [unwrap, wrap]\n}\n"],"mappings":";;;;;;;;AAyBA,MAAM,qBAAqB;AAE3B,MAAM,eAAe,SAAiB,KAAK,KAAK,SAAS;;AAGzD,MAAM,iBAA2C,gBAAgB,SAAQ,OAAM,gBAAgB,EAAE,KAAK,CAAC,CAAC;;;;;;;;AASxG,SAAgB,uBAAuB,QAAgB,OAAiB,QAAuB,OAA8C;CAC3I,MAAM,QAAQ,MAAM;CACpB,IAAI,CAAC,SAAS,CAAC,OAAO,MAAM,OAAO,OAAO,OAAO;CACjD,IAAI,CAAC,MAAM,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,EAAE,2BAA2B,EAAE,MAAM,KAAK,MAAM,CAAC;IAAG,MAAM,KAAK;GAAK;EACtF;EACA;CAEiB,CAAC;AACtB"}
@@ -1,63 +1,69 @@
1
1
  import { findBlockById } from "../../core/schema/block-ids.js";
2
2
  import { EDITOR_API } from "../../core/api-routes.js";
3
+ import { assetRefOf, derivationOf, derivationOriginOf, derivationState, isForeignSource } from "../../core/derivation.js";
4
+ import { documentIdOf } from "../../core/block-transfer.js";
3
5
  import { sha256Hex } from "../../core/hash.js";
4
- import { bodyMarkdown, derivationOf, derivationState, isForeignSource, sourceOf } from "./derivation.js";
5
- import { compositeKindsOf } from "./nodes.js";
6
+ import { bodyMarkdown } from "./source.js";
6
7
  import { compositeOfRow } from "./rows.js";
7
8
  //#region src/features/composites/derived-chrome.ts
8
9
  /**
9
- * The chrome state of the row's Baustein when it is derived (null when it is not): `stale` when its asset source has
10
- * changed since it was made, i.e. the enclosing Baustein's source block hash differs from the stored `inputHash`.
11
- * Cheap on purpose (no body hashing): the chrome runs it for every row on every refresh. „bearbeitet“ and the staleness
12
- * of a block-derived Baustein hash Markdown, so only the details card computes them (`derivationDetailsOf`).
10
+ * The chrome state of the row's Typed block when it is Derived (null when it is not): `stale` when its asset source has
11
+ * changed since it was made, i.e. the block that holds the asset has a hash that differs from the stored `inputHash`; `sourceMissing`
12
+ * when the original no longer exists. Cheap on purpose (no body hashing): the chrome runs it for every row on every refresh.
13
+ * „bearbeitet“ and the staleness of a block-derived Typed block hash Markdown, so only the details card computes them (`derivationDetailsOf`).
13
14
  */
14
15
  function derivedChromeOf(editor, row) {
15
16
  const { doc } = editor.state;
16
17
  const at = doc.nodeAt(row.pos);
17
- const found = at?.type.name === "composite" && (at.attrs.id ?? null) === row.id ? {
18
+ const found = at?.type.name === "typedBlock" && (at.attrs.id ?? null) === row.id ? {
18
19
  pos: row.pos,
19
20
  node: at
20
21
  } : compositeOfRow(doc, row);
21
22
  if (!found || !derivationOf(found.node)) return null;
22
- const parent = doc.resolve(found.pos).parent;
23
- return { stale: parent.type.name === "composite" && derivationState(parent, found.node, () => "", compositeKindsOf(editor)).stale === true };
24
- }
25
- /** The id of `editor`'s document as the `blockTransfer` storage knows it; null when the editor has none. */
26
- function documentIdOf(editor) {
27
- return editor.storage.blockTransfer?.documentId ?? null;
23
+ const state = derivationState(doc, found.pos, () => "", documentIdOf(editor));
24
+ return {
25
+ stale: state?.stale === true,
26
+ sourceMissing: state?.source === "missing"
27
+ };
28
28
  }
29
29
  /** Whether `derivation` was made from a block of another document than `editor`'s (its source cannot be looked up here). */
30
30
  function derivationIsForeign(editor, derivation) {
31
31
  return isForeignSource(derivation, documentIdOf(editor));
32
32
  }
33
33
  /**
34
- * Details of the derived Baustein `node` of `editor`'s document (null when it is not derived). Serialises and hashes
35
- * the body (and for a block source the source block), so call it for one Baustein at a time, not for every row.
34
+ * Whether the Derived block `node` of `editor`'s document has lost its original (the source-missing state). False for a block that is
35
+ * not Derived, not in the document, or whose original lives in another document.
36
+ */
37
+ function isSourceMissing(editor, node) {
38
+ const id = node.attrs.id;
39
+ const found = typeof id === "string" && id ? findBlockById(editor.state.doc, id) : null;
40
+ return !!found && derivationOriginOf(editor.state.doc, found.pos, documentIdOf(editor))?.status === "missing";
41
+ }
42
+ /**
43
+ * Details of the Derived block `node` of `editor`'s document (null when it is not Derived). Serialises and hashes
44
+ * the body (and for a block source the source block), so call it for one Typed block at a time, not for every row.
36
45
  */
37
46
  function derivationDetailsOf(editor, node) {
38
47
  const derivation = derivationOf(node);
39
48
  if (!derivation) return null;
40
49
  const { doc } = editor.state;
41
- const kinds = compositeKindsOf(editor);
50
+ const documentId = documentIdOf(editor);
42
51
  const id = node.attrs.id;
43
52
  const found = typeof id === "string" && id ? findBlockById(doc, id) : null;
44
- const parent = found ? doc.resolve(found.pos).parent : null;
45
- const holder = parent?.type.name === "composite" ? parent : null;
46
53
  let bodyHash;
47
- const state = derivationState(holder ?? node, node, () => bodyHash ??= sha256Hex(bodyMarkdown(editor, node)), kinds);
54
+ const state = found ? derivationState(doc, found.pos, () => bodyHash ??= sha256Hex(bodyMarkdown(editor, node)), documentId) : null;
55
+ const origin = found ? derivationOriginOf(doc, found.pos, documentId) : null;
48
56
  const foreign = derivationIsForeign(editor, derivation);
49
- let stale = state.stale;
50
- if ("block" in derivation.from && !foreign) {
51
- const source = findBlockById(doc, derivation.from.block);
52
- stale = source && derivation.inputHash ? sha256Hex(bodyMarkdown(editor, source.node)) !== derivation.inputHash : null;
53
- }
54
- const documentId = holder ? sourceOf(holder, kinds)?.asset?.documentId : void 0;
55
- const outputUrl = derivation.output && documentId ? `${EDITOR_API}/assets/${documentId}/${derivation.output}` : null;
57
+ let stale = state?.stale ?? null;
58
+ if ("block" in derivation.from && origin?.status === "found") stale = derivation.inputHash ? sha256Hex(bodyMarkdown(editor, origin.node)) !== derivation.inputHash : null;
59
+ const outputDocument = (origin?.status === "found" ? assetRefOf(String(origin.node.attrs.src ?? ""))?.documentId : void 0) ?? documentId;
60
+ const outputUrl = derivation.output && outputDocument ? `${EDITOR_API}/assets/${outputDocument}/${derivation.output}` : null;
56
61
  return {
57
62
  derivation,
58
63
  foreign,
64
+ sourceMissing: origin?.status === "missing",
59
65
  stale,
60
- edited: state.edited,
66
+ edited: state?.edited ?? null,
61
67
  outputUrl
62
68
  };
63
69
  }
@@ -74,6 +80,6 @@ function derivationMethodLabel(t, method) {
74
80
  return KNOWN_METHODS.includes(method) ? t(`composites.derivation.method.${method}`) : method;
75
81
  }
76
82
  //#endregion
77
- export { derivationDetailsOf, derivationIsForeign, derivationMethodLabel, derivedChromeOf };
83
+ export { derivationDetailsOf, derivationIsForeign, derivationMethodLabel, derivedChromeOf, isSourceMissing };
78
84
 
79
85
  //# sourceMappingURL=derived-chrome.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"derived-chrome.js","names":[],"sources":["../../../src/features/composites/derived-chrome.ts"],"sourcesContent":["// Vue-free: what the composite chrome and the details card show for a derived Baustein (one with a `meta.derivation`).\nimport type { Editor } from '@tiptap/core'\nimport type { Node as PMNode } from '@tiptap/pm/model'\nimport { EDITOR_API } from '../../core/api-routes'\nimport { sha256Hex } from '../../core/hash'\nimport { findBlockById } from '../../core/schema/block-ids'\nimport type { MessageKey, Translate } from '../../i18n'\nimport { type Derivation, bodyMarkdown, derivationOf, derivationState, isForeignSource, sourceOf } from './derivation'\nimport { compositeKindsOf } from './nodes'\nimport { type CompositeRow, compositeOfRow } from './rows'\n\n/**\n * The chrome state of the row's Baustein when it is derived (null when it is not): `stale` when its asset source has\n * changed since it was made, i.e. the enclosing Baustein's source block hash differs from the stored `inputHash`.\n * Cheap on purpose (no body hashing): the chrome runs it for every row on every refresh. „bearbeitet“ and the staleness\n * of a block-derived Baustein hash Markdown, so only the details card computes them (`derivationDetailsOf`).\n */\nexport function derivedChromeOf(editor: Editor, row: Pick<CompositeRow, 'id' | 'pos'>): { stale: boolean } | null {\n const { doc } = editor.state\n // The row's position may be stale for a moment after an edit; take it only when it still holds the same Baustein.\n const at = doc.nodeAt(row.pos)\n const found = at?.type.name === 'composite' && (at.attrs.id ?? null) === row.id ? { pos: row.pos, node: at } : compositeOfRow(doc, row)\n if (!found || !derivationOf(found.node)) return null\n const parent = doc.resolve(found.pos).parent\n const stale = parent.type.name === 'composite' && derivationState(parent, found.node, () => '', compositeKindsOf(editor)).stale === true\n return { stale }\n}\n\n/** The id of `editor`'s document as the `blockTransfer` storage knows it; null when the editor has none. */\nfunction documentIdOf(editor: Editor): string | null {\n const storage = editor.storage as { blockTransfer?: { documentId?: string | null } }\n return storage.blockTransfer?.documentId ?? null\n}\n\n/** Whether `derivation` was made from a block of another document than `editor`'s (its source cannot be looked up here). */\nexport function derivationIsForeign(editor: Editor, derivation: Derivation): boolean {\n return isForeignSource(derivation, documentIdOf(editor))\n}\n\n/** Everything the details card shows about the derivation of `node`; `stale`/`edited` are null when they cannot be told. */\nexport interface DerivationDetails {\n derivation: Derivation\n /** The source lives in another document: nothing to compare with (`stale` is null) and nothing to reveal. */\n foreign: boolean\n /** The source changed since `node` was made: asset hash for an asset source, Markdown hash of the source block for a block source; null for a foreign source. */\n stale: boolean | null\n /** The body differs from what was generated. */\n edited: boolean | null\n /** URL of the stored raw output, when there is one and its document is known. */\n outputUrl: string | null\n}\n\n/**\n * Details of the derived Baustein `node` of `editor`'s document (null when it is not derived). Serialises and hashes\n * the body (and for a block source the source block), so call it for one Baustein at a time, not for every row.\n */\nexport function derivationDetailsOf(editor: Editor, node: PMNode): DerivationDetails | null {\n const derivation = derivationOf(node)\n if (!derivation) return null\n const { doc } = editor.state\n const kinds = compositeKindsOf(editor)\n const id: unknown = node.attrs.id\n const found = typeof id === 'string' && id ? findBlockById(doc, id) : null\n const parent = found ? doc.resolve(found.pos).parent : null\n const holder = parent?.type.name === 'composite' ? parent : null\n\n let bodyHash: string | undefined\n const state = derivationState(holder ?? node, node, () => (bodyHash ??= sha256Hex(bodyMarkdown(editor, node))), kinds)\n const foreign = derivationIsForeign(editor, derivation)\n let stale = state.stale\n if ('block' in derivation.from && !foreign) {\n const source = findBlockById(doc, derivation.from.block)\n stale = source && derivation.inputHash ? sha256Hex(bodyMarkdown(editor, source.node)) !== derivation.inputHash : null\n }\n\n const documentId = holder ? sourceOf(holder, kinds)?.asset?.documentId : undefined\n const outputUrl = derivation.output && documentId ? `${EDITOR_API}/assets/${documentId}/${derivation.output}` : null\n return { derivation, foreign, stale, edited: state.edited, outputUrl }\n}\n\nconst KNOWN_METHODS: readonly string[] = ['transcription', 'pdf-text', 'ocr', 'description', 'bibliography']\n\n/** The words for a derivation method: the known ones translated, `ai:<kind>` as „KI-Ableitung“, anything else as stored. */\nexport function derivationMethodLabel(t: Translate, method: string): string {\n if (method.startsWith('ai:')) return t('composites.derivation.method.ai')\n return KNOWN_METHODS.includes(method) ? t(`composites.derivation.method.${method}` as MessageKey) : method\n}\n"],"mappings":";;;;;;;;;;;;;AAiBA,SAAgB,gBAAgB,QAAgB,KAAkE;CAChH,MAAM,EAAE,QAAQ,OAA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,KAAK,KAAK;EACvD,QAAQ,UAAU,WAAW,YAAY,UAAU,aAAa,QAAQ,OAAO,IAAI,CAAC,MAAM,WAAW,YAAY;CACnH;CAEA,MAAM,aAAa,SAAS,SAAS,QAAQ,KAAK,CAAC,EAAE,OAAO,aAAa,KAAA;CACzE,MAAM,YAAY,WAAW,UAAU,aAAa,GAAG,WAAW,UAAU,WAAW,GAAG,WAAW,WAAW;CAChH,OAAO;EAAE;EAAY;EAAS;EAAO,QAAQ,MAAM;EAAQ;CAAU;AACvE;AAEA,MAAM,gBAAmC;CAAC;CAAiB;CAAY;CAAO;CAAe;AAAc;;AAG3G,SAAgB,sBAAsB,GAAc,QAAwB;CAC1E,IAAI,OAAO,WAAW,KAAK,GAAG,OAAO,EAAE,iCAAiC;CACxE,OAAO,cAAc,SAAS,MAAM,IAAI,EAAE,gCAAgC,QAAsB,IAAI;AACtG"}
1
+ {"version":3,"file":"derived-chrome.js","names":[],"sources":["../../../src/features/composites/derived-chrome.ts"],"sourcesContent":["// Vue-free: what the composite chrome, the details card, the inspector and the outline show for a Derived block (one with a `meta.derivation`).\nimport type { Editor } from '@tiptap/core'\nimport type { Node as PMNode } from '@tiptap/pm/model'\nimport { EDITOR_API } from '../../core/api-routes'\nimport { documentIdOf } from '../../core/block-transfer'\nimport { type Derivation, assetRefOf, derivationOf, derivationOriginOf, derivationState, isForeignSource } from '../../core/derivation'\nimport { sha256Hex } from '../../core/hash'\nimport { findBlockById } from '../../core/schema/block-ids'\nimport type { MessageKey, Translate } from '../../i18n'\nimport { bodyMarkdown } from './source'\nimport { type CompositeRow, compositeOfRow } from './rows'\n\n/** The state of the chrome of a Derived block: `stale` when its asset source has changed since it was made, `sourceMissing` when its original was deleted. */\nexport interface DerivedChrome {\n stale: boolean\n /** The original is gone (deleted, or never in this document): the Derived block stays on its own. */\n sourceMissing: boolean\n}\n\n/**\n * The chrome state of the row's Typed block when it is Derived (null when it is not): `stale` when its asset source has\n * changed since it was made, i.e. the block that holds the asset has a hash that differs from the stored `inputHash`; `sourceMissing`\n * when the original no longer exists. Cheap on purpose (no body hashing): the chrome runs it for every row on every refresh.\n * „bearbeitet“ and the staleness of a block-derived Typed block hash Markdown, so only the details card computes them (`derivationDetailsOf`).\n */\nexport function derivedChromeOf(editor: Editor, row: Pick<CompositeRow, 'id' | 'pos'>): DerivedChrome | null {\n const { doc } = editor.state\n // The row's position may be stale for a moment after an edit; take it only when it still holds the same Typed block.\n const at = doc.nodeAt(row.pos)\n const found = at?.type.name === 'typedBlock' && (at.attrs.id ?? null) === row.id ? { pos: row.pos, node: at } : compositeOfRow(doc, row)\n if (!found || !derivationOf(found.node)) return null\n const state = derivationState(doc, found.pos, () => '', documentIdOf(editor))\n return { stale: state?.stale === true, sourceMissing: state?.source === 'missing' }\n}\n\n/** Whether `derivation` was made from a block of another document than `editor`'s (its source cannot be looked up here). */\nexport function derivationIsForeign(editor: Editor, derivation: Derivation): boolean {\n return isForeignSource(derivation, documentIdOf(editor))\n}\n\n/**\n * Whether the Derived block `node` of `editor`'s document has lost its original (the source-missing state). False for a block that is\n * not Derived, not in the document, or whose original lives in another document.\n */\nexport function isSourceMissing(editor: Editor, node: PMNode): boolean {\n const id: unknown = node.attrs.id\n const found = typeof id === 'string' && id ? findBlockById(editor.state.doc, id) : null\n return !!found && derivationOriginOf(editor.state.doc, found.pos, documentIdOf(editor))?.status === 'missing'\n}\n\n/** Everything the details card shows about the derivation of `node`; `stale`/`edited` are null when they cannot be told. */\nexport interface DerivationDetails {\n derivation: Derivation\n /** The source lives in another document: nothing to compare with (`stale` is null) and nothing to reveal. */\n foreign: boolean\n /** The original was deleted: the Derived block stays without it (`derivationState`: `source: 'missing'`). */\n sourceMissing: boolean\n /** The source changed since `node` was made: asset hash for an asset source, Markdown hash of the source block for a block source; null for a foreign or missing source. */\n stale: boolean | null\n /** The body differs from what was generated. */\n edited: boolean | null\n /** URL of the stored raw output, when there is one and its document is known. */\n outputUrl: string | null\n}\n\n/**\n * Details of the Derived block `node` of `editor`'s document (null when it is not Derived). Serialises and hashes\n * the body (and for a block source the source block), so call it for one Typed block at a time, not for every row.\n */\nexport function derivationDetailsOf(editor: Editor, node: PMNode): DerivationDetails | null {\n const derivation = derivationOf(node)\n if (!derivation) return null\n const { doc } = editor.state\n const documentId = documentIdOf(editor)\n const id: unknown = node.attrs.id\n const found = typeof id === 'string' && id ? findBlockById(doc, id) : null\n\n let bodyHash: string | undefined\n const state = found ? derivationState(doc, found.pos, () => (bodyHash ??= sha256Hex(bodyMarkdown(editor, node))), documentId) : null\n const origin = found ? derivationOriginOf(doc, found.pos, documentId) : null\n const foreign = derivationIsForeign(editor, derivation)\n let stale = state?.stale ?? null\n if ('block' in derivation.from && origin?.status === 'found') {\n stale = derivation.inputHash ? sha256Hex(bodyMarkdown(editor, origin.node)) !== derivation.inputHash : null\n }\n\n // The stored raw output lives in the document that holds the original's asset; without an original, in the open document.\n const assetDocument = origin?.status === 'found' ? assetRefOf(String(origin.node.attrs.src ?? ''))?.documentId : undefined\n const outputDocument = assetDocument ?? documentId\n const outputUrl = derivation.output && outputDocument ? `${EDITOR_API}/assets/${outputDocument}/${derivation.output}` : null\n return { derivation, foreign, sourceMissing: origin?.status === 'missing', stale, edited: state?.edited ?? null, outputUrl }\n}\n\nconst KNOWN_METHODS: readonly string[] = ['transcription', 'pdf-text', 'ocr', 'description', 'bibliography']\n\n/** The words for a derivation method: the known ones translated, `ai:<kind>` as „KI-Ableitung“, anything else as stored. */\nexport function derivationMethodLabel(t: Translate, method: string): string {\n if (method.startsWith('ai:')) return t('composites.derivation.method.ai')\n return KNOWN_METHODS.includes(method) ? t(`composites.derivation.method.${method}` as MessageKey) : method\n}\n"],"mappings":";;;;;;;;;;;;;;AAyBA,SAAgB,gBAAgB,QAAgB,KAA6D;CAC3G,MAAM,EAAE,QAAQ,OAAO;CAEvB,MAAM,KAAK,IAAI,OAAO,IAAI,GAAG;CAC7B,MAAM,QAAQ,IAAI,KAAK,SAAS,iBAAiB,GAAG,MAAM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AU,aAAa,QAAQ,OAAO,IAAI,CAAC,MAAM,WAAW,YAAY;CAKzG,MAAM,kBADgB,QAAQ,WAAW,UAAU,WAAW,OAAO,OAAO,KAAK,MAAM,OAAO,EAAE,CAAC,CAAC,EAAE,aAAa,KAAA,MACzE;CACxC,MAAM,YAAY,WAAW,UAAU,iBAAiB,GAAG,WAAW,UAAU,eAAe,GAAG,WAAW,WAAW;CACxH,OAAO;EAAE;EAAY;EAAS,eAAe,QAAQ,WAAW;EAAW;EAAO,QAAQ,OAAO,UAAU;EAAM;CAAU;AAC7H;AAEA,MAAM,gBAAmC;CAAC;CAAiB;CAAY;CAAO;CAAe;AAAc;;AAG3G,SAAgB,sBAAsB,GAAc,QAAwB;CAC1E,IAAI,OAAO,WAAW,KAAK,GAAG,OAAO,EAAE,iCAAiC;CACxE,OAAO,cAAc,SAAS,MAAM,IAAI,EAAE,gCAAgC,QAAsB,IAAI;AACtG"}
@@ -13,14 +13,14 @@ const HEADING_SCOPE_KEYS = {
13
13
  descriptionKey: "composites.settings.scope.heading.description"
14
14
  }
15
15
  };
16
- const KIND_ICON_KEYS = {
16
+ const BLOCK_TYPE_ICON_KEYS = {
17
17
  always: {
18
- labelKey: "composites.settings.kindIcon.always.label",
19
- descriptionKey: "composites.settings.kindIcon.always.description"
18
+ labelKey: "composites.settings.blockTypeIcon.always.label",
19
+ descriptionKey: "composites.settings.blockTypeIcon.always.description"
20
20
  },
21
21
  hover: {
22
- labelKey: "composites.settings.kindIcon.hover.label",
23
- descriptionKey: "composites.settings.kindIcon.hover.description"
22
+ labelKey: "composites.settings.blockTypeIcon.hover.label",
23
+ descriptionKey: "composites.settings.blockTypeIcon.hover.description"
24
24
  }
25
25
  };
26
26
  const DRAG_HANDLE_KEYS = {
@@ -42,6 +42,6 @@ function optionItems(values, keys, t) {
42
42
  }));
43
43
  }
44
44
  //#endregion
45
- export { DRAG_HANDLE_KEYS, HEADING_SCOPE_KEYS, KIND_ICON_KEYS, optionItems };
45
+ export { BLOCK_TYPE_ICON_KEYS, DRAG_HANDLE_KEYS, HEADING_SCOPE_KEYS, optionItems };
46
46
 
47
47
  //# sourceMappingURL=editing-settings-keys.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"editing-settings-keys.js","names":[],"sources":["../../../src/features/composites/editing-settings-keys.ts"],"sourcesContent":["import type { MessageKey, Translate } from '../../i18n'\nimport type { DragHandleVisibility, HeadingConversionScope, KindIconVisibility } from '../../settings'\n\n/** Message keys of the labels of the „Bearbeiten“ settings radios (Vue and React); resolve them with `t`. The stored values stay the ids. */\nexport interface OptionKeys { labelKey: MessageKey, descriptionKey: MessageKey }\n\nexport const HEADING_SCOPE_KEYS: Record<HeadingConversionScope, OptionKeys> = {\n container: { labelKey: 'composites.settings.scope.container.label', descriptionKey: 'composites.settings.scope.container.description' },\n document: { labelKey: 'composites.settings.scope.document.label', descriptionKey: 'composites.settings.scope.document.description' },\n heading: { labelKey: 'composites.settings.scope.heading.label', descriptionKey: 'composites.settings.scope.heading.description' },\n}\n\nexport const KIND_ICON_KEYS: Record<KindIconVisibility, OptionKeys> = {\n always: { labelKey: 'composites.settings.kindIcon.always.label', descriptionKey: 'composites.settings.kindIcon.always.description' },\n hover: { labelKey: 'composites.settings.kindIcon.hover.label', descriptionKey: 'composites.settings.kindIcon.hover.description' },\n}\n\nexport const DRAG_HANDLE_KEYS: Record<DragHandleVisibility, OptionKeys> = {\n hover: { labelKey: 'composites.settings.dragHandle.hover.label', descriptionKey: 'composites.settings.dragHandle.hover.description' },\n always: { labelKey: 'composites.settings.dragHandle.always.label', descriptionKey: 'composites.settings.dragHandle.always.description' },\n}\n\n/** The radio items of `values`, with the label and description of each resolved through `t`. */\nexport function optionItems<T extends string>(values: readonly T[], keys: Record<T, OptionKeys>, t: Translate): { value: T, label: string, description: string }[] {\n return values.map(value => ({ value, label: t(keys[value].labelKey), description: t(keys[value].descriptionKey) }))\n}\n"],"mappings":";AAMA,MAAa,qBAAiE;CAC5E,WAAW;EAAE,UAAU;EAA6C,gBAAgB;CAAkD;CACtI,UAAU;EAAE,UAAU;EAA4C,gBAAgB;CAAiD;CACnI,SAAS;EAAE,UAAU;EAA2C,gBAAgB;CAAgD;AAClI;AAEA,MAAa,iBAAyD;CACpE,QAAQ;EAAE,UAAU;EAA6C,gBAAgB;CAAkD;CACnI,OAAO;EAAE,UAAU;EAA4C,gBAAgB;CAAiD;AAClI;AAEA,MAAa,mBAA6D;CACxE,OAAO;EAAE,UAAU;EAA8C,gBAAgB;CAAmD;CACpI,QAAQ;EAAE,UAAU;EAA+C,gBAAgB;CAAoD;AACzI;;AAGA,SAAgB,YAA8B,QAAsB,MAA6B,GAAkE;CACjK,OAAO,OAAO,KAAI,WAAU;EAAE;EAAO,OAAO,EAAE,KAAK,MAAM,CAAC,QAAQ;EAAG,aAAa,EAAE,KAAK,MAAM,CAAC,cAAc;CAAE,EAAE;AACpH"}
1
+ {"version":3,"file":"editing-settings-keys.js","names":[],"sources":["../../../src/features/composites/editing-settings-keys.ts"],"sourcesContent":["import type { MessageKey, Translate } from '../../i18n'\nimport type { BlockTypeIconVisibility, DragHandleVisibility, HeadingConversionScope } from '../../settings'\n\n/** Message keys of the labels of the „Bearbeiten“ settings radios (Vue and React); resolve them with `t`. The stored values stay the ids. */\nexport interface OptionKeys { labelKey: MessageKey, descriptionKey: MessageKey }\n\nexport const HEADING_SCOPE_KEYS: Record<HeadingConversionScope, OptionKeys> = {\n container: { labelKey: 'composites.settings.scope.container.label', descriptionKey: 'composites.settings.scope.container.description' },\n document: { labelKey: 'composites.settings.scope.document.label', descriptionKey: 'composites.settings.scope.document.description' },\n heading: { labelKey: 'composites.settings.scope.heading.label', descriptionKey: 'composites.settings.scope.heading.description' },\n}\n\nexport const BLOCK_TYPE_ICON_KEYS: Record<BlockTypeIconVisibility, OptionKeys> = {\n always: { labelKey: 'composites.settings.blockTypeIcon.always.label', descriptionKey: 'composites.settings.blockTypeIcon.always.description' },\n hover: { labelKey: 'composites.settings.blockTypeIcon.hover.label', descriptionKey: 'composites.settings.blockTypeIcon.hover.description' },\n}\n\nexport const DRAG_HANDLE_KEYS: Record<DragHandleVisibility, OptionKeys> = {\n hover: { labelKey: 'composites.settings.dragHandle.hover.label', descriptionKey: 'composites.settings.dragHandle.hover.description' },\n always: { labelKey: 'composites.settings.dragHandle.always.label', descriptionKey: 'composites.settings.dragHandle.always.description' },\n}\n\n/** The radio items of `values`, with the label and description of each resolved through `t`. */\nexport function optionItems<T extends string>(values: readonly T[], keys: Record<T, OptionKeys>, t: Translate): { value: T, label: string, description: string }[] {\n return values.map(value => ({ value, label: t(keys[value].labelKey), description: t(keys[value].descriptionKey) }))\n}\n"],"mappings":";AAMA,MAAa,qBAAiE;CAC5E,WAAW;EAAE,UAAU;EAA6C,gBAAgB;CAAkD;CACtI,UAAU;EAAE,UAAU;EAA4C,gBAAgB;CAAiD;CACnI,SAAS;EAAE,UAAU;EAA2C,gBAAgB;CAAgD;AAClI;AAEA,MAAa,uBAAoE;CAC/E,QAAQ;EAAE,UAAU;EAAkD,gBAAgB;CAAuD;CAC7I,OAAO;EAAE,UAAU;EAAiD,gBAAgB;CAAsD;AAC5I;AAEA,MAAa,mBAA6D;CACxE,OAAO;EAAE,UAAU;EAA8C,gBAAgB;CAAmD;CACpI,QAAQ;EAAE,UAAU;EAA+C,gBAAgB;CAAoD;AACzI;;AAGA,SAAgB,YAA8B,QAAsB,MAA6B,GAAkE;CACjK,OAAO,OAAO,KAAI,WAAU;EAAE;EAAO,OAAO,EAAE,KAAK,MAAM,CAAC,QAAQ;EAAG,aAAa,EAAE,KAAK,MAAM,CAAC,cAAc;CAAE,EAAE;AACpH"}
@@ -1,34 +1,34 @@
1
1
  import { EditorFeature } from "../../core/feature.js";
2
- import "../../core/index.js";
3
- import { CompositeKind } from "./kinds.js";
4
2
  import { Basket } from "./baskets.js";
3
+ import { BlockType } from "./block-types.js";
4
+ import "../../core/index.js";
5
5
  import { CompositeNodeViews } from "./node-views.js";
6
6
  //#region src/features/composites/feature.d.ts
7
7
  /** What a framework binding supplies to the composites feature. */
8
8
  export interface CompositesUi<C> {
9
9
  /** The chips on each title line and the details popover on the kind icon; mounted as an overlay. */
10
10
  chrome: C;
11
- /** The focus chip („Fokus: <Titel> · Aufheben“) shown while a Baustein is focused; mounted as an overlay. Absent: no chip (the focus mode itself works). */
11
+ /** The focus chip („Fokus: <Titel> · Aufheben“) shown while a Typed block is focused; mounted as an overlay. Absent: no chip (the focus mode itself works). */
12
12
  focusChip?: C;
13
- /** The „Bearbeiten“ settings tab; receives `{ kinds }` as props. */
13
+ /** The „Bearbeiten“ settings tab; receives `{ blockTypes }` as props. */
14
14
  settingsTab: C;
15
15
  /** The composite block view of the framework. */
16
16
  nodeViews: CompositeNodeViews;
17
17
  }
18
18
  /** Options of `compositeFeature`. */
19
19
  export interface CompositeFeatureOptions {
20
- /** The composite kinds („Bausteine“) offered in the editor, with their own labels (default: `defaultCompositeKinds(t)`, the built-in kinds in the editor's language); read once. */
21
- kinds?: readonly CompositeKind[];
22
- /** The colour baskets a Baustein can be put into (default: `defaultBaskets(t)`, red/orange/yellow/green/blue in the editor's language; colours are the `--sk-basket-<id>` CSS variables); read once. */
20
+ /** The Block types offered in the editor, with their own labels (default: `defaultBlockTypes(t)`, the built-in Block types in the editor's language); read once. */
21
+ blockTypes?: readonly BlockType[];
22
+ /** The colour baskets a Typed block can be put into (default: `defaultBaskets(t)`, red/orange/yellow/green/blue in the editor's language; colours are the `--sk-basket-<id>` CSS variables); read once. */
23
23
  baskets?: readonly Basket[];
24
24
  }
25
25
  /**
26
- * Composites („Bausteine“): the node family with its node views, the toolbar group (insert, „In Baustein umwandeln“,
26
+ * Composites (Typed blocks): the node family with its node views, the toolbar group (insert, „In Block umwandeln“,
27
27
  * „Gliederung umwandeln“), `/` commands, the conversion providers (wrap into / switch kind of / unwrap composites),
28
28
  * Markdown `:::` fences, legacy `section` migration, the preferred-structure setting and its `editing` settings tab,
29
29
  * the chips on each title line (status, tags) and the details popover on the kind icon (the binding's `chrome` overlay), focus mode on one
30
- * Baustein (`CompositeFocus`, the „Fokussieren“ block action and the binding's `focusChip` overlay), and
31
- * the AI view of kinds and structure, and the kinds' accepted children (`AcceptedChildren`: an edit that nests a Baustein
30
+ * Typed block (`CompositeFocus`, the „Fokussieren“ block action and the binding's `focusChip` overlay), and
31
+ * the AI view of Block types and structure, and the Block types' accepted children (`AcceptedChildren`: an edit that nests a Typed block
32
32
  * into one that does not accept its kind is refused with a notice). Contributes the `parseMarkdown`,
33
33
  * `structure` and `migrateContent` stages. Imports no AI, media or transcript code.
34
34
  */