@blokkli/editor 2.0.0-alpha.35 → 2.0.0-alpha.36

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 (199) hide show
  1. package/dist/global/types/blockOptions.d.ts +9 -2
  2. package/dist/global/types/definitions.d.ts +12 -5
  3. package/dist/module.d.mts +2 -2
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +56 -4
  6. package/dist/modules/agent/index.d.mts +1 -1
  7. package/dist/modules/agent/index.mjs +38 -20
  8. package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +2 -2
  9. package/dist/modules/agent/runtime/app/composables/agentProvider.js +3 -3
  10. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +34 -60
  11. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.d.vue.ts +8 -0
  12. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +138 -0
  13. package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue.d.ts +8 -0
  14. package/dist/modules/agent/runtime/app/features/agent/index.vue +5 -1
  15. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +175 -0
  16. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +5 -0
  17. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +10 -1
  18. package/dist/modules/agent/runtime/app/tools/schemas.js +36 -23
  19. package/dist/modules/agent/runtime/server/Session.d.ts +4 -2
  20. package/dist/modules/agent/runtime/server/Session.js +61 -57
  21. package/dist/modules/agent/runtime/server/agentPrompt.d.ts +9 -1
  22. package/dist/modules/agent/runtime/server/agentPrompt.js +26 -0
  23. package/dist/modules/agent/runtime/shared/types.d.ts +35 -1
  24. package/dist/modules/charts/index.d.mts +35 -0
  25. package/dist/modules/charts/index.mjs +43 -0
  26. package/dist/modules/charts/runtime/blokkli/skills/charts.d.ts +2 -0
  27. package/dist/modules/charts/runtime/blokkli/skills/charts.js +42 -0
  28. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +63 -0
  29. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +98 -0
  30. package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.d.ts +2 -0
  31. package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.js +86 -0
  32. package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.d.ts +2 -0
  33. package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.js +74 -0
  34. package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.d.ts +2 -0
  35. package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.js +42 -0
  36. package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.d.ts +2 -0
  37. package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.js +101 -0
  38. package/dist/modules/charts/runtime/chartTypes/area.d.ts +2 -0
  39. package/dist/modules/charts/runtime/chartTypes/area.js +68 -0
  40. package/dist/modules/charts/runtime/chartTypes/bar.d.ts +2 -0
  41. package/dist/modules/charts/runtime/chartTypes/bar.js +76 -0
  42. package/dist/modules/charts/runtime/chartTypes/define.d.ts +2 -0
  43. package/dist/modules/charts/runtime/chartTypes/define.js +3 -0
  44. package/dist/modules/charts/runtime/chartTypes/donut.d.ts +2 -0
  45. package/dist/modules/charts/runtime/chartTypes/donut.js +45 -0
  46. package/dist/modules/charts/runtime/chartTypes/heatmap.d.ts +2 -0
  47. package/dist/modules/charts/runtime/chartTypes/heatmap.js +54 -0
  48. package/dist/modules/charts/runtime/chartTypes/index.d.ts +21 -0
  49. package/dist/modules/charts/runtime/chartTypes/index.js +47 -0
  50. package/dist/modules/charts/runtime/chartTypes/line.d.ts +2 -0
  51. package/dist/modules/charts/runtime/chartTypes/line.js +68 -0
  52. package/dist/modules/charts/runtime/chartTypes/pie.d.ts +2 -0
  53. package/dist/modules/charts/runtime/chartTypes/pie.js +28 -0
  54. package/dist/modules/charts/runtime/chartTypes/radar.d.ts +2 -0
  55. package/dist/modules/charts/runtime/chartTypes/radar.js +52 -0
  56. package/dist/modules/charts/runtime/chartTypes/radialBar.d.ts +2 -0
  57. package/dist/modules/charts/runtime/chartTypes/radialBar.js +44 -0
  58. package/dist/modules/charts/runtime/chartTypes/shared.d.ts +52 -0
  59. package/dist/modules/charts/runtime/chartTypes/shared.js +103 -0
  60. package/dist/modules/charts/runtime/chartTypes/types.d.ts +29 -0
  61. package/dist/modules/charts/runtime/chartTypes/types.js +0 -0
  62. package/dist/modules/charts/runtime/components/ChartRenderer/index.d.vue.ts +4 -0
  63. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +120 -0
  64. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue.d.ts +4 -0
  65. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.d.vue.ts +3 -0
  66. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.vue +29 -0
  67. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.vue.d.ts +3 -0
  68. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.d.vue.ts +15 -0
  69. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue +97 -0
  70. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue.d.ts +15 -0
  71. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.d.vue.ts +11 -0
  72. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue +34 -0
  73. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue.d.ts +11 -0
  74. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.d.vue.ts +12 -0
  75. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +49 -0
  76. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue.d.ts +12 -0
  77. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.d.vue.ts +19 -0
  78. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue +90 -0
  79. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue.d.ts +19 -0
  80. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.d.vue.ts +23 -0
  81. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +224 -0
  82. package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue.d.ts +23 -0
  83. package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.d.vue.ts +10 -0
  84. package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue +61 -0
  85. package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue.d.ts +10 -0
  86. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.d.vue.ts +8 -0
  87. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue +23 -0
  88. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue.d.ts +8 -0
  89. package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +10 -0
  90. package/dist/modules/charts/runtime/features/charts/Editor/index.vue +243 -0
  91. package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +10 -0
  92. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +17 -0
  93. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.js +90 -0
  94. package/dist/modules/charts/runtime/features/charts/index.d.vue.ts +3 -0
  95. package/dist/modules/charts/runtime/features/charts/index.vue +72 -0
  96. package/dist/modules/charts/runtime/features/charts/index.vue.d.ts +3 -0
  97. package/dist/modules/charts/runtime/helpers/index.d.ts +1 -0
  98. package/dist/modules/charts/runtime/helpers/index.js +17 -0
  99. package/dist/modules/charts/runtime/types.d.ts +51 -0
  100. package/dist/modules/charts/runtime/types.js +64 -0
  101. package/dist/modules/drupal/graphql/features/fragments.graphql +2 -0
  102. package/dist/modules/drupal/index.d.mts +1 -1
  103. package/dist/modules/drupal/runtime/adapter/index.js +12 -8
  104. package/dist/modules/table-of-contents/index.d.mts +11 -0
  105. package/dist/modules/table-of-contents/index.mjs +24 -0
  106. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.d.vue.ts +44 -0
  107. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue +43 -0
  108. package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue.d.ts +44 -0
  109. package/dist/modules/table-of-contents/runtime/types/index.d.ts +4 -0
  110. package/dist/modules/table-of-contents/runtime/types/index.js +0 -0
  111. package/dist/runtime/components/Blocks/Fragment/index.vue +6 -2
  112. package/dist/runtime/components/BlokkliItem.vue +8 -3
  113. package/dist/runtime/components/BlokkliProvider.d.vue.ts +7 -0
  114. package/dist/runtime/components/BlokkliProvider.vue +7 -1
  115. package/dist/runtime/components/BlokkliProvider.vue.d.ts +7 -0
  116. package/dist/runtime/composables/useBlokkliHelper.js +4 -2
  117. package/dist/runtime/editor/components/AnimationCanvas/index.vue +4 -20
  118. package/dist/runtime/editor/components/Banner/index.d.vue.ts +12 -2
  119. package/dist/runtime/editor/components/Banner/index.vue +4 -2
  120. package/dist/runtime/editor/components/Banner/index.vue.d.ts +12 -2
  121. package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +27 -0
  122. package/dist/runtime/editor/components/Dropdown/index.vue +107 -0
  123. package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +27 -0
  124. package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue +1 -1
  125. package/dist/runtime/editor/components/EditProvider.d.vue.ts +2 -0
  126. package/dist/runtime/editor/components/EditProvider.vue +4 -3
  127. package/dist/runtime/editor/components/EditProvider.vue.d.ts +2 -0
  128. package/dist/runtime/editor/components/Form/Radio/index.d.vue.ts +1 -0
  129. package/dist/runtime/editor/components/Form/Radio/index.vue +3 -2
  130. package/dist/runtime/editor/components/Form/Radio/index.vue.d.ts +1 -0
  131. package/dist/runtime/editor/components/ItemIcon/index.vue +10 -2
  132. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +13 -3
  133. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +15 -7
  134. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +13 -3
  135. package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +2 -0
  136. package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
  137. package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +2 -0
  138. package/dist/runtime/editor/components/ShortcutIndicator/index.vue +1 -1
  139. package/dist/runtime/editor/components/index.d.ts +3 -1
  140. package/dist/runtime/editor/components/index.js +4 -0
  141. package/dist/runtime/editor/composables/onElementResize.js +0 -1
  142. package/dist/runtime/editor/composables/useEditableFieldOverride.js +4 -5
  143. package/dist/runtime/editor/css/output.css +1 -1
  144. package/dist/runtime/editor/events/index.d.ts +7 -0
  145. package/dist/runtime/editor/features/add-list/Help/Item.vue +5 -2
  146. package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
  147. package/dist/runtime/editor/features/clipboard/index.vue +1 -1
  148. package/dist/runtime/editor/features/debug/index.vue +1 -1
  149. package/dist/runtime/editor/features/dev-mode/index.vue +86 -2
  150. package/dist/runtime/editor/features/edit/index.vue +20 -0
  151. package/dist/runtime/editor/features/fragments/types.d.ts +1 -0
  152. package/dist/runtime/editor/features/hover/Renderer/index.vue +30 -3
  153. package/dist/runtime/editor/features/hover/index.vue +1 -1
  154. package/dist/runtime/editor/features/options/Form/Checkbox/index.d.vue.ts +2 -2
  155. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +3 -3
  156. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue.d.ts +2 -2
  157. package/dist/runtime/editor/features/options/Form/Checkboxes/index.d.vue.ts +2 -2
  158. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +5 -5
  159. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue.d.ts +2 -2
  160. package/dist/runtime/editor/features/options/Form/Item.d.vue.ts +2 -2
  161. package/dist/runtime/editor/features/options/Form/Item.vue +14 -48
  162. package/dist/runtime/editor/features/options/Form/Item.vue.d.ts +2 -2
  163. package/dist/runtime/editor/features/options/Form/Number/index.d.vue.ts +3 -3
  164. package/dist/runtime/editor/features/options/Form/Number/index.vue +7 -17
  165. package/dist/runtime/editor/features/options/Form/Number/index.vue.d.ts +3 -3
  166. package/dist/runtime/editor/features/options/Form/Range/index.d.vue.ts +2 -2
  167. package/dist/runtime/editor/features/options/Form/Range/index.vue +4 -4
  168. package/dist/runtime/editor/features/options/Form/Range/index.vue.d.ts +2 -2
  169. package/dist/runtime/editor/features/options/Form/index.vue +10 -5
  170. package/dist/runtime/editor/features/selection/index.vue +2 -2
  171. package/dist/runtime/editor/features/transform/index.vue +1 -3
  172. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +1 -1
  173. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +1 -1
  174. package/dist/runtime/editor/providers/definition.d.ts +2 -2
  175. package/dist/runtime/editor/providers/definition.js +7 -1
  176. package/dist/runtime/editor/providers/dom.d.ts +5 -0
  177. package/dist/runtime/editor/providers/dom.js +11 -2
  178. package/dist/runtime/editor/providers/fields.d.ts +19 -1
  179. package/dist/runtime/editor/providers/fields.js +54 -2
  180. package/dist/runtime/editor/translations/de.json +269 -1
  181. package/dist/runtime/editor/translations/fr.json +269 -1
  182. package/dist/runtime/editor/translations/gsw_CH.json +269 -1
  183. package/dist/runtime/editor/translations/it.json +269 -1
  184. package/dist/runtime/helpers/imports/index.d.ts +8 -1
  185. package/dist/runtime/helpers/imports/index.js +15 -6
  186. package/dist/runtime/helpers/injections.d.ts +5 -1
  187. package/dist/runtime/helpers/injections.js +3 -0
  188. package/dist/runtime/helpers/runtimeHelpers/index.js +14 -0
  189. package/dist/runtime/types/definitions.d.ts +8 -5
  190. package/dist/runtime/types/provider.d.ts +2 -0
  191. package/dist/shared/editor.6D5vApr0.mjs +30 -0
  192. package/dist/shared/{editor.DMFfaLVE.mjs → editor.BFIzNSQM.mjs} +1 -30
  193. package/dist/shared/{editor.Iax3GCvt.d.mts → editor.CWQIFIEQ.d.mts} +22 -0
  194. package/dist/types.d.mts +1 -1
  195. package/package.json +17 -1
  196. package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +0 -104
  197. /package/dist/modules/agent/runtime/app/tools/{get_available_bundles → get_bundle_info}/index.d.ts +0 -0
  198. /package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.d.vue.ts +0 -0
  199. /package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue.d.ts +0 -0
