@blokkli/editor 2.0.0-alpha.22 → 2.0.0-alpha.24

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 (229) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +150 -226
  3. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +1 -1
  4. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +20 -14
  5. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +8 -4
  6. package/dist/runtime/blokkliPlugins/Sidebar/index.vue +55 -25
  7. package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +5 -4
  8. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +9 -2
  9. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +2 -0
  10. package/dist/runtime/blokkliPlugins/TourItem/index.vue +22 -13
  11. package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +1 -0
  12. package/dist/runtime/blokkliPlugins/ViewOption/index.vue +3 -1
  13. package/dist/runtime/blokkliPlugins/index.d.ts +1 -5
  14. package/dist/runtime/blokkliPlugins/index.js +0 -8
  15. package/dist/runtime/components/Blocks/FromLibrary/index.vue +0 -5
  16. package/dist/runtime/components/BlokkliEditable.vue +6 -1
  17. package/dist/runtime/components/BlokkliField.vue +1 -1
  18. package/dist/runtime/components/BlokkliProvider.vue +4 -4
  19. package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -1
  20. package/dist/runtime/components/Edit/Actions/ItemDropdown.vue +66 -0
  21. package/dist/runtime/components/Edit/Actions/ItemDropdown.vue.d.ts +6 -0
  22. package/dist/runtime/components/Edit/Actions/index.vue +80 -117
  23. package/dist/runtime/components/Edit/AddListItem/index.vue +8 -29
  24. package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +2 -3
  25. package/dist/runtime/components/Edit/AnimationCanvas/index.vue +23 -68
  26. package/dist/runtime/components/Edit/AppMenu/MenuButton.vue +39 -0
  27. package/dist/runtime/{blokkliPlugins/MenuButton/index.vue.d.ts → components/Edit/AppMenu/MenuButton.vue.d.ts} +0 -4
  28. package/dist/runtime/components/Edit/AppMenu/index.vue +62 -40
  29. package/dist/runtime/components/Edit/BlockProxy/index.vue +2 -8
  30. package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +33 -49
  31. package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +14 -1
  32. package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +93 -0
  33. package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue.d.ts +12 -0
  34. package/dist/runtime/components/Edit/Dialog/index.vue +26 -5
  35. package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
  36. package/dist/runtime/components/Edit/DraggableList.vue +5 -25
  37. package/dist/runtime/components/Edit/EditProvider.vue +71 -41
  38. package/dist/runtime/components/Edit/EditProvider.vue.d.ts +1 -1
  39. package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +52 -0
  40. package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue.d.ts +7 -0
  41. package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue +41 -0
  42. package/dist/runtime/components/Edit/Features/{Selection/OverlayFallback → AddList/Actions}/index.vue.d.ts +1 -1
  43. package/dist/runtime/components/Edit/Features/{BlockAddList → AddList/Blocks}/index.vue +36 -108
  44. package/dist/runtime/components/Edit/Features/{Hover/Overlay → AddList/Blocks}/index.vue.d.ts +7 -2
  45. package/dist/runtime/components/Edit/Features/AddList/index.vue +76 -110
  46. package/dist/runtime/components/Edit/Features/Analyze/{Renderer.vue → Main.vue} +4 -8
  47. package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/fragment.glsl +10 -6
  48. package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/index.vue +43 -15
  49. package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/index.vue.d.ts +0 -2
  50. package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/vertex.glsl +11 -9
  51. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +15 -3
  52. package/dist/runtime/components/Edit/Features/Analyze/index.vue +7 -3
  53. package/dist/runtime/components/Edit/Features/Anchors/index.vue +2 -2
  54. package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +41 -20
  55. package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +3 -2
  56. package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue +2 -28
  57. package/dist/runtime/components/Edit/Features/Assistant/index.vue +18 -14
  58. package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +1 -0
  59. package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +2 -2
  60. package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +22 -11
  61. package/dist/runtime/components/Edit/Features/Clipboard/index.vue +70 -29
  62. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +0 -2
  63. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +6 -4
  64. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +77 -27
  65. package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +7 -4
  66. package/dist/runtime/components/Edit/Features/Comments/index.vue +2 -2
  67. package/dist/runtime/components/Edit/Features/Conversions/index.vue +16 -9
  68. package/dist/runtime/components/Edit/Features/Debug/DebugSection.vue +24 -0
  69. package/dist/runtime/components/Edit/Features/Debug/DebugSection.vue.d.ts +16 -0
  70. package/dist/runtime/components/Edit/Features/Debug/Main.vue +80 -0
  71. package/dist/runtime/components/Edit/Features/Debug/Section/Features.vue +34 -0
  72. package/dist/runtime/components/Edit/Features/Debug/Section/Icons.vue +15 -0
  73. package/dist/runtime/components/Edit/Features/Debug/Section/Icons.vue.d.ts +2 -0
  74. package/dist/runtime/components/Edit/Features/Debug/Section/Keyboard.vue +17 -0
  75. package/dist/runtime/components/Edit/Features/Debug/Section/Keyboard.vue.d.ts +2 -0
  76. package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue +66 -0
  77. package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +6 -0
  78. package/dist/runtime/components/Edit/Features/Debug/Section/Rendering.vue +96 -0
  79. package/dist/runtime/components/Edit/Features/Debug/Section/Rendering.vue.d.ts +2 -0
  80. package/dist/runtime/components/Edit/Features/Debug/Section/Selection.vue +25 -0
  81. package/dist/runtime/components/Edit/Features/Debug/Section/Selection.vue.d.ts +2 -0
  82. package/dist/runtime/components/Edit/Features/Debug/index.vue +2 -2
  83. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue +113 -0
  84. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue.d.ts +25 -0
  85. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +23 -119
  86. package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/fragment.glsl +77 -0
  87. package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue +138 -92
  88. package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/vertex.glsl +60 -8
  89. package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +4 -5
  90. package/dist/runtime/components/Edit/Features/EditForm/index.vue +2 -2
  91. package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +0 -6
  92. package/dist/runtime/components/Edit/Features/EditableField/index.vue +8 -4
  93. package/dist/runtime/components/Edit/Features/Exit/index.vue +12 -9
  94. package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue +1 -5
  95. package/dist/runtime/components/Edit/Features/Fragments/index.vue +27 -31
  96. package/dist/runtime/components/Edit/Features/Hover/Renderer/fragment.glsl +141 -0
  97. package/dist/runtime/components/Edit/Features/Hover/{Overlay → Renderer}/index.vue +225 -38
  98. package/dist/runtime/components/Edit/Features/Hover/Renderer/index.vue.d.ts +2 -0
  99. package/dist/runtime/components/Edit/Features/Hover/{Overlay → Renderer}/vertex.glsl +49 -11
  100. package/dist/runtime/components/Edit/Features/Hover/index.vue +9 -6
  101. package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +1 -0
  102. package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +25 -24
  103. package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +2 -2
  104. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue +1 -5
  105. package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +1 -0
  106. package/dist/runtime/components/Edit/Features/Library/index.vue +50 -36
  107. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/Item.vue +1 -1
  108. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +26 -13
  109. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue.d.ts +0 -1
  110. package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +3 -47
  111. package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/fragment.glsl +13 -26
  112. package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/index.vue +131 -75
  113. package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/index.vue.d.ts +0 -1
  114. package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/vertex.glsl +27 -2
  115. package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +25 -12
  116. package/dist/runtime/components/Edit/Features/Ownership/index.vue +2 -2
  117. package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +2 -1
  118. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +1 -0
  119. package/dist/runtime/components/Edit/Features/Publish/index.vue +17 -15
  120. package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +1 -1
  121. package/dist/runtime/components/Edit/Features/Revert/index.vue +24 -18
  122. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +23 -6
  123. package/dist/runtime/components/Edit/Features/Search/index.vue +1 -1
  124. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +21 -17
  125. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +6 -6
  126. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +19 -17
  127. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +242 -131
  128. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +29 -12
  129. package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +15 -10
  130. package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/fragment.glsl +23 -14
  131. package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/index.vue +121 -28
  132. package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/index.vue.d.ts +0 -2
  133. package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/vertex.glsl +23 -14
  134. package/dist/runtime/components/Edit/Features/Selection/index.vue +46 -59
  135. package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +1 -0
  136. package/dist/runtime/components/Edit/Features/Settings/index.vue +25 -17
  137. package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +2 -2
  138. package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +1 -1
  139. package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue +2 -2
  140. package/dist/runtime/components/Edit/Features/Tour/index.vue +12 -10
  141. package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +5 -5
  142. package/dist/runtime/components/Edit/Features/Transform/index.vue +30 -23
  143. package/dist/runtime/components/Edit/Features/Translations/index.vue +18 -17
  144. package/dist/runtime/components/Edit/Form/Checkboxes/index.vue +43 -0
  145. package/dist/runtime/components/Edit/Form/Checkboxes/index.vue.d.ts +20 -0
  146. package/dist/runtime/components/Edit/FormOverlay/index.vue +13 -4
  147. package/dist/runtime/components/Edit/ItemIconBox/index.vue +41 -0
  148. package/dist/runtime/components/Edit/{AddListItemIcon → ItemIconBox}/index.vue.d.ts +5 -5
  149. package/dist/runtime/components/Edit/Konami/Game/index.vue +0 -1
  150. package/dist/runtime/components/Edit/Konami/index.vue +3 -5
  151. package/dist/runtime/components/Edit/Messages/Item/index.vue +11 -2
  152. package/dist/runtime/components/Edit/Messages/Item/index.vue.d.ts +1 -1
  153. package/dist/runtime/components/Edit/Messages/index.vue +6 -1
  154. package/dist/runtime/components/Edit/Overlay/index.vue +66 -0
  155. package/dist/runtime/components/Edit/Overlay/index.vue.d.ts +2 -0
  156. package/dist/runtime/components/Edit/PreviewProvider.vue +1 -1
  157. package/dist/runtime/components/Edit/Sortli/index.vue +5 -8
  158. package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +2 -0
  159. package/dist/runtime/components/Edit/SystemRequirements/index.vue +36 -36
  160. package/dist/runtime/components/Edit/Toolbar/index.vue +47 -51
  161. package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue +9 -2
  162. package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +4 -1
  163. package/dist/runtime/components/Edit/index.d.ts +7 -5
  164. package/dist/runtime/components/Edit/index.js +13 -9
  165. package/dist/runtime/css/output.css +1 -1
  166. package/dist/runtime/helpers/animationProvider.d.ts +58 -9
  167. package/dist/runtime/helpers/animationProvider.js +318 -75
  168. package/dist/runtime/helpers/composables/defineAddAction.d.ts +2 -0
  169. package/dist/runtime/helpers/composables/defineAddAction.js +10 -0
  170. package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +2 -0
  171. package/dist/runtime/helpers/composables/defineItemDropdownAction.js +10 -0
  172. package/dist/runtime/helpers/composables/defineMenuButton.d.ts +2 -0
  173. package/dist/runtime/helpers/composables/defineMenuButton.js +10 -0
  174. package/dist/runtime/helpers/composables/defineRenderer.d.ts +5 -2
  175. package/dist/runtime/helpers/composables/defineRenderer.js +3 -2
  176. package/dist/runtime/helpers/composables/useDialog.d.ts +3 -0
  177. package/dist/runtime/helpers/composables/useDialog.js +16 -0
  178. package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +16 -0
  179. package/dist/runtime/helpers/composables/useGlobalBlokkliObject.js +36 -0
  180. package/dist/runtime/helpers/debugProvider.d.ts +13 -3
  181. package/dist/runtime/helpers/debugProvider.js +80 -12
  182. package/dist/runtime/helpers/defineElementStyle.d.ts +2 -0
  183. package/dist/runtime/helpers/defineElementStyle.js +33 -0
  184. package/dist/runtime/helpers/domProvider.d.ts +1 -0
  185. package/dist/runtime/helpers/domProvider.js +51 -32
  186. package/dist/runtime/helpers/dropTargets/index.d.ts +1 -1
  187. package/dist/runtime/helpers/dropTargets/index.js +18 -4
  188. package/dist/runtime/helpers/eventBus.d.ts +1 -1
  189. package/dist/runtime/helpers/index.d.ts +1 -6
  190. package/dist/runtime/helpers/index.js +0 -81
  191. package/dist/runtime/helpers/pluginProvider.d.ts +38 -3
  192. package/dist/runtime/helpers/pluginProvider.js +49 -18
  193. package/dist/runtime/helpers/providers/blocks.js +10 -0
  194. package/dist/runtime/helpers/providers/directive.d.ts +4 -1
  195. package/dist/runtime/helpers/providers/directive.js +9 -2
  196. package/dist/runtime/helpers/providers/fields.d.ts +9 -1
  197. package/dist/runtime/helpers/stateProvider.js +1 -0
  198. package/dist/runtime/helpers/uiProvider.d.ts +13 -12
  199. package/dist/runtime/helpers/uiProvider.js +117 -81
  200. package/dist/runtime/helpers/webgl/index.d.ts +2 -3
  201. package/dist/runtime/helpers/webgl/index.js +9 -14
  202. package/dist/runtime/icons/click.svg +1 -0
  203. package/dist/runtime/icons/dock-left.svg +1 -0
  204. package/dist/runtime/icons/dock-right.svg +1 -0
  205. package/dist/runtime/icons/dock-window.svg +1 -0
  206. package/dist/runtime/plugins/blokkliDirectives.js +1 -1
  207. package/dist/runtime/types/index.d.ts +16 -26
  208. package/package.json +1 -1
  209. package/dist/runtime/blokkliPlugins/AddAction/index.vue +0 -96
  210. package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +0 -26
  211. package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +0 -56
  212. package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +0 -24
  213. package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +0 -76
  214. package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +0 -31
  215. package/dist/runtime/blokkliPlugins/MenuButton/index.vue +0 -66
  216. package/dist/runtime/components/Edit/AddListItemIcon/index.vue +0 -19
  217. package/dist/runtime/components/Edit/Features/BlockAddList/docs.md +0 -15
  218. package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +0 -240
  219. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +0 -96
  220. package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +0 -139
  221. package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +0 -42
  222. /package/dist/runtime/components/Edit/Features/Analyze/{Renderer.vue.d.ts → Main.vue.d.ts} +0 -0
  223. /package/dist/runtime/components/Edit/Features/Anchors/{Renderer.vue → Overlay/index.vue} +0 -0
  224. /package/dist/runtime/components/Edit/Features/{BlockAddList → Anchors/Overlay}/index.vue.d.ts +0 -0
  225. /package/dist/runtime/components/Edit/Features/Debug/{Renderer.vue.d.ts → Main.vue.d.ts} +0 -0
  226. /package/dist/runtime/components/Edit/Features/{Anchors/Renderer.vue.d.ts → Debug/Section/Features.vue.d.ts} +0 -0
  227. /package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue.d.ts +0 -0
  228. /package/dist/runtime/components/Edit/Features/Ownership/{Renderer.vue → Banner/index.vue} +0 -0
  229. /package/dist/runtime/components/Edit/Features/Ownership/{Renderer.vue.d.ts → Banner/index.vue.d.ts} +0 -0
