@blokkli/editor 2.0.0-alpha.53 → 2.0.0-alpha.55

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/constants/index.d.ts +1 -1
  2. package/dist/global/constants/index.js +1 -1
  3. package/dist/global/types/features.d.ts +5 -9
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +28 -35
  6. package/dist/modules/agent/index.mjs +46 -29
  7. package/dist/modules/agent/runtime/app/composables/agentProvider.js +2 -1
  8. package/dist/modules/agent/runtime/app/features/agent/Container.d.vue.ts +19 -0
  9. package/dist/modules/agent/runtime/app/features/agent/Container.vue +195 -0
  10. package/dist/modules/agent/runtime/app/features/agent/Container.vue.d.ts +19 -0
  11. package/dist/modules/agent/runtime/app/features/agent/index.vue +18 -164
  12. package/dist/modules/agent/runtime/app/features/agent/types.d.ts +9 -0
  13. package/dist/modules/agent/runtime/app/helpers/index.d.ts +7 -3
  14. package/dist/modules/agent/runtime/app/helpers/index.js +9 -3
  15. package/dist/modules/agent/runtime/app/prompts/fixReadability.js +51 -44
  16. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -1
  17. package/dist/modules/agent/runtime/app/tools/check_readability/index.js +1 -0
  18. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +1 -1
  19. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +6 -1
  20. package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.js +1 -0
  21. package/dist/modules/agent/runtime/app/types/index.d.ts +12 -0
  22. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +34 -18
  23. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +7 -0
  24. package/dist/modules/drupal/graphql/features/droppable-field-items.graphql +22 -0
  25. package/dist/modules/drupal/graphql/features/import-existing.graphql +0 -25
  26. package/dist/modules/drupal/graphql/features/workspace.graphql +9 -2
  27. package/dist/modules/drupal/graphql/mutations/update_droppable_field.graphql +21 -0
  28. package/dist/modules/drupal/index.mjs +6 -2
  29. package/dist/modules/drupal/runtime/adapter/index.js +75 -39
  30. package/dist/modules/readability/index.d.mts +11 -0
  31. package/dist/modules/readability/index.mjs +17 -0
  32. package/dist/modules/readability/runtime/adapter-extension.d.ts +2 -0
  33. package/dist/modules/readability/runtime/adapter-extension.js +5 -0
  34. package/dist/modules/readability/runtime/analyzers/builtin.d.ts +10 -0
  35. package/dist/modules/readability/runtime/analyzers/builtin.js +340 -0
  36. package/dist/runtime/components/BlokkliEditable.vue +10 -90
  37. package/dist/runtime/components/BlokkliItem.vue +2 -2
  38. package/dist/runtime/components/BlokkliProvider.vue +11 -5
  39. package/dist/runtime/composables/defineBlokkli.js +3 -1
  40. package/dist/runtime/composables/defineBlokkliFeature.d.ts +2 -3
  41. package/dist/runtime/editor/components/Actions/index.vue +1 -1
  42. package/dist/runtime/editor/components/AnimationCanvas/index.vue +41 -6
  43. package/dist/runtime/editor/components/AppMenu/Inner.d.vue.ts +7 -0
  44. package/dist/runtime/editor/components/AppMenu/Inner.vue +83 -0
  45. package/dist/runtime/editor/components/AppMenu/Inner.vue.d.ts +7 -0
  46. package/dist/runtime/editor/components/AppMenu/index.vue +5 -79
  47. package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
  48. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +9 -1
  49. package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
  50. package/dist/runtime/editor/components/BlockPreviewItem/index.vue +12 -6
  51. package/dist/runtime/editor/components/BlokkliEditableEdit.d.vue.ts +23 -0
  52. package/dist/runtime/editor/components/BlokkliEditableEdit.vue +95 -0
  53. package/dist/runtime/editor/components/BlokkliEditableEdit.vue.d.ts +23 -0
  54. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.d.vue.ts +4 -1
  55. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +4 -1
  56. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue.d.ts +4 -1
  57. package/dist/runtime/editor/components/BundleSelector/index.vue +10 -5
  58. package/dist/runtime/editor/components/Dialog/index.vue +0 -77
  59. package/dist/runtime/editor/components/EditIndicator.d.vue.ts +1 -0
  60. package/dist/runtime/editor/components/EditIndicator.vue +3 -2
  61. package/dist/runtime/editor/components/EditIndicator.vue.d.ts +1 -0
  62. package/dist/runtime/editor/components/EditProvider.d.vue.ts +3 -1
  63. package/dist/runtime/editor/components/EditProvider.vue +13 -4
  64. package/dist/runtime/editor/components/EditProvider.vue.d.ts +3 -1
  65. package/dist/runtime/editor/components/FeaturesRenderer/index.vue +1 -4
  66. package/dist/runtime/editor/components/Form/Text/index.d.vue.ts +5 -0
  67. package/dist/runtime/editor/components/Form/Text/index.vue +10 -4
  68. package/dist/runtime/editor/components/Form/Text/index.vue.d.ts +5 -0
  69. package/dist/runtime/editor/components/FormOverlay/index.vue +0 -24
  70. package/dist/runtime/editor/components/GrowOnly/index.d.vue.ts +10 -0
  71. package/dist/runtime/editor/components/GrowOnly/index.vue +34 -0
  72. package/dist/runtime/editor/components/GrowOnly/index.vue.d.ts +10 -0
  73. package/dist/runtime/editor/components/Konami/Game/index.vue +120 -0
  74. package/dist/runtime/editor/components/Konami/index.vue +7 -124
  75. package/dist/runtime/editor/components/Loading/index.vue +1 -1
  76. package/dist/runtime/editor/components/PluginConfigForm/Text/index.vue +1 -0
  77. package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -0
  78. package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +3 -1
  79. package/dist/runtime/editor/components/PreviewProvider.vue +6 -1
  80. package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +3 -1
  81. package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
  82. package/dist/runtime/editor/components/index.d.ts +11 -10
  83. package/dist/runtime/editor/components/index.js +32 -10
  84. package/dist/runtime/editor/composables/defineRenderer.d.ts +2 -2
  85. package/dist/runtime/editor/composables/defineRenderer.js +8 -3
  86. package/dist/runtime/editor/css/output.css +1 -1
  87. package/dist/runtime/editor/events/index.d.ts +6 -0
  88. package/dist/runtime/editor/features/analyze/Main.d.vue.ts +1 -0
  89. package/dist/runtime/editor/features/analyze/Main.vue +9 -8
  90. package/dist/runtime/editor/features/analyze/Main.vue.d.ts +1 -0
  91. package/dist/runtime/editor/features/analyze/Results/ResultsItem.vue +7 -15
  92. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +4 -2
  93. package/dist/runtime/editor/features/analyze/analyzers/axe.js +9 -9
  94. package/dist/runtime/editor/features/analyze/analyzers/readability.js +7 -7
  95. package/dist/runtime/editor/features/analyze/index.vue +26 -26
  96. package/dist/runtime/editor/features/analyze/readability/types.d.ts +18 -14
  97. package/dist/runtime/editor/features/anchors/index.vue +6 -2
  98. package/dist/runtime/editor/features/artboard/Renderer.vue +3 -2
  99. package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +78 -0
  100. package/dist/runtime/editor/features/block-scheduler/index.vue +34 -89
  101. package/dist/runtime/editor/features/breadcrumbs/index.vue +2 -2
  102. package/dist/runtime/editor/features/changelog/changelog.json +8 -0
  103. package/dist/runtime/editor/features/changelog/index.vue +10 -8
  104. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +152 -0
  105. package/dist/runtime/editor/features/clipboard/index.vue +13 -159
  106. package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -28
  107. package/dist/runtime/editor/features/command-palette/Palette/index.vue +17 -6
  108. package/dist/runtime/editor/features/command-palette/index.vue +7 -2
  109. package/dist/runtime/editor/features/comments/index.vue +6 -3
  110. package/dist/runtime/editor/features/debug/Main.vue +168 -0
  111. package/dist/runtime/editor/features/debug/Section/Features.vue +1 -2
  112. package/dist/runtime/editor/features/debug/index.vue +6 -170
  113. package/dist/runtime/editor/features/dev-mode/index.vue +2 -1
  114. package/dist/runtime/editor/features/diff/index.vue +6 -2
  115. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +15 -16
  116. package/dist/runtime/editor/features/dragging-overlay/index.vue +4 -3
  117. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.d.vue.ts +15 -0
  118. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +547 -0
  119. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue.d.ts +15 -0
  120. package/dist/runtime/editor/features/droppable-field-edit/index.d.vue.ts +3 -0
  121. package/dist/runtime/editor/features/droppable-field-edit/index.vue +231 -0
  122. package/dist/runtime/editor/features/droppable-field-edit/index.vue.d.ts +3 -0
  123. package/dist/runtime/editor/features/droppable-field-edit/types.d.ts +70 -0
  124. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.d.vue.ts +1 -0
  125. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +34 -21
  126. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue.d.ts +1 -0
  127. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +2 -2
  128. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +2 -2
  129. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
  130. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +6 -13
  131. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +4 -4
  132. package/dist/runtime/editor/features/fragments/index.vue +9 -4
  133. package/dist/runtime/editor/features/help/index.vue +7 -2
  134. package/dist/runtime/editor/features/highlights/Renderer/index.vue +11 -17
  135. package/dist/runtime/editor/features/history/index.vue +3 -2
  136. package/dist/runtime/editor/features/hover/Renderer/index.vue +87 -36
  137. package/dist/runtime/editor/features/hover/Renderer/vertex.glsl +5 -5
  138. package/dist/runtime/editor/features/hover/index.vue +1 -1
  139. package/dist/runtime/editor/features/import-existing/Dialog/Item.d.vue.ts +5 -0
  140. package/dist/runtime/editor/features/import-existing/Dialog/Item.vue +55 -0
  141. package/dist/runtime/editor/features/import-existing/Dialog/Item.vue.d.ts +5 -0
  142. package/dist/runtime/editor/features/import-existing/Dialog/index.d.vue.ts +7 -3
  143. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +107 -65
  144. package/dist/runtime/editor/features/import-existing/Dialog/index.vue.d.ts +7 -3
  145. package/dist/runtime/editor/features/import-existing/index.vue +19 -6
  146. package/dist/runtime/editor/features/import-existing/types.d.ts +0 -11
  147. package/dist/runtime/editor/features/library/ReusableDialog/index.vue +7 -33
  148. package/dist/runtime/editor/features/library/index.vue +14 -5
  149. package/dist/runtime/editor/features/media-library/Library/index.vue +3 -1
  150. package/dist/runtime/editor/features/media-library/index.vue +9 -2
  151. package/dist/runtime/editor/features/media-library/types.d.ts +2 -0
  152. package/dist/runtime/editor/features/multi-select/Renderer/index.vue +16 -15
  153. package/dist/runtime/editor/features/multi-select/index.vue +9 -3
  154. package/dist/runtime/editor/features/options/Form/Radios/index.vue +4 -8
  155. package/dist/runtime/editor/features/options/index.vue +7 -2
  156. package/dist/runtime/editor/features/preview-grant/index.vue +8 -2
  157. package/dist/runtime/editor/features/publish/index.vue +3 -2
  158. package/dist/runtime/editor/features/referenced-entities/index.vue +7 -2
  159. package/dist/runtime/editor/features/responsive-preview/index.vue +13 -11
  160. package/dist/runtime/editor/features/search/index.vue +6 -2
  161. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +6 -11
  162. package/dist/runtime/editor/features/selection/Renderer/index.vue +9 -14
  163. package/dist/runtime/editor/features/selection/index.vue +7 -4
  164. package/dist/runtime/editor/features/settings/index.vue +8 -3
  165. package/dist/runtime/editor/features/structure/index.vue +3 -2
  166. package/dist/runtime/editor/features/templates/CreateDialog/index.vue +1 -0
  167. package/dist/runtime/editor/features/templates/index.vue +14 -6
  168. package/dist/runtime/editor/features/theme/index.vue +2 -1
  169. package/dist/runtime/editor/features/tour/index.vue +6 -2
  170. package/dist/runtime/editor/features/translations/index.vue +7 -4
  171. package/dist/runtime/editor/features/workspace/Overlay/Item.d.vue.ts +3 -0
  172. package/dist/runtime/editor/features/workspace/Overlay/Item.vue +49 -0
  173. package/dist/runtime/editor/features/workspace/Overlay/Item.vue.d.ts +3 -0
  174. package/dist/runtime/editor/features/workspace/Overlay/index.vue +16 -104
  175. package/dist/runtime/editor/features/workspace/index.vue +6 -2
  176. package/dist/runtime/editor/helpers/webgl/index.d.ts +3 -2
  177. package/dist/runtime/editor/helpers/webgl/index.js +2 -3
  178. package/dist/runtime/editor/libraries/fzf.d.ts +3 -0
  179. package/dist/runtime/editor/libraries/fzf.js +7 -0
  180. package/dist/runtime/editor/libraries/twgl.d.ts +10 -0
  181. package/dist/runtime/editor/libraries/twgl.js +14 -0
  182. package/dist/runtime/editor/plugins/DebugOverlay/index.vue +3 -1
  183. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +39 -18
  184. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -0
  185. package/dist/runtime/editor/plugins/Sidebar/index.vue +12 -4
  186. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -0
  187. package/dist/runtime/editor/providers/animation.d.ts +5 -10
  188. package/dist/runtime/editor/providers/animation.js +10 -8
  189. package/dist/runtime/editor/providers/directive.d.ts +11 -0
  190. package/dist/runtime/editor/providers/directive.js +16 -0
  191. package/dist/runtime/editor/providers/features.d.ts +3 -3
  192. package/dist/runtime/editor/providers/features.js +1 -1
  193. package/dist/runtime/editor/providers/fieldValue.d.ts +27 -0
  194. package/dist/runtime/editor/providers/fieldValue.js +21 -1
  195. package/dist/runtime/editor/providers/keyboard.js +6 -3
  196. package/dist/runtime/editor/providers/readability.d.ts +28 -4
  197. package/dist/runtime/editor/providers/readability.js +30 -46
  198. package/dist/runtime/editor/providers/selection.d.ts +8 -0
  199. package/dist/runtime/editor/providers/selection.js +6 -0
  200. package/dist/runtime/editor/providers/texts.d.ts +1 -3
  201. package/dist/runtime/editor/providers/texts.js +34 -37
  202. package/dist/runtime/editor/providers/workspaces.d.ts +93 -0
  203. package/dist/runtime/editor/providers/workspaces.js +76 -0
  204. package/dist/runtime/editor/translations/de.json +918 -3616
  205. package/dist/runtime/editor/translations/fr.json +250 -3616
  206. package/dist/runtime/editor/translations/gsw_CH.json +918 -3616
  207. package/dist/runtime/editor/translations/it.json +250 -3616
  208. package/dist/runtime/editor/types/app.d.ts +2 -0
  209. package/dist/runtime/editor/types/features.d.ts +1 -1
  210. package/dist/runtime/editor/types/state.d.ts +7 -0
  211. package/dist/runtime/helpers/injections.d.ts +6 -0
  212. package/dist/runtime/helpers/injections.js +3 -0
  213. package/dist/runtime/types/definitions.d.ts +4 -0
  214. package/package.json +14 -4
  215. package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.d.ts +0 -6
  216. package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.js +0 -216
  217. package/dist/runtime/editor/features/workspace/types.d.ts +0 -59
  218. /package/dist/runtime/editor/features/{workspace → droppable-field-edit}/types.js +0 -0
