@blokkli/editor 2.0.0-alpha.12 → 2.0.0-alpha.14

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 (274) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.json +5 -5
  3. package/dist/module.mjs +4006 -1164
  4. package/dist/modules/drupal/graphql/base/fragment.ParagraphsBlokkliConfigInput.graphql +31 -0
  5. package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +1 -0
  6. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +1 -0
  7. package/dist/modules/drupal/graphql/base/query.pbEntityConfig.graphql +5 -0
  8. package/dist/modules/drupal/graphql/features/transform.graphql +9 -1
  9. package/dist/modules/drupal/graphql/features/transform_host.graphql +38 -0
  10. package/dist/modules/drupal/graphql/mutations/update_host_options.graphql +15 -0
  11. package/dist/modules/drupal/index.d.mts +1 -1
  12. package/dist/modules/drupal/index.mjs +20 -7
  13. package/dist/modules/drupal/runtime/adapter/index.js +109 -4
  14. package/dist/runtime/adapter/index.d.ts +54 -1
  15. package/dist/runtime/blokkliPlugins/AddAction/index.vue +27 -3
  16. package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue +65 -0
  17. package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +26 -0
  18. package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +3 -0
  19. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +3 -2
  20. package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +3 -3
  21. package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +49 -11
  22. package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +29 -15
  23. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -7
  24. package/dist/runtime/blokkliPlugins/Sidebar/index.vue +2 -9
  25. package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +4 -4
  26. package/dist/runtime/blokkliPlugins/ViewOption/index.vue +6 -3
  27. package/dist/runtime/blokkliPlugins/index.d.ts +8 -7
  28. package/dist/runtime/blokkliPlugins/index.js +15 -13
  29. package/dist/runtime/components/Blocks/Fragment/icon.svg +1 -1
  30. package/dist/runtime/components/BlokkliProvider.vue +1 -0
  31. package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -0
  32. package/dist/runtime/components/Edit/Actions/index.vue +39 -67
  33. package/dist/runtime/components/Edit/AddListItem/index.vue +2 -5
  34. package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +1 -1
  35. package/dist/runtime/components/Edit/AddListItemIcon/index.vue +19 -0
  36. package/dist/runtime/components/Edit/AddListItemIcon/index.vue.d.ts +15 -0
  37. package/dist/runtime/components/Edit/AppMenu/index.vue +5 -5
  38. package/dist/runtime/components/Edit/Dialog/index.vue +5 -1
  39. package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +1 -1
  40. package/dist/runtime/components/Edit/DiffViewer/State.vue +276 -0
  41. package/dist/runtime/components/Edit/DiffViewer/State.vue.d.ts +16 -0
  42. package/dist/runtime/components/Edit/DragInteractions/index.vue +45 -8
  43. package/dist/runtime/components/Edit/EditProvider.vue +46 -35
  44. package/dist/runtime/components/Edit/Features/AddList/index.vue +15 -25
  45. package/dist/runtime/components/Edit/Features/Analyze/Overlay/fragment.glsl +58 -0
  46. package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +168 -0
  47. package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue.d.ts +9 -0
  48. package/dist/runtime/components/Edit/Features/Analyze/Overlay/vertex.glsl +72 -0
  49. package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue +159 -0
  50. package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue.d.ts +7 -0
  51. package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +100 -0
  52. package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +6 -0
  53. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +56 -0
  54. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +3 -0
  55. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +87 -0
  56. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +7 -0
  57. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +101 -0
  58. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +8 -0
  59. package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue +18 -0
  60. package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue.d.ts +8 -0
  61. package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +92 -0
  62. package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue.d.ts +17 -0
  63. package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue +77 -0
  64. package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue.d.ts +6 -0
  65. package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.d.ts +12 -0
  66. package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +75 -0
  67. package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.d.ts +4 -0
  68. package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.js +5 -0
  69. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +32 -0
  70. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +45 -0
  71. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.d.ts +5 -0
  72. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.js +95 -0
  73. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.d.ts +3 -0
  74. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.js +13 -0
  75. package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.d.ts +2 -0
  76. package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.js +2 -0
  77. package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.d.ts +2 -0
  78. package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +165 -0
  79. package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +44 -0
  80. package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.js +0 -0
  81. package/dist/runtime/components/Edit/Features/Analyze/helper.d.ts +5 -0
  82. package/dist/runtime/components/Edit/Features/Analyze/helper.js +28 -0
  83. package/dist/runtime/components/Edit/Features/Analyze/index.vue +44 -0
  84. package/dist/runtime/components/Edit/Features/Anchors/Renderer.vue +136 -0
  85. package/dist/runtime/components/Edit/Features/Anchors/index.vue +32 -0
  86. package/dist/runtime/components/Edit/Features/Anchors/index.vue.d.ts +2 -0
  87. package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +25 -13
  88. package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +296 -0
  89. package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue.d.ts +7 -0
  90. package/dist/runtime/components/Edit/Features/Artboard/index.vue +10 -245
  91. package/dist/runtime/components/Edit/Features/Assistant/index.vue +3 -2
  92. package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +4 -4
  93. package/dist/runtime/components/Edit/Features/Clipboard/index.vue +161 -28
  94. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +16 -4
  95. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue.d.ts +0 -1
  96. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +4 -53
  97. package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +3 -2
  98. package/dist/runtime/components/Edit/Features/Conversions/index.vue +12 -14
  99. package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +14 -0
  100. package/dist/runtime/components/Edit/Features/Debug/index.vue +27 -24
  101. package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +13 -190
  102. package/dist/runtime/components/Edit/Features/Diff/index.vue +2 -2
  103. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +4 -4
  104. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +1 -1
  105. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +35 -71
  106. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +1 -1
  107. package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +62 -48
  108. package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +3 -3
  109. package/dist/runtime/components/Edit/Features/EditForm/index.vue +3 -3
  110. package/dist/runtime/components/Edit/Features/EditableField/index.vue +6 -2
  111. package/dist/runtime/components/Edit/Features/EditableMask/index.vue +3 -20
  112. package/dist/runtime/components/Edit/Features/Fragments/index.vue +3 -2
  113. package/dist/runtime/components/Edit/Features/History/index.vue +35 -12
  114. package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +6 -2
  115. package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +3 -2
  116. package/dist/runtime/components/Edit/Features/Library/index.vue +11 -9
  117. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +5 -8
  118. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/fragment.glsl +1 -1
  119. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +9 -4
  120. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/vertex.glsl +1 -1
  121. package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +8 -14
  122. package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +3 -2
  123. package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue.d.ts +2 -0
  124. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +9 -3
  125. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +0 -1
  126. package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +37 -19
  127. package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue.d.ts +8 -2
  128. package/dist/runtime/components/Edit/Features/Options/Form/index.vue +81 -37
  129. package/dist/runtime/components/Edit/Features/Options/Form/index.vue.d.ts +5 -5
  130. package/dist/runtime/components/Edit/Features/Options/index.vue +30 -6
  131. package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -3
  132. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +1 -0
  133. package/dist/runtime/components/Edit/Features/Publish/index.vue +3 -2
  134. package/dist/runtime/components/Edit/Features/Revert/index.vue +3 -3
  135. package/dist/runtime/components/Edit/Features/Search/index.vue +3 -2
  136. package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue +54 -0
  137. package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue.d.ts +14 -0
  138. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +120 -0
  139. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +15 -0
  140. package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +459 -0
  141. package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue.d.ts +6 -0
  142. package/dist/runtime/components/Edit/Features/Selection/Overlay/fragment.glsl +15 -10
  143. package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +32 -11
  144. package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +1 -1
  145. package/dist/runtime/components/Edit/Features/Selection/index.vue +76 -7
  146. package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +12 -17
  147. package/dist/runtime/components/Edit/Features/Settings/index.vue +11 -25
  148. package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +5 -1
  149. package/dist/runtime/components/Edit/Features/Theme/index.vue +2 -1
  150. package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +3 -2
  151. package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +198 -0
  152. package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue.d.ts +13 -0
  153. package/dist/runtime/components/Edit/Features/Transform/index.vue +155 -44
  154. package/dist/runtime/components/Edit/Form/Radio/index.vue +33 -0
  155. package/dist/runtime/components/Edit/Form/Radio/index.vue.d.ts +20 -0
  156. package/dist/runtime/components/Edit/Form/RadioTabs/index.vue +37 -0
  157. package/dist/runtime/components/Edit/Form/RadioTabs/index.vue.d.ts +22 -0
  158. package/dist/runtime/components/Edit/Form/Select/index.vue +29 -0
  159. package/dist/runtime/components/Edit/Form/Select/index.vue.d.ts +20 -0
  160. package/dist/runtime/components/Edit/Form/Text/index.vue +33 -0
  161. package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +19 -0
  162. package/dist/runtime/components/Edit/Form/Textarea/index.vue +13 -6
  163. package/dist/runtime/components/Edit/Form/Textarea/index.vue.d.ts +4 -0
  164. package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
  165. package/dist/runtime/components/Edit/Indicators/index.vue +123 -0
  166. package/dist/runtime/components/Edit/Indicators/index.vue.d.ts +2 -0
  167. package/dist/runtime/components/Edit/ItemIcon/index.vue +2 -1
  168. package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue +66 -0
  169. package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue.d.ts +7 -0
  170. package/dist/runtime/components/Edit/Konami/Game/blokkli.png +0 -0
  171. package/dist/runtime/components/Edit/Konami/Game/charmap.d.ts +2 -0
  172. package/dist/runtime/components/Edit/Konami/Game/charmap.js +168 -0
  173. package/dist/runtime/components/Edit/Konami/Game/index.vue +745 -0
  174. package/dist/runtime/components/Edit/Konami/Game/index.vue.d.ts +6 -0
  175. package/dist/runtime/components/Edit/Konami/Game/textRendering.d.ts +8 -0
  176. package/dist/runtime/components/Edit/Konami/Game/textRendering.js +138 -0
  177. package/dist/runtime/components/Edit/Konami/Game/useIconRendering.d.ts +9 -0
  178. package/dist/runtime/components/Edit/Konami/Game/useIconRendering.js +130 -0
  179. package/dist/runtime/components/Edit/Konami/index.vue +44 -0
  180. package/dist/runtime/components/Edit/Konami/index.vue.d.ts +2 -0
  181. package/dist/runtime/components/Edit/Loading/index.vue +6 -2
  182. package/dist/runtime/components/Edit/Loading/index.vue.d.ts +2 -0
  183. package/dist/runtime/components/Edit/Messages/index.vue +8 -3
  184. package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue +17 -0
  185. package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue.d.ts +11 -0
  186. package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue +37 -0
  187. package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue.d.ts +11 -0
  188. package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue +43 -0
  189. package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue.d.ts +11 -0
  190. package/dist/runtime/components/Edit/PluginConfigForm/index.vue +57 -0
  191. package/dist/runtime/components/Edit/PluginConfigForm/index.vue.d.ts +16 -0
  192. package/dist/runtime/components/Edit/PreviewProvider.vue +3 -4
  193. package/dist/runtime/components/Edit/RelativeTime/index.vue +3 -2
  194. package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +8 -3
  195. package/dist/runtime/components/Edit/SystemRequirements/index.vue +3 -3
  196. package/dist/runtime/components/Edit/Toolbar/index.vue +3 -2
  197. package/dist/runtime/components/Edit/Transition/index.vue +41 -0
  198. package/dist/runtime/components/Edit/Transition/index.vue.d.ts +19 -0
  199. package/dist/runtime/components/Edit/index.d.ts +23 -15
  200. package/dist/runtime/components/Edit/index.js +44 -28
  201. package/dist/runtime/composables/defineBlokkli.js +7 -3
  202. package/dist/runtime/composables/defineBlokkliFeature.d.ts +4 -7
  203. package/dist/runtime/composables/defineBlokkliProvider.d.ts +11 -0
  204. package/dist/runtime/composables/defineBlokkliProvider.js +46 -0
  205. package/dist/runtime/composables/useBlokkliHelper.js +1 -1
  206. package/dist/runtime/constants/index.d.ts +3 -0
  207. package/dist/runtime/constants/index.js +3 -0
  208. package/dist/runtime/css/output.css +1 -1
  209. package/dist/runtime/helpers/addElementClasses.d.ts +2 -0
  210. package/dist/runtime/helpers/addElementClasses.js +24 -0
  211. package/dist/runtime/helpers/animationProvider.d.ts +4 -2
  212. package/dist/runtime/helpers/animationProvider.js +7 -2
  213. package/dist/runtime/helpers/bundles/index.d.ts +1 -0
  214. package/dist/runtime/helpers/bundles/index.js +4 -0
  215. package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +20 -0
  216. package/dist/runtime/helpers/composables/useStickyToolbar.js +215 -0
  217. package/dist/runtime/helpers/definitionProvider.d.ts +2 -1
  218. package/dist/runtime/helpers/definitionProvider.js +17 -0
  219. package/dist/runtime/helpers/dom/index.d.ts +59 -0
  220. package/dist/runtime/helpers/dom/index.js +48 -0
  221. package/dist/runtime/helpers/domProvider.d.ts +2 -1
  222. package/dist/runtime/helpers/domProvider.js +89 -43
  223. package/dist/runtime/helpers/dropTargets/index.d.ts +6 -0
  224. package/dist/runtime/helpers/dropTargets/index.js +49 -0
  225. package/dist/runtime/helpers/eventBus.d.ts +1 -1
  226. package/dist/runtime/helpers/eventBus.js +2 -2
  227. package/dist/runtime/helpers/index.d.ts +10 -1
  228. package/dist/runtime/helpers/index.js +57 -0
  229. package/dist/runtime/helpers/indicatorsProvider.d.ts +10 -0
  230. package/dist/runtime/helpers/indicatorsProvider.js +23 -0
  231. package/dist/runtime/helpers/keyboardProvider.d.ts +2 -0
  232. package/dist/runtime/helpers/keyboardProvider.js +17 -1
  233. package/dist/runtime/helpers/pluginProvider.d.ts +10 -0
  234. package/dist/runtime/helpers/pluginProvider.js +33 -0
  235. package/dist/runtime/helpers/renderCycle.d.ts +1 -0
  236. package/dist/runtime/helpers/renderCycle.js +10 -0
  237. package/dist/runtime/helpers/runtimeHelpers/index.js +14 -11
  238. package/dist/runtime/helpers/selectionProvider.d.ts +16 -0
  239. package/dist/runtime/helpers/selectionProvider.js +47 -35
  240. package/dist/runtime/helpers/stateProvider.d.ts +6 -2
  241. package/dist/runtime/helpers/stateProvider.js +58 -14
  242. package/dist/runtime/helpers/storageProvider.d.ts +4 -3
  243. package/dist/runtime/helpers/storageProvider.js +56 -3
  244. package/dist/runtime/helpers/symbols.d.ts +1 -0
  245. package/dist/runtime/helpers/symbols.js +1 -0
  246. package/dist/runtime/helpers/textProvider.js +6 -0
  247. package/dist/runtime/helpers/themeProvider.d.ts +2 -0
  248. package/dist/runtime/helpers/themeProvider.js +4 -1
  249. package/dist/runtime/helpers/transform.js +1 -3
  250. package/dist/runtime/helpers/uiProvider.d.ts +7 -2
  251. package/dist/runtime/helpers/uiProvider.js +49 -47
  252. package/dist/runtime/helpers/useTransitionedValue.d.ts +18 -0
  253. package/dist/runtime/helpers/useTransitionedValue.js +57 -0
  254. package/dist/runtime/icons/anchor.svg +1 -0
  255. package/dist/runtime/icons/arrow-left.svg +1 -1
  256. package/dist/runtime/icons/arrow-right.svg +1 -1
  257. package/dist/runtime/icons/arrow-top-right.svg +1 -0
  258. package/dist/runtime/icons/chart.svg +1 -0
  259. package/dist/runtime/icons/copy.svg +1 -0
  260. package/dist/runtime/icons/cursor-move.svg +1 -1
  261. package/dist/runtime/icons/diff.svg +1 -1
  262. package/dist/runtime/icons/eye.svg +1 -1
  263. package/dist/runtime/icons/info.svg +1 -1
  264. package/dist/runtime/icons/link.svg +1 -0
  265. package/dist/runtime/icons/speedometer.svg +1 -0
  266. package/dist/runtime/types/blokkOptions.d.ts +8 -0
  267. package/dist/runtime/types/index.d.ts +163 -5
  268. package/dist/runtime/types/theme.d.ts +2 -1
  269. package/dist/shared/{editor.gz_ac6uT.d.mts → editor.CKsrTpc1.d.mts} +1 -1
  270. package/package.json +55 -38
  271. package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue +0 -22
  272. package/dist/runtime/components/Edit/Features/FieldAreas/index.vue +0 -41
  273. /package/dist/runtime/components/Edit/Features/{FieldAreas/Overlay → Analyze}/index.vue.d.ts +0 -0
  274. /package/dist/runtime/components/Edit/Features/{FieldAreas/index.vue.d.ts → Anchors/Renderer.vue.d.ts} +0 -0
@@ -28,8 +28,8 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
28
28
  onCancel?: ((...args: any[]) => any) | undefined;
29
29
  onSubmit?: ((...args: any[]) => any) | undefined;
30
30
  }>, {
31
- width: number | string;
32
31
  icon: BlokkliIcon;
32
+ width: number | string;
33
33
  lead: string;
34
34
  submitLabel: string;
35
35
  canSubmit: boolean;
@@ -0,0 +1,276 @@
1
+ <template>
2
+ <div class="bk bk-diff-view">
3
+ <div class="bk-diff-mode-selector">
4
+ <FormRadioTabs
5
+ id="diff-viewer-state-display"
6
+ v-model="diffMode"
7
+ :options="diffModeOptions"
8
+ :label="$t('diffModeLabel', 'Display')"
9
+ :scheme
10
+ />
11
+ </div>
12
+ <div class="bk-diff-table" :data-diff-mode="diffMode">
13
+ <button
14
+ v-for="item in diffItems"
15
+ :key="item.uuid"
16
+ class="bk-diff-item"
17
+ :class="{
18
+ 'bk-is-muted': showSelect && !selected?.includes(item.uuid)
19
+ }"
20
+ @click.prevent="onClick(item.uuid)"
21
+ >
22
+ <div
23
+ class="bk-diff-item-header"
24
+ :disabled="item.status === 'removed' && !showSelect"
25
+ :class="{
26
+ 'bk-is-selected': showSelect && selected?.includes(item.uuid)
27
+ }"
28
+ >
29
+ <div class="bk-blokkli-item-label">
30
+ <div class="bk-blokkli-item-label-icon">
31
+ <ItemIcon :bundle="item.bundle" />
32
+ </div>
33
+ <span>{{ getLabel(item.bundle) }}</span>
34
+ </div>
35
+ <div class="bk-diff-status">
36
+ <div
37
+ v-if="item.status === 'added'"
38
+ class="bk-diff-status-label bk-is-added"
39
+ >
40
+ {{ $t("diffStatusAdded", "Added") }}
41
+ </div>
42
+ <div
43
+ v-else-if="item.status === 'removed'"
44
+ class="bk-diff-status-label bk-is-removed"
45
+ >
46
+ {{ $t("diffStatusDeleted", "Deleted") }}
47
+ </div>
48
+ <div
49
+ v-else-if="item.status === 'unchanged'"
50
+ class="bk-diff-status-label"
51
+ >
52
+ {{ $t("diffStatusUnchanged", "Unchanged") }}
53
+ </div>
54
+ <div v-else class="bk-diff-status-label">
55
+ {{ $t("diffStatusEdited", "Edited") }}
56
+ </div>
57
+ </div>
58
+ </div>
59
+ <div class="bk-diff-item-diffs">
60
+ <div
61
+ v-for="prop in item.props"
62
+ :key="prop.key"
63
+ class="bk-diff-prop-row"
64
+ >
65
+ <h3>{{ prop.key }}</h3>
66
+ <div class="bk-diff-monospace">
67
+ <div
68
+ v-if="diffMode === 'inline'"
69
+ class="bk-diff-prop-diff"
70
+ v-html="prop.diff"
71
+ />
72
+ <div
73
+ v-else-if="diffMode === 'side_by_side'"
74
+ class="bk-diff-prop-side-by-side"
75
+ >
76
+ <div class="bk-diff-prop-before">
77
+ <div class="bk-diff-prop-label">
78
+ {{ $t("diffBefore", "Before") }}
79
+ </div>
80
+ <div class="bk-diff-prop-content" v-html="prop.before" />
81
+ </div>
82
+ <div class="bk-diff-prop-after">
83
+ <div class="bk-diff-prop-label">
84
+ {{ $t("diffAfter", "After") }}
85
+ </div>
86
+ <div class="bk-diff-prop-content" v-html="prop.after" />
87
+ </div>
88
+ </div>
89
+ <div
90
+ v-else-if="diffMode === 'after'"
91
+ class="bk-diff-prop-after-only"
92
+ >
93
+ <div class="bk-diff-prop-content" v-html="prop.after" />
94
+ </div>
95
+ </div>
96
+ </div>
97
+ </div>
98
+ </button>
99
+ </div>
100
+ </div>
101
+ </template>
102
+
103
+ <script setup>
104
+ import { computed, useBlokkli } from "#imports";
105
+ import { ItemIcon, FormRadioTabs } from "#blokkli/components";
106
+ import diff from "html-diff-ts";
107
+ const props = defineProps({
108
+ stateBefore: { type: Object, required: true },
109
+ stateAfter: { type: Object, required: true },
110
+ showSelect: { type: Boolean, required: false },
111
+ includeUuids: { type: Array, required: false },
112
+ selected: { type: Array, required: false },
113
+ scheme: { type: String, required: false }
114
+ });
115
+ const { types, $t, eventBus, dom, definitions, storage } = useBlokkli();
116
+ const diffMode = storage.use(
117
+ "diffMode",
118
+ "inline"
119
+ );
120
+ const diffModeOptions = computed(() => [
121
+ {
122
+ value: "inline",
123
+ label: $t("diffModeInline", "Inline")
124
+ },
125
+ {
126
+ value: "side_by_side",
127
+ label: $t("diffModeSideBySide", "Both")
128
+ },
129
+ {
130
+ value: "after",
131
+ label: $t("diffModeAfter", "After")
132
+ }
133
+ ]);
134
+ const emit = defineEmits(["toggle"]);
135
+ function getProps(bundle, props2) {
136
+ const definition = definitions.getDefaultDefinition(bundle);
137
+ if (definition?.editor?.mapDiffProps) {
138
+ return definition.editor.mapDiffProps(props2);
139
+ }
140
+ if (typeof props2 === "object") {
141
+ return Object.entries(props2).reduce(
142
+ (acc, [key, value]) => {
143
+ if (typeof value === "string" || typeof value === "number") {
144
+ acc[key] = value.toString();
145
+ } else if (typeof value === "object") {
146
+ try {
147
+ const json = JSON.stringify(value, null, 2);
148
+ acc[key] = `<pre>${json}</pre>`;
149
+ } catch {
150
+ }
151
+ }
152
+ return acc;
153
+ },
154
+ {}
155
+ );
156
+ }
157
+ return {};
158
+ }
159
+ function buildDiffItems(fields) {
160
+ const items = (fields || []).flatMap((v) => v.list);
161
+ return items;
162
+ }
163
+ const itemsBefore = computed(
164
+ () => buildDiffItems(props.stateBefore.mutatedState?.fields)
165
+ );
166
+ const itemsAfter = computed(
167
+ () => buildDiffItems(props.stateAfter.mutatedState?.fields)
168
+ );
169
+ function toString(v) {
170
+ if (typeof v === "string") {
171
+ return v;
172
+ } else if (typeof v === "number") {
173
+ return v.toString();
174
+ }
175
+ return "";
176
+ }
177
+ const diffItems = computed(() => {
178
+ const diffMap = /* @__PURE__ */ new Map();
179
+ itemsBefore.value.forEach((beforeItem) => {
180
+ if (props.includeUuids && !props.includeUuids.includes(beforeItem.uuid)) {
181
+ return;
182
+ }
183
+ const afterItem = itemsAfter.value.find(
184
+ (item) => item.uuid === beforeItem.uuid
185
+ );
186
+ const beforeProps = getProps(beforeItem.bundle, beforeItem.props);
187
+ if (!afterItem) {
188
+ diffMap.set(beforeItem.uuid, {
189
+ uuid: beforeItem.uuid,
190
+ bundle: beforeItem.bundle,
191
+ status: "removed",
192
+ props: Object.entries(beforeProps).map(([key, value]) => ({
193
+ key,
194
+ diff: diff(toString(value), ""),
195
+ before: toString(value),
196
+ after: ""
197
+ }))
198
+ });
199
+ } else {
200
+ const afterProps = getProps(afterItem.bundle, afterItem.props);
201
+ const changedProps = [];
202
+ Object.entries(beforeProps).forEach(([key, beforeValue]) => {
203
+ const afterValue = afterProps[key];
204
+ if (beforeValue !== afterValue) {
205
+ changedProps.push({
206
+ key,
207
+ diff: diff(toString(beforeValue), toString(afterValue)),
208
+ before: toString(beforeValue),
209
+ after: toString(afterValue)
210
+ });
211
+ }
212
+ });
213
+ Object.keys(afterProps).forEach((key) => {
214
+ if (!(key in beforeProps)) {
215
+ changedProps.push({
216
+ key,
217
+ diff: diff("", toString(afterProps[key])),
218
+ before: "",
219
+ after: toString(afterProps[key])
220
+ });
221
+ }
222
+ });
223
+ if (changedProps.length > 0) {
224
+ diffMap.set(beforeItem.uuid, {
225
+ uuid: beforeItem.uuid,
226
+ bundle: beforeItem.bundle,
227
+ status: "changed",
228
+ props: changedProps
229
+ });
230
+ } else if (props.includeUuids) {
231
+ diffMap.set(beforeItem.uuid, {
232
+ uuid: beforeItem.uuid,
233
+ bundle: beforeItem.bundle,
234
+ status: "unchanged",
235
+ props: []
236
+ });
237
+ }
238
+ }
239
+ });
240
+ itemsAfter.value.forEach((afterItem) => {
241
+ if (!itemsBefore.value.some((item) => item.uuid === afterItem.uuid)) {
242
+ const afterProps = getProps(afterItem.bundle, afterItem.props);
243
+ diffMap.set(afterItem.uuid, {
244
+ uuid: afterItem.uuid,
245
+ bundle: afterItem.bundle,
246
+ status: "added",
247
+ props: Object.entries(afterProps).map(([key, value]) => ({
248
+ key,
249
+ diff: diff("", toString(value)),
250
+ before: "",
251
+ after: toString(value)
252
+ }))
253
+ });
254
+ }
255
+ });
256
+ return Array.from(diffMap.values()).sort((a, b) => {
257
+ const aY = dom.getBlockRect(a.uuid)?.y || 0;
258
+ const bY = dom.getBlockRect(b.uuid)?.y || 0;
259
+ return aY - bY;
260
+ });
261
+ });
262
+ function onClick(uuid) {
263
+ if (props.showSelect) {
264
+ emit("toggle", uuid);
265
+ } else {
266
+ scrollToBlock(uuid);
267
+ }
268
+ }
269
+ function getLabel(bundle) {
270
+ return types.getBlockBundleDefinition(bundle)?.label || bundle;
271
+ }
272
+ function scrollToBlock(uuid) {
273
+ eventBus.emit("scrollIntoView", { uuid, center: true });
274
+ eventBus.emit("select", uuid);
275
+ }
276
+ </script>
@@ -0,0 +1,16 @@
1
+ import type { MappedState } from '#blokkli/types';
2
+ import type { ThemeColorName } from '#blokkli/types/theme';
3
+ type __VLS_Props = {
4
+ stateBefore: MappedState;
5
+ stateAfter: MappedState;
6
+ showSelect?: boolean;
7
+ includeUuids?: string[];
8
+ selected?: string[];
9
+ scheme?: ThemeColorName;
10
+ };
11
+ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
12
+ toggle: (uuid: string) => any;
13
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onToggle?: ((uuid: string) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
16
+ export default _default;
@@ -10,6 +10,7 @@ import {
10
10
  isInsideRect
11
11
  } from "#blokkli/helpers";
12
12
  import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
13
+ import { MOUSE_BUTTON, MOUSE_BUTTONS } from "#blokkli/helpers/dom";
13
14
  import { watch, ref, useBlokkli, onMounted, onBeforeUnmount } from "#imports";
14
15
  const { dom, eventBus, selection, keyboard, ui, state } = useBlokkli();
15
16
  const rootEl = ui.rootElement();
@@ -28,6 +29,8 @@ watch(dom.isReady, buildRects);
28
29
  let lastInteractedElement = null;
29
30
  let pointerDownElement = null;
30
31
  let mouseStartCoordinates = null;
32
+ let pointerDownTimestamp = 0;
33
+ let pointerUpTimestamp = 0;
31
34
  function getInteractedElement(e) {
32
35
  const { x, y } = getInteractionCoordinates(e);
33
36
  const elements = document.elementsFromPoint(x, y);
@@ -85,7 +88,7 @@ function getInteractedElement(e) {
85
88
  return null;
86
89
  }
87
90
  function onPointerMove(e) {
88
- if (keyboard.isPressingSpace.value || state.editMode.value !== "editing") {
91
+ if (keyboard.isPressingSpace.value || state.editMode.value !== "editing" || e.buttons === MOUSE_BUTTONS.AUXILIARY) {
89
92
  return;
90
93
  }
91
94
  e.preventDefault();
@@ -94,14 +97,26 @@ function onPointerMove(e) {
94
97
  if (e.pointerType === "touch") {
95
98
  return onTouchMove(e);
96
99
  }
97
- if (e.buttons !== 1) {
100
+ if (e.buttons !== MOUSE_BUTTONS.PRIMARY) {
98
101
  return;
99
102
  }
100
- if (!pointerDownElement || !mouseStartCoordinates || selection.isDragging.value || keyboard.isPressingSpace.value || selection.isMultiSelecting.value) {
103
+ if (!mouseStartCoordinates || selection.isMultiSelecting.value || selection.isDragging.value || keyboard.isPressingSpace.value) {
101
104
  return;
102
105
  }
103
106
  const diffX = Math.abs(mouseStartCoordinates.x - e.clientX);
104
107
  const diffY = Math.abs(mouseStartCoordinates.y - e.clientY);
108
+ if (!pointerDownElement) {
109
+ const timeDelta = Date.now() - pointerDownTimestamp;
110
+ const maxMovement = Math.max(diffX, diffY);
111
+ if (maxMovement > 6 && timeDelta > 150 || maxMovement > 20) {
112
+ rootEl.removeEventListener("pointermove", onPointerMove);
113
+ eventBus.emit("multi-select:start", {
114
+ x: e.clientX,
115
+ y: e.clientY
116
+ });
117
+ }
118
+ return;
119
+ }
105
120
  if (diffX < 6 && diffY < 6) {
106
121
  return;
107
122
  }
@@ -123,11 +138,13 @@ function onPointerMove(e) {
123
138
  });
124
139
  }
125
140
  }
141
+ rootEl.removeEventListener("pointermove", onPointerMove);
126
142
  }
127
143
  }
128
- let pointerDownTimestamp = 0;
129
- let pointerUpTimestamp = 0;
130
144
  function onPointerDown(e) {
145
+ if (e.buttons === MOUSE_BUTTONS.AUXILIARY) {
146
+ return;
147
+ }
131
148
  if (!keyboard.isPressingSpace.value) {
132
149
  e.preventDefault();
133
150
  e.stopPropagation();
@@ -145,10 +162,10 @@ function onPointerDown(e) {
145
162
  if (selection.isDragging.value) {
146
163
  return;
147
164
  }
165
+ pointerDownTimestamp = Date.now();
148
166
  const coords = { x: e.clientX, y: e.clientY };
149
- if (!e.shiftKey && e.buttons !== 2) {
150
- pointerDownTimestamp = Date.now();
151
- mouseStartCoordinates = coords;
167
+ mouseStartCoordinates = coords;
168
+ if (!e.shiftKey && e.buttons === MOUSE_BUTTONS.PRIMARY) {
152
169
  const interacted = getInteractedElement(e);
153
170
  pointerDownElement = interacted;
154
171
  if (interacted) {
@@ -157,8 +174,23 @@ function onPointerDown(e) {
157
174
  }
158
175
  eventBus.emit("mouse:down", { ...coords, type: "mouse", distance: 0 });
159
176
  }
177
+ function isClickInArtboard(coords) {
178
+ const size = ui.artboardSize.value;
179
+ const scale = ui.artboardScale.value;
180
+ const rect = {
181
+ x: ui.artboardOffset.value.x,
182
+ y: ui.artboardOffset.value.y,
183
+ width: size.width * scale,
184
+ height: size.height * scale
185
+ };
186
+ return isInsideRect(coords.x, coords.y, rect);
187
+ }
160
188
  function onPointerUp(e) {
161
189
  rootEl.removeEventListener("pointermove", onPointerMove);
190
+ if (e.button === MOUSE_BUTTON.AUXILIARY) {
191
+ e.preventDefault();
192
+ return;
193
+ }
162
194
  e.preventDefault();
163
195
  e.stopPropagation();
164
196
  e.stopImmediatePropagation();
@@ -228,6 +260,11 @@ function onPointerUp(e) {
228
260
  return;
229
261
  }
230
262
  eventBus.emit("window:clickAway");
263
+ if (isClickInArtboard(coords)) {
264
+ eventBus.emit("select:host");
265
+ } else {
266
+ eventBus.emit("select:host:unselect");
267
+ }
231
268
  }
232
269
  let longPressTimeout = null;
233
270
  let touchStartInteraction = null;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <Teleport to="body">
3
- <Transition name="bk-loading">
3
+ <Transition :name="ui.useAnimations.value ? 'bk-loading' : void 0">
4
4
  <Loading
5
5
  v-if="isInitializing || !toolbarLoaded || !featuresLoaded"
6
6
  screen
@@ -29,6 +29,7 @@
29
29
  <Actions v-if="!isInitializing" />
30
30
  <Toolbar @loaded="toolbarLoaded = true" />
31
31
  <AppMenu v-if="toolbarLoaded" />
32
+ <Indicators />
32
33
  <Features
33
34
  v-if="!isInitializing && toolbarLoaded"
34
35
  :key="route.fullPath"
@@ -36,6 +37,7 @@
36
37
  />
37
38
  <DragInteractions v-if="!isInitializing" />
38
39
  <AnimationCanvas v-if="!isInitializing" />
40
+ <Konami />
39
41
  <SystemRequirements />
40
42
  <slot
41
43
  v-if="!isInitializing"
@@ -46,7 +48,6 @@
46
48
 
47
49
  <script setup>
48
50
  import {
49
- watch,
50
51
  ref,
51
52
  computed,
52
53
  provide,
@@ -54,18 +55,21 @@ import {
54
55
  onBeforeUnmount,
55
56
  useRoute,
56
57
  useRuntimeConfig,
57
- nextTick
58
+ nextTick,
59
+ inject
58
60
  } from "#imports";
59
61
  import Toolbar from "./Toolbar/index.vue";
60
62
  import Actions from "./Actions/index.vue";
61
63
  import Loading from "./Loading/index.vue";
62
64
  import Messages from "./Messages/index.vue";
63
65
  import Features from "./Features/index.vue";
66
+ import Indicators from "./Indicators/index.vue";
64
67
  import AppMenu from "./AppMenu/index.vue";
65
68
  import DraggableList from "./DraggableList.vue";
66
69
  import DragInteractions from "./DragInteractions/index.vue";
67
70
  import AnimationCanvas from "./AnimationCanvas/index.vue";
68
71
  import SystemRequirements from "./SystemRequirements/index.vue";
72
+ import Konami from "./Konami/index.vue";
69
73
  import animationProvider from "./../../helpers/animationProvider";
70
74
  import keyboardProvider from "./../../helpers/keyboardProvider";
71
75
  import selectionProvider from "./../../helpers/selectionProvider";
@@ -83,6 +87,8 @@ import tourProvider from "./../../helpers/tourProvider";
83
87
  import debugProvider from "./../../helpers/debugProvider";
84
88
  import definitionProvider from "./../../helpers/definitionProvider";
85
89
  import dropAreasProvider from "./../../helpers/dropAreaProvider";
90
+ import indicatorsProvider from "./../../helpers/indicatorsProvider";
91
+ import pluginProvider from "./../../helpers/pluginProvider";
86
92
  import { eventBus } from "#blokkli/helpers/eventBus";
87
93
  import "#blokkli-build/styles.css";
88
94
  import getAdapter from "#blokkli-build/edit-adapter";
@@ -92,9 +98,11 @@ import {
92
98
  INJECT_EDIT_FIELD_LIST_COMPONENT,
93
99
  INJECT_EDIT_LOGGER,
94
100
  INJECT_GLOBAL_PROXY_MODE,
95
- INJECT_IS_EDITING
101
+ INJECT_IS_EDITING,
102
+ INJECT_PROVIDER_KEY
96
103
  } from "#blokkli/helpers/symbols";
97
104
  import { useBlockRegistration } from "#blokkli/helpers/composables/useBlockRegistration";
105
+ import { addElementClasses } from "#blokkli/helpers/addElementClasses";
98
106
  const props = defineProps({
99
107
  entity: { type: null, required: false, default: void 0 },
100
108
  entityType: { type: String, required: true },
@@ -113,6 +121,7 @@ const context = computed(() => {
113
121
  };
114
122
  });
115
123
  const adapter = await getAdapter(context);
124
+ const providerKey = inject(INJECT_PROVIDER_KEY, "");
116
125
  const route = useRoute();
117
126
  const runtimeConfig = useRuntimeConfig().public.blokkli;
118
127
  const toolbarLoaded = ref(false);
@@ -120,8 +129,8 @@ const featuresLoaded = ref(false);
120
129
  const isInitializing = ref(true);
121
130
  const definitions = definitionProvider();
122
131
  const $t = textProvider(context);
123
- const state = await editStateProvider(adapter, context, $t);
124
- const storage = storageProvider();
132
+ const state = await editStateProvider(adapter, context, $t, providerKey);
133
+ const storage = await storageProvider(adapter);
125
134
  const debug = debugProvider(storage);
126
135
  const features = featuresProvider(storage);
127
136
  const theme = themeProvider();
@@ -129,12 +138,14 @@ const commands = commandsProvider();
129
138
  const tour = tourProvider();
130
139
  const dropAreas = dropAreasProvider();
131
140
  const broadcast = broadcastProvider();
132
- const ui = uiProvider(storage, state);
141
+ const ui = uiProvider(storage, state, context);
133
142
  const dom = domProvider(ui, debug, definitions);
134
- const animation = animationProvider(ui);
143
+ const animation = animationProvider(ui, storage);
135
144
  const keyboard = keyboardProvider(animation);
136
145
  const selection = selectionProvider(dom);
137
146
  const types = await typesProvider(adapter, selection, context);
147
+ const indicators = indicatorsProvider();
148
+ const plugins = pluginProvider();
138
149
  const mutatedEntity = computed(() => state.mutatedEntity.value || props.entity);
139
150
  const onContextMenu = (e) => {
140
151
  e.preventDefault();
@@ -148,22 +159,22 @@ function onTouchStart(e) {
148
159
  e.preventDefault();
149
160
  }
150
161
  }
151
- const setRootClasses = (unmount) => {
152
- document.documentElement.classList.remove("bk-use-animations");
153
- if (ui.useAnimations.value && !unmount) {
154
- document.documentElement.classList.add("bk-use-animations");
155
- }
156
- };
157
- watch(ui.useAnimations, setRootClasses);
162
+ const shouldIsolate = computed(() => props.isolate);
163
+ addElementClasses(
164
+ document.documentElement,
165
+ "bk-use-animations",
166
+ ui.useAnimations
167
+ );
168
+ addElementClasses(
169
+ document.documentElement,
170
+ "bk-isolate-provider",
171
+ shouldIsolate
172
+ );
158
173
  const baseLogger = debug.createLogger("EditProvider");
159
174
  onMounted(() => {
160
175
  window.addEventListener("contextmenu", onContextMenu);
161
- if (props.isolate) {
162
- document.documentElement.classList.add("bk-isolate-provider");
163
- }
164
176
  document.documentElement.addEventListener("touchmove", onTouchMove);
165
177
  document.documentElement.addEventListener("touchstart", onTouchStart);
166
- setRootClasses();
167
178
  baseLogger.log("EditProvider mounted");
168
179
  dom.init();
169
180
  isInitializing.value = false;
@@ -173,10 +184,8 @@ onBeforeUnmount(() => {
173
184
  window.removeEventListener("contextmenu", onContextMenu);
174
185
  isInitializing.value = true;
175
186
  toolbarLoaded.value = false;
176
- document.documentElement.classList.remove("bk-isolate-provider");
177
187
  document.documentElement.removeEventListener("touchmove", onTouchMove);
178
188
  document.documentElement.removeEventListener("touchstart", onTouchStart);
179
- setRootClasses(true);
180
189
  });
181
190
  provide(INJECT_EDIT_LOGGER, baseLogger);
182
191
  provide(INJECT_EDIT_FIELD_LIST_COMPONENT, DraggableList);
@@ -189,27 +198,29 @@ provide(INJECT_EDIT_CONTEXT, {
189
198
  useBlockRegistration
190
199
  });
191
200
  provide(INJECT_APP, {
201
+ $t,
192
202
  adapter,
203
+ animation,
204
+ broadcast,
205
+ commands,
206
+ context,
207
+ debug,
208
+ definitions,
209
+ dom,
210
+ dropAreas,
193
211
  eventBus,
212
+ features,
213
+ indicators,
214
+ keyboard,
215
+ plugins,
194
216
  runtimeConfig,
217
+ selection,
195
218
  state,
196
- dom,
197
219
  storage,
198
- types,
199
- selection,
200
- keyboard,
201
- ui,
202
- animation,
203
- context,
204
- $t,
205
- broadcast,
206
- features,
207
220
  theme,
208
- commands,
209
221
  tour,
210
- dropAreas,
211
- debug,
212
- definitions
222
+ types,
223
+ ui
213
224
  });
214
225
  const isProxyMode = computed(() => ui.isProxyMode.value);
215
226
  provide(INJECT_GLOBAL_PROXY_MODE, isProxyMode);
@@ -50,13 +50,12 @@ import {
50
50
  ref,
51
51
  computed,
52
52
  useBlokkli,
53
- onMounted,
54
- onBeforeUnmount,
55
53
  nextTick,
56
54
  defineBlokkliFeature
57
55
  } from "#imports";
58
56
  import { Sortli } from "#blokkli/components";
59
57
  import { PluginSidebar, PluginTourItem } from "#blokkli/plugins";
58
+ import { addElementClasses } from "#blokkli/helpers/addElementClasses";
60
59
  const { settings } = defineBlokkliFeature({
61
60
  id: "add-list",
62
61
  icon: "plus",
@@ -94,14 +93,10 @@ const hasContextMenuOpen = computed(
94
93
  const isSidebar = computed(() => ui.addListOrientation.value === "sidebar");
95
94
  const shouldRender = computed(() => state.editMode.value === "editing");
96
95
  watch(ui.addListOrientation, () => {
97
- setRootClasses();
98
96
  nextTick(() => {
99
97
  eventBus.emit("add-list:change");
100
98
  });
101
99
  });
102
- watch(shouldRender, () => {
103
- setRootClasses();
104
- });
105
100
  const CLASS_LEFT = "bk-has-add-list-left";
106
101
  const CLASS_BOTTOM = "bk-has-add-list-bottom";
107
102
  const wrapper = ref(null);
@@ -146,18 +141,6 @@ const onWheel = (e) => {
146
141
  e.stopPropagation();
147
142
  }
148
143
  };
149
- function setRootClasses() {
150
- document.documentElement.classList.remove(CLASS_BOTTOM);
151
- document.documentElement.classList.remove(CLASS_LEFT);
152
- if (!shouldRender.value) {
153
- return;
154
- }
155
- if (ui.addListOrientation.value === "horizontal") {
156
- document.documentElement.classList.add(CLASS_BOTTOM);
157
- } else if (ui.addListOrientation.value === "vertical") {
158
- document.documentElement.classList.add(CLASS_LEFT);
159
- }
160
- }
161
144
  const sidebarTitle = computed(() => $t("addListSidebarTitle", "Add blocks"));
162
145
  const tourText = computed(
163
146
  () => $t(
@@ -165,13 +148,20 @@ const tourText = computed(
165
148
  "<p>This shows the list of available blocks that can be placed. Add a block by dragging the icon into the page.</p><p>When an existing block is selected, some blocks may be greyed out. This indicates which blocks can be placed inside or after the selected block.</p>"
166
149
  )
167
150
  );
168
- onMounted(() => {
169
- setRootClasses();
170
- });
171
- onBeforeUnmount(() => {
172
- document.documentElement.classList.remove(CLASS_BOTTOM);
173
- document.documentElement.classList.remove(CLASS_LEFT);
174
- });
151
+ addElementClasses(
152
+ document.documentElement,
153
+ CLASS_BOTTOM,
154
+ computed(
155
+ () => ui.addListOrientation.value === "horizontal" && shouldRender.value
156
+ )
157
+ );
158
+ addElementClasses(
159
+ document.documentElement,
160
+ CLASS_LEFT,
161
+ computed(
162
+ () => ui.addListOrientation.value === "vertical" && shouldRender.value
163
+ )
164
+ );
175
165
  </script>
176
166
 
177
167
  <script>