@@ -0,0 +1,17 @@
1
+ <template>
2
+ <div class="bk-debug-list">
3
+ <div>
4
+ <div>Space</div>
5
+ <div>{{ keyboard.isPressingSpace.value }}</div>
6
+ </div>
7
+ <div>
8
+ <div>Control</div>
9
+ <div>{{ keyboard.isPressingControl.value }}</div>
10
+ </div>
11
+ </div>
12
+ </template>
13
+
14
+ <script setup>
15
+ import { useBlokkli } from "#imports";
16
+ const { keyboard } = useBlokkli();
17
+ </script>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <div>
3
+ <div>
4
+ <FormToggle v-model="logEvents" label="Log Events" />
5
+ </div>
6
+ <div>
7
+ <FormCheckboxes
8
+ id="debug-loggers"
9
+ v-model="debug.enabledLoggers.value"
10
+ label="Enabled Loggers"
11
+ description="If none selected, all will log. Select one or more to filter."
12
+ :options="loggerOptions"
13
+ />
14
+ </div>
15
+ <div>
16
+ <button
17
+ class="bk-button bk-is-small"
18
+ @click.prevent="() => console.log(dom.getDebugData())"
19
+ >
20
+ Log DOM state
21
+ </button>
22
+ </div>
23
+
24
+ <div>
25
+ <button class="bk-button bk-is-small" @click.prevent="getAllMessages">
26
+ Log all messages
27
+ </button>
28
+ </div>
29
+ </div>
30
+ </template>
31
+
32
+ <script setup>
33
+ import { useBlokkli, computed, onMounted, onBeforeUnmount } from "#imports";
34
+ import { FormToggle, FormCheckboxes } from "#blokkli/components";
35
+ const props = defineProps({
36
+ logger: { type: Object, required: true }
37
+ });
38
+ const { debug, dom, storage, eventBus } = useBlokkli();
39
+ const logEvents = storage.use("debug:log-events", true);
40
+ const loggerOptions = computed(() => {
41
+ return debug.registeredLoggers.value.map((name) => ({
42
+ value: name,
43
+ label: name
44
+ })).sort((a, b) => {
45
+ return a.label.localeCompare(b.label);
46
+ });
47
+ });
48
+ const onEvent = (name, data) => {
49
+ if (!logEvents.value) {
50
+ return;
51
+ }
52
+ if (name === "animationFrame" || name === "animationFrame:before" || name === "animationFrame:after" || name === "canvas:draw") {
53
+ return;
54
+ }
55
+ props.logger.log("Event: " + String(name), data);
56
+ };
57
+ onMounted(() => {
58
+ eventBus.on("*", onEvent);
59
+ });
60
+ onBeforeUnmount(() => {
61
+ eventBus.off("*", onEvent);
62
+ });
63
+ function getAllMessages() {
64
+ console.log(debug.getMessages());
65
+ }
66
+ </script>
@@ -0,0 +1,6 @@
1
+ import type { DebugLogger } from '#blokkli/helpers/debugProvider';
2
+ type __VLS_Props = {
3
+ logger: DebugLogger;
4
+ };
5
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ export default _default;
@@ -0,0 +1,96 @@
1
+ <template>
2
+ <div class="bk-debug-list">
3
+ <div>
4
+ <div>DPI</div>
5
+ <div>{{ animation.dpi.value }}</div>
6
+ </div>
7
+ </div>
8
+ <div v-for="overlay in debug.overlays.value" :key="overlay.id">
9
+ <FormToggle
10
+ :label="overlay.label"
11
+ :model-value="overlay.active"
12
+ @update:model-value="debug.toggleOverlay(overlay.id)"
13
+ />
14
+ </div>
15
+ <div>
16
+ <FormToggle
17
+ label="Set transforming"
18
+ :model-value="ui.isTransforming.value"
19
+ @update:model-value="toggleTransforming"
20
+ />
21
+ </div>
22
+
23
+ <div>
24
+ <FormRadio
25
+ id="rendering-mode"
26
+ label="Rendering Mode"
27
+ :model-value="animation.preferredRenderingMode.value"
28
+ :options="renderingModeOptions"
29
+ @update:model-value="updateRenderingMode"
30
+ />
31
+ </div>
32
+ <div>
33
+ <button
34
+ class="bk-button bk-is-small"
35
+ @click.prevent="() => dom.updateVisibleRects()"
36
+ >
37
+ Refresh Rects
38
+ </button>
39
+ </div>
40
+ <div v-if="animation.hasWebGLContext.value">
41
+ <button
42
+ class="bk-button bk-is-small"
43
+ :disabled="!animation.isRenderingWebGL.value"
44
+ @click.prevent="loseContext"
45
+ >
46
+ Lose WebGL Context
47
+ </button>
48
+ </div>
49
+ <div v-if="animation.hasWebGLContext.value">
50
+ <button
51
+ class="bk-button bk-is-small"
52
+ :disabled="animation.isRenderingWebGL.value"
53
+ @click.prevent="restoreContext"
54
+ >
55
+ Restore WebGL Context
56
+ </button>
57
+ </div>
58
+ </template>
59
+
60
+ <script setup>
61
+ import { useBlokkli } from "#imports";
62
+ import { FormToggle, FormRadio } from "#blokkli/components";
63
+ const { animation, debug, ui, dom } = useBlokkli();
64
+ const renderingModeOptions = [
65
+ { value: "auto", label: "Auto" },
66
+ { value: "webgl", label: "WebGL" },
67
+ { value: "2d", label: "2D Canvas" }
68
+ ];
69
+ let webglLoseContextExt = null;
70
+ function toggleTransforming() {
71
+ if (ui.isTransforming.value) {
72
+ ui.setTransform();
73
+ } else {
74
+ ui.setTransform("Transform plugin label");
75
+ }
76
+ }
77
+ function updateRenderingMode(value) {
78
+ if (value === "auto" || value === "webgl" || value === "2d") {
79
+ animation.preferredRenderingMode.value = value;
80
+ }
81
+ }
82
+ function loseContext() {
83
+ const gl = animation.getRawGL();
84
+ if (gl) {
85
+ webglLoseContextExt = gl.getExtension("WEBGL_lose_context");
86
+ if (webglLoseContextExt) {
87
+ webglLoseContextExt.loseContext();
88
+ }
89
+ }
90
+ }
91
+ function restoreContext() {
92
+ if (webglLoseContextExt) {
93
+ webglLoseContextExt.restoreContext();
94
+ }
95
+ }
96
+ </script>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -0,0 +1,25 @@
1
+ <template>
2
+ <div class="bk-debug-list">
3
+ <div>
4
+ <div>Count</div>
5
+ <div>{{ selection.uuids.value.length }}</div>
6
+ </div>
7
+ <div>
8
+ <div>isDragging</div>
9
+ <div>{{ selection.isDragging.value }}</div>
10
+ </div>
11
+ <div>
12
+ <div>isDraggingExisting</div>
13
+ <div>{{ selection.isDraggingExisting.value }}</div>
14
+ </div>
15
+ <div>
16
+ <div>Is multiselecting</div>
17
+ <div>{{ selection.isMultiSelecting.value }}</div>
18
+ </div>
19
+ </div>
20
+ </template>
21
+
22
+ <script setup>
23
+ import { useBlokkli } from "#imports";
24
+ const { selection } = useBlokkli();
25
+ </script>
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
+ export default _default;
@@ -1,11 +1,11 @@
1
1
  <template>
