@ecsplico/editor 3.6.0 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (593) hide show
  1. package/CHANGELOG.md +73 -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 -8
  268. package/dist/features/composites/merge.js +23 -22
  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 +150 -87
  374. package/dist/features/image-studio/components/ImageStudioDialog.js.map +1 -1
  375. package/dist/features/image-studio/components/ImageStudioDialog.vue.d.ts +5 -1
  376. package/dist/features/image-studio/components/ImageStudioLibraryPanel.js +186 -0
  377. package/dist/features/image-studio/components/ImageStudioLibraryPanel.js.map +1 -0
  378. package/dist/features/image-studio/components/ImageStudioLibraryTile.js +134 -0
  379. package/dist/features/image-studio/components/ImageStudioLibraryTile.js.map +1 -0
  380. package/dist/features/image-studio/components/ImageStudioView.js.map +1 -1
  381. package/dist/features/image-studio/feature.d.ts +1 -1
  382. package/dist/features/image-studio/feature.js +1 -1
  383. package/dist/features/image-studio/feature.js.map +1 -1
  384. package/dist/features/image-studio/index.d.ts +3 -2
  385. package/dist/features/image-studio/index.js +2 -2
  386. package/dist/features/image-studio/library.d.ts +35 -0
  387. package/dist/features/image-studio/node-core.d.ts +3 -3
  388. package/dist/features/image-studio/node-core.js +1 -1
  389. package/dist/features/image-studio/node-core.js.map +1 -1
  390. package/dist/features/image-studio/node-store.d.ts +1 -1
  391. package/dist/features/image-studio/node-store.js +1 -1
  392. package/dist/features/image-studio/node-store.js.map +1 -1
  393. package/dist/features/image-studio/react/ImageStudioDialog.d.ts +1 -1
  394. package/dist/features/image-studio/react/ImageStudioDialog.js +46 -5
  395. package/dist/features/image-studio/react/ImageStudioDialog.js.map +1 -1
  396. package/dist/features/image-studio/react/ImageStudioLibraryPanel.js +141 -0
  397. package/dist/features/image-studio/react/ImageStudioLibraryPanel.js.map +1 -0
  398. package/dist/features/image-studio/react/ImageStudioLibraryTile.js +105 -0
  399. package/dist/features/image-studio/react/ImageStudioLibraryTile.js.map +1 -0
  400. package/dist/features/image-studio/react/ImageStudioView.js +1 -1
  401. package/dist/features/image-studio/react/ImageStudioView.js.map +1 -1
  402. package/dist/features/image-studio/react/store.d.ts +8 -3
  403. package/dist/features/image-studio/react/store.js.map +1 -1
  404. package/dist/features/image-studio/react.d.ts +4 -3
  405. package/dist/features/image-studio/react.js +3 -3
  406. package/dist/features/image-studio/react.js.map +1 -1
  407. package/dist/features/image-studio/schema.d.ts +1 -1
  408. package/dist/features/image-studio/schema.js +1 -1
  409. package/dist/features/image-studio/schema.js.map +1 -1
  410. package/dist/features/image-studio/state.d.ts +8 -3
  411. package/dist/features/image-studio/state.js +11 -3
  412. package/dist/features/image-studio/state.js.map +1 -1
  413. package/dist/features/image-studio/store.d.ts +8 -3
  414. package/dist/features/image-studio/vue.d.ts +4 -3
  415. package/dist/features/image-studio/vue.js +3 -3
  416. package/dist/features/image-studio/vue.js.map +1 -1
  417. package/dist/features/mentions/tag.js +2 -1
  418. package/dist/features/mentions/tag.js.map +1 -1
  419. package/dist/features/themes/components/SettingsAppearanceTab.js +1 -1
  420. package/dist/features/themes/components/SettingsAppearanceTab.js.map +1 -1
  421. package/dist/features/themes/feature.d.ts +1 -1
  422. package/dist/features/themes/feature.js.map +1 -1
  423. package/dist/features/themes/react/SettingsAppearanceTab.d.ts +1 -1
  424. package/dist/features/themes/react/SettingsAppearanceTab.js +1 -1
  425. package/dist/features/themes/react/SettingsAppearanceTab.js.map +1 -1
  426. package/dist/features/themes/theme-runtime.js +1 -1
  427. package/dist/features/themes/theme-runtime.js.map +1 -1
  428. package/dist/features/transcript/TranscriptSegmentView.js +1 -1
  429. package/dist/features/transcript/TranscriptSegmentView.js.map +1 -1
  430. package/dist/features/transcript/react/TranscriptSegmentView.js +1 -1
  431. package/dist/features/transcript/react/TranscriptSegmentView.js.map +1 -1
  432. package/dist/features/transcript/segment-node.js.map +1 -1
  433. package/dist/features/transfer/feature.js +1 -1
  434. package/dist/features/transfer/feature.js.map +1 -1
  435. package/dist/features/transfer/transforms.d.ts +4 -4
  436. package/dist/features/transfer/transforms.js +12 -12
  437. package/dist/features/transfer/transforms.js.map +1 -1
  438. package/dist/i18n/de/ai.js +4 -4
  439. package/dist/i18n/de/ai.js.map +1 -1
  440. package/dist/i18n/de/authors.js +1 -1
  441. package/dist/i18n/de/authors.js.map +1 -1
  442. package/dist/i18n/de/comments.js +1 -1
  443. package/dist/i18n/de/comments.js.map +1 -1
  444. package/dist/i18n/de/composites.js +62 -59
  445. package/dist/i18n/de/composites.js.map +1 -1
  446. package/dist/i18n/de/image-studio.js +11 -2
  447. package/dist/i18n/de/image-studio.js.map +1 -1
  448. package/dist/i18n/de/integrations.js +20 -20
  449. package/dist/i18n/de/integrations.js.map +1 -1
  450. package/dist/i18n/de/markdown.js +1 -1
  451. package/dist/i18n/de/markdown.js.map +1 -1
  452. package/dist/i18n/de/palette.js +1 -1
  453. package/dist/i18n/de/palette.js.map +1 -1
  454. package/dist/i18n/de/themes.js +3 -3
  455. package/dist/i18n/de/themes.js.map +1 -1
  456. package/dist/i18n/de/transfer.js +2 -2
  457. package/dist/i18n/de/transfer.js.map +1 -1
  458. package/dist/i18n/de/tree.js +6 -6
  459. package/dist/i18n/de/tree.js.map +1 -1
  460. package/dist/i18n/de.d.ts +110 -98
  461. package/dist/i18n/en/ai.js +2 -2
  462. package/dist/i18n/en/ai.js.map +1 -1
  463. package/dist/i18n/en/composites.js +64 -61
  464. package/dist/i18n/en/composites.js.map +1 -1
  465. package/dist/i18n/en/image-studio.js +9 -0
  466. package/dist/i18n/en/image-studio.js.map +1 -1
  467. package/dist/i18n/en/integrations.js +9 -9
  468. package/dist/i18n/en/integrations.js.map +1 -1
  469. package/dist/i18n/en/markdown.js +1 -1
  470. package/dist/i18n/en/markdown.js.map +1 -1
  471. package/dist/i18n/en/palette.js +1 -1
  472. package/dist/i18n/en/palette.js.map +1 -1
  473. package/dist/i18n/en/themes.js +4 -4
  474. package/dist/i18n/en/themes.js.map +1 -1
  475. package/dist/i18n/en/tree.js +5 -5
  476. package/dist/i18n/en/tree.js.map +1 -1
  477. package/dist/index.d.ts +4 -1
  478. package/dist/integrations/composite-ai/bibliography-fetch.d.ts +6 -6
  479. package/dist/integrations/composite-ai/bibliography-fetch.js +19 -19
  480. package/dist/integrations/composite-ai/bibliography-fetch.js.map +1 -1
  481. package/dist/integrations/composite-ai/composite-fill.d.ts +4 -4
  482. package/dist/integrations/composite-ai/composite-fill.js +5 -5
  483. package/dist/integrations/composite-ai/composite-fill.js.map +1 -1
  484. package/dist/integrations/composite-ai/composite-summary.d.ts +2 -2
  485. package/dist/integrations/composite-ai/composite-summary.js +5 -5
  486. package/dist/integrations/composite-ai/composite-summary.js.map +1 -1
  487. package/dist/integrations/composite-ai/derive.d.ts +17 -17
  488. package/dist/integrations/composite-ai/derive.js +27 -26
  489. package/dist/integrations/composite-ai/derive.js.map +1 -1
  490. package/dist/integrations/composite-ai/index.d.ts +14 -15
  491. package/dist/integrations/composite-ai/index.js +98 -77
  492. package/dist/integrations/composite-ai/index.js.map +1 -1
  493. package/dist/integrations/composite-ai/outline-sanitize.d.ts +1 -1
  494. package/dist/integrations/composite-ai/outline-sanitize.js +1 -1
  495. package/dist/integrations/composite-ai/outline-sanitize.js.map +1 -1
  496. package/dist/integrations/composite-ai/rendition.d.ts +9 -9
  497. package/dist/integrations/composite-ai/rendition.js +27 -27
  498. package/dist/integrations/composite-ai/rendition.js.map +1 -1
  499. package/dist/integrations/composite-ai/split.d.ts +8 -8
  500. package/dist/integrations/composite-ai/split.js +12 -12
  501. package/dist/integrations/composite-ai/split.js.map +1 -1
  502. package/dist/integrations/composite-ai/transfer-transforms.d.ts +2 -2
  503. package/dist/integrations/composite-ai/transfer-transforms.js +11 -11
  504. package/dist/integrations/composite-ai/transfer-transforms.js.map +1 -1
  505. package/dist/integrations/composite-media/index.d.ts +4 -3
  506. package/dist/integrations/composite-media/index.js +20 -14
  507. package/dist/integrations/composite-media/index.js.map +1 -1
  508. package/dist/markdown/MarkdownSurface.vue.d.ts +7 -7
  509. package/dist/markdown/document.js +1 -1
  510. package/dist/markdown/document.js.map +1 -1
  511. package/dist/nuxt/module.d.ts +48 -24
  512. package/dist/nuxt/module.js.map +1 -1
  513. package/dist/nuxt/runtime/server/plugins/editor-server.js +3 -2
  514. package/dist/nuxt/runtime/server/plugins/editor-server.js.map +1 -1
  515. package/dist/presets/compose.d.ts +6 -6
  516. package/dist/presets/compose.js +7 -4
  517. package/dist/presets/compose.js.map +1 -1
  518. package/dist/react/AdvancedEditor.d.ts +2 -2
  519. package/dist/react/AdvancedEditor.js +1 -1
  520. package/dist/react/AdvancedEditor.js.map +1 -1
  521. package/dist/react/compose.d.ts +1 -1
  522. package/dist/react/compose.js +1 -1
  523. package/dist/react/compose.js.map +1 -1
  524. package/dist/react/composed-surface.d.ts +5 -5
  525. package/dist/react/composed-surface.js +2 -2
  526. package/dist/react/composed-surface.js.map +1 -1
  527. package/dist/server/ai.d.ts +7 -7
  528. package/dist/server/ai.js +1 -1
  529. package/dist/server/ai.js.map +1 -1
  530. package/dist/server/auth.d.ts +1 -1
  531. package/dist/server/collab-state.d.ts +1 -1
  532. package/dist/server/collab-state.js.map +1 -1
  533. package/dist/server/collab.d.ts +4 -4
  534. package/dist/server/collab.js +22 -17
  535. package/dist/server/collab.js.map +1 -1
  536. package/dist/server/handlers/ai.d.ts +9 -6
  537. package/dist/server/handlers/ai.js +13 -17
  538. package/dist/server/handlers/ai.js.map +1 -1
  539. package/dist/server/handlers/context.d.ts +4 -0
  540. package/dist/server/handlers/context.js.map +1 -1
  541. package/dist/server/handlers/editor.d.ts +33 -32
  542. package/dist/server/handlers/editor.js +13 -8
  543. package/dist/server/handlers/editor.js.map +1 -1
  544. package/dist/server/handlers/images.d.ts +1 -1
  545. package/dist/server/handlers/images.js +1 -1
  546. package/dist/server/handlers/images.js.map +1 -1
  547. package/dist/server/host.d.ts +4 -0
  548. package/dist/server/host.js +10 -2
  549. package/dist/server/host.js.map +1 -1
  550. package/dist/server/index.d.ts +3 -3
  551. package/dist/server/ports.d.ts +8 -8
  552. package/dist/server/ports.js.map +1 -1
  553. package/dist/settings/index.d.ts +20 -19
  554. package/dist/settings/index.js +25 -24
  555. package/dist/settings/index.js.map +1 -1
  556. package/dist/settings/migrate.d.ts +18 -0
  557. package/dist/settings/migrate.js +46 -0
  558. package/dist/settings/migrate.js.map +1 -0
  559. package/dist/settings/values.d.ts +12 -12
  560. package/dist/settings/values.js +11 -11
  561. package/dist/settings/values.js.map +1 -1
  562. package/dist/styles/composites.css +10 -10
  563. package/dist/tree/DocumentTree.js +12 -5
  564. package/dist/tree/DocumentTree.js.map +1 -1
  565. package/dist/tree/drop-rules.js +5 -5
  566. package/dist/tree/drop-rules.js.map +1 -1
  567. package/dist/tree/react/DocumentTree.js +14 -5
  568. package/dist/tree/react/DocumentTree.js.map +1 -1
  569. package/dist/tree/tree-host.js +5 -5
  570. package/dist/tree/tree-host.js.map +1 -1
  571. package/dist/tree/tree-items.js +34 -28
  572. package/dist/tree/tree-items.js.map +1 -1
  573. package/dist/tree/tree-model.js +16 -16
  574. package/dist/tree/tree-model.js.map +1 -1
  575. package/dist/tree/tree-rows.js +2 -2
  576. package/dist/tree/tree-rows.js.map +1 -1
  577. package/dist/tree/tree-view-model.d.ts +2 -2
  578. package/dist/tree/tree-view-model.js.map +1 -1
  579. package/dist/vue/AdvancedEditor.js +2 -2
  580. package/dist/vue/AdvancedEditor.js.map +1 -1
  581. package/dist/vue/AdvancedEditor.vue.d.ts +10 -10
  582. package/dist/vue/SimpleEditor.vue.d.ts +4 -4
  583. package/dist/vue/components/EditorSurface.vue.d.ts +4 -4
  584. package/dist/vue/compose.d.ts +1 -1
  585. package/dist/vue/compose.js +1 -1
  586. package/dist/vue/compose.js.map +1 -1
  587. package/package.json +1 -1
  588. package/dist/features/composites/derivation.d.ts +0 -62
  589. package/dist/features/composites/derivation.js +0 -102
  590. package/dist/features/composites/derivation.js.map +0 -1
  591. package/dist/features/composites/kinds.d.ts +0 -89
  592. package/dist/features/composites/kinds.js +0 -285
  593. package/dist/features/composites/kinds.js.map +0 -1
@@ -1,7 +1,7 @@
1
- import { AI_LANGUAGES, AUTHOR_COLOR_STYLES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, KIND_ICON_VISIBILITIES, MODEL_SLOTS, STRUCTURE_MODES, TREE_ROOTS } from "./values.js";
1
+ import { AI_LANGUAGES, AUTHOR_COLOR_STYLES, BLOCK_TYPE_ICON_VISIBILITIES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, MODEL_ROLES, STRUCTURE_MODES, TREE_ROOTS } from "./values.js";
2
+ import { EDITOR_SETTINGS_VERSION, isOutdatedEditorSettings, migrateEditorSettings } from "./migrate.js";
2
3
  import { z } from "zod";
3
4
  //#region src/settings/index.ts
4
- const EDITOR_SETTINGS_VERSION = 1;
5
5
  /** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */
6
6
  const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/;
7
7
  /** Bounds of `blocks.splitTargetChars`. */
@@ -13,7 +13,7 @@ function clampSplitTargetChars(typed, current) {
13
13
  return typed.trim() !== "" && Number.isFinite(value) ? Math.min(SPLIT_TARGET_CHARS_MAX, Math.max(200, value)) : current;
14
14
  }
15
15
  const EDITOR_SETTINGS_DEFAULTS = {
16
- version: 1,
16
+ version: 2,
17
17
  editing: {
18
18
  headingConversionScope: "container",
19
19
  authorColors: false,
@@ -22,14 +22,14 @@ const EDITOR_SETTINGS_DEFAULTS = {
22
22
  },
23
23
  ai: {
24
24
  autocomplete: false,
25
- slots: {},
25
+ roles: {},
26
26
  translateLanguage: "Englisch"
27
27
  },
28
28
  blocks: {
29
- defaultKind: "section",
30
- structure: "composite",
29
+ defaultBlockType: "section",
30
+ structure: "structured",
31
31
  treeRoot: "folders",
32
- kindIcon: "always",
32
+ blockTypeIcon: "always",
33
33
  dragHandle: "hover",
34
34
  splitTargetChars: 1500
35
35
  },
@@ -42,16 +42,16 @@ const commentsLayoutSchema = z.enum(COMMENTS_LAYOUTS);
42
42
  const autocompleteSchema = z.boolean();
43
43
  const profileIdSchema = z.string().min(1).max(100);
44
44
  const translateLanguageSchema = z.enum(AI_LANGUAGES);
45
- const defaultKindSchema = z.string().min(1).max(100);
45
+ const defaultBlockTypeSchema = z.string().min(1).max(100);
46
46
  const structureSchema = z.enum(STRUCTURE_MODES);
47
47
  const treeRootSchema = z.enum(TREE_ROOTS);
48
- const kindIconSchema = z.enum(KIND_ICON_VISIBILITIES);
48
+ const blockTypeIconSchema = z.enum(BLOCK_TYPE_ICON_VISIBILITIES);
49
49
  const dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES);
50
50
  const splitTargetCharsSchema = z.number().int().min(200).max(SPLIT_TARGET_CHARS_MAX);
51
51
  const themeSchema = z.string().regex(THEME_ID).nullable();
52
52
  /** Complete, valid settings (the body of `PUT /api/editor/settings`). */
53
53
  const editorSettingsSchema = z.object({
54
- version: z.literal(1),
54
+ version: z.literal(2),
55
55
  editing: z.object({
56
56
  headingConversionScope: headingConversionScopeSchema,
57
57
  authorColors: authorColorsSchema,
@@ -60,14 +60,14 @@ const editorSettingsSchema = z.object({
60
60
  }),
61
61
  ai: z.object({
62
62
  autocomplete: autocompleteSchema,
63
- slots: z.partialRecord(z.enum(MODEL_SLOTS), profileIdSchema),
63
+ roles: z.partialRecord(z.enum(MODEL_ROLES), profileIdSchema),
64
64
  translateLanguage: translateLanguageSchema
65
65
  }),
66
66
  blocks: z.object({
67
- defaultKind: defaultKindSchema,
67
+ defaultBlockType: defaultBlockTypeSchema,
68
68
  structure: structureSchema,
69
69
  treeRoot: treeRootSchema,
70
- kindIcon: kindIconSchema,
70
+ blockTypeIcon: blockTypeIconSchema,
71
71
  dragHandle: dragHandleSchema,
72
72
  splitTargetChars: splitTargetCharsSchema
73
73
  }),
@@ -81,20 +81,21 @@ function valid(schema, value, fallback) {
81
81
  return parsed.success ? parsed.data : fallback;
82
82
  }
83
83
  /**
84
- * Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Accepts the legacy flat
85
- * `{ headingConversionScope }` shape of the per-browser settings before version 1. Always returns fresh objects.
84
+ * Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Reads older stored settings
85
+ * through `migrateEditorSettings` (`./migrate`), including the legacy flat `{ headingConversionScope }` per-browser shape.
86
+ * Always returns fresh objects of the current version.
86
87
  */
87
88
  function parseEditorSettings(input) {
88
- const root = record(input);
89
+ const root = record(migrateEditorSettings(input));
89
90
  const editing = record(root.editing);
90
91
  const ai = record(root.ai);
91
- const slots = record(ai.slots);
92
+ const roles = record(ai.roles);
92
93
  const blocks = record(root.blocks);
93
94
  const appearance = record(root.appearance);
94
95
  const defaults = EDITOR_SETTINGS_DEFAULTS;
95
96
  const legacyScope = valid(headingConversionScopeSchema, root.headingConversionScope, defaults.editing.headingConversionScope);
96
97
  return {
97
- version: 1,
98
+ version: 2,
98
99
  editing: {
99
100
  headingConversionScope: valid(headingConversionScopeSchema, editing.headingConversionScope, legacyScope),
100
101
  authorColors: valid(authorColorsSchema, editing.authorColors, defaults.editing.authorColors),
@@ -103,17 +104,17 @@ function parseEditorSettings(input) {
103
104
  },
104
105
  ai: {
105
106
  autocomplete: valid(autocompleteSchema, ai.autocomplete, defaults.ai.autocomplete),
106
- slots: Object.fromEntries(MODEL_SLOTS.flatMap((slot) => {
107
- const parsed = profileIdSchema.safeParse(slots[slot]);
108
- return parsed.success ? [[slot, parsed.data]] : [];
107
+ roles: Object.fromEntries(MODEL_ROLES.flatMap((role) => {
108
+ const parsed = profileIdSchema.safeParse(roles[role]);
109
+ return parsed.success ? [[role, parsed.data]] : [];
109
110
  })),
110
111
  translateLanguage: valid(translateLanguageSchema, ai.translateLanguage, defaults.ai.translateLanguage)
111
112
  },
112
113
  blocks: {
113
- defaultKind: valid(defaultKindSchema, blocks.defaultKind, defaults.blocks.defaultKind),
114
+ defaultBlockType: valid(defaultBlockTypeSchema, blocks.defaultBlockType, defaults.blocks.defaultBlockType),
114
115
  structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),
115
116
  treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),
116
- kindIcon: valid(kindIconSchema, blocks.kindIcon, defaults.blocks.kindIcon),
117
+ blockTypeIcon: valid(blockTypeIconSchema, blocks.blockTypeIcon, defaults.blocks.blockTypeIcon),
117
118
  dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),
118
119
  splitTargetChars: valid(splitTargetCharsSchema, blocks.splitTargetChars, defaults.blocks.splitTargetChars)
119
120
  },
@@ -121,6 +122,6 @@ function parseEditorSettings(input) {
121
122
  };
122
123
  }
123
124
  //#endregion
124
- export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, EDITOR_SETTINGS_DEFAULTS, EDITOR_SETTINGS_VERSION, HEADING_CONVERSION_SCOPES, KIND_ICON_VISIBILITIES, MODEL_SLOTS, SPLIT_TARGET_CHARS_MAX, SPLIT_TARGET_CHARS_MIN, STRUCTURE_MODES, THEME_ID, TREE_ROOTS, clampSplitTargetChars, editorSettingsSchema, parseEditorSettings };
125
+ export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, BLOCK_TYPE_ICON_VISIBILITIES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, EDITOR_SETTINGS_DEFAULTS, EDITOR_SETTINGS_VERSION, HEADING_CONVERSION_SCOPES, MODEL_ROLES, SPLIT_TARGET_CHARS_MAX, SPLIT_TARGET_CHARS_MIN, STRUCTURE_MODES, THEME_ID, TREE_ROOTS, clampSplitTargetChars, editorSettingsSchema, isOutdatedEditorSettings, migrateEditorSettings, parseEditorSettings };
125
126
 
126
127
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/settings/index.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n AI_LANGUAGES,\n type AiLanguage,\n AUTHOR_COLOR_STYLES,\n type AuthorColorStyle,\n COMMENTS_LAYOUTS,\n type CommentsLayout,\n DRAG_HANDLE_VISIBILITIES,\n type DragHandleVisibility,\n HEADING_CONVERSION_SCOPES,\n type HeadingConversionScope,\n KIND_ICON_VISIBILITIES,\n type KindIconVisibility,\n MODEL_SLOTS,\n type ModelSlot,\n STRUCTURE_MODES,\n type StructureMode,\n TREE_ROOTS,\n type TreeRoot,\n} from './values'\n\nexport * from './values'\n\nexport const EDITOR_SETTINGS_VERSION = 1\n\n/** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */\nexport const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/\n\n/** A user's editor preferences, shared by all editors on the page; persisted per user through the `settings` port. */\nexport interface EditorSettings {\n version: typeof EDITOR_SETTINGS_VERSION\n editing: {\n /** Blocks „Gliederung umwandeln“ (both directions) converts when nothing is selected. */\n headingConversionScope: HeadingConversionScope\n /** Text is tinted per author (authors feature): each run in the colour of the user who wrote it. */\n authorColors: boolean\n /** `background`: tinted background; `text`: text in the author's colour. */\n authorColorStyle: AuthorColorStyle\n /** `margin`: comment cards in a column beside the text; `inline`: popover at the text plus the toolbar's list (comments feature). */\n commentsLayout: CommentsLayout\n }\n ai: {\n /** Ghost-text suggestions while typing (`GhostAutocomplete`). */\n autocomplete: boolean\n /** Model profile id per slot; a missing or unknown id falls back to the server's default preset for the slot. */\n slots: Partial<Record<ModelSlot, string>>\n /** Preselected target language of „Übersetzen“. */\n translateLanguage: AiLanguage\n }\n blocks: {\n /** Composite kind id the „Baustein“ shortcuts create (toolbar button, heading conversion). */\n defaultKind: string\n /** Preferred document structure: toolbar block types and the structure of AI-generated blocks. */\n structure: StructureMode\n /** Root of the document drawer while a composite file is loaded: nested in the folders, or the file itself. */\n treeRoot: TreeRoot\n /** Kind icon of composites (their drag handle): always visible, or only on hover, focus or while the details are open. */\n kindIcon: KindIconVisibility\n /** Standard drag handle of blocks without kind icon: on the hovered block, or permanently beside every block. */\n dragHandle: DragHandleVisibility\n /** Target size in characters of the parts a length split cuts a Baustein into (200–20000). */\n splitTargetChars: number\n }\n appearance: {\n /** Id of the Obsidian theme applied to the whole app (themes feature); `null` = the standard Nuxt UI look. */\n theme: string | null\n }\n}\n\n/** Bounds of `blocks.splitTargetChars`. */\nexport const SPLIT_TARGET_CHARS_MIN = 200\nexport const SPLIT_TARGET_CHARS_MAX = 20000\n\n/** The split target typed into the field as a valid setting: rounded and clamped to its bounds; `current` when `typed` is empty or not a number. */\nexport function clampSplitTargetChars(typed: string, current: number): number {\n const value = Math.round(Number(typed))\n return typed.trim() !== '' && Number.isFinite(value) ? Math.min(SPLIT_TARGET_CHARS_MAX, Math.max(SPLIT_TARGET_CHARS_MIN, value)) : current\n}\n\nexport const EDITOR_SETTINGS_DEFAULTS: EditorSettings = {\n version: EDITOR_SETTINGS_VERSION,\n editing: { headingConversionScope: 'container', authorColors: false, authorColorStyle: 'background', commentsLayout: 'margin' },\n ai: { autocomplete: false, slots: {}, translateLanguage: 'Englisch' },\n blocks: { defaultKind: 'section', structure: 'composite', treeRoot: 'folders', kindIcon: 'always', dragHandle: 'hover', splitTargetChars: 1500 },\n appearance: { theme: null },\n}\n\nconst headingConversionScopeSchema = z.enum(HEADING_CONVERSION_SCOPES)\nconst authorColorsSchema = z.boolean()\nconst authorColorStyleSchema = z.enum(AUTHOR_COLOR_STYLES)\nconst commentsLayoutSchema = z.enum(COMMENTS_LAYOUTS)\nconst autocompleteSchema = z.boolean()\nconst profileIdSchema = z.string().min(1).max(100)\nconst translateLanguageSchema = z.enum(AI_LANGUAGES)\nconst defaultKindSchema = z.string().min(1).max(100)\nconst structureSchema = z.enum(STRUCTURE_MODES)\nconst treeRootSchema = z.enum(TREE_ROOTS)\nconst kindIconSchema = z.enum(KIND_ICON_VISIBILITIES)\nconst dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES)\nconst splitTargetCharsSchema = z.number().int().min(SPLIT_TARGET_CHARS_MIN).max(SPLIT_TARGET_CHARS_MAX)\nconst themeSchema = z.string().regex(THEME_ID).nullable()\n\n/** Complete, valid settings (the body of `PUT /api/editor/settings`). */\nexport const editorSettingsSchema = z.object({\n version: z.literal(EDITOR_SETTINGS_VERSION),\n editing: z.object({\n headingConversionScope: headingConversionScopeSchema,\n authorColors: authorColorsSchema,\n authorColorStyle: authorColorStyleSchema,\n commentsLayout: commentsLayoutSchema,\n }),\n ai: z.object({\n autocomplete: autocompleteSchema,\n slots: z.partialRecord(z.enum(MODEL_SLOTS), profileIdSchema),\n translateLanguage: translateLanguageSchema,\n }),\n blocks: z.object({\n defaultKind: defaultKindSchema,\n structure: structureSchema,\n treeRoot: treeRootSchema,\n kindIcon: kindIconSchema,\n dragHandle: dragHandleSchema,\n splitTargetChars: splitTargetCharsSchema,\n }),\n appearance: z.object({ theme: themeSchema }),\n}) satisfies z.ZodType<EditorSettings>\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction valid<T>(schema: z.ZodType<T>, value: unknown, fallback: T): T {\n const parsed = schema.safeParse(value)\n return parsed.success ? parsed.data : fallback\n}\n\n/**\n * Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Accepts the legacy flat\n * `{ headingConversionScope }` shape of the per-browser settings before version 1. Always returns fresh objects.\n */\nexport function parseEditorSettings(input: unknown): EditorSettings {\n const root = record(input)\n const editing = record(root.editing)\n const ai = record(root.ai)\n const slots = record(ai.slots)\n const blocks = record(root.blocks)\n const appearance = record(root.appearance)\n const defaults = EDITOR_SETTINGS_DEFAULTS\n const legacyScope = valid(headingConversionScopeSchema, root.headingConversionScope, defaults.editing.headingConversionScope)\n return {\n version: EDITOR_SETTINGS_VERSION,\n editing: {\n headingConversionScope: valid(headingConversionScopeSchema, editing.headingConversionScope, legacyScope),\n authorColors: valid(authorColorsSchema, editing.authorColors, defaults.editing.authorColors),\n authorColorStyle: valid(authorColorStyleSchema, editing.authorColorStyle, defaults.editing.authorColorStyle),\n commentsLayout: valid(commentsLayoutSchema, editing.commentsLayout, defaults.editing.commentsLayout),\n },\n ai: {\n autocomplete: valid(autocompleteSchema, ai.autocomplete, defaults.ai.autocomplete),\n slots: Object.fromEntries(MODEL_SLOTS.flatMap((slot) => {\n const parsed = profileIdSchema.safeParse(slots[slot])\n return parsed.success ? [[slot, parsed.data]] : []\n })),\n translateLanguage: valid(translateLanguageSchema, ai.translateLanguage, defaults.ai.translateLanguage),\n },\n blocks: {\n defaultKind: valid(defaultKindSchema, blocks.defaultKind, defaults.blocks.defaultKind),\n structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),\n treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),\n kindIcon: valid(kindIconSchema, blocks.kindIcon, defaults.blocks.kindIcon),\n dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),\n splitTargetChars: valid(splitTargetCharsSchema, blocks.splitTargetChars, defaults.blocks.splitTargetChars),\n },\n appearance: {\n theme: valid(themeSchema, appearance.theme, defaults.appearance.theme),\n },\n }\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/settings/index.ts"],"sourcesContent":["import { z } from 'zod'\nimport {\n AI_LANGUAGES,\n type AiLanguage,\n AUTHOR_COLOR_STYLES,\n type AuthorColorStyle,\n BLOCK_TYPE_ICON_VISIBILITIES,\n type BlockTypeIconVisibility,\n COMMENTS_LAYOUTS,\n type CommentsLayout,\n DRAG_HANDLE_VISIBILITIES,\n type DragHandleVisibility,\n HEADING_CONVERSION_SCOPES,\n type HeadingConversionScope,\n MODEL_ROLES,\n type ModelRole,\n STRUCTURE_MODES,\n type StructureMode,\n TREE_ROOTS,\n type TreeRoot,\n} from './values'\nimport { EDITOR_SETTINGS_VERSION, migrateEditorSettings } from './migrate'\n\nexport * from './values'\nexport { EDITOR_SETTINGS_VERSION, isOutdatedEditorSettings, migrateEditorSettings } from './migrate'\n\n/** Valid theme id: lowercase slug, used as directory name and in `/api/editor/themes/:id`. Defined here so core never imports a feature. */\nexport const THEME_ID = /^[a-z0-9][a-z0-9-]{0,63}$/\n\n/** A user's editor preferences, shared by all editors on the page; persisted per user through the `settings` port. */\nexport interface EditorSettings {\n version: typeof EDITOR_SETTINGS_VERSION\n editing: {\n /** Blocks „Gliederung umwandeln“ (both directions) converts when nothing is selected. */\n headingConversionScope: HeadingConversionScope\n /** Text is tinted per author (authors feature): each run in the colour of the user who wrote it. */\n authorColors: boolean\n /** `background`: tinted background; `text`: text in the author's colour. */\n authorColorStyle: AuthorColorStyle\n /** `margin`: comment cards in a column beside the text; `inline`: popover at the text plus the toolbar's list (comments feature). */\n commentsLayout: CommentsLayout\n }\n ai: {\n /** Ghost-text suggestions while typing (`GhostAutocomplete`). */\n autocomplete: boolean\n /** Model profile id per model role; a missing or unknown id falls back to the server's default preset for the role. */\n roles: Partial<Record<ModelRole, string>>\n /** Preselected target language of „Übersetzen“. */\n translateLanguage: AiLanguage\n }\n blocks: {\n /** Block type id the Typed block shortcuts create (toolbar button, heading conversion). */\n defaultBlockType: string\n /** Preferred document structure: toolbar block types and the structure of AI-generated blocks. */\n structure: StructureMode\n /** Root of the document drawer while a Document with Typed blocks is loaded: nested in the folders, or the file itself. */\n treeRoot: TreeRoot\n /** Block type icon of Typed blocks (their drag handle): always visible, or only on hover, focus or while the details are open. */\n blockTypeIcon: BlockTypeIconVisibility\n /** Standard drag handle of blocks without Block type icon: on the hovered block, or permanently beside every block. */\n dragHandle: DragHandleVisibility\n /** Target size in characters of the parts a length split cuts a Typed block into (200–20000). */\n splitTargetChars: number\n }\n appearance: {\n /** Id of the Obsidian theme applied to the whole app (themes feature); `null` = the standard Nuxt UI look. */\n theme: string | null\n }\n}\n\n/** Bounds of `blocks.splitTargetChars`. */\nexport const SPLIT_TARGET_CHARS_MIN = 200\nexport const SPLIT_TARGET_CHARS_MAX = 20000\n\n/** The split target typed into the field as a valid setting: rounded and clamped to its bounds; `current` when `typed` is empty or not a number. */\nexport function clampSplitTargetChars(typed: string, current: number): number {\n const value = Math.round(Number(typed))\n return typed.trim() !== '' && Number.isFinite(value) ? Math.min(SPLIT_TARGET_CHARS_MAX, Math.max(SPLIT_TARGET_CHARS_MIN, value)) : current\n}\n\nexport const EDITOR_SETTINGS_DEFAULTS: EditorSettings = {\n version: EDITOR_SETTINGS_VERSION,\n editing: { headingConversionScope: 'container', authorColors: false, authorColorStyle: 'background', commentsLayout: 'margin' },\n ai: { autocomplete: false, roles: {}, translateLanguage: 'Englisch' },\n blocks: { defaultBlockType: 'section', structure: 'structured', treeRoot: 'folders', blockTypeIcon: 'always', dragHandle: 'hover', splitTargetChars: 1500 },\n appearance: { theme: null },\n}\n\nconst headingConversionScopeSchema = z.enum(HEADING_CONVERSION_SCOPES)\nconst authorColorsSchema = z.boolean()\nconst authorColorStyleSchema = z.enum(AUTHOR_COLOR_STYLES)\nconst commentsLayoutSchema = z.enum(COMMENTS_LAYOUTS)\nconst autocompleteSchema = z.boolean()\nconst profileIdSchema = z.string().min(1).max(100)\nconst translateLanguageSchema = z.enum(AI_LANGUAGES)\nconst defaultBlockTypeSchema = z.string().min(1).max(100)\nconst structureSchema = z.enum(STRUCTURE_MODES)\nconst treeRootSchema = z.enum(TREE_ROOTS)\nconst blockTypeIconSchema = z.enum(BLOCK_TYPE_ICON_VISIBILITIES)\nconst dragHandleSchema = z.enum(DRAG_HANDLE_VISIBILITIES)\nconst splitTargetCharsSchema = z.number().int().min(SPLIT_TARGET_CHARS_MIN).max(SPLIT_TARGET_CHARS_MAX)\nconst themeSchema = z.string().regex(THEME_ID).nullable()\n\n/** Complete, valid settings (the body of `PUT /api/editor/settings`). */\nexport const editorSettingsSchema = z.object({\n version: z.literal(EDITOR_SETTINGS_VERSION),\n editing: z.object({\n headingConversionScope: headingConversionScopeSchema,\n authorColors: authorColorsSchema,\n authorColorStyle: authorColorStyleSchema,\n commentsLayout: commentsLayoutSchema,\n }),\n ai: z.object({\n autocomplete: autocompleteSchema,\n roles: z.partialRecord(z.enum(MODEL_ROLES), profileIdSchema),\n translateLanguage: translateLanguageSchema,\n }),\n blocks: z.object({\n defaultBlockType: defaultBlockTypeSchema,\n structure: structureSchema,\n treeRoot: treeRootSchema,\n blockTypeIcon: blockTypeIconSchema,\n dragHandle: dragHandleSchema,\n splitTargetChars: splitTargetCharsSchema,\n }),\n appearance: z.object({ theme: themeSchema }),\n}) satisfies z.ZodType<EditorSettings>\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\nfunction valid<T>(schema: z.ZodType<T>, value: unknown, fallback: T): T {\n const parsed = schema.safeParse(value)\n return parsed.success ? parsed.data : fallback\n}\n\n/**\n * Deep-merges unknown input over the defaults; unknown keys dropped, invalid values replaced. Reads older stored settings\n * through `migrateEditorSettings` (`./migrate`), including the legacy flat `{ headingConversionScope }` per-browser shape.\n * Always returns fresh objects of the current version.\n */\nexport function parseEditorSettings(input: unknown): EditorSettings {\n const root = record(migrateEditorSettings(input))\n const editing = record(root.editing)\n const ai = record(root.ai)\n const roles = record(ai.roles)\n const blocks = record(root.blocks)\n const appearance = record(root.appearance)\n const defaults = EDITOR_SETTINGS_DEFAULTS\n const legacyScope = valid(headingConversionScopeSchema, root.headingConversionScope, defaults.editing.headingConversionScope)\n return {\n version: EDITOR_SETTINGS_VERSION,\n editing: {\n headingConversionScope: valid(headingConversionScopeSchema, editing.headingConversionScope, legacyScope),\n authorColors: valid(authorColorsSchema, editing.authorColors, defaults.editing.authorColors),\n authorColorStyle: valid(authorColorStyleSchema, editing.authorColorStyle, defaults.editing.authorColorStyle),\n commentsLayout: valid(commentsLayoutSchema, editing.commentsLayout, defaults.editing.commentsLayout),\n },\n ai: {\n autocomplete: valid(autocompleteSchema, ai.autocomplete, defaults.ai.autocomplete),\n roles: Object.fromEntries(MODEL_ROLES.flatMap((role) => {\n const parsed = profileIdSchema.safeParse(roles[role])\n return parsed.success ? [[role, parsed.data]] : []\n })),\n translateLanguage: valid(translateLanguageSchema, ai.translateLanguage, defaults.ai.translateLanguage),\n },\n blocks: {\n defaultBlockType: valid(defaultBlockTypeSchema, blocks.defaultBlockType, defaults.blocks.defaultBlockType),\n structure: valid(structureSchema, blocks.structure, defaults.blocks.structure),\n treeRoot: valid(treeRootSchema, blocks.treeRoot, defaults.blocks.treeRoot),\n blockTypeIcon: valid(blockTypeIconSchema, blocks.blockTypeIcon, defaults.blocks.blockTypeIcon),\n dragHandle: valid(dragHandleSchema, blocks.dragHandle, defaults.blocks.dragHandle),\n splitTargetChars: valid(splitTargetCharsSchema, blocks.splitTargetChars, defaults.blocks.splitTargetChars),\n },\n appearance: {\n theme: valid(themeSchema, appearance.theme, defaults.appearance.theme),\n },\n }\n}\n"],"mappings":"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"}
@@ -0,0 +1,18 @@
1
+ //#region src/settings/migrate.d.ts
2
+ /**
3
+ * Version 2 renamed `ai.slots` to `ai.roles`, `blocks.defaultKind` to `blocks.defaultBlockType`, `blocks.kindIcon` to
4
+ * `blocks.blockTypeIcon` and the `blocks.structure` value `'composite'` to `'structured'` (`migrateEditorSettings`).
5
+ */
6
+ export declare const EDITOR_SETTINGS_VERSION = 2;
7
+ /**
8
+ * Maps stored settings of version 1 (and the unversioned flat per-browser shape before it) to version 2: `ai.slots` →
9
+ * `ai.roles`, `blocks.defaultKind` → `blocks.defaultBlockType`, `blocks.kindIcon` → `blocks.blockTypeIcon`, the
10
+ * `blocks.structure` value `'composite'` → `'structured'`. A key that is already new wins over the old one; unknown keys
11
+ * and values pass through (`parseEditorSettings` validates). Input of version 2 or later, and anything that is not an
12
+ * object, is returned as it is, so the migration is idempotent. Never mutates `input`.
13
+ */
14
+ export declare function migrateEditorSettings(input: unknown): unknown;
15
+ /** True when `stored` is a settings record older than `EDITOR_SETTINGS_VERSION`: it is written back once, migrated (`migrateEditorSettings`). */
16
+ export declare function isOutdatedEditorSettings(stored: unknown): boolean;
17
+ //#endregion
18
+ //# sourceMappingURL=migrate.d.ts.map
@@ -0,0 +1,46 @@
1
+ //#region src/settings/migrate.ts
2
+ /**
3
+ * Version 2 renamed `ai.slots` to `ai.roles`, `blocks.defaultKind` to `blocks.defaultBlockType`, `blocks.kindIcon` to
4
+ * `blocks.blockTypeIcon` and the `blocks.structure` value `'composite'` to `'structured'` (`migrateEditorSettings`).
5
+ */
6
+ const EDITOR_SETTINGS_VERSION = 2;
7
+ function record(value) {
8
+ return value && typeof value === "object" && !Array.isArray(value) ? value : {};
9
+ }
10
+ /**
11
+ * Maps stored settings of version 1 (and the unversioned flat per-browser shape before it) to version 2: `ai.slots` →
12
+ * `ai.roles`, `blocks.defaultKind` → `blocks.defaultBlockType`, `blocks.kindIcon` → `blocks.blockTypeIcon`, the
13
+ * `blocks.structure` value `'composite'` → `'structured'`. A key that is already new wins over the old one; unknown keys
14
+ * and values pass through (`parseEditorSettings` validates). Input of version 2 or later, and anything that is not an
15
+ * object, is returned as it is, so the migration is idempotent. Never mutates `input`.
16
+ */
17
+ function migrateEditorSettings(input) {
18
+ const root = record(input);
19
+ if (root !== input || typeof root.version === "number" && root.version >= 2) return input;
20
+ const { slots, ...ai } = record(root.ai);
21
+ const { defaultKind, kindIcon, ...blocks } = record(root.blocks);
22
+ const migrated = {
23
+ ...root,
24
+ version: 2
25
+ };
26
+ if ("ai" in root) migrated.ai = {
27
+ ...slots !== void 0 && { roles: slots },
28
+ ...ai
29
+ };
30
+ if ("blocks" in root) migrated.blocks = {
31
+ ...defaultKind !== void 0 && { defaultBlockType: defaultKind },
32
+ ...kindIcon !== void 0 && { blockTypeIcon: kindIcon },
33
+ ...blocks,
34
+ ...blocks.structure === "composite" && { structure: "structured" }
35
+ };
36
+ return migrated;
37
+ }
38
+ /** True when `stored` is a settings record older than `EDITOR_SETTINGS_VERSION`: it is written back once, migrated (`migrateEditorSettings`). */
39
+ function isOutdatedEditorSettings(stored) {
40
+ const { version } = record(stored);
41
+ return typeof version !== "number" || version < 2;
42
+ }
43
+ //#endregion
44
+ export { EDITOR_SETTINGS_VERSION, isOutdatedEditorSettings, migrateEditorSettings };
45
+
46
+ //# sourceMappingURL=migrate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate.js","names":[],"sources":["../../src/settings/migrate.ts"],"sourcesContent":["// Read-time migration of stored editor settings: the only place outside tests and `core/schema/persisted-names.ts` that\n// still names the settings keys of version 1 (the legacy-names check exempts this file).\n\n/**\n * Version 2 renamed `ai.slots` to `ai.roles`, `blocks.defaultKind` to `blocks.defaultBlockType`, `blocks.kindIcon` to\n * `blocks.blockTypeIcon` and the `blocks.structure` value `'composite'` to `'structured'` (`migrateEditorSettings`).\n */\nexport const EDITOR_SETTINGS_VERSION = 2\n\nfunction record(value: unknown): Record<string, unknown> {\n return value && typeof value === 'object' && !Array.isArray(value) ? value as Record<string, unknown> : {}\n}\n\n/**\n * Maps stored settings of version 1 (and the unversioned flat per-browser shape before it) to version 2: `ai.slots` →\n * `ai.roles`, `blocks.defaultKind` → `blocks.defaultBlockType`, `blocks.kindIcon` → `blocks.blockTypeIcon`, the\n * `blocks.structure` value `'composite'` → `'structured'`. A key that is already new wins over the old one; unknown keys\n * and values pass through (`parseEditorSettings` validates). Input of version 2 or later, and anything that is not an\n * object, is returned as it is, so the migration is idempotent. Never mutates `input`.\n */\nexport function migrateEditorSettings(input: unknown): unknown {\n const root = record(input)\n if (root !== input || (typeof root.version === 'number' && root.version >= EDITOR_SETTINGS_VERSION)) return input\n const { slots, ...ai } = record(root.ai)\n const { defaultKind, kindIcon, ...blocks } = record(root.blocks)\n const migrated: Record<string, unknown> = { ...root, version: EDITOR_SETTINGS_VERSION }\n if ('ai' in root) migrated.ai = { ...(slots !== undefined && { roles: slots }), ...ai }\n if ('blocks' in root) {\n migrated.blocks = {\n ...(defaultKind !== undefined && { defaultBlockType: defaultKind }),\n ...(kindIcon !== undefined && { blockTypeIcon: kindIcon }),\n ...blocks,\n ...(blocks.structure === 'composite' && { structure: 'structured' }),\n }\n }\n return migrated\n}\n\n/** True when `stored` is a settings record older than `EDITOR_SETTINGS_VERSION`: it is written back once, migrated (`migrateEditorSettings`). */\nexport function isOutdatedEditorSettings(stored: unknown): boolean {\n const { version } = record(stored)\n return typeof version !== 'number' || version < EDITOR_SETTINGS_VERSION\n}\n"],"mappings":";;;;;AAOA,MAAa,0BAA0B;AAEvC,SAAS,OAAO,OAAyC;CACvD,OAAO,SAAS,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IAAI,QAAmC,CAAC;AAC3G;;;;;;;;AASA,SAAgB,sBAAsB,OAAyB;CAC7D,MAAM,OAAO,OAAO,KAAK;CACzB,IAAI,SAAS,SAAU,OAAO,KAAK,YAAY,YAAY,KAAK,WAAA,GAAqC,OAAO;CAC5G,MAAM,EAAE,OAAO,GAAG,OAAO,OAAO,KAAK,EAAE;CACvC,MAAM,EAAE,aAAa,UAAU,GAAG,WAAW,OAAO,KAAK,MAAM;CAC/D,MAAM,WAAoC;EAAE,GAAG;EAAM,SAAA;CAAiC;CACtF,IAAI,QAAQ,MAAM,SAAS,KAAK;EAAE,GAAI,UAAU,KAAA,KAAa,EAAE,OAAO,MAAM;EAAI,GAAG;CAAG;CACtF,IAAI,YAAY,MACd,SAAS,SAAS;EAChB,GAAI,gBAAgB,KAAA,KAAa,EAAE,kBAAkB,YAAY;EACjE,GAAI,aAAa,KAAA,KAAa,EAAE,eAAe,SAAS;EACxD,GAAG;EACH,GAAI,OAAO,cAAc,eAAe,EAAE,WAAW,aAAa;CACpE;CAEF,OAAO;AACT;;AAGA,SAAgB,yBAAyB,QAA0B;CACjE,MAAM,EAAE,YAAY,OAAO,MAAM;CACjC,OAAO,OAAO,YAAY,YAAY,UAAA;AACxC"}
@@ -1,28 +1,28 @@
1
1
  //#region src/settings/values.d.ts
2
- /** Feature slots a model profile can be assigned to. */
3
- export declare const MODEL_SLOTS: readonly ["complete", "rewrite", "generate"];
4
- export type ModelSlot = typeof MODEL_SLOTS[number];
2
+ /** Model roles (stored under `ai.roles`): what a model profile can be assigned to; each role is one AI function. */
3
+ export declare const MODEL_ROLES: readonly ["complete", "rewrite", "generate"];
4
+ export type ModelRole = typeof MODEL_ROLES[number];
5
5
  /** Target languages of the `translate` task: the stored ids, also the language name the model is asked for; displayed through the catalogs. */
6
6
  export declare const AI_LANGUAGES: readonly ["Deutsch", "Englisch", "Französisch", "Spanisch", "Italienisch"];
7
7
  export type AiLanguage = (typeof AI_LANGUAGES)[number];
8
8
  export declare const HEADING_CONVERSION_SCOPES: readonly ["container", "document", "heading"];
9
9
  /** Blocks converted when nothing is selected: the caret's composite body / document, the whole document, or the caret's heading with its content. */
10
10
  export type HeadingConversionScope = (typeof HEADING_CONVERSION_SCOPES)[number];
11
- /** How a user prefers documents structured: Markdown headings, or nested composites („Bausteine“). */
12
- export declare const STRUCTURE_MODES: readonly ["flat", "composite"];
11
+ /** How a user prefers documents structured: Markdown headings (Flat mode), or nested Typed blocks (Structure mode). */
12
+ export declare const STRUCTURE_MODES: readonly ["flat", "structured"];
13
13
  export type StructureMode = (typeof STRUCTURE_MODES)[number];
14
14
  /**
15
- * What the document drawer's tree is rooted in while a composite file (a document with Bausteine) is loaded:
15
+ * What the document drawer's tree is rooted in while a Document with Typed blocks is loaded:
16
16
  * `folders` nests files in the store's folders (the file is one entry of the folder tree), `file` makes the loaded
17
- * file itself the single root, with its Ordner/Dokument composites as the hierarchy below. Without a loaded composite
18
- * file the drawer always shows the folders.
17
+ * file itself the single root, with its Ordner/Dokument Typed blocks as the hierarchy below. Without a loaded Document with Typed blocks
18
+ * the drawer always shows the folders.
19
19
  */
20
20
  export declare const TREE_ROOTS: readonly ["folders", "file"];
21
21
  export type TreeRoot = (typeof TREE_ROOTS)[number];
22
- /** When a composite shows its kind icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */
23
- export declare const KIND_ICON_VISIBILITIES: readonly ["always", "hover"];
24
- export type KindIconVisibility = (typeof KIND_ICON_VISIBILITIES)[number];
25
- /** When the standard drag handle of blocks without kind icon shows: on the hovered block, or permanently beside every block. */
22
+ /** When a Typed block shows its Block type icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */
23
+ export declare const BLOCK_TYPE_ICON_VISIBILITIES: readonly ["always", "hover"];
24
+ export type BlockTypeIconVisibility = (typeof BLOCK_TYPE_ICON_VISIBILITIES)[number];
25
+ /** When the standard drag handle of blocks without Block type icon shows: on the hovered block, or permanently beside every block. */
26
26
  export declare const DRAG_HANDLE_VISIBILITIES: readonly ["hover", "always"];
27
27
  export type DragHandleVisibility = (typeof DRAG_HANDLE_VISIBILITIES)[number];
28
28
  /** How the author colouring mode shows a run's author (authors feature): tinted background or coloured text. */
@@ -1,6 +1,6 @@
1
1
  //#region src/settings/values.ts
2
- /** Feature slots a model profile can be assigned to. */
3
- const MODEL_SLOTS = [
2
+ /** Model roles (stored under `ai.roles`): what a model profile can be assigned to; each role is one AI function. */
3
+ const MODEL_ROLES = [
4
4
  "complete",
5
5
  "rewrite",
6
6
  "generate"
@@ -18,24 +18,24 @@ const HEADING_CONVERSION_SCOPES = [
18
18
  "document",
19
19
  "heading"
20
20
  ];
21
- /** How a user prefers documents structured: Markdown headings, or nested composites („Bausteine“). */
22
- const STRUCTURE_MODES = ["flat", "composite"];
21
+ /** How a user prefers documents structured: Markdown headings (Flat mode), or nested Typed blocks (Structure mode). */
22
+ const STRUCTURE_MODES = ["flat", "structured"];
23
23
  /**
24
- * What the document drawer's tree is rooted in while a composite file (a document with Bausteine) is loaded:
24
+ * What the document drawer's tree is rooted in while a Document with Typed blocks is loaded:
25
25
  * `folders` nests files in the store's folders (the file is one entry of the folder tree), `file` makes the loaded
26
- * file itself the single root, with its Ordner/Dokument composites as the hierarchy below. Without a loaded composite
27
- * file the drawer always shows the folders.
26
+ * file itself the single root, with its Ordner/Dokument Typed blocks as the hierarchy below. Without a loaded Document with Typed blocks
27
+ * the drawer always shows the folders.
28
28
  */
29
29
  const TREE_ROOTS = ["folders", "file"];
30
- /** When a composite shows its kind icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */
31
- const KIND_ICON_VISIBILITIES = ["always", "hover"];
32
- /** When the standard drag handle of blocks without kind icon shows: on the hovered block, or permanently beside every block. */
30
+ /** When a Typed block shows its Block type icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */
31
+ const BLOCK_TYPE_ICON_VISIBILITIES = ["always", "hover"];
32
+ /** When the standard drag handle of blocks without Block type icon shows: on the hovered block, or permanently beside every block. */
33
33
  const DRAG_HANDLE_VISIBILITIES = ["hover", "always"];
34
34
  /** How the author colouring mode shows a run's author (authors feature): tinted background or coloured text. */
35
35
  const AUTHOR_COLOR_STYLES = ["background", "text"];
36
36
  /** How a user wants comments shown (comments feature): cards in a margin column beside the text, or a popover at the text with a list in the toolbar. */
37
37
  const COMMENTS_LAYOUTS = ["margin", "inline"];
38
38
  //#endregion
39
- export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, KIND_ICON_VISIBILITIES, MODEL_SLOTS, STRUCTURE_MODES, TREE_ROOTS };
39
+ export { AI_LANGUAGES, AUTHOR_COLOR_STYLES, BLOCK_TYPE_ICON_VISIBILITIES, COMMENTS_LAYOUTS, DRAG_HANDLE_VISIBILITIES, HEADING_CONVERSION_SCOPES, MODEL_ROLES, STRUCTURE_MODES, TREE_ROOTS };
40
40
 
41
41
  //# sourceMappingURL=values.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"values.js","names":[],"sources":["../../src/settings/values.ts"],"sourcesContent":["// Inert enum values of the stored settings model. Vue-free and free of feature code: the settings schema imports only\n// this file, features import their values from here. Their presence does not install any feature.\n\n/** Feature slots a model profile can be assigned to. */\nexport const MODEL_SLOTS = ['complete', 'rewrite', 'generate'] as const\nexport type ModelSlot = typeof MODEL_SLOTS[number]\n\n/** Target languages of the `translate` task: the stored ids, also the language name the model is asked for; displayed through the catalogs. */\n// i18n-ignore: stored setting ids, not display text\nexport const AI_LANGUAGES = ['Deutsch', 'Englisch', 'Französisch', 'Spanisch', 'Italienisch'] as const\nexport type AiLanguage = (typeof AI_LANGUAGES)[number]\n\nexport const HEADING_CONVERSION_SCOPES = ['container', 'document', 'heading'] as const\n/** Blocks converted when nothing is selected: the caret's composite body / document, the whole document, or the caret's heading with its content. */\nexport type HeadingConversionScope = (typeof HEADING_CONVERSION_SCOPES)[number]\n\n/** How a user prefers documents structured: Markdown headings, or nested composites („Bausteine“). */\nexport const STRUCTURE_MODES = ['flat', 'composite'] as const\nexport type StructureMode = (typeof STRUCTURE_MODES)[number]\n\n/**\n * What the document drawer's tree is rooted in while a composite file (a document with Bausteine) is loaded:\n * `folders` nests files in the store's folders (the file is one entry of the folder tree), `file` makes the loaded\n * file itself the single root, with its Ordner/Dokument composites as the hierarchy below. Without a loaded composite\n * file the drawer always shows the folders.\n */\nexport const TREE_ROOTS = ['folders', 'file'] as const\nexport type TreeRoot = (typeof TREE_ROOTS)[number]\n\n/** When a composite shows its kind icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */\nexport const KIND_ICON_VISIBILITIES = ['always', 'hover'] as const\nexport type KindIconVisibility = (typeof KIND_ICON_VISIBILITIES)[number]\n\n/** When the standard drag handle of blocks without kind icon shows: on the hovered block, or permanently beside every block. */\nexport const DRAG_HANDLE_VISIBILITIES = ['hover', 'always'] as const\nexport type DragHandleVisibility = (typeof DRAG_HANDLE_VISIBILITIES)[number]\n\n/** How the author colouring mode shows a run's author (authors feature): tinted background or coloured text. */\nexport const AUTHOR_COLOR_STYLES = ['background', 'text'] as const\nexport type AuthorColorStyle = (typeof AUTHOR_COLOR_STYLES)[number]\n\n/** How a user wants comments shown (comments feature): cards in a margin column beside the text, or a popover at the text with a list in the toolbar. */\nexport const COMMENTS_LAYOUTS = ['margin', 'inline'] as const\nexport type CommentsLayout = (typeof COMMENTS_LAYOUTS)[number]\n"],"mappings":";;AAIA,MAAa,cAAc;CAAC;CAAY;CAAW;AAAU;;AAK7D,MAAa,eAAe;CAAC;CAAW;CAAY;CAAe;CAAY;AAAa;AAG5F,MAAa,4BAA4B;CAAC;CAAa;CAAY;AAAS;;AAK5E,MAAa,kBAAkB,CAAC,QAAQ,WAAW;;;;;;;AASnD,MAAa,aAAa,CAAC,WAAW,MAAM;;AAI5C,MAAa,yBAAyB,CAAC,UAAU,OAAO;;AAIxD,MAAa,2BAA2B,CAAC,SAAS,QAAQ;;AAI1D,MAAa,sBAAsB,CAAC,cAAc,MAAM;;AAIxD,MAAa,mBAAmB,CAAC,UAAU,QAAQ"}
1
+ {"version":3,"file":"values.js","names":[],"sources":["../../src/settings/values.ts"],"sourcesContent":["// Inert enum values of the stored settings model. Vue-free and free of feature code: the settings schema imports only\n// this file, features import their values from here. Their presence does not install any feature.\n\n/** Model roles (stored under `ai.roles`): what a model profile can be assigned to; each role is one AI function. */\nexport const MODEL_ROLES = ['complete', 'rewrite', 'generate'] as const\nexport type ModelRole = typeof MODEL_ROLES[number]\n\n/** Target languages of the `translate` task: the stored ids, also the language name the model is asked for; displayed through the catalogs. */\n// i18n-ignore: stored setting ids, not display text\nexport const AI_LANGUAGES = ['Deutsch', 'Englisch', 'Französisch', 'Spanisch', 'Italienisch'] as const\nexport type AiLanguage = (typeof AI_LANGUAGES)[number]\n\nexport const HEADING_CONVERSION_SCOPES = ['container', 'document', 'heading'] as const\n/** Blocks converted when nothing is selected: the caret's composite body / document, the whole document, or the caret's heading with its content. */\nexport type HeadingConversionScope = (typeof HEADING_CONVERSION_SCOPES)[number]\n\n/** How a user prefers documents structured: Markdown headings (Flat mode), or nested Typed blocks (Structure mode). */\nexport const STRUCTURE_MODES = ['flat', 'structured'] as const\nexport type StructureMode = (typeof STRUCTURE_MODES)[number]\n\n/**\n * What the document drawer's tree is rooted in while a Document with Typed blocks is loaded:\n * `folders` nests files in the store's folders (the file is one entry of the folder tree), `file` makes the loaded\n * file itself the single root, with its Ordner/Dokument Typed blocks as the hierarchy below. Without a loaded Document with Typed blocks\n * the drawer always shows the folders.\n */\nexport const TREE_ROOTS = ['folders', 'file'] as const\nexport type TreeRoot = (typeof TREE_ROOTS)[number]\n\n/** When a Typed block shows its Block type icon (the icon is also its drag handle): permanently, or only while hovered, focused or its details are open. */\nexport const BLOCK_TYPE_ICON_VISIBILITIES = ['always', 'hover'] as const\nexport type BlockTypeIconVisibility = (typeof BLOCK_TYPE_ICON_VISIBILITIES)[number]\n\n/** When the standard drag handle of blocks without Block type icon shows: on the hovered block, or permanently beside every block. */\nexport const DRAG_HANDLE_VISIBILITIES = ['hover', 'always'] as const\nexport type DragHandleVisibility = (typeof DRAG_HANDLE_VISIBILITIES)[number]\n\n/** How the author colouring mode shows a run's author (authors feature): tinted background or coloured text. */\nexport const AUTHOR_COLOR_STYLES = ['background', 'text'] as const\nexport type AuthorColorStyle = (typeof AUTHOR_COLOR_STYLES)[number]\n\n/** How a user wants comments shown (comments feature): cards in a margin column beside the text, or a popover at the text with a list in the toolbar. */\nexport const COMMENTS_LAYOUTS = ['margin', 'inline'] as const\nexport type CommentsLayout = (typeof COMMENTS_LAYOUTS)[number]\n"],"mappings":";;AAIA,MAAa,cAAc;CAAC;CAAY;CAAW;AAAU;;AAK7D,MAAa,eAAe;CAAC;CAAW;CAAY;CAAe;CAAY;AAAa;AAG5F,MAAa,4BAA4B;CAAC;CAAa;CAAY;AAAS;;AAK5E,MAAa,kBAAkB,CAAC,QAAQ,YAAY;;;;;;;AASpD,MAAa,aAAa,CAAC,WAAW,MAAM;;AAI5C,MAAa,+BAA+B,CAAC,UAAU,OAAO;;AAI9D,MAAa,2BAA2B,CAAC,SAAS,QAAQ;;AAI1D,MAAa,sBAAsB,CAAC,cAAc,MAAM;;AAIxD,MAAa,mBAAmB,CAAC,UAAU,QAAQ"}
@@ -1,9 +1,9 @@
1
1
  /* Styles of the composite feature (`@ecsplico/editor/composites`); import after `core.css`. */
2
2
  /* Colour baskets (`compositeFeature({ baskets })`): the default set's colours, light and dark like `tokens.css` (the host sets
3
3
  `.dark`). Declared under `:where()` (specificity 0), a host's rule always wins; a custom basket brings its own `color`.
4
- `--sk-kind-tone-mix` is how strongly a kind's tone (`CompositeKind.chrome.tone`) tints the Baustein surface. */
4
+ `--sk-block-type-tone-mix` is how strongly a Block type's tone (`BlockType.chrome.tone`) tints the Typed block surface. */
5
5
  :where(:root) {
6
- --sk-kind-tone-mix: 8%;
6
+ --sk-block-type-tone-mix: 8%;
7
7
  --sk-basket-red: #ef4444;
8
8
  --sk-basket-orange: #f97316;
9
9
  --sk-basket-yellow: #eab308;
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  :where(.dark) {
15
- --sk-kind-tone-mix: 14%;
15
+ --sk-block-type-tone-mix: 14%;
16
16
  --sk-basket-red: #f87171;
17
17
  --sk-basket-orange: #fb923c;
18
18
  --sk-basket-yellow: #facc15;
@@ -29,11 +29,11 @@
29
29
  padding-left: 1.25rem;
30
30
  border-left: 2px solid var(--sk-border);
31
31
  }
32
- /* Kind tone: the node view sets `data-kind-tone` and `--sk-kind-tone` on a Baustein whose kind has `chrome.tone`; kinds without one are untouched.
32
+ /* Block type tone: the node view sets `data-block-type-tone` and `--sk-block-type-tone` on a Typed block whose Block type has `chrome.tone`; Block types without one are untouched.
33
33
  Declared before the basket stripe, which wins on the border when both apply. */
34
- .tiptap .composite[data-kind-tone] {
35
- background: color-mix(in oklab, var(--sk-kind-tone) var(--sk-kind-tone-mix), transparent);
36
- border-left-color: var(--sk-kind-tone);
34
+ .tiptap .composite[data-block-type-tone] {
35
+ background: color-mix(in oklab, var(--sk-block-type-tone) var(--sk-block-type-tone-mix), transparent);
36
+ border-left-color: var(--sk-block-type-tone);
37
37
  }
38
38
  /* The node view sets `--sk-basket-color` of a composite in a colour basket (`compositeFeature({ baskets })`); the colours of the default set are the tokens above. */
39
39
  /* Basket stripe: the border takes the basket's colour; the inset shadow thickens it at every nesting depth without moving content. */
@@ -47,7 +47,7 @@
47
47
  .tiptap .composite[data-title-hidden] > .composite__content > .composite-title { display: none; }
48
48
  .tiptap .composite .composite { margin: 1em 0; }
49
49
  .tiptap .composite .composite .composite { margin: 0.75em 0; padding-left: 1rem; border-left-width: 1px; }
50
- /* Derived Baustein (has a `meta.derivation`) that is not opened: a short faded preview. The content stays laid out and
50
+ /* Derived Typed block (has a `meta.derivation`) that is not opened: a short faded preview. The content stays laid out and
51
51
  only clipped, so ProseMirror positions and measurements stay valid; a caret inside opens it (`CompositeNode`). */
52
52
  .tiptap .composite.is-collapsed > .composite__content {
53
53
  max-height: 7rem;
@@ -82,7 +82,7 @@
82
82
  /* Description and tags rows are data only: the chips and the details popover of `CompositeChrome` show and edit them. */
83
83
  .tiptap .composite-description,
84
84
  .tiptap .composite-tags { display: none; }
85
- /* Focus mode (`focusComposite`): the decorations of `CompositeFocus` hide every sibling of the focused Baustein
85
+ /* Focus mode (`focusComposite`): the decorations of `CompositeFocus` hide every sibling of the focused Typed block
86
86
  (`sk-focus-target`) and of each ancestor (`sk-focus-ancestor`). An ancestor keeps its title (its description and tags
87
87
  rows are hidden above anyway; its title, description and tags are not siblings in the sense of the decorations). */
88
88
  .tiptap .sk-focus-hidden { display: none !important; }
@@ -94,7 +94,7 @@
94
94
  pointer-events: none;
95
95
  content: var(--composite-title-placeholder, '');
96
96
  }
97
- /* Inline reference to a Baustein (`[@`): a link-like pill in the primary colour; greyed and struck when the target is gone. */
97
+ /* Inline reference to a Typed block (`[@`): a link-like pill in the primary colour; greyed and struck when the target is gone. */
98
98
  .tiptap .reference {
99
99
  color: var(--sk-primary);
100
100
  background: color-mix(in oklab, var(--sk-primary) 12%, transparent);
@@ -77,7 +77,7 @@ const _hoisted_25 = {
77
77
  class: "px-2.5 py-1.5 text-sm text-[var(--sk-muted)]"
78
78
  };
79
79
  const basketOption = "flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm text-[var(--sk-fg)] transition-colors duration-150 hover:bg-[var(--sk-bg-elevated)] focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[var(--sk-primary)]";
80
- /** The breadcrumb of the focus: the document (first crumb, leaves focus) and the Bausteine down to the focused one. */
80
+ /** The breadcrumb of the focus: the document (first crumb, leaves focus) and the Typed blocks down to the focused one. */
81
81
  const _sfc_main = /*@__PURE__*/ defineComponent({
82
82
  __name: "DocumentTree",
83
83
  props: /*@__PURE__*/ mergeModels({
@@ -100,7 +100,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
100
100
  selectedFolder
101
101
  });
102
102
  const { settings } = useEditorSettings();
103
- const canUseFileRoot = computed(() => state.value.hasEditor && state.value.structure === "composite");
103
+ const canUseFileRoot = computed(() => state.value.hasEditor && state.value.structure === "structured");
104
104
  function toggleTreeRoot() {
105
105
  settings.value.blocks.treeRoot = settings.value.blocks.treeRoot === "file" ? "folders" : "file";
106
106
  }
@@ -173,7 +173,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
173
173
  if (!event.dataTransfer) return model.value.dragEnd();
174
174
  event.dataTransfer.setData(DRAG_MIME, JSON.stringify(payload));
175
175
  const editor = props.editor;
176
- const found = payload.type === "composite" && editor && !editor.isDestroyed ? findBlockById(editor.state.doc, payload.blockId) : null;
176
+ const found = payload.type === "typedBlock" && editor && !editor.isDestroyed ? findBlockById(editor.state.doc, payload.blockId) : null;
177
177
  const transfer = found && editor ? blockTransferOf(editor, found.pos) : null;
178
178
  if (transfer) writeBlockTransfer(event.dataTransfer, transfer);
179
179
  event.dataTransfer.effectAllowed = transfer ? "copyMove" : "move";
@@ -392,7 +392,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
392
392
  name: "i-lucide-chevron-right",
393
393
  class: normalizeClass(["size-3.5 shrink-0 text-[var(--sk-muted)] transition-transform", row(item).open && "rotate-90"]),
394
394
  onClick: ($event) => onChevronClick($event, item)
395
- }, null, 8, ["class", "onClick"])) : item.type === "composite" || item.type === "heading" ? (openBlock(), createElementBlock("span", _hoisted_17)) : createCommentVNode("v-if", true),
395
+ }, null, 8, ["class", "onClick"])) : item.type === "typedBlock" || item.type === "heading" ? (openBlock(), createElementBlock("span", _hoisted_17)) : createCommentVNode("v-if", true),
396
396
  createVNode(unref(UIcon), {
397
397
  name: item.icon,
398
398
  class: "size-4 shrink-0",
@@ -454,6 +454,13 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
454
454
  class: "size-3.5 shrink-0 text-[var(--sk-muted)]",
455
455
  title: unref(t)("tree.summary")
456
456
  }, null, 8, ["title"])) : createCommentVNode("v-if", true),
457
+ item.sourceMissing ? (openBlock(), createBlock(unref(UIcon), {
458
+ key: 2,
459
+ name: "i-lucide-unlink",
460
+ class: "size-3.5 shrink-0 text-[var(--sk-warning)]",
461
+ title: unref(t)("composites.derivation.sourceMissing"),
462
+ "data-source-missing": ""
463
+ }, null, 8, ["title"])) : createCommentVNode("v-if", true),
457
464
  createElementVNode("div", {
458
465
  class: "flex shrink-0",
459
466
  onClick: _cache[11] || (_cache[11] = withModifiers(() => {}, ["stop"]))
@@ -479,7 +486,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
479
486
  ])]),
480
487
  _: 2
481
488
  }, 1032, ["items"])) : createCommentVNode("v-if", true), createElementVNode("div", _hoisted_22, [
482
- item.type === "composite" && item.blockId ? (openBlock(), createBlock(unref(UButton), {
489
+ item.type === "typedBlock" && item.blockId ? (openBlock(), createBlock(unref(UButton), {
483
490
  key: 0,
484
491
  icon: "i-lucide-focus",
485
492
  size: "xs",