@blokkli/editor 2.0.0-alpha.63 → 2.0.0-alpha.65

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 (225) hide show
  1. package/dist/global/types/blockOptions.d.ts +32 -27
  2. package/dist/module.d.mts +2 -2
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +154 -5
  5. package/dist/modules/agent/index.d.mts +1 -1
  6. package/dist/modules/agent/index.mjs +2 -1
  7. package/dist/modules/agent/runtime/app/components/Attachment/PreviewCsv/index.vue +1 -1
  8. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.d.vue.ts +1 -1
  9. package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.vue.d.ts +1 -1
  10. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +1 -1
  11. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +1 -1
  12. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +1 -1
  13. package/dist/modules/agent/runtime/app/features/agent/index.vue +1 -1
  14. package/dist/modules/agent/runtime/app/helpers/mutationResult.d.ts +12 -0
  15. package/dist/modules/agent/runtime/app/helpers/mutationResult.js +34 -0
  16. package/dist/modules/agent/runtime/app/providers/toolsProvider.js +13 -7
  17. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.d.ts +1 -1
  18. package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +1 -1
  19. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +1 -1
  20. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +16 -5
  21. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +43 -15
  22. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +1 -1
  23. package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +1 -1
  24. package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +1 -1
  25. package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +1 -1
  26. package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +1 -1
  27. package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +1 -1
  28. package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +1 -1
  29. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +1 -1
  30. package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.js +1 -3
  31. package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -2
  32. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +6 -2
  33. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +3 -3
  34. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +5 -5
  35. package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +1 -1
  36. package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +1 -1
  37. package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +1 -1
  38. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +1 -1
  39. package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +1 -1
  40. package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +1 -1
  41. package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +1 -1
  42. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +2 -2
  43. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +1 -1
  44. package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +1 -1
  45. package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +3 -3
  46. package/dist/modules/agent/runtime/server/classes/FieldStreamParser/index.js +10 -15
  47. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.d.ts +1 -3
  48. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +3 -1
  49. package/dist/modules/agent/runtime/shared/toolParams.d.ts +3 -3
  50. package/dist/modules/agent/runtime/shared/types.d.ts +3 -3
  51. package/dist/modules/charts/index.d.mts +14 -1
  52. package/dist/modules/charts/index.mjs +37 -2
  53. package/dist/modules/charts/runtime/features/charts/Editor/AdvancedConfigPanel/index.vue +1 -1
  54. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/Field.vue +19 -9
  55. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/OutputPreviewTable/index.vue +1 -1
  56. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +16 -8
  57. package/dist/modules/charts/runtime/features/charts/Editor/NumberFormatEditor/index.vue +23 -7
  58. package/dist/modules/charts/runtime/features/charts/Editor/index.vue +5 -6
  59. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
  60. package/dist/modules/drupal/index.d.mts +1 -1
  61. package/dist/modules/drupal/runtime/adapter/index.js +3 -0
  62. package/dist/modules/iframes/index.d.mts +1 -1
  63. package/dist/modules/index.d.mts +1 -1
  64. package/dist/modules/readability/index.d.mts +1 -1
  65. package/dist/modules/readability/index.mjs +2 -1
  66. package/dist/modules/table-of-contents/index.d.mts +1 -1
  67. package/dist/runtime/components/Blocks/NotImplemented/index.vue +1 -1
  68. package/dist/runtime/editor/components/Actions/Title/index.vue +1 -1
  69. package/dist/runtime/editor/components/Actions/index.vue +1 -1
  70. package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
  71. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +2 -2
  72. package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
  73. package/dist/runtime/editor/components/Avatar/index.vue +1 -1
  74. package/dist/runtime/editor/components/BlockPreviewItem/index.vue +1 -1
  75. package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue +1 -1
  76. package/dist/runtime/editor/components/BlockProxy/index.vue +1 -1
  77. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +1 -1
  78. package/dist/runtime/editor/components/BundleSelector/index.vue +1 -1
  79. package/dist/runtime/editor/components/ColorDropdown/index.vue +1 -1
  80. package/dist/runtime/editor/components/Dialog/index.vue +1 -1
  81. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +1 -1
  82. package/dist/runtime/editor/components/DiffApproval/types.js +1 -3
  83. package/dist/runtime/editor/components/DiffViewer/State.vue +1 -1
  84. package/dist/runtime/editor/components/DraggableList.vue +1 -1
  85. package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +1 -0
  86. package/dist/runtime/editor/components/Dropdown/index.vue +2 -2
  87. package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +1 -0
  88. package/dist/runtime/editor/components/DropdownItem/index.vue +1 -1
  89. package/dist/runtime/editor/components/EditIndicator.vue +1 -1
  90. package/dist/runtime/editor/components/EditProvider.vue +2 -2
  91. package/dist/runtime/editor/components/FileDropHandler/index.vue +1 -1
  92. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -1
  93. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -1
  94. package/dist/runtime/editor/components/Form/RadioTabs/index.vue +1 -1
  95. package/dist/runtime/editor/components/Form/Search/index.d.vue.ts +1 -0
  96. package/dist/runtime/editor/components/Form/Search/index.vue +2 -2
  97. package/dist/runtime/editor/components/Form/Search/index.vue.d.ts +1 -0
  98. package/dist/runtime/editor/components/FormOverlay/index.vue +1 -1
  99. package/dist/runtime/editor/components/Icon/index.vue +1 -1
  100. package/dist/runtime/editor/components/Indicators/index.vue +31 -100
  101. package/dist/runtime/editor/components/Konami/Game/index.vue +1 -1
  102. package/dist/runtime/editor/components/Messages/index.vue +1 -1
  103. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +1 -0
  104. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +2 -1
  105. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +1 -0
  106. package/dist/runtime/editor/components/Overlay/index.vue +1 -1
  107. package/dist/runtime/editor/components/Pagination/index.vue +1 -1
  108. package/dist/runtime/editor/components/Panel/Section/index.vue +1 -1
  109. package/dist/runtime/editor/components/Panel/Tabs/index.d.vue.ts +1 -1
  110. package/dist/runtime/editor/components/Panel/Tabs/index.vue.d.ts +1 -1
  111. package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -1
  112. package/dist/runtime/editor/components/PluginConfigFormInline/FilterSelect/index.vue +1 -1
  113. package/dist/runtime/editor/components/PluginConfigFormInline/index.vue +1 -1
  114. package/dist/runtime/editor/components/Popup/index.vue +1 -1
  115. package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
  116. package/dist/runtime/editor/components/RelativeTime/index.vue +7 -13
  117. package/dist/runtime/editor/components/Resizable/index.vue +1 -1
  118. package/dist/runtime/editor/components/RichText/Editor/index.vue +1 -1
  119. package/dist/runtime/editor/components/ScaleToFit/index.vue +1 -1
  120. package/dist/runtime/editor/components/SearchOverlay/index.vue +1 -1
  121. package/dist/runtime/editor/components/SidebarFloater/index.vue +1 -1
  122. package/dist/runtime/editor/components/StatusIcon/index.vue +1 -1
  123. package/dist/runtime/editor/components/StatusIndicator/index.vue +1 -1
  124. package/dist/runtime/editor/components/SystemRequirements/index.vue +1 -1
  125. package/dist/runtime/editor/components/Tabs/index.d.vue.ts +1 -1
  126. package/dist/runtime/editor/components/Tabs/index.vue.d.ts +1 -1
  127. package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +2 -1
  128. package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
  129. package/dist/runtime/editor/components/Transition/Collapse/index.vue +1 -1
  130. package/dist/runtime/editor/components/Transition/List/index.vue +1 -1
  131. package/dist/runtime/editor/composables/defineViewOption.js +5 -1
  132. package/dist/runtime/editor/composables/useStickyToolbar.js +1 -4
  133. package/dist/runtime/editor/css/output.css +1 -1
  134. package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
  135. package/dist/runtime/editor/features/add-list/index.vue +1 -1
  136. package/dist/runtime/editor/features/analyze/index.vue +1 -1
  137. package/dist/runtime/editor/features/anchors/Overlay/index.vue +11 -5
  138. package/dist/runtime/editor/features/anchors/index.vue +2 -1
  139. package/dist/runtime/editor/features/artboard/Overview/index.vue +1 -1
  140. package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
  141. package/dist/runtime/editor/features/artboard/Scrollbar/index.vue +1 -1
  142. package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +1 -1
  143. package/dist/runtime/editor/features/block-transfer/index.vue +1 -1
  144. package/dist/runtime/editor/features/breadcrumbs/index.vue +1 -1
  145. package/dist/runtime/editor/features/changelog/changelog.json +8 -0
  146. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +1 -1
  147. package/dist/runtime/editor/features/comments/AddForm/index.vue +1 -1
  148. package/dist/runtime/editor/features/comments/Thread/index.vue +1 -1
  149. package/dist/runtime/editor/features/complex-options/index.vue +1 -0
  150. package/dist/runtime/editor/features/debug/Main.vue +1 -1
  151. package/dist/runtime/editor/features/dev-mode/index.vue +1 -1
  152. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -1
  153. package/dist/runtime/editor/features/dragging-overlay/index.vue +1 -1
  154. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +1 -1
  155. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +1 -1
  156. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +1 -5
  157. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +1 -5
  158. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
  159. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +1 -1
  160. package/dist/runtime/editor/features/editable-mask/index.vue +1 -1
  161. package/dist/runtime/editor/features/entity-title/index.vue +17 -7
  162. package/dist/runtime/editor/features/help/Dialog/index.vue +1 -1
  163. package/dist/runtime/editor/features/help/Shortcuts/index.vue +1 -1
  164. package/dist/runtime/editor/features/history/List/index.vue +1 -1
  165. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +1 -1
  166. package/dist/runtime/editor/features/library/index.vue +1 -0
  167. package/dist/runtime/editor/features/media-library/index.vue +1 -1
  168. package/dist/runtime/editor/features/options/Form/Item.vue +5 -12
  169. package/dist/runtime/editor/features/options/Form/Radios/index.d.vue.ts +5 -4
  170. package/dist/runtime/editor/features/options/Form/Radios/index.vue +8 -5
  171. package/dist/runtime/editor/features/options/Form/Radios/index.vue.d.ts +5 -4
  172. package/dist/runtime/editor/features/options/Form/Text/index.d.vue.ts +4 -0
  173. package/dist/runtime/editor/features/options/Form/Text/index.vue +11 -3
  174. package/dist/runtime/editor/features/options/Form/Text/index.vue.d.ts +4 -0
  175. package/dist/runtime/editor/features/options/index.vue +1 -1
  176. package/dist/runtime/editor/features/publish/Dialog/Item.vue +4 -7
  177. package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +1 -1
  178. package/dist/runtime/editor/features/referenced-entities/List/Item/index.vue +1 -0
  179. package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +1 -1
  180. package/dist/runtime/editor/features/search/index.vue +1 -1
  181. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -1
  182. package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +1 -1
  183. package/dist/runtime/editor/features/settings/index.vue +1 -1
  184. package/dist/runtime/editor/features/structure/List/Item/index.vue +1 -1
  185. package/dist/runtime/editor/features/structure/index.vue +1 -1
  186. package/dist/runtime/editor/features/templates/DialogManageTemplates/Item.vue +1 -0
  187. package/dist/runtime/editor/features/templates/DialogManageTemplates/index.vue +1 -1
  188. package/dist/runtime/editor/features/theme/index.vue +1 -1
  189. package/dist/runtime/editor/features/touch-action-bar/Bar/index.vue +1 -1
  190. package/dist/runtime/editor/features/tour/Overlay/index.vue +1 -1
  191. package/dist/runtime/editor/features/transform/Dialog/index.vue +1 -1
  192. package/dist/runtime/editor/features/translations/SelectionTable/index.vue +1 -1
  193. package/dist/runtime/editor/features/workspace/index.vue +1 -1
  194. package/dist/runtime/editor/helpers/diff/index.d.ts +11 -0
  195. package/dist/runtime/editor/helpers/diff/index.js +13 -7
  196. package/dist/runtime/editor/helpers/options/index.d.ts +2 -0
  197. package/dist/runtime/editor/helpers/options/index.js +21 -0
  198. package/dist/runtime/editor/plugins/BlockIndicator/index.d.vue.ts +24 -1
  199. package/dist/runtime/editor/plugins/BlockIndicator/index.vue +17 -7
  200. package/dist/runtime/editor/plugins/BlockIndicator/index.vue.d.ts +24 -1
  201. package/dist/runtime/editor/plugins/ItemAction/index.d.vue.ts +2 -1
  202. package/dist/runtime/editor/plugins/ItemAction/index.vue +1 -1
  203. package/dist/runtime/editor/plugins/ItemAction/index.vue.d.ts +2 -1
  204. package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
  205. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
  206. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -2
  207. package/dist/runtime/editor/plugins/Sidebar/index.vue +1 -1
  208. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -2
  209. package/dist/runtime/editor/plugins/ToolbarButton/index.vue +1 -1
  210. package/dist/runtime/editor/providers/animation.d.ts +2 -0
  211. package/dist/runtime/editor/providers/definition.d.ts +4 -3
  212. package/dist/runtime/editor/providers/definition.js +10 -2
  213. package/dist/runtime/editor/providers/plugin.d.ts +1 -0
  214. package/dist/runtime/editor/providers/state.d.ts +25 -1
  215. package/dist/runtime/editor/providers/state.js +17 -0
  216. package/dist/runtime/editor/translations/de.json +2 -0
  217. package/dist/runtime/editor/translations/fr.json +2 -0
  218. package/dist/runtime/editor/translations/gsw_CH.json +2 -0
  219. package/dist/runtime/editor/translations/it.json +2 -0
  220. package/dist/runtime/editor/types/state.d.ts +7 -0
  221. package/dist/runtime/editor/types/ui.d.ts +1 -0
  222. package/dist/shared/{editor.Gu7mgJ5Q.mjs → editor.BGemL1Oh.mjs} +146 -146
  223. package/dist/shared/{editor.D28NbXr3.d.mts → editor.S5sA3rij.d.mts} +452 -406
  224. package/dist/types.d.mts +1 -1
  225. package/package.json +74 -82
