@blokkli/editor 2.0.0-alpha.59 → 2.0.0-alpha.61

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 (324) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +28 -11
  3. package/dist/modules/agent/index.mjs +2 -5
  4. package/dist/modules/agent/runtime/app/features/agent/Container.vue +3 -3
  5. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +15 -3
  6. package/dist/modules/agent/runtime/app/features/agent/index.vue +5 -1
  7. package/dist/modules/agent/runtime/app/features/agent/types.d.ts +2 -1
  8. package/dist/modules/agent/runtime/app/helpers/mutationResult.d.ts +38 -0
  9. package/dist/modules/agent/runtime/app/helpers/mutationResult.js +49 -0
  10. package/dist/modules/agent/runtime/app/prompts/fixReadability.js +3 -3
  11. package/dist/modules/agent/runtime/app/providers/agentProvider.d.ts +2 -1
  12. package/dist/modules/agent/runtime/app/providers/agentProvider.js +6 -6
  13. package/dist/modules/agent/runtime/app/providers/toolsProvider.js +3 -13
  14. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.d.ts +25 -0
  15. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.js +3 -2
  16. package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +22 -0
  17. package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +3 -2
  18. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +24 -0
  19. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +3 -2
  20. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +32 -0
  21. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +6 -4
  22. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +22 -0
  23. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +3 -2
  24. package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +22 -0
  25. package/dist/modules/agent/runtime/app/tools/add_template/index.js +5 -3
  26. package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +3 -3
  27. package/dist/modules/agent/runtime/app/tools/ask_question/index.js +7 -6
  28. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.d.vue.ts +29 -0
  29. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue +172 -0
  30. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue.d.ts +29 -0
  31. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +28 -0
  32. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.js +80 -0
  33. package/dist/modules/agent/runtime/app/tools/check_readability_for_texts/index.d.ts +17 -0
  34. package/dist/modules/agent/runtime/app/tools/check_readability_for_texts/index.js +2 -2
  35. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +16 -0
  36. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.d.ts +10 -1
  37. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +3 -2
  38. package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +16 -0
  39. package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.js +3 -2
  40. package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +16 -0
  41. package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.js +3 -2
  42. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +22 -0
  43. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +5 -3
  44. package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +31 -0
  45. package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.js +7 -7
  46. package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.d.ts +7 -0
  47. package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.js +2 -2
  48. package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.d.ts +10 -0
  49. package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +3 -3
  50. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.d.ts +35 -0
  51. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +2 -2
  52. package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.d.ts +20 -0
  53. package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.js +2 -2
  54. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +30 -0
  55. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +15 -11
  56. package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.d.ts +25 -0
  57. package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.js +2 -2
  58. package/dist/modules/agent/runtime/app/tools/get_page_structure/index.d.ts +8 -0
  59. package/dist/modules/agent/runtime/app/tools/get_page_structure/index.js +2 -2
  60. package/dist/modules/agent/runtime/app/tools/get_page_text/index.d.ts +8 -0
  61. package/dist/modules/agent/runtime/app/tools/get_page_text/index.js +65 -0
  62. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +81 -0
  63. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +20 -12
  64. package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.d.ts +14 -0
  65. package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +2 -2
  66. package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +38 -0
  67. package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.js +7 -6
  68. package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.d.ts +12 -0
  69. package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.js +2 -2
  70. package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +16 -0
  71. package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.js +62 -0
  72. package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.d.ts +9 -0
  73. package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +2 -2
  74. package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +16 -0
  75. package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.js +3 -2
  76. package/dist/modules/agent/runtime/app/tools/helpers.d.ts +8 -2
  77. package/dist/modules/agent/runtime/app/tools/helpers.js +9 -9
  78. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +22 -0
  79. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +3 -2
  80. package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +21 -0
  81. package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.js +3 -2
  82. package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +20 -0
  83. package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.js +3 -2
  84. package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +19 -0
  85. package/dist/modules/agent/runtime/app/tools/replace_media_field/index.js +3 -2
  86. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +25 -5
  87. package/dist/modules/agent/runtime/app/tools/schemas.js +37 -10
  88. package/dist/modules/agent/runtime/app/tools/search_content/index.d.ts +15 -0
  89. package/dist/modules/agent/runtime/app/tools/search_content/index.js +8 -7
  90. package/dist/modules/agent/runtime/app/tools/search_media/index.d.ts +5 -1
  91. package/dist/modules/agent/runtime/app/tools/search_media/index.js +3 -3
  92. package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.d.ts +16 -0
  93. package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.js +2 -2
  94. package/dist/modules/agent/runtime/app/tools/search_templates/index.d.ts +13 -0
  95. package/dist/modules/agent/runtime/app/tools/search_templates/index.js +2 -2
  96. package/dist/modules/agent/runtime/app/tools/search_text/index.d.ts +15 -0
  97. package/dist/modules/agent/runtime/app/tools/search_text/index.js +2 -2
  98. package/dist/modules/agent/runtime/app/tools/select_media/Component.vue +1 -1
  99. package/dist/modules/agent/runtime/app/tools/select_media/index.d.ts +2 -2
  100. package/dist/modules/agent/runtime/app/tools/select_media/index.js +2 -2
  101. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +19 -0
  102. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +3 -2
  103. package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +17 -0
  104. package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.js +3 -2
  105. package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +13 -4
  106. package/dist/modules/agent/runtime/app/tools/update_text_fields/index.js +8 -7
  107. package/dist/modules/agent/runtime/app/tools/web_fetch/index.d.ts +17 -0
  108. package/dist/modules/agent/runtime/app/tools/web_fetch/index.js +2 -2
  109. package/dist/modules/agent/runtime/app/types/index.d.ts +6 -9
  110. package/dist/modules/agent/runtime/app/types/index.js +4 -3
  111. package/dist/modules/agent/runtime/server/agent.js +1 -2
  112. package/dist/modules/agent/runtime/server/classes/Session/index.d.ts +2 -2
  113. package/dist/modules/agent/runtime/server/classes/Session/index.js +10 -5
  114. package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +2 -1
  115. package/dist/modules/agent/runtime/shared/toolParams.d.ts +19 -0
  116. package/dist/modules/agent/runtime/shared/toolParams.js +6 -0
  117. package/dist/modules/agent/runtime/shared/toolResult.d.ts +4 -0
  118. package/dist/modules/agent/runtime/shared/toolResult.js +5 -0
  119. package/dist/modules/agent/runtime/shared/types.d.ts +23 -4
  120. package/dist/modules/agent/runtime/shared/types.js +6 -1
  121. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +4 -13
  122. package/dist/modules/drupal/graphql/features/notifications.graphql +39 -0
  123. package/dist/modules/drupal/index.mjs +6 -1
  124. package/dist/modules/drupal/runtime/adapter/index.js +38 -0
  125. package/dist/runtime/editor/components/Actions/ItemDropdown/Item.vue +0 -1
  126. package/dist/runtime/editor/components/Actions/ScrollArrow/index.d.vue.ts +13 -0
  127. package/dist/runtime/editor/components/Actions/ScrollArrow/index.vue +52 -0
  128. package/dist/runtime/editor/components/Actions/ScrollArrow/index.vue.d.ts +13 -0
  129. package/dist/runtime/editor/components/Actions/Title/index.vue +9 -8
  130. package/dist/runtime/editor/components/Actions/index.vue +47 -7
  131. package/dist/runtime/editor/components/Actions/useToolbarScroll.d.ts +25 -0
  132. package/dist/runtime/editor/components/Actions/useToolbarScroll.js +125 -0
  133. package/dist/runtime/editor/components/AddListItem/index.vue +0 -2
  134. package/dist/runtime/editor/components/AppMenu/MenuButton.vue +1 -3
  135. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +4 -1
  136. package/dist/runtime/editor/components/Avatar/index.vue +0 -1
  137. package/dist/runtime/editor/components/BlockPreviewRenderer/index.d.vue.ts +1 -1
  138. package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue.d.ts +1 -1
  139. package/dist/runtime/editor/components/BundleSelector/index.vue +0 -4
  140. package/dist/runtime/editor/components/Dialog/index.d.vue.ts +2 -2
  141. package/dist/runtime/editor/components/Dialog/index.vue +1 -3
  142. package/dist/runtime/editor/components/Dialog/index.vue.d.ts +2 -2
  143. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.d.vue.ts +8 -0
  144. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue +12 -2
  145. package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue.d.ts +8 -0
  146. package/dist/runtime/editor/components/DiffApproval/Highlight/index.d.vue.ts +8 -0
  147. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue +14 -2
  148. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue.d.ts +8 -0
  149. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.d.vue.ts +2 -2
  150. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +0 -2
  151. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue.d.ts +2 -2
  152. package/dist/runtime/editor/components/DiffApproval/index.vue +3 -2
  153. package/dist/runtime/editor/components/Dropdown/index.vue +0 -39
  154. package/dist/runtime/editor/components/DropdownItem/index.d.vue.ts +12 -2
  155. package/dist/runtime/editor/components/DropdownItem/index.vue +46 -2
  156. package/dist/runtime/editor/components/DropdownItem/index.vue.d.ts +12 -2
  157. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -1
  158. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -1
  159. package/dist/runtime/editor/components/Form/Datepicker/index.vue +0 -1
  160. package/dist/runtime/editor/components/Form/TextDark/index.vue +0 -1
  161. package/dist/runtime/editor/components/Form/Textarea/index.vue +0 -1
  162. package/dist/runtime/editor/components/Form/Toggle/index.d.vue.ts +1 -0
  163. package/dist/runtime/editor/components/Form/Toggle/index.vue +9 -2
  164. package/dist/runtime/editor/components/Form/Toggle/index.vue.d.ts +1 -0
  165. package/dist/runtime/editor/components/FormOverlay/index.vue +0 -1
  166. package/dist/runtime/editor/components/Icon/index.vue +0 -2
  167. package/dist/runtime/editor/components/Messages/Item/index.vue +4 -1
  168. package/dist/runtime/editor/components/Messages/index.vue +3 -0
  169. package/dist/runtime/editor/components/Panel/Sheet/index.vue +1 -1
  170. package/dist/runtime/editor/components/Popup/index.vue +0 -2
  171. package/dist/runtime/editor/components/RichText/Editor/index.d.vue.ts +1 -1
  172. package/dist/runtime/editor/components/RichText/Editor/index.vue.d.ts +1 -1
  173. package/dist/runtime/editor/components/ScheduleDate/index.vue +1 -3
  174. package/dist/runtime/editor/components/SearchOverlay/index.d.vue.ts +1 -1
  175. package/dist/runtime/editor/components/SearchOverlay/index.vue.d.ts +1 -1
  176. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.d.vue.ts +3 -0
  177. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +74 -0
  178. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue.d.ts +3 -0
  179. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.d.vue.ts +7 -0
  180. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.vue +16 -0
  181. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.vue.d.ts +7 -0
  182. package/dist/runtime/editor/components/Toolbar/ViewOptions/index.d.vue.ts +3 -0
  183. package/dist/runtime/editor/components/Toolbar/ViewOptions/index.vue +57 -0
  184. package/dist/runtime/editor/components/Toolbar/ViewOptions/index.vue.d.ts +3 -0
  185. package/dist/runtime/editor/components/Toolbar/index.vue +3 -56
  186. package/dist/runtime/editor/components/ToolbarDropdown/index.d.vue.ts +21 -0
  187. package/dist/runtime/editor/components/ToolbarDropdown/index.vue +36 -0
  188. package/dist/runtime/editor/components/ToolbarDropdown/index.vue.d.ts +21 -0
  189. package/dist/runtime/editor/components/Tooltip/Context.vue +3 -1
  190. package/dist/runtime/editor/components/Tooltip/index.d.vue.ts +1 -1
  191. package/dist/runtime/editor/components/Tooltip/index.vue +4 -1
  192. package/dist/runtime/editor/components/Tooltip/index.vue.d.ts +1 -1
  193. package/dist/runtime/editor/components/index.d.ts +1 -0
  194. package/dist/runtime/editor/components/index.js +1 -0
  195. package/dist/runtime/editor/composables/defineViewOption.d.ts +5 -0
  196. package/dist/runtime/editor/composables/defineViewOption.js +10 -0
  197. package/dist/runtime/editor/composables/index.d.ts +3 -0
  198. package/dist/runtime/editor/composables/index.js +2 -0
  199. package/dist/runtime/editor/composables/useDismiss.d.ts +30 -0
  200. package/dist/runtime/editor/composables/useDismiss.js +43 -0
  201. package/dist/runtime/editor/composables/useGlobalBlokkliObject.d.ts +3 -3
  202. package/dist/runtime/editor/css/output.css +1 -1
  203. package/dist/runtime/editor/events/index.d.ts +23 -0
  204. package/dist/runtime/editor/features/add-list/Actions/index.vue +0 -1
  205. package/dist/runtime/editor/features/add-list/Blocks/index.vue +0 -1
  206. package/dist/runtime/editor/features/add-list/Help/Item.vue +2 -7
  207. package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
  208. package/dist/runtime/editor/features/add-list/index.vue +0 -2
  209. package/dist/runtime/editor/features/anchors/index.vue +11 -11
  210. package/dist/runtime/editor/features/anchors/types.d.ts +1 -0
  211. package/dist/runtime/editor/features/anchors/types.js +1 -0
  212. package/dist/runtime/editor/features/artboard/Renderer.vue +30 -28
  213. package/dist/runtime/editor/features/block-scheduler/Dialog/ScheduleSection.vue +0 -3
  214. package/dist/runtime/editor/features/block-scheduler/index.vue +0 -1
  215. package/dist/runtime/editor/features/block-transfer/SummaryDialog/index.vue +0 -4
  216. package/dist/runtime/editor/features/breadcrumbs/Crumb/index.vue +0 -5
  217. package/dist/runtime/editor/features/changelog/changelog.json +16 -0
  218. package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -3
  219. package/dist/runtime/editor/features/command-palette/Palette/index.vue +0 -1
  220. package/dist/runtime/editor/features/comments/AddForm/index.vue +0 -1
  221. package/dist/runtime/editor/features/comments/Comment/Actions/index.vue +0 -4
  222. package/dist/runtime/editor/features/comments/Comment/index.d.vue.ts +14 -0
  223. package/dist/runtime/editor/features/comments/Comment/index.vue +29 -8
  224. package/dist/runtime/editor/features/comments/Comment/index.vue.d.ts +14 -0
  225. package/dist/runtime/editor/features/comments/CommentInput/index.d.vue.ts +1 -1
  226. package/dist/runtime/editor/features/comments/CommentInput/index.vue +0 -3
  227. package/dist/runtime/editor/features/comments/CommentInput/index.vue.d.ts +1 -1
  228. package/dist/runtime/editor/features/comments/Sidebar/AddForm/index.vue +0 -1
  229. package/dist/runtime/editor/features/comments/Sidebar/index.d.vue.ts +16 -0
  230. package/dist/runtime/editor/features/comments/Sidebar/index.vue +13 -8
  231. package/dist/runtime/editor/features/comments/Sidebar/index.vue.d.ts +16 -0
  232. package/dist/runtime/editor/features/comments/Thread/ReplyForm/index.vue +0 -1
  233. package/dist/runtime/editor/features/comments/Thread/index.d.vue.ts +16 -0
  234. package/dist/runtime/editor/features/comments/Thread/index.vue +26 -6
  235. package/dist/runtime/editor/features/comments/Thread/index.vue.d.ts +16 -0
  236. package/dist/runtime/editor/features/comments/index.vue +28 -3
  237. package/dist/runtime/editor/features/delete/types.d.ts +1 -0
  238. package/dist/runtime/editor/features/delete/types.js +1 -0
  239. package/dist/runtime/editor/features/dev-mode/index.vue +17 -15
  240. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -0
  241. package/dist/runtime/editor/features/duplicate/types.d.ts +1 -0
  242. package/dist/runtime/editor/features/duplicate/types.js +1 -0
  243. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +0 -2
  244. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +0 -1
  245. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +0 -5
  246. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +0 -5
  247. package/dist/runtime/editor/features/editable-mask/index.vue +21 -20
  248. package/dist/runtime/editor/features/entity-title/index.vue +0 -4
  249. package/dist/runtime/editor/features/fragments/Dialog/index.vue +0 -4
  250. package/dist/runtime/editor/features/grid/index.vue +16 -15
  251. package/dist/runtime/editor/features/grid/types.d.ts +1 -0
  252. package/dist/runtime/editor/features/grid/types.js +1 -0
  253. package/dist/runtime/editor/features/help/Dialog/index.d.vue.ts +7 -0
  254. package/dist/runtime/editor/features/help/Dialog/index.vue +57 -0
  255. package/dist/runtime/editor/features/help/Dialog/index.vue.d.ts +7 -0
  256. package/dist/runtime/editor/features/help/index.vue +52 -47
  257. package/dist/runtime/editor/features/history/List/index.vue +2 -9
  258. package/dist/runtime/editor/features/history/types.d.ts +1 -0
  259. package/dist/runtime/editor/features/history/types.js +1 -0
  260. package/dist/runtime/editor/features/notifications/Item/index.d.vue.ts +4 -0
  261. package/dist/runtime/editor/features/notifications/Item/index.vue +96 -0
  262. package/dist/runtime/editor/features/notifications/Item/index.vue.d.ts +4 -0
  263. package/dist/runtime/editor/features/notifications/List/index.d.vue.ts +11 -0
  264. package/dist/runtime/editor/features/notifications/List/index.vue +126 -0
  265. package/dist/runtime/editor/features/notifications/List/index.vue.d.ts +11 -0
  266. package/dist/runtime/editor/features/notifications/docs.md +12 -0
  267. package/dist/runtime/editor/features/notifications/index.d.vue.ts +3 -0
  268. package/dist/runtime/editor/features/notifications/index.vue +123 -0
  269. package/dist/runtime/editor/features/notifications/index.vue.d.ts +3 -0
  270. package/dist/runtime/editor/features/notifications/types.d.ts +132 -0
  271. package/dist/runtime/editor/features/notifications/types.js +20 -0
  272. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +6 -2
  273. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +14 -4
  274. package/dist/runtime/editor/features/options/Form/Color/index.vue +1 -1
  275. package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +0 -1
  276. package/dist/runtime/editor/features/options/Form/DateTimeLocal/index.vue +0 -1
  277. package/dist/runtime/editor/features/options/Form/Group.vue +3 -1
  278. package/dist/runtime/editor/features/options/Form/Item.vue +1 -2
  279. package/dist/runtime/editor/features/options/Form/Number/index.vue +9 -3
  280. package/dist/runtime/editor/features/options/Form/Radios/index.vue +3 -2
  281. package/dist/runtime/editor/features/options/Form/Range/index.vue +8 -2
  282. package/dist/runtime/editor/features/options/Form/Text/index.vue +6 -2
  283. package/dist/runtime/editor/features/options/index.vue +7 -1
  284. package/dist/runtime/editor/features/ownership/Banner/index.vue +3 -1
  285. package/dist/runtime/editor/features/ownership/types.d.ts +1 -0
  286. package/dist/runtime/editor/features/ownership/types.js +1 -0
  287. package/dist/runtime/editor/features/preview-grant/types.d.ts +1 -0
  288. package/dist/runtime/editor/features/preview-grant/types.js +1 -0
  289. package/dist/runtime/editor/features/proxy-view/index.vue +24 -21
  290. package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +0 -2
  291. package/dist/runtime/editor/features/publish/Dialog/index.vue +1 -2
  292. package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +0 -1
  293. package/dist/runtime/editor/features/revert/types.d.ts +1 -0
  294. package/dist/runtime/editor/features/revert/types.js +1 -0
  295. package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +18 -8
  296. package/dist/runtime/editor/features/swap/types.d.ts +1 -0
  297. package/dist/runtime/editor/features/swap/types.js +1 -0
  298. package/dist/runtime/editor/features/translations/Banner/index.vue +4 -1
  299. package/dist/runtime/editor/features/translations/CsvDialog/Import/index.vue +4 -1
  300. package/dist/runtime/editor/features/translations/TranslateDialog/index.vue +7 -2
  301. package/dist/runtime/editor/plugins/BlockIndicator/index.vue +0 -2
  302. package/dist/runtime/editor/plugins/ContextMenu/Menu/index.vue +4 -36
  303. package/dist/runtime/editor/plugins/ItemAction/index.vue +0 -1
  304. package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
  305. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
  306. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -2
  307. package/dist/runtime/editor/plugins/Sidebar/index.vue +7 -50
  308. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -2
  309. package/dist/runtime/editor/plugins/ToolbarButton/index.d.vue.ts +8 -2
  310. package/dist/runtime/editor/plugins/ToolbarButton/index.vue +122 -28
  311. package/dist/runtime/editor/plugins/ToolbarButton/index.vue.d.ts +8 -2
  312. package/dist/runtime/editor/plugins/index.d.ts +1 -2
  313. package/dist/runtime/editor/plugins/index.js +1 -3
  314. package/dist/runtime/editor/providers/fieldValue.js +11 -13
  315. package/dist/runtime/editor/providers/plugin.d.ts +12 -0
  316. package/dist/runtime/editor/providers/plugin.js +9 -0
  317. package/dist/runtime/editor/translations/de.json +53 -19
  318. package/dist/runtime/editor/translations/fr.json +16 -4
  319. package/dist/runtime/editor/translations/gsw_CH.json +53 -19
  320. package/dist/runtime/editor/translations/it.json +16 -4
  321. package/package.json +6 -6
  322. package/dist/runtime/editor/plugins/ViewOption/index.d.vue.ts +0 -139
  323. package/dist/runtime/editor/plugins/ViewOption/index.vue +0 -99
  324. package/dist/runtime/editor/plugins/ViewOption/index.vue.d.ts +0 -139
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blokkli/editor",
3
3
  "configKey": "blokkli",
