@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
@@ -0,0 +1,78 @@
1
+ import { ref } from "#imports";
2
+ import { AnalyzerContext } from "../features/analyze/analyzers/helpers/Context.js";
3
+ import { normalizeToArray } from "../features/analyze/analyzers/helpers/normalizeArray.js";
4
+ export default function analyzeProvider(adapters, state, ui, context, $t) {
5
+ const analyzers = ref([]);
6
+ const isInitialized = ref(false);
7
+ let initPromise = null;
8
+ async function doInit() {
9
+ const fetched = await adapters.getAggregated("getAnalyzers");
10
+ const initCtx = new AnalyzerContext(
11
+ context.value.language,
12
+ ui.interfaceLanguage.value,
13
+ ui.providerElement,
14
+ state,
15
+ $t
16
+ );
17
+ await Promise.all(
18
+ fetched.map(async (analyzer) => {
19
+ if (analyzer.init) {
20
+ await analyzer.init(initCtx);
21
+ }
22
+ })
23
+ );
24
+ analyzers.value = fetched;
25
+ isInitialized.value = true;
26
+ }
27
+ function ensureInitialized() {
28
+ if (isInitialized.value) {
29
+ return Promise.resolve();
30
+ }
31
+ if (!initPromise) {
32
+ initPromise = doInit();
33
+ }
34
+ return initPromise;
35
+ }
36
+ function createContext(element, signal) {
37
+ return new AnalyzerContext(
38
+ context.value.language,
39
+ ui.interfaceLanguage.value,
40
+ element,
41
+ state,
42
+ $t,
43
+ signal
44
+ );
45
+ }
46
+ async function runAnalyzer(analyzer, ctx) {
47
+ return normalizeToArray(analyzer.run(ctx));
48
+ }
49
+ async function runOnTexts(texts, analyzerType) {
50
+ await ensureInitialized();
51
+ let textAnalyzers = analyzers.value.filter((a) => a.analyzeText);
52
+ if (analyzerType) {
53
+ textAnalyzers = textAnalyzers.filter((a) => a.type === analyzerType);
54
+ }
55
+ const results = [];
56
+ for (const text of texts) {
57
+ for (const analyzer of textAnalyzers) {
58
+ const nodes = await analyzer.analyzeText(text, context.value.language);
59
+ const label = typeof analyzer.label === "function" ? analyzer.label(context.value.language) : analyzer.label;
60
+ results.push({
61
+ analyzerId: analyzer.id,
62
+ analyzerLabel: label,
63
+ text,
64
+ nodes
65
+ });
66
+ }
67
+ }
68
+ return results;
69
+ }
70
+ return {
71
+ analyzers,
72
+ isInitialized,
73
+ ensureInitialized,
74
+ createContext,
75
+ runAnalyzer,
76
+ runOnTexts
77
+ };
78
+ }
@@ -182,6 +182,10 @@ export type AnimationProvider = {
182
182
  * Defaults to 'move' when pressing Space, otherwise determined by highest zIndex renderer.
183
183
  */
184
184
  cursor: ComputedRef<CursorKeyword>;
185
+ /**
186
+ * Get the current mouse coordinates.
187
+ */
188
+ getMouseCoords: () => Coord;
185
189
  /**
186
190
  * Handle a click event by calling onClick handlers on renderers.
187
191
  * Returns true if any renderer claimed the click, false otherwise.
@@ -437,6 +437,11 @@ export default function(eventBus, ui, storage, selection, debug, keyboard) {
437
437
  onBlokkliEvent("select:toggle", requestDraw);
438
438
  onBlokkliEvent("option:update", requestDraw);
439
439
  onBlokkliEvent("state:reloaded", requestDraw);
440
+ onBlokkliEvent("dragging:move", (e) => {
441
+ mouseX = e.x;
442
+ mouseY = e.y;
443
+ requestDraw();
444
+ });
440
445
  const dpi = computed(() => {
441
446
  const viewportWidth = ui.viewport.value.width;
442
447
  const viewportHeight = ui.viewport.value.height;
@@ -513,6 +518,7 @@ export default function(eventBus, ui, storage, selection, debug, keyboard) {
513
518
  setCanvasElement,
514
519
  removeCanvasElement,
515
520
  cursor,
521
+ getMouseCoords: () => ({ x: mouseX, y: mouseY }),
516
522
  handleClick,
517
523
  registerRenderer,
518
524
  unregisterRenderer,
@@ -0,0 +1,55 @@
1
+ import type { DraggableItemTypes, DraggableItem } from '../types/draggable.js';
2
+ import type { BlokkliFieldElement, BlokkliItemHost } from '#blokkli/editor/types/field';
3
+ import type { DropArea } from '#blokkli/editor/types/ui';
4
+ type MaybePromise<T> = T | Promise<T>;
5
+ export type DropResolveContext<K extends keyof DraggableItemTypes> = {
6
+ items: DraggableItemTypes[K][];
7
+ field: BlokkliFieldElement;
8
+ host: BlokkliItemHost;
9
+ afterUuid: string | null;
10
+ };
11
+ export type DropExecuteContext<K extends keyof DraggableItemTypes> = DropResolveContext<K> & {
12
+ bundle: string;
13
+ };
14
+ export type DropExecuteResult = {
15
+ /** If true, the dispatcher will focus the editable field after the block is added. */
16
+ focusEditable?: boolean;
17
+ };
18
+ export type DropHandler<K extends keyof DraggableItemTypes> = {
19
+ /**
20
+ * Optional. Called at drop time to refine which bundles are applicable.
21
+ * Can read DataTransfer, detect content types, re-map via clipboardMapBundle, etc.
22
+ * Returns the refined list of possible bundles.
23
+ * If omitted, the overlay calls execute() directly without bundle resolution.
24
+ */
25
+ resolveBundles?: (ctx: DropResolveContext<K>) => string[] | Promise<string[]>;
26
+ /**
27
+ * Called to perform the actual mutation.
28
+ * If resolveBundles was provided, `ctx.bundle` is the resolved bundle
29
+ * (either the single result or the user's BundleSelector pick).
30
+ */
31
+ execute: (ctx: DropExecuteContext<K>) => MaybePromise<DropExecuteResult | void>;
32
+ };
33
+ type DropAreaProviderFunction = (items: DraggableItem[]) => DropArea[] | DropArea | undefined;
34
+ export type DragDropProvider = {
35
+ registerDropHandler: <K extends keyof DraggableItemTypes>(itemType: K, handler: DropHandler<K>) => void;
36
+ unregisterDropHandler: <K extends keyof DraggableItemTypes>(itemType: K, handler: DropHandler<K>) => void;
37
+ getDropHandler: <K extends keyof DraggableItemTypes>(itemType: K) => DropHandler<K> | undefined;
38
+ /**
39
+ * Register a drop area provider function.
40
+ *
41
+ * The function will be called when drop areas are requested during drag operations.
42
+ * It receives the currently dragged items and can return drop areas where those items can be dropped.
43
+ */
44
+ addDropArea: (fn: DropAreaProviderFunction) => void;
45
+ /**
46
+ * Unregister a drop area provider function.
47
+ */
48
+ removeDropArea: (fn: DropAreaProviderFunction) => void;
49
+ /**
50
+ * Get all drop areas from all registered providers.
51
+ */
52
+ getDropAreas: (items: DraggableItem[]) => DropArea[];
53
+ };
54
+ export default function (): DragDropProvider;
55
+ export {};
@@ -0,0 +1,37 @@
1
+ import { falsy } from "../../helpers/index.js";
2
+ export default function() {
3
+ const handlers = /* @__PURE__ */ new Map();
4
+ let dropAreaFunctions = [];
5
+ const registerDropHandler = (itemType, handler) => {
6
+ handlers.set(itemType, handler);
7
+ };
8
+ const unregisterDropHandler = (itemType, handler) => {
9
+ if (handlers.get(itemType) === handler) {
10
+ handlers.delete(itemType);
11
+ }
12
+ };
13
+ const getDropHandler = (itemType) => {
14
+ return handlers.get(itemType);
15
+ };
16
+ const addDropArea = (fn) => {
17
+ dropAreaFunctions.push(fn);
18
+ };
19
+ const removeDropArea = (fn) => {
20
+ dropAreaFunctions = dropAreaFunctions.filter((v) => v !== fn);
21
+ };
22
+ const getDropAreas = (items) => dropAreaFunctions.flatMap((fn) => {
23
+ const v = fn(items);
24
+ if (v) {
25
+ return v;
26
+ }
27
+ return null;
28
+ }).filter(falsy);
29
+ return {
30
+ registerDropHandler,
31
+ unregisterDropHandler,
32
+ getDropHandler,
33
+ addDropArea,
34
+ removeDropArea,
35
+ getDropAreas
36
+ };
37
+ }
@@ -6,6 +6,12 @@ import {
6
6
  } from "#imports";