@@ -14,8 +14,6 @@
14
14
  </template>
15
15
 
16
16
  <script setup>
17
- import Renderer from "./Renderer/index.vue";
18
- import SelectionAddButtons from "./AddButtons/index.vue";
19
17
  import {
20
18
  calculateIntersection,
21
19
  getBounds,
@@ -27,7 +25,8 @@ import {
27
25
  useBlokkli,
28
26
  defineBlokkliFeature,
29
27
  ref,
30
- watch
28
+ watch,
29
+ defineAsyncComponent
31
30
  } from "#imports";
32
31
  import { itemEntityType } from "#blokkli-build/config";
33
32
  import {
@@ -35,6 +34,10 @@ import {
35
34
  onBlokkliEvent,
36
35
  useStateBasedCache
37
36
  } from "#blokkli/editor/composables";
37
+ const Renderer = defineAsyncComponent(() => import("./Renderer/index.vue"));
38
+ const SelectionAddButtons = defineAsyncComponent(
39
+ () => import("./AddButtons/index.vue")
40
+ );
38
41
  defineBlokkliFeature({
39
42
  id: "selection",
40
43
  icon: "bk_mdi_select",
@@ -81,7 +84,7 @@ const stop = watch(
81
84
  }
82
85
  );
83
86
  const isVisible = computed(
84
- () => dom.isReady.value && !selection.isMultiSelecting.value && !selection.activeEditableLabel.value && !selection.isDragging.value && !ui.isAnimating.value && hasSelectedOnce.value && !ui.isApproving.value
87
+ () => dom.isReady.value && !selection.isMultiSelecting.value && !selection.activeFieldLabel.value && !selection.isDragging.value && !ui.isAnimating.value && hasSelectedOnce.value && !ui.isApproving.value
85
88
  );
86
89
  const findMostVisibleBlock = (allowedSet) => {
87
90
  const viewport = ui.visibleViewportPadded.value;
@@ -7,14 +7,18 @@
7
7
  </template>
8
8
 
9
9
  <script setup>
10
- import { useBlokkli, defineBlokkliFeature, computed } from "#imports";
11
- import SettingsDialog from "./Dialog/index.vue";
10
+ import {
11
+ useBlokkli,
12
+ defineBlokkliFeature,
13
+ computed,
14
+ defineAsyncComponent
15
+ } from "#imports";
12
16
  import { BlokkliTransition } from "#blokkli/editor/components";
13
17
  import {
14
18
  addElementClasses,
15
19
  defineMenuButton
16
20
  } from "#blokkli/editor/composables";
17
- const { ui, $t } = useBlokkli();
21
+ const SettingsDialog = defineAsyncComponent(() => import("./Dialog/index.vue"));
18
22
  const { settings } = defineBlokkliFeature({
19
23
  id: "settings",
20
24
  label: "Settings",
@@ -45,6 +49,7 @@ const { settings } = defineBlokkliFeature({
45
49
  }
46
50
  }
47
51
  });
52
+ const { ui, $t } = useBlokkli();
48
53
  const showSettings = computed(() => ui.currentDialog.value?.id === "settings");
49
54
  function onClick() {
50
55
  ui.openDialog({ id: "settings", alignment: "center" });
@@ -35,12 +35,13 @@ import {
35
35
  provide,
36
36
  onBeforeUnmount,
37
37
  onMounted,
38
- reactive
38
+ reactive,
39
+ defineAsyncComponent
39
40
  } from "#imports";
40
41
  import { PluginSidebar } from "#blokkli/editor/plugins";
41
42
  import { ScrollBoundary } from "#blokkli/editor/components";
42
- import List from "./List/index.vue";
43
43
  import { defineDropHandler } from "#blokkli/editor/composables";
44
+ const List = defineAsyncComponent(() => import("./List/index.vue"));
44
45
  defineBlokkliFeature({
45
46
  id: "structure",
46
47
  icon: "bk_mdi_account_tree",
@@ -20,6 +20,7 @@
20
20
  <FormText
21
21
  id="template_label"
22
22
  v-model="label"
23
+ lazy
23
24
  :label="$t('templatesCreateDialogLabelLabel', 'Name')"
24
25
  type="text"
25
26
  :placeholder="
@@ -32,10 +32,12 @@
32
32
  </template>
33
33
 
34
34
  <script setup>
35
- import { ref, useBlokkli, defineBlokkliFeature } from "#imports";
36
- import TemplatesDialog from "./Dialog/index.vue";
37
- import CreateTemplateDialog from "./CreateDialog/index.vue";
38
- import ManageDialog from "./ManageDialog/index.vue";
35
+ import {
36
+ ref,
37
+ useBlokkli,
38
+ defineBlokkliFeature,
39
+ defineAsyncComponent
40
+ } from "#imports";
39
41
  import { BlokkliTransition } from "#blokkli/editor/components";
40
42
  import {
41
43
  defineAddAction,
@@ -43,13 +45,19 @@ import {
43
45
  defineMenuButton,
44
46
  useDialog
45
47
  } from "#blokkli/editor/composables";
48
+ const TemplatesDialog = defineAsyncComponent(() => import("./Dialog/index.vue"));
49
+ const CreateTemplateDialog = defineAsyncComponent(
50
+ () => import("./CreateDialog/index.vue")
51
+ );
52
+ const ManageDialog = defineAsyncComponent(
53
+ () => import("./ManageDialog/index.vue")
54
+ );
46
55
  const { adapter } = defineBlokkliFeature({
47
56
  id: "templates",
48
57
  icon: "bk_mdi_dashboard",
49
58
  label: "Templates",
50
59
  description: "Add blocks from templates.",
51
- requiredAdapterMethods: ["templatesAdd", "templatesSearch"],
52
- dependencies: ["add-list", "entity-title"]
60
+ requiredAdapterMethods: ["templatesAdd", "templatesSearch"]
53
61
  });
54
62
  const { state, $t, ui, selection } = useBlokkli();
55
63
  const placedAction = ref(null);
@@ -64,7 +64,8 @@ defineBlokkliFeature({
64
64
  id: "theme",
65
65
  icon: "bk_mdi_palette",
66
66
  label: "Theme",
67
- description: "Implements a theme editor."
67
+ description: "Implements a theme editor.",
68
+ devOnly: true
68
69
  });
69
70
  const { $t, theme } = useBlokkli();
70
71
  const selectedThemeId = ref("custom");
@@ -17,10 +17,14 @@
17
17
  </template>
18
18
 
19
19
  <script setup>
20
- import { defineBlokkliFeature, useBlokkli } from "#imports";
21
- import Overlay from "./Overlay/index.vue";
20
+ import {
21
+ defineAsyncComponent,
22
+ defineBlokkliFeature,
23
+ useBlokkli
24
+ } from "#imports";
22
25
  import { defineMenuButton } from "#blokkli/editor/composables";
23
26
  import { Popup } from "#blokkli/editor/components";
27
+ const Overlay = defineAsyncComponent(() => import("./Overlay/index.vue"));
24
28
  defineBlokkliFeature({
25
29
  id: "tour",
26
30
  label: "Tour",
@@ -112,13 +112,11 @@ import {
112
112
  computed,
113
113
  useBlokkli,
114
114
  defineBlokkliFeature,
115
- onMounted
115
+ onMounted,
116
+ defineAsyncComponent
116
117
  } from "#imports";
117
118
  import { falsy } from "#blokkli/helpers";
118
119
  import { PluginItemAction, PluginTourItem } from "#blokkli/editor/plugins";
119
- import Banner from "./Banner/index.vue";
120
- import CsvDialog from "./CsvDialog/index.vue";
121
- import TranslateDialog from "./TranslateDialog/index.vue";
122
120
  import {
123
121
  defineMenuButton,
124
122
  defineHighlight,
@@ -127,6 +125,11 @@ import {
127
125
  useDialog
128
126
  } from "#blokkli/editor/composables";
129
127
  import { BlokkliTransition, Tooltip } from "#blokkli/editor/components";
128
+ const CsvDialog = defineAsyncComponent(() => import("./CsvDialog/index.vue"));
129
+ const TranslateDialog = defineAsyncComponent(
130
+ () => import("./TranslateDialog/index.vue")
131
+ );
132
+ const Banner = defineAsyncComponent(() => import("./Banner/index.vue"));
130
133
  const { adapter } = defineBlokkliFeature({
131
134
  id: "translations",
132
135
  label: "Translations",
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<any, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, any, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <a
3
+ :href="url"
4
+ class="bk-command _bk_flex _bk_items-center _bk_gap-10 _bk_px-15 _bk_w-full _bk_text-left _bk_no-underline _bk_max-w-full _bk_min-w-0 _bk_border _bk_border-transparent"
5
+ :class="
6
+ focused ? '_bk_bg-mono-800 _bk_border-mono-100 _bk_text-white' : '_bk_text-mono-300'
7
+ "
8
+ >
9
+ <div class="_bk_flex-1 _bk_min-w-0">
10
+ <div class="_bk_truncate _bk_font-semibold _bk_text-base">
11
+ {{ label }}
12
+ <span class="_bk_font-normal _bk_text-mono-500">{{ id }}</span>
13
+ </div>
14
+ <ul class="bk-pill-list _bk_mt-3">
15
+ <li>
16
+ <span class="bk-pill bk-is-mono-dark">{{ bundleLabel }}</span>
17
+ </li>
18
+ <li v-if="lastChanged">
19
+ <span class="bk-pill bk-is-yellow-dark">
20
+ <RelativeTime :timestamp="lastChanged" />
21
+ </span>
22
+ </li>
23
+ <li v-if="isOwner">
24
+ <span class="bk-pill bk-is-strong">{{ $t("owner", "Owner") }}</span>
25
+ </li>
26
+ </ul>
27
+ </div>
28
+ </a>
29
+ </template>
30
+
31
+ <script setup>
32
+ import { useBlokkli } from "#imports";
33
+ import { RelativeTime } from "#blokkli/editor/components";
34
+ defineProps({
35
+ id: { type: String, required: true },
36
+ uuid: { type: String, required: true },
37
+ entityType: { type: String, required: true },
38
+ bundle: { type: String, required: true },
39
+ label: { type: String, required: true },
40
+ url: { type: String, required: true },
41
+ lastChanged: { type: [String, null], required: true },
42
+ uid: { type: [String, null], required: true },
43
+ context: { type: String, required: false },
44
+ focused: { type: Boolean, required: true },
45
+ bundleLabel: { type: String, required: true },
46
+ isOwner: { type: Boolean, required: true }
47
+ });
48
+ const { $t } = useBlokkli();
49
+ </script>
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import("vue").DefineComponent<any, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, any, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -7,45 +7,19 @@
7
7
  :is-searching
8
8
  :placeholder="$t('workspaceSearchPlaceholder', 'Search pages...')"
9
9
  :item-height="70"
10
- :is-loading
10
+ :is-loading="workspaces.isLoading.value"
11
11
  @select="onSelectByIndex"
12
12
  @close="emit('close')"
13
13
  >
14
- <a
14
+ <Item
15
15
  v-for="(item, i) in displayItems"
16
16
  :key="item.uuid"
17
- ref="itemEls"
18
- :href="item.url"
19
- class="bk-command _bk_flex _bk_items-center _bk_gap-10 _bk_px-15 _bk_w-full _bk_text-left _bk_no-underline _bk_max-w-full _bk_min-w-0 _bk_border _bk_border-transparent"
20
- :class="
21
- focusedIndex === i ? '_bk_bg-mono-800 _bk_border-mono-100 _bk_text-white' : '_bk_text-mono-300'
22
- "
17
+ v-bind="item"
18
+ :focused="focusedIndex === i"
19
+ :bundle-label="workspaces.getBundleLabel(item.bundle)"
20
+ :is-owner="!!(item.uid && item.uid === ownerId)"
23
21
  @mouseenter="onMouseEnter(i)"
24
- >
25
- <div class="_bk_flex-1 _bk_min-w-0">
26
- <div class="_bk_truncate _bk_font-semibold _bk_text-base">
27
- {{ item.label }}
28
- <span class="_bk_font-normal _bk_text-mono-500">{{ item.id }}</span>
29
- </div>
30
- <ul class="_bk_flex _bk_gap-5 _bk_mt-3">
31
- <li class="bk-workspace-pill _bk_px-0 _bk_text-mono-300">
32
- {{ getBundleLabel(item) }}
33
- </li>
34
- <li
35
- v-if="item.lastChanged"
36
- class="bk-workspace-pill _bk_bg-yellow-dark/60 _bk_text-yellow-light"
37
- >
38
- <RelativeTime :timestamp="item.lastChanged" />
39
- </li>
40
- <li
41
- v-if="item.uid && item.uid === ownerId"
42
- class="bk-workspace-pill _bk_bg-accent-700/80"
43
- >
44
- <span>{{ $t("owner", "Owner") }}</span>
45
- </li>
46
- </ul>
47
- </div>
48
- </a>
22
+ />
49
23
  </SearchOverlay>
50
24
  </template>
51
25
 
@@ -58,59 +32,24 @@ import {
58
32
  onBeforeUnmount,
59
33
  watch
60
34
  } from "#imports";
61
- import { SearchOverlay, RelativeTime } from "#blokkli/editor/components";
62
- import { AsyncFzf, asyncExtendedMatch } from "fzf";
35
+ import { SearchOverlay } from "#blokkli/editor/components";
36
+ import Item from "./Item.vue";
63
37
  const emit = defineEmits(["close"]);
64
- const { adapter, $t, context, state, cache } = useBlokkli();
38
+ const { $t, state, workspaces } = useBlokkli();
65
39
  const searchText = ref("");
66
- const isLoading = ref(true);
67
- const allItems = ref([]);
68
- const labelMap = ref(null);
69
40
  const fzfResults = ref([]);
70
41
  const isSearching = ref(false);
71
42
  const ownerId = computed(() => state.owner.value?.id);
72
- const currentEntityUuid = computed(() => context.value.entityUuid);
73
- const defaultSorted = computed(() => {
74
- return allItems.value.filter((v) => v.uuid !== currentEntityUuid.value).sort((a, b) => {
75
- const aHasState = a.lastChanged !== null ? 0 : 1;
76
- const bHasState = b.lastChanged !== null ? 0 : 1;
77
- if (aHasState !== bHasState) return aHasState - bHasState;
78
- const aIsOwner = a.uid && a.uid === ownerId.value ? 0 : 1;
79
- const bIsOwner = b.uid && b.uid === ownerId.value ? 0 : 1;
80
- if (aIsOwner !== bIsOwner) return aIsOwner - bIsOwner;
81
- if (a.lastChanged && b.lastChanged) {
82
- return new Date(b.lastChanged).getTime() - new Date(a.lastChanged).getTime();
83
- }
84
- if (a.lastChanged) return -1;
85
- if (b.lastChanged) return 1;
86
- return a.label.localeCompare(b.label);
87
- });
88
- });
89
- const allSortedItems = computed(() => {
90
- if (searchText.value.trim()) {
91
- return fzfResults.value.filter((v) => v.uuid !== currentEntityUuid.value);
92
- }
93
- return defaultSorted.value;
43
+ const displayItems = computed(() => {
44
+ const source = searchText.value.trim() ? fzfResults.value : workspaces.defaultSorted.value;
45
+ return source.slice(0, 50);
94
46
  });
95
- const displayItems = computed(() => allSortedItems.value.slice(0, 50));
96
- function getBundleLabel(item) {
97
- return labelMap.value?.bundles[item.bundle] ?? item.bundle;
98
- }
99
47
  function onSelectByIndex(index) {
100
48
  const item = displayItems.value[index];
101
49
  if (item) {
102
50
  window.location.href = item.url;
103
51
  }
104
52
  }
105
- function getFzf() {
106
- return cache.get(
107
- "workspace:fzf",
108
- () => new AsyncFzf(allItems.value, {
109
- selector: (item) => item.context ? item.label + " " + item.context : item.label,
110
- match: asyncExtendedMatch
111
- })
112
- );
113
- }
114
53
  let searchTimeout = null;
115
54
  watch(searchText, (newValue) => {
116
55
  if (searchTimeout) {
@@ -130,9 +69,9 @@ watch(searchText, (newValue) => {
130
69
  return;
131
70
  }
132
71
  try {
133
- const results = await getFzf().find(query);
72
+ const results = await workspaces.search(query);
134
73
  if (searchText.value.trim() === query) {
135
- fzfResults.value = results.map((r) => r.item);
74
+ fzfResults.value = results;
136
75
  }
137
76
  } finally {
138
77
  if (searchText.value.trim() === query) {
@@ -141,37 +80,10 @@ watch(searchText, (newValue) => {
141
80
  }
142
81
  }, 150);
143
82
  });
144
- onMounted(async () => {
145
- try {
146
- const result = await cache.getAsync(
147
- "workspace:hostEntities",
148
- () => adapter.getHostEntities()
149
- );
150
- allItems.value = result.items;
151
- labelMap.value = result.labelMap;
152
- } finally {
153
- isLoading.value = false;
154
- }
155
- });
83
+ onMounted(() => workspaces.ensureLoaded());
156
84
  onBeforeUnmount(() => {
157
85
  if (searchTimeout) {
158
86
  clearTimeout(searchTimeout);
159
87
  }
160
88
  });
161
89
  </script>
162
-
163
- <style>
164
- .bk .bk-workspace-pill {
165
- display: flex;
166
- align-items: center;
167
- gap: 3px;
168
- border-radius: 9999px;
169
- padding-left: 5px;
170
- padding-right: 5px;
171
- padding-top: 1px;
172
- padding-bottom: 1px;
173
- font-size: 12px;
174
- line-height: 16px;
175
- font-weight: 500
176
- }
177
- </style>
@@ -22,11 +22,15 @@
22
22
  </template>
23
23
 
24
24
  <script setup>
25
- import { useBlokkli, defineBlokkliFeature } from "#imports";
25
+ import {
26
+ useBlokkli,
27
+ defineBlokkliFeature,
28
+ defineAsyncComponent
29
+ } from "#imports";
26
30
  import { BlokkliTransition } from "#blokkli/editor/components";
27
31
  import { PluginToolbarButton } from "#blokkli/editor/plugins";
28
- import Overlay from "./Overlay/index.vue";
29
32
  import { onBlokkliEvent, useDialog } from "#blokkli/editor/composables";
33
+ const Overlay = defineAsyncComponent(() => import("./Overlay/index.vue"));
30
34
  defineBlokkliFeature({
31
35
  id: "workspace",
32
36
  icon: "bk_mdi_workspaces",
@@ -1,4 +1,5 @@
1
- import { type BufferInfo } from 'twgl.js';
1
+ import type { BufferInfo } from 'twgl.js';
2
+ import type { TwglHelpers } from '#blokkli/editor/libraries/twgl';
2
3
  import type { Rectangle } from '#blokkli/editor/types/geometry';
3
4
  type RectangleBufferRect = Rectangle & {
4
5
  id: string;
@@ -44,6 +45,6 @@ export declare class RectangleBufferCollector<T extends RectangleBufferRect> {
44
45
  processPendingRects(): void;
45
46
  getIndex(id: string): number | undefined;
46
47
  updateRectangle(): void;
47
- createBufferInfo(gl: WebGLRenderingContext): BufferInfo;
48
+ createBufferInfo(gl: WebGLRenderingContext, twgl: TwglHelpers): BufferInfo;
48
49
  }
49
50
  export {};
@@ -1,4 +1,3 @@
1
- import { createBufferInfoFromArrays } from "twgl.js";
2
1
  import { intersects } from "./../geometry/index.js";
3
2
  export class RectangleBufferCollector {
4
3
  added = /* @__PURE__ */ new Set();
@@ -309,8 +308,8 @@ export class RectangleBufferCollector {
309
308
  }
310
309
  updateRectangle() {
311
310
  }
312
- createBufferInfo(gl) {
313
- return createBufferInfoFromArrays(gl, {
311
+ createBufferInfo(gl, twgl) {
312
+ return twgl.createBufferInfoFromArrays(gl, {
314
313
  a_position: {
315
314
  numComponents: 3,
316
315
  data: this.positions,
@@ -0,0 +1,3 @@
1
+ import type { Fzf, AsyncFzf, FzfOptions, AsyncFzfOptions } from 'fzf';
2
+ export declare function loadFzf(): Promise<typeof import('fzf')>;
3
+ export type { Fzf, AsyncFzf, FzfOptions, AsyncFzfOptions };
@@ -0,0 +1,7 @@
1
+ let modulePromise = null;
2
+ export function loadFzf() {
3
+ if (!modulePromise) {
4
+ modulePromise = import("fzf");
5
+ }
6
+ return modulePromise;
7
+ }
@@ -0,0 +1,10 @@
1
+ import { createProgramInfo, setBuffersAndAttributes, drawBufferInfo, setUniforms, createBufferInfoFromArrays } from 'twgl.js';
2
+ export declare const twgl: {
3
+ createProgramInfo: typeof createProgramInfo;
4
+ setBuffersAndAttributes: typeof setBuffersAndAttributes;
5
+ drawBufferInfo: typeof drawBufferInfo;
6
+ setUniforms: typeof setUniforms;
7
+ createBufferInfoFromArrays: typeof createBufferInfoFromArrays;
8
+ };
9
+ export type TwglHelpers = typeof twgl;
10
+ export type { BufferInfo, ProgramInfo } from 'twgl.js';
@@ -0,0 +1,14 @@
1
+ import {
2
+ createProgramInfo,
3
+ setBuffersAndAttributes,
4
+ drawBufferInfo,
5
+ setUniforms,
6
+ createBufferInfoFromArrays
7
+ } from "twgl.js";
8
+ export const twgl = {
9
+ createProgramInfo,
10
+ setBuffersAndAttributes,
11
+ drawBufferInfo,
12
+ setUniforms,
13
+ createBufferInfoFromArrays
14
+ };
@@ -1,6 +1,8 @@
1
1
  <template>
2
2
  <Teleport v-if="isVisible" to="body">
3
- <slot />
3
+ <div class="bk">
4
+ <slot />
5
+ </div>
4
6
  </Teleport>
5
7
  </template>
6
8
 
@@ -32,7 +32,7 @@
32
32
  >
33
33
  <Icon
34
34
  :name="
35
- region === 'left' ? 'bk_mdi_dock_to_left' : 'bk_mdi_dock_to_right'
35
+ region === 'left' ? 'bk_mdi_dock_to_right' : 'bk_mdi_dock_to_left'
36
36
  "
37
37
  />
38
38
  </button>
@@ -144,6 +144,10 @@ const height = computed(() => {
144
144
  const headerHeight = computed(() => 40);
145
145
  const startMouseX = ref(0);
146
146
  const startMouseY = ref(0);
147
+ const startX = ref(0);
148
+ const startY = ref(0);
149
+ const startWidth = ref(0);
150
+ const startHeight = ref(0);
147
151
  const rootCursor = computed(() => {
148
152
  switch (mouseMode.value) {
149
153
  case "resize-bottom-right":
@@ -202,45 +206,61 @@ const onMouseDown = (e, mode) => {
202
206
  mouseMode.value = mode;
203
207
  startMouseX.value = e.clientX;
204
208
  startMouseY.value = e.clientY;
209
+ if (offsetX.value !== 0) {
210
+ x.value = x.value - offsetX.value;
211
+ }
212
+ setCoordinates(x.value, y.value);
213
+ clampSizeToViewport();
214
+ startX.value = x.value;
215
+ startY.value = y.value;
216
+ startWidth.value = width.value;
217
+ startHeight.value = height.value;
205
218
  window.addEventListener("pointermove", onMouseMove, { capture: true });
206
219
  window.addEventListener("pointerup", onMouseUp, { capture: true });
207
220
  };
208
221
  const setCoordinates = (newX, newY) => {
209
- x.value = Math.min(
210
- Math.max(newX, ui.visibleViewport.value.x),
211
- ui.visibleViewport.value.width + ui.visibleViewport.value.x - width.value
222
+ x.value = Math.max(
223
+ Math.min(
224
+ newX,
225
+ ui.visibleViewport.value.x + ui.visibleViewport.value.width - width.value
226
+ ),
227
+ ui.visibleViewport.value.x
212
228
  );
213
- y.value = Math.min(
214
- Math.max(newY, ui.visibleViewport.value.y),
215
- ui.visibleViewport.value.y + ui.visibleViewport.value.height - headerHeight.value
229
+ y.value = Math.max(
230
+ Math.min(
231
+ newY,
232
+ ui.visibleViewport.value.y + ui.visibleViewport.value.height - headerHeight.value
233
+ ),
234
+ ui.visibleViewport.value.y
216
235
  );
217
236
  };
218
237
  const setSizes = (newWidth, newHeight) => {
219
238
  if (newWidth !== void 0) {
220
239
  const maxWidth = ui.visibleViewport.value.x + ui.visibleViewport.value.width - x.value;
221
- userWidth.value = Math.min(Math.max(newWidth, props.minWidth), maxWidth);
240
+ userWidth.value = Math.max(Math.min(newWidth, maxWidth), props.minWidth);
222
241
  }
223
242
  if (newHeight !== void 0) {
224
- userHeight.value = Math.min(
225
- Math.max(newHeight, props.minHeight),
226
- window.innerHeight - 50
227
- );
243
+ const maxHeight = ui.visibleViewport.value.y + ui.visibleViewport.value.height - y.value;
244
+ userHeight.value = Math.max(Math.min(newHeight, maxHeight), props.minHeight);
228
245
  }
229
246
  };
247
+ const clampSizeToViewport = () => {
248
+ setSizes(userWidth.value, userHeight.value);
249
+ };
230
250
  const onMouseMove = (e) => {
231
251
  if (mouseMode.value === "move") {
232
252
  setCoordinates(
233
- storedData.value.x + e.clientX - startMouseX.value,
234
- storedData.value.y + e.clientY - startMouseY.value
253
+ startX.value + e.clientX - startMouseX.value,
254
+ startY.value + e.clientY - startMouseY.value
235
255
  );
236
256
  } else if (mouseMode.value === "resize-right") {
237
- setSizes(storedData.value.width + e.clientX - startMouseX.value);
257
+ setSizes(startWidth.value + e.clientX - startMouseX.value);
238
258
  } else if (mouseMode.value === "resize-bottom") {
239
- setSizes(void 0, storedData.value.height + e.clientY - startMouseY.value);
259
+ setSizes(void 0, startHeight.value + e.clientY - startMouseY.value);
240
260
  } else if (mouseMode.value === "resize-bottom-right") {
241
261
  setSizes(
242
- storedData.value.width + e.clientX - startMouseX.value,
243
- storedData.value.height + e.clientY - startMouseY.value
262
+ startWidth.value + e.clientX - startMouseX.value,
263
+ startHeight.value + e.clientY - startMouseY.value
244
264
  );
245
265
  }
246
266
  };
@@ -265,6 +285,7 @@ const recalculatePositions = () => {
265
285
  storedData.value.viewportHeight = window.innerHeight;
266
286
  };
267
287
  recalculatePositions();
288
+ clampSizeToViewport();
268
289
  watch(offsetX, () => {
269
290
  updateStored();
270
291
  });
@@ -217,6 +217,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
217
217
  scrolledToEnd: any;
218
218
  isDetached: any;
219
219
  isShown: any;
220
+ shouldRender: any;
220
221
  width: any;
221
222
  height: any;
222
223
  toggleSidebar: () => void;
@@ -228,6 +229,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
228
229
  scrolledToEnd: any;
229
230
  isDetached: any;
230
231
  isShown: any;
232
+ shouldRender: any;
231
233
  width: undefined;
232
234
  height: undefined;
233
235
  toggleSidebar: () => void;