@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
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Teleport to="body">
2
+ <Teleport :to="ui.mainLayoutElement.value">
3
3
  <ViewportBlockingRect id="tour-popup" class="bk bk-tour-popup">
4
4
  <div class="bk-tour-popup-title">
5
5
  <h2>{{ $t("tourLabel", "Take a tour") }}</h2>
@@ -29,6 +29,6 @@
29
29
  <script setup>
30
30
  import { Icon, ViewportBlockingRect } from "#blokkli/components";
31
31
  import { useBlokkli } from "#imports";
32
- const { $t } = useBlokkli();
32
+ const { $t, ui } = useBlokkli();
33
33
  defineEmits(["start", "close"]);
34
34
  </script>
@@ -1,22 +1,13 @@
1
1
  <template>
2
2
  <Overlay v-if="tour.isTouring.value" @close="close" />
3
- <PluginMenuButton
4
- id="tour"
5
- :title="$t('tourLabel', 'Take a tour')"
6
- :description="$t('tourDescription', 'Explore the features of the editor')"
7
- icon="tutor"
8
- secondary
9
- :weight="-10"
10
- @click="start"
11
- />
12
3
  <Popup v-if="showTourPopup" @close="close" @start="start" />
13
4
  </template>
14
5
 
15
6
  <script setup>
16
7
  import { defineBlokkliFeature, useBlokkli } from "#imports";
17
8
  import Overlay from "./Overlay/index.vue";
18
- import { PluginMenuButton } from "#blokkli/plugins";
19
9
  import Popup from "./Popup/index.vue";
10
+ import defineMenuButton from "#blokkli/helpers/composables/defineMenuButton";
20
11
  defineBlokkliFeature({
21
12
  id: "tour",
22
13
  label: "Tour",
@@ -33,6 +24,17 @@ const close = () => {
33
24
  showTourPopup.value = false;
34
25
  tour.isTouring.value = false;
35
26
  };
27
+ defineMenuButton(() => {
28
+ return {
29
+ id: "tour",
30
+ title: $t("tourLabel", "Take a tour"),
31
+ description: $t("tourDescription", "Explore the features of the editor"),
32
+ icon: "tutor",
33
+ secondary: true,
34
+ weight: -10,
35
+ callback: start
36
+ };
37
+ });
36
38
  </script>
37
39
 
38
40
  <script>
@@ -38,14 +38,14 @@
38
38
  }"
39
39
  @click.prevent="onClickPreview"
40
40
  >
41
- {{ $t("transformDialogButtonPreview", "Preview") }}
41
+ {{ $t("transformDialogButtonPreview", "New suggestion") }}
42
42
  </button>
43
43
  <button
44
44
  class="bk-button bk-is-orange"
45
45
  :disabled
46
46
  @click.prevent="onClickSubmit"
47
47
  >
48
- {{ $t("transformDialogButtonApply", "Apply") }}
48
+ {{ $t("transformDialogButtonApply", "Apply changes") }}
49
49
  </button>
50
50
  </footer>
51
51
  </div>
@@ -183,10 +183,10 @@ onMounted(async () => {
183
183
  ui.hasTransformOverlayOpen.value = true;
184
184
  selection.lockSelection("transform-dialog");
185
185
  if (hasSeedInput.value && supportsPreview.value) {
186
- const hasOnlySeedInputs = props.plugin.configInputs?.every(
187
- (v) => v.type === "seed"
186
+ const hasNoRequiredInput = props.plugin.configInputs?.every(
187
+ (v) => v.type === "seed" || !v.required
188
188
  );
189
- if (hasOnlySeedInputs === true) {
189
+ if (hasNoRequiredInput === true) {
190
190
  await onClickPreview();
191
191
  }
192
192
  }
@@ -1,26 +1,5 @@
1
1
  <template>
2
- <PluginItemDropdown
3
- id="transform"
4
- :title="$t('transformTo', 'Actions')"
5
- :enabled="!!possibleTransforms.length"
6
- :items="possibleTransforms"
7
- icon="script"
8
- weight="100"
9
- @select="onSelectBlockTransformPlugin($event, selection.uuids.value)"
10
- />
11
-
12
- <PluginItemDropdown
13
- v-if="hostPlugins.length"
14
- id="transform-host"
15
- :title="$t('transformTo', 'Actions')"
16
- :enabled="selection.hasHostSelected.value"
17
- :items="hostPlugins"
18
- icon="script"
19
- weight="100"
20
- @select="onSelectHostTransformPlugin($event)"
21
- />
22
-
23
- <Teleport to="body">
2
+ <Teleport :to="ui.mainLayoutElement.value">
24
3
  <BlokkliTransition name="transform-overlay">
25
4
  <TransformDialog
26
5
  v-if="openPluginDefinition"
@@ -42,10 +21,10 @@ import {
42
21
  defineBlokkliFeature,
43
22
  useLazyAsyncData
44
23
  } from "#imports";
45
- import { PluginItemDropdown } from "#blokkli/plugins";
46
24
  import { BlokkliTransition } from "#blokkli/components";
47
25
  import { filterTransforms } from "#blokkli/helpers/transform";
48
26
  import defineCommands from "#blokkli/helpers/composables/defineCommands";
27
+ import defineItemDropdownAction from "#blokkli/helpers/composables/defineItemDropdownAction";
49
28
  import TransformDialog from "./Dialog/index.vue";
50
29
  const { adapter } = defineBlokkliFeature({
51
30
  id: "transform",
@@ -218,6 +197,34 @@ defineCommands(
218
197
  }
219
198
  }))
220
199
  );
200
+ defineItemDropdownAction(() => {
201
+ if (possibleTransforms.value.length) {
202
+ return possibleTransforms.value.map((transform) => ({
203
+ id: "transform-block-" + transform.id,
204
+ label: transform.label,
205
+ icon: "script",
206
+ group: "transform",
207
+ weight: 100,
208
+ callback: () => {
209
+ onSelectBlockTransformPlugin(transform, selection.uuids.value);
210
+ }
211
+ }));
212
+ }
213
+ });
214
+ defineItemDropdownAction(() => {
215
+ if (selection.hasHostSelected.value && hostPlugins.value && hostPlugins.value.length) {
216
+ return hostPlugins.value.map((plugin) => ({
217
+ id: "transform-host-" + plugin.id,
218
+ label: plugin.label,
219
+ icon: "script",
220
+ group: "transform",
221
+ weight: 100,
222
+ callback: () => {
223
+ onSelectHostTransformPlugin(plugin);
224
+ }
225
+ }));
226
+ }
227
+ });
221
228
  </script>
222
229
 
223
230
  <script>
@@ -52,18 +52,6 @@
52
52
  <Banner v-if="isTranslating" :active-language />
53
53
  </Teleport>
54
54
 
55
- <PluginMenuButton
56
- id="translations"
57
- :title="$t('translationsBatchTranslateMenuTitle', 'Translate...')"
58
- :description="
59
- $t('translationsBatchTranslateMenuDescription', 'Translate all blocks')
60
- "
61
- :disabled="!isTranslating"
62
- :weight="60"
63
- icon="translate"
64
- @click="eventBus.emit('batchTranslate')"
65
- />
66
-
67
55
  <PluginItemAction
68
56
  v-if="isTranslating"
69
57
  id="translate"
@@ -84,13 +72,10 @@ import {
84
72
  onMounted
85
73
  } from "#imports";
86
74
  import { falsy } from "#blokkli/helpers";
87
- import {
88
- PluginMenuButton,
89
- PluginItemAction,
90
- PluginTourItem
91
- } from "#blokkli/plugins";
75
+ import { PluginItemAction, PluginTourItem } from "#blokkli/plugins";
92
76
  import Banner from "./Banner/index.vue";
93
77
  import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
78
+ import defineMenuButton from "#blokkli/helpers/composables/defineMenuButton";
94
79
  const { adapter } = defineBlokkliFeature({
95
80
  id: "translations",
96
81
  label: "Translations",
@@ -202,6 +187,22 @@ onMounted(() => {
202
187
  }
203
188
  }
204
189
  });
190
+ defineMenuButton(() => {
191
+ return {
192
+ id: "translations",
193
+ title: $t("translationsBatchTranslateMenuTitle", "Translate..."),
194
+ description: $t(
195
+ "translationsBatchTranslateMenuDescription",
196
+ "Translate all blocks"
197
+ ),
198
+ icon: "translate",
199
+ disabled: !isTranslating.value,
200
+ weight: 60,
201
+ callback: () => {
202
+ eventBus.emit("batchTranslate");
203
+ }
204
+ };
205
+ });
205
206
  </script>
206
207
 
207
208
  <script>
@@ -0,0 +1,43 @@
1
+ <template>
2
+ <div>
3
+ <div class="bk-form-label">
4
+ {{ label }}<span v-if="required" class="bk-required-indicator">*</span>
5
+ </div>
6
+ <div>
7
+ <label v-for="option in options" :key="option.value" class="bk-checkbox">
8
+ <input
9
+ :checked="isChecked(option.value)"
10
+ type="checkbox"
11
+ :value="option.value"
12
+ :required
13
+ :disabled
14
+ @change="toggleValue(option.value)"
15
+ />
16
+ <span>{{ option.label }}</span>
17
+ </label>
18
+ </div>
19
+ <div v-if="description" class="bk-form-description">{{ description }}</div>
20
+ </div>
21
+ </template>
22
+
23
+ <script setup>
24
+ defineProps({
25
+ id: { type: String, required: true },
26
+ label: { type: String, required: true },
27
+ options: { type: Array, required: true },
28
+ required: { type: Boolean, required: false },
29
+ disabled: { type: Boolean, required: false },
30
+ description: { type: String, required: false }
31
+ });
32
+ const value = defineModel({ type: Array, ...{ default: [] } });
33
+ function isChecked(optionValue) {
34
+ return value.value.includes(optionValue);
35
+ }
36
+ function toggleValue(optionValue) {
37
+ if (value.value.includes(optionValue)) {
38
+ value.value = value.value.filter((v) => v !== optionValue);
39
+ } else {
40
+ value.value = [...value.value, optionValue];
41
+ }
42
+ }
43
+ </script>
@@ -0,0 +1,20 @@
1
+ type __VLS_Props = {
2
+ id: string;
3
+ label: string;
4
+ options: {
5
+ value: string;
6
+ label: string;
7
+ }[];
8
+ required?: boolean;
9
+ disabled?: boolean;
10
+ description?: string;
11
+ };
12
+ type __VLS_PublicProps = __VLS_Props & {
13
+ modelValue?: string[];
14
+ };
15
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
16
+ "update:modelValue": (value: string[]) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
18
+ "onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ export default _default;
@@ -6,7 +6,6 @@
6
6
  @keyup.stop
7
7
  @keydown.stop
8
8
  >
9
- <div class="bk bk-form-overlay-background bk-overlay" />
10
9
  <Resizable :id="id" class="bk-form-overlay-resizable">
11
10
  <FormHeader
12
11
  :bundle="bundle"
@@ -27,16 +26,26 @@
27
26
  <script setup>
28
27
  import FormHeader from "./Header/index.vue";
29
28
  import { Resizable } from "#blokkli/components";
30
- defineProps({
29
+ import { onBeforeUnmount, onMounted, useBlokkli } from "#imports";
30
+ import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
31
+ const props = defineProps({
31
32
  id: { type: String, required: true },
32
33
  bundle: { type: String, required: false },
33
34
  icon: { type: null, required: false },
34
35
  title: { type: String, required: true }
35
36
  });
37
+ const { ui } = useBlokkli();
36
38
  const emit = defineEmits(["close"]);
37
- const onClose = () => {
39
+ function onClose() {
38
40
  emit("close");
39
- };
41
+ }
42
+ onBlokkliEvent("overlay:close", onClose);
43
+ onMounted(() => {
44
+ ui.openDialog({ id: props.id, alignment: "right" });
45
+ });
46
+ onBeforeUnmount(() => {
47
+ ui.closeDialog(props.id);
48
+ });
40
49
  </script>
41
50
 
42
51
  <script>
@@ -0,0 +1,41 @@
1
+ <template>
2
+ <div
3
+ class="bk-item-icon"
4
+ :class="[
5
+ 'bk-is-' + mappedColor,
6
+ {
7
+ 'bk-is-small': isSmall
8
+ }
9
+ ]"
10
+ >
11
+ <Icon v-if="icon" :name="icon" />
12
+ <ItemIcon v-else-if="bundle" :bundle />
13
+ </div>
14
+ </template>
15
+
16
+ <script setup>
17
+ import { ItemIcon, Icon } from "#blokkli/components";
18
+ import {
19
+ BUNDLE_BLOKKLI_FRAGMENT,
20
+ BUNDLE_FROM_LIBRARY
21
+ } from "#blokkli/constants";
22
+ import { computed } from "#imports";
23
+ const props = defineProps({
24
+ icon: { type: null, required: false, default: void 0 },
25
+ bundle: { type: String, required: false, default: void 0 },
26
+ color: { type: String, required: false, default: void 0 },
27
+ isSmall: { type: Boolean, required: false, default: false }
28
+ });
29
+ const mappedColor = computed(() => {
30
+ if (props.color) {
31
+ return props.color;
32
+ } else if (props.bundle) {
33
+ if (props.bundle === BUNDLE_BLOKKLI_FRAGMENT) {
34
+ return "accent";
35
+ } else if (props.bundle === BUNDLE_FROM_LIBRARY) {
36
+ return "lime";
37
+ }
38
+ }
39
+ return "default";
40
+ });
41
+ </script>
@@ -1,15 +1,15 @@
1
1
  import type { BlokkliIcon } from '#blokkli-build/icons';
2
- import type { AddListOrientation } from '#blokkli/types';
2
+ type ItemColor = 'rose' | 'lime' | 'default' | 'yellow' | 'accent';
3
3
  type __VLS_Props = {
4
4
  icon?: BlokkliIcon;
5
5
  bundle?: string;
6
- color?: 'rose' | 'lime' | 'default' | 'yellow' | 'accent';
7
- orientation?: AddListOrientation;
6
+ color?: ItemColor;
7
+ isSmall?: boolean;
8
8
  };
9
9
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
10
10
  bundle: string;
11
11
  icon: BlokkliIcon;
12
- color: "rose" | "lime" | "default" | "yellow" | "accent";
13
- orientation: AddListOrientation;
12
+ color: ItemColor;
13
+ isSmall: boolean;
14
14
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
15
  export default _default;
@@ -5,7 +5,6 @@
5
5
  '--bk-bg': background
6
6
  }"
7
7
  >
8
- <div class="bk-dialog-background" />
9
8
  <div class="bk-konami-game bk-slide-up-inner">
10
9
  <div class="bk-konami-game-canvas">
11
10
  <canvas
@@ -1,9 +1,7 @@
1
1
  <template>
2
- <Teleport to="body">
3
- <BlokkliTransition name="slide-up">
4
- <Game v-if="isEnabled" @close="isEnabled = false" />
5
- </BlokkliTransition>
6
- </Teleport>
2
+ <BlokkliTransition name="slide-up">
3
+ <Game v-if="isEnabled" @close="isEnabled = false" />
4
+ </BlokkliTransition>
7
5
  </template>
8
6
 
9
7
  <script setup>
@@ -26,9 +26,10 @@
26
26
  </div>
27
27
  <Teleport
28
28
  v-if="additional && additional instanceof Error && showDetails"
29
- to="body"
29
+ :to="ui.mainLayoutElement.value"
30
30
  >
31
31
  <DialogModal
32
+ id="messages-error-details"
32
33
  title="Error Details"
33
34
  hide-buttons
34
35
  width="100%"
@@ -48,13 +49,21 @@
48
49
  </template>
49
50
 
50
51
  <script setup>
51
- import { ref, onMounted, onBeforeUnmount, computed, watch } from "#imports";
52
+ import {
53
+ ref,
54
+ onMounted,
55
+ onBeforeUnmount,
56
+ computed,
57
+ watch,
58
+ useBlokkli
59
+ } from "#imports";
52
60
  import { Icon, DialogModal } from "#blokkli/components";
53
61
  const props = defineProps({
54
62
  type: { type: String, required: true },
55
63
  message: { type: String, required: true },
56
64
  additional: { type: null, required: false }
57
65
  });
66
+ const { ui } = useBlokkli();
58
67
  const emit = defineEmits(["close"]);
59
68
  const hasTimer = ref(true);
60
69
  const showDetails = ref(false);
@@ -1,5 +1,5 @@
1
1
  type __VLS_Props = {
2
- type: 'success' | 'error';
2
+ type: 'success' | 'error' | 'warning';
3
3
  message: string;
4
4
  additional?: string | Error | unknown;
5
5
  };
@@ -16,7 +16,12 @@ import { ref, useBlokkli } from "#imports";
16
16
  import Item from "./Item/index.vue";
17
17
  import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
18
18
  const { ui } = useBlokkli();
19
- const messages = ref([]);
19
+ const messages = ref([
20
+ // {
21
+ // type: 'success',
22
+ // message: 'Foobar this is just a message',
23
+ // },
24
+ ]);
20
25
  function removeMessage(index) {
21
26
  messages.value = messages.value.filter((_v, i) => i !== index);
22
27
  }
@@ -0,0 +1,66 @@
1
+ <template>
2
+ <BlokkliTransition name="fade">
3
+ <div
4
+ v-if="isVisible"
5
+ class="bk bk-overlay"
6
+ @click.prevent.stop.capture="onClick"
7
+ @dblclick.prevent="onDoubleClick"
8
+ @wheel.capture.stop.prevent
9
+ @pointerdown.capture.stop.prevent
10
+ @pointermove.capture.stop.prevent
11
+ @touchstart.capture.stop.prevent
12
+ @touchmove.capture.stop.prevent
13
+ @touchend.capture.stop.prevent
14
+ >
15
+ <div
16
+ v-if="showDoubleClickInfo"
17
+ :class="{
18
+ 'bk-is-left': alignment === 'right' || alignment === 'center',
19
+ 'bk-is-right': alignment === 'left'
20
+ }"
21
+ >
22
+ <Icon name="click" />
23
+ <div v-html="infoText" />
24
+ </div>
25
+ </div>
26
+ </BlokkliTransition>
27
+ </template>
28
+
29
+ <script setup>
30
+ import { BlokkliTransition, Icon } from "#blokkli/components";
31
+ import { computed, useBlokkli, ref, watch } from "#imports";
32
+ const { ui, eventBus, $t } = useBlokkli();
33
+ let clickTimeout = null;
34
+ const showDoubleClickInfo = ref(false);
35
+ const alignment = computed(() => ui.currentDialog.value?.alignment);
36
+ const infoText = computed(
37
+ () => $t(
38
+ "overlayDoubleClickInfo",
39
+ "<strong>Double click</strong> to close overlay"
40
+ )
41
+ );
42
+ function onClick() {
43
+ if (clickTimeout) {
44
+ return;
45
+ }
46
+ clickTimeout = window.setTimeout(() => {
47
+ showDoubleClickInfo.value = true;
48
+ }, 500);
49
+ }
50
+ const isVisible = computed(() => ui.hasDialogOpen.value);
51
+ watch(isVisible, () => {
52
+ if (clickTimeout) {
53
+ window.clearTimeout(clickTimeout);
54
+ clickTimeout = null;
55
+ }
56
+ showDoubleClickInfo.value = false;
57
+ });
58
+ function onDoubleClick() {
59
+ if (clickTimeout) {
60
+ window.clearTimeout(clickTimeout);
61
+ clickTimeout = null;
62
+ }
63
+ eventBus.emit("overlay:close");
64
+ showDoubleClickInfo.value = false;
65
+ }
66
+ </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;
@@ -124,7 +124,7 @@ const onWheel = (e) => {
124
124
  };
125
125
  const isInIframe = () => window.parent !== window;
126
126
  const onFocusItem = (uuid) => {
127
- const el = document.querySelector(`[data-uuid="${uuid}"]`);
127
+ const el = document.querySelector(`[data-bk-uuid="${uuid}"]`);
128
128
  if (el) {
129
129
  const elRect = el.getBoundingClientRect();
130
130
  if (!intersects(elRect, {
@@ -10,14 +10,11 @@
10
10
 
11
11
  <script setup>
12
12
  import { useBlokkli } from "#imports";
13
- import {
14
- buildDraggableItem,
15
- getDistance,
16
- getInteractionCoordinates
17
- } from "#blokkli/helpers";
13
+ import { getDistance, getInteractionCoordinates } from "#blokkli/helpers";
18
14
  const { eventBus } = useBlokkli();
19
15
  const props = defineProps({
20
- getDragItems: { type: Function, required: false }
16
+ getDragItems: { type: Function, required: false },
17
+ buildItem: { type: Function, required: true }
21
18
  });
22
19
  let pointerStartCoords = null;
23
20
  let activeItem = null;
@@ -31,10 +28,10 @@ function onPointerDown(e) {
31
28
  }
32
29
  pointerStartCoords = getInteractionCoordinates(e);
33
30
  const sortliItem = e.target.closest("[data-sortli-id]");
34
- if (!sortliItem) {
31
+ if (!(sortliItem instanceof HTMLElement)) {
35
32
  return;
36
33
  }
37
- const item = buildDraggableItem(sortliItem);
34
+ const item = props.buildItem(sortliItem);
38
35
  if (!item) {
39
36
  return;
40
37
  }
@@ -1,8 +1,10 @@
1
1
  import type { DraggableItem } from '#blokkli/types';
2
2
  declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
3
3
  getDragItems?: (activeItem?: DraggableItem) => DraggableItem[] | null;
4
+ buildItem: (el: HTMLElement) => DraggableItem | null | undefined;
4
5
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
5
6
  getDragItems?: (activeItem?: DraggableItem) => DraggableItem[] | null;
7
+ buildItem: (el: HTMLElement) => DraggableItem | null | undefined;
6
8
  }> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
7
9
  default?: (props: {}) => any;
8
10
  }>;