@blokkli/editor 1.0.4 → 1.1.1

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 (78) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +345 -16
  3. package/dist/runtime/adapter/drupal/graphql/base.graphql +2 -1
  4. package/dist/runtime/adapter/drupal/graphqlMiddleware.js +4 -1
  5. package/dist/runtime/adapter/index.d.ts +12 -1
  6. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +41 -39
  7. package/dist/runtime/blokkliPlugins/Sidebar/index.vue +10 -16
  8. package/dist/runtime/blokkliPlugins/ViewOption/index.vue +2 -0
  9. package/dist/runtime/components/BlokkliField.vue +75 -17
  10. package/dist/runtime/components/BlokkliItem.vue +34 -6
  11. package/dist/runtime/components/BlokkliProvider.vue +18 -1
  12. package/dist/runtime/components/Edit/BlockProxy/index.vue +102 -0
  13. package/dist/runtime/components/Edit/DragInteractions/index.vue +49 -25
  14. package/dist/runtime/components/Edit/DraggableList.vue +140 -30
  15. package/dist/runtime/components/Edit/EditProvider.vue +4 -0
  16. package/dist/runtime/components/Edit/Features/AddList/index.vue +3 -0
  17. package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +111 -0
  18. package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +47 -0
  19. package/dist/runtime/components/Edit/Features/Artboard/index.vue +301 -9
  20. package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +29 -4
  21. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +3 -4
  22. package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +27 -0
  23. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +24 -3
  24. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +56 -24
  25. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +184 -29
  26. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +36 -16
  27. package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +4 -0
  28. package/dist/runtime/components/Edit/Features/Duplicate/index.vue +1 -13
  29. package/dist/runtime/components/Edit/Features/EditableMask/index.vue +2 -2
  30. package/dist/runtime/components/Edit/Features/History/index.vue +1 -1
  31. package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +2 -2
  32. package/dist/runtime/components/Edit/Features/Options/Form/Checkboxes/index.vue +28 -25
  33. package/dist/runtime/components/Edit/Features/Options/Form/Color/index.vue +1 -1
  34. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +67 -39
  35. package/dist/runtime/components/Edit/Features/Options/Form/Number/index.vue +6 -2
  36. package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +1 -1
  37. package/dist/runtime/components/Edit/Features/Options/Form/Range/index.vue +2 -2
  38. package/dist/runtime/components/Edit/Features/Options/Form/Text/index.vue +2 -1
  39. package/dist/runtime/components/Edit/Features/Options/Form/index.vue +83 -33
  40. package/dist/runtime/components/Edit/Features/ProxyView/index.vue +38 -0
  41. package/dist/runtime/components/Edit/Features/Publish/index.vue +53 -6
  42. package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue +3 -13
  43. package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +1 -1
  44. package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +2 -0
  45. package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +3 -3
  46. package/dist/runtime/components/Edit/Features/Structure/index.vue +3 -3
  47. package/dist/runtime/components/Edit/ScrollBoundary/index.vue +24 -0
  48. package/dist/runtime/components/Edit/index.d.ts +2 -1
  49. package/dist/runtime/components/Edit/index.js +3 -1
  50. package/dist/runtime/composables/defineBlokkli.js +10 -5
  51. package/dist/runtime/constants/index.d.ts +1 -1
  52. package/dist/runtime/constants/index.js +6 -1
  53. package/dist/runtime/css/output.css +1 -1
  54. package/dist/runtime/helpers/animationProvider.js +10 -4
  55. package/dist/runtime/helpers/domProvider.d.ts +12 -4
  56. package/dist/runtime/helpers/domProvider.js +70 -26
  57. package/dist/runtime/helpers/featuresProvider.d.ts +1 -1
  58. package/dist/runtime/helpers/runtimeHelpers/index.d.ts +6 -0
  59. package/dist/runtime/helpers/runtimeHelpers/index.js +25 -0
  60. package/dist/runtime/helpers/selectionProvider.d.ts +2 -1
  61. package/dist/runtime/helpers/selectionProvider.js +7 -8
  62. package/dist/runtime/helpers/symbols.d.ts +7 -0
  63. package/dist/runtime/helpers/symbols.js +7 -0
  64. package/dist/runtime/helpers/typesProvider.d.ts +1 -1
  65. package/dist/runtime/helpers/uiProvider.d.ts +1 -0
  66. package/dist/runtime/helpers/uiProvider.js +16 -3
  67. package/dist/runtime/helpers/webgl/index.d.ts +6 -1
  68. package/dist/runtime/helpers/webgl/index.js +38 -5
  69. package/dist/runtime/icons/eye.svg +1 -0
  70. package/dist/runtime/types/generatedModuleTypes.d.ts +12 -4
  71. package/dist/runtime/types/index.d.ts +30 -1
  72. package/package.json +7 -5
  73. package/dist/runtime/components/Edit/Features/Artboard/Manager/Artboard.d.ts +0 -204
  74. package/dist/runtime/components/Edit/Features/Artboard/Manager/Artboard.js +0 -748
  75. package/dist/runtime/components/Edit/Features/Artboard/Manager/Scrollbar/index.vue +0 -176
  76. package/dist/runtime/components/Edit/Features/Artboard/Manager/index.vue +0 -317
  77. package/dist/runtime/helpers/Artboard/index.d.ts +0 -16
  78. package/dist/runtime/helpers/Artboard/index.js +0 -20
