@blokkli/editor 1.4.0-alpha.1 → 2.0.0-alpha.2

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 (439) hide show
  1. package/dist/module.d.mts +12 -194
  2. package/dist/module.json +4 -4
  3. package/dist/module.mjs +1847 -1306
  4. package/dist/modules/drupal/adapter/index.d.mts +6 -0
  5. package/dist/modules/drupal/adapter/index.mjs +762 -0
  6. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +44 -0
  7. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliMutatedField.graphql +11 -0
  8. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliMutationItem.graphql +9 -0
  9. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliMutationResult.graphql +7 -0
  10. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliViolation.graphql +7 -0
  11. package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +96 -0
  12. package/dist/modules/drupal/graphql/base/query.pbEditState.graphql +15 -0
  13. package/dist/modules/drupal/graphql/features/conversions.graphql +44 -0
  14. package/dist/modules/drupal/graphql/features/import-existing.graphql +34 -0
  15. package/dist/{runtime/adapter/drupal/graphql → modules/drupal/graphql/features}/library.graphql +17 -0
  16. package/dist/modules/drupal/graphql/features/media-library.graphql +28 -0
  17. package/dist/modules/drupal/graphql/features/preview-grant.graphql +13 -0
  18. package/dist/modules/drupal/graphql/features/publish.graphql +15 -0
  19. package/dist/modules/drupal/graphql/features/publishNew.graphql +59 -0
  20. package/dist/modules/drupal/graphql/mutations/add.graphql +25 -0
  21. package/dist/modules/drupal/graphql/mutations/add_clipboard_text.graphql +25 -0
  22. package/dist/modules/drupal/graphql/mutations/add_entity_reference.graphql +31 -0
  23. package/dist/modules/drupal/graphql/mutations/add_entity_reference_multiple.graphql +25 -0
  24. package/dist/modules/drupal/graphql/mutations/add_file.graphql +27 -0
  25. package/dist/modules/drupal/graphql/mutations/add_image.graphql +27 -0
  26. package/dist/modules/drupal/graphql/mutations/add_video_remote.graphql +25 -0
  27. package/dist/modules/drupal/graphql/mutations/bulk_update_behavior_settings.graphql +15 -0
  28. package/dist/modules/drupal/graphql/mutations/duplicate.graphql +33 -0
  29. package/dist/modules/drupal/graphql/mutations/move.graphql +25 -0
  30. package/dist/modules/drupal/graphql/mutations/move_multiple.graphql +25 -0
  31. package/dist/modules/drupal/graphql/mutations/redo.graphql +14 -0
  32. package/dist/modules/drupal/graphql/mutations/remove.graphql +15 -0
  33. package/dist/modules/drupal/graphql/mutations/remove_multiple.graphql +15 -0
  34. package/dist/modules/drupal/graphql/mutations/replace_host_entity_media.graphql +20 -0
  35. package/dist/modules/drupal/graphql/mutations/replace_media.graphql +22 -0
  36. package/dist/modules/drupal/graphql/mutations/revertAllChanges.graphql +14 -0
  37. package/dist/modules/drupal/graphql/mutations/setHistoryIndex.graphql +15 -0
  38. package/dist/modules/drupal/graphql/mutations/setMutationStatus.graphql +16 -0
  39. package/dist/modules/drupal/graphql/mutations/takeOwnership.graphql +14 -0
  40. package/dist/modules/drupal/graphql/mutations/undo.graphql +14 -0
  41. package/dist/modules/drupal/graphql/mutations/update_behavior_setting.graphql +23 -0
  42. package/dist/modules/drupal/graphql/mutations/update_field_value.graphql +22 -0
  43. package/dist/modules/drupal/graphql/mutations/update_host_entity_field_value.graphql +20 -0
  44. package/dist/modules/drupal/index.d.mts +10 -0
  45. package/dist/modules/drupal/index.mjs +170 -0
  46. package/dist/runtime/adapter/index.d.ts +30 -4
  47. package/dist/runtime/blokkliPlugins/AddAction/index.vue +39 -54
  48. package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +26 -0
  49. package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +38 -64
  50. package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue.d.ts +12 -0
  51. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +19 -30
  52. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +37 -0
  53. package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue +15 -23
  54. package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +21 -0
  55. package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +28 -45
  56. package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +41 -0
  57. package/dist/runtime/blokkliPlugins/ItemAction/index.vue +39 -85
  58. package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +83 -0
  59. package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +22 -26
  60. package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +17 -0
  61. package/dist/runtime/blokkliPlugins/MenuButton/index.vue +30 -38
  62. package/dist/runtime/blokkliPlugins/MenuButton/index.vue.d.ts +32 -0
  63. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +146 -211
  64. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +91 -0
  65. package/dist/runtime/blokkliPlugins/Sidebar/index.vue +95 -139
  66. package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +85 -0
  67. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +38 -57
  68. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +48 -0
  69. package/dist/runtime/blokkliPlugins/TourItem/index.vue +20 -29
  70. package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +20 -0
  71. package/dist/runtime/blokkliPlugins/ViewOption/index.vue +45 -59
  72. package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +39 -0
  73. package/dist/runtime/components/Blocks/Fragment/index.vue +13 -20
  74. package/dist/runtime/components/Blocks/Fragment/index.vue.d.ts +6 -0
  75. package/dist/runtime/components/Blocks/FromLibrary/index.vue +19 -29
  76. package/dist/runtime/components/Blocks/FromLibrary/index.vue.d.ts +6 -0
  77. package/dist/runtime/components/BlokkliEditable.vue +30 -49
  78. package/dist/runtime/components/BlokkliEditable.vue.d.ts +20 -0
  79. package/dist/runtime/components/BlokkliField.vue +101 -159
  80. package/dist/runtime/components/BlokkliField.vue.d.ts +49 -0
  81. package/dist/runtime/components/BlokkliItem.vue +43 -66
  82. package/dist/runtime/components/BlokkliItem.vue.d.ts +26 -0
  83. package/dist/runtime/components/BlokkliProvider.vue +51 -87
  84. package/dist/runtime/components/BlokkliProvider.vue.d.ts +34 -0
  85. package/dist/runtime/components/Edit/Actions/index.vue +116 -164
  86. package/dist/runtime/components/Edit/Actions/index.vue.d.ts +2 -0
  87. package/dist/runtime/components/Edit/AddListItem/index.vue +45 -66
  88. package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +28 -0
  89. package/dist/runtime/components/Edit/AnimationCanvas/index.vue +52 -88
  90. package/dist/runtime/components/Edit/AnimationCanvas/index.vue.d.ts +2 -0
  91. package/dist/runtime/components/Edit/AppMenu/index.vue +12 -15
  92. package/dist/runtime/components/Edit/AppMenu/index.vue.d.ts +2 -0
  93. package/dist/runtime/components/Edit/BlockProxy/index.vue +48 -82
  94. package/dist/runtime/components/Edit/BlockProxy/index.vue.d.ts +10 -0
  95. package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +17 -21
  96. package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +23 -0
  97. package/dist/runtime/components/Edit/Dialog/index.vue +67 -103
  98. package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +44 -0
  99. package/dist/runtime/components/Edit/DragInteractions/index.vue +219 -333
  100. package/dist/runtime/components/Edit/DragInteractions/index.vue.d.ts +2 -0
  101. package/dist/runtime/components/Edit/DraggableList.vue +82 -125
  102. package/dist/runtime/components/Edit/DraggableList.vue.d.ts +27 -0
  103. package/dist/runtime/components/Edit/EditIndicator.vue +34 -46
  104. package/dist/runtime/components/Edit/EditIndicator.vue.d.ts +11 -0
  105. package/dist/runtime/components/Edit/EditProvider.vue +146 -142
  106. package/dist/runtime/components/Edit/EditProvider.vue.d.ts +26 -0
  107. package/dist/runtime/components/Edit/Features/AddList/index.vue +90 -117
  108. package/dist/runtime/components/Edit/Features/AddList/index.vue.d.ts +2 -0
  109. package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +43 -63
  110. package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue.d.ts +6 -0
  111. package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +18 -23
  112. package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue.d.ts +7 -0
  113. package/dist/runtime/components/Edit/Features/Artboard/index.vue +174 -223
  114. package/dist/runtime/components/Edit/Features/Artboard/index.vue.d.ts +2 -0
  115. package/dist/runtime/components/Edit/Features/Assistant/Overlay/ResultMarkup/index.vue +7 -7
  116. package/dist/runtime/components/Edit/Features/Assistant/Overlay/ResultMarkup/index.vue.d.ts +6 -0
  117. package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue +41 -54
  118. package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue.d.ts +8 -0
  119. package/dist/runtime/components/Edit/Features/Assistant/index.vue +31 -40
  120. package/dist/runtime/components/Edit/Features/Assistant/index.vue.d.ts +2 -0
  121. package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +225 -326
  122. package/dist/runtime/components/Edit/Features/BlockAddList/index.vue.d.ts +2 -0
  123. package/dist/runtime/components/Edit/Features/Clipboard/List/Item/File.vue +36 -44
  124. package/dist/runtime/components/Edit/Features/Clipboard/List/Item/File.vue.d.ts +3 -0
  125. package/dist/runtime/components/Edit/Features/Clipboard/List/Item/Video.vue +33 -35
  126. package/dist/runtime/components/Edit/Features/Clipboard/List/Item/Video.vue.d.ts +3 -0
  127. package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +13 -21
  128. package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue.d.ts +10 -0
  129. package/dist/runtime/components/Edit/Features/Clipboard/index.vue +227 -298
  130. package/dist/runtime/components/Edit/Features/Clipboard/index.vue.d.ts +2 -0
  131. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +24 -34
  132. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue.d.ts +22 -0
  133. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +146 -195
  134. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue.d.ts +6 -0
  135. package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +21 -26
  136. package/dist/runtime/components/Edit/Features/CommandPalette/index.vue.d.ts +2 -0
  137. package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +11 -14
  138. package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue.d.ts +8 -0
  139. package/dist/runtime/components/Edit/Features/Comments/Comment/index.vue +21 -29
  140. package/dist/runtime/components/Edit/Features/Comments/Comment/index.vue.d.ts +23 -0
  141. package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +31 -43
  142. package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue.d.ts +19 -0
  143. package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +70 -100
  144. package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue.d.ts +18 -0
  145. package/dist/runtime/components/Edit/Features/Comments/index.vue +37 -48
  146. package/dist/runtime/components/Edit/Features/Comments/index.vue.d.ts +2 -0
  147. package/dist/runtime/components/Edit/Features/Conversions/index.vue +40 -56
  148. package/dist/runtime/components/Edit/Features/Conversions/index.vue.d.ts +2 -0
  149. package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +37 -50
  150. package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue.d.ts +2 -0
  151. package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +35 -44
  152. package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue.d.ts +2 -0
  153. package/dist/runtime/components/Edit/Features/Debug/index.vue +43 -57
  154. package/dist/runtime/components/Edit/Features/Debug/index.vue.d.ts +2 -0
  155. package/dist/runtime/components/Edit/Features/Delete/index.vue +31 -52
  156. package/dist/runtime/components/Edit/Features/Delete/index.vue.d.ts +2 -0
  157. package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +75 -114
  158. package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue.d.ts +2 -0
  159. package/dist/runtime/components/Edit/Features/Diff/index.vue +17 -19
  160. package/dist/runtime/components/Edit/Features/Diff/index.vue.d.ts +2 -0
  161. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +193 -337
  162. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue.d.ts +27 -0
  163. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +1 -1
  164. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +391 -644
  165. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue.d.ts +156 -0
  166. package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +197 -323
  167. package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue.d.ts +2 -0
  168. package/dist/runtime/components/Edit/Features/Duplicate/index.vue +49 -71
  169. package/dist/runtime/components/Edit/Features/Duplicate/index.vue.d.ts +2 -0
  170. package/dist/runtime/components/Edit/Features/Edit/index.vue +41 -71
  171. package/dist/runtime/components/Edit/Features/Edit/index.vue.d.ts +2 -0
  172. package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +35 -51
  173. package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue.d.ts +11 -0
  174. package/dist/runtime/components/Edit/Features/EditForm/index.vue +104 -140
  175. package/dist/runtime/components/Edit/Features/EditForm/index.vue.d.ts +2 -0
  176. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Contenteditable/index.vue +18 -25
  177. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Contenteditable/index.vue.d.ts +12 -0
  178. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +34 -50
  179. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue.d.ts +16 -0
  180. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +40 -51
  181. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue.d.ts +16 -0
  182. package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +147 -209
  183. package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue.d.ts +15 -0
  184. package/dist/runtime/components/Edit/Features/EditableField/index.vue +90 -143
  185. package/dist/runtime/components/Edit/Features/EditableField/index.vue.d.ts +2 -0
  186. package/dist/runtime/components/Edit/Features/EditableMask/index.vue +28 -36
  187. package/dist/runtime/components/Edit/Features/EditableMask/index.vue.d.ts +2 -0
  188. package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +49 -58
  189. package/dist/runtime/components/Edit/Features/EntityTitle/index.vue.d.ts +2 -0
  190. package/dist/runtime/components/Edit/Features/Exit/index.vue +16 -20
  191. package/dist/runtime/components/Edit/Features/Exit/index.vue.d.ts +2 -0
  192. package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue +4 -15
  193. package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue.d.ts +2 -0
  194. package/dist/runtime/components/Edit/Features/FieldAreas/index.vue +19 -21
  195. package/dist/runtime/components/Edit/Features/FieldAreas/index.vue.d.ts +2 -0
  196. package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue +28 -35
  197. package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue.d.ts +8 -0
  198. package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +51 -74
  199. package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue.d.ts +12 -0
  200. package/dist/runtime/components/Edit/Features/Fragments/index.vue +41 -51
  201. package/dist/runtime/components/Edit/Features/Fragments/index.vue.d.ts +2 -0
  202. package/dist/runtime/components/Edit/Features/Grid/index.vue +17 -20
  203. package/dist/runtime/components/Edit/Features/Grid/index.vue.d.ts +2 -0
  204. package/dist/runtime/components/Edit/Features/Help/Shortcuts/index.vue +24 -35
  205. package/dist/runtime/components/Edit/Features/Help/Shortcuts/index.vue.d.ts +2 -0
  206. package/dist/runtime/components/Edit/Features/Help/index.vue +19 -23
  207. package/dist/runtime/components/Edit/Features/Help/index.vue.d.ts +2 -0
  208. package/dist/runtime/components/Edit/Features/History/List/index.vue +49 -70
  209. package/dist/runtime/components/Edit/Features/History/List/index.vue.d.ts +5 -0
  210. package/dist/runtime/components/Edit/Features/History/index.vue +54 -69
  211. package/dist/runtime/components/Edit/Features/History/index.vue.d.ts +2 -0
  212. package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +48 -66
  213. package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue.d.ts +14 -0
  214. package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +38 -54
  215. package/dist/runtime/components/Edit/Features/ImportExisting/index.vue.d.ts +2 -0
  216. package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +90 -128
  217. package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue.d.ts +13 -0
  218. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue +29 -38
  219. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue.d.ts +9 -0
  220. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +68 -93
  221. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue.d.ts +12 -0
  222. package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +39 -49
  223. package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue.d.ts +12 -0
  224. package/dist/runtime/components/Edit/Features/Library/index.vue +85 -117
  225. package/dist/runtime/components/Edit/Features/Library/index.vue.d.ts +2 -0
  226. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/Item.vue +13 -19
  227. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/Item.vue.d.ts +19 -0
  228. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +76 -112
  229. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue.d.ts +6 -0
  230. package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +107 -140
  231. package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue.d.ts +2 -0
  232. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +128 -188
  233. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue.d.ts +12 -0
  234. package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +42 -57
  235. package/dist/runtime/components/Edit/Features/MultiSelect/index.vue.d.ts +2 -0
  236. package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +27 -34
  237. package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue.d.ts +14 -0
  238. package/dist/runtime/components/Edit/Features/Options/Form/Checkboxes/index.vue +55 -75
  239. package/dist/runtime/components/Edit/Features/Options/Form/Checkboxes/index.vue.d.ts +24 -0
  240. package/dist/runtime/components/Edit/Features/Options/Form/Color/index.vue +18 -21
  241. package/dist/runtime/components/Edit/Features/Options/Form/Color/index.vue.d.ts +12 -0
  242. package/dist/runtime/components/Edit/Features/Options/Form/DateTimeLocal/index.vue +36 -0
  243. package/dist/runtime/components/Edit/Features/Options/Form/DateTimeLocal/index.vue.d.ts +20 -0
  244. package/dist/runtime/components/Edit/Features/Options/Form/Group.vue +7 -9
  245. package/dist/runtime/components/Edit/Features/Options/Form/Group.vue.d.ts +29 -0
  246. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +87 -93
  247. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +14 -0
  248. package/dist/runtime/components/Edit/Features/Options/Form/Number/index.vue +31 -45
  249. package/dist/runtime/components/Edit/Features/Options/Form/Number/index.vue.d.ts +21 -0
  250. package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +55 -79
  251. package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue.d.ts +30 -0
  252. package/dist/runtime/components/Edit/Features/Options/Form/Range/index.vue +23 -33
  253. package/dist/runtime/components/Edit/Features/Options/Form/Range/index.vue.d.ts +18 -0
  254. package/dist/runtime/components/Edit/Features/Options/Form/Text/index.vue +17 -26
  255. package/dist/runtime/components/Edit/Features/Options/Form/Text/index.vue.d.ts +17 -0
  256. package/dist/runtime/components/Edit/Features/Options/Form/index.vue +178 -272
  257. package/dist/runtime/components/Edit/Features/Options/Form/index.vue.d.ts +9 -0
  258. package/dist/runtime/components/Edit/Features/Options/index.vue +38 -69
  259. package/dist/runtime/components/Edit/Features/Options/index.vue.d.ts +2 -0
  260. package/dist/runtime/components/Edit/Features/Ownership/index.vue +27 -34
  261. package/dist/runtime/components/Edit/Features/Ownership/index.vue.d.ts +2 -0
  262. package/dist/runtime/components/Edit/Features/Preview/index.vue +22 -27
  263. package/dist/runtime/components/Edit/Features/Preview/index.vue.d.ts +2 -0
  264. package/dist/runtime/components/Edit/Features/PreviewGrant/QrCode/index.vue +12 -16
  265. package/dist/runtime/components/Edit/Features/PreviewGrant/QrCode/index.vue.d.ts +5 -0
  266. package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +31 -36
  267. package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue.d.ts +2 -0
  268. package/dist/runtime/components/Edit/Features/ProxyView/index.vue +18 -20
  269. package/dist/runtime/components/Edit/Features/ProxyView/index.vue.d.ts +2 -0
  270. package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue +118 -0
  271. package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue.d.ts +18 -0
  272. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +251 -0
  273. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue.d.ts +19 -0
  274. package/dist/runtime/components/Edit/Features/Publish/Dialog/types.d.ts +7 -0
  275. package/dist/runtime/components/Edit/Features/Publish/index.vue +70 -74
  276. package/dist/runtime/components/Edit/Features/Publish/index.vue.d.ts +2 -0
  277. package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue +48 -54
  278. package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue.d.ts +27 -0
  279. package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +77 -103
  280. package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue.d.ts +2 -0
  281. package/dist/runtime/components/Edit/Features/Revert/index.vue +27 -32
  282. package/dist/runtime/components/Edit/Features/Revert/index.vue.d.ts +2 -0
  283. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +67 -88
  284. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue.d.ts +17 -0
  285. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +89 -139
  286. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue.d.ts +18 -0
  287. package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue +79 -108
  288. package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue.d.ts +12 -0
  289. package/dist/runtime/components/Edit/Features/Search/index.vue +30 -37
  290. package/dist/runtime/components/Edit/Features/Search/index.vue.d.ts +2 -0
  291. package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +67 -103
  292. package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue.d.ts +9 -0
  293. package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +28 -36
  294. package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue.d.ts +5 -0
  295. package/dist/runtime/components/Edit/Features/Selection/index.vue +131 -217
  296. package/dist/runtime/components/Edit/Features/Selection/index.vue.d.ts +2 -0
  297. package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +50 -81
  298. package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue.d.ts +9 -0
  299. package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +73 -117
  300. package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue.d.ts +6 -0
  301. package/dist/runtime/components/Edit/Features/Settings/index.vue +41 -53
  302. package/dist/runtime/components/Edit/Features/Settings/index.vue.d.ts +2 -0
  303. package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +65 -101
  304. package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue.d.ts +15 -0
  305. package/dist/runtime/components/Edit/Features/Structure/List/Item/index.vue +71 -99
  306. package/dist/runtime/components/Edit/Features/Structure/List/Item/index.vue.d.ts +12 -0
  307. package/dist/runtime/components/Edit/Features/Structure/List/index.vue +17 -26
  308. package/dist/runtime/components/Edit/Features/Structure/List/index.vue.d.ts +12 -0
  309. package/dist/runtime/components/Edit/Features/Structure/index.vue +31 -40
  310. package/dist/runtime/components/Edit/Features/Structure/index.vue.d.ts +2 -0
  311. package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +32 -53
  312. package/dist/runtime/components/Edit/Features/Theme/Color/index.vue.d.ts +7 -0
  313. package/dist/runtime/components/Edit/Features/Theme/GeneratedCode/index.vue +7 -10
  314. package/dist/runtime/components/Edit/Features/Theme/GeneratedCode/index.vue.d.ts +2 -0
  315. package/dist/runtime/components/Edit/Features/Theme/index.vue +49 -63
  316. package/dist/runtime/components/Edit/Features/Theme/index.vue.d.ts +2 -0
  317. package/dist/runtime/components/Edit/Features/TouchActionBar/Bar/index.vue +9 -10
  318. package/dist/runtime/components/Edit/Features/TouchActionBar/Bar/index.vue.d.ts +12 -0
  319. package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +16 -19
  320. package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue.d.ts +2 -0
  321. package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +119 -174
  322. package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue.d.ts +6 -0
  323. package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue +10 -12
  324. package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue.d.ts +8 -0
  325. package/dist/runtime/components/Edit/Features/Tour/index.vue +21 -25
  326. package/dist/runtime/components/Edit/Features/Tour/index.vue.d.ts +2 -0
  327. package/dist/runtime/components/Edit/Features/Transform/index.vue +80 -120
  328. package/dist/runtime/components/Edit/Features/Transform/index.vue.d.ts +2 -0
  329. package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +21 -29
  330. package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue.d.ts +6 -0
  331. package/dist/runtime/components/Edit/Features/Translations/index.vue +96 -139
  332. package/dist/runtime/components/Edit/Features/Translations/index.vue.d.ts +2 -0
  333. package/dist/runtime/components/Edit/Features/Validations/Overlay/Item.vue +21 -35
  334. package/dist/runtime/components/Edit/Features/Validations/Overlay/Item.vue.d.ts +6 -0
  335. package/dist/runtime/components/Edit/Features/Validations/Overlay/index.vue +30 -39
  336. package/dist/runtime/components/Edit/Features/Validations/Overlay/index.vue.d.ts +6 -0
  337. package/dist/runtime/components/Edit/Features/Validations/SidebarItem/index.vue +20 -28
  338. package/dist/runtime/components/Edit/Features/Validations/SidebarItem/index.vue.d.ts +9 -0
  339. package/dist/runtime/components/Edit/Features/Validations/index.vue +27 -33
  340. package/dist/runtime/components/Edit/Features/Validations/index.vue.d.ts +2 -0
  341. package/dist/runtime/components/Edit/Features/index.vue +33 -52
  342. package/dist/runtime/components/Edit/Features/index.vue.d.ts +6 -0
  343. package/dist/runtime/components/Edit/Form/Group/index.vue +23 -0
  344. package/dist/runtime/components/Edit/Form/Group/index.vue.d.ts +20 -0
  345. package/dist/runtime/components/Edit/Form/Item/index.vue +5 -0
  346. package/dist/runtime/components/Edit/Form/Item/index.vue.d.ts +14 -0
  347. package/dist/runtime/components/Edit/Form/Textarea/index.vue +27 -0
  348. package/dist/runtime/components/Edit/Form/Textarea/index.vue.d.ts +16 -0
  349. package/dist/runtime/components/Edit/Form/Toggle/index.vue +21 -0
  350. package/dist/runtime/components/Edit/Form/Toggle/index.vue.d.ts +14 -0
  351. package/dist/runtime/components/Edit/FormOverlay/Header/index.vue +11 -22
  352. package/dist/runtime/components/Edit/FormOverlay/Header/index.vue.d.ts +18 -0
  353. package/dist/runtime/components/Edit/FormOverlay/index.vue +15 -21
  354. package/dist/runtime/components/Edit/FormOverlay/index.vue.d.ts +25 -0
  355. package/dist/runtime/components/Edit/Highlight/index.vue +31 -70
  356. package/dist/runtime/components/Edit/Highlight/index.vue.d.ts +20 -0
  357. package/dist/runtime/components/Edit/Icon/index.vue +11 -14
  358. package/dist/runtime/components/Edit/Icon/index.vue.d.ts +7 -0
  359. package/dist/runtime/components/Edit/InfoBox/index.vue +5 -6
  360. package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +5 -0
  361. package/dist/runtime/components/Edit/ItemIcon/index.vue +13 -13
  362. package/dist/runtime/components/Edit/ItemIcon/index.vue.d.ts +6 -0
  363. package/dist/runtime/components/Edit/Loading/index.vue +8 -9
  364. package/dist/runtime/components/Edit/Loading/index.vue.d.ts +6 -0
  365. package/dist/runtime/components/Edit/Messages/Item/index.vue +30 -41
  366. package/dist/runtime/components/Edit/Messages/Item/index.vue.d.ts +11 -0
  367. package/dist/runtime/components/Edit/Messages/index.vue +13 -17
  368. package/dist/runtime/components/Edit/Messages/index.vue.d.ts +2 -0
  369. package/dist/runtime/components/Edit/Pagination/index.vue +6 -8
  370. package/dist/runtime/components/Edit/Pagination/index.vue.d.ts +12 -0
  371. package/dist/runtime/components/Edit/PreviewProvider.vue +124 -177
  372. package/dist/runtime/components/Edit/PreviewProvider.vue.d.ts +24 -0
  373. package/dist/runtime/components/Edit/RelativeTime/index.vue +19 -25
  374. package/dist/runtime/components/Edit/RelativeTime/index.vue.d.ts +15 -0
  375. package/dist/runtime/components/Edit/Resizable/index.vue +45 -55
  376. package/dist/runtime/components/Edit/Resizable/index.vue.d.ts +13 -0
  377. package/dist/runtime/components/Edit/ScaleToFit/index.vue +44 -62
  378. package/dist/runtime/components/Edit/ScaleToFit/index.vue.d.ts +15 -0
  379. package/dist/runtime/components/Edit/ScrollBoundary/index.vue +11 -27
  380. package/dist/runtime/components/Edit/ScrollBoundary/index.vue.d.ts +23 -0
  381. package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +47 -59
  382. package/dist/runtime/components/Edit/ShortcutIndicator/index.vue.d.ts +20 -0
  383. package/dist/runtime/components/Edit/Sortli/index.vue +45 -59
  384. package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +14 -0
  385. package/dist/runtime/components/Edit/SystemRequirements/index.vue +29 -43
  386. package/dist/runtime/components/Edit/SystemRequirements/index.vue.d.ts +2 -0
  387. package/dist/runtime/components/Edit/Toolbar/index.vue +26 -41
  388. package/dist/runtime/components/Edit/Toolbar/index.vue.d.ts +6 -0
  389. package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue +29 -51
  390. package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +20 -0
  391. package/dist/runtime/components/Edit/index.d.ts +5 -1
  392. package/dist/runtime/components/Edit/index.js +9 -1
  393. package/dist/runtime/composables/defineBlokkli.d.ts +2 -2
  394. package/dist/runtime/composables/defineBlokkli.js +29 -11
  395. package/dist/runtime/composables/defineBlokkliFragment.d.ts +1 -1
  396. package/dist/runtime/composables/defineBlokkliFragment.js +16 -24
  397. package/dist/runtime/css/output.css +1 -1
  398. package/dist/runtime/helpers/definitionProvider.d.ts +18 -0
  399. package/dist/runtime/helpers/definitionProvider.js +96 -0
  400. package/dist/runtime/helpers/domProvider.d.ts +2 -1
  401. package/dist/runtime/helpers/domProvider.js +6 -3
  402. package/dist/runtime/helpers/editComponents/index.d.ts +2 -0
  403. package/dist/runtime/helpers/editComponents/index.js +10 -0
  404. package/dist/runtime/helpers/featuresProvider.d.ts +2 -1
  405. package/dist/runtime/helpers/featuresProvider.js +19 -10
  406. package/dist/runtime/helpers/frameEventBus.d.ts +1 -1
  407. package/dist/runtime/helpers/imports/index.d.ts +1 -0
  408. package/dist/runtime/helpers/imports/index.js +44 -0
  409. package/dist/runtime/helpers/index.js +5 -8
  410. package/dist/runtime/helpers/runtimeHelpers/index.d.ts +5 -0
  411. package/dist/runtime/helpers/runtimeHelpers/index.js +17 -4
  412. package/dist/runtime/helpers/stateProvider.d.ts +1 -1
  413. package/dist/runtime/helpers/textProvider.d.ts +1 -1
  414. package/dist/runtime/helpers/themeProvider.js +4 -1
  415. package/dist/runtime/helpers/transform.d.ts +1 -1
  416. package/dist/runtime/helpers/typesProvider.d.ts +2 -2
  417. package/dist/runtime/helpers/uiProvider.js +4 -5
  418. package/dist/runtime/helpers/webgl/index.js +1 -1
  419. package/dist/runtime/icons/arrow-right-thin.svg +3 -0
  420. package/dist/runtime/public/_blokkli-assets/check.svg +6 -0
  421. package/dist/runtime/public/_blokkli-assets/loader.svg +1 -0
  422. package/dist/runtime/types/blokkOptions.d.ts +11 -2
  423. package/dist/runtime/types/index.d.ts +34 -14
  424. package/dist/shared/editor.gz_ac6uT.d.mts +431 -0
  425. package/dist/types.d.mts +1 -1
  426. package/package.json +30 -25
  427. package/dist/module.cjs +0 -5
  428. package/dist/module.d.ts +0 -198
  429. package/dist/runtime/adapter/drupal/graphql/base.graphql +0 -944
  430. package/dist/runtime/adapter/drupal/graphqlMiddleware.d.ts +0 -2
  431. package/dist/runtime/adapter/drupal/graphqlMiddleware.js +0 -680
  432. package/dist/runtime/types/generatedModuleTypes.d.ts +0 -49
  433. package/dist/types.d.ts +0 -1
  434. /package/dist/{runtime/adapter/drupal/graphql → modules/drupal/graphql/features}/comments.graphql +0 -0
  435. /package/dist/{runtime/adapter/drupal/graphql → modules/drupal/graphql/features}/fragments.graphql +0 -0
  436. /package/dist/{runtime/adapter/drupal/graphql → modules/drupal/graphql/features}/search.graphql +0 -0
  437. /package/dist/{runtime/adapter/drupal/graphql → modules/drupal/graphql/features}/transform.graphql +0 -0
  438. /package/dist/runtime/{types/generatedModuleTypes.js → components/Edit/Features/Publish/Dialog/types.js} +0 -0
  439. /package/dist/runtime/public/{Inter.var.woff2 → _blokkli-assets/Inter.var.woff2} +0 -0