2
- <Renderer v-if="debug.isEnabled.value" :logger />
2
+ <DebugMain v-if="debug.isEnabled.value" :logger />
3
3
  </template>
4
4
 
5
5
  <script setup>
6
6
  import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
7
7
  import { defineBlokkliFeature, useBlokkli } from "#imports";
8
- import Renderer from "./Renderer.vue";
8
+ import DebugMain from "./Main.vue";
9
9
  const { logger } = defineBlokkliFeature({
10
10
  id: "debug",
11
11
  label: "Debug",
@@ -0,0 +1,113 @@
1
+ <template>
2
+ <div
3
+ ref="rootEl"
4
+ class="bk-dragging-overlay-item"
5
+ :class="{ 'bk-is-top': isTop, 'bk-is-fallback': !markup }"
6
+ :style="{
7
+ width: width + 'px',
8
+ height: height + 'px',
9
+ transformOrigin,
10
+ background,
11
+ '--bk-dragging-scale': to.scaleX,
12
+ '--bk-dragging-radius': Math.max(borderRadius ?? 0, 4)
13
+ }"
14
+ >
15
+ <div
16
+ v-if="markup"
17
+ ref="markupEl"
18
+ class="bk-dragging-overlay-markup"
19
+ v-html="markup"
20
+ />
21
+ <div v-else class="bk-dragging-overlay-fallback">
22
+ <div :style="{ transform: `scale(${1 / to.scaleX})` }">
23
+ <template v-if="isTop">
24
+ <ItemIcon v-if="bundle" :bundle="bundle" />
25
+ <Icon v-else-if="icon" :name="icon" />
26
+ <div v-if="label">{{ label }}</div>
27
+ </template>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </template>
32
+
33
+ <script setup>
34
+ import { ref, onMounted, useBlokkli, useTemplateRef } from "#imports";
35
+ import { Icon, ItemIcon } from "#blokkli/components";
36
+ import { lerp } from "#blokkli/helpers";
37
+ import { easeOutElastic } from "#blokkli/helpers/easing";
38
+ import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
39
+ const props = defineProps({
40
+ isTop: { type: Boolean, required: true },
41
+ from: { type: Object, required: true },
42
+ to: { type: Object, required: true },
43
+ width: { type: Number, required: true },
44
+ height: { type: Number, required: true },
45
+ transformOrigin: { type: String, required: true },
46
+ markup: { type: String, required: true },
47
+ background: { type: String, required: true },
48
+ bundle: { type: String, required: false },
49
+ icon: { type: null, required: false },
50
+ label: { type: String, required: false },
51
+ prevVisibility: { type: String, required: false },
52
+ element: { type: null, required: true }
53
+ });
54
+ const DURATION = 500;
55
+ const { ui, theme } = useBlokkli();
56
+ const rootEl = useTemplateRef("rootEl");
57
+ const markupEl = useTemplateRef("markupEl");
58
+ const borderRadius = ref(null);
59
+ let isDone = false;
60
+ let animationStart = 0;
61
+ function setBorderRadius() {
62
+ if (borderRadius.value !== null) {
63
+ return;
64
+ }
65
+ if (!props.isTop) {
66
+ borderRadius.value = 4;
67
+ return;
68
+ }
69
+ if (markupEl.value) {
70
+ const child = markupEl.value.firstChild;
71
+ if (child instanceof HTMLElement) {
72
+ const style = theme.getDraggableStyle(child);
73
+ borderRadius.value = style.radiusMin;
74
+ return;
75
+ }
76
+ }
77
+ borderRadius.value = 4;
78
+ }
79
+ onBlokkliEvent("canvas:draw", (e) => {
80
+ if (isDone || !rootEl.value) {
81
+ return;
82
+ }
83
+ if (!animationStart) {
84
+ animationStart = e.time;
85
+ }
86
+ setBorderRadius();
87
+ const elapsed = e.time - animationStart;
88
+ const alphaX = easeOutElastic(elapsed / DURATION, 1.92, 0.91);
89
+ const alphaY = easeOutElastic(elapsed / DURATION, 2.2, 0.76);
90
+ const opacityAlpha = Math.min(Math.max(elapsed - 300, 0) / 200, 1);
91
+ const from = props.from;
92
+ const to = props.to;
93
+ if (elapsed > DURATION || !ui.useAnimations.value || ui.lowPerformanceMode.value) {
94
+ rootEl.value.style.transform = `translate(${to.x}px, ${to.y}px) scale(${to.scaleX}, ${to.scaleY})`;
95
+ rootEl.value.style.opacity = String(to.opacity);
96
+ isDone = true;
97
+ return;
98
+ }
99
+ const newX = lerp(from.x, to.x, alphaX);
100
+ const newY = lerp(from.y, to.y, alphaY);
101
+ const newOpacity = lerp(from.opacity, to.opacity, opacityAlpha);
102
+ const newScaleX = lerp(from.scaleX, to.scaleX, alphaX);
103
+ const newScaleY = lerp(from.scaleY, to.scaleY, alphaY);
104
+ rootEl.value.style.transform = `translate(${newX}px, ${newY}px) scale(${newScaleX}, ${newScaleY})`;
105
+ rootEl.value.style.opacity = String(newOpacity);
106
+ });
107
+ onMounted(() => {
108
+ if (rootEl.value) {
109
+ rootEl.value.style.transform = `translate(${props.from.x}px, ${props.from.y}px) scale(${props.from.scaleX}, ${props.from.scaleY})`;
110
+ rootEl.value.style.opacity = String(props.from.opacity);
111
+ }
112
+ });
113
+ </script>
@@ -0,0 +1,25 @@
1
+ import type { BlokkliIcon } from '#blokkli-build/icons';
2
+ type AnimationRectangleValues = {
3
+ opacity: number;
4
+ scaleX: number;
5
+ scaleY: number;
6
+ x: number;
7
+ y: number;
8
+ };
9
+ export type DragItemData = {
10
+ isTop: boolean;
11
+ from: AnimationRectangleValues;
12
+ to: AnimationRectangleValues;
13
+ width: number;
14
+ height: number;
15
+ transformOrigin: string;
16
+ markup: string;
17
+ background: string;
18
+ bundle?: string;
19
+ icon?: BlokkliIcon;
20
+ label?: string;
21
+ prevVisibility?: string;
22
+ element: HTMLElement;
23
+ };
24
+ declare const _default: import("vue").DefineComponent<DragItemData, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DragItemData> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
25
+ export default _default;
@@ -2,52 +2,21 @@
2
2
  <div
3
3
  class="bk-vars bk-dragging-overlay"
4
4
  :style="style"
5
- :class="[{ 'bk-is-touch': isTouch }, { 'bk-is-active': !!activeLabel }]"
5
+ :class="[
6
+ { 'bk-is-touch': isTouch },
7
+ { 'bk-is-active': !!activeLabel },
8
+ { bk: !isExisting }
9
+ ]"
6
10
  >