4
- "version": "2.0.0-alpha.59",
4
+ "version": "2.0.0-alpha.61",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.15.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -19,7 +19,7 @@ import 'typescript';
19
19
  import 'oxc-walker';
20
20
 
21
21
  const name = "@blokkli/editor";
22
- const version = "2.0.0-alpha.59";
22
+ const version = "2.0.0-alpha.61";
23
23
 
24
24
  function validateOption(optionKey, option, icons) {
25
25
  const errors = [];
@@ -1512,6 +1512,7 @@ const USED_MATERIAL_ICONS = [
1512
1512
  "bk_mdi_add_column_right",
1513
1513
  "bk_mdi_add_comment",
1514
1514
  "bk_mdi_add_row_below",
1515
+ "bk_mdi_alternate_email",
1515
1516
  "bk_mdi_anchor",
1516
1517
  "bk_mdi_architecture",
1517
1518
  "bk_mdi_area_chart",
@@ -1552,6 +1553,7 @@ const USED_MATERIAL_ICONS = [
1552
1553
  "bk_mdi_construction",
1553
1554
  "bk_mdi_content_copy",
1554
1555
  "bk_mdi_content_paste",
1556
+ "bk_mdi_crop_9_16",
1555
1557
  "bk_mdi_csv",
1556
1558
  "bk_mdi_dashboard",
1557
1559
  "bk_mdi_data_object",
@@ -1569,6 +1571,7 @@ const USED_MATERIAL_ICONS = [
1569
1571
  "bk_mdi_exit_to_app",
1570
1572
  "bk_mdi_expand_all",
1571
1573
  "bk_mdi_extension",
1574
+ "bk_mdi_eye_tracking",
1572
1575
  "bk_mdi_feature_search",
1573
1576
  "bk_mdi_fit_screen",
1574
1577
  "bk_mdi_format_bold",
@@ -1601,11 +1604,13 @@ const USED_MATERIAL_ICONS = [
1601
1604
  "bk_mdi_lists",
1602
1605
  "bk_mdi_lock",
1603
1606
  "bk_mdi_logo_dev",
1607
+ "bk_mdi_mark_chat_read",
1604
1608
  "bk_mdi_menu",
1605
1609
  "bk_mdi_mobile",
1606
1610
  "bk_mdi_mobile_rotate",
1607
1611
  "bk_mdi_monitor",
1608
1612
  "bk_mdi_newspaper",
1613
+ "bk_mdi_notifications",
1609
1614
  "bk_mdi_open_in_new",
1610
1615
  "bk_mdi_palette",
1611
1616
  "bk_mdi_person",
@@ -1658,6 +1663,7 @@ const USED_MATERIAL_ICONS = [
1658
1663
  "bk_mdi_undo",
1659
1664
  "bk_mdi_unpublished",
1660
1665
  "bk_mdi_upload",
1666
+ "bk_mdi_verified",
1661
1667
  "bk_mdi_video_camera_back",
1662
1668
  "bk_mdi_visibility",
1663
1669
  "bk_mdi_visibility_off",
@@ -1921,7 +1927,9 @@ export default adapterExtensions
1921
1927
  }
1922
1928
  );
1923
1929
 
1930
+ const logger$2 = useLogger("@blokkli/editor");
1924
1931
  let processor = null;
1932
+ let processorUnavailable = false;
1925
1933
  function postcssMangleClasses(selectorParser) {
1926
1934
  const plugin = () => ({
1927
1935
  postcssPlugin: "postcss-mangle-blokkli-classes",
@@ -1963,12 +1971,16 @@ function postcssMangleClasses(selectorParser) {
1963
1971
  plugin.postcss = true;
1964
1972
  return plugin;
1965
1973
  }
1974
+ async function ensureProcessor() {
1975
+ if (processor || processorUnavailable) return processor;
1976
+ processor = await createProcessor();
1977
+ return processor;
1978
+ }
1966
1979
  async function processCSS(css, from, contentPaths) {
1967
- if (!processor) {
1968
- processor = await createProcessor();
1969
- }
1980
+ const proc = await ensureProcessor();
1981
+ if (!proc) return css;
1970
1982
  const sourceDirectives = contentPaths?.length ? "\n" + contentPaths.map((dir) => `@source "${dir}/**/*.vue";`).join("\n") : "";
1971
- const result = await processor.process(css + sourceDirectives, {
1983
+ const result = await proc.process(css + sourceDirectives, {
1972
1984
  from: from || "module.css"
1973
1985
  });
1974
1986
  return result.css;
@@ -2006,12 +2018,13 @@ async function createProcessor() {
2006
2018
  return postcss(plugins);
2007
2019
  } catch (e) {
2008
2020
  if (e.code === "MODULE_NOT_FOUND") {
2021
+ processorUnavailable = true;
2009
2022
  const missing = e.message.match(/Cannot find module '([^']+)'/)?.[1] || "unknown";
2010
- throw new Error(
2011
- `Missing dependency "${missing}" required for processing module CSS.
2012
- Install the required PostCSS packages:
2013
- npm install -D postcss tailwindcss @tailwindcss/postcss postcss-import postcss-nesting postcss-replace @thedutchcoder/postcss-rem-to-px`
2023
+ logger$2.warn(
2024
+ `bl\xF6kkli's PostCSS pipeline is disabled \u2014 missing dependency "${missing}". This is only required if you author custom bl\xF6kkli modules or features that use Tailwind v4 \`@apply\` / \`theme()\` in their <style> blocks. To enable it, install:
2025
+ npm install -D postcss tailwindcss @tailwindcss/postcss postcss-import postcss-nesting postcss-replace @thedutchcoder/postcss-rem-to-px`
2014
2026
  );
2027
+ return null;
2015
2028
  }
2016
2029
  throw e;
2017
2030
  }
@@ -2174,6 +2187,7 @@ async function stripDistBoilerplate(css) {
2174
2187
  return result.css;
2175
2188
  }
2176
2189
  async function processStyleBlocks(code, filePath, tailwindConfigPath) {
2190
+ if (!await ensureProcessor()) return code;
2177
2191
  const styleRegex = /<style([^>]*)>([\s\S]*?)<\/style>/g;
2178
2192
  let result = code;
2179
2193
  let styleMatch;
@@ -4378,8 +4392,11 @@ const module$1 = defineNuxtModule({
4378
4392
  blockCollector,
4379
4393
  theme
4380
4394
  );
4381
- const moduleRoot = helper.resolvers.module.resolve(".");
4382
- if (!moduleRoot.includes("/node_modules/")) {
4395
+ const distMarker = helper.resolvers.module.resolve(
4396
+ "./modules/tailwind/index.mjs"
4397
+ );
4398
+ const isRunningFromDist = helper.fileCache.fileExists(distMarker);
4399
+ if (!isRunningFromDist) {
4383
4400
  context.addContentPath(helper.resolvers.module.resolve("./runtime"));
4384
4401
  context.addContentPath(helper.resolvers.module.resolve("./modules"));
4385
4402
  }
@@ -176,8 +176,8 @@ function createClientTemplate(toolCollector, skillsCollector, options, routes) {
176
176
  const entries = toolsWithNames.map((t) => {
177
177
  const importPath = rel(t.filePath);
178
178
  return ` '${t.name}': {
179
- params: _ToolParams<typeof import('${importPath}')['default']>
180
- result: _ToolResult<typeof import('${importPath}')['default']>
179
+ params: z.infer<typeof import('${importPath}')['paramsSchema']>
180
+ result: z.infer<typeof import('${importPath}')['resultSchema']>
181
181
  }`;
182
182
  }).join("\n");
183
183
  toolMapBlock = `export interface AgentToolMap {
@@ -192,9 +192,6 @@ ${entries}
192
192
  import type { McpToolDefinition } from '#blokkli/agent/app/types'
193
193
  import type { AgentModelDefinition } from '#blokkli/agent/shared/types'
194
194
 
195
- type _ToolParams<T> = T extends { paramsSchema: infer P extends z.ZodType } ? z.infer<P> : never
196
- type _ToolResult<T> = T extends { resultSchema: infer R extends z.ZodType } ? z.infer<R> : never
197
-
198
195
  ${toolMapBlock}
199
196
 
200
197
  export type AgentToolName = ${agentToolNameType}
@@ -78,7 +78,7 @@ const agentApp = {
78
78
  provide(INJECT_AGENT_APP, agentApp);
79
79
  async function consumePromptRequest(request) {
80
80
  emit("consumed");
81
- const { prompt, selectedUuids } = request;
81
+ const { prompt, selectedBlocks } = request;
82
82
  const promptText = prompt.getPrompt(blokkli);
83
83
  const userPromptText = prompt.getUserPrompt?.(blokkli);
84
84
  let preSeededResults = void 0;
@@ -86,7 +86,7 @@ async function consumePromptRequest(request) {
86
86
  if (prompt.preExecute) {
87
87
  const preResult = await prompt.preExecute({
88
88
  app: blokkli,
89
- selectedUuids,
89
+ selectedBlocks,
90
90
  runTool: tools.runForPrompt
91
91
  });
92
92
  if (preResult) {
@@ -97,7 +97,7 @@ async function consumePromptRequest(request) {
97
97
  agent.sendPrompt({
98
98
  prompt: promptText,
99
99
  displayPrompt: userPromptText,
100
- selectedUuids,
100
+ selectedBlocks,
101
101
  autoLoadTools: prompt.tools,
102
102
  autoLoadSkills: prompt.skills,
103
103
  preSeededResults,
@@ -243,16 +243,27 @@ function scrollToBottomOnSend() {
243
243
  isAtBottom.value = true;
244
244
  nextTick(scrollToBottom);
245
245
  }
246
+ function snapshotInitialSelection() {
247
+ if (conversation.value.length) return void 0;
248
+ const items = app.selection.items.value;
249
+ if (!items.length) return void 0;
250
+ return items.map((item) => ({
251
+ uuid: item.uuid,
252
+ bundle: item.bundle,
253
+ label: app.types.getBlockLabel(item.bundle)
254
+ }));
255
+ }
246
256
  function onWelcomePrompt(prompt) {
247
- agent.sendPrompt({ prompt });
257
+ agent.sendPrompt({ prompt, selectedBlocks: snapshotInitialSelection() });
248
258
  scrollToBottomOnSend();
249
259
  }
250
260
  function onSubmit(submitAttachments) {
251
261
  const text = inputValue.value.trim();
252
262
  if (!text && !submitAttachments.length || isProcessing.value || !isConnected.value)
253
263
  return;
264
+ const selectedBlocks = snapshotInitialSelection();
254
265
  if (!submitAttachments.length) {
255
- agent.sendPrompt({ prompt: inputValue.value });
266
+ agent.sendPrompt({ prompt: inputValue.value, selectedBlocks });
256
267
  } else {
257
268
  const attachmentBlocks = submitAttachments.map(
258
269
  (att) => `<attachment type="${att.type}">
@@ -265,7 +276,8 @@ ${attachmentBlocks}` : attachmentBlocks;
265
276
  agent.sendPrompt({
266
277
  prompt,
267
278
  displayPrompt: text,
268
- attachments: submitAttachments
279
+ attachments: submitAttachments,
280
+ selectedBlocks
269
281
  });
270
282
  }
271
283
  inputValue.value = "";
@@ -149,7 +149,11 @@ defineItemDropdownAction(() => {
149
149
  app.eventBus.emit("sidebar:open", "agent");
150
150
  pendingPromptRequest.value = {
151
151
  prompt,
152
- selectedUuids: [...app.selection.uuids.value]
152
+ selectedBlocks: app.selection.items.value.map((item) => ({
153
+ uuid: item.uuid,
154
+ bundle: item.bundle,
155
+ label: app.types.getBlockLabel(item.bundle)
156
+ }))
153
157
  };
154
158
  }
155
159
  };
@@ -2,13 +2,14 @@ import type { AgentPromptDefinition } from '#blokkli/agent/app/types';
2
2
  import type { BlokkliUser } from '#blokkli/editor/types/user';
3
3
  import type { AdapterSearchArguments } from '#blokkli/editor/adapter';
4
4
  import type { PluginConfigInput } from '#blokkli/editor/types/pluginConfig';
5
+ import type { SelectedBlock } from '#blokkli/agent/shared/types';
5
6
  /**
6
7
  * A pending request from the outer feature's item-dropdown action that the
7
8
  * inner container consumes on mount (or on change if already mounted).
8
9
  */
9
10
  export type PendingPromptRequest = {
10
11
  prompt: AgentPromptDefinition;
11
- selectedUuids: string[];
12
+ selectedBlocks: SelectedBlock[];
12
13
  };
13
14
  export type AgentConversationHostInfo = {
14
15
  entityType: string;
@@ -0,0 +1,38 @@
1
+ import type { BlokkliApp } from '#blokkli/editor/types/app';
2
+ /**
3
+ * Tree-shaped entry in the `newParagraphs` payload returned by mutation tools.
4
+ *
5
+ * Mirrors the input shape of `add_paragraphs` — nested children are grouped by
6
+ * paragraph field name so the LLM can verify the structure round-tripped. A
7
+ * flat list was previously emitted; the model could not tell whether a child
8
+ * UUID was actually a sibling that got placed at the top level by mistake.
9
+ */
10
+ export type NewParagraphNode = {
11
+ uuid: string;
12
+ bundle: string;
13
+ paragraphFields?: string[];
14
+ children?: Record<string, NewParagraphNode[]>;
15
+ };
16
+ /**
17
+ * Build the tree-shaped `newParagraphs` payload from a flat list of newly
18
+ * created block UUIDs (computed as the set diff of `getAllUuids()` before vs
19
+ * after a mutation).
20
+ *
21
+ * A block whose host is ALSO in `newUuids` is nested under that parent's
22
+ * `children[fieldName]`. Top-level entries are blocks whose parent already
23
+ * existed before the mutation — these were inserted into the target field.
24
+ *
25
+ * Per-block lookup uses `app.blocks.getBlock` (host metadata) and
26
+ * `app.types.fieldConfig` (paragraph-field discovery), so no extra adapter
27
+ * round-trips are needed.
28
+ */
29
+ export declare function buildNewParagraphsTree(newUuids: string[], app: BlokkliApp, itemEntityType: string): NewParagraphNode[];
30
+ /**
31
+ * Count every node in a `newParagraphs` tree, including nested children.
32
+ *
33
+ * The tree-shaped envelope means a top-level array of length 1 can still
34
+ * represent dozens of added blocks (one parent with many children). Callers
35
+ * that report "added N paragraphs" should count recursively so the figure
36
+ * stays honest.
37
+ */
38
+ export declare function countNewParagraphs(nodes: NewParagraphNode[]): number;
@@ -0,0 +1,49 @@
1
+ export function buildNewParagraphsTree(newUuids, app, itemEntityType) {
2
+ if (!newUuids.length) return [];
3
+ const newSet = new Set(newUuids);
4
+ const nodes = /* @__PURE__ */ new Map();
5
+ const roots = [];
6
+ const pendingChildren = /* @__PURE__ */ new Map();
7
+ for (const uuid of newUuids) {
8
+ const block = app.blocks.getBlock(uuid);
9
+ if (!block) continue;
10
+ const paragraphFields = app.types.fieldConfig.forEntityTypeAndBundle(itemEntityType, block.bundle).map((f) => f.name);
11
+ const node = {
12
+ uuid,
13
+ bundle: block.bundle,
14
+ ...paragraphFields.length ? { paragraphFields } : {}
15
+ };
16
+ nodes.set(uuid, node);
17
+ const host = block.host;
18
+ if (host.type === itemEntityType && newSet.has(host.uuid)) {
19
+ let perField = pendingChildren.get(host.uuid);
20
+ if (!perField) {
21
+ perField = /* @__PURE__ */ new Map();
22
+ pendingChildren.set(host.uuid, perField);
23
+ }
24
+ const bucket = perField.get(host.fieldName) ?? [];
25
+ bucket.push(node);
26
+ perField.set(host.fieldName, bucket);
27
+ } else {
28
+ roots.push(node);
29
+ }
30
+ }
31
+ for (const [parentUuid, perField] of pendingChildren) {
32
+ const parent = nodes.get(parentUuid);
33
+ if (!parent) continue;
34
+ parent.children = Object.fromEntries(perField);
35
+ }
36
+ return roots;
37
+ }
38
+ export function countNewParagraphs(nodes) {
39
+ let total = 0;
40
+ for (const node of nodes) {
41
+ total += 1;
42
+ if (node.children) {
43
+ for (const childList of Object.values(node.children)) {
44
+ total += countNewParagraphs(childList);
45
+ }
46
+ }
47
+ }
48
+ return total;
49
+ }
@@ -28,11 +28,11 @@ export default defineBlokkliAgentPrompt({
28
28
  "Fix the readability of the selected paragraphs."
29
29
  );
30
30
  },
31
- async preExecute({ selectedUuids, runTool }) {
31
+ async preExecute({ selectedBlocks, runTool }) {
32
32
  const readability = await runTool(
33
33
  "get_readability_issues",
34
- selectedUuids.length ? {
35
- uuids: selectedUuids
34
+ selectedBlocks.length ? {
35
+ uuids: selectedBlocks.map((b) => b.uuid)
36
36
  } : {}
37
37
  );
38
38
  const fields = Object.entries(readability.result).flatMap(
@@ -1,5 +1,6 @@
1
1
  import { type Ref } from '#imports';
2
2
  import type { Attachment, PreSeededToolResult, AutoExecuteTool } from '#blokkli/agent/app/types';
3
+ import type { SelectedBlock } from '#blokkli/agent/shared/types';
3
4
  import type { BlokkliApp } from '#blokkli/editor/types/app';
4
5
  import type { FullBlokkliAdapter } from '#blokkli/editor/adapter';
5
6
  import type { SocketProvider } from './socketProvider.js';
@@ -9,7 +10,7 @@ import type { ToolsProvider } from './toolsProvider.js';
9
10
  export type SendPromptOptions = {
10
11
  prompt: string;
11
12
  displayPrompt?: string;
12
- selectedUuids?: string[];
13
+ selectedBlocks?: SelectedBlock[];
13
14
  attachments?: Attachment[];
14
15
  autoLoadTools?: string[];
15
16
  autoLoadSkills?: string[];
@@ -9,19 +9,19 @@ function buildSendContext(options) {
9
9
  const {
10
10
  prompt,
11
11
  displayPrompt,
12
- selectedUuids,
12
+ selectedBlocks,
13
13
  autoLoadTools,
14
14
  autoLoadSkills,
15
15
  preSeededResults,
16
16
  autoExecuteTools,
17
17
  promptId
18
18
  } = options;
19
- const hasData = !!promptId || displayPrompt !== void 0 && displayPrompt !== prompt || !!selectedUuids?.length || !!autoLoadTools?.length || !!autoLoadSkills?.length || !!preSeededResults?.length || !!autoExecuteTools?.length;
19
+ const hasData = !!promptId || displayPrompt !== void 0 && displayPrompt !== prompt || !!selectedBlocks?.length || !!autoLoadTools?.length || !!autoLoadSkills?.length || !!preSeededResults?.length || !!autoExecuteTools?.length;
20
20
  if (!hasData) return void 0;
21
21
  return {
22
22
  promptId,
23
23
  serverPrompt: displayPrompt !== void 0 && displayPrompt !== prompt ? prompt : void 0,
24
- selectedUuids: selectedUuids?.length ? [...selectedUuids] : void 0,
24
+ selectedBlocks: selectedBlocks?.length ? [...selectedBlocks] : void 0,
25
25
  autoLoadTools: autoLoadTools?.length ? [...autoLoadTools] : void 0,
26
26
  autoLoadSkills: autoLoadSkills?.length ? [...autoLoadSkills] : void 0,
27
27
  preSeededResults: preSeededResults?.length ? preSeededResults : void 0,
@@ -217,7 +217,7 @@ export default function agentProvider({
217
217
  const {
218
218
  prompt,
219
219
  displayPrompt,
220
- selectedUuids,
220
+ selectedBlocks,
221
221
  attachments,
222
222
  autoLoadTools,
223
223
  autoLoadSkills,
@@ -280,7 +280,7 @@ export default function agentProvider({
280
280
  socket.send({
281
281
  type: "start",
282
282
  prompt,
283
- selectedUuids: selectedUuids?.length ? selectedUuids : void 0,
283
+ selectedBlocks: selectedBlocks?.length ? selectedBlocks : void 0,
284
284
  autoLoadTools: resolvedAutoLoadTools?.length ? resolvedAutoLoadTools : void 0,
285
285
  autoLoadSkills: resolvedAutoLoadSkills?.length ? resolvedAutoLoadSkills : void 0,
286
286
  preSeededResults: serverPreSeeded,
@@ -323,7 +323,7 @@ export default function agentProvider({
323
323
  displayPrompt: isEdit ? void 0 : displayedText,
324
324
  attachments: target.attachments,
325
325
  rollbackToUserMessageIndex: userMessageIndex,
326
- selectedUuids: ctx?.selectedUuids,
326
+ selectedBlocks: ctx?.selectedBlocks,
327
327
  autoLoadTools: ctx?.autoLoadTools,
328
328
  autoLoadSkills: ctx?.autoLoadSkills,
329
329
  preSeededResults: isEdit ? void 0 : ctx?.preSeededResults,
@@ -11,6 +11,7 @@ import {
11
11
  asRecord,
12
12
  splitMeta
13
13
  } from "#blokkli/agent/app/helpers";
14
+ import { buildNewParagraphsTree } from "#blokkli/agent/app/helpers/mutationResult";
14
15
  import { mcpTools } from "#blokkli-build/agent-client";
15
16
  import { itemEntityType } from "#blokkli-build/config";
16
17
  import { generateId } from "#blokkli/agent/app/helpers/id";
@@ -104,22 +105,11 @@ export default function toolsProvider({
104
105
  return newUuids;
105
106
  }
106
107
  function buildMutationResult(newUuids) {
107
- const newParagraphs = action.type === "add" && newUuids.length ? newUuids.map((uuid) => {
108
- const block = app.blocks.getBlock(uuid);
109
- if (!block) return null;
110
- const blockFieldNames = app.types.fieldConfig.forEntityTypeAndBundle(itemEntityType, block.bundle).map((f) => f.name);
111
- return {
112
- uuid,
113
- bundle: block.bundle,
114
- ...blockFieldNames.length ? { paragraphFields: blockFieldNames } : {}
115
- };
116
- }).filter(
117
- (b) => b !== null
118
- ) : void 0;
108
+ const newParagraphs = action.type === "add" ? buildNewParagraphsTree(newUuids, app, itemEntityType) : [];
119
109
  return {
120
110
  success: true,
121
111
  historyIndex: state.currentMutationIndex.value,
122
- newParagraphs: newParagraphs?.length ? newParagraphs : void 0,
112
+ newParagraphs: newParagraphs.length ? newParagraphs : void 0,
123
113
  ...action.result
124
114
  };
125
115
  }
@@ -1,2 +1,27 @@
1
+ import { z } from 'zod';
2
+ export declare const paramsSchema: z.ZodObject<{
3
+ itemId: z.ZodString;
4
+ itemEntityType: z.ZodString;
5
+ itemEntityBundle: z.ZodString;
6
+ targetBundle: z.ZodString;
7
+ parent: z.ZodObject<{
8
+ type: z.ZodString;
9
+ uuid: z.ZodString;
10
+ field: z.ZodString;
11
+ }, z.core.$strip>;
12
+ position: z.ZodDefault<z.ZodOptional<z.ZodString>>;
13
+ }, z.core.$strip>;
14
+ export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
15
+ type: z.ZodEnum<{
16
+ rewrite: "rewrite";
17
+ delete: "delete";
18
+ add: "add";
19
+ move: "move";
20
+ options: "options";
21
+ }>;
22
+ label: z.ZodString;
23
+ }, z.core.$strip>, z.ZodObject<{
24
+ error: z.ZodString;
25
+ }, z.core.$strip>]>;
1
26
  declare const _default: any;
2
27
  export default _default;
@@ -3,7 +3,7 @@ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
3
3
  import { mutationResultSchema, parentSchema, positionSchema } from "../schemas.js";
4
4
  import { resolvePosition } from "../helpers.js";
5
5
  import { requireBundlePermission } from "../../helpers/validation.js";
6
- const paramsSchema = z.object({
6
+ export const paramsSchema = z.object({
7
7
  itemId: z.string().describe("Content item ID from search_content results"),
8
8
  itemEntityType: z.string().describe("Entity type of the content item"),
9
9
  itemEntityBundle: z.string().describe("Entity bundle of the content item"),
@@ -13,6 +13,7 @@ const paramsSchema = z.object({
13
13
  parent: parentSchema.describe("The parent entity to add the paragraph to"),
14
14
  position: positionSchema
15
15
  });
16
+ export const resultSchema = mutationResultSchema;
16
17
  export default defineBlokkliAgentTool({
17
18
  name: "add_content_search_paragraphs",
18
19
  description: "Add a paragraph using a content item from search results. Use search_content first to find content items, then use this tool to add one to the page.",
@@ -28,7 +29,7 @@ export default defineBlokkliAgentTool({
28
29
  );
29
30
  },
30
31
  paramsSchema,
31
- resultSchema: mutationResultSchema,
32
+ resultSchema,
32
33
  requiredAdapterMethods: ["addContentSearchItem"],
33
34
  execute(ctx, params) {
34
35
  const denied = requireBundlePermission(
@@ -1,2 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const paramsSchema: z.ZodObject<{
3
+ name: z.ZodString;
4
+ parent: z.ZodObject<{
5
+ type: z.ZodString;
6
+ uuid: z.ZodString;
7
+ field: z.ZodString;
8
+ }, z.core.$strip>;
9
+ position: z.ZodDefault<z.ZodOptional<z.ZodString>>;
10
+ }, z.core.$strip>;
11
+ export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
12
+ type: z.ZodEnum<{
13
+ rewrite: "rewrite";
14
+ delete: "delete";
15
+ add: "add";
16
+ move: "move";
17
+ options: "options";
18
+ }>;
19
+ label: z.ZodString;
20
+ }, z.core.$strip>, z.ZodObject<{
21
+ error: z.ZodString;
22
+ }, z.core.$strip>]>;
1
23
  declare const _default: any;
2
24
  export default _default;
@@ -3,11 +3,12 @@ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
3
3
  import { mutationResultSchema, parentSchema, positionSchema } from "../schemas.js";
4
4
  import { resolvePosition } from "../helpers.js";
5
5
  import { fragmentBlockBundle } from "#blokkli-build/config";
6
- const paramsSchema = z.object({
6
+ export const paramsSchema = z.object({
7
7
  name: z.string().describe("The fragment name to add"),
8
8
  parent: parentSchema.describe("The parent entity to add the fragment to"),
9
9
  position: positionSchema
10
10
  });
11
+ export const resultSchema = mutationResultSchema;
11
12
  export default defineBlokkliAgentTool({
12
13
  name: "add_fragment",
13
14
  description: "Add a fragment paragraph to the page.",
@@ -19,7 +20,7 @@ export default defineBlokkliAgentTool({
19
20
  return $t("aiAgentAddFragmentRunning", "Adding fragment", { more: true });
20
21
  },
21
22
  paramsSchema,
22
- resultSchema: mutationResultSchema,
23
+ resultSchema,
23
24
  requiredAdapterMethods: ["fragmentsAddBlock"],
24
25
  execute(ctx, params) {
25
26
  const { fields, definitions, permissions } = ctx.app;
@@ -1,2 +1,26 @@
1
+ import { z } from 'zod';
2
+ export declare const paramsSchema: z.ZodObject<{
3
+ mediaId: z.ZodString;
4
+ mediaBundle: z.ZodString;
5
+ targetBundle: z.ZodString;
6
+ parent: z.ZodObject<{
7
+ type: z.ZodString;
8
+ uuid: z.ZodString;
9
+ field: z.ZodString;
10
+ }, z.core.$strip>;
11
+ position: z.ZodDefault<z.ZodOptional<z.ZodString>>;
12
+ }, z.core.$strip>;
13
+ export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
14
+ type: z.ZodEnum<{
15
+ rewrite: "rewrite";
16
+ delete: "delete";
17
+ add: "add";
18
+ move: "move";
19
+ options: "options";
20
+ }>;
21
+ label: z.ZodString;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ error: z.ZodString;
24
+ }, z.core.$strip>]>;
1
25
  declare const _default: any;
2
26
  export default _default;
@@ -3,7 +3,7 @@ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
3
3
  import { mutationResultSchema, parentSchema, positionSchema } from "../schemas.js";
4
4
  import { resolvePosition } from "../helpers.js";
5
5
  import { requireBundlePermission } from "../../helpers/validation.js";
6
- const paramsSchema = z.object({
6
+ export const paramsSchema = z.object({
7
7
  mediaId: z.string().describe("Media item ID from search_media results"),
8
8
  mediaBundle: z.string().describe('Media bundle type (e.g., "image")'),
9
9
  targetBundle: z.string().describe(
@@ -12,6 +12,7 @@ const paramsSchema = z.object({
12
12
  parent: parentSchema.describe("The parent entity to add the paragraph to"),
13
13
  position: positionSchema
14
14
  });
15
+ export const resultSchema = mutationResultSchema;
15
16
  export default defineBlokkliAgentTool({
16
17
  name: "add_media_paragraph",
17
18
  description: "Add a paragraph using a media item from the library. Use search_media first to find media items, then use this tool to add one to the page.",
@@ -25,7 +26,7 @@ export default defineBlokkliAgentTool({
25
26
  });
26
27
  },
27
28
  paramsSchema,
28
- resultSchema: mutationResultSchema,
29
+ resultSchema,
29
30
  requiredAdapterMethods: ["mediaLibraryAddBlock"],
30
31
  execute(ctx, params) {
31
32
  const denied = requireBundlePermission(
@@ -1,2 +1,34 @@
1
+ import { z } from 'zod';
2
+ type OptionValue = string | boolean | number | string[];
3
+ type BlockInput = {
4
+ bundle: string;
5
+ contentFields?: Record<string, string | {
6
+ entityType: string;
7
+ entityId: string;
8
+ }>;
9
+ options?: Record<string, OptionValue>;
10
+ children?: Record<string, BlockInput[]>;
11
+ };
12
+ export declare const paramsSchema: z.ZodObject<{
13
+ paragraphs: z.ZodArray<z.ZodType<BlockInput, unknown, z.core.$ZodTypeInternals<BlockInput, unknown>>>;
14
+ parent: z.ZodObject<{
15
+ type: z.ZodString;
16
+ uuid: z.ZodString;
17
+ field: z.ZodString;
18
+ }, z.core.$strip>;
19
+ position: z.ZodDefault<z.ZodOptional<z.ZodString>>;
20
+ }, z.core.$strip>;
21
+ export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
22
+ type: z.ZodEnum<{
23
+ rewrite: "rewrite";
24
+ delete: "delete";
25
+ add: "add";
26
+ move: "move";
27
+ options: "options";
28
+ }>;
29
+ label: z.ZodString;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ error: z.ZodString;
32
+ }, z.core.$strip>]>;
1
33
  declare const _default: any;
2
34
  export default _default;