@@ -1,3 +1,4 @@
1
+ export type DefinitionString = string | Record<string, string>;
1
2
  type DefinitionOptionText = {
2
3
  /**
3
4
  * The option type.
@@ -10,13 +11,17 @@ type DefinitionOptionText = {
10
11
  /**
11
12
  * The label displayed in the editor.
12
13
  */
13
- label: string;
14
+ label: DefinitionString;
14
15
  /**
15
16
  * Optional description providing additional context.
16
17
  *
17
18
  * Displayed below the option label in the editor.
18
19
  */
19
- description?: string;
20
+ description?: DefinitionString;
21
+ /**
22
+ * The placeholder.
23
+ */
24
+ placeholder?: DefinitionString;
20
25
  /**
21
26
  * The HTML input type.
22
27
  *
@@ -38,13 +43,13 @@ type DefinitionOptionNumberBase = {
38
43
  /**
39
44
  * The label displayed in the editor.
40
45
  */
41
- label: string;
46
+ label: DefinitionString;
42
47
  /**
43
48
  * Optional description providing additional context.
44
49
  *
45
50
  * Displayed below the option label in the editor.
46
51
  */
47
- description?: string;
52
+ description?: DefinitionString;
48
53
  /**
49
54
  * Minimum allowed value.
50
55
  *
@@ -93,13 +98,13 @@ type DefinitionOptionRange = {
93
98
  /**
94
99
  * The label displayed in the editor.
95
100
  */
96
- label: string;
101
+ label: DefinitionString;
97
102
  /**
98
103
  * Optional description providing additional context.
99
104
  *
100
105
  * Displayed below the option label in the editor.
101
106
  */
102
- description?: string;
107
+ description?: DefinitionString;
103
108
  /**
104
109
  * Minimum allowed value.
105
110
  */
@@ -127,13 +132,13 @@ type DefinitionOptionDateTimeLocal = {
127
132
  /**
128
133
  * The label displayed in the editor.
129
134
  */
130
- label: string;
135
+ label: DefinitionString;
131
136
  /**
132
137
  * Optional description providing additional context.
133
138
  *
134
139
  * Displayed below the option label in the editor.
135
140
  */
136
- description?: string;
141
+ description?: DefinitionString;
137
142
  /**
138
143
  * The default value as an ISO 8601 datetime string.
139
144
  *
@@ -167,13 +172,13 @@ type DefinitionOptionCheckbox = {
167
172
  /**
168
173
  * The label displayed in the editor.
169
174
  */
170
- label: string;
175
+ label: DefinitionString;
171
176
  /**
172
177
  * Optional description providing additional context.
173
178
  *
174
179
  * Displayed below the option label in the editor.
175
180
  */
176
- description?: string;
181
+ description?: DefinitionString;
177
182
  /**
178
183
  * Optional group name for organizing options.
179
184
  *
@@ -195,13 +200,13 @@ type DefinitionOptionColor = {
195
200
  /**
196
201
  * The label displayed in the editor.
197
202
  */
198
- label: string;
203
+ label: DefinitionString;
199
204
  /**
200
205
  * Optional description providing additional context.
201
206
  *
202
207
  * Displayed below the option label in the editor.
203
208
  */
204
- description?: string;
209
+ description?: DefinitionString;
205
210
  /**
206
211
  * Optional group name for organizing options.
207
212
  *
@@ -217,13 +222,13 @@ type DefinitionOptionCheckboxes = {
217
222
  /**
218
223
  * The label displayed in the editor.
219
224
  */
220
- label: string;
225
+ label: DefinitionString;
221
226
  /**
222
227
  * Optional description providing additional context.
223
228
  *
224
229
  * Displayed below the option label in the editor.
225
230
  */
226
- description?: string;
231
+ description?: DefinitionString;
227
232
  /**
228
233
  * The default values.
229
234
  */
@@ -233,7 +238,7 @@ type DefinitionOptionCheckboxes = {
233
238
  *
234
239
  * Key is the option value, value is the display label.
235
240
  */
236
- options: Record<string, string>;
241
+ options: Record<string, DefinitionString>;
237
242
  /**
238
243
  * Optional group name for organizing options.
239
244
  *
@@ -251,11 +256,11 @@ type DefinitionOptionRadiosGridOption = {
251
256
  /**
252
257
  * The label displayed for this option.
253
258
  */
254
- label: string;
259
+ label: DefinitionString;
255
260
  /**
256
261
  * Optional description providing additional context for this option.
257
262
  */
258
- description?: string;
263
+ description?: DefinitionString;
259
264
  };
260
265
  type DefinitionOptionRadiosGrid = {
261
266
  /**
@@ -285,11 +290,11 @@ type DefinitionOptionRadiosColorsOption = {
285
290
  /**
286
291
  * The label displayed for this option.
287
292
  */
288
- label: string;
293
+ label: DefinitionString;
289
294
  /**
290
295
  * Optional description providing additional context for this option.
291
296
  */
292
- description?: string;
297
+ description?: DefinitionString;
293
298
  };
294
299
  type DefinitionOptionRadiosColors = {
295
300
  /**
@@ -317,8 +322,8 @@ type DefinitionOptionRadiosRadios = {
317
322
  * label and optional description.
318
323
  */
319
324
  options: Record<string, string | {
320
- label: string;
321
- description?: string;
325
+ label: DefinitionString;
326
+ description?: DefinitionString;
322
327
  }>;
323
328
  };
324
329
  type DefinitionOptionRadiosIconsOptionBase<Icon extends string = string> = {
@@ -331,11 +336,11 @@ type DefinitionOptionRadiosIconsOptionBase<Icon extends string = string> = {
331
336
  /**
332
337
  * The label displayed for this option.
333
338
  */
334
- label: string;
339
+ label: DefinitionString;
335
340
  /**
336
341
  * Optional description providing additional context for this option.
337
342
  */
338
- description?: string;
343
+ description?: DefinitionString;
339
344
  };
340
345
  type DefinitionOptionRadiosIconsBase<Icon extends string = string> = {
341
346
  /**
@@ -357,13 +362,13 @@ type DefinitionOptionRadiosBase<Icon extends string = string> = {
357
362
  /**
358
363
  * The label displayed in the editor.
359
364
  */
360
- label: string;
365
+ label: DefinitionString;
361
366
  /**
362
367
  * Optional description providing additional context.
363
368
  *
364
369
  * Displayed below the option label in the editor.
365
370
  */
366
- description?: string;
371
+ description?: DefinitionString;
367
372
  /**
368
373
  * The default value.
369
374
  *
@@ -379,10 +384,10 @@ type DefinitionOptionRadiosBase<Icon extends string = string> = {
379
384
  } & (DefinitionOptionRadiosColors | DefinitionOptionRadiosGrid | DefinitionOptionRadiosRadios | DefinitionOptionRadiosIconsBase<Icon>);
380
385
  type DefinitionOptionJsonBase<DataType extends string = string> = {
381
386
  type: 'json';
382
- label: string;
387
+ label: DefinitionString;
383
388
  default: string;
384
389
  dataType?: DataType;
385
- description?: string;
390
+ description?: DefinitionString;
386
391
  group?: string;
387
392
  };
388
393
  export type BlockOptionDefinitionBase<Icon extends string = string, DataType extends string = string> = DefinitionOptionJsonBase<DataType> | DefinitionOptionColor | DefinitionOptionCheckbox | DefinitionOptionCheckboxes | DefinitionOptionRadiosBase<Icon> | DefinitionOptionText | DefinitionOptionRange | DefinitionOptionNumber | DefinitionOptionDateTimeLocal;
package/dist/module.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { NuxtModule } from 'nuxt/schema';
2
- import { M as ModuleOptions } from './shared/editor.D28NbXr3.mjs';
3
- export { a as ModuleHooks } from './shared/editor.D28NbXr3.mjs';
2
+ import { M as ModuleOptions } from './shared/editor.S5sA3rij.mjs';
3
+ export { a as ModuleHooks } from './shared/editor.S5sA3rij.mjs';
4
4
  import 'consola';
5
5
  import '../dist/global/types/definitions.js';
6
6
  import '../dist/global/types/theme.js';
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.63",
4
+ "version": "2.0.0-alpha.65",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.15.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -5,7 +5,7 @@ import MagicString from 'magic-string';
5
5
  import { walk } from 'estree-walker-ts';
6
6
  import { pathToFileURL } from 'node:url';
7
7
  import { parseURL, parseQuery } from 'ufo';
8
- import { C as Collector, a as CollectedFile, c as extractObjectLiteral, p as parseTsObject, t as toValidVariableName, o as onlyUnique, f as falsy, s as sortObjectKeys } from './shared/editor.Gu7mgJ5Q.mjs';
8
+ import { C as Collector, a as CollectedFile, c as extractObjectLiteral, p as parseTsObject, t as toValidVariableName, o as onlyUnique, f as falsy, s as sortObjectKeys } from './shared/editor.BGemL1Oh.mjs';
9
9
  import { dirname, resolve, relative } from 'pathe';
10
10
  import micromatch from 'micromatch';
11
11
  import { hash } from 'ohash';
@@ -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.63";
22
+ const version = "2.0.0-alpha.65";
23
23
 
24
24
  function validateOption(optionKey, option, icons) {
25
25
  const errors = [];
@@ -1198,6 +1198,16 @@ class ModuleHelper {
1198
1198
  resolvers;
1199
1199
  fileCache;
1200
1200
  options;
1201
+ /**
1202
+ * npm packages to pre-bundle via Vite's optimizeDeps, collected from the core
1203
+ * module and enabled sub-modules. Flushed by {@link applyBuildConfig}.
1204
+ */
1205
+ packageDependencies = /* @__PURE__ */ new Set();
1206
+ /**
1207
+ * npm packages that must resolve to a single copy across the whole app.
1208
+ * Flushed to Vite's resolve.dedupe by {@link applyBuildConfig}.
1209
+ */
1210
+ dedupedPackages = /* @__PURE__ */ new Set();
1201
1211
  isDev;
1202
1212
  isModuleBuild;
1203
1213
  isPrepare;
@@ -1254,6 +1264,67 @@ class ModuleHelper {
1254
1264
  from: this.resolvers.module.resolve("./runtime/composables/" + name)
1255
1265
  });
1256
1266
  }
1267
+ /**
1268
+ * Register npm packages that the editor imports at runtime so Vite
1269
+ * pre-bundles them.
1270
+ *
1271
+ * Without this, Vite discovers a dependency lazily on first import (often via
1272
+ * a dynamic `import()`) and triggers a full page reload to re-optimize. The
1273
+ * core module declares its own dependencies; optional modules (agent, charts,
1274
+ * …) declare theirs only when enabled, so projects that don't use a module
1275
+ * don't pre-bundle its dependencies.
1276
+ *
1277
+ * Collected here and flushed to the Vite config by {@link applyBuildConfig},
1278
+ * which the core module calls once all modules have run their setup.
1279
+ *
1280
+ * @param names - Bare package specifiers (e.g. 'echarts', '@tiptap/core').
1281
+ */
1282
+ addPackageDependency(...names) {
1283
+ for (const name of names) {
1284
+ this.packageDependencies.add(name);
1285
+ }
1286
+ }
1287
+ /**
1288
+ * Declare packages that must only ever exist once in the module graph.
1289
+ *
1290
+ * Libraries that rely on `instanceof` checks or module-level registries break
1291
+ * when a project's install tree ends up with two copies (e.g. a hoisted
1292
+ * version plus an older one nested under a transitive dependency). Forcing
1293
+ * resolution to a single copy makes the editor work regardless of how the
1294
+ * host project's package manager arranged node_modules.
1295
+ *
1296
+ * @param names - Bare package specifiers (e.g. 'prosemirror-model').
1297
+ */
1298
+ addDedupedPackage(...names) {
1299
+ for (const name of names) {
1300
+ this.dedupedPackages.add(name);
1301
+ }
1302
+ }
1303
+ /**
1304
+ * Apply collected build configuration to the Nuxt/Vite config.
1305
+ *
1306
+ * Called once by the core module after every module's setup has run, so it
1307
+ * sees the full set of {@link addPackageDependency} and
1308
+ * {@link addDedupedPackage} registrations.
1309
+ */
1310
+ applyBuildConfig() {
1311
+ this.nuxt.options.vite.optimizeDeps ??= {};
1312
+ const include = this.nuxt.options.vite.optimizeDeps.include ??= [];
1313
+ const exclude = this.nuxt.options.vite.optimizeDeps.exclude ?? [];
1314
+ for (const name of this.packageDependencies) {
1315
+ if (include.includes(name) || exclude.includes(name)) {
1316
+ continue;
1317
+ }
1318
+ include.push(name);
1319
+ }
1320
+ this.nuxt.options.vite.resolve ??= {};
1321
+ const dedupe = this.nuxt.options.vite.resolve.dedupe ??= [];
1322
+ for (const name of this.dedupedPackages) {
1323
+ if (!dedupe.includes(name)) {
1324
+ dedupe.push(name);
1325
+ }
1326
+ }
1327
+ }
1257
1328
  addAlias(name, path) {
1258
1329
  this.nuxt.options.alias[name] = path;
1259
1330
  this.nuxt.options.nitro.typescript ||= {};
@@ -4059,6 +4130,39 @@ const optionsSchema = withHelper((helper) => {
4059
4130
  }
4060
4131
  return defineFileTemplate(fileName, (ctx) => {
4061
4132
  const globalOptions = ctx.helper.options.globalOptions || {};
4133
+ const defaultLanguage = ctx.helper.options.defaultLanguage || "en";
4134
+ const normalizeDefinitionString = (value) => {
4135
+ if (typeof value === "string") {
4136
+ return { [defaultLanguage]: value };
4137
+ }
4138
+ return value;
4139
+ };
4140
+ const normalizeOption = (option) => {
4141
+ if (!option || typeof option !== "object") {
4142
+ return option;
4143
+ }
4144
+ const result = { ...option };
4145
+ if ("label" in result) {
4146
+ result.label = normalizeDefinitionString(result.label);
4147
+ }
4148
+ if ("description" in result) {
4149
+ result.description = normalizeDefinitionString(result.description);
4150
+ }
4151
+ if (result.options && typeof result.options === "object") {
4152
+ const normalizedOptions = {};
4153
+ for (const [key, value] of Object.entries(result.options)) {
4154
+ if (result.type === "checkboxes") {
4155
+ normalizedOptions[key] = normalizeDefinitionString(value);
4156
+ } else if (typeof value === "string") {
4157
+ normalizedOptions[key] = { label: { [defaultLanguage]: value } };
4158
+ } else {
4159
+ normalizedOptions[key] = normalizeOption(value);
4160
+ }
4161
+ }
4162
+ result.options = normalizedOptions;
4163
+ }
4164
+ return result;
4165
+ };
4062
4166
  const blocks = [...ctx.blocks.files.values()];
4063
4167
  const schema = blocks.reduce((acc, v) => {
4064
4168
  if (v.definition && isBlock(v.definition)) {
@@ -4074,6 +4178,12 @@ const optionsSchema = withHelper((helper) => {
4074
4178
  }
4075
4179
  return acc;
4076
4180
  }, {});
4181
+ for (const bundle of Object.keys(schema)) {
4182
+ const options = schema[bundle];
4183
+ for (const key of Object.keys(options)) {
4184
+ options[key] = normalizeOption(options[key]);
4185
+ }
4186
+ }
4077
4187
  const sorted = sortObjectKeys(schema);
4078
4188
  return JSON.stringify(sorted, null, 2);
4079
4189
  });
@@ -4590,9 +4700,48 @@ const module$1 = defineNuxtModule({
4590
4700
  const moduleDir = import.meta.url;
4591
4701
  const resolver = createResolver(moduleDir);
4592
4702
  nuxt.options.build.transpile.push(resolver.resolve("runtime"));
4593
- nuxt.options.vite.optimizeDeps ??= {};
4594
- nuxt.options.vite.optimizeDeps.include ??= [];
4595
- nuxt.options.vite.optimizeDeps.include.push("papaparse", "pofile");
4703
+ helper.addPackageDependency(
4704
+ "@floating-ui/dom",
4705
+ "@tiptap/core",
4706
+ "@tiptap/extension-emoji",
4707
+ "@tiptap/extension-mention",
4708
+ "@tiptap/extension-task-item",
4709
+ "@tiptap/extension-task-list",
4710
+ "@tiptap/starter-kit",
4711
+ "@tiptap/vue-3",
4712
+ "@vue/devtools-core",
4713
+ "@vue/devtools-kit",
4714
+ "axe-core",
4715
+ // CJS
4716
+ "fzf",
4717
+ "get-video-id",
4718
+ "html-diff-ts",
4719
+ "mitt",
4720
+ "papaparse",
4721
+ // CJS
4722
+ "pofile",
4723
+ // CJS
4724
+ "qrcode.vue",
4725
+ "twgl.js"
4726
+ );
4727
+ helper.addDedupedPackage(
4728
+ "@tiptap/core",
4729
+ "@tiptap/pm",
4730
+ "prosemirror-changeset",
4731
+ "prosemirror-commands",
4732
+ "prosemirror-dropcursor",
4733
+ "prosemirror-gapcursor",
4734
+ "prosemirror-history",
4735
+ "prosemirror-inputrules",
4736
+ "prosemirror-keymap",
4737
+ "prosemirror-model",
4738
+ "prosemirror-schema-list",
4739
+ "prosemirror-state",
4740
+ "prosemirror-tables",
4741
+ "prosemirror-transform",
4742
+ "prosemirror-view"
4743
+ );
4744
+ helper.applyBuildConfig();
4596
4745
  helper.addComponent("BlokkliField");
4597
4746
  helper.addComponent("BlokkliEditable");
4598
4747
  helper.addComponent("BlokkliProvider");
@@ -1,4 +1,4 @@
1
- import { B as BlokkliModule } from '../../shared/editor.D28NbXr3.mjs';
1
+ import { B as BlokkliModule } from '../../shared/editor.S5sA3rij.mjs';
2
2
  import 'nuxt/schema';
3
3
  import 'consola';
4
4
  import '../../../dist/global/types/definitions.js';
@@ -3,7 +3,7 @@ import { fileURLToPath } from 'node:url';
3
3
  import * as path from 'node:path';
4
4
  import { defineBlokkliModule } from '../index.mjs';
5
5
  import * as fs from 'node:fs';
6
- import { C as Collector, a as CollectedFile, b as extractStringProperty } from '../../shared/editor.Gu7mgJ5Q.mjs';
6
+ import { C as Collector, a as CollectedFile, e as extractStringProperty } from '../../shared/editor.BGemL1Oh.mjs';
7
7
  import { d as defineCodeTemplate } from '../../shared/editor.6D5vApr0.mjs';
8
8
  import MagicString from 'magic-string';
9
9
  import { parse } from 'acorn';
@@ -645,6 +645,7 @@ export default defineNuxtConfig({
645
645
  "#blokkli/agent/server",
646
646
  moduleResolver.resolve("./runtime/server")
647
647
  );
648
+ ctx.helper.addPackageDependency("mammoth", "marked", "turndown", "zod");
648
649
  const moduleBlokkliDirs = ctx.helper.options.blokkliDirs || [];
649
650
  const moduleToolsDir = moduleResolver.resolve("./runtime/app/tools");
650
651
  const projectToolsDir = path.resolve(nuxt.options.rootDir, "blokkli/tools");
@@ -30,7 +30,7 @@ const bodyRows = computed(() => {
30
30
  });
31
31
  </script>
32
32
 
33
- <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
33
+ <style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
34
34
  .bk-agent-attachment-table {
35
35
  width: 100%;
36
36
  border-collapse: collapse;
@@ -25,7 +25,7 @@ declare const __VLS_export: <TItem>(__VLS_props: NonNullable<Awaited<typeof __VL
25
25
  isSelected: boolean;
26
26
  }) => unknown;
27
27
  };
28
- emit: (evt: "update:page", value: number) => void;
28
+ emit: (event: "update:page", value: number) => void;
29
29
  }>) => import("vue").VNode & {
30
30
  __ctx?: Awaited<typeof __VLS_setup>;
31
31
  };
@@ -25,7 +25,7 @@ declare const __VLS_export: <TItem>(__VLS_props: NonNullable<Awaited<typeof __VL
25
25
  isSelected: boolean;
26
26
  }) => unknown;
27
27
  };
28
- emit: (evt: "update:page", value: number) => void;
28
+ emit: (event: "update:page", value: number) => void;
29
29
  }>) => import("vue").VNode & {
30
30
  __ctx?: Awaited<typeof __VLS_setup>;
31
31
  };
@@ -92,7 +92,7 @@ const { $t } = useBlokkli();
92
92
  const isExpanded = ref(false);
93
93
  </script>
94
94
 
95
- <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
95
+ <style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
96
96
  .bk-agent-input-actions-button {
97
97
  display: flex;
98
98
  height: 40px;
@@ -42,7 +42,7 @@ const disclaimer = computed(() => {
42
42
  });
43
43
  </script>
44
44
 
45
- <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
45
+ <style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
46
46
  .bk-agent-welcome-text ul + p {
47
47
  margin-top: 30px;
48
48
  }
@@ -134,7 +134,7 @@ export default {
134
134
  };
135
135
  </script>
136
136
 
137
- <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
137
+ <style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
138
138
  .bk-agent-transcript-block {
139
139
  margin: 0px;
140
140
  border-radius: 4px;
@@ -168,7 +168,7 @@ export default {
168
168
  };
169
169
  </script>
170
170
 
171
- <style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
171
+ <style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
172
172
  @keyframes bk-sparkle {
173
173
  0%,
174
174
  100% {
@@ -1,4 +1,5 @@
1
1
  import type { BlokkliApp } from '#blokkli/editor/types/app';
2
+ import type { MutationResponseLike } from '#blokkli/editor/adapter';
2
3
  /**
3
4
  * Tree-shaped entry in the `newParagraphs` payload returned by mutation tools.
4
5
  *
@@ -27,6 +28,17 @@ export type NewParagraphNode = {
27
28
  * round-trips are needed.
28
29
  */
29
30
  export declare function buildNewParagraphsTree(newUuids: string[], app: BlokkliApp, itemEntityType: string): NewParagraphNode[];
31
+ /**
32
+ * Compose an agent-facing error message from a rejected mutation response.
33
+ *
34
+ * Backends return structured `violations` (field-level constraint failures)
35
+ * and/or plain `errors`. Violations carry the useful context (which field on
36
+ * which entity failed and why), so they're preferred; the generic `errors`
37
+ * list (e.g. Drupal's catch-all "Entity Violations") is only used as a
38
+ * fallback when no violations are present. The result is surfaced to the LLM
39
+ * so it can correct the mutation (e.g. supply the missing required field).
40
+ */
41
+ export declare function formatMutationFailure(response: MutationResponseLike<any> | undefined): string;
30
42
  /**
31
43
  * Count every node in a `newParagraphs` tree, including nested children.
32
44
  *
@@ -35,6 +35,40 @@ export function buildNewParagraphsTree(newUuids, app, itemEntityType) {
35
35
  }
36
36
  return roots;
37
37
  }
38
+ function violationLocation(violation) {
39
+ const parts = [];
40
+ if (violation.propertyPath) {
41
+ parts.push(violation.propertyPath);
42
+ }
43
+ if (violation.entityUuid) {
44
+ const entity = violation.entityType ?? "entity";
45
+ parts.push(
46
+ violation.propertyPath ? `(${entity} ${violation.entityUuid})` : `${entity} ${violation.entityUuid}`
47
+ );
48
+ }
49
+ return parts.join(" ");
50
+ }
51
+ export function formatMutationFailure(response) {
52
+ if (!response) {
53
+ return "The mutation failed: the backend returned no response.";
54
+ }
55
+ const violations = response.violations ?? [];
56
+ if (violations.length) {
57
+ const lines = violations.map((violation) => {
58
+ const location = violationLocation(violation);
59
+ return location ? `- ${location}: ${violation.message}` : `- ${violation.message}`;
60
+ });
61
+ return `The mutation was rejected by the backend:
62
+ ${lines.join("\n")}`;
63
+ }
64
+ const errors = (response.errors ?? []).filter(Boolean);
65
+ if (errors.length) {
66
+ const lines = errors.map((error) => `- ${error}`);
67
+ return `The mutation was rejected by the backend:
68
+ ${lines.join("\n")}`;
69
+ }
70
+ return "The mutation was rejected by the backend.";
71
+ }
38
72
  export function countNewParagraphs(nodes) {
39
73
  let total = 0;
40
74
  for (const node of nodes) {
@@ -11,7 +11,10 @@ import {
11
11
  asRecord,
12
12
  splitMeta
13
13
  } from "#blokkli/agent/app/helpers";
14
- import { buildNewParagraphsTree } from "#blokkli/agent/app/helpers/mutationResult";
14
+ import {
15
+ buildNewParagraphsTree,
16
+ formatMutationFailure
17
+ } from "#blokkli/agent/app/helpers/mutationResult";
15
18
  import { mcpTools } from "#blokkli-build/agent-client";
16
19
  import { itemEntityType } from "#blokkli-build/config";
17
20
  import { generateId } from "#blokkli/agent/app/helpers/id";
@@ -95,14 +98,19 @@ export default function toolsProvider({
95
98
  if (setLabel) setLabel(action.label);
96
99
  async function applyMutation() {
97
100
  const uuidsBefore = state.getAllUuids();
98
- await state.mutateWithLoadingState(() => action.apply(adapter));
101
+ const response = await state.applyMutationSilently(
102
+ () => action.apply(adapter)
103
+ );
104
+ if (!response || !response.success) {
105
+ return { ok: false, error: formatMutationFailure(response) };
106
+ }
99
107
  const newUuids = state.getAllUuids().filter((uuid) => !uuidsBefore.includes(uuid));
100
108
  const selectUuids = newUuids.length ? newUuids : action.affectedUuids || [];
101
109
  if (selectUuids.length) {
102
110
  app.eventBus.emit("select", selectUuids);
103
111
  app.eventBus.emit("scrollSelectionIntoView", {});
104
112
  }
105
- return newUuids;
113
+ return { ok: true, result: buildMutationResult(newUuids), meta: {} };
106
114
  }
107
115
  function buildMutationResult(newUuids) {
108
116
  const newParagraphs = action.type === "add" ? buildNewParagraphsTree(newUuids, app, itemEntityType) : [];
@@ -114,13 +122,11 @@ export default function toolsProvider({
114
122
  };
115
123
  }
116
124
  if (autoApprove.value || !toolDef.requiresApproval) {
117
- const newUuids = await applyMutation();
118
- return { ok: true, result: buildMutationResult(newUuids), meta: {} };
125
+ return applyMutation();
119
126
  }
120
127
  const approved = await waitForApproval(action);
121
128
  if (approved) {
122
- const newUuids = await applyMutation();
123
- return { ok: true, result: buildMutationResult(newUuids), meta: {} };
129
+ return applyMutation();
124
130
  }
125
131
  if (action.revert) action.revert();
126
132
  return { ok: true, result: { success: false, rejected: true }, meta: {} };
@@ -13,11 +13,11 @@ export declare const paramsSchema: z.ZodObject<{
13
13
  }, z.core.$strip>;
14
14
  export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
15
15
  type: z.ZodEnum<{
16
+ options: "options";
16
17
  rewrite: "rewrite";
17
18
  delete: "delete";
18
19
  add: "add";
19
20
  move: "move";
20
- options: "options";
21
21
  }>;
22
22
  label: z.ZodString;
23
23
  }, z.core.$strip>, z.ZodObject<{
@@ -10,11 +10,11 @@ export declare const paramsSchema: z.ZodObject<{
10
10
  }, z.core.$strip>;
11
11
  export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
12
12
  type: z.ZodEnum<{
13
+ options: "options";
13
14
  rewrite: "rewrite";
14
15
  delete: "delete";
15
16
  add: "add";
16
17
  move: "move";
17
- options: "options";
18
18
  }>;
19
19
  label: z.ZodString;
20
20
  }, z.core.$strip>, z.ZodObject<{