7
- <BlokkliTransition name="drag-item">
8
- <div
9
- v-show="activeLabel"
10
- class="bk bk-dragging-overlay-label"
11
- :style="{ backgroundColor: currentActiveColor }"
12
- >
13
- <Icon name="cursor-move" />
14
- <p v-html="currentActiveLabel" />
15
- </div>
16
- </BlokkliTransition>
17
11
  <div
18
- v-for="(rect, i) in rects"
19
- :key="i"
20
- class="bk-dragging-overlay-item"
21
- :class="{ 'bk-is-top': rect.isTop, 'bk-is-fallback': !rect.markup }"
22
- :style="{
23
- width: rect.width + 'px',
24
- height: rect.height + 'px',
25
- transform: `translate(${rect.x}px, ${rect.y}px) scale(${rect.scaleX}, ${rect.scaleY})`,
26
- opacity: rect.opacity,
27
- background: rect.background,
28
- transformOrigin: rect.transformOrigin,
29
- borderRadius: rect.borderRadius
30
- }"
12
+ v-show="activeLabel"
13
+ class="bk bk-dragging-overlay-label"
14
+ :style="{ backgroundColor: currentActiveColor }"
31
15
  >
32
- <div
33
- v-if="rect.markup"
34
- class="bk-dragging-overlay-markup"
35
- v-html="rect.markup"
36
- />
37
- <div
38
- v-else
39
- class="bk-dragging-overlay-fallback"
40
- :style="{ color: rect.fallbackColor }"
41
- >
42
- <div :style="{ transform: `scale(${1 / rect.to.scaleX})` }">
43
- <template v-if="rect.isTop">
44
- <ItemIcon v-if="rect.bundle" :bundle="rect.bundle" />
45
- <Icon v-else-if="rect.icon" :name="rect.icon" />
46
- <div v-if="rect.label">{{ rect.label }}</div>
47
- </template>
48
- </div>
49
- </div>
16
+ <Icon name="cursor-move" />
17
+ <p v-html="currentActiveLabel" />
50
18
  </div>