@@ -9,7 +9,7 @@
9
9
  import { computed } from "#imports";
10
10
  const props = defineProps({
11
11
  label: { type: String, required: true },
12
- modelValue: { type: String, required: false },
12
+ modelValue: { type: Number, required: false },
13
13
  min: { type: Number, required: true },
14
14
  max: { type: Number, required: true },
15
15
  step: { type: Number, required: true }
@@ -17,14 +17,14 @@ const props = defineProps({
17
17
  const emit = defineEmits(["update:modelValue"]);
18
18
  const text = computed({
19
19
  get() {
20
- return props.modelValue || "0";
20
+ return String(props.modelValue ?? 0);
21
21
  },
22
22
  set(v) {
23
- emit("update:modelValue", (v === void 0 ? "" : v).toString());
23
+ emit("update:modelValue", Number(v) || 0);
24
24
  }
25
25
  });
26
26
  const formatted = computed(() => {
27
- const numValue = typeof text.value === "string" ? Number.parseFloat(text.value) : text.value;
27
+ const numValue = props.modelValue ?? 0;
28
28
  const stepPrecision = (props.step.toString().split(".")[1] || "").length;
29
29
  return numValue.toFixed(stepPrecision);
30
30
  });
@@ -2,7 +2,7 @@ declare const _default: typeof __VLS_export;
2
2
  export default _default;
3
3
  declare const __VLS_export: import("vue").DefineComponent<{
4
4
  label: string;
5
- modelValue?: string;
5
+ modelValue?: number;
6
6
  min: number;
7
7
  max: number;
8
8
  step: number;
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
10
10
  "update:modelValue": (...args: any[]) => void;
11
11
  }, string, import("vue").PublicProps, Readonly<{
12
12
  label: string;
13
- modelValue?: string;
13
+ modelValue?: number;
14
14
  min: number;
15
15
  max: number;
16
16
  step: number;
@@ -266,21 +266,26 @@ const optionGroups = computed(() => {
266
266
  );
267
267
  });
268
268
  function setOptionValue(key, value) {
269
+ const optionDef = availableOptions.value.find((o) => o.property === key);
270
+ const storable = optionDef ? optionValueToStorable(
271
+ optionDef.option,
272
+ value
273
+ ) : String(value);
269
274
  if (Array.isArray(props.uuids)) {
270
275
  props.uuids.forEach((uuid) => {
271
- updated.set(uuid, key, value);
276
+ updated.set(uuid, key, storable);
272
277
  if (!state.mutatedOptions[uuid]) {
273
278
  state.mutatedOptions[uuid] = {};
274
279
  }
275
- state.mutatedOptions[uuid][key] = value;
276
- eventBus.emit("option:update", { uuid, key, value });
280
+ state.mutatedOptions[uuid][key] = storable;
281
+ eventBus.emit("option:update", { uuid, key, value: storable });
277
282
  });
278
283
  } else {
279
- updated.set("HOST", key, value);
284
+ updated.set("HOST", key, storable);
280
285
  if (!state.mutatedOptions.HOST) {
281
286
  state.mutatedOptions.HOST = {};
282
287
  }
283
- state.mutatedOptions.HOST[key] = value;
288
+ state.mutatedOptions.HOST[key] = storable;
284
289
  }
285
290
  }
286
291
  onMounted(() => {
@@ -231,7 +231,7 @@ function selectInList(prev) {
231
231
  }
232
232
  }
233
233
  onBlokkliEvent("keyPressed", (e) => {
234
- if (selection.isDragging.value || selection.isMultiSelecting.value || ui.hasDialogOpen.value || ui.hasTooltipOpen.value) {
234
+ if (selection.isDragging.value || selection.isMultiSelecting.value || ui.hasDialogOpen.value || ui.hasTooltipOpen.value || ui.hasNestedEditorOpen.value) {
235
235
  return;
236
236
  }
237
237
  if (e.code === "Escape") {
@@ -240,7 +240,7 @@ onBlokkliEvent("keyPressed", (e) => {
240
240
  eventBus.emit("select:host:unselect");
241
241
  }
242
242
  } else if (e.code === "Tab") {
243
- if (tour.isTouring.value || ui.hasDialogOpen.value) {
243
+ if (tour.isTouring.value || ui.hasDialogOpen.value || ui.hasNestedEditorOpen.value) {
244
244
  return;
245
245
  }
246
246
  e.originalEvent.preventDefault();
@@ -118,9 +118,7 @@ function cancelTransform() {
118
118
  }
119
119
  watch(selection.uuids, async () => {
120
120
  if (status.value === "idle") {
121
- execute().then(() => {
122
- console.log(plugins.value);
123
- });
121
+ await execute();
124
122
  }
125
123
  });
126
124
  watch(selection.hasHostSelected, () => {
@@ -191,9 +191,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
191
191
  height: number;
192
192
  };
193
193
  minHeight: number;
194
+ tourText: string;
194
195
  minWidth: number;
195
196
  region: SidebarRegion;
196
- tourText: string;
197
197
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
198
198
  icon?: (props: {}) => any;
199
199
  } & {
@@ -191,9 +191,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
191
191
  height: number;
192
192
  };
193
193
  minHeight: number;
194
+ tourText: string;
194
195
  minWidth: number;
195
196
  region: SidebarRegion;
196
- tourText: string;
197
197
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
198
198
  icon?: (props: {}) => any;
199
199
  } & {
@@ -1,6 +1,6 @@
1
1
  import { type Ref, type ComputedRef } from '#imports';
2
2
  import type { BlockDefinition, FragmentDefinition, ProviderDefinition } from '#blokkli-build/definitions';
3
- import type { ValidFieldListTypes, BlockBundleWithNested } from '#blokkli-build/generated-types';
3
+ import type { ValidFieldListTypes, BlockBundleWithNested, ValidProviderTypes } from '#blokkli-build/generated-types';
4
4
  import type { DeepReadonly } from 'vue';
5
5
  import type { BlockDefinitionOptionsInput } from '../../types/definitions.js';
6
6
  import type { RuntimeBlockOptionArray } from '../../../global/types/blockOptions.js';
@@ -95,4 +95,4 @@ export type DefinitionProvider = {
95
95
  */
96
96
  bundlesWithAutoAdd: ComputedRef<string[]>;
97
97
  };
98
- export default function (): DefinitionProvider;
98
+ export default function (providerType: ValidProviderTypes): DefinitionProvider;
@@ -1,7 +1,7 @@
1
1
  import { computed, ref, readonly } from "#imports";
2
2
  import definitions from "#blokkli-build/definitions";
3
3
  import { OPTIONS } from "#blokkli-build/runtime-options";
4
- export default function() {
4
+ export default function(providerType) {
5
5
  const blocks = ref(definitions.blocks);
6
6
  const fragments = ref(definitions.fragments);
7
7
  const providers = ref(definitions.providers);
@@ -42,6 +42,8 @@ export default function() {
42
42
  acc[bundle + "__field:" + renderFor.fieldList] = definition;
43
43
  } else if ("fieldListType" in renderFor) {
44
44
  acc[bundle + "__field:" + renderFor.fieldListType] = definition;
45
+ } else if (renderFor.providerType) {
46
+ acc[bundle + "__provider:" + renderFor.providerType] = definition;
45
47
  }
46
48
  });
47
49
  } else {
@@ -80,6 +82,10 @@ export default function() {
80
82
  return blocksByKey.value[forParentBundle];
81
83
  }
82
84
  }
85
+ const forProviderType = bundle + "__provider:" + providerType;
86
+ if (blocksByKey.value[forProviderType]) {
87
+ return blocksByKey.value[forProviderType];
88
+ }
83
89
  return blocksByKey.value[bundle];
84
90
  }
85
91
  function getFragmentDefinition(name) {
@@ -7,6 +7,7 @@ import type { ElementProvider } from './element.js';
7
7
  import type { Rectangle } from '../types/geometry.js';
8
8
  import type { DraggableExistingBlock, DraggableItem } from '../types/draggable.js';
9
9
  import type { RegisteredField, RegisterFieldData, RenderedFieldListItem } from '../types/field.js';
10
+ import type { BlokkliFragmentName } from '#blokkli-build/definitions';
10
11
  type RegisteredFieldType = {
11
12
  entityType: string;
12
13
  entityBundle: string;
@@ -186,6 +187,10 @@ export type DomProvider = {
186
187
  * Get the drag element for a block.
187
188
  */
188
189
  getDragElement: (block: DraggableExistingBlock | RenderedFieldListItem) => HTMLElement | undefined;
190
+ /**
191
+ * The fragments that are generally available to be added anywhere on the page.
192
+ */
193
+ generallyAvailableFragments: ComputedRef<BlokkliFragmentName[]>;
189
194
  /**
190
195
  * Get debug data for troubleshooting.
191
196
  */
@@ -1,5 +1,5 @@
1
1
  import { reactive, ref, computed, onMounted } from "#imports";
2
- import { falsy } from "#blokkli/helpers";
2
+ import { falsy, onlyUnique } from "#blokkli/helpers";
3
3
  import { cloneElementWithStyles } from "../helpers/dom/index.js";
4
4
  import {
5
5
  onBlokkliEvent,
@@ -28,6 +28,14 @@ export default function(ui, debug, state, element) {
28
28
  const isInitalizing = ref(true);
29
29
  let settleTimeout = null;
30
30
  const settleKey = ref(0);
31
+ const generallyAvailableFragments = computed(() => {
32
+ return Object.values(registeredFields).flatMap((field) => {
33
+ if (field && field.allowedFragments.length) {
34
+ return field.allowedFragments;
35
+ }
36
+ return null;
37
+ }).filter(falsy).filter(onlyUnique);
38
+ });
31
39
  const observedElements = {};
32
40
  function getBoundingClientRect(element2) {
33
41
  logger.log("getBoundingClientRect", element2);
@@ -526,6 +534,7 @@ export default function(ui, debug, state, element) {
526
534
  getRegisteredField,
527
535
  getFieldsAllowingFragment,
528
536
  registeredBlocks: computed(() => registeredBlocks),
529
- getBoundingClientRect
537
+ getBoundingClientRect,
538
+ generallyAvailableFragments
530
539
  };
531
540
  }
@@ -1,6 +1,7 @@
1
1
  import type { BlokkliFieldElement } from '../types/field.js';
2
2
  import type { DomProvider } from './dom.js';
3
3
  import type { BlockDefinitionProvider } from './types.js';
4
+ import type { StateProvider } from './state.js';
4
5
  export type FieldsProvider = {
5
6
  /**
6
7
  * Find a field element by host entity UUID and field name.
@@ -19,5 +20,22 @@ export type FieldsProvider = {
19
20
  * @returns The field element with metadata, or undefined if not found
20
21
  */
21
22
  find: (uuid: string, fieldName: string) => BlokkliFieldElement | undefined;
23
+ /**
24
+ * Get the z-index of the field containing the given block UUID.
25
+ *
26
+ * @param uuid - The block UUID
27
+ * @returns The z-index of the field, or 0 if not found
28
+ */
29
+ getFieldZIndex: (uuid: string) => number;
30
+ /**
31
+ * Compare field priority between two blocks.
32
+ * Returns > 0 if uuidA wins, < 0 if uuidB wins, 0 if equal.
33
+ * Uses z-index as primary sort, DOM order as tiebreaker.
34
+ *
35
+ * @param uuidA - First block UUID
36
+ * @param uuidB - Second block UUID
37
+ * @returns Comparison result
38
+ */
39
+ compareFieldPriority: (uuidA: string, uuidB: string) => number;
22
40
  };
23
- export default function (dom: DomProvider, types: BlockDefinitionProvider): FieldsProvider;
41
+ export default function (dom: DomProvider, types: BlockDefinitionProvider, state: StateProvider): FieldsProvider;
@@ -1,6 +1,8 @@
1
1
  import { onBlokkliEvent } from "#blokkli/editor/composables";
2
- export default function(dom, types) {
2
+ export default function(dom, types, state) {
3
3
  const fieldCache = /* @__PURE__ */ new Map();
4
+ const fieldInfoCache = /* @__PURE__ */ new Map();
5
+ const comparisonCache = /* @__PURE__ */ new Map();
4
6
  function find(uuid, fieldName) {
5
7
  const key = uuid + ":" + fieldName;
6
8
  const cached = fieldCache.get(key);
@@ -38,10 +40,60 @@ export default function(dom, types) {
38
40
  fieldCache.set(key, fieldElement);
39
41
  return fieldElement;
40
42
  }
43
+ function getFieldInfo(uuid) {
44
+ const cached = fieldInfoCache.get(uuid);
45
+ if (cached !== void 0) {
46
+ return cached;
47
+ }
48
+ const fieldKey = state.getFieldKeyForUuid(uuid);
49
+ if (!fieldKey) {
50
+ fieldInfoCache.set(uuid, null);
51
+ return null;
52
+ }
53
+ const separatorIndex = fieldKey.indexOf(":");
54
+ const entityUuid = fieldKey.substring(0, separatorIndex);
55
+ const fieldName = fieldKey.substring(separatorIndex + 1);
56
+ const field = dom.getRegisteredField(entityUuid, fieldName);
57
+ const info = field ? { zIndex: field.zIndex, element: field.element } : null;
58
+ fieldInfoCache.set(uuid, info);
59
+ return info;
60
+ }
61
+ function getFieldZIndex(uuid) {
62
+ return getFieldInfo(uuid)?.zIndex ?? 0;
63
+ }
64
+ function compareFieldPriority(uuidA, uuidB) {
65
+ const cacheKey = uuidA + "\0" + uuidB;
66
+ const cached = comparisonCache.get(cacheKey);
67
+ if (cached !== void 0) {
68
+ return cached;
69
+ }
70
+ const fieldA = getFieldInfo(uuidA);
71
+ const fieldB = getFieldInfo(uuidB);
72
+ const zIndexA = fieldA?.zIndex ?? 0;
73
+ const zIndexB = fieldB?.zIndex ?? 0;
74
+ let result = 0;
75
+ if (zIndexA !== zIndexB) {
76
+ result = zIndexA - zIndexB;
77
+ } else {
78
+ const elA = fieldA?.element;
79
+ const elB = fieldB?.element;
80
+ if (elA && elB && elA !== elB) {
81
+ const position = elA.compareDocumentPosition(elB);
82
+ if (position & Node.DOCUMENT_POSITION_FOLLOWING) result = -1;
83
+ else if (position & Node.DOCUMENT_POSITION_PRECEDING) result = 1;
84
+ }
85
+ }
86
+ comparisonCache.set(cacheKey, result);
87
+ return result;
88
+ }
41
89
  onBlokkliEvent("state:reloaded", () => {
42
90
  fieldCache.clear();
91
+ fieldInfoCache.clear();
92
+ comparisonCache.clear();
43
93
  });
44
94
  return {
45
- find
95
+ find,
96
+ getFieldZIndex,
97
+ compareFieldPriority
46
98
  };
47
99
  }
@@ -92,7 +92,7 @@
92
92
  "translation": "@bundle mit Inhalts-ID @id hinzugefügt"
93
93
  },
94
94
  "aiAgentAddContentSearchBlockRunning": {
95
- "source": "Adding content block...",
95
+ "source": "Adding content paragraph...",
96
96
  "translation": "Inhalts-Block hinzufügen..."
97
97
  },
98
98
  "aiAgentAddFragmentDone": {
@@ -203,6 +203,14 @@
203
203
  "source": "Connecting...",
204
204
  "translation": "Verbinden..."
205
205
  },
206
+ "aiAgentCreateChartDone": {
207
+ "source": "Added chart",
208
+ "translation": "Diagramm hinzugefügt"
209
+ },
210
+ "aiAgentCreateChartRunning": {
211
+ "source": "Creating chart...",
212
+ "translation": "Diagramm wird erstellt..."
213
+ },
206
214
  "aiAgentCreatePlan": {
207
215
  "source": "Plan: @label",
208
216
  "translation": "Plan: @label"
@@ -347,6 +355,18 @@
347
355
  "source": "Getting bundle info...",
348
356
  "translation": "Bundle-Info abrufen..."
349
357
  },
358
+ "aiAgentGetChartDataDone": {
359
+ "source": "Got chart data",
360
+ "translation": "Diagrammdaten geladen"
361
+ },
362
+ "aiAgentGetChartDataRunning": {
363
+ "source": "Getting chart data...",
364
+ "translation": "Diagrammdaten werden geladen..."
365
+ },
366
+ "aiAgentGetChartTypeOptionsRunning": {
367
+ "source": "Getting chart options...",
368
+ "translation": "Diagrammoptionen werden geladen..."
369
+ },
350
370
  "aiAgentGetChildBlocks": {
351
371
  "source": "Get child blocks",
352
372
  "translation": "Kind-Blöcke abrufen"
@@ -383,6 +403,14 @@
383
403
  "source": "Getting mutation history...",
384
404
  "translation": "Änderungsverlauf abrufen..."
385
405
  },
406
+ "aiAgentGetPageStructureDone": {
407
+ "source": "Got page structure (@count paragraphs)",
408
+ "translation": "Seitenstruktur erhalten (@count Absätze)"
409
+ },
410
+ "aiAgentGetPageStructureRunning": {
411
+ "source": "Getting page structure...",
412
+ "translation": "Seitenstruktur wird geladen..."
413
+ },
386
414
  "aiAgentGetSelectedBlocksDone": {
387
415
  "source": "@count block(s) selected",
388
416
  "translation": "@count Blöcke ausgewählt"
@@ -495,6 +523,10 @@
495
523
  "source": "Replacing media...",
496
524
  "translation": "Medien ersetzen..."
497
525
  },
526
+ "aiAgentRetry": {
527
+ "source": "Retry",
528
+ "translation": "Erneut versuchen"
529
+ },
498
530
  "aiAgentSearchLibraryDone": {
499
531
  "source": "Searched library",
500
532
  "translation": "Bibliothek durchsucht"
@@ -607,6 +639,14 @@
607
639
  "source": "Unknown message type",
608
640
  "translation": "Unbekannter Nachrichtentyp"
609
641
  },
642
+ "aiAgentUpdateChartDone": {
643
+ "source": "Updated chart",
644
+ "translation": "Diagramm aktualisiert"
645
+ },
646
+ "aiAgentUpdateChartRunning": {
647
+ "source": "Updating chart...",
648
+ "translation": "Diagramm wird aktualisiert..."
649
+ },
610
650
  "aiAgentUpdateOptionsOnBlockDone": {
611
651
  "source": "Updated @count option(s) on block",
612
652
  "translation": "@count Option(en) auf Block aktualisiert"
@@ -919,6 +959,226 @@
919
959
  "source": "Cancel selection",
920
960
  "translation": "Auswahl abbrechen"
921
961
  },
962
+ "chartsAddColumn": {
963
+ "source": "Add column",
964
+ "translation": "Spalte hinzufügen"
965
+ },
966
+ "chartsAddFootnote": {
967
+ "source": "Add footnote",
968
+ "translation": "Fussnote hinzufügen"
969
+ },
970
+ "chartsAddRow": {
971
+ "source": "Add row",
972
+ "translation": "Zeile hinzufügen"
973
+ },
974
+ "chartsAreaCurved": {
975
+ "source": "Smooth curves",
976
+ "translation": "Glatte Kurven"
977
+ },
978
+ "chartsAreaMarkers": {
979
+ "source": "Show markers",
980
+ "translation": "Markierungen anzeigen"
981
+ },
982
+ "chartsAutoUpdate": {
983
+ "source": "Auto-update",
984
+ "translation": "Automatisch aktualisieren"
985
+ },
986
+ "chartsBarHorizontal": {
987
+ "source": "Horizontal",
988
+ "translation": "Horizontal"
989
+ },
990
+ "chartsBarStacked": {
991
+ "source": "Stacked",
992
+ "translation": "Gestapelt"
993
+ },
994
+ "chartsBorderRadius": {
995
+ "source": "Corner radius",
996
+ "translation": "Eckenradius"
997
+ },
998
+ "chartsBorderRadiusLarge": {
999
+ "source": "Large",
1000
+ "translation": "Gross"
1001
+ },
1002
+ "chartsBorderRadiusNone": {
1003
+ "source": "None",
1004
+ "translation": "Keine"
1005
+ },
1006
+ "chartsBorderRadiusSmall": {
1007
+ "source": "Small",
1008
+ "translation": "Klein"
1009
+ },
1010
+ "chartsData": {
1011
+ "source": "Data",
1012
+ "translation": "Daten"
1013
+ },
1014
+ "chartsDataLabels": {
1015
+ "source": "Data labels",
1016
+ "translation": "Datenbeschriftungen"
1017
+ },
1018
+ "chartsDonutShowLabels": {
1019
+ "source": "Show labels",
1020
+ "translation": "Beschriftungen anzeigen"
1021
+ },
1022
+ "chartsDonutShowTotal": {
1023
+ "source": "Show total",
1024
+ "translation": "Total anzeigen"
1025
+ },
1026
+ "chartsEditorSaveError": {
1027
+ "source": "The chart could not be saved.",
1028
+ "translation": "Das Diagramm konnte nicht gespeichert werden."
1029
+ },
1030
+ "chartsEditorTitle": {
1031
+ "source": "Edit chart",
1032
+ "translation": "Diagramm bearbeiten"
1033
+ },
1034
+ "chartsFootnotes": {
1035
+ "source": "Footnotes",
1036
+ "translation": "Fussnoten"
1037
+ },
1038
+ "chartsGridLines": {
1039
+ "source": "Grid lines",
1040
+ "translation": "Rasterlinien"
1041
+ },
1042
+ "chartsImportCsv": {
1043
+ "source": "Import CSV",
1044
+ "translation": "CSV importieren"
1045
+ },
1046
+ "chartsLegendPosition": {
1047
+ "source": "Legend position",
1048
+ "translation": "Legendenposition"
1049
+ },
1050
+ "chartsLineCurved": {
1051
+ "source": "Smooth curves",
1052
+ "translation": "Glatte Kurven"
1053
+ },
1054
+ "chartsLineMarkers": {
1055
+ "source": "Show markers",
1056
+ "translation": "Markierungen anzeigen"
1057
+ },
1058
+ "chartsOpacityLight": {
1059
+ "source": "Light",
1060
+ "translation": "Leicht"
1061
+ },
1062
+ "chartsOpacitySolid": {
1063
+ "source": "Solid",
1064
+ "translation": "Deckend"
1065
+ },
1066
+ "chartsOpacityTransparent": {
1067
+ "source": "Transparent",
1068
+ "translation": "Transparent"
1069
+ },
1070
+ "chartsOptionGroupDisplay": {
1071
+ "source": "Display",
1072
+ "translation": "Darstellung"
1073
+ },
1074
+ "chartsOptionGroupLabels": {
1075
+ "source": "Labels",
1076
+ "translation": "Beschriftungen"
1077
+ },
1078
+ "chartsPieShowLabels": {
1079
+ "source": "Show labels",
1080
+ "translation": "Beschriftungen anzeigen"
1081
+ },
1082
+ "chartsPositionBottom": {
1083
+ "source": "Bottom",
1084
+ "translation": "Unten"
1085
+ },
1086
+ "chartsPositionRight": {
1087
+ "source": "Right",
1088
+ "translation": "Rechts"
1089
+ },
1090
+ "chartsPositionTop": {
1091
+ "source": "Top",
1092
+ "translation": "Oben"
1093
+ },
1094
+ "chartsPreview": {
1095
+ "source": "Preview",
1096
+ "translation": "Vorschau"
1097
+ },
1098
+ "chartsPreviewPlaceholder": {
1099
+ "source": "Click \"Refresh Preview\" to see the chart.",
1100
+ "translation": "Klicken Sie auf «Vorschau aktualisieren», um das Diagramm anzuzeigen."
1101
+ },
1102
+ "chartsRadarFillOpacity": {
1103
+ "source": "Fill opacity",
1104
+ "translation": "Fülldeckkraft"
1105
+ },
1106
+ "chartsRadarMarkers": {
1107
+ "source": "Show markers",
1108
+ "translation": "Markierungen anzeigen"
1109
+ },
1110
+ "chartsRadialBarShowLabels": {
1111
+ "source": "Show labels",
1112
+ "translation": "Beschriftungen anzeigen"
1113
+ },
1114
+ "chartsRadialBarShowTotal": {
1115
+ "source": "Show total",
1116
+ "translation": "Total anzeigen"
1117
+ },
1118
+ "chartsRefreshPreview": {
1119
+ "source": "Refresh Preview",
1120
+ "translation": "Vorschau aktualisieren"
1121
+ },
1122
+ "chartsRotationAuto": {
1123
+ "source": "Auto",
1124
+ "translation": "Automatisch"
1125
+ },
1126
+ "chartsStrokeMedium": {
1127
+ "source": "Medium",
1128
+ "translation": "Mittel"
1129
+ },
1130
+ "chartsStrokeThick": {
1131
+ "source": "Thick",
1132
+ "translation": "Dick"
1133
+ },
1134
+ "chartsStrokeThin": {
1135
+ "source": "Thin",
1136
+ "translation": "Dünn"
1137
+ },
1138
+ "chartsStrokeWidth": {
1139
+ "source": "Line thickness",
1140
+ "translation": "Linienstärke"
1141
+ },
1142
+ "chartsTitle": {
1143
+ "source": "Title",
1144
+ "translation": "Titel"
1145
+ },
1146
+ "chartsTypeArea": {
1147
+ "source": "Area",
1148
+ "translation": "Fläche"
1149
+ },
1150
+ "chartsTypeBar": {
1151
+ "source": "Bar",
1152
+ "translation": "Balken"
1153
+ },
1154
+ "chartsTypeDonut": {
1155
+ "source": "Donut",
1156
+ "translation": "Donut"
1157
+ },
1158
+ "chartsTypeHeatmap": {
1159
+ "source": "Heatmap",
1160
+ "translation": "Heatmap"
1161
+ },
1162
+ "chartsTypeLine": {
1163
+ "source": "Line",
1164
+ "translation": "Linie"
1165
+ },
1166
+ "chartsTypePie": {
1167
+ "source": "Pie",
1168
+ "translation": "Kreis"
1169
+ },
1170
+ "chartsTypeRadar": {
1171
+ "source": "Radar",
1172
+ "translation": "Radar"
1173
+ },
1174
+ "chartsTypeRadialBar": {
1175
+ "source": "Radial Bar",
1176
+ "translation": "Radialdiagramm"
1177
+ },
1178
+ "chartsXAxisRotation": {
1179
+ "source": "Label rotation",
1180
+ "translation": "Beschriftungswinkel"
1181
+ },
922
1182
  "clearInput": {
923
1183
  "source": "Clear input",
924
1184
  "translation": "Eingabe löschen"
@@ -1327,6 +1587,14 @@
1327
1587
  "source": "Breadcrumbs",
1328
1588
  "translation": "Breadcrumbs"
1329
1589
  },
1590
+ "feature_charts_description": {
1591
+ "source": "Add and edit interactive charts.",
1592
+ "translation": "Interaktive Diagramme hinzufügen und bearbeiten."
1593
+ },
1594
+ "feature_charts_label": {
1595
+ "source": "Charts",
1596
+ "translation": "Diagramme"
1597
+ },
1330
1598
  "feature_clipboard_description": {
1331
1599
  "source": "Provides clipboard integration to copy/paste existing blocks or paste supported clipboard content like text or images.",
1332
1600
  "translation": "Stellt Zwischenablage-Integration bereit zum Kopieren/Einfügen von bestehenden Blöcken oder zum Einfügen von unterstützten Inhalten wie Text oder Bildern."