@@ -11,11 +11,10 @@
11
11
  icon="tree"
12
12
  weight="-90"
13
13
  >
14
- <div
14
+ <ScrollBoundary
15
15
  v-if="isLoaded"
16
16
  id="bk-structure"
17
17
  class="bk bk-structure bk-control"
18
- @wheel.stop
19
18
  >
20
19
  <List
21
20
  :entity-bundle="context.entityBundle"
@@ -23,7 +22,7 @@
23
22
  :entity-uuid="context.entityUuid"
24
23
  :visible-field-keys="visibleFieldKeys"
25
24
  />
26
- </div>
25
+ </ScrollBoundary>
27
26
  </PluginSidebar>
28
27
  </template>
29
28
 
@@ -38,6 +37,7 @@ import {
38
37
  reactive,
39
38
  } from '#imports'
40
39
  import { PluginSidebar } from '#blokkli/plugins'
40
+ import { ScrollBoundary } from '#blokkli/components'
41
41
  import List from './List/index.vue'
42
42
 
43
43
  defineBlokkliFeature({
@@ -0,0 +1,24 @@
1
+ <template>
2
+ <div @wheel="onWheel">
3
+ <slot />
4
+ </div>
5
+ </template>
6
+
7
+ <script setup lang="ts">
8
+ import { useBlokkli } from '#imports'
9
+
10
+ const { selection } = useBlokkli()
11
+
12
+ function onWheel(e: WheelEvent) {
13
+ if (selection.isDragging.value) {
14
+ return
15
+ }
16
+
17
+ if (e.ctrlKey || e.metaKey) {
18
+ return
19
+ }
20
+
21
+ // e.preventDefault()
22
+ e.stopImmediatePropagation()
23
+ }
24
+ </script>
@@ -11,4 +11,5 @@ import AddListItem from './AddListItem/index.vue.js';
11
11
  import Loading from './Loading/index.vue.js';
12
12
  import Highlight from './Highlight/index.vue.js';
13
13
  import ViewportBlockingRect from './ViewportBlockingRect/index.vue.js';
14
- export { ItemIcon, ShortcutIndicator, RelativeTime, Icon, Resizable, DialogModal, ScaleToFit, Sortli, FormOverlay, AddListItem, Loading, Highlight, ViewportBlockingRect, };
14
+ import ScrollBoundary from './ScrollBoundary/index.vue.js';
15
+ export { ItemIcon, ShortcutIndicator, RelativeTime, Icon, Resizable, DialogModal, ScaleToFit, Sortli, FormOverlay, AddListItem, Loading, Highlight, ViewportBlockingRect, ScrollBoundary, };
@@ -11,6 +11,7 @@ import AddListItem from "./AddListItem/index.vue";
11
11
  import Loading from "./Loading/index.vue";
12
12
  import Highlight from "./Highlight/index.vue";
13
13
  import ViewportBlockingRect from "./ViewportBlockingRect/index.vue";
14
+ import ScrollBoundary from "./ScrollBoundary/index.vue";
14
15
  export {
15
16
  ItemIcon,
16
17
  ShortcutIndicator,
@@ -24,5 +25,6 @@ export {
24
25
  AddListItem,
25
26
  Loading,
26
27
  Highlight,
27
- ViewportBlockingRect
28
+ ViewportBlockingRect,
29
+ ScrollBoundary
28
30
  };
@@ -4,7 +4,8 @@ import {
4
4
  INJECT_FIELD_LIST_BLOCKS,
5
5
  INJECT_FIELD_LIST_TYPE,
6
6
  INJECT_REUSABLE_OPTIONS,
7
- INJECT_PROVIDER_BLOCKS
7
+ INJECT_PROVIDER_BLOCKS,
8
+ INJECT_FIELD_USES_PROXY
8
9
  } from "../helpers/symbols.js";
9
10
  import {
10
11
  computed,
@@ -75,10 +76,14 @@ export function defineBlokkli(config) {
75
76
  });
76
77
  const parentType = computed(() => item?.value.parentType);
77
78
  const isEditing = !!item?.value.isEditing;
79
+ const fieldUsesProxy = inject(INJECT_FIELD_USES_PROXY, false);
78
80
  onMounted(() => {
79
- if (!item?.value || !isEditing || !editContext || !editContext.dom || // Block is already registered by the from_library block.
80
- fromLibraryOptions || // The defineBlokkliFragment composable registers the block itself.
81
- config.bundle === "blokkli_fragment") {
81
+ if (
82
+ // If the field uses proxy mode we don't want to register the block here.
83
+ fieldUsesProxy || !item?.value || !isEditing || !editContext || !editContext.dom || // Block is already registered by the from_library block.
84
+ fromLibraryOptions || // The defineBlokkliFragment composable registers the block itself.
85
+ config.bundle === "blokkli_fragment"
86
+ ) {
82
87
  return;
83
88
  }
84
89
  const instance = getCurrentInstance();
@@ -91,7 +96,7 @@ export function defineBlokkli(config) {
91
96
  );
92
97
  });
93
98
  onBeforeUnmount(() => {
94
- if (editContext && editContext.dom && uuid && config.bundle !== "blokkli_fragment") {
99
+ if (!fieldUsesProxy && isEditing && editContext && editContext.dom && uuid && config.bundle !== "blokkli_fragment") {
95
100
  editContext.dom.unregisterBlock(uuid);
96
101
  }
97
102
  });
@@ -1,4 +1,4 @@
1
- export declare const SETTINGS_GROUP: readonly ["appearance", "behavior", "advanced"];
1
+ export declare const SETTINGS_GROUP: readonly ["appearance", "artboard", "behavior", "advanced"];
2
2
  export declare const VIEWPORT: readonly ["mobile", "desktop"];
3
3
  export type SettingsGroup = (typeof SETTINGS_GROUP)[number];
4
4
  export type Viewport = (typeof VIEWPORT)[number];
@@ -1,2 +1,7 @@
1
- export const SETTINGS_GROUP = ["appearance", "behavior", "advanced"];
1
+ export const SETTINGS_GROUP = [
2
+ "appearance",
3
+ "artboard",
4
+ "behavior",
5
+ "advanced"
6
+ ];
2
7
  export const VIEWPORT = ["mobile", "desktop"];