19
+ <DragItem v-for="(rect, i) in rects" :key="i" v-bind="rect" />
51
20
  </div>
52
21
  </template>
53
22
 
@@ -60,23 +29,10 @@ import {
60
29
  onMounted,
61
30
  onBeforeUnmount
62
31
  } from "#imports";
63
- import {
64
- isInsideRect,
65
- realBackgroundColor,
66
- lerp,
67
- falsy
68
- } from "#blokkli/helpers";
69
- import { Icon, ItemIcon, BlokkliTransition } from "#blokkli/components";
70
- import { easeOutElastic } from "#blokkli/helpers/easing";
71
- import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
72
- const {
73
- dom,
74
- ui,
75
- animation,
76
- theme,
77
- types,
78
- element: elementProvider
79
- } = useBlokkli();
32
+ import { isInsideRect, realBackgroundColor, falsy } from "#blokkli/helpers";
33
+ import { Icon } from "#blokkli/components";
34
+ import DragItem, {} from "./DragItem.vue";
35
+ const { dom, ui, types } = useBlokkli();
80
36
  const props = defineProps({
81
37
  items: { type: Array, required: true },
82
38
  x: { type: Number, required: true },
@@ -86,6 +42,9 @@ const props = defineProps({
86
42
  activeColor: { type: String, required: false },
87
43
  activeLabel: { type: String, required: false }
88
44
  });
45
+ const isExisting = computed(
46
+ () => !!props.items.find((v) => v.itemType === "existing")
47
+ );
89
48
  const currentActiveLabel = ref("");
90
49
  const currentActiveColor = ref("");
91
50
  watch(
@@ -138,51 +97,6 @@ function getRect() {
138
97
  }
139
98
  defineExpose({ getRect });
140
99
  const rects = ref([]);
141
- const animationStart = Date.now();
142
- const duration = 500;
143
- const isDone = ref(false);
144
- onBlokkliEvent("animationFrame", () => {
145
- if (isDone.value) {
146
- return;
147
- }
148
- const newRects = [];
149
- const elapsed = Date.now() - animationStart;
150
- const alphaX = easeOutElastic(elapsed / duration, 1.92, 0.91);
151
- const alphaY = easeOutElastic(elapsed / duration, 2.2, 0.76);
152
- const opacityAlpha = Math.min(Math.max(elapsed - 300, 0) / 200, 1);
153
- for (let i = 0; i < rects.value.length; i++) {
154
- const rect = rects.value[i];
155
- const newX = lerp(rect.from.x, rect.to.x, alphaX);
156
- const newY = lerp(rect.from.y, rect.to.y, alphaY);
157
- const newOpacity = lerp(rect.from.opacity, rect.to.opacity, opacityAlpha);
158
- const newScaleX = lerp(rect.from.scaleX, rect.to.scaleX, alphaX);
159
- const newScaleY = lerp(rect.from.scaleY, rect.to.scaleY, alphaY);
160
- animation.requestDraw();
161
- newRects.push({
162
- ...rect,
163
- x: newX,
164
- y: newY,
165
- scaleX: newScaleX,
166
- scaleY: newScaleY,
167
- opacity: newOpacity
168
- });
169
- }
170
- if (elapsed > duration || !ui.useAnimations.value || ui.lowPerformanceMode.value) {
171
- rects.value = newRects.map((v) => {
172
- return {
173
- ...v,
174
- opacity: v.to.opacity,
175
- scaleX: v.to.scaleX,
176
- scaleY: v.to.scaleY,
177
- x: v.to.x,
178
- y: v.to.y
179
- };
180
- });
181
- isDone.value = true;
182
- return;
183
- }
184
- rects.value = newRects;
185
- });
186
100
  function getDraggingBounds(mouse, rect, maxWidth) {
187
101
  const aspectRatio = rect.width / rect.height;
188
102
  const effectiveWidth = Math.min(rect.width, maxWidth);
@@ -204,15 +118,10 @@ function getDraggingBounds(mouse, rect, maxWidth) {
204
118
  }
205
119
  onMounted(() => {
206
120
  const elRects = props.items.map((item, index) => {
207
- const itemElement = item.itemType === "existing" ? dom.getDragElement(item) : item.element();
208
- if (!itemElement) {
121
+ const element = item.itemType === "existing" ? dom.getDragElement(item) : item.element();
122
+ if (!element) {
209
123
  return;
210
124
  }
211
- const element = elementProvider.query(
212
- itemElement,
213
- ".bk-drop-element",
214
- "Find drop element for drag item."
215
- ) || itemElement;
216
125
  return {
217
126
  rect: element.getBoundingClientRect(),
218
127
  element,
@@ -230,7 +139,7 @@ onMounted(() => {
230
139
  props.startCoords,
231
140
  boundRect.rect,
232
141
  // Limit width to 250px
233
- 340
142
+ 351
234
143
  );
235
144
  const boundsX = props.isTouch ? 0 : bounds.x;
236
145
  const boundsY = props.isTouch ? translateY.value : bounds.y;
@@ -265,7 +174,6 @@ onMounted(() => {
265
174
  scaleX: targetScaleX,
266
175
  scaleY: targetScaleY
267
176
  };
268
- const style2 = theme.getDraggableStyle(element);
269
177
  const markup = (elRects.length < 6 || isTop) && !ui.lowPerformanceMode.value ? dom.getDropElementMarkup(item.item, true) : "";
270
178
  let bundle;
271
179
  let label = "";
@@ -284,19 +192,15 @@ onMounted(() => {
284
192
  isTop,
285
193
  from: ui.lowPerformanceMode.value ? to : from,
286
194
  to,
287
- ...from,
288
195
  width: item.element.offsetWidth,
289
196
  height: item.element.offsetHeight,
290
- opacity: 1,
291
197
  transformOrigin: `${originX}px ${originY}px`,
292
198
  markup,
293
- background: realBackgroundColor(item.element),
199
+ background: item.item.itemType === "existing" ? realBackgroundColor(item.element) : "",
294
200
  prevVisibility: item.item.itemType === "existing" || item.item.itemType === "existing_structure" ? item.element.style.visibility : void 0,
295
201
  element: item.element,
296
- borderRadius: style2.radiusString,
297
202
  bundle,
298
- label,
299
- fallbackColor: style2.textColor
203
+ label
300
204
  };
301
205
  }).filter(falsy);
302
206
  elRects.forEach((item) => {
@@ -0,0 +1,77 @@
1
+ #version 300 es
2
+
3
+ precision highp float;
4
+
5
+ in float v_intersecting;
6
+ in float v_is_hover_area;
7
+ in vec4 v_quad;
8
+ in vec3 v_color;
9
+
10
+ // Optimized varyings - values computed once per vertex instead of per pixel
11
+ in vec2 v_size;
12
+ in vec2 v_location;
13
+ in vec2 v_size_inner;
14
+ in float v_thickness;
15
+ in float v_edge_softness;
16
+ in float v_radius_outer;
17
+ in float v_radius_inner;
18
+ in float v_fill_alpha;
19
+
20
+ out vec4 fragColor;
21
+
22
+ uniform float u_scale;
23
+ uniform float u_dpi;
24
+ uniform vec2 u_resolution;
25
+ uniform float u_active_hover_nesting_level;
26
+
27
+ float roundedBoxSDF(vec2 CenterPosition, vec2 Size, float Radius) {
28
+ return length(max(abs(CenterPosition) - Size + Radius, 0.0)) - Radius;
29
+ }
30
+
31
+ void main() {
32
+ bool isHoverArea = v_is_hover_area >= 1.0;
33
+
34
+ // Compute different distance for inside and outside using pre-computed values
35
+ float distanceOuter = roundedBoxSDF(
36
+ v_location - gl_FragCoord.xy,
37
+ v_size / 2.0,
38
+ v_radius_outer
39
+ );
40
+ float distanceInner = roundedBoxSDF(
41
+ v_location - gl_FragCoord.xy,
42
+ v_size_inner / 2.0,
43
+ v_radius_inner
44
+ );
45
+
46
+ float alphaOuter =
47
+ 1.0 -
48
+ smoothstep(-v_edge_softness, v_edge_softness, distanceOuter - v_thickness);
49
+ float alphaInner =
50
+ 1.0 -
51
+ smoothstep(-v_edge_softness, v_edge_softness, distanceInner - v_thickness);
52
+
53
+ // Alpha value for the border.
54
+ float alphaBorder = clamp(alphaOuter - alphaInner, 0.0, 1.0);
55
+
56
+ float adjustedAlphaFill = alphaInner * v_fill_alpha;
57
+
58
+ if (v_is_hover_area >= 1.0) {
59
+ // If nesting level is 0, don't render the fill (border only)
60
+ if (u_active_hover_nesting_level < 0.5) {
61
+ adjustedAlphaFill = 0.0;
62
+ } else {
63
+ adjustedAlphaFill *= 0.5;
64
+ }
65
+ }
66
+
67
+ if (alphaBorder > 0.0) {
68
+ float a = isHoverArea ? 0.6 : 1.0;
69
+ fragColor = vec4(v_color, a);
70
+ return;
71
+ } else if (adjustedAlphaFill > 0.0) {
72
+ fragColor = vec4(v_color, adjustedAlphaFill);
73
+ return;
74
+ }
75
+
76
+ discard;
77
+ }