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

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 (218) hide show
  1. package/dist/global/types/blockOptions.d.ts +4 -3
  2. package/dist/module.d.mts +2 -2
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +71 -4
  5. package/dist/modules/agent/index.d.mts +1 -1
  6. package/dist/modules/agent/index.mjs +236 -6
  7. package/dist/modules/agent/runtime/app/composables/agentProvider.js +31 -14
  8. package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.d.ts +2 -20
  9. package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.js +0 -3
  10. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue +2 -2
  11. package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue +1 -2
  12. package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +1 -2
  13. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.d.vue.ts +1 -0
  14. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +66 -59
  15. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue.d.ts +1 -0
  16. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +10 -12
  17. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/de.md +2 -2
  18. package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/en.md +2 -2
  19. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +1 -5
  20. package/dist/modules/agent/runtime/app/features/agent/index.vue +89 -37
  21. package/dist/modules/agent/runtime/app/helpers/index.d.ts +16 -19
  22. package/dist/modules/agent/runtime/app/helpers/index.js +22 -46
  23. package/dist/modules/agent/runtime/app/helpers/pageStructure.js +1 -1
  24. package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.js +5 -9
  25. package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +2 -6
  26. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -6
  27. package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +2 -3
  28. package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +2 -6
  29. package/dist/modules/agent/runtime/app/tools/add_template/index.js +2 -6
  30. package/dist/modules/agent/runtime/app/tools/analyze_content/index.d.ts +2 -0
  31. package/dist/modules/agent/runtime/app/tools/analyze_content/index.js +120 -0
  32. package/dist/modules/agent/runtime/app/tools/check_readability/index.d.ts +2 -0
  33. package/dist/modules/agent/runtime/app/tools/check_readability/index.js +57 -0
  34. package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +2 -6
  35. package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +1 -1
  36. package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +2 -1
  37. package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +1 -1
  38. package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +2 -5
  39. package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +2 -1
  40. package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +2 -3
  41. package/dist/modules/agent/runtime/app/tools/helpers.d.ts +53 -0
  42. package/dist/modules/agent/runtime/app/tools/helpers.js +187 -0
  43. package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +2 -6
  44. package/dist/modules/agent/runtime/app/tools/schemas.d.ts +0 -52
  45. package/dist/modules/agent/runtime/app/tools/schemas.js +0 -187
  46. package/dist/modules/agent/runtime/app/tools/search_content/index.js +40 -47
  47. package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +2 -5
  48. package/dist/modules/agent/runtime/app/types/index.d.ts +0 -61
  49. package/dist/modules/agent/runtime/server/Session.d.ts +25 -6
  50. package/dist/modules/agent/runtime/server/Session.js +109 -30
  51. package/dist/modules/agent/runtime/server/SessionManager.d.ts +3 -0
  52. package/dist/modules/agent/runtime/server/SessionManager.js +4 -1
  53. package/dist/modules/agent/runtime/server/agent.js +3 -2
  54. package/dist/modules/agent/runtime/server/default-skills/fixReadability.d.ts +2 -0
  55. package/dist/modules/agent/runtime/server/default-skills/fixReadability.js +69 -0
  56. package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +28 -0
  57. package/dist/modules/agent/runtime/server/server-tools/index.d.ts +10 -2
  58. package/dist/modules/agent/runtime/server/server-tools/index.js +1 -1
  59. package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +1 -1
  60. package/dist/modules/agent/runtime/shared/types.d.ts +46 -11
  61. package/dist/modules/agent/runtime/shared/types.js +22 -10
  62. package/dist/modules/charts/index.d.mts +1 -1
  63. package/dist/modules/charts/index.mjs +21 -7
  64. package/dist/modules/charts/runtime/blokkli/skills/charts.js +6 -6
  65. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +25 -2
  66. package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +39 -1
  67. package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.js +24 -17
  68. package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.js +11 -19
  69. package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.js +2 -4
  70. package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.js +8 -20
  71. package/dist/modules/charts/runtime/chartTypes/area.d.ts +6 -1
  72. package/dist/modules/charts/runtime/chartTypes/bar.d.ts +7 -1
  73. package/dist/modules/charts/runtime/chartTypes/define.d.ts +1 -1
  74. package/dist/modules/charts/runtime/chartTypes/donut.d.ts +5 -1
  75. package/dist/modules/charts/runtime/chartTypes/heatmap.d.ts +3 -1
  76. package/dist/modules/charts/runtime/chartTypes/index.d.ts +18 -0
  77. package/dist/modules/charts/runtime/chartTypes/line.d.ts +6 -1
  78. package/dist/modules/charts/runtime/chartTypes/pie.d.ts +4 -1
  79. package/dist/modules/charts/runtime/chartTypes/radar.d.ts +6 -1
  80. package/dist/modules/charts/runtime/chartTypes/radialBar.d.ts +5 -1
  81. package/dist/modules/charts/runtime/chartTypes/shared.d.ts +20 -5
  82. package/dist/modules/charts/runtime/chartTypes/types.d.ts +6 -6
  83. package/dist/modules/charts/runtime/components/ChartRenderer/index.d.vue.ts +145 -2
  84. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +2 -2
  85. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue.d.ts +145 -2
  86. package/dist/modules/charts/runtime/components/index.d.ts +1 -0
  87. package/dist/modules/charts/runtime/components/index.js +1 -0
  88. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.d.vue.ts +3 -2
  89. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue.d.ts +3 -2
  90. package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue +1 -2
  91. package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue +1 -1
  92. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.d.vue.ts +2 -0
  93. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue +35 -13
  94. package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue.d.ts +2 -0
  95. package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +1 -0
  96. package/dist/modules/charts/runtime/features/charts/Editor/index.vue +9 -3
  97. package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +1 -0
  98. package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.js +1 -1
  99. package/dist/modules/charts/runtime/features/charts/index.vue +6 -6
  100. package/dist/modules/charts/runtime/helpers/index.d.ts +25 -0
  101. package/dist/modules/charts/runtime/helpers/index.js +63 -0
  102. package/dist/modules/charts/runtime/types.d.ts +10 -28
  103. package/dist/modules/charts/runtime/types.js +0 -64
  104. package/dist/modules/drupal/index.d.mts +1 -1
  105. package/dist/modules/drupal/runtime/adapter/index.d.ts +3 -1
  106. package/dist/modules/drupal/runtime/adapter/index.js +4 -4
  107. package/dist/modules/table-of-contents/index.d.mts +1 -1
  108. package/dist/runtime/components/BlokkliItem.vue +1 -1
  109. package/dist/runtime/composables/defineBlokkli.js +1 -1
  110. package/dist/runtime/editor/components/AnimationCanvas/index.vue +13 -7
  111. package/dist/runtime/editor/components/Banner/index.d.vue.ts +1 -0
  112. package/dist/runtime/editor/components/Banner/index.vue +1 -1
  113. package/dist/runtime/editor/components/Banner/index.vue.d.ts +1 -0
  114. package/dist/runtime/editor/components/DropdownItem/index.d.vue.ts +1 -0
  115. package/dist/runtime/editor/components/DropdownItem/index.vue +3 -2
  116. package/dist/runtime/editor/components/DropdownItem/index.vue.d.ts +1 -0
  117. package/dist/runtime/editor/components/EditProvider.vue +7 -4
  118. package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +5 -1
  119. package/dist/runtime/editor/components/FlexTextarea/index.vue +24 -101
  120. package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +5 -1
  121. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +28 -9
  122. package/dist/runtime/editor/components/Popup/index.d.vue.ts +30 -0
  123. package/dist/runtime/editor/components/Popup/index.vue +82 -0
  124. package/dist/runtime/editor/components/Popup/index.vue.d.ts +30 -0
  125. package/dist/runtime/editor/components/Resizable/index.vue +4 -1
  126. package/dist/runtime/editor/components/Toolbar/index.vue +107 -6
  127. package/dist/runtime/editor/components/index.d.ts +4 -3
  128. package/dist/runtime/editor/components/index.js +6 -4
  129. package/dist/runtime/editor/composables/defineDropAreas.js +3 -3
  130. package/dist/runtime/editor/composables/defineDropHandler.d.ts +3 -0
  131. package/dist/runtime/editor/composables/defineDropHandler.js +10 -0
  132. package/dist/runtime/editor/composables/index.d.ts +1 -0
  133. package/dist/runtime/editor/composables/index.js +1 -0
  134. package/dist/runtime/editor/css/output.css +1 -1
  135. package/dist/runtime/editor/events/index.d.ts +9 -0
  136. package/dist/runtime/editor/features/add-list/index.vue +58 -1
  137. package/dist/runtime/editor/features/analyze/Main.d.vue.ts +3 -2
  138. package/dist/runtime/editor/features/analyze/Main.vue +28 -44
  139. package/dist/runtime/editor/features/analyze/Main.vue.d.ts +3 -2
  140. package/dist/runtime/editor/features/analyze/analyzers/readability.js +65 -0
  141. package/dist/runtime/editor/features/analyze/analyzers/types.d.ts +19 -0
  142. package/dist/runtime/editor/features/analyze/index.vue +18 -15
  143. package/dist/runtime/editor/features/clipboard/DropElement/Video.d.vue.ts +8 -0
  144. package/dist/runtime/editor/features/clipboard/{List/Item → DropElement}/Video.vue +1 -5
  145. package/dist/runtime/editor/features/clipboard/DropElement/Video.vue.d.ts +8 -0
  146. package/dist/runtime/editor/features/clipboard/DropElement/helpers.d.ts +1 -0
  147. package/dist/runtime/editor/features/clipboard/DropElement/helpers.js +14 -0
  148. package/dist/runtime/editor/features/clipboard/DropElement/index.d.vue.ts +16 -0
  149. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +97 -0
  150. package/dist/runtime/editor/features/clipboard/DropElement/index.vue.d.ts +16 -0
  151. package/dist/runtime/editor/features/clipboard/helpers.d.ts +15 -0
  152. package/dist/runtime/editor/features/clipboard/helpers.js +62 -0
  153. package/dist/runtime/editor/features/clipboard/index.vue +585 -337
  154. package/dist/runtime/editor/features/clipboard/types.d.ts +14 -2
  155. package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +17 -5
  156. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +2 -2
  157. package/dist/runtime/editor/features/dragging-overlay/index.vue +125 -219
  158. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +4 -4
  159. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +6 -0
  160. package/dist/runtime/editor/features/library/index.vue +14 -0
  161. package/dist/runtime/editor/features/media-library/index.vue +32 -1
  162. package/dist/runtime/editor/features/options/Form/ComplexType/index.d.vue.ts +11 -0
  163. package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +36 -0
  164. package/dist/runtime/editor/features/options/Form/ComplexType/index.vue.d.ts +11 -0
  165. package/dist/runtime/editor/features/options/Form/Item.d.vue.ts +3 -2
  166. package/dist/runtime/editor/features/options/Form/Item.vue +10 -2
  167. package/dist/runtime/editor/features/options/Form/Item.vue.d.ts +3 -2
  168. package/dist/runtime/editor/features/options/Form/index.vue +5 -0
  169. package/dist/runtime/editor/features/search/index.vue +25 -1
  170. package/dist/runtime/editor/features/structure/index.vue +25 -1
  171. package/dist/runtime/editor/features/tour/index.vue +22 -12
  172. package/dist/runtime/editor/helpers/clipboardData/index.d.ts +11 -0
  173. package/dist/runtime/editor/helpers/clipboardData/index.js +157 -0
  174. package/dist/runtime/editor/helpers/options/index.js +5 -0
  175. package/dist/runtime/editor/icons/svg/stars.svg +5 -1
  176. package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
  177. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
  178. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +14 -3
  179. package/dist/runtime/editor/plugins/Sidebar/index.vue +4 -2
  180. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +14 -3
  181. package/dist/runtime/editor/providers/analyze.d.ts +43 -0
  182. package/dist/runtime/editor/providers/analyze.js +78 -0
  183. package/dist/runtime/editor/providers/animation.d.ts +4 -0
  184. package/dist/runtime/editor/providers/animation.js +6 -0
  185. package/dist/runtime/editor/providers/dragdrop.d.ts +55 -0
  186. package/dist/runtime/editor/providers/dragdrop.js +37 -0
  187. package/dist/runtime/editor/providers/storage.js +15 -0
  188. package/dist/runtime/editor/providers/ui.d.ts +6 -0
  189. package/dist/runtime/editor/providers/ui.js +19 -0
  190. package/dist/runtime/editor/translations/de.json +73 -61
  191. package/dist/runtime/editor/translations/fr.json +67 -55
  192. package/dist/runtime/editor/translations/gsw_CH.json +71 -59
  193. package/dist/runtime/editor/translations/it.json +67 -55
  194. package/dist/runtime/editor/types/app.d.ts +4 -2
  195. package/dist/runtime/editor/types/draggable.d.ts +1 -0
  196. package/dist/runtime/editor/types/ui.d.ts +1 -1
  197. package/dist/runtime/helpers/injections.d.ts +1 -1
  198. package/dist/runtime/types/blockOptions.d.ts +2 -1
  199. package/dist/runtime/types/definitions.d.ts +4 -0
  200. package/dist/shared/{editor.CWQIFIEQ.d.mts → editor.BdBm1Z7C.d.mts} +12 -0
  201. package/dist/types.d.mts +1 -1
  202. package/package.json +5 -3
  203. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.d.vue.ts +0 -3
  204. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.vue +0 -29
  205. package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.vue.d.ts +0 -3
  206. package/dist/runtime/editor/features/clipboard/List/Item/File.d.vue.ts +0 -4
  207. package/dist/runtime/editor/features/clipboard/List/Item/File.vue +0 -60
  208. package/dist/runtime/editor/features/clipboard/List/Item/File.vue.d.ts +0 -4
  209. package/dist/runtime/editor/features/clipboard/List/Item/Video.d.vue.ts +0 -4
  210. package/dist/runtime/editor/features/clipboard/List/Item/Video.vue.d.ts +0 -4
  211. package/dist/runtime/editor/features/clipboard/List/index.d.vue.ts +0 -11
  212. package/dist/runtime/editor/features/clipboard/List/index.vue +0 -72
  213. package/dist/runtime/editor/features/clipboard/List/index.vue.d.ts +0 -11
  214. package/dist/runtime/editor/features/tour/Popup/index.d.vue.ts +0 -9
  215. package/dist/runtime/editor/features/tour/Popup/index.vue +0 -34
  216. package/dist/runtime/editor/features/tour/Popup/index.vue.d.ts +0 -9
  217. package/dist/runtime/editor/providers/dropArea.d.ts +0 -48
  218. package/dist/runtime/editor/providers/dropArea.js +0 -22
@@ -1,23 +1,45 @@
1
1
  <template>
2
2
  <div :class="{ 'bk-is-stale': stale }">
3
- <ChartRenderer v-if="data" v-bind="data" />
4
- <div v-else class="bk-chart-preview-placeholder">
5
- {{
6
- $t(
7
- "chartsPreviewPlaceholder",
8
- 'Click "Refresh Preview" to see the chart.'
9
- )
10
- }}
11
- </div>
3
+ <BlokkliItem
4
+ v-if="item"
5
+ v-bind="item"
6
+ :options="mergedOptions"
7
+ :is-editing="false"
8
+ />
12
9
  </div>
13
10
  </template>
14
11
 
15
12
  <script setup>
16
- import { useBlokkli } from "#imports";
17
- import ChartRenderer from "../../../../components/ChartRenderer/index.vue";
18
- const { $t } = useBlokkli();
19
- defineProps({
13
+ import { computed, provide, useBlokkli } from "#imports";
14
+ import {
15
+ INJECT_EDIT_CONTEXT,
16
+ INJECT_FIELD_LIST_BLOCKS,
17
+ INJECT_FIELD_LIST_TYPE,
18
+ INJECT_IS_EDITING,
19
+ INJECT_IS_IN_REUSABLE,
20
+ INJECT_PROVIDER_BLOCKS
21
+ } from "#blokkli/helpers/injections";
22
+ const { state } = useBlokkli();
23
+ const props = defineProps({
24
+ uuid: { type: String, required: true },
25
+ optionKey: { type: String, required: true },
20
26
  data: { type: [Object, null], required: true },
21
27
  stale: { type: Boolean, required: true }
22
28
  });
29
+ const item = computed(() => state.getFieldListItem(props.uuid));
30
+ const mergedOptions = computed(() => {
31
+ const base = item.value?.options || {};
32
+ return {
33
+ ...base,
34
+ [props.optionKey]: JSON.stringify(props.data)
35
+ };
36
+ });
37
+ const blocks = computed(() => []);
38
+ const fieldListType = computed(() => "default");
39
+ provide(INJECT_IS_IN_REUSABLE, true);
40
+ provide(INJECT_IS_EDITING, false);
41
+ provide(INJECT_FIELD_LIST_BLOCKS, blocks);
42
+ provide(INJECT_PROVIDER_BLOCKS, blocks);
43
+ provide(INJECT_FIELD_LIST_TYPE, fieldListType);
44
+ provide(INJECT_EDIT_CONTEXT, null);
23
45
  </script>
@@ -1,5 +1,7 @@
1
1
  import type { BlokkliChartData } from '../../../../types.js';
2
2
  type __VLS_Props = {
3
+ uuid: string;
4
+ optionKey: string;
3
5
  data: BlokkliChartData | null;
4
6
  stale: boolean;
5
7
  };
@@ -1,6 +1,7 @@
1
1
  import type { BlokkliChartData } from '../../../types.js';
2
2
  type __VLS_Props = {
3
3
  uuid: string;
4
+ optionKey: string;
4
5
  };
5
6
  declare function getData(): BlokkliChartData;
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
@@ -44,7 +44,12 @@
44
44
  />
45
45
  </div>
46
46
  </div>
47
- <Preview :data="previewData" :stale="isStale" />
47
+ <Preview
48
+ :uuid
49
+ :option-key="optionKey"
50
+ :data="previewData"
51
+ :stale="isStale"
52
+ />
48
53
  </div>
49
54
 
50
55
  <div class="bk-chart-editor-section">
@@ -93,7 +98,7 @@
93
98
 
94
99
  <script setup>
95
100
  import { ref, computed, watch, useBlokkli, onBeforeUnmount } from "#imports";
96
- import { getDefaultChartData, getFirstColorId } from "../../../types";
101
+ import { getDefaultChartData, getFirstColorId } from "../../../helpers";
97
102
  import { getChartType, getDefaultTypeOptions } from "../../../chartTypes";
98
103
  import { COLORS } from "#blokkli-build/charts-config";
99
104
  import { useChartEditorState } from "./useChartEditorState";
@@ -106,7 +111,8 @@ import Preview from "./Preview/index.vue";
106
111
  import ChartTypeOptions from "./ChartTypeOptions/index.vue";
107
112
  import { onBlokkliEvent } from "#blokkli/editor/composables";
108
113
  const props = defineProps({
109
- uuid: { type: String, required: true }
114
+ uuid: { type: String, required: true },
115
+ optionKey: { type: String, required: true }
110
116
  });
111
117
  const { $t, state } = useBlokkli();
112
118
  function getCurrentData() {
@@ -1,6 +1,7 @@
1
1
  import type { BlokkliChartData } from '../../../types.js';
2
2
  type __VLS_Props = {
3
3
  uuid: string;
4
+ optionKey: string;
4
5
  };
5
6
  declare function getData(): BlokkliChartData;
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
@@ -1,5 +1,5 @@
1
1
  import { ref, watch, nextTick, computed } from "#imports";
2
- import { getColorIdAtIndex } from "../../../types.js";
2
+ import { getColorIdAtIndex } from "../../../helpers/index.js";
3
3
  const MAX_HISTORY = 50;
4
4
  function clone(v) {
5
5
  return JSON.parse(JSON.stringify(v));
@@ -9,7 +9,7 @@
9
9
  @submit="onSubmit"
10
10
  @close="onSubmit"
11
11
  >
12
- <ChartsEditor ref="editorRef" :uuid />
12
+ <ChartsEditor ref="editorRef" :uuid :option-key="optionKey" />
13
13
  </NestedEditorOverlay>
14
14
  </template>
15
15
 
@@ -33,6 +33,7 @@ defineBlokkliFeature({
33
33
  });
34
34
  const { $t, state, adapter, dom, blocks } = useBlokkli();
35
35
  const uuid = ref(null);
36
+ const optionKey = ref("data");
36
37
  const element = computed(() => {
37
38
  if (!uuid.value) {
38
39
  return null;
@@ -53,7 +54,7 @@ async function onSubmit() {
53
54
  () => adapter.updateOptions([
54
55
  {
55
56
  uuid: uuid.value,
56
- key: "data",
57
+ key: optionKey.value,
57
58
  value: JSON.stringify(chartData)
58
59
  }
59
60
  ]),
@@ -62,11 +63,10 @@ async function onSubmit() {
62
63
  isLoading.value = false;
63
64
  uuid.value = null;
64
65
  }
65
- onBlokkliEvent("fragment:edit", (data) => {
66
- if (data.name === "blokkli_chart") {
66
+ onBlokkliEvent("option:edit-complex", (data) => {
67
+ if (data.dataType === "chart") {
67
68
  uuid.value = data.uuid;
68
- } else {
69
- uuid.value = null;
69
+ optionKey.value = data.key;
70
70
  }
71
71
  });
72
72
  </script>
@@ -1 +1,26 @@
1
+ import type { BlokkliChartData, ChartColor } from '../types.js';
2
+ export declare const SUPERSCRIPTS: Record<string, string>;
3
+ /**
4
+ * Replace `{1}`, `{2}`, etc. with Unicode superscript characters.
5
+ */
6
+ export declare function applyFootnotes(text: string): string;
7
+ /**
8
+ * Resolve a color ID to a concrete CSS color value that ApexCharts can use.
9
+ *
10
+ * Plain values like '#ff0000' or 'rgb(255, 0, 0)' are returned as-is.
11
+ * Values containing 'var(' (e.g. 'rgb(var(--theme-primary))') are resolved
12
+ * by setting the value on a DOM element and reading the computed color.
13
+ *
14
+ * Falls back to the first defined color if the ID is not found.
15
+ */
16
+ export declare function resolveChartColor(colorId: string, colors: Record<string, ChartColor>, el?: HTMLElement | null): string;
17
+ /**
18
+ * Get the fallback color ID (first defined color).
19
+ */
20
+ export declare function getFirstColorId(colors: Record<string, ChartColor>): string;
21
+ /**
22
+ * Get a color ID for the given index, cycling through available colors.
23
+ */
24
+ export declare function getColorIdAtIndex(index: number, colors: Record<string, ChartColor>): string;
25
+ export declare function getDefaultChartData(colors: Record<string, ChartColor>): BlokkliChartData;
1
26
  export declare function parseNumericInput(raw: string): number;
@@ -1,3 +1,66 @@
1
+ export const SUPERSCRIPTS = {
2
+ "1": "\xB9",
3
+ "2": "\xB2",
4
+ "3": "\xB3",
5
+ "4": "\u2074",
6
+ "5": "\u2075",
7
+ "6": "\u2076",
8
+ "7": "\u2077",
9
+ "8": "\u2078",
10
+ "9": "\u2079",
11
+ "0": "\u2070"
12
+ };
13
+ export function applyFootnotes(text) {
14
+ return text.replace(
15
+ /\{(\d)\}/g,
16
+ (_, d) => SUPERSCRIPTS[d] || `{${d}}`
17
+ );
18
+ }
19
+ export function resolveChartColor(colorId, colors, el) {
20
+ const ids = Object.keys(colors);
21
+ const entry = colors[colorId] || colors[ids[0] || ""];
22
+ if (!entry) {
23
+ return "#888888";
24
+ }
25
+ const value = entry.color;
26
+ if (!value.includes("var(")) {
27
+ return value;
28
+ }
29
+ const target = el || document.documentElement;
30
+ const prev = target.style.color;
31
+ target.style.color = value;
32
+ const resolved = getComputedStyle(target).color;
33
+ target.style.color = prev;
34
+ return resolved || value;
35
+ }
36
+ export function getFirstColorId(colors) {
37
+ return Object.keys(colors)[0] || "";
38
+ }
39
+ export function getColorIdAtIndex(index, colors) {
40
+ const ids = Object.keys(colors);
41
+ return ids[index % ids.length] || ids[0] || "";
42
+ }
43
+ export function getDefaultChartData(colors) {
44
+ return {
45
+ title: "",
46
+ type: "bar",
47
+ categories: ["Category 1", "Category 2", "Category 3"],
48
+ series: [
49
+ {
50
+ name: "Series 1",
51
+ color: getColorIdAtIndex(0, colors),
52
+ data: [30, 40, 35]
53
+ }
54
+ ],
55
+ categoryColors: [
56
+ getColorIdAtIndex(0, colors),
57
+ getColorIdAtIndex(1, colors),
58
+ getColorIdAtIndex(2, colors)
59
+ ],
60
+ footnotes: [],
61
+ typeOptions: {}
62
+ };
63
+ }
1
64
  export function parseNumericInput(raw) {
2
65
  let str = raw.trim();
3
66
  if (!str) return 0;
@@ -1,4 +1,6 @@
1
+ import type { ChartTypeOptionsMap } from './chartTypes/index.js';
1
2
  export type ChartType = 'bar' | 'line' | 'pie' | 'area' | 'donut' | 'heatmap' | 'radialBar' | 'radar';
3
+ export type ChartTypeOptions = ChartTypeOptionsMap[ChartType];
2
4
  export type ChartSeries = {
3
5
  name: string;
4
6
  /**
@@ -7,9 +9,8 @@ export type ChartSeries = {
7
9
  color: string;
8
10
  data: number[];
9
11
  };
10
- export type BlokkliChartData = {
12
+ type ChartDataBase = {
11
13
  title: string;
12
- type: ChartType;
13
14
  categories: string[];
14
15
  series: ChartSeries[];
15
16
  /**
@@ -18,34 +19,15 @@ export type BlokkliChartData = {
18
19
  */
19
20
  categoryColors: string[];
20
21
  footnotes: string[];
21
- typeOptions?: Record<string, unknown>;
22
22
  };
23
- declare const SUPERSCRIPTS: Record<string, string>;
24
- export { SUPERSCRIPTS };
25
- /**
26
- * Replace `{1}`, `{2}`, etc. with Unicode superscript characters.
27
- */
28
- export declare function applyFootnotes(text: string): string;
23
+ export type BlokkliChartData = {
24
+ [K in ChartType]: ChartDataBase & {
25
+ type: K;
26
+ typeOptions?: Partial<ChartTypeOptionsMap[K]>;
27
+ };
28
+ }[ChartType];
29
29
  export type ChartColor = {
30
30
  color: string;
31
31
  label: string;
32
32
  };
33
- /**
34
- * Resolve a color ID to a concrete CSS color value that ApexCharts can use.
35
- *
36
- * Plain values like '#ff0000' or 'rgb(255, 0, 0)' are returned as-is.
37
- * Values containing 'var(' (e.g. 'rgb(var(--theme-primary))') are resolved
38
- * by setting the value on a DOM element and reading the computed color.
39
- *
40
- * Falls back to the first defined color if the ID is not found.
41
- */
42
- export declare function resolveChartColor(colorId: string, colors: Record<string, ChartColor>, el?: HTMLElement | null): string;
43
- /**
44
- * Get the fallback color ID (first defined color).
45
- */
46
- export declare function getFirstColorId(colors: Record<string, ChartColor>): string;
47
- /**
48
- * Get a color ID for the given index, cycling through available colors.
49
- */
50
- export declare function getColorIdAtIndex(index: number, colors: Record<string, ChartColor>): string;
51
- export declare function getDefaultChartData(colors: Record<string, ChartColor>): BlokkliChartData;
33
+ export {};
@@ -1,64 +0,0 @@
1
- const SUPERSCRIPTS = {
2
- "1": "\xB9",
3
- "2": "\xB2",
4
- "3": "\xB3",
5
- "4": "\u2074",
6
- "5": "\u2075",
7
- "6": "\u2076",
8
- "7": "\u2077",
9
- "8": "\u2078",
10
- "9": "\u2079",
11
- "0": "\u2070"
12
- };
13
- export { SUPERSCRIPTS };
14
- export function applyFootnotes(text) {
15
- return text.replace(
16
- /\{(\d)\}/g,
17
- (_, d) => SUPERSCRIPTS[d] || `{${d}}`
18
- );
19
- }
20
- export function resolveChartColor(colorId, colors, el) {
21
- const ids = Object.keys(colors);
22
- const entry = colors[colorId] || colors[ids[0] || ""];
23
- if (!entry) {
24
- return "#888888";
25
- }
26
- const value = entry.color;
27
- if (!value.includes("var(")) {
28
- return value;
29
- }
30
- const target = el || document.documentElement;
31
- const prev = target.style.color;
32
- target.style.color = value;
33
- const resolved = getComputedStyle(target).color;
34
- target.style.color = prev;
35
- return resolved || value;
36
- }
37
- export function getFirstColorId(colors) {
38
- return Object.keys(colors)[0] || "";
39
- }
40
- export function getColorIdAtIndex(index, colors) {
41
- const ids = Object.keys(colors);
42
- return ids[index % ids.length] || ids[0] || "";
43
- }
44
- export function getDefaultChartData(colors) {
45
- return {
46
- title: "",
47
- type: "bar",
48
- categories: ["Category 1", "Category 2", "Category 3"],
49
- series: [
50
- {
51
- name: "Series 1",
52
- color: getColorIdAtIndex(0, colors),
53
- data: [30, 40, 35]
54
- }
55
- ],
56
- categoryColors: [
57
- getColorIdAtIndex(0, colors),
58
- getColorIdAtIndex(1, colors),
59
- getColorIdAtIndex(2, colors)
60
- ],
61
- footnotes: [],
62
- typeOptions: {}
63
- };
64
- }
@@ -1,4 +1,4 @@
1
- import { B as BlokkliModule } from '../../shared/editor.CWQIFIEQ.mjs';
1
+ import { B as BlokkliModule } from '../../shared/editor.BdBm1Z7C.mjs';
2
2
  import 'nuxt/schema';
3
3
  import 'consola';
4
4
  import '../../../dist/global/types/definitions.js';
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import { type BlokkliAdapterFactory } from '#blokkli/editor/adapter';
2
+ import type { ParagraphsBlokkliEditStateFragment } from '#graphql-operations';
3
+ declare const _default: BlokkliAdapterFactory<ParagraphsBlokkliEditStateFragment>;
2
4
  export default _default;
@@ -852,19 +852,19 @@ export default defineBlokkliEditAdapter(
852
852
  }
853
853
  }
854
854
  return false;
855
- })?.possibleParagraphBundles?.[0];
855
+ })?.possibleParagraphBundles;
856
856
  } else if (e.type === "plaintext") {
857
857
  return config.clipboard.find((v) => {
858
858
  return v?.__typename === "ParagraphsBlokkliSupportedClipboardRichText";
859
- })?.possibleParagraphBundles?.[0];
859
+ })?.possibleParagraphBundles;
860
860
  } else if (e.type === "image") {
861
861
  return config.clipboard.find((v) => {
862
862
  return v?.__typename === "ParagraphsBlokkliSupportedClipboardImage";
863
- })?.possibleParagraphBundles?.[0];
863
+ })?.possibleParagraphBundles;
864
864
  } else if (e.type === "file") {
865
865
  return config.clipboard.find((v) => {
866
866
  return v?.__typename === "ParagraphsBlokkliSupportedClipboardFile";
867
- })?.possibleParagraphBundles?.[0];
867
+ })?.possibleParagraphBundles;
868
868
  }
869
869
  };
870
870
  }
@@ -1,4 +1,4 @@
1
- import { B as BlokkliModule } from '../../shared/editor.CWQIFIEQ.mjs';
1
+ import { B as BlokkliModule } from '../../shared/editor.BdBm1Z7C.mjs';
2
2
  import 'nuxt/schema';
3
3
  import 'consola';
4
4
  import '../../../dist/global/types/definitions.js';
@@ -56,7 +56,7 @@ const isGlobalProxyMode = inject(INJECT_GLOBAL_PROXY_MODE, null);
56
56
  const fieldListType = inject(INJECT_FIELD_LIST_TYPE, void 0);
57
57
  const providerType = inject(INJECT_PROVIDER_TYPE, void 0);
58
58
  const itemProps = computed(() => {
59
- if (mutatedItemProps) {
59
+ if (mutatedItemProps && componentProps.isEditing) {
60
60
  const mutatedProps = mutatedItemProps[componentProps.uuid];
61
61
  if (mutatedProps) {
62
62
  return {
@@ -92,7 +92,7 @@ export function defineBlokkli(arg) {
92
92
  }
93
93
  if (editContext?.useBlockRegistration && editContext.dom && bundle !== fromLibraryBlockBundle && bundle !== fragmentBlockBundle) {
94
94
  const isProxyMode = inject(INJECT_FIELD_USES_PROXY, false);
95
- if (!isProxyMode) {
95
+ if (!isProxyMode && isEditing) {
96
96
  editContext.useBlockRegistration(editContext.dom, reusableUuid ?? uuid);
97
97
  }
98
98
  }
@@ -79,6 +79,7 @@ let pointerDownElement = null;
79
79
  let mouseStartCoordinates = null;
80
80
  let pointerDownTimestamp = 0;
81
81
  let pointerUpTimestamp = 0;
82
+ let pointerDownOnCanvas = false;
82
83
  function getInteractedElement(e) {
83
84
  const { x, y } = getInteractionCoordinates(e);
84
85
  const visibleUuids = dom.getVisibleBlocks();
@@ -144,7 +145,7 @@ function onPointerMove(e) {
144
145
  if (!handlePointerMove) {
145
146
  return;
146
147
  }
147
- if (keyboard.isPressingSpace.value || e.buttons === MOUSE_BUTTONS.AUXILIARY) {
148
+ if (keyboard.isPressingSpace.value || e.buttons & MOUSE_BUTTONS.AUXILIARY) {
148
149
  return;
149
150
  }
150
151
  e.preventDefault();
@@ -201,9 +202,10 @@ function onPointerMove(e) {
201
202
  }
202
203
  }
203
204
  function onPointerDown(e) {
204
- if (e.buttons === MOUSE_BUTTONS.AUXILIARY) {
205
+ if (e.buttons & MOUSE_BUTTONS.AUXILIARY) {
205
206
  return;
206
207
  }
208
+ pointerDownOnCanvas = true;
207
209
  if (canvasEl.value) {
208
210
  canvasEl.value.focus();
209
211
  }
@@ -251,15 +253,15 @@ function isClickInArtboard(coords) {
251
253
  return isInsideRect(coords.x, coords.y, rect);
252
254
  }
253
255
  function onPointerUp(e) {
254
- handlePointerMove = false;
255
256
  if (e.button === MOUSE_BUTTON.AUXILIARY) {
256
257
  e.preventDefault();
257
258
  return;
258
259
  }
260
+ handlePointerMove = false;
259
261
  e.preventDefault();
260
262
  e.stopPropagation();
261
263
  e.stopImmediatePropagation();
262
- if (ui.openTooltip.value) {
264
+ if (ui.openTooltip.value && !selection.activeEditableLabel.value) {
263
265
  ui.openTooltip.value = "";
264
266
  return;
265
267
  }
@@ -289,8 +291,11 @@ function onPointerUp(e) {
289
291
  return;
290
292
  }
291
293
  if (selection.activeEditableLabel.value) {
292
- eventBus.emit("window:clickAway");
293
- lastInteractedElement = null;
294
+ if (pointerDownOnCanvas) {
295
+ eventBus.emit("window:clickAway");
296
+ lastInteractedElement = null;
297
+ }
298
+ pointerDownOnCanvas = false;
294
299
  return;
295
300
  }
296
301
  if (animation.handleClick(e.clientX, e.clientY)) {
@@ -303,6 +308,7 @@ function onPointerUp(e) {
303
308
  const deltaY = Math.abs(lastInteractedElement.y - e.clientY);
304
309
  if (deltaTime < 400 && deltaX < 3 && deltaY < 3) {
305
310
  if (clicked.editableFieldName) {
311
+ pointerDownOnCanvas = false;
306
312
  eventBus.emit("editable:focus", {
307
313
  fieldName: clicked.editableFieldName,
308
314
  uuid: clicked.uuid
@@ -448,7 +454,7 @@ function onClick(e) {
448
454
  e.preventDefault();
449
455
  e.stopImmediatePropagation();
450
456
  e.stopPropagation();
451
- if (canvasEl.value) {
457
+ if (canvasEl.value && !selection.activeEditableLabel.value) {
452
458
  canvasEl.value.focus();
453
459
  }
454
460
  }
@@ -16,6 +16,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
17
  onClick?: (() => any) | undefined;
18
18
  }>, {
19
+ text: string;
19
20
  button: string;
20
21
  scheme: ThemeColorName;
21
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -26,7 +26,7 @@ import {
26
26
  const props = defineProps({
27
27
  id: { type: String, required: true },
28
28
  icon: { type: null, required: true },
29
- text: { type: String, required: false },
29
+ text: { type: String, required: false, default: void 0 },
30
30
  button: { type: String, required: false, default: void 0 },
31
31
  scheme: { type: String, required: false, default: "accent" }
32
32
  });
@@ -16,6 +16,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
16
16
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
17
  onClick?: (() => any) | undefined;
18
18
  }>, {
19
+ text: string;
19
20
  button: string;
20
21
  scheme: ThemeColorName;
21
22
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -2,6 +2,7 @@ import type { BlokkliIcon } from '#blokkli-build/icons';
2
2
  type __VLS_Props = {
3
3
  icon: BlokkliIcon;
4
4
  text: string;
5
+ disabled?: boolean;
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
8
  click: () => any;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <button class="bk-dropdown-menu-item" @click="$emit('click')">
2
+ <button class="bk-dropdown-menu-item" :disabled @click="$emit('click')">
3
3
  <Icon :name="icon" />
4
4
  <span>{{ text }}</span>
5
5
  </button>
@@ -9,7 +9,8 @@
9
9
  import { Icon } from "#blokkli/editor/components";
10
10
  defineProps({
11
11
  icon: { type: null, required: true },
12
- text: { type: String, required: true }
12
+ text: { type: String, required: true },
13
+ disabled: { type: Boolean, required: false }
13
14
  });
14
15
  defineEmits(["click"]);
15
16
  </script>
@@ -2,6 +2,7 @@ import type { BlokkliIcon } from '#blokkli-build/icons';
2
2
  type __VLS_Props = {
3
3
  icon: BlokkliIcon;
4
4
  text: string;
5
+ disabled?: boolean;
5
6
  };
6
7
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
8
  click: () => any;
@@ -100,7 +100,6 @@ import commandsProvider from "#blokkli/editor/providers/commands";
100
100
  import tourProvider from "#blokkli/editor/providers/tour";
101
101
  import debugProvider from "#blokkli/editor/providers/debug";
102
102
  import definitionProvider from "#blokkli/editor/providers/definition";
103
- import dropAreasProvider from "#blokkli/editor/providers/dropArea";
104
103
  import blocksProvider from "#blokkli/editor/providers/blocks";
105
104
  import indicatorsProvider from "#blokkli/editor/providers/indicators";
106
105
  import pluginProvider from "#blokkli/editor/providers/plugin";
@@ -109,6 +108,8 @@ import fieldsProvider from "#blokkli/editor/providers/fields";
109
108
  import iconsProvider from "#blokkli/editor/providers/icons";
110
109
  import permissionsProvider from "#blokkli/editor/providers/permissions";
111
110
  import adaptersProvider from "#blokkli/editor/providers/adapters";
111
+ import analyzeProviderFn from "#blokkli/editor/providers/analyze";
112
+ import dragdropProvider from "#blokkli/editor/providers/dragdrop";
112
113
  import { eventBus } from "#blokkli/editor/events";
113
114
  import "#blokkli-build/styles.css";
114
115
  import getAdapter from "#blokkli-build/edit-adapter";
@@ -186,7 +187,6 @@ const element = elementProvider(debug);
186
187
  const features = featuresProvider(storage);
187
188
  const commands = commandsProvider();
188
189
  const tour = tourProvider();
189
- const dropAreas = dropAreasProvider();
190
190
  const broadcast = broadcastProvider();
191
191
  const icons = iconsProvider();
192
192
  const ui = uiProvider(
@@ -216,6 +216,8 @@ const indicators = indicatorsProvider();
216
216
  const directive = directiveProvider(debug, ui);
217
217
  const fields = fieldsProvider(dom, types, state);
218
218
  const permissionsInstance = await permissionsProvider(adapter);
219
+ const analyze = analyzeProviderFn(adapters, state, ui, context, $t);
220
+ const dragdrop = dragdropProvider();
219
221
  const mutatedEntityProps = computed(() => state.mutatedItemProps.HOST);
220
222
  const mutatedEntity = computed(() => {
221
223
  return {
@@ -283,7 +285,6 @@ const app = {
283
285
  debug,
284
286
  definitions,
285
287
  dom,
286
- dropAreas,
287
288
  element,
288
289
  eventBus,
289
290
  directive,
@@ -301,7 +302,9 @@ const app = {
301
302
  ui,
302
303
  fields,
303
304
  icons,
304
- permissions: permissionsInstance
305
+ permissions: permissionsInstance,
306
+ analyze,
307
+ dragdrop
305
308
  };
306
309
  provide(INJECT_APP, app);
307
310
  function textWithHighlight(title, text) {