7
7
  import { storageDefaults } from "#blokkli-build/editor-config";
8
8
  const PREFIX = "blokkli:";
9
+ const migrations = {
10
+ showTourPopup: (oldValue) => ({
11
+ key: "popup:tour:closed",
12
+ value: !oldValue
13
+ })
14
+ };
9
15
  const getExisting = (key) => {
10
16
  try {
11
17
  const value = localStorage.getItem(key);
@@ -114,5 +120,14 @@ export default async function(adapter, context) {
114
120
  values.value[storageKey] = void 0;
115
121
  window.localStorage.removeItem(storageKey);
116
122
  };
123
+ for (const [oldKey, migrate] of Object.entries(migrations)) {
124
+ const oldStorageKey = PREFIX + oldKey;
125
+ const oldValue = getExisting(oldStorageKey);
126
+ if (oldValue !== void 0) {
127
+ const { key, value } = migrate(oldValue);
128
+ localStorage.setItem(PREFIX + key, JSON.stringify(value));
129
+ localStorage.removeItem(oldStorageKey);
130
+ }
131
+ }
117
132
  return { use, useWithContextPrefix, clearAll, clear };
118
133
  }
@@ -375,6 +375,12 @@ export type UiProvider = {
375
375
  * When true, adds 'bk-has-sidebar-right' class to document root.
376
376
  */
377
377
  hasSidebarRight: ComputedRef<boolean>;
378
+ /**
379
+ * Whether any sidebar is active in the right-bottom region.
380
+ *
381
+ * When true, adds 'bk-has-sidebar-right-bottom' class to document root.
382
+ */
383
+ hasSidebarRightBottom: ComputedRef<boolean>;
378
384
  /**
379
385
  * Reference to the main layout element.
380
386
  *
@@ -190,12 +190,18 @@ export default function(eventBus, providerElement, storage, context, element, ma
190
190
  };
191
191
  const activeSidebarsLeft = ref([]);
192
192
  const activeSidebarsRight = ref([]);
193
+ const activeSidebarsRightBottom = ref([]);
193
194
  function setActiveSidebar(region, id) {
194
195
  if (region === "left") {
195
196
  if (activeSidebarsLeft.value.includes(id)) {
196
197
  return;
197
198
  }
198
199
  activeSidebarsLeft.value.push(id);
200
+ } else if (region === "right-bottom") {
201
+ if (activeSidebarsRightBottom.value.includes(id)) {
202
+ return;
203
+ }
204
+ activeSidebarsRightBottom.value.push(id);
199
205
  } else {
200
206
  if (activeSidebarsRight.value.includes(id)) {
201
207
  return;
@@ -208,6 +214,10 @@ export default function(eventBus, providerElement, storage, context, element, ma
208
214
  activeSidebarsLeft.value = activeSidebarsLeft.value.filter(
209
215
  (v) => v !== id
210
216
  );
217
+ } else if (region === "right-bottom") {
218
+ activeSidebarsRightBottom.value = activeSidebarsRightBottom.value.filter(
219
+ (v) => v !== id
220
+ );
211
221
  } else {
212
222
  activeSidebarsRight.value = activeSidebarsRight.value.filter(
213
223
  (v) => v !== id
@@ -220,6 +230,9 @@ export default function(eventBus, providerElement, storage, context, element, ma
220
230
  const hasSidebarRight = computed(() => {
221
231
  return !!activeSidebarsRight.value.length;
222
232
  });
233
+ const hasSidebarRightBottom = computed(() => {
234
+ return !!activeSidebarsRightBottom.value.length;
235
+ });
223
236
  const blockingPaddingX = computed(() => 15);
224
237
  const blockingPaddingY = computed(() => 50);
225
238
  const viewportPadding = computed(() => 10);
@@ -326,6 +339,11 @@ export default function(eventBus, providerElement, storage, context, element, ma
326
339
  "bk-has-sidebar-right",
327
340
  hasSidebarRight
328
341
  );
342
+ addElementClasses(
343
+ document.documentElement,
344
+ "bk-has-sidebar-right-bottom",
345
+ hasSidebarRightBottom
346
+ );
329
347
  addElementClasses(document.documentElement, ["bk-html-root"]);
330
348
  addElementClasses(document.body, "bk-body");
331
349
  addElementClasses(document.documentElement, CLASS_PROXY_MODE, isProxyMode);
@@ -418,6 +436,7 @@ export default function(eventBus, providerElement, storage, context, element, ma
418
436
  removeActiveSidebar,
419
437
  hasSidebarLeft,
420
438
  hasSidebarRight,
439
+ hasSidebarRightBottom,
421
440
  mainLayoutElement,
422
441
  openDialog,
423
442
  closeDialog,
@@ -75,6 +75,10 @@
75
75
  "source": "<p>This shows the list of available blocks that can be placed. Add a block by dragging the icon into the page.</p><p>When an existing block is selected, some blocks may be greyed out. This indicates which blocks can be placed inside or after the selected block.</p>",
76
76
  "translation": "<p>Hier sehen Sie die Liste der verfügbaren Blöcke. Ziehen Sie einen Block auf die Seite um ihn hinzuzufügen.</p><p>Wenn ein bestehender Block ausgewählt ist sind möglicherweise einige Blöcke ausgegraut. Das bedeutet, dass nur die hervorgehobenen Blöcke im oder nach dem ausgewählten Block hinzugefügt werden können.</p>"
77
77
  },
78
+ "agentSidebarTooltipLabel": {
79
+ "source": "@name (AI-Assistant)",
80
+ "translation": "@name (KI-Assistent)"
81
+ },
78
82
  "aiAgentAddBlockDone": {
79
83
  "source": "Added @bundle",
80
84
  "translation": "@bundle hinzugefügt"
@@ -131,6 +135,14 @@
131
135
  "source": "Always",
132
136
  "translation": "Immer"
133
137
  },
138
+ "aiAgentAnalyzeContentDone": {
139
+ "source": "Analyzed @count results",
140
+ "translation": "@count Ergebnisse analysiert"
141
+ },
142
+ "aiAgentAnalyzeContentRunning": {
143
+ "source": "Analyzing content...",
144
+ "translation": "Inhalte werden analysiert..."
145
+ },
134
146
  "aiAgentApprove": {
135
147
  "source": "Approve",
136
148
  "translation": "Bestätigen"
@@ -191,6 +203,14 @@
191
203
  "source": "Cancelled",
192
204
  "translation": "Abgebrochen"
193
205
  },
206
+ "aiAgentCheckReadabilityDone": {
207
+ "source": "Checked readability for @count texts",
208
+ "translation": "Lesbarkeit von @count Texten geprüft"
209
+ },
210
+ "aiAgentCheckReadabilityRunning": {
211
+ "source": "Checking readability...",
212
+ "translation": "Lesbarkeit wird geprüft..."
213
+ },
194
214
  "aiAgentCompletePlanStep": {
195
215
  "source": "Completed: @label",
196
216
  "translation": "Abgeschlossen: @label"
@@ -295,6 +315,10 @@
295
315
  "source": "An unexpected error occurred.",
296
316
  "translation": "Ein unerwarteter Fehler ist aufgetreten."
297
317
  },
318
+ "aiAgentExpandButton": {
319
+ "source": "Show more",
320
+ "translation": "Mehr anzeigen"
321
+ },
298
322
  "aiAgentFindBlocksDone": {
299
323
  "source": "Found @count blocks",
300
324
  "translation": "@count Blöcke gefunden"
@@ -427,6 +451,14 @@
427
451
  "source": "Navigating history...",
428
452
  "translation": "Im Verlauf navigieren..."
429
453
  },
454
+ "aiAgentIntroPopup": {
455
+ "source": "Need help editing? @name is your AI assistant — it can add, move, and update blocks and much more. Give it a try!",
456
+ "translation": "Brauchst du Hilfe? Ich bin @name, dein KI-Assistent — ich kann Blöcke hinzufügen, verschieben, bearbeiten und vieles mehr. Probier es aus!"
457
+ },
458
+ "aiAgentIntroPopupCta": {
459
+ "source": "Get started",
460
+ "translation": "Jetzt ausprobieren"
461
+ },
430
462
  "aiAgentLoadSkill": {
431
463
  "source": "Using skill \"@label\"",
432
464
  "translation": "Skill «@label» lesen"
@@ -435,10 +467,6 @@
435
467
  "source": "@count tools loaded",
436
468
  "translation": "@count Tools geladen"
437
469
  },
438
- "aiAgentMoreOptions": {
439
- "source": "More options",
440
- "translation": "Weitere Optionen"
441
- },
442
470
  "aiAgentMoveBlockDone": {
443
471
  "source": "Moved @bundle",
444
472
  "translation": "@bundle verschoben"
@@ -455,10 +483,6 @@
455
483
  "source": "Start new conversation",
456
484
  "translation": "Neue Konversation starten"
457
485
  },
458
- "aiAgentNewLineHint": {
459
- "source": "Shift + Enter for new line",
460
- "translation": "Shift + Enter für neue Zeile"
461
- },
462
486
  "aiAgentNoConversations": {
463
487
  "source": "No past conversations.",
464
488
  "translation": "Keine früheren Konversationen."
@@ -483,6 +507,10 @@
483
507
  "source": "Plan completed: @label",
484
508
  "translation": "Plan abgeschlossen: @label"
485
509
  },
510
+ "aiAgentPopupTitle": {
511
+ "source": "AI-Assistant",
512
+ "translation": "KI-Assistent"
513
+ },
486
514
  "aiAgentProcessing": {
487
515
  "source": "Processing...",
488
516
  "translation": "Verarbeiten..."
@@ -527,6 +555,10 @@
527
555
  "source": "Retry",
528
556
  "translation": "Erneut versuchen"
529
557
  },
558
+ "aiAgentSearchContentRunning": {
559
+ "source": "Searching content...",
560
+ "translation": "Inhalte werden durchsucht..."
561
+ },
530
562
  "aiAgentSearchLibraryDone": {
531
563
  "source": "Searched library",
532
564
  "translation": "Bibliothek durchsucht"
@@ -707,6 +739,10 @@
707
739
  "source": "Click the button above to run the analysis.",
708
740
  "translation": "Klicken Sie auf den Button oben um die Analyse auszuführen."
709
741
  },
742
+ "analyzeKeepVisible": {
743
+ "source": "Keep results visible",
744
+ "translation": "Ergebnisse sichtbar halten"
745
+ },
710
746
  "analyzeLastRun": {
711
747
  "source": "Last run: @time",
712
748
  "translation": "Zuletzt ausgeführt: @time"
@@ -1023,6 +1059,10 @@
1023
1059
  "source": "Show total",
1024
1060
  "translation": "Total anzeigen"
1025
1061
  },
1062
+ "chartsEditButton": {
1063
+ "source": "Edit chart...",
1064
+ "translation": "Diagramm bearbeiten..."
1065
+ },
1026
1066
  "chartsEditorSaveError": {
1027
1067
  "source": "The chart could not be saved.",
1028
1068
  "translation": "Das Diagramm konnte nicht gespeichert werden."
@@ -1095,10 +1135,6 @@
1095
1135
  "source": "Preview",
1096
1136
  "translation": "Vorschau"
1097
1137
  },
1098
- "chartsPreviewPlaceholder": {
1099
- "source": "Click \"Refresh Preview\" to see the chart.",
1100
- "translation": "Klicken Sie auf «Vorschau aktualisieren», um das Diagramm anzuzeigen."
1101
- },
1102
1138
  "chartsRadarFillOpacity": {
1103
1139
  "source": "Fill opacity",
1104
1140
  "translation": "Fülldeckkraft"
@@ -1183,21 +1219,13 @@
1183
1219
  "source": "Clear input",
1184
1220
  "translation": "Eingabe löschen"
1185
1221
  },
1186
- "clipboard": {
1187
- "source": "Clipboard",
1188
- "translation": "Zwischenablage"
1189
- },
1190
1222
  "clipboardCopyShortcutHelp": {
1191
1223
  "source": "Copy selected blocks",
1192
1224
  "translation": "Ausgewählte Blöcke kopieren"
1193
1225
  },
1194
- "clipboardEmpty": {
1195
- "source": "No items in the clipboard",
1196
- "translation": "Keine Elemente in der Zwischenablage"
1197
- },
1198
- "clipboardExplanation": {
1199
- "source": "<p>\n Use Ctrl-V on the page to paste content. These\n will then be displayed here.\n </p>\n <p>\n Use Ctrl-F to search for existing content and paste it into\n the clipboard.\n </p>",
1200
- "translation": "<p>Verwenden Sie Ctrl-V auf der Seite um Inhalte einzufügen. Diese werden dann hier angezeigt.</p><p>Verwenden Sie Ctrl-F um bestehende Inhalte zu suchen und in die Zwischenablage einzufügen.</p>"
1226
+ "clipboardNoCommonBundle": {
1227
+ "source": "No common block type for these files.",
1228
+ "translation": "Kein gemeinsamer Blocktyp für diese Dateien."
1201
1229
  },
1202
1230
  "clipboardPasteDescription": {
1203
1231
  "source": "Paste blocks from clipboard",
@@ -1207,41 +1235,29 @@
1207
1235
  "source": "Failed to paste:",
1208
1236
  "translation": "Einfügen fehlgeschlagen:"
1209
1237
  },
1210
- "clipboardPasteErrorAllowedBundlesMultiple": {
1211
- "source": "Block types (@types) are not allowed here.",
1212
- "translation": "Die Block-Typen (@types) sind hier nicht erlaubt."
1213
- },
1214
- "clipboardPasteErrorAllowedBundlesSingle": {
1215
- "source": "Block type \"@types\" is not allowed here.",
1216
- "translation": "Der Block-Typ «@types» ist hier nicht erlaubt."
1217
- },
1218
- "clipboardPasteErrorAllowedFragmentsMultiple": {
1219
- "source": "Fragments (@types) are not allowed here.",
1220
- "translation": "Die Fragmente (@types) sind hier nicht erlaubt."
1221
- },
1222
- "clipboardPasteErrorAllowedFragmentsSingle": {
1223
- "source": "Fragment \"@types\" is not allowed here.",
1224
- "translation": "Das Fragment «@types» ist hier nicht erlaubt."
1238
+ "clipboardPasteShortcutHelp": {
1239
+ "source": "Paste text, image or copied blocks",
1240
+ "translation": "Text, Bild oder kopierte Blöcke einfügen"
1225
1241
  },
1226
- "clipboardPasteErrorCardinality": {
1227
- "source": "This field only allows up to @count blocks.",
1228
- "translation": "Dieses Feld erlaubt nur bis zu @count Blöcke."
1242
+ "clipboardTypeFile": {
1243
+ "source": "File",
1244
+ "translation": "Datei"
1229
1245
  },
1230
- "clipboardPasteErrorOneField": {
1231
- "source": "Pasting is only possible into one field at a time.",
1232
- "translation": "Blöcke können nur in einem Feld gleichzeitig eingefügt werden."
1246
+ "clipboardTypeImage": {
1247
+ "source": "Image",
1248
+ "translation": "Bild"
1233
1249
  },
1234
- "clipboardPastePlaceholder": {
1235
- "source": "Paste text or media here",
1236
- "translation": "Text oder Medien einfügen"
1250
+ "clipboardTypeText": {
1251
+ "source": "Text",
1252
+ "translation": "Text"
1237
1253
  },
1238
- "clipboardPasteShortcutHelp": {
1239
- "source": "Paste text, image or copied blocks",
1240
- "translation": "Text, Bild oder kopierte Blöcke einfügen"
1254
+ "clipboardTypeVideo": {
1255
+ "source": "Video",
1256
+ "translation": "Video"
1241
1257
  },
1242
- "clipboardTourText": {
1243
- "source": "Drag and drop content pasted from your clipboard into the page to create a matching block.",
1244
- "translation": "Ziehen Sie Inhalte, die aus Ihrer Zwischenablage eingefügt wurden, in die Seite hinein, um einen passenden Block zu erstellen."
1258
+ "clipboardUnsupportedFileType": {
1259
+ "source": "This file type is not supported.",
1260
+ "translation": "Dieser Dateityp wird nicht unterstützt."
1245
1261
  },
1246
1262
  "close": {
1247
1263
  "source": "Close",
@@ -1603,14 +1619,6 @@
1603
1619
  "source": "Clipboard",
1604
1620
  "translation": "Zwischenablage"
1605
1621
  },
1606
- "feature_clipboard_setting_openSidebarOnPaste_description": {
1607
- "source": "Automatically opens the sidebar when pasting content from the clipboard.",
1608
- "translation": "Öffnet automatisch die Seitenleiste wenn Inhalte aus der Zwischenablage eingefügt werden."
1609
- },
1610
- "feature_clipboard_setting_openSidebarOnPaste_label": {
1611
- "source": "Open sidebar when pasting",
1612
- "translation": "Seitenleiste beim Einfügen aus der Zwischenablage öffnen"
1613
- },
1614
1622
  "feature_command-palette_description": {
1615
1623
  "source": "Provides a command palette with search to access most UI features with a keyboard.",
1616
1624
  "translation": "Stellt eine Befehlspalette mit Suche bereit, um die meisten UI-Funktionen mit der Tastatur zu verwenden."
@@ -2887,6 +2895,10 @@
2887
2895
  "source": "Successfully created template \"@label\"",
2888
2896
  "translation": "Die Vorlage «@label» wurde erfolgreich erstellt."
2889
2897
  },
2898
+ "textareaNewLineHint": {
2899
+ "source": "Shift + Enter for new line",
2900
+ "translation": "Shift + Enter für neue Zeile"
2901
+ },
2890
2902
  "theme": {
2891
2903
  "source": "Theme",
2892
2904
  "translation": "Farben"