@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,4 +1,4 @@
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 { useEditorI18n } from "../../../react/use-editor-i18n.js";
4
4
  import { Icon } from "../../../react/Icon.js";
@@ -9,7 +9,7 @@ import { SettingsSection } from "../../../react/SettingsSection.js";
9
9
  import { Label } from "../../../react/ui/label.js";
10
10
  import { RadioGroup, RadioGroupItem } from "../../../react/ui/radio-group.js";
11
11
  import { STRUCTURE_MODE_KEYS } from "../structure-mode.js";
12
- import { DRAG_HANDLE_KEYS, HEADING_SCOPE_KEYS, KIND_ICON_KEYS, optionItems } from "../editing-settings-keys.js";
12
+ import { BLOCK_TYPE_ICON_KEYS, DRAG_HANDLE_KEYS, HEADING_SCOPE_KEYS, optionItems } from "../editing-settings-keys.js";
13
13
  import { TREE_ROOT_KEYS } from "../tree-root.js";
14
14
  import { useEffect, useId, useState } from "react";
15
15
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -56,10 +56,10 @@ function RadioOption({ item }) {
56
56
  })]
57
57
  });
58
58
  }
59
- /** „Bearbeiten“: Gliederung (structure mode, conversion scope), Bausteine defaults and the visibility of the block handles. */
60
- function SettingsEditingTab({ kinds }) {
59
+ /** „Bearbeiten“: Gliederung (structure mode, conversion scope), Typed blocks defaults and the visibility of the block handles. */
60
+ function SettingsEditingTab({ blockTypes }) {
61
61
  const { settings, update } = useEditorSettings();
62
- const kindLabelId = useId();
62
+ const blockTypeLabelId = useId();
63
63
  const splitTargetId = useId();
64
64
  const [splitTarget, setSplitTarget] = useState(String(settings.blocks.splitTargetChars));
65
65
  useEffect(() => {
@@ -76,7 +76,7 @@ function SettingsEditingTab({ kinds }) {
76
76
  const structureItems = optionItems(STRUCTURE_MODES, STRUCTURE_MODE_KEYS, t);
77
77
  const scopeItems = optionItems(HEADING_CONVERSION_SCOPES, HEADING_SCOPE_KEYS, t);
78
78
  const treeRootItems = optionItems(TREE_ROOTS, TREE_ROOT_KEYS, t);
79
- const kindIconItems = optionItems(KIND_ICON_VISIBILITIES, KIND_ICON_KEYS, t);
79
+ const blockTypeIconItems = optionItems(BLOCK_TYPE_ICON_VISIBILITIES, BLOCK_TYPE_ICON_KEYS, t);
80
80
  const dragHandleItems = optionItems(DRAG_HANDLE_VISIBILITIES, DRAG_HANDLE_KEYS, t);
81
81
  return /* @__PURE__ */ jsxs("div", {
82
82
  className: "flex flex-col gap-8",
@@ -118,26 +118,26 @@ function SettingsEditingTab({ kinds }) {
118
118
  children: [/* @__PURE__ */ jsxs("div", {
119
119
  className: "min-w-0 flex-1",
120
120
  children: [/* @__PURE__ */ jsx(Label, {
121
- id: kindLabelId,
121
+ id: blockTypeLabelId,
122
122
  className: "text-sm font-medium text-foreground",
123
- children: t("composites.settings.defaultKind.label")
123
+ children: t("composites.settings.defaultBlockType.label")
124
124
  }), /* @__PURE__ */ jsx("p", {
125
125
  className: "text-sm text-muted-foreground",
126
- children: t("composites.settings.defaultKind.description")
126
+ children: t("composites.settings.defaultBlockType.description")
127
127
  })]
128
128
  }), /* @__PURE__ */ jsxs(Select, {
129
- value: settings.blocks.defaultKind,
129
+ value: settings.blocks.defaultBlockType,
130
130
  onValueChange: (value) => update((draft) => {
131
- draft.blocks.defaultKind = value;
131
+ draft.blocks.defaultBlockType = value;
132
132
  }),
133
133
  children: [/* @__PURE__ */ jsx(SelectTrigger, {
134
- "aria-labelledby": kindLabelId,
134
+ "aria-labelledby": blockTypeLabelId,
135
135
  className: "w-64",
136
136
  children: /* @__PURE__ */ jsx(SelectValue, {})
137
- }), /* @__PURE__ */ jsx(SelectContent, { children: kinds.map((kind) => /* @__PURE__ */ jsxs(SelectItem, {
138
- value: kind.id,
139
- children: [/* @__PURE__ */ jsx(Icon, { name: kind.icon }), kind.label]
140
- }, kind.id)) })]
137
+ }), /* @__PURE__ */ jsx(SelectContent, { children: blockTypes.map((blockType) => /* @__PURE__ */ jsxs(SelectItem, {
138
+ value: blockType.id,
139
+ children: [/* @__PURE__ */ jsx(Icon, { name: blockType.icon }), blockType.label]
140
+ }, blockType.id)) })]
141
141
  })]
142
142
  }),
143
143
  /* @__PURE__ */ jsxs("div", {
@@ -162,11 +162,11 @@ function SettingsEditingTab({ kinds }) {
162
162
  })]
163
163
  }),
164
164
  /* @__PURE__ */ jsx(RadioField, {
165
- legend: t("composites.settings.kindIcon.legend"),
166
- items: kindIconItems,
167
- value: settings.blocks.kindIcon,
165
+ legend: t("composites.settings.blockTypeIcon.legend"),
166
+ items: blockTypeIconItems,
167
+ value: settings.blocks.blockTypeIcon,
168
168
  onChange: (value) => update((draft) => {
169
- draft.blocks.kindIcon = value;
169
+ draft.blocks.blockTypeIcon = value;
170
170
  })
171
171
  }),
172
172
  /* @__PURE__ */ jsx(RadioField, {
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsEditingTab.js","names":[],"sources":["../../../../src/features/composites/react/SettingsEditingTab.tsx"],"sourcesContent":["import { useEffect, useId, useState } from 'react'\nimport { Icon } from '../../../react/Icon'\nimport { useEditorSettings } from '../../../react/settings'\nimport { SettingsSection } from '../../../react/SettingsSection'\nimport { Input } from '../../../react/ui/input'\nimport { Label } from '../../../react/ui/label'\nimport { RadioGroup, RadioGroupItem } from '../../../react/ui/radio-group'\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../react/ui/select'\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 { useEditorI18n } from '../../../react/use-editor-i18n'\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/** A group of radio options under a legend (the counterpart of Nuxt UI's `URadioGroup`), the options one above the other. */\nfunction RadioField<T extends string>({ legend, items, value, onChange }: {\n legend: string\n items: readonly { label: string, description: string, value: T }[]\n value: T\n onChange: (value: T) => void\n}) {\n const legendId = useId()\n return (\n <div className=\"py-3\">\n <p id={legendId} className=\"mb-2 text-sm font-medium text-foreground\">{legend}</p>\n <RadioGroup\n aria-labelledby={legendId}\n className=\"flex flex-col gap-2\"\n value={value}\n onValueChange={(next) => {\n const item = items.find(candidate => candidate.value === next)\n if (item) onChange(item.value)\n }}\n >\n {items.map(item => <RadioOption key={item.value} item={item} />)}\n </RadioGroup>\n </div>\n )\n}\n\nfunction RadioOption({ item }: { item: { label: string, description: string, value: string } }) {\n const id = useId()\n return (\n <div className=\"flex items-start gap-2\">\n <RadioGroupItem id={id} value={item.value} className=\"mt-0.5\" />\n <Label htmlFor={id} className=\"flex-col items-start gap-0.5\">\n <span className=\"text-sm font-medium text-foreground\">{item.label}</span>\n <span className=\"text-sm font-normal text-muted-foreground\">{item.description}</span>\n </Label>\n </div>\n )\n}\n\n/** „Bearbeiten“: Gliederung (structure mode, conversion scope), Bausteine defaults and the visibility of the block handles. */\nexport function SettingsEditingTab({ kinds }: { kinds: readonly CompositeKind[] }) {\n const { settings, update } = useEditorSettings()\n const kindLabelId = useId()\n const splitTargetId = useId()\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.\n const [splitTarget, setSplitTarget] = useState(String(settings.blocks.splitTargetChars))\n useEffect(() => { setSplitTarget(String(settings.blocks.splitTargetChars)) }, [settings.blocks.splitTargetChars])\n const commitSplitTarget = () => {\n const next = clampSplitTargetChars(splitTarget, settings.blocks.splitTargetChars)\n update((draft) => { draft.blocks.splitTargetChars = next })\n setSplitTarget(String(next))\n }\n const { t } = useEditorI18n()\n const structureItems = optionItems(STRUCTURE_MODES, STRUCTURE_MODE_KEYS, t)\n const scopeItems = optionItems(HEADING_CONVERSION_SCOPES, HEADING_SCOPE_KEYS, t)\n const treeRootItems = optionItems(TREE_ROOTS, TREE_ROOT_KEYS, t)\n const kindIconItems = optionItems(KIND_ICON_VISIBILITIES, KIND_ICON_KEYS, t)\n const dragHandleItems = optionItems(DRAG_HANDLE_VISIBILITIES, DRAG_HANDLE_KEYS, t)\n\n return (\n <div className=\"flex flex-col gap-8\">\n <SettingsSection title={t('composites.settings.structure.title')}>\n <RadioField\n legend={t('composites.settings.structure.legend')}\n items={structureItems}\n value={settings.blocks.structure}\n onChange={value => update((draft) => { draft.blocks.structure = value })}\n />\n <RadioField\n legend={t('composites.settings.scope.legend')}\n items={scopeItems}\n value={settings.editing.headingConversionScope}\n onChange={value => update((draft) => { draft.editing.headingConversionScope = value })}\n />\n </SettingsSection>\n\n <SettingsSection title={t('composites.settings.sidebar.title')}>\n <RadioField\n legend={t('composites.settings.treeRoot.legend')}\n items={treeRootItems}\n value={settings.blocks.treeRoot}\n onChange={value => update((draft) => { draft.blocks.treeRoot = value })}\n />\n </SettingsSection>\n\n <SettingsSection title={t('composites.settings.composites.title')}>\n <div className=\"flex items-start justify-between gap-4 py-3\">\n <div className=\"min-w-0 flex-1\">\n <Label id={kindLabelId} className=\"text-sm font-medium text-foreground\">{t('composites.settings.defaultKind.label')}</Label>\n <p className=\"text-sm text-muted-foreground\">{t('composites.settings.defaultKind.description')}</p>\n </div>\n <Select value={settings.blocks.defaultKind} onValueChange={value => update((draft) => { draft.blocks.defaultKind = value })}>\n <SelectTrigger aria-labelledby={kindLabelId} className=\"w-64\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {kinds.map(kind => (\n <SelectItem key={kind.id} value={kind.id}>\n <Icon name={kind.icon} />\n {kind.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex items-start justify-between gap-4 py-3\">\n <Label htmlFor={splitTargetId} className=\"min-w-0 flex-1 text-sm font-medium text-foreground\">{t('settings.editing.splitTargetChars')}</Label>\n <Input\n id={splitTargetId}\n type=\"number\"\n min={SPLIT_TARGET_CHARS_MIN}\n max={SPLIT_TARGET_CHARS_MAX}\n step={100}\n className=\"w-32\"\n value={splitTarget}\n onChange={event => setSplitTarget(event.target.value)}\n onBlur={commitSplitTarget}\n onKeyDown={(event) => {\n if (event.key === 'Enter') commitSplitTarget()\n }}\n />\n </div>\n <RadioField\n legend={t('composites.settings.kindIcon.legend')}\n items={kindIconItems}\n value={settings.blocks.kindIcon}\n onChange={value => update((draft) => { draft.blocks.kindIcon = value })}\n />\n <RadioField\n legend={t('composites.settings.dragHandle.legend')}\n items={dragHandleItems}\n value={settings.blocks.dragHandle}\n onChange={value => update((draft) => { draft.blocks.dragHandle = value })}\n />\n </SettingsSection>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAS,WAA6B,EAAE,QAAQ,OAAO,OAAO,YAK3D;CACD,MAAM,WAAW,MAAM;CACvB,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,KAAD;GAAG,IAAI;GAAU,WAAU;GAA4C,UAAA;EAAU,CAAA,GACjF,oBAAC,YAAD;GACE,mBAAiB;GACjB,WAAU;GACH;GACP,gBAAgB,SAAS;IACvB,M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AD;QAAe,mBAAiB;QAAa,WAAU;QACrD,UAAA,oBAAC,aAAD,CAAc,CAAA;OACD,CAAA,GACf,oBAAC,eAAD,EAAA,UACG,MAAM,KAAI,SACT,qBAAC,YAAD;QAA0B,OAAO,KAAK;QAAtC,UAAA,CACE,oBAAC,MAAD,EAAM,MAAM,KAAK,KAAO,CAAA,GACvB,KAAK,KACI;OAHK,GAAA,KAAK,EAGV,CACb,EACY,CAAA,CACT;MACL,CAAA,CAAA;;KACL,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,oBAAC,OAAD;OAAO,SAAS;OAAe,WAAU;OAAsD,UAAA,EAAE,mCAAmC;MAAS,CAAA,GAC7I,oBAAC,OAAD;OACE,IAAI;OACJ,MAAK;OACL,KAAA;OACA,KAAK;OACL,MAAM;OACN,WAAU;OACV,OAAO;OACP,WAAU,UAAS,eAAe,MAAM,OAAO,KAAK;OACpD,QAAQ;OACR,YAAY,UAAU;QACpB,IAAI,MAAM,QAAQ,SAAS,kBAAkB;OAC/C;MACD,CAAA,CACE;;KACL,oBAAC,YAAD;MACE,QAAQ,EAAE,qCAAqC;MAC/C,OAAO;MACP,OAAO,SAAS,OAAO;MACvB,WAAU,UAAS,QAAQ,UAAU;OAAE,MAAM,OAAO,WAAW;MAAM,CAAC;KACvE,CAAA;KACD,oBAAC,YAAD;MACE,QAAQ,EAAE,uCAAuC;MACjD,OAAO;MACP,OAAO,SAAS,OAAO;MACvB,WAAU,UAAS,QAAQ,UAAU;OAAE,MAAM,OAAO,aAAa;MAAM,CAAC;KACzE,CAAA;IACc;;EACd;;AAET"}
1
+ {"version":3,"file":"SettingsEditingTab.js","names":[],"sources":["../../../../src/features/composites/react/SettingsEditingTab.tsx"],"sourcesContent":["import { useEffect, useId, useState } from 'react'\nimport { Icon } from '../../../react/Icon'\nimport { useEditorSettings } from '../../../react/settings'\nimport { SettingsSection } from '../../../react/SettingsSection'\nimport { Input } from '../../../react/ui/input'\nimport { Label } from '../../../react/ui/label'\nimport { RadioGroup, RadioGroupItem } from '../../../react/ui/radio-group'\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../../../react/ui/select'\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 { useEditorI18n } from '../../../react/use-editor-i18n'\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/** A group of radio options under a legend (the counterpart of Nuxt UI's `URadioGroup`), the options one above the other. */\nfunction RadioField<T extends string>({ legend, items, value, onChange }: {\n legend: string\n items: readonly { label: string, description: string, value: T }[]\n value: T\n onChange: (value: T) => void\n}) {\n const legendId = useId()\n return (\n <div className=\"py-3\">\n <p id={legendId} className=\"mb-2 text-sm font-medium text-foreground\">{legend}</p>\n <RadioGroup\n aria-labelledby={legendId}\n className=\"flex flex-col gap-2\"\n value={value}\n onValueChange={(next) => {\n const item = items.find(candidate => candidate.value === next)\n if (item) onChange(item.value)\n }}\n >\n {items.map(item => <RadioOption key={item.value} item={item} />)}\n </RadioGroup>\n </div>\n )\n}\n\nfunction RadioOption({ item }: { item: { label: string, description: string, value: string } }) {\n const id = useId()\n return (\n <div className=\"flex items-start gap-2\">\n <RadioGroupItem id={id} value={item.value} className=\"mt-0.5\" />\n <Label htmlFor={id} className=\"flex-col items-start gap-0.5\">\n <span className=\"text-sm font-medium text-foreground\">{item.label}</span>\n <span className=\"text-sm font-normal text-muted-foreground\">{item.description}</span>\n </Label>\n </div>\n )\n}\n\n/** „Bearbeiten“: Gliederung (structure mode, conversion scope), Typed blocks defaults and the visibility of the block handles. */\nexport function SettingsEditingTab({ blockTypes }: { blockTypes: readonly BlockType[] }) {\n const { settings, update } = useEditorSettings()\n const blockTypeLabelId = useId()\n const splitTargetId = useId()\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.\n const [splitTarget, setSplitTarget] = useState(String(settings.blocks.splitTargetChars))\n useEffect(() => { setSplitTarget(String(settings.blocks.splitTargetChars)) }, [settings.blocks.splitTargetChars])\n const commitSplitTarget = () => {\n const next = clampSplitTargetChars(splitTarget, settings.blocks.splitTargetChars)\n update((draft) => { draft.blocks.splitTargetChars = next })\n setSplitTarget(String(next))\n }\n const { t } = useEditorI18n()\n const structureItems = optionItems(STRUCTURE_MODES, STRUCTURE_MODE_KEYS, t)\n const scopeItems = optionItems(HEADING_CONVERSION_SCOPES, HEADING_SCOPE_KEYS, t)\n const treeRootItems = optionItems(TREE_ROOTS, TREE_ROOT_KEYS, t)\n const blockTypeIconItems = optionItems(BLOCK_TYPE_ICON_VISIBILITIES, BLOCK_TYPE_ICON_KEYS, t)\n const dragHandleItems = optionItems(DRAG_HANDLE_VISIBILITIES, DRAG_HANDLE_KEYS, t)\n\n return (\n <div className=\"flex flex-col gap-8\">\n <SettingsSection title={t('composites.settings.structure.title')}>\n <RadioField\n legend={t('composites.settings.structure.legend')}\n items={structureItems}\n value={settings.blocks.structure}\n onChange={value => update((draft) => { draft.blocks.structure = value })}\n />\n <RadioField\n legend={t('composites.settings.scope.legend')}\n items={scopeItems}\n value={settings.editing.headingConversionScope}\n onChange={value => update((draft) => { draft.editing.headingConversionScope = value })}\n />\n </SettingsSection>\n\n <SettingsSection title={t('composites.settings.sidebar.title')}>\n <RadioField\n legend={t('composites.settings.treeRoot.legend')}\n items={treeRootItems}\n value={settings.blocks.treeRoot}\n onChange={value => update((draft) => { draft.blocks.treeRoot = value })}\n />\n </SettingsSection>\n\n <SettingsSection title={t('composites.settings.composites.title')}>\n <div className=\"flex items-start justify-between gap-4 py-3\">\n <div className=\"min-w-0 flex-1\">\n <Label id={blockTypeLabelId} className=\"text-sm font-medium text-foreground\">{t('composites.settings.defaultBlockType.label')}</Label>\n <p className=\"text-sm text-muted-foreground\">{t('composites.settings.defaultBlockType.description')}</p>\n </div>\n <Select value={settings.blocks.defaultBlockType} onValueChange={value => update((draft) => { draft.blocks.defaultBlockType = value })}>\n <SelectTrigger aria-labelledby={blockTypeLabelId} className=\"w-64\">\n <SelectValue />\n </SelectTrigger>\n <SelectContent>\n {blockTypes.map(blockType => (\n <SelectItem key={blockType.id} value={blockType.id}>\n <Icon name={blockType.icon} />\n {blockType.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n </div>\n <div className=\"flex items-start justify-between gap-4 py-3\">\n <Label htmlFor={splitTargetId} className=\"min-w-0 flex-1 text-sm font-medium text-foreground\">{t('settings.editing.splitTargetChars')}</Label>\n <Input\n id={splitTargetId}\n type=\"number\"\n min={SPLIT_TARGET_CHARS_MIN}\n max={SPLIT_TARGET_CHARS_MAX}\n step={100}\n className=\"w-32\"\n value={splitTarget}\n onChange={event => setSplitTarget(event.target.value)}\n onBlur={commitSplitTarget}\n onKeyDown={(event) => {\n if (event.key === 'Enter') commitSplitTarget()\n }}\n />\n </div>\n <RadioField\n legend={t('composites.settings.blockTypeIcon.legend')}\n items={blockTypeIconItems}\n value={settings.blocks.blockTypeIcon}\n onChange={value => update((draft) => { draft.blocks.blockTypeIcon = value })}\n />\n <RadioField\n legend={t('composites.settings.dragHandle.legend')}\n items={dragHandleItems}\n value={settings.blocks.dragHandle}\n onChange={value => update((draft) => { draft.blocks.dragHandle = value })}\n />\n </SettingsSection>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAS,WAA6B,EAAE,QAAQ,OAAO,OAAO,YAK3D;CACD,MAAM,WAAW,MAAM;CACvB,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACE,oBAAC,KAAD;GAAG,IAAI;GAAU,WAAU;GAA4C,UAAA;EAAU,CAAA,G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QAAQ,UAAU;QAAE,MAAM,OAAO,mBAAmB;OAAM,CAAC;OAApI,UAAA,CACE,oBAAC,eAAD;QAAe,mBAAiB;QAAkB,WAAU;QAC1D,UAAA,oBAAC,aAAD,CAAc,CAAA;OACD,CAAA,GACf,oBAAC,eAAD,EAAA,UACG,WAAW,KAAI,cACd,qBAAC,YAAD;QAA+B,OAAO,UAAU;QAAhD,UAAA,CACE,oBAAC,MAAD,EAAM,MAAM,UAAU,KAAO,CAAA,GAC5B,UAAU,KACD;OAHK,GAAA,UAAU,EAGf,CACb,EACY,CAAA,CACT;MACL,CAAA,CAAA;;KACL,qBAAC,OAAD;MAAK,WAAU;MAAf,UAAA,CACE,oBAAC,OAAD;OAAO,SAAS;OAAe,WAAU;OAAsD,UAAA,EAAE,mCAAmC;MAAS,CAAA,GAC7I,oBAAC,OAAD;OACE,IAAI;OACJ,MAAK;OACL,KAAA;OACA,KAAK;OACL,MAAM;OACN,WAAU;OACV,OAAO;OACP,WAAU,UAAS,eAAe,MAAM,OAAO,KAAK;OACpD,QAAQ;OACR,YAAY,UAAU;QACpB,IAAI,MAAM,QAAQ,SAAS,kBAAkB;OAC/C;MACD,CAAA,CACE;;KACL,oBAAC,YAAD;MACE,QAAQ,EAAE,0CAA0C;MACpD,OAAO;MACP,OAAO,SAAS,OAAO;MACvB,WAAU,UAAS,QAAQ,UAAU;OAAE,MAAM,OAAO,gBAAgB;MAAM,CAAC;KAC5E,CAAA;KACD,oBAAC,YAAD;MACE,QAAQ,EAAE,uCAAuC;MACjD,OAAO;MACP,OAAO,SAAS,OAAO;MACvB,WAAU,UAAS,QAAQ,UAAU;OAAE,MAAM,OAAO,aAAa;MAAM,CAAC;KACzE,CAAA;IACc;;EACd;;AAET"}
@@ -25,7 +25,7 @@ function compositeFeature(options = {}) {
25
25
  focusChip: FocusChip,
26
26
  settingsTab: SettingsEditingTab,
27
27
  nodeViews: {
28
- composite: ReactNodeViewRenderer(CompositeView),
28
+ typedBlock: ReactNodeViewRenderer(CompositeView),
29
29
  reference: ReactNodeViewRenderer(ReferenceView)
30
30
  }
31
31
  }, options);
@@ -1 +1 @@
1
- {"version":3,"file":"react.js","names":[],"sources":["../../../src/features/composites/react.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { ReactNodeViewRenderer } from '@tiptap/react'\nimport type { ComponentType } from 'react'\nimport type { ReactFeature } from '../../react'\nimport { type CompositeFeatureOptions, compositeFeatureCore } from './feature'\nimport { CompositeChrome } from './react/CompositeChrome'\nimport { ReferenceView } from './react/ReferenceView'\nimport { CompositeView } from './react/CompositeView'\nimport { FocusChip } from './react/FocusChip'\nimport { SettingsEditingTab } from './react/SettingsEditingTab'\n\nexport { CompositeChrome } from './react/CompositeChrome'\nexport { CompositeDetails } from './react/CompositeDetails'\nexport { CompositeFieldEditor } from './react/CompositeFieldEditor'\nexport { CompositeInspector } from './react/CompositeInspector'\nexport { CompositeStatusMenu } from './react/CompositeStatusMenu'\nexport { CompositeSummaryEditor } from './react/CompositeSummaryEditor'\nexport { CompositeTable } from './react/CompositeTable'\nexport { CompositeTagsEditor } from './react/CompositeTagsEditor'\nexport { CompositeView } from './react/CompositeView'\nexport { FocusChip } from './react/FocusChip'\nexport { ReferenceView } from './react/ReferenceView'\nexport { SettingsEditingTab } from './react/SettingsEditingTab'\nexport { useCompositeAnchors } from './react/use-composite-anchors'\nexport { useCompositeRows } from './react/use-composite-rows'\n\n/**\n * The React composites feature (shadcn): see `compositeFeatureCore`. The host places `CompositeTable` and\n * `CompositeInspector` beside the editor.\n */\nexport function compositeFeature(options: CompositeFeatureOptions = {}): ReactFeature {\n return compositeFeatureCore<ComponentType<{ editor: Editor }>>({\n chrome: CompositeChrome,\n focusChip: FocusChip,\n // A settings tab receives only its descriptor's `props` (`{ kinds }`), not the toolbar's `{ editor }` (see `EditorSettingsPanel`).\n settingsTab: SettingsEditingTab as unknown as ComponentType<{ editor: Editor }>,\n nodeViews: { composite: ReactNodeViewRenderer(CompositeView), reference: ReactNodeViewRenderer(ReferenceView) },\n }, options)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,iBAAiB,UAAmC,CAAC,GAAiB;CACpF,OAAO,qBAAwD;EAC7D,QAAQ;EACR,WAAW;EAEX,aAAa;EACb,WAAW;GAAE,WAAW,sBAAsB,aAAa;GAAG,WAAW,sBAAsB,aAAa;EAAE;CAChH,GAAG,OAAO;AACZ"}
1
+ {"version":3,"file":"react.js","names":[],"sources":["../../../src/features/composites/react.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport { ReactNodeViewRenderer } from '@tiptap/react'\nimport type { ComponentType } from 'react'\nimport type { ReactFeature } from '../../react'\nimport { type CompositeFeatureOptions, compositeFeatureCore } from './feature'\nimport { CompositeChrome } from './react/CompositeChrome'\nimport { ReferenceView } from './react/ReferenceView'\nimport { CompositeView } from './react/CompositeView'\nimport { FocusChip } from './react/FocusChip'\nimport { SettingsEditingTab } from './react/SettingsEditingTab'\n\nexport { CompositeChrome } from './react/CompositeChrome'\nexport { CompositeDetails } from './react/CompositeDetails'\nexport { CompositeFieldEditor } from './react/CompositeFieldEditor'\nexport { CompositeInspector } from './react/CompositeInspector'\nexport { CompositeStatusMenu } from './react/CompositeStatusMenu'\nexport { CompositeSummaryEditor } from './react/CompositeSummaryEditor'\nexport { CompositeTable } from './react/CompositeTable'\nexport { CompositeTagsEditor } from './react/CompositeTagsEditor'\nexport { CompositeView } from './react/CompositeView'\nexport { FocusChip } from './react/FocusChip'\nexport { ReferenceView } from './react/ReferenceView'\nexport { SettingsEditingTab } from './react/SettingsEditingTab'\nexport { useCompositeAnchors } from './react/use-composite-anchors'\nexport { useCompositeRows } from './react/use-composite-rows'\n\n/**\n * The React composites feature (shadcn): see `compositeFeatureCore`. The host places `CompositeTable` and\n * `CompositeInspector` beside the editor.\n */\nexport function compositeFeature(options: CompositeFeatureOptions = {}): ReactFeature {\n return compositeFeatureCore<ComponentType<{ editor: Editor }>>({\n chrome: CompositeChrome,\n focusChip: FocusChip,\n // A settings tab receives only its descriptor's `props` (`{ kinds }`), not the toolbar's `{ editor }` (see `EditorSettingsPanel`).\n settingsTab: SettingsEditingTab as unknown as ComponentType<{ editor: Editor }>,\n nodeViews: { typedBlock: ReactNodeViewRenderer(CompositeView), reference: ReactNodeViewRenderer(ReferenceView) },\n }, options)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,SAAgB,iBAAiB,UAAmC,CAAC,GAAiB;CACpF,OAAO,qBAAwD;EAC7D,QAAQ;EACR,WAAW;EAEX,aAAa;EACb,WAAW;GAAE,YAAY,sBAAsB,aAAa;GAAG,WAAW,sBAAsB,aAAa;EAAE;CACjH,GAAG,OAAO;AACZ"}
@@ -6,7 +6,7 @@
6
6
  const REFERENCE_AI_BLOCK = {
7
7
  id: "reference",
8
8
  label: "Verweis",
9
- description: "Inline-Verweis auf einen Baustein dieses Dokuments (Zitat, Quelle), optional mit Fundstelle (Seite oder Zeit).",
9
+ description: "Inline-Verweis auf einen Typed block dieses Dokuments (Zitat, Quelle), optional mit Fundstelle (Seite oder Zeit).",
10
10
  syntax: "[@<Block-ID>] oder [@<Block-ID>, S. 12]",
11
11
  example: "Das zeigt die Studie [@0f3c9a52-7d1e-4b8a-9c2f-5e6d7a8b9c0d, S. 12]."
12
12
  };
@@ -1 +1 @@
1
- {"version":3,"file":"reference-ai.js","names":[],"sources":["../../../src/features/composites/reference-ai.ts"],"sourcesContent":["// i18n-ignore-file: model-facing block description (German prompt text, not UI)\nimport type { AiBlock } from '../../core/feature'\n\n/**\n * How the chat and rewrite models learn the `reference` chip: written as Markdown text `[@<Block-ID>]`, which the\n * composites feature's `normalize` stage turns back into a chip. Not a convert target (no conversion provider owns it).\n */\nexport const REFERENCE_AI_BLOCK: AiBlock = {\n id: 'reference',\n label: 'Verweis',\n description: 'Inline-Verweis auf einen Baustein dieses Dokuments (Zitat, Quelle), optional mit Fundstelle (Seite oder Zeit).',\n syntax: '[@<Block-ID>] oder [@<Block-ID>, S. 12]',\n example: 'Das zeigt die Studie [@0f3c9a52-7d1e-4b8a-9c2f-5e6d7a8b9c0d, S. 12].',\n}\n"],"mappings":";;;;;AAOA,MAAa,qBAA8B;CACzC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;AACX"}
1
+ {"version":3,"file":"reference-ai.js","names":[],"sources":["../../../src/features/composites/reference-ai.ts"],"sourcesContent":["// i18n-ignore-file: model-facing block description (German prompt text, not UI)\nimport type { AiBlock } from '../../core/feature'\n\n/**\n * How the chat and rewrite models learn the `reference` chip: written as Markdown text `[@<Block-ID>]`, which the\n * composites feature's `normalize` stage turns back into a chip. Not a convert target (no conversion provider owns it).\n */\nexport const REFERENCE_AI_BLOCK: AiBlock = {\n id: 'reference',\n label: 'Verweis',\n description: 'Inline-Verweis auf einen Typed block dieses Dokuments (Zitat, Quelle), optional mit Fundstelle (Seite oder Zeit).',\n syntax: '[@<Block-ID>] oder [@<Block-ID>, S. 12]',\n example: 'Das zeigt die Studie [@0f3c9a52-7d1e-4b8a-9c2f-5e6d7a8b9c0d, S. 12].',\n}\n"],"mappings":";;;;;AAOA,MAAa,qBAA8B;CACzC,IAAI;CACJ,OAAO;CACP,aAAa;CACb,QAAQ;CACR,SAAS;AACX"}
@@ -1,4 +1,4 @@
1
- import { CompositeKind } from "./kinds.js";
1
+ import { BlockType } from "./block-types.js";
2
2
  import "./reference.js";
3
3
  import { Editor } from "@tiptap/core";
4
4
  import { Node as Node$1 } from "@tiptap/pm/model";
@@ -9,8 +9,8 @@ export interface ReferenceTarget {
9
9
  title: string;
10
10
  kindLabel: string;
11
11
  }
12
- /** The Baustein `node` as a reference target. */
13
- export declare function referenceTarget(node: Node$1, kinds: readonly CompositeKind[]): ReferenceTarget;
12
+ /** The Typed block `node` as a reference target. */
13
+ export declare function referenceTarget(node: Node$1, kinds: readonly BlockType[]): ReferenceTarget;
14
14
  /** The chip text: the short citation ("Doe et al. 2024") when the target has bibliographic data, else its title, else its kind's label. */
15
15
  export declare function referenceLabel(target: ReferenceTarget): string;
16
16
  /** The chip's tooltip: the full citation, else the title. */
@@ -1,15 +1,15 @@
1
1
  import { findBlockById } from "../../core/schema/block-ids.js";
2
- import { compositeKind } from "./kinds.js";
2
+ import { blockTypeOf } from "./block-types.js";
3
3
  import "./meta-keys.js";
4
- import { compositeKindsOf } from "./nodes.js";
4
+ import { blockTypesOf } from "./nodes.js";
5
5
  import { citeFull, citeShort } from "./bibliography.js";
6
6
  //#region src/features/composites/reference-label.ts
7
- /** The Baustein `node` as a reference target. */
7
+ /** The Typed block `node` as a reference target. */
8
8
  function referenceTarget(node, kinds) {
9
9
  return {
10
10
  meta: node.attrs.meta ?? {},
11
11
  title: node.childCount > 0 ? node.child(0).textContent.trim() : "",
12
- kindLabel: compositeKind(kinds, String(node.attrs.kind)).label
12
+ kindLabel: blockTypeOf(kinds, String(node.attrs.blockType)).label
13
13
  };
14
14
  }
15
15
  const bibOfTarget = (target) => {
@@ -40,12 +40,12 @@ function referenceAttrsOf(node) {
40
40
  /** What a chip shows now: the live label and tooltip of its target, or (`gone`) the attrs' cached label when the target no longer exists. */
41
41
  function resolveReference(editor, attrs) {
42
42
  const found = findBlockById(editor.state.doc, attrs.target);
43
- if (found?.node.type.name !== "composite") return {
43
+ if (found?.node.type.name !== "typedBlock") return {
44
44
  label: attrs.label,
45
45
  title: attrs.label,
46
46
  gone: true
47
47
  };
48
- const target = referenceTarget(found.node, compositeKindsOf(editor));
48
+ const target = referenceTarget(found.node, blockTypesOf(editor));
49
49
  return {
50
50
  label: referenceLabel(target),
51
51
  title: referenceTitle(target),
@@ -1 +1 @@
1
- {"version":3,"file":"reference-label.js","names":[],"sources":["../../../src/features/composites/reference-label.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport type { Node as PMNode } from '@tiptap/pm/model'\nimport { findBlockById } from '../../core/schema'\nimport { type CslItem, BIB_KEY, citeFull, citeShort } from './bibliography'\nimport { compositeKind, type CompositeKind } from './kinds'\nimport { compositeKindsOf } from './nodes'\nimport type { ReferenceAttrs } from './reference'\n\n/** What a reference chip shows of its target: the parts of a `CompositeRow`, or of a composite node (`referenceTarget`). */\nexport interface ReferenceTarget {\n meta: Record<string, unknown>\n title: string\n kindLabel: string\n}\n\n/** The Baustein `node` as a reference target. */\nexport function referenceTarget(node: PMNode, kinds: readonly CompositeKind[]): ReferenceTarget {\n return {\n meta: (node.attrs.meta ?? {}) as Record<string, unknown>,\n title: node.childCount > 0 ? node.child(0).textContent.trim() : '',\n kindLabel: compositeKind(kinds, String(node.attrs.kind)).label,\n }\n}\n\nconst bibOfTarget = (target: ReferenceTarget): CslItem | null => {\n const bib = target.meta[BIB_KEY]\n if (!bib || typeof bib !== 'object' || Array.isArray(bib)) return null\n return 'type' in bib && typeof bib.type === 'string' ? bib as CslItem : null\n}\n\n/** The chip text: the short citation (\"Doe et al. 2024\") when the target has bibliographic data, else its title, else its kind's label. */\nexport function referenceLabel(target: ReferenceTarget): string {\n const bib = bibOfTarget(target)\n return bib ? citeShort(bib, target.title) : target.title || target.kindLabel\n}\n\n/** The chip's tooltip: the full citation, else the title. */\nexport function referenceTitle(target: ReferenceTarget): string {\n const bib = bibOfTarget(target)\n return bib ? citeFull({ ...bib, title: target.title }) : target.title || target.kindLabel\n}\n\n/** The attrs of a `reference` node that the label needs, typed (a node's `attrs` is a loose record). */\nexport function referenceAttrsOf(node: PMNode): Pick<ReferenceAttrs, 'target' | 'label'> {\n return { target: String(node.attrs.target ?? ''), label: String(node.attrs.label ?? '') }\n}\n\n/** What a chip shows now: the live label and tooltip of its target, or (`gone`) the attrs' cached label when the target no longer exists. */\nexport function resolveReference(editor: Editor, attrs: Pick<ReferenceAttrs, 'target' | 'label'>): { label: string, title: string, gone: boolean } {\n const found = findBlockById(editor.state.doc, attrs.target)\n if (found?.node.type.name !== 'composite') return { label: attrs.label, title: attrs.label, gone: true }\n const target = referenceTarget(found.node, compositeKindsOf(editor))\n return { label: referenceLabel(target), title: referenceTitle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;AACrF"}
1
+ {"version":3,"file":"reference-label.js","names":[],"sources":["../../../src/features/composites/reference-label.ts"],"sourcesContent":["import type { Editor } from '@tiptap/core'\nimport type { Node as PMNode } from '@tiptap/pm/model'\nimport { findBlockById } from '../../core/schema'\nimport { type CslItem, BIB_KEY, citeFull, citeShort } from './bibliography'\nimport { type BlockType, blockTypeOf } from './block-types'\nimport { blockTypesOf } from './nodes'\nimport type { ReferenceAttrs } from './reference'\n\n/** What a reference chip shows of its target: the parts of a `CompositeRow`, or of a composite node (`referenceTarget`). */\nexport interface ReferenceTarget {\n meta: Record<string, unknown>\n title: string\n kindLabel: string\n}\n\n/** The Typed block `node` as a reference target. */\nexport function referenceTarget(node: PMNode, kinds: readonly BlockType[]): ReferenceTarget {\n return {\n meta: (node.attrs.meta ?? {}) as Record<string, unknown>,\n title: node.childCount > 0 ? node.child(0).textContent.trim() : '',\n kindLabel: blockTypeOf(kinds, String(node.attrs.blockType)).label,\n }\n}\n\nconst bibOfTarget = (target: ReferenceTarget): CslItem | null => {\n const bib = target.meta[BIB_KEY]\n if (!bib || typeof bib !== 'object' || Array.isArray(bib)) return null\n return 'type' in bib && typeof bib.type === 'string' ? bib as CslItem : null\n}\n\n/** The chip text: the short citation (\"Doe et al. 2024\") when the target has bibliographic data, else its title, else its kind's label. */\nexport function referenceLabel(target: ReferenceTarget): string {\n const bib = bibOfTarget(target)\n return bib ? citeShort(bib, target.title) : target.title || target.kindLabel\n}\n\n/** The chip's tooltip: the full citation, else the title. */\nexport function referenceTitle(target: ReferenceTarget): string {\n const bib = bibOfTarget(target)\n return bib ? citeFull({ ...bib, title: target.title }) : target.title || target.kindLabel\n}\n\n/** The attrs of a `reference` node that the label needs, typed (a node's `attrs` is a loose record). */\nexport function referenceAttrsOf(node: PMNode): Pick<ReferenceAttrs, 'target' | 'label'> {\n return { target: String(node.attrs.target ?? ''), label: String(node.attrs.label ?? '') }\n}\n\n/** What a chip shows now: the live label and tooltip of its target, or (`gone`) the attrs' cached label when the target no longer exists. */\nexport function resolveReference(editor: Editor, attrs: Pick<ReferenceAttrs, 'target' | 'label'>): { label: string, title: string, gone: boolean } {\n const found = findBlockById(editor.state.doc, attrs.target)\n if (found?.node.type.name !== 'typedBlock') return { label: attrs.label, title: attrs.label, gone: true }\n const target = referenceTarget(found.node, blockTypesOf(editor))\n return { label: referenceLabel(target), title: referenceTitle(target), gone: false }\n}\n"],"mappings":";;;;;;;AAgBA,SAAgB,gBAAgB,MAAc,OAA8C;CAC1F,OAAO;EACL,MAAO,KAAK,MAAM,QAAQ,CAAC;EAC3B,OAAO,KAAK,aAAa,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,YAAY,KAAK,IAAI;EAChE,WAAW,YAAY,OAAO,OAAO,KAAK,MAAM,SAAS,CAAC,CAAC,CAAC;CAC9D;AACF;AAEA,MAAM,eAAe,WAA4C;CAC/D,MAAM,MAAM,OAAO,KAAA;CACnB,IAAI,CAAC,OAAO,OAAO,QAAQ,YAAY,MAAM,QAAQ,GAAG,GAAG,OAAO;CAClE,OAAO,UAAU,OAAO,OAAO,IAAI,SAAS,WAAW,MAAiB;AAC1E;;AAGA,SAAgB,eAAe,QAAiC;CAC9D,MAAM,MAAM,YAAY,MAAM;CAC9B,OAAO,MAAM,UAAU,KAAK,OAAO,KAAK,IAAI,OAAO,SAAS,OAAO;AACrE;;AAGA,SAAgB,eAAe,QAAiC;CAC9D,MAAM,MAAM,YAAY,MAAM;CAC9B,OAAO,MAAM,SAAS;EAAE,GAAG;EAAK,OAAO,OAAO;CAAM,CAAC,IAAI,OAAO,SAAS,OAAO;AAClF;;AAGA,SAAgB,iBAAiB,MAAwD;CACvF,OAAO;EAAE,QAAQ,OAAO,KAAK,MAAM,UAAU,EAAE;EAAG,OAAO,OAAO,KAAK,MAAM,SAAS,EAAE;CAAE;AAC1F;;AAGA,SAAgB,iBAAiB,QAAgB,OAAkG;CACjJ,MAAM,QAAQ,cAAc,OAAO,MAAM,KAAK,MAAM,MAAM;CAC1D,IAAI,OAAO,KAAK,KAAK,SAAS,cAAc,OAAO;EAAE,OAAO,MAAM;EAAO,OAAO,MAAM;EAAO,MAAM;CAAK;CACxG,MAAM,SAAS,gBAAgB,MAAM,MAAM,aAAa,MAAM,CAAC;CAC/D,OAAO;EAAE,OAAO,eAAe,MAAM;EAAG,OAAO,eAAe,MAAM;EAAG,MAAM;CAAM;AACrF"}
@@ -2,7 +2,7 @@ import { Translate } from "../../i18n/index.js";
2
2
  import { ReferenceOptions } from "./reference.js";
3
3
  //#region src/features/composites/reference-suggestion.d.ts
4
4
  /**
5
- * `[@` trigger for ReferenceNode: the Bausteine of the document (with a block ID) whose title, kind or chip label (the
5
+ * `[@` trigger for ReferenceNode: the Typed blocks of the document (with a block ID) whose title, Block type or chip label (the
6
6
  * short citation) contains the typed query, inserted as a chip that shows the short citation or the title. `t` renders the popup texts in the app's language.
7
7
  */
8
8
  export declare const referenceSuggestion: (t: Translate) => NonNullable<ReferenceOptions["suggestion"]>;
@@ -1,21 +1,21 @@
1
1
  import { ABILITY } from "../../core/schema/abilities.js";
2
2
  import { hasAbility } from "../../core/abilities.js";
3
3
  import { createSuggestionRender } from "../../core/suggestion-popup.js";
4
- import { compositeKindsOf } from "./nodes.js";
4
+ import { blockTypesOf } from "./nodes.js";
5
5
  import { referenceLabel } from "./reference-label.js";
6
6
  import { compositeRows } from "./rows.js";
7
7
  //#region src/features/composites/reference-suggestion.ts
8
8
  /** Rows of the popup; more would need scrolling past what a citation picker is for, and the query narrows them anyway. */
9
9
  const MAX_ITEMS = 20;
10
10
  /**
11
- * `[@` trigger for ReferenceNode: the Bausteine of the document (with a block ID) whose title, kind or chip label (the
11
+ * `[@` trigger for ReferenceNode: the Typed blocks of the document (with a block ID) whose title, Block type or chip label (the
12
12
  * short citation) contains the typed query, inserted as a chip that shows the short citation or the title. `t` renders the popup texts in the app's language.
13
13
  */
14
14
  const referenceSuggestion = (t) => ({
15
15
  allow: ({ editor }) => hasAbility(editor, ABILITY.reference),
16
16
  items: ({ query, editor }) => {
17
17
  const needle = query.trim().toLowerCase();
18
- return compositeRows(editor.state.doc, compositeKindsOf(editor)).rows.filter((row) => row.id !== null).map((row) => ({
18
+ return compositeRows(editor.state.doc, blockTypesOf(editor)).rows.filter((row) => row.id !== null).map((row) => ({
19
19
  row,
20
20
  label: referenceLabel(row)
21
21
  })).filter(({ row, label }) => !needle || [
@@ -1 +1 @@
1
- {"version":3,"file":"reference-suggestion.js","names":[],"sources":["../../../src/features/composites/reference-suggestion.ts"],"sourcesContent":["import { createSuggestionRender, hasAbility } from '../../core'\nimport { ABILITY } from '../../core/schema'\nimport type { Translate } from '../../i18n'\nimport { compositeKindsOf } from './nodes'\nimport type { ReferenceAttrs, ReferenceOptions } from './reference'\nimport { referenceLabel } from './reference-label'\nimport { compositeRows } from './rows'\n\n/** Rows of the popup; more would need scrolling past what a citation picker is for, and the query narrows them anyway. */\nconst MAX_ITEMS = 20\n\n/**\n * `[@` trigger for ReferenceNode: the Bausteine of the document (with a block ID) whose title, kind or chip label (the\n * short citation) contains the typed query, inserted as a chip that shows the short citation or the title. `t` renders the popup texts in the app's language.\n */\nexport const referenceSuggestion = (t: Translate): NonNullable<ReferenceOptions['suggestion']> => ({\n allow: ({ editor }) => hasAbility(editor, ABILITY.reference),\n items: ({ query, editor }): ReferenceAttrs[] => {\n const needle = query.trim().toLowerCase()\n return compositeRows(editor.state.doc, compositeKindsOf(editor)).rows\n .filter(row => row.id !== null)\n .map(row => ({ row, label: referenceLabel(row) }))\n .filter(({ row, label }) => !needle || [label, row.title, row.kindLabel].some(part => part.toLowerCase().includes(needle)))\n .slice(0, MAX_ITEMS)\n .map(({ row, label }): ReferenceAttrs => ({ target: row.id!, documentId: null, locator: null, label }))\n },\n render: createSuggestionRender<ReferenceAttrs>({\n display: item => ({ label: item.label }),\n emptyText: t('composites.reference.empty'),\n loadingText: t('common.loading'),\n }),\n})\n"],"mappings":";;;;;;;;AASA,MAAM,YAAY;;;;;AAMlB,MAAa,uBAAuB,OAA+D;CACjG,QAAQ,EAAE,aAAa,WAAW,QAAQ,QAAQ,SAAS;CAC3D,QAAQ,EAAE,OAAO,aAA+B;EAC9C,MAAM,SAAS,MAAM,KAAK,CAAC,CAAC,YAAY;EACxC,OAAO,cAAc,OAAO,MAAM,KAAK,iBAAiB,MAAM,CAAC,CAAC,CAAC,KAC9D,QAAO,QAAO,IAAI,OAAO,IAAI,CAAC,CAC9B,KAAI,SAAQ;GAAE;GAAK,OAAO,eAAe,GAAG;EAAE,EAAE,CAAC,CACjD,QAAQ,EAAE,KAAK,YAAY,CAAC,UAAU;GAAC;GAAO,IAAI;GAAO,IAAI;EAAS,CAAC,CAAC,MAAK,SAAQ,KAAK,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAC1H,MAAM,GAAG,SAAS,CAAC,CACnB,KAAK,EAAE,KAAK,aAA6B;GAAE,QAAQ,IAAI;GAAK,YAAY;GAAM,SAAS;GAAM;EAAM,EAAE;CAC1G;CACA,QAAQ,uBAAuC;EAC7C,UAAS,UAAS,EAAE,OAAO,KAAK,MAAM;EACtC,WAAW,EAAE,4BAA4B;EACzC,aAAa,EAAE,gBAAgB;CACjC,CAAC;AACH"}
1
+ {"version":3,"file":"reference-suggestion.js","names":[],"sources":["../../../src/features/composites/reference-suggestion.ts"],"sourcesContent":["import { createSuggestionRender, hasAbility } from '../../core'\nimport { ABILITY } from '../../core/schema'\nimport type { Translate } from '../../i18n'\nimport { blockTypesOf } from './nodes'\nimport type { ReferenceAttrs, ReferenceOptions } from './reference'\nimport { referenceLabel } from './reference-label'\nimport { compositeRows } from './rows'\n\n/** Rows of the popup; more would need scrolling past what a citation picker is for, and the query narrows them anyway. */\nconst MAX_ITEMS = 20\n\n/**\n * `[@` trigger for ReferenceNode: the Typed blocks of the document (with a block ID) whose title, Block type or chip label (the\n * short citation) contains the typed query, inserted as a chip that shows the short citation or the title. `t` renders the popup texts in the app's language.\n */\nexport const referenceSuggestion = (t: Translate): NonNullable<ReferenceOptions['suggestion']> => ({\n allow: ({ editor }) => hasAbility(editor, ABILITY.reference),\n items: ({ query, editor }): ReferenceAttrs[] => {\n const needle = query.trim().toLowerCase()\n return compositeRows(editor.state.doc, blockTypesOf(editor)).rows\n .filter(row => row.id !== null)\n .map(row => ({ row, label: referenceLabel(row) }))\n .filter(({ row, label }) => !needle || [label, row.title, row.kindLabel].some(part => part.toLowerCase().includes(needle)))\n .slice(0, MAX_ITEMS)\n .map(({ row, label }): ReferenceAttrs => ({ target: row.id!, documentId: null, locator: null, label }))\n },\n render: createSuggestionRender<ReferenceAttrs>({\n display: item => ({ label: item.label }),\n emptyText: t('composites.reference.empty'),\n loadingText: t('common.loading'),\n }),\n})\n"],"mappings":";;;;;;;;AASA,MAAM,YAAY;;;;;AAMlB,MAAa,uBAAuB,OAA+D;CACjG,QAAQ,EAAE,aAAa,WAAW,QAAQ,QAAQ,SAAS;CAC3D,QAAQ,EAAE,OAAO,aAA+B;EAC9C,MAAM,SAAS,MAAM,KAAK,CAAC,CAAC,YAAY;EACxC,OAAO,cAAc,OAAO,MAAM,KAAK,aAAa,MAAM,CAAC,CAAC,CAAC,KAC1D,QAAO,QAAO,IAAI,OAAO,IAAI,CAAC,CAC9B,KAAI,SAAQ;GAAE;GAAK,OAAO,eAAe,GAAG;EAAE,EAAE,CAAC,CACjD,QAAQ,EAAE,KAAK,YAAY,CAAC,UAAU;GAAC;GAAO,IAAI;GAAO,IAAI;EAAS,CAAC,CAAC,MAAK,SAAQ,KAAK,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,CAAC,CAAC,CAC1H,MAAM,GAAG,SAAS,CAAC,CACnB,KAAK,EAAE,KAAK,aAA6B;GAAE,QAAQ,IAAI;GAAK,YAAY;GAAM,SAAS;GAAM;EAAM,EAAE;CAC1G;CACA,QAAQ,uBAAuC;EAC7C,UAAS,UAAS,EAAE,OAAO,KAAK,MAAM;EACtC,WAAW,EAAE,4BAA4B;EACzC,aAAa,EAAE,gBAAgB;CACjC,CAAC;AACH"}
@@ -6,11 +6,11 @@ export declare function collectCompositeIds(content: JSONContent | null | undefi
6
6
  /**
7
7
  * Turns `[@<id>]` / `[@<id>, <locator>]` tokens in text nodes into `reference` nodes (attrs target, locator, empty
8
8
  * `label`: the node view resolves the live label) — for imported and AI-generated Markdown, whose parser keeps the
9
- * token as text. Only ids in `ids` (the Bausteine of the document) match; unknown ids and text in code blocks, inline
9
+ * token as text. Only ids in `ids` (the Typed blocks of the document) match; unknown ids and text in code blocks, inline
10
10
  * code or links stay plain. Returns the input unchanged when nothing matched.
11
11
  */
12
12
  export declare function referencesFromText(json: JSONContent, ids: ReadonlySet<string>): JSONContent;
13
- /** Block IDs of the composites of `doc`: the Bausteine a `[@id]` text may point at. */
13
+ /** Block IDs of the composites of `doc`: the Typed blocks a `[@id]` text may point at. */
14
14
  export declare function compositeIdsOf(doc: Node$1): Set<string>;
15
15
  /** The `normalize` stage: the composites of the document (`current`) and of `blocks` themselves may be referenced by text. */
16
16
  export declare function normalizeReferences(blocks: JSONContent[], current: ReadonlySet<string>): JSONContent[];
@@ -6,14 +6,14 @@ const TOKEN = new RegExp(REFERENCE_TOKEN_SOURCE, "g");
6
6
  /** Block IDs of every composite in a TipTap JSON tree, added to `into`. */
7
7
  function collectCompositeIds(content, into) {
8
8
  if (!content) return into;
9
- if (content.type === "composite" && typeof content.attrs?.id === "string" && content.attrs.id) into.add(content.attrs.id);
9
+ if (content.type === "typedBlock" && typeof content.attrs?.id === "string" && content.attrs.id) into.add(content.attrs.id);
10
10
  for (const child of content.content ?? []) collectCompositeIds(child, into);
11
11
  return into;
12
12
  }
13
13
  /**
14
14
  * Turns `[@<id>]` / `[@<id>, <locator>]` tokens in text nodes into `reference` nodes (attrs target, locator, empty
15
15
  * `label`: the node view resolves the live label) — for imported and AI-generated Markdown, whose parser keeps the
16
- * token as text. Only ids in `ids` (the Bausteine of the document) match; unknown ids and text in code blocks, inline
16
+ * token as text. Only ids in `ids` (the Typed blocks of the document) match; unknown ids and text in code blocks, inline
17
17
  * code or links stay plain. Returns the input unchanged when nothing matched.
18
18
  */
19
19
  function referencesFromText(json, ids) {
@@ -65,11 +65,11 @@ function referencesFromText(json, ids) {
65
65
  };
66
66
  return walk(json);
67
67
  }
68
- /** Block IDs of the composites of `doc`: the Bausteine a `[@id]` text may point at. */
68
+ /** Block IDs of the composites of `doc`: the Typed blocks a `[@id]` text may point at. */
69
69
  function compositeIdsOf(doc) {
70
70
  const ids = /* @__PURE__ */ new Set();
71
71
  doc.descendants((node) => {
72
- if (node.type.name !== "composite") return;
72
+ if (node.type.name !== "typedBlock") return;
73
73
  const id = blockIdOf(node);
74
74
  if (id) ids.add(id);
75
75
  });
@@ -1 +1 @@
1
- {"version":3,"file":"reference-text.js","names":[],"sources":["../../../src/features/composites/reference-text.ts"],"sourcesContent":["import type { JSONContent } from '@tiptap/core'\nimport type { Node as PMNode } from '@tiptap/pm/model'\nimport { blockIdOf } from '../../core/schema'\nimport { REFERENCE_TOKEN_SOURCE } from './reference'\n\n/** `[@<block id>]` or `[@<block id>, <locator>]`; a `]` inside the locator is written `\\]`. */\nconst TOKEN = new RegExp(REFERENCE_TOKEN_SOURCE, 'g')\n\n/** Block IDs of every composite in a TipTap JSON tree, added to `into`. */\nexport function collectCompositeIds(content: JSONContent | null | undefined, into: Set<string>): Set<string> {\n if (!content) return into\n if (content.type === 'composite' && typeof content.attrs?.id === 'string' && content.attrs.id) into.add(content.attrs.id)\n for (const child of content.content ?? []) collectCompositeIds(child, into)\n return into\n}\n\n/**\n * Turns `[@<id>]` / `[@<id>, <locator>]` tokens in text nodes into `reference` nodes (attrs target, locator, empty\n * `label`: the node view resolves the live label) — for imported and AI-generated Markdown, whose parser keeps the\n * token as text. Only ids in `ids` (the Bausteine of the document) match; unknown ids and text in code blocks, inline\n * code or links stay plain. Returns the input unchanged when nothing matched.\n */\nexport function referencesFromText(json: JSONContent, ids: ReadonlySet<string>): JSONContent {\n if (!ids.size) return json\n\n const splitText = (node: JSONContent): JSONContent[] => {\n const text = node.text ?? ''\n if (!text.includes('[@') || node.marks?.some(m => m.type === 'code' || m.type === 'link')) return [node]\n const out: JSONContent[] = []\n let last = 0\n for (const match of text.matchAll(TOKEN)) {\n const target = match[1]!\n if (!ids.has(target)) continue\n const at = match.index ?? 0\n if (at > last) out.push({ ...node, text: text.slice(last, at) })\n out.push({\n type: 'reference',\n attrs: { target, documentId: null, locator: match[2]?.replace(/\\\\\\]/g, ']').trim() || null, label: '' },\n ...(node.marks?.length ? { marks: node.marks } : {}),\n })\n last = at + match[0].length\n }\n if (!out.length) return [node]\n if (last < text.length) out.push({ ...node, text: text.slice(last) })\n return out\n }\n\n const walk = (node: JSONContent): JSONContent => {\n if (!node.content || node.type === 'codeBlock') return node\n let changed = false\n const content = node.content.flatMap((child) => {\n const next = child.type === 'text' ? splitText(child) : [walk(child)]\n if (next.length !== 1 || next[0] !== child) changed = true\n return next\n })\n return changed ? { ...node, content } : node\n }\n return walk(json)\n}\n\n/** Block IDs of the composites of `doc`: the Bausteine a `[@id]` text may point at. */\nexport function compositeIdsOf(doc: PMNode): Set<string> {\n const ids = new Set<string>()\n doc.descendants((node) => {\n if (node.type.name !== 'composite') return\n const id = blockIdOf(node)\n if (id) ids.add(id)\n })\n return ids\n}\n\n/** The `normalize` stage: the composites of the document (`current`) and of `blocks` themselves may be referenced by text. */\nexport function normalizeReferences(blocks: JSONContent[], current: ReadonlySet<string>): JSONContent[] {\n const doc: JSONContent = { type: 'doc', content: blocks }\n return referencesFromText(doc, collectCompositeIds(doc, new Set(current))).content ?? []\n}\n"],"mappings":";;;;AAMA,MAAM,QAAQ,IAAI,OAAO,wBAAwB,GAAG;;AAGpD,SAAgB,oBAAoB,SAAyC,MAAgC;CAC3G,IAAI,CAAC,SAAS,OAAO;CACrB,IAAI,QAAQ,SAAS,eAAe,OAAO,QAAQ,OAAO,OAAO,YAAY,QAAQ,MAAM,IAAI,KAAK,IAAI,QAAQ,MAAM,EAAE;CACxH,KAAK,MA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SAAS,UAAU,KAAK,IAAI,CAAC,KAAK,KAAK,CAAC;GACpE,IAAI,KAAK,WAAW,KAAK,KAAK,OAAO,OAAO,UAAU;GACtD,OAAO;EACT,CAAC;EACD,OAAO,UAAU;GAAE,GAAG;GAAM;EAAQ,IAAI;CAC1C;CACA,OAAO,KAAK,IAAI;AAClB;;AAGA,SAAgB,eAAe,KAA0B;CACvD,MAAM,sBAAM,IAAI,IAAY;CAC5B,IAAI,aAAa,SAAS;EACxB,IAAI,KAAK,KAAK,SAAS,aAAa;EACpC,MAAM,KAAK,UAAU,IAAI;EACzB,IAAI,IAAI,IAAI,IAAI,EAAE;CACpB,CAAC;CACD,OAAO;AACT;;AAGA,SAAgB,oBAAoB,QAAuB,SAA6C;CACtG,MAAM,MAAmB;EAAE,MAAM;EAAO,SAAS;CAAO;CACxD,OAAO,mBAAmB,KAAK,oBAAoB,KAAK,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;AACzF"}
1
+ {"version":3,"file":"reference-text.js","names":[],"sources":["../../../src/features/composites/reference-text.ts"],"sourcesContent":["import type { JSONContent } from '@tiptap/core'\nimport type { Node as PMNode } from '@tiptap/pm/model'\nimport { blockIdOf } from '../../core/schema'\nimport { REFERENCE_TOKEN_SOURCE } from './reference'\n\n/** `[@<block id>]` or `[@<block id>, <locator>]`; a `]` inside the locator is written `\\]`. */\nconst TOKEN = new RegExp(REFERENCE_TOKEN_SOURCE, 'g')\n\n/** Block IDs of every composite in a TipTap JSON tree, added to `into`. */\nexport function collectCompositeIds(content: JSONContent | null | undefined, into: Set<string>): Set<string> {\n if (!content) return into\n if (content.type === 'typedBlock' && typeof content.attrs?.id === 'string' && content.attrs.id) into.add(content.attrs.id)\n for (const child of content.content ?? []) collectCompositeIds(child, into)\n return into\n}\n\n/**\n * Turns `[@<id>]` / `[@<id>, <locator>]` tokens in text nodes into `reference` nodes (attrs target, locator, empty\n * `label`: the node view resolves the live label) — for imported and AI-generated Markdown, whose parser keeps the\n * token as text. Only ids in `ids` (the Typed blocks of the document) match; unknown ids and text in code blocks, inline\n * code or links stay plain. Returns the input unchanged when nothing matched.\n */\nexport function referencesFromText(json: JSONContent, ids: ReadonlySet<string>): JSONContent {\n if (!ids.size) return json\n\n const splitText = (node: JSONContent): JSONContent[] => {\n const text = node.text ?? ''\n if (!text.includes('[@') || node.marks?.some(m => m.type === 'code' || m.type === 'link')) return [node]\n const out: JSONContent[] = []\n let last = 0\n for (const match of text.matchAll(TOKEN)) {\n const target = match[1]!\n if (!ids.has(target)) continue\n const at = match.index ?? 0\n if (at > last) out.push({ ...node, text: text.slice(last, at) })\n out.push({\n type: 'reference',\n attrs: { target, documentId: null, locator: match[2]?.replace(/\\\\\\]/g, ']').trim() || null, label: '' },\n ...(node.marks?.length ? { marks: node.marks } : {}),\n })\n last = at + match[0].length\n }\n if (!out.length) return [node]\n if (last < text.length) out.push({ ...node, text: text.slice(last) })\n return out\n }\n\n const walk = (node: JSONContent): JSONContent => {\n if (!node.content || node.type === 'codeBlock') return node\n let changed = false\n const content = node.content.flatMap((child) => {\n const next = child.type === 'text' ? splitText(child) : [walk(child)]\n if (next.length !== 1 || next[0] !== child) changed = true\n return next\n })\n return changed ? { ...node, content } : node\n }\n return walk(json)\n}\n\n/** Block IDs of the composites of `doc`: the Typed blocks a `[@id]` text may point at. */\nexport function compositeIdsOf(doc: PMNode): Set<string> {\n const ids = new Set<string>()\n doc.descendants((node) => {\n if (node.type.name !== 'typedBlock') return\n const id = blockIdOf(node)\n if (id) ids.add(id)\n })\n return ids\n}\n\n/** The `normalize` stage: the composites of the document (`current`) and of `blocks` themselves may be referenced by text. */\nexport function normalizeReferences(blocks: JSONContent[], current: ReadonlySet<string>): JSONContent[] {\n const doc: JSONContent = { type: 'doc', content: blocks }\n return referencesFromText(doc, collectCompositeIds(doc, new Set(current))).content ?? []\n}\n"],"mappings":";;;;AAMA,MAAM,QAAQ,IAAI,OAAO,wBAAwB,GAAG;;AAGpD,SAAgB,oB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AO;CACT;CAEA,MAAM,QAAQ,SAAmC;EAC/C,IAAI,CAAC,KAAK,WAAW,KAAK,SAAS,aAAa,OAAO;EACvD,IAAI,UAAU;EACd,MAAM,UAAU,KAAK,QAAQ,SAAS,UAAU;GAC9C,MAAM,OAAO,MAAM,SAAS,SAAS,UAAU,KAAK,IAAI,CAAC,KAAK,KAAK,CAAC;GACpE,IAAI,KAAK,WAAW,KAAK,KAAK,OAAO,OAAO,UAAU;GACtD,OAAO;EACT,CAAC;EACD,OAAO,UAAU;GAAE,GAAG;GAAM;EAAQ,IAAI;CAC1C;CACA,OAAO,KAAK,IAAI;AAClB;;AAGA,SAAgB,eAAe,KAA0B;CACvD,MAAM,sBAAM,IAAI,IAAY;CAC5B,IAAI,aAAa,SAAS;EACxB,IAAI,KAAK,KAAK,SAAS,cAAc;EACrC,MAAM,KAAK,UAAU,IAAI;EACzB,IAAI,IAAI,IAAI,IAAI,EAAE;CACpB,CAAC;CACD,OAAO;AACT;;AAGA,SAAgB,oBAAoB,QAAuB,SAA6C;CACtG,MAAM,MAAmB;EAAE,MAAM;EAAO,SAAS;CAAO;CACxD,OAAO,mBAAmB,KAAK,oBAAoB,KAAK,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;AACzF"}
@@ -3,14 +3,14 @@ import { PluginKey } from "@tiptap/pm/state";
3
3
  import { SuggestionOptions } from "@tiptap/suggestion";
4
4
  //#region src/features/composites/reference.d.ts
5
5
  /**
6
- * Attributes of a reference chip. `target` is the block ID of the referenced Baustein; `label` caches its display text
6
+ * Attributes of a reference chip. `target` is the block ID of the referenced Typed block; `label` caches its display text
7
7
  * for the cases the target cannot be resolved (the node view shows the live label and only falls back to this one).
8
8
  */
9
9
  export interface ReferenceAttrs {
10
10
  target: string;
11
11
  /** Document of the target; `null` = this document (cross-document references are not resolved yet). */
12
12
  documentId: string | null;
13
- /** Position inside the target's source: `S. 12` (PDF page), `03:14` (recording time); `null` = the whole Baustein. */
13
+ /** Position inside the target's source: `S. 12` (PDF page), `03:14` (recording time); `null` = the whole Typed block. */
14
14
  locator: string | null;
15
15
  label: string;
16
16
  }
@@ -35,7 +35,7 @@ export interface ReferenceOptions {
35
35
  /** Own key, so the `[@` popup runs next to the `@` mention and `#` tag popups. */
36
36
  export declare const ReferenceSuggestionPluginKey: PluginKey<any>;
37
37
  /**
38
- * Inline chip pointing at a Baustein of the document (a paper, a recording, a note): shared by the client editor and
38
+ * Inline chip pointing at a Typed block of the document (a paper, a recording, a note): shared by the client editor and
39
39
  * the server (collab schema, Markdown). Markdown form `[@<block id>, <locator>]`; text of that form becomes chips again
40
40
  * through `referencesFromText` (the composites feature's `normalize` stage). The client adds the node view and the popup.
41
41
  */
@@ -13,7 +13,7 @@ const REFERENCE_TOKEN_SOURCE = String.raw`\[@([0-9a-f-]{36})(?:,\s*((?:\\\]|[^\]
13
13
  /** Own key, so the `[@` popup runs next to the `@` mention and `#` tag popups. */
14
14
  const ReferenceSuggestionPluginKey = new PluginKey("referenceSuggestion");
15
15
  /**
16
- * Inline chip pointing at a Baustein of the document (a paper, a recording, a note): shared by the client editor and
16
+ * Inline chip pointing at a Typed block of the document (a paper, a recording, a note): shared by the client editor and
17
17
  * the server (collab schema, Markdown). Markdown form `[@<block id>, <locator>]`; text of that form becomes chips again
18
18
  * through `referencesFromText` (the composites feature's `normalize` stage). The client adds the node view and the popup.
19
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"reference.js","names":[],"sources":["../../../src/features/composites/reference.ts"],"sourcesContent":["import { Extension, mergeAttributes, Node } from '@tiptap/core'\nimport { PluginKey } from '@tiptap/pm/state'\nimport { Suggestion, type SuggestionOptions } from '@tiptap/suggestion'\n\n/**\n * Attributes of a reference chip. `target` is the block ID of the referenced Baustein; `label` caches its display text\n * for the cases the target cannot be resolved (the node view shows the live label and only falls back to this one).\n */\nexport interface ReferenceAttrs {\n target: string\n /** Document of the target; `null` = this document (cross-document references are not resolved yet). */\n documentId: string | null\n /** Position inside the target's source: `S. 12` (PDF page), `03:14` (recording time); `null` = the whole Baustein. */\n locator: string | null\n label: string\n}\n\nexport const REFERENCE_NODE = 'reference'\n\n/** Trigger of the popup. Two characters: `[@` is the Markdown form, so typing it by hand and picking from the list agree. */\nexport const REFERENCE_TRIGGER = '[@'\n\n/** `[@<target>]` / `[@<target>, <locator>]`, the chip's Markdown form; `]` in a locator is escaped as `\\]`. */\nexport function referenceMarkdown(attrs: Pick<ReferenceAttrs, 'target' | 'locator'>): string {\n const locator = attrs.locator?.trim()\n return locator ? `[@${attrs.target}, ${locator.replace(/\\]/g, '\\\\]')}]` : `[@${attrs.target}]`\n}\n\n/** Pattern of the chip's Markdown form (capture 1: block id, capture 2: locator with `\\]` still escaped); compile with `new RegExp(..., 'g')`. */\nexport const REFERENCE_TOKEN_SOURCE = String.raw`\\[@([0-9a-f-]{36})(?:,\\s*((?:\\\\\\]|[^\\]])+))?\\]`\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n reference: {\n /** Inserts a reference chip (followed by a space) at the selection. */\n insertReference: (attrs: Partial<ReferenceAttrs> & Pick<ReferenceAttrs, 'target'>) => ReturnType\n /** Sets the locator of the reference chip at `pos`; an empty text clears it. */\n setReferenceLocator: (pos: number, locator: string) => ReturnType\n }\n }\n}\n\nexport interface ReferenceOptions {\n HTMLAttributes: Record<string, unknown>\n /** `[@` popup (client only, see reference-suggestion.ts); `null` = schema only (server, Markdown). */\n suggestion: Omit<SuggestionOptions<ReferenceAttrs, ReferenceAttrs>, 'editor'> | null\n}\n\n/** Own key, so the `[@` popup runs next to the `@` mention and `#` tag popups. */\nexport const ReferenceSuggestionPluginKey = new PluginKey('referenceSuggestion')\n\n/**\n * Inline chip pointing at a Baustein of the document (a paper, a recording, a note): shared by the client editor and\n * the server (collab schema, Markdown). Markdown form `[@<block id>, <locator>]`; text of that form becomes chips again\n * through `referencesFromText` (the composites feature's `normalize` stage). The client adds the node view and the popup.\n */\nexport const ReferenceNode = Node.create<ReferenceOptions>({\n name: REFERENCE_NODE,\n group: 'inline',\n inline: true,\n atom: true,\n selectable: true,\n // Just below Mention (100): TipTap's Markdown manager registers the tokenizers in priority order and marked tries the\n // last registered first, so `markdownTokenizer` below sees `[@<id>]` before Mention's `[@ ...]` shortcode does.\n priority: 99,\n\n // Claims `[@<block id>, <locator>]` as plain text, so Mention's tokenizer (which takes every `[@...]`) leaves it alone;\n // the composites feature's `normalize` stage turns it into a chip when the id belongs to a Baustein of the document.\n markdownTokenizer: {\n name: 'referenceToken',\n level: 'inline',\n start: src => src.search(/\\[@[0-9a-f-]{36}/),\n tokenize: (src) => {\n const match = new RegExp(`^${REFERENCE_TOKEN_SOURCE}`).exec(src)\n return match ? { type: 'text', raw: match[0], text: match[0] } : undefined\n },\n },\n\n addOptions() {\n return { HTMLAttributes: { class: 'reference' }, suggestion: null }\n },\n\n addAttributes() {\n return {\n target: {\n default: '',\n parseHTML: el => el.getAttribute('data-target') ?? '',\n renderHTML: attrs => ({ 'data-target': attrs.target }),\n },\n documentId: {\n default: null,\n parseHTML: el => el.getAttribute('data-document'),\n renderHTML: attrs => attrs.documentId ? { 'data-document': attrs.documentId } : {},\n },\n locator: {\n default: null,\n parseHTML: el => el.getAttribute('data-locator'),\n renderHTML: attrs => attrs.locator ? { 'data-locator': attrs.locator } : {},\n },\n label: {\n default: '',\n parseHTML: el => el.getAttribute('data-label') ?? el.textContent ?? '',\n renderHTML: attrs => ({ 'data-label': attrs.label }),\n },\n }\n },\n\n parseHTML() {\n return [{ tag: `span[data-type=\"${this.name}\"]` }]\n },\n\n renderHTML({ node, HTMLAttributes }) {\n return ['span', mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes), String(node.attrs.label ?? '')]\n },\n\n renderText: ({ node }) => referenceMarkdown(node.attrs as ReferenceAttrs),\n\n // Markdown export (editor.getMarkdown(), AI context/selection) writes the chip as `[@<id>, <locator>]`.\n renderMarkdown: node => referenceMarkdown({ target: String(node.attrs?.target ?? ''), locator: typeof node.attrs?.locator === 'string' ? node.attrs.locator : null }),\n\n addCommands() {\n return {\n insertReference: attrs => ({ commands }) =>\n commands.insertContent([{ type: this.name, attrs }, { type: 'text', text: ' ' }]),\n setReferenceLocator: (pos, locator) => ({ tr, dispatch }) => {\n const node = tr.doc.nodeAt(pos)\n if (node?.type.name !== this.name) return false\n if (dispatch) tr.setNodeMarkup(pos, undefined, { ...node.attrs, locator: locator.trim() || null })\n return true\n },\n }\n },\n\n // The popup lives in a companion extension (see `ReferenceSuggestion`): it must rank above TipTap's core keymap\n // (100) to see Enter first, which this node cannot (its priority orders the Markdown tokenizer).\n addExtensions() {\n const { suggestion } = this.options\n return suggestion ? [ReferenceSuggestion.configure({ suggestion })] : []\n },\n})\n\n/**\n * The `[@` popup of ReferenceNode. Priority 101 (like TagNode), above core's Keymap (100): extension priority orders\n * the ProseMirror plugins' `handleKeyDown`, and with a lower one Enter would split the paragraph instead of picking.\n */\nexport const ReferenceSuggestion = Extension.create<{ suggestion: NonNullable<ReferenceOptions['suggestion']> | null }>({\n name: 'referenceSuggestion',\n priority: 101,\n\n addOptions() {\n return { suggestion: null }\n },\n\n addProseMirrorPlugins() {\n const { suggestion } = this.options\n if (!suggestion) return []\n const { allow, ...rest } = suggestion\n return [Suggestion<ReferenceAttrs, ReferenceAttrs>({\n pluginKey: ReferenceSuggestionPluginKey,\n char: REFERENCE_TRIGGER,\n allowSpaces: true,\n allow: p => allow?.(p) ?? true,\n command: ({ editor, range, props }) => {\n // Reuse a following space instead of doubling it (as Mention does).\n const nodeAfter = editor.view.state.selection.$to.nodeAfter\n if (nodeAfter?.text?.startsWith(' ')) range.to += 1\n editor.chain().focus()\n .insertContentAt(range, [{ type: REFERENCE_NODE, attrs: props }, { type: 'text', text: ' ' }])\n .run()\n editor.view.dom.ownerDocument.defaultView?.getSelection()?.collapseToEnd()\n },\n ...rest,\n editor: this.editor,\n })]\n },\n})\n"],"mappings":";;;;AAiBA,MAAa,iBAAiB;;AAM9B,SAAgB,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EAC3B,OAAO,CAAC,WAA2C;GACjD,WAAW;GACX,MAAA;GACA,aAAa;GACb,QAAO,MAAK,QAAQ,CAAC,KAAK;GAC1B,UAAU,EAAE,QAAQ,OAAO,YAAY;IAGrC,IADkB,OAAO,KAAK,MAAM,UAAU,IAAI,WACnC,MAAM,WAAW,GAAG,GAAG,MAAM,MAAM;IAClD,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CACnB,gBAAgB,OAAO,CAAC;KAAE,MAAM;KAAgB,OAAO;IAAM,GAAG;KAAE,MAAM;KAAQ,MAAM;IAAI,CAAC,CAAC,CAAC,CAC7F,IAAI;IACP,OAAO,KAAK,IAAI,cAAc,aAAa,aAAa,CAAC,EAAE,cAAc;GAC3E;GACA,GAAG;GACH,QAAQ,KAAK;EACf,CAAC,CAAC;CACJ;AACF,CAAC"}
1
+ {"version":3,"file":"reference.js","names":[],"sources":["../../../src/features/composites/reference.ts"],"sourcesContent":["import { Extension, mergeAttributes, Node } from '@tiptap/core'\nimport { PluginKey } from '@tiptap/pm/state'\nimport { Suggestion, type SuggestionOptions } from '@tiptap/suggestion'\n\n/**\n * Attributes of a reference chip. `target` is the block ID of the referenced Typed block; `label` caches its display text\n * for the cases the target cannot be resolved (the node view shows the live label and only falls back to this one).\n */\nexport interface ReferenceAttrs {\n target: string\n /** Document of the target; `null` = this document (cross-document references are not resolved yet). */\n documentId: string | null\n /** Position inside the target's source: `S. 12` (PDF page), `03:14` (recording time); `null` = the whole Typed block. */\n locator: string | null\n label: string\n}\n\nexport const REFERENCE_NODE = 'reference'\n\n/** Trigger of the popup. Two characters: `[@` is the Markdown form, so typing it by hand and picking from the list agree. */\nexport const REFERENCE_TRIGGER = '[@'\n\n/** `[@<target>]` / `[@<target>, <locator>]`, the chip's Markdown form; `]` in a locator is escaped as `\\]`. */\nexport function referenceMarkdown(attrs: Pick<ReferenceAttrs, 'target' | 'locator'>): string {\n const locator = attrs.locator?.trim()\n return locator ? `[@${attrs.target}, ${locator.replace(/\\]/g, '\\\\]')}]` : `[@${attrs.target}]`\n}\n\n/** Pattern of the chip's Markdown form (capture 1: block id, capture 2: locator with `\\]` still escaped); compile with `new RegExp(..., 'g')`. */\nexport const REFERENCE_TOKEN_SOURCE = String.raw`\\[@([0-9a-f-]{36})(?:,\\s*((?:\\\\\\]|[^\\]])+))?\\]`\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n reference: {\n /** Inserts a reference chip (followed by a space) at the selection. */\n insertReference: (attrs: Partial<ReferenceAttrs> & Pick<ReferenceAttrs, 'target'>) => ReturnType\n /** Sets the locator of the reference chip at `pos`; an empty text clears it. */\n setReferenceLocator: (pos: number, locator: string) => ReturnType\n }\n }\n}\n\nexport interface ReferenceOptions {\n HTMLAttributes: Record<string, unknown>\n /** `[@` popup (client only, see reference-suggestion.ts); `null` = schema only (server, Markdown). */\n suggestion: Omit<SuggestionOptions<ReferenceAttrs, ReferenceAttrs>, 'editor'> | null\n}\n\n/** Own key, so the `[@` popup runs next to the `@` mention and `#` tag popups. */\nexport const ReferenceSuggestionPluginKey = new PluginKey('referenceSuggestion')\n\n/**\n * Inline chip pointing at a Typed block of the document (a paper, a recording, a note): shared by the client editor and\n * the server (collab schema, Markdown). Markdown form `[@<block id>, <locator>]`; text of that form becomes chips again\n * through `referencesFromText` (the composites feature's `normalize` stage). The client adds the node view and the popup.\n */\nexport const ReferenceNode = Node.create<ReferenceOptions>({\n name: REFERENCE_NODE,\n group: 'inline',\n inline: true,\n atom: true,\n selectable: true,\n // Just below Mention (100): TipTap's Markdown manager registers the tokenizers in priority order and marked tries the\n // last registered first, so `markdownTokenizer` below sees `[@<id>]` before Mention's `[@ ...]` shortcode does.\n priority: 99,\n\n // Claims `[@<block id>, <locator>]` as plain text, so Mention's tokenizer (which takes every `[@...]`) leaves it alone;\n // the composites feature's `normalize` stage turns it into a chip when the id belongs to a Typed block of the document.\n markdownTokenizer: {\n name: 'referenceToken',\n level: 'inline',\n start: src => src.search(/\\[@[0-9a-f-]{36}/),\n tokenize: (src) => {\n const match = new RegExp(`^${REFERENCE_TOKEN_SOURCE}`).exec(src)\n return match ? { type: 'text', raw: match[0], text: match[0] } : undefined\n },\n },\n\n addOptions() {\n return { HTMLAttributes: { class: 'reference' }, suggestion: null }\n },\n\n addAttributes() {\n return {\n target: {\n default: '',\n parseHTML: el => el.getAttribute('data-target') ?? '',\n renderHTML: attrs => ({ 'data-target': attrs.target }),\n },\n documentId: {\n default: null,\n parseHTML: el => el.getAttribute('data-document'),\n renderHTML: attrs => attrs.documentId ? { 'data-document': attrs.documentId } : {},\n },\n locator: {\n default: null,\n parseHTML: el => el.getAttribute('data-locator'),\n renderHTML: attrs => attrs.locator ? { 'data-locator': attrs.locator } : {},\n },\n label: {\n default: '',\n parseHTML: el => el.getAttribute('data-label') ?? el.textContent ?? '',\n renderHTML: attrs => ({ 'data-label': attrs.label }),\n },\n }\n },\n\n parseHTML() {\n return [{ tag: `span[data-type=\"${this.name}\"]` }]\n },\n\n renderHTML({ node, HTMLAttributes }) {\n return ['span', mergeAttributes({ 'data-type': this.name }, this.options.HTMLAttributes, HTMLAttributes), String(node.attrs.label ?? '')]\n },\n\n renderText: ({ node }) => referenceMarkdown(node.attrs as ReferenceAttrs),\n\n // Markdown export (editor.getMarkdown(), AI context/selection) writes the chip as `[@<id>, <locator>]`.\n renderMarkdown: node => referenceMarkdown({ target: String(node.attrs?.target ?? ''), locator: typeof node.attrs?.locator === 'string' ? node.attrs.locator : null }),\n\n addCommands() {\n return {\n insertReference: attrs => ({ commands }) =>\n commands.insertContent([{ type: this.name, attrs }, { type: 'text', text: ' ' }]),\n setReferenceLocator: (pos, locator) => ({ tr, dispatch }) => {\n const node = tr.doc.nodeAt(pos)\n if (node?.type.name !== this.name) return false\n if (dispatch) tr.setNodeMarkup(pos, undefined, { ...node.attrs, locator: locator.trim() || null })\n return true\n },\n }\n },\n\n // The popup lives in a companion extension (see `ReferenceSuggestion`): it must rank above TipTap's core keymap\n // (100) to see Enter first, which this node cannot (its priority orders the Markdown tokenizer).\n addExtensions() {\n const { suggestion } = this.options\n return suggestion ? [ReferenceSuggestion.configure({ suggestion })] : []\n },\n})\n\n/**\n * The `[@` popup of ReferenceNode. Priority 101 (like TagNode), above core's Keymap (100): extension priority orders\n * the ProseMirror plugins' `handleKeyDown`, and with a lower one Enter would split the paragraph instead of picking.\n */\nexport const ReferenceSuggestion = Extension.create<{ suggestion: NonNullable<ReferenceOptions['suggestion']> | null }>({\n name: 'referenceSuggestion',\n priority: 101,\n\n addOptions() {\n return { suggestion: null }\n },\n\n addProseMirrorPlugins() {\n const { suggestion } = this.options\n if (!suggestion) return []\n const { allow, ...rest } = suggestion\n return [Suggestion<ReferenceAttrs, ReferenceAttrs>({\n pluginKey: ReferenceSuggestionPluginKey,\n char: REFERENCE_TRIGGER,\n allowSpaces: true,\n allow: p => allow?.(p) ?? true,\n command: ({ editor, range, props }) => {\n // Reuse a following space instead of doubling it (as Mention does).\n const nodeAfter = editor.view.state.selection.$to.nodeAfter\n if (nodeAfter?.text?.startsWith(' ')) range.to += 1\n editor.chain().focus()\n .insertContentAt(range, [{ type: REFERENCE_NODE, attrs: props }, { type: 'text', text: ' ' }])\n .run()\n editor.view.dom.ownerDocument.defaultView?.getSelection()?.collapseToEnd()\n },\n ...rest,\n editor: this.editor,\n })]\n },\n})\n"],"mappings":";;;;AAiBA,MAAa,iBAAiB;;AAM9B,SAAgB,kBAAkB,OAA2D;CAC3F,MAAM,UAAU,MAAM,SAAS,KAAK;CACpC,OAAO,UAAU,KAAK,MAAM,OAAO,IAAI,QAAQ,QAAQ,OAAO,KAAK,EAAE,KAAK,KAAK,MAAM,OAAO;AAC9F;;AAGA,MAAa,yBAAyB,OAAO,GAAG;;AAoBhD,MAAa,+BAA+B,IAAI,UAAU,qBAAqB;;;;;;AAO/E,MAAa,gBAAgB,KAAK,OAAyB;CACzD,MAAM;CACN,OAAO;CACP,QAAQ;CACR,MAAM;CACN,YAAY;CAGZ,UAAU;CAIV,mBAAm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AC,CAAC,CAAC,CAC7F,IAAI;IACP,OAAO,KAAK,IAAI,cAAc,aAAa,aAAa,CAAC,EAAE,cAAc;GAC3E;GACA,GAAG;GACH,QAAQ,KAAK;EACf,CAAC,CAAC;CACJ;AACF,CAAC"}
@@ -3,7 +3,7 @@ import { Editor, Extension } from "@tiptap/core";
3
3
  declare module '@tiptap/core' {
4
4
  interface Commands<ReturnType> {
5
5
  sourceReveal: {
6
- /** Seek and play the media of the source-holding Baustein enclosing `pos` to `seconds`; silent when there is none. */
6
+ /** Seek and play the media of the source-holding Typed block enclosing `pos` to `seconds`; silent when there is none. */
7
7
  seekSource: (pos: number, seconds: number) => ReturnType;
8
8
  };
9
9
  }
@@ -17,12 +17,12 @@ export type SourceLocator = {
17
17
  /** Parses a reference locator; null for anything that is not a time or a page number. */
18
18
  export declare function parseLocator(locator: string | null | undefined): SourceLocator | null;
19
19
  /**
20
- * Seeks and plays the audio/video of the nearest source-holding Baustein around `pos` (a transcript segment inside a
20
+ * Seeks and plays the audio/video of the nearest source-holding Typed block around `pos` (a transcript segment inside a
21
21
  * rendition reaches the recording that way). Silent when there is no source or no media element.
22
22
  */
23
23
  export declare function seekSource(editor: Editor, pos: number, seconds: number): void;
24
24
  /**
25
- * Shows the source of Baustein `targetId` at `locator`: a `mm:ss` time seeks the media, a page number opens a PDF source
25
+ * Shows the source of Typed block `targetId` at `locator`: a `mm:ss` time seeks the media, a page number opens a PDF source
26
26
  * at that page; then the source block flashes. Silent when the target or its source is gone.
27
27
  */
28
28
  export declare function revealSource(editor: Editor, targetId: string, locator: string | null): void;
@@ -1,6 +1,6 @@
1
1
  import { blockIdOf, findBlockById } from "../../core/schema/block-ids.js";
2
- import { sourceOf } from "./derivation.js";
3
- import { compositeKindsOf } from "./nodes.js";
2
+ import { blockTypesOf } from "./nodes.js";
3
+ import { sourceOf } from "./source.js";
4
4
  import { Extension } from "@tiptap/core";
5
5
  //#region src/features/composites/reveal-source.ts
6
6
  /** DOM event the PDF file view listens for; `detail` is the 1-based page to open the viewer at. */
@@ -19,7 +19,7 @@ function parseLocator(locator) {
19
19
  }
20
20
  /** The source block of the composite `composite` at `pos` with its document position, or null. */
21
21
  function sourceAt(editor, composite, pos) {
22
- const source = sourceOf(composite, compositeKindsOf(editor));
22
+ const source = sourceOf(composite, blockTypesOf(editor));
23
23
  if (!source) return null;
24
24
  let sourcePos = pos + 1;
25
25
  for (let i = 0; i < source.index; i++) sourcePos += composite.child(i).nodeSize;
@@ -44,7 +44,7 @@ function playAt(editor, sourcePos, seconds) {
44
44
  return true;
45
45
  }
46
46
  /**
47
- * Seeks and plays the audio/video of the nearest source-holding Baustein around `pos` (a transcript segment inside a
47
+ * Seeks and plays the audio/video of the nearest source-holding Typed block around `pos` (a transcript segment inside a
48
48
  * rendition reaches the recording that way). Silent when there is no source or no media element.
49
49
  */
50
50
  function seekSource(editor, pos, seconds) {
@@ -52,7 +52,7 @@ function seekSource(editor, pos, seconds) {
52
52
  const $pos = editor.state.doc.resolve(pos);
53
53
  for (let depth = $pos.depth; depth >= 0; depth--) {
54
54
  const composite = $pos.node(depth);
55
- if (composite.type.name !== "composite") continue;
55
+ if (composite.type.name !== "typedBlock") continue;
56
56
  const source = sourceAt(editor, composite, $pos.before(depth));
57
57
  if (!source) continue;
58
58
  playAt(editor, source.pos, seconds);
@@ -60,7 +60,7 @@ function seekSource(editor, pos, seconds) {
60
60
  }
61
61
  }
62
62
  /**
63
- * Shows the source of Baustein `targetId` at `locator`: a `mm:ss` time seeks the media, a page number opens a PDF source
63
+ * Shows the source of Typed block `targetId` at `locator`: a `mm:ss` time seeks the media, a page number opens a PDF source
64
64
  * at that page; then the source block flashes. Silent when the target or its source is gone.
65
65
  */
66
66
  function revealSource(editor, targetId, locator) {