@@ -2,477 +2,363 @@
2
2
  <div />
3
3
  </template>
4
4
 
5
- <script setup lang="ts">
5
+ <script setup>
6
6
  import {
7
7
  falsy,
8
8
  getDistance,
9
9
  getInteractionCoordinates,
10
- isInsideRect,
11
- } from '#blokkli/helpers'
12
- import onBlokkliEvent from '#blokkli/helpers/composables/onBlokkliEvent'
13
- import type { Coord, Rectangle } from '#blokkli/types'
14
- import { watch, ref, useBlokkli, onMounted, onBeforeUnmount } from '#imports'
15
-
16
- const { dom, eventBus, selection, keyboard, ui, state } = useBlokkli()
17
-
18
- const rootEl = ui.rootElement()
19
-
20
- const rects = ref<{ uuid: string; rect: Rectangle }[]>([])
21
-
10
+ isInsideRect
11
+ } from "#blokkli/helpers";
12
+ import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
13
+ import { watch, ref, useBlokkli, onMounted, onBeforeUnmount } from "#imports";
14
+ const { dom, eventBus, selection, keyboard, ui, state } = useBlokkli();
15
+ const rootEl = ui.rootElement();
16
+ const rects = ref([]);
22
17
  function buildRects() {
23
- const visible = dom.getVisibleBlocks()
24
- rects.value = visible
25
- .map((uuid) => {
26
- const rect = dom.getBlockRect(uuid)
27
- if (!rect) {
28
- return
29
- }
30
- return { uuid, rect }
31
- })
32
- .filter(falsy)
33
- }
34
-
35
- watch(dom.isReady, buildRects)
36
-
37
- type InteractedElement = {
38
- uuid?: string
39
- editableFieldName?: string
40
- timestamp: number
41
- x: number
42
- y: number
18
+ const visible = dom.getVisibleBlocks();
19
+ rects.value = visible.map((uuid) => {
20
+ const rect = dom.getBlockRect(uuid);
21
+ if (!rect) {
22
+ return;
23
+ }
24
+ return { uuid, rect };
25
+ }).filter(falsy);
43
26
  }
44
-
45
- let lastInteractedElement: InteractedElement | null = null
46
- let pointerDownElement: InteractedElement | null = null
47
- let mouseStartCoordinates: Coord | null = null
48
-
49
- function getInteractedElement(
50
- e: MouseEvent | TouchEvent,
51
- ): InteractedElement | null {
52
- const { x, y } = getInteractionCoordinates(e)
53
- const elements = document.elementsFromPoint(x, y)
54
-
55
- let editableFieldName = ''
56
- let uuid = ''
57
-
27
+ watch(dom.isReady, buildRects);
28
+ let lastInteractedElement = null;
29
+ let pointerDownElement = null;
30
+ let mouseStartCoordinates = null;
31
+ function getInteractedElement(e) {
32
+ const { x, y } = getInteractionCoordinates(e);
33
+ const elements = document.elementsFromPoint(x, y);
34
+ let editableFieldName = "";
35
+ let uuid = "";
58
36
  for (let i = 0; i < elements.length; i++) {
59
- let el: Element = elements[i]
60
-
37
+ let el = elements[i];
61
38
  if (!(el instanceof HTMLElement)) {
62
- continue
39
+ continue;
63
40
  }
64
-
65
41
  if (el.dataset.blokkliEditableField) {
66
- editableFieldName = el.dataset.blokkliEditableField
42
+ editableFieldName = el.dataset.blokkliEditableField;
67
43
  }
68
-
69
- // elementsFromPoint() does not contain the <tr> element if the deepest element is a <td> or <th>.
70
- // In this case, we have to use direct parent element which is always going to be <tr>.
71
- // This fixes the scenario where the root element of a block is a <tr>.
72
44
  if (el instanceof HTMLTableCellElement) {
73
- const parent = el.parentElement
45
+ const parent = el.parentElement;
74
46
  if (parent instanceof HTMLTableRowElement) {
75
- el = parent
47
+ el = parent;
76
48
  }
77
49
  }
78
-
79
50
  if (!(el instanceof HTMLElement)) {
80
- continue
51
+ continue;
81
52
  }
82
-
83
53
  if (!el.dataset.uuid) {
84
- continue
54
+ continue;
85
55
  }
86
- const block = dom.findBlock(el.dataset.uuid)
56
+ const block = dom.findBlock(el.dataset.uuid);
87
57
  if (!block) {
88
- continue
58
+ continue;
89
59
  }
90
- const draggableEl = dom.getDragElement(block)
60
+ const draggableEl = dom.getDragElement(block);
91
61
  if (draggableEl && el !== draggableEl && !elements.includes(draggableEl)) {
92
- continue
62
+ continue;
93
63
  }
94
- uuid = el.dataset.uuid
95
- break
64
+ uuid = el.dataset.uuid;
65
+ break;
96
66
  }
97
-
98
67
  if (editableFieldName || uuid) {
99
- return { editableFieldName, uuid, timestamp: Date.now(), x, y }
68
+ return { editableFieldName, uuid, timestamp: Date.now(), x, y };
100
69
  }
101
-
102
- // Try to find a block to select by matching its rects.
103
- // Some blocks might not render anything and thus have a height of 0.
104
- // All registered block rects enfore a minimum height. That way we might
105
- // still be able to select a block.
106
- const visibleUuids = dom.getVisibleBlocks()
70
+ const visibleUuids = dom.getVisibleBlocks();
107
71
  for (let i = 0; i < visibleUuids.length; i++) {
108
- const rect = dom.getBlockRect(visibleUuids[i])
72
+ const rect = dom.getBlockRect(visibleUuids[i]);
109
73
  if (rect) {
110
- const relativeRect = ui.getViewportRelativeRect(rect)
74
+ const relativeRect = ui.getViewportRelativeRect(rect);
111
75
  if (isInsideRect(x, y, relativeRect)) {
112
76
  return {
113
77
  uuid: visibleUuids[i],
114
78
  timestamp: Date.now(),
115
79
  x,
116
- y,
117
- }
80
+ y
81
+ };
118
82
  }
119
83
  }
120
84
  }
121
-
122
- return null
85
+ return null;
123
86
  }
124
-
125
- function onPointerMove(e: PointerEvent) {
126
- if (keyboard.isPressingSpace.value || state.editMode.value !== 'editing') {
127
- return
87
+ function onPointerMove(e) {
88
+ if (keyboard.isPressingSpace.value || state.editMode.value !== "editing") {
89
+ return;
128
90
  }
129
- e.preventDefault()
130
- e.stopPropagation()
131
- e.stopImmediatePropagation()
132
- if (e.pointerType === 'touch') {
133
- return onTouchMove(e)
91
+ e.preventDefault();
92
+ e.stopPropagation();
93
+ e.stopImmediatePropagation();
94
+ if (e.pointerType === "touch") {
95
+ return onTouchMove(e);
134
96
  }
135
97
  if (e.buttons !== 1) {
136
- return
98
+ return;
137
99
  }
138
- if (
139
- !pointerDownElement ||
140
- !mouseStartCoordinates ||
141
- selection.isDragging.value ||
142
- keyboard.isPressingSpace.value ||
143
- selection.isMultiSelecting.value
144
- ) {
145
- return
100
+ if (!pointerDownElement || !mouseStartCoordinates || selection.isDragging.value || keyboard.isPressingSpace.value || selection.isMultiSelecting.value) {
101
+ return;
146
102
  }
147
-
148
- const diffX = Math.abs(mouseStartCoordinates.x - e.clientX)
149
- const diffY = Math.abs(mouseStartCoordinates.y - e.clientY)
150
- // Only start dragging if at least 6px in any direction were moved.
103
+ const diffX = Math.abs(mouseStartCoordinates.x - e.clientX);
104
+ const diffY = Math.abs(mouseStartCoordinates.y - e.clientY);
151
105
  if (diffX < 6 && diffY < 6) {
152
- return
106
+ return;
153
107
  }
154
-
155
- const interacted = getInteractedElement(e)
108
+ const interacted = getInteractedElement(e);
156
109
  if (interacted && interacted.uuid) {
157
- // The interacted block is part of the current selection.
158
110
  if (selection.uuids.value.includes(interacted.uuid)) {
159
- eventBus.emit('dragging:start', {
111
+ eventBus.emit("dragging:start", {
160
112
  items: [...selection.blocks.value],
161
113
  coords: { x: e.clientX, y: e.clientY },
162
- mode: 'mouse',
163
- })
114
+ mode: "mouse"
115
+ });
164
116
  } else {
165
- const block = dom.findBlock(interacted.uuid)
117
+ const block = dom.findBlock(interacted.uuid);
166
118
  if (block) {
167
- eventBus.emit('dragging:start', {
119
+ eventBus.emit("dragging:start", {
168
120
  items: [block],
169
121
  coords: { x: e.clientX, y: e.clientY },
170
- mode: 'mouse',
171
- })
122
+ mode: "mouse"
123
+ });
172
124
  }
173
125
  }
174
126
  }
175
127
  }
176
-
177
- let pointerDownTimestamp = 0
178
- let pointerUpTimestamp = 0
179
-
180
- function onPointerDown(e: PointerEvent) {
128
+ let pointerDownTimestamp = 0;
129
+ let pointerUpTimestamp = 0;
130
+ function onPointerDown(e) {
181
131
  if (!keyboard.isPressingSpace.value) {
182
- e.preventDefault()
183
- e.stopPropagation()
184
- e.stopImmediatePropagation()
132
+ e.preventDefault();
133
+ e.stopPropagation();
134
+ e.stopImmediatePropagation();
185
135
  }
186
- // Set the state of the pressed shortcuts.
187
- keyboard.setShortcutStateFromEvent(e)
188
-
189
- rootEl.removeEventListener('pointermove', onPointerMove)
136
+ keyboard.setShortcutStateFromEvent(e);
137
+ rootEl.removeEventListener("pointermove", onPointerMove);
190
138
  if (state.isLoading.value) {
191
- return
139
+ return;
192
140
  }
193
- rootEl.addEventListener('pointermove', onPointerMove)
194
-
195
- if (e.pointerType === 'touch') {
196
- return onTouchStart(e)
141
+ rootEl.addEventListener("pointermove", onPointerMove);
142
+ if (e.pointerType === "touch") {
143
+ return onTouchStart(e);
197
144
  }
198
-
199
- // If we are already dragging, return.
200
- // This might be the case if a dragging:start event was manually triggered,
201
- // e.g. when selecting a draggable item using the keyboard.
202
145
  if (selection.isDragging.value) {
203
- return
146
+ return;
204
147
  }
205
-
206
- const coords = { x: e.clientX, y: e.clientY }
207
- // Only handle click interactions when:
208
- // - not pressing the shift key
209
- // - using the left mouse button
148
+ const coords = { x: e.clientX, y: e.clientY };
210
149
  if (!e.shiftKey && e.buttons !== 2) {
211
- pointerDownTimestamp = Date.now()
212
- mouseStartCoordinates = coords
213
-
214
- const interacted = getInteractedElement(e)
215
- pointerDownElement = interacted
150
+ pointerDownTimestamp = Date.now();
151
+ mouseStartCoordinates = coords;
152
+ const interacted = getInteractedElement(e);
153
+ pointerDownElement = interacted;
216
154
  if (interacted) {
217
- return
155
+ return;
218
156
  }
219
157
  }
220
-
221
- // Either pressing shift or right mouse button.
222
- // Features may handle this via event (e.g. start multi select).
223
- eventBus.emit('mouse:down', { ...coords, type: 'mouse', distance: 0 })
158
+ eventBus.emit("mouse:down", { ...coords, type: "mouse", distance: 0 });
224
159
  }
225
-
226
- function onPointerUp(e: PointerEvent) {
227
- rootEl.removeEventListener('pointermove', onPointerMove)
228
- e.preventDefault()
229
- e.stopPropagation()
230
- e.stopImmediatePropagation()
231
- // This is required because emitting the mouse:up event would set this value to false.
232
- const wasDragging = selection.isDragging.value
233
- const wasMultiSelecting = selection.isMultiSelecting.value
234
- pointerDownElement = null
235
-
160
+ function onPointerUp(e) {
161
+ rootEl.removeEventListener("pointermove", onPointerMove);
162
+ e.preventDefault();
163
+ e.stopPropagation();
164
+ e.stopImmediatePropagation();
165
+ const wasDragging = selection.isDragging.value;
166
+ const wasMultiSelecting = selection.isMultiSelecting.value;
167
+ pointerDownElement = null;
236
168
  if (state.isLoading.value) {
237
- return
169
+ return;
238
170
  }
239
-
240
- if (e.pointerType === 'touch') {
241
- return onTouchEnd(e)
171
+ if (e.pointerType === "touch") {
172
+ return onTouchEnd(e);
242
173
  }
243
- const coords = getInteractionCoordinates(e)
244
- const distance = mouseStartCoordinates
245
- ? getDistance(mouseStartCoordinates, coords)
246
- : 0
247
- eventBus.emit('mouse:up', {
174
+ const coords = getInteractionCoordinates(e);
175
+ const distance = mouseStartCoordinates ? getDistance(mouseStartCoordinates, coords) : 0;
176
+ eventBus.emit("mouse:up", {
248
177
  x: e.clientX,
249
178
  y: e.clientY,
250
- type: 'mouse',
179
+ type: "mouse",
251
180
  distance,
252
- duration: Date.now() - pointerDownTimestamp,
253
- })
254
-
255
- // Prevents selecting the block under the current pointer position when dragging or multi selecting is ending.
181
+ duration: Date.now() - pointerDownTimestamp
182
+ });
256
183
  if (wasDragging || wasMultiSelecting) {
257
- eventBus.emit('dragging:end')
258
- return
184
+ eventBus.emit("dragging:end");
185
+ return;
259
186
  }
260
187
  if (keyboard.isPressingSpace.value) {
261
- return
188
+ return;
262
189
  }
263
190
  if (selection.editableActive.value) {
264
- eventBus.emit('window:clickAway')
265
- lastInteractedElement = null
266
- return
191
+ eventBus.emit("window:clickAway");
192
+ lastInteractedElement = null;
193
+ return;
267
194
  }
268
- const clicked = getInteractedElement(e)
269
-
270
- // Handle double clicking.
271
- if (
272
- clicked &&
273
- pointerUpTimestamp &&
274
- lastInteractedElement &&
275
- (clicked.uuid === lastInteractedElement.uuid ||
276
- clicked.editableFieldName === lastInteractedElement.editableFieldName)
277
- ) {
278
- const deltaTime = Date.now() - pointerUpTimestamp
279
- const deltaX = Math.abs(lastInteractedElement.x - e.clientX)
280
- const deltaY = Math.abs(lastInteractedElement.y - e.clientY)
195
+ const clicked = getInteractedElement(e);
196
+ if (clicked && pointerUpTimestamp && lastInteractedElement && (clicked.uuid === lastInteractedElement.uuid || clicked.editableFieldName === lastInteractedElement.editableFieldName)) {
197
+ const deltaTime = Date.now() - pointerUpTimestamp;
198
+ const deltaX = Math.abs(lastInteractedElement.x - e.clientX);
199
+ const deltaY = Math.abs(lastInteractedElement.y - e.clientY);
281
200
  if (deltaTime < 400 && deltaX < 3 && deltaY < 3) {
282
201
  if (clicked.editableFieldName) {
283
- eventBus.emit('editable:focus', {
202
+ eventBus.emit("editable:focus", {
284
203
  fieldName: clicked.editableFieldName,
285
- uuid: clicked.uuid,
286
- })
287
- return
204
+ uuid: clicked.uuid
205
+ });
206
+ return;
288
207
  }
289
208
  if (lastInteractedElement.uuid) {
290
- const block = dom.findBlock(lastInteractedElement.uuid)
209
+ const block = dom.findBlock(lastInteractedElement.uuid);
291
210
  if (!block) {
292
- return
211
+ return;
293
212
  }
294
- eventBus.emit('item:doubleClick', block)
213
+ eventBus.emit("item:doubleClick", block);
295
214
  }
296
215
  }
297
216
  }
298
- lastInteractedElement = clicked
299
- pointerUpTimestamp = Date.now()
217
+ lastInteractedElement = clicked;
218
+ pointerUpTimestamp = Date.now();
300
219
  if (clicked?.uuid) {
301
- dom.refreshBlockRect(clicked.uuid)
220
+ dom.refreshBlockRect(clicked.uuid);
302
221
  if (keyboard.isPressingControl.value || selection.isMultiSelecting.value) {
303
- // Toggle the clicked block.
304
- eventBus.emit('select:toggle', clicked.uuid)
222
+ eventBus.emit("select:toggle", clicked.uuid);
305
223
  } else if (keyboard.isPressingShift.value) {
306
- eventBus.emit('select:shiftToggle', clicked.uuid)
224
+ eventBus.emit("select:shiftToggle", clicked.uuid);
307
225
  } else {
308
- eventBus.emit('select', clicked.uuid)
226
+ eventBus.emit("select", clicked.uuid);
309
227
  }
310
- return
228
+ return;
311
229
  }
312
- eventBus.emit('window:clickAway')
230
+ eventBus.emit("window:clickAway");
313
231
  }
314
-
315
- let longPressTimeout: any = null
316
-
317
- let touchStartInteraction: InteractedElement | null = null
318
- let touchStartCoords: Coord | null = null
319
- let longPressInteraction: InteractedElement | null = null
320
-
321
- let touchStartTimestamp = 0
322
-
323
- function onTouchStart(e: PointerEvent) {
232
+ let longPressTimeout = null;
233
+ let touchStartInteraction = null;
234
+ let touchStartCoords = null;
235
+ let longPressInteraction = null;
236
+ let touchStartTimestamp = 0;
237
+ function onTouchStart(e) {
324
238
  if (e.isPrimary) {
325
- touchStartTimestamp = Date.now()
239
+ touchStartTimestamp = Date.now();
326
240
  }
327
- longPressInteraction = null
328
- const coords = getInteractionCoordinates(e)
329
- touchStartCoords = coords
330
- eventBus.emit('mouse:down', { ...coords, type: 'touch', distance: 0 })
241
+ longPressInteraction = null;
242
+ const coords = getInteractionCoordinates(e);
243
+ touchStartCoords = coords;
244
+ eventBus.emit("mouse:down", { ...coords, type: "touch", distance: 0 });
331
245
  if (selection.isDragging.value) {
332
- return
246
+ return;
333
247
  }
334
- clearTimeout(longPressTimeout)
335
-
336
- const interacted = getInteractedElement(e)
248
+ clearTimeout(longPressTimeout);
249
+ const interacted = getInteractedElement(e);
337
250
  if (!interacted?.uuid) {
338
- return
251
+ return;
339
252
  }
340
-
341
- touchStartInteraction = interacted
342
-
253
+ touchStartInteraction = interacted;
343
254
  longPressTimeout = setTimeout(() => {
344
- // Block is already selected. Start dragging.
345
255
  if (touchStartInteraction?.uuid) {
346
- longPressInteraction = touchStartInteraction
347
- if (
348
- selection.uuids.value.includes(touchStartInteraction.uuid) &&
349
- state.editMode.value === 'editing'
350
- ) {
351
- eventBus.emit('dragging:start', {
256
+ longPressInteraction = touchStartInteraction;
257
+ if (selection.uuids.value.includes(touchStartInteraction.uuid) && state.editMode.value === "editing") {
258
+ eventBus.emit("dragging:start", {
352
259
  items: [...selection.blocks.value],
353
260
  coords: {
354
261
  x: touchStartInteraction.x,
355
- y: touchStartInteraction.y,
262
+ y: touchStartInteraction.y
356
263
  },
357
- mode: 'touch',
358
- })
359
- return
264
+ mode: "touch"
265
+ });
266
+ return;
360
267
  }
361
-
362
- // Start multiselecting.
363
- eventBus.emit('select:start', {
268
+ eventBus.emit("select:start", {
364
269
  uuids: [...selection.uuids.value, touchStartInteraction.uuid],
365
- mode: 'touch',
366
- })
270
+ mode: "touch"
271
+ });
367
272
  }
368
- }, 500)
273
+ }, 500);
369
274
  }
370
-
371
- function onTouchMove(e: PointerEvent) {
275
+ function onTouchMove(e) {
372
276
  if (!longPressTimeout || !touchStartInteraction) {
373
- return
277
+ return;
374
278
  }
375
- const coords = getInteractionCoordinates(e)
376
-
377
- const deltaX = Math.abs(coords.x - touchStartInteraction.x)
378
- const deltaY = Math.abs(coords.y - touchStartInteraction.y)
379
-
279
+ const coords = getInteractionCoordinates(e);
280
+ const deltaX = Math.abs(coords.x - touchStartInteraction.x);
281
+ const deltaY = Math.abs(coords.y - touchStartInteraction.y);
380
282
  if (deltaX > 10 || deltaY > 10) {
381
- clearTimeout(longPressTimeout)
382
- longPressTimeout = null
283
+ clearTimeout(longPressTimeout);
284
+ longPressTimeout = null;
383
285
  }
384
286
  }
385
-
386
- function onTouchEnd(e: PointerEvent) {
387
- const wasDragging = selection.isDragging.value
388
- const coords = getInteractionCoordinates(e)
389
- const distance = touchStartCoords ? getDistance(touchStartCoords, coords) : 0
287
+ function onTouchEnd(e) {
288
+ const wasDragging = selection.isDragging.value;
289
+ const coords = getInteractionCoordinates(e);
290
+ const distance = touchStartCoords ? getDistance(touchStartCoords, coords) : 0;
390
291
  if (e.isPrimary) {
391
- eventBus.emit('mouse:up', {
292
+ eventBus.emit("mouse:up", {
392
293
  ...coords,
393
- type: 'touch',
294
+ type: "touch",
394
295
  distance,
395
- duration: Date.now() - touchStartTimestamp,
396
- })
296
+ duration: Date.now() - touchStartTimestamp
297
+ });
397
298
  }
398
- clearTimeout(longPressTimeout)
399
- longPressTimeout = null
299
+ clearTimeout(longPressTimeout);
300
+ longPressTimeout = null;
400
301
  if (wasDragging) {
401
- return
302
+ return;
402
303
  }
403
304
  if (!touchStartCoords) {
404
- return
305
+ return;
405
306
  }
406
-
407
- // If the distance is abve this value, don't do anything. The user is likely scrolling.
408
307
  if (distance > 7) {
409
- return
308
+ return;
410
309
  }
411
- const interacted = getInteractedElement(e)
310
+ const interacted = getInteractedElement(e);
412
311
  if (interacted?.uuid) {
413
- // Prevent unselecting the block after a long press interaction, which has already selected the block.
414
312
  if (longPressInteraction && longPressInteraction.uuid === interacted.uuid) {
415
- return
313
+ return;
416
314
  }
417
315
  if (selection.isMultiSelecting.value) {
418
- eventBus.emit('select:toggle', interacted.uuid)
316
+ eventBus.emit("select:toggle", interacted.uuid);
419
317
  } else {
420
- eventBus.emit('select', interacted.uuid)
318
+ eventBus.emit("select", interacted.uuid);
421
319
  }
422
320
  } else {
423
- eventBus.emit('window:clickAway')
321
+ eventBus.emit("window:clickAway");
424
322
  }
425
- longPressInteraction = null
323
+ longPressInteraction = null;
426
324
  }
427
-
428
- onBlokkliEvent('dragging:start', (e) => {
429
- mouseStartCoordinates = e.coords
430
- })
431
-
432
- function onClick(e: MouseEvent) {
433
- e.preventDefault()
434
- e.stopImmediatePropagation()
435
- e.stopPropagation()
325
+ onBlokkliEvent("dragging:start", (e) => {
326
+ mouseStartCoordinates = e.coords;
327
+ });
328
+ function onClick(e) {
329
+ e.preventDefault();
330
+ e.stopImmediatePropagation();
331
+ e.stopPropagation();
436
332
  }
437
-
438
333
  onMounted(() => {
439
- const providerElement = ui.providerElement()
440
-
441
- providerElement.addEventListener('click', onClick, {
442
- capture: true,
443
- })
444
-
445
- rootEl.addEventListener('click', onClick, {
446
- capture: true,
447
- })
448
-
449
- rootEl.addEventListener('pointerdown', onPointerDown, {
450
- capture: true,
451
- })
452
-
453
- rootEl.addEventListener('pointerup', onPointerUp, {
454
- capture: true,
455
- })
456
- })
457
-
334
+ const providerElement = ui.providerElement();
335
+ providerElement.addEventListener("click", onClick, {
336
+ capture: true
337
+ });
338
+ rootEl.addEventListener("click", onClick, {
339
+ capture: true
340
+ });
341
+ rootEl.addEventListener("pointerdown", onPointerDown, {
342
+ capture: true
343
+ });
344
+ rootEl.addEventListener("pointerup", onPointerUp, {
345
+ capture: true
346
+ });
347
+ });
458
348
  onBeforeUnmount(() => {
459
- const providerElement = ui.providerElement()
460
-
461
- providerElement.removeEventListener('click', onClick, {
462
- capture: true,
463
- })
464
-
465
- rootEl.removeEventListener('click', onClick, {
466
- capture: true,
467
- })
468
-
469
- rootEl.removeEventListener('pointerdown', onPointerDown, {
470
- capture: true,
471
- })
472
- rootEl.removeEventListener('pointermove', onPointerMove)
473
-
474
- rootEl.removeEventListener('pointerup', onPointerUp, {
475
- capture: true,
476
- })
477
- })
349
+ const providerElement = ui.providerElement();
350
+ providerElement.removeEventListener("click", onClick, {
351
+ capture: true
352
+ });
353
+ rootEl.removeEventListener("click", onClick, {
354
+ capture: true
355
+ });
356
+ rootEl.removeEventListener("pointerdown", onPointerDown, {
357
+ capture: true
358
+ });
359
+ rootEl.removeEventListener("pointermove", onPointerMove);
360
+ rootEl.removeEventListener("pointerup", onPointerUp, {
361
+ capture: true
362
+ });
363
+ });
478
364
  </script>