@blokkli/editor 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (428) hide show
  1. package/dist/module.d.mts +1 -1
  2. package/dist/module.json +5 -5
  3. package/dist/module.mjs +5549 -1269
  4. package/dist/modules/drupal/graphql/base/fragment.ParagraphsBlokkliConfigInput.graphql +31 -0
  5. package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +9 -0
  6. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
  7. package/dist/modules/drupal/graphql/base/fragment.paragraphsFieldItem.graphql +9 -0
  8. package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +1 -10
  9. package/dist/modules/drupal/graphql/base/query.pbEntityConfig.graphql +5 -0
  10. package/dist/modules/drupal/graphql/features/comments.graphql +11 -8
  11. package/dist/modules/drupal/graphql/features/publishNew.graphql +1 -4
  12. package/dist/modules/drupal/graphql/features/scheduler.graphql +31 -0
  13. package/dist/modules/drupal/graphql/features/transform.graphql +9 -1
  14. package/dist/modules/drupal/graphql/features/transform_host.graphql +38 -0
  15. package/dist/modules/drupal/graphql/mutations/set_paragraph_schedule.graphql +15 -0
  16. package/dist/modules/drupal/graphql/mutations/update_host_options.graphql +15 -0
  17. package/dist/modules/drupal/index.d.mts +1 -1
  18. package/dist/modules/drupal/index.mjs +79 -9
  19. package/dist/modules/drupal/runtime/adapter/index.d.ts +3 -0
  20. package/dist/modules/drupal/{adapter/index.mjs → runtime/adapter/index.js} +166 -20
  21. package/dist/runtime/adapter/index.d.ts +111 -1
  22. package/dist/runtime/blokkliPlugins/AddAction/index.vue +27 -3
  23. package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue +65 -0
  24. package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +26 -0
  25. package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +6 -0
  26. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +3 -2
  27. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +2 -19
  28. package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +2 -7
  29. package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +3 -3
  30. package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +2 -19
  31. package/dist/runtime/blokkliPlugins/ItemAction/index.vue +23 -15
  32. package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +21 -44
  33. package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +49 -11
  34. package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +29 -15
  35. package/dist/runtime/blokkliPlugins/MenuButton/index.vue.d.ts +3 -3
  36. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -7
  37. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +2 -51
  38. package/dist/runtime/blokkliPlugins/Sidebar/index.vue +2 -9
  39. package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +15 -9
  40. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +1 -1
  41. package/dist/runtime/blokkliPlugins/TourItem/index.vue +10 -5
  42. package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +2 -4
  43. package/dist/runtime/blokkliPlugins/ViewOption/index.vue +6 -3
  44. package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +4 -3
  45. package/dist/runtime/blokkliPlugins/index.d.ts +8 -7
  46. package/dist/runtime/blokkliPlugins/index.js +15 -13
  47. package/dist/runtime/components/Blocks/Fragment/icon.svg +1 -1
  48. package/dist/runtime/components/Blocks/FromLibrary/index.vue +4 -2
  49. package/dist/runtime/components/BlokkliEditable.vue +34 -16
  50. package/dist/runtime/components/BlokkliEditable.vue.d.ts +2 -1
  51. package/dist/runtime/components/BlokkliField.vue +31 -27
  52. package/dist/runtime/components/BlokkliField.vue.d.ts +61 -17
  53. package/dist/runtime/components/BlokkliItem.vue +2 -2
  54. package/dist/runtime/components/BlokkliItem.vue.d.ts +4 -2
  55. package/dist/runtime/components/BlokkliProvider.vue +60 -45
  56. package/dist/runtime/components/BlokkliProvider.vue.d.ts +45 -7
  57. package/dist/runtime/components/Edit/Actions/index.vue +69 -78
  58. package/dist/runtime/components/Edit/AddListItem/index.vue +2 -5
  59. package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +1 -1
  60. package/dist/runtime/components/Edit/AddListItemIcon/index.vue +19 -0
  61. package/dist/runtime/components/Edit/AddListItemIcon/index.vue.d.ts +15 -0
  62. package/dist/runtime/components/Edit/AnimationCanvas/index.vue +436 -25
  63. package/dist/runtime/components/Edit/AppMenu/index.vue +5 -5
  64. package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +83 -0
  65. package/dist/runtime/components/Edit/ArtboardTooltip/index.vue.d.ts +32 -0
  66. package/dist/runtime/components/Edit/Banner/index.vue +51 -0
  67. package/dist/runtime/components/Edit/Banner/index.vue.d.ts +18 -0
  68. package/dist/runtime/components/Edit/BlockProxy/index.vue +3 -1
  69. package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +2 -13
  70. package/dist/runtime/components/Edit/Dialog/index.vue +14 -5
  71. package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +4 -2
  72. package/dist/runtime/components/Edit/DiffViewer/State.vue +276 -0
  73. package/dist/runtime/components/Edit/DiffViewer/State.vue.d.ts +16 -0
  74. package/dist/runtime/components/Edit/DraggableList.vue +20 -50
  75. package/dist/runtime/components/Edit/DraggableList.vue.d.ts +7 -7
  76. package/dist/runtime/components/Edit/EditIndicator.vue +118 -44
  77. package/dist/runtime/components/Edit/EditIndicator.vue.d.ts +3 -0
  78. package/dist/runtime/components/Edit/EditProvider.vue +192 -80
  79. package/dist/runtime/components/Edit/EditProvider.vue.d.ts +3 -0
  80. package/dist/runtime/components/Edit/Features/AddList/index.vue +24 -36
  81. package/dist/runtime/components/Edit/Features/Analyze/Overlay/fragment.glsl +58 -0
  82. package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +170 -0
  83. package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue.d.ts +9 -0
  84. package/dist/runtime/components/Edit/Features/Analyze/Overlay/vertex.glsl +72 -0
  85. package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue +159 -0
  86. package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue.d.ts +7 -0
  87. package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +100 -0
  88. package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +6 -0
  89. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +56 -0
  90. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +3 -0
  91. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +87 -0
  92. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +7 -0
  93. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +105 -0
  94. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +8 -0
  95. package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue +18 -0
  96. package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue.d.ts +8 -0
  97. package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +92 -0
  98. package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue.d.ts +17 -0
  99. package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue +77 -0
  100. package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue.d.ts +6 -0
  101. package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.d.ts +12 -0
  102. package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +75 -0
  103. package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.d.ts +4 -0
  104. package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.js +5 -0
  105. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +32 -0
  106. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +45 -0
  107. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.d.ts +5 -0
  108. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.js +95 -0
  109. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.d.ts +3 -0
  110. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.js +13 -0
  111. package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.d.ts +2 -0
  112. package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.js +2 -0
  113. package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.d.ts +2 -0
  114. package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +165 -0
  115. package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +44 -0
  116. package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.js +0 -0
  117. package/dist/runtime/components/Edit/Features/Analyze/helper.d.ts +5 -0
  118. package/dist/runtime/components/Edit/Features/Analyze/helper.js +28 -0
  119. package/dist/runtime/components/Edit/Features/Analyze/index.vue +44 -0
  120. package/dist/runtime/components/Edit/Features/Anchors/Renderer.vue +53 -0
  121. package/dist/runtime/components/Edit/Features/Anchors/index.vue +32 -0
  122. package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +25 -13
  123. package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +299 -0
  124. package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue.d.ts +7 -0
  125. package/dist/runtime/components/Edit/Features/Artboard/index.vue +10 -217
  126. package/dist/runtime/components/Edit/Features/Assistant/index.vue +5 -3
  127. package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +33 -57
  128. package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue +154 -0
  129. package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue.d.ts +27 -0
  130. package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +222 -0
  131. package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue.d.ts +11 -0
  132. package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +96 -0
  133. package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue.d.ts +2 -0
  134. package/dist/runtime/components/Edit/Features/Clipboard/index.vue +177 -46
  135. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +51 -0
  136. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +17 -0
  137. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +48 -117
  138. package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +5 -2
  139. package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +35 -20
  140. package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue.d.ts +5 -3
  141. package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue +29 -0
  142. package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue.d.ts +13 -0
  143. package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +22 -16
  144. package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue.d.ts +1 -0
  145. package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +15 -6
  146. package/dist/runtime/components/Edit/Features/Comments/index.vue +21 -9
  147. package/dist/runtime/components/Edit/Features/Conversions/index.vue +16 -21
  148. package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +26 -35
  149. package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +240 -0
  150. package/dist/runtime/components/Edit/Features/Debug/Renderer.vue.d.ts +6 -0
  151. package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +14 -0
  152. package/dist/runtime/components/Edit/Features/Debug/index.vue +7 -162
  153. package/dist/runtime/components/Edit/Features/Delete/index.vue +1 -1
  154. package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +13 -190
  155. package/dist/runtime/components/Edit/Features/Diff/index.vue +2 -2
  156. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +18 -10
  157. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +8 -2
  158. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +111 -121
  159. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue.d.ts +3 -132
  160. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +2 -1
  161. package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +87 -61
  162. package/dist/runtime/components/Edit/Features/Duplicate/index.vue +6 -8
  163. package/dist/runtime/components/Edit/Features/Edit/index.vue +16 -22
  164. package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +3 -3
  165. package/dist/runtime/components/Edit/Features/EditForm/index.vue +10 -9
  166. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +69 -4
  167. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue.d.ts +2 -2
  168. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +13 -9
  169. package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +45 -87
  170. package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue.d.ts +2 -2
  171. package/dist/runtime/components/Edit/Features/EditableField/index.vue +45 -43
  172. package/dist/runtime/components/Edit/Features/EditableMask/index.vue +3 -20
  173. package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +33 -1
  174. package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +11 -9
  175. package/dist/runtime/components/Edit/Features/Fragments/index.vue +8 -6
  176. package/dist/runtime/components/Edit/Features/History/index.vue +39 -13
  177. package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +139 -0
  178. package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue +261 -0
  179. package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue.d.ts +6 -0
  180. package/dist/runtime/components/Edit/Features/Hover/Overlay/vertex.glsl +117 -0
  181. package/dist/runtime/components/Edit/Features/Hover/index.vue +25 -0
  182. package/dist/runtime/components/Edit/Features/Hover/index.vue.d.ts +2 -0
  183. package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +6 -2
  184. package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +3 -2
  185. package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +5 -7
  186. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +19 -27
  187. package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +32 -28
  188. package/dist/runtime/components/Edit/Features/Library/index.vue +40 -32
  189. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +11 -11
  190. package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +15 -12
  191. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/fragment.glsl +1 -1
  192. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +44 -32
  193. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/vertex.glsl +1 -1
  194. package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +10 -18
  195. package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +3 -2
  196. package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue.d.ts +2 -0
  197. package/dist/runtime/components/Edit/Features/Options/Form/Group.vue.d.ts +2 -11
  198. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +14 -3
  199. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +0 -1
  200. package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +37 -19
  201. package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue.d.ts +8 -2
  202. package/dist/runtime/components/Edit/Features/Options/Form/index.vue +88 -42
  203. package/dist/runtime/components/Edit/Features/Options/Form/index.vue.d.ts +5 -5
  204. package/dist/runtime/components/Edit/Features/Options/index.vue +35 -11
  205. package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue +35 -0
  206. package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue.d.ts +6 -0
  207. package/dist/runtime/components/Edit/Features/Ownership/index.vue +7 -25
  208. package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -3
  209. package/dist/runtime/components/Edit/Features/ProxyView/index.vue +5 -1
  210. package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue +41 -14
  211. package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue.d.ts +2 -0
  212. package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue +47 -0
  213. package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue.d.ts +19 -0
  214. package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue +83 -0
  215. package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue.d.ts +9 -0
  216. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +439 -123
  217. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue.d.ts +3 -14
  218. package/dist/runtime/components/Edit/Features/Publish/index.vue +57 -24
  219. package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue.d.ts +2 -13
  220. package/dist/runtime/components/Edit/Features/Revert/index.vue +3 -3
  221. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +15 -15
  222. package/dist/runtime/components/Edit/Features/Search/index.vue +7 -3
  223. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +85 -0
  224. package/dist/runtime/components/Edit/Features/{CommandPalette/Palette/Group → Selection/AddButtons/Overlay}/index.vue.d.ts +8 -13
  225. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +106 -0
  226. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +440 -0
  227. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue.d.ts +32 -0
  228. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +102 -0
  229. package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +387 -0
  230. package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue.d.ts +6 -0
  231. package/dist/runtime/components/Edit/Features/Selection/Overlay/fragment.glsl +15 -10
  232. package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +105 -25
  233. package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue.d.ts +5 -3
  234. package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +12 -3
  235. package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +2 -2
  236. package/dist/runtime/components/Edit/Features/Selection/index.vue +135 -25
  237. package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +12 -17
  238. package/dist/runtime/components/Edit/Features/Settings/index.vue +11 -25
  239. package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +2 -2
  240. package/dist/runtime/components/Edit/Features/Structure/List/Item/index.vue +13 -6
  241. package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +5 -1
  242. package/dist/runtime/components/Edit/Features/Theme/index.vue +2 -1
  243. package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +3 -2
  244. package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +3 -0
  245. package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +198 -0
  246. package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue.d.ts +13 -0
  247. package/dist/runtime/components/Edit/Features/Transform/index.vue +156 -70
  248. package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +17 -11
  249. package/dist/runtime/components/Edit/Features/Translations/index.vue +20 -23
  250. package/dist/runtime/components/Edit/Features/Validations/SidebarItem/index.vue +5 -5
  251. package/dist/runtime/components/Edit/Features/index.vue +17 -7
  252. package/dist/runtime/components/Edit/Form/Datepicker/index.vue +198 -0
  253. package/dist/runtime/components/Edit/Form/Datepicker/index.vue.d.ts +15 -0
  254. package/dist/runtime/components/Edit/Form/Group/index.vue.d.ts +2 -4
  255. package/dist/runtime/components/Edit/Form/Item/index.vue.d.ts +2 -4
  256. package/dist/runtime/components/Edit/Form/Radio/index.vue +33 -0
  257. package/dist/runtime/components/Edit/Form/Radio/index.vue.d.ts +20 -0
  258. package/dist/runtime/components/Edit/Form/RadioTabs/index.vue +37 -0
  259. package/dist/runtime/components/Edit/Form/RadioTabs/index.vue.d.ts +22 -0
  260. package/dist/runtime/components/Edit/Form/Select/index.vue +29 -0
  261. package/dist/runtime/components/Edit/Form/Select/index.vue.d.ts +20 -0
  262. package/dist/runtime/components/Edit/Form/Text/index.vue +34 -0
  263. package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +20 -0
  264. package/dist/runtime/components/Edit/Form/Textarea/index.vue +13 -6
  265. package/dist/runtime/components/Edit/Form/Textarea/index.vue.d.ts +4 -0
  266. package/dist/runtime/components/Edit/Form/Toggle/index.vue +4 -3
  267. package/dist/runtime/components/Edit/Form/Toggle/index.vue.d.ts +12 -2
  268. package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
  269. package/dist/runtime/components/Edit/FormOverlay/index.vue.d.ts +3 -2
  270. package/dist/runtime/components/Edit/Indicators/index.vue +123 -0
  271. package/dist/runtime/components/Edit/Indicators/index.vue.d.ts +2 -0
  272. package/dist/runtime/components/Edit/InfoBox/index.vue +6 -2
  273. package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +12 -2
  274. package/dist/runtime/components/Edit/ItemIcon/index.vue +2 -1
  275. package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue +66 -0
  276. package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue.d.ts +7 -0
  277. package/dist/runtime/components/Edit/Konami/Game/blokkli.png +0 -0
  278. package/dist/runtime/components/Edit/Konami/Game/charmap.d.ts +2 -0
  279. package/dist/runtime/components/Edit/Konami/Game/charmap.js +168 -0
  280. package/dist/runtime/components/Edit/Konami/Game/index.vue +752 -0
  281. package/dist/runtime/components/Edit/Konami/Game/index.vue.d.ts +6 -0
  282. package/dist/runtime/components/Edit/Konami/Game/textRendering.d.ts +8 -0
  283. package/dist/runtime/components/Edit/Konami/Game/textRendering.js +138 -0
  284. package/dist/runtime/components/Edit/Konami/Game/useIconRendering.d.ts +9 -0
  285. package/dist/runtime/components/Edit/Konami/Game/useIconRendering.js +130 -0
  286. package/dist/runtime/components/Edit/Konami/index.vue +44 -0
  287. package/dist/runtime/components/Edit/Konami/index.vue.d.ts +2 -0
  288. package/dist/runtime/components/Edit/Loading/index.vue +6 -2
  289. package/dist/runtime/components/Edit/Loading/index.vue.d.ts +2 -0
  290. package/dist/runtime/components/Edit/Messages/index.vue +8 -3
  291. package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue +17 -0
  292. package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue.d.ts +11 -0
  293. package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue +37 -0
  294. package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue.d.ts +11 -0
  295. package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue +43 -0
  296. package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue.d.ts +11 -0
  297. package/dist/runtime/components/Edit/PluginConfigForm/index.vue +57 -0
  298. package/dist/runtime/components/Edit/PluginConfigForm/index.vue.d.ts +16 -0
  299. package/dist/runtime/components/Edit/PreviewProvider.vue +3 -4
  300. package/dist/runtime/components/Edit/RelativeTime/index.vue +3 -2
  301. package/dist/runtime/components/Edit/RelativeTime/index.vue.d.ts +2 -2
  302. package/dist/runtime/components/Edit/Resizable/index.vue.d.ts +1 -1
  303. package/dist/runtime/components/Edit/ScaleToFit/index.vue.d.ts +1 -1
  304. package/dist/runtime/components/Edit/ScheduleDate/index.vue +131 -0
  305. package/dist/runtime/components/Edit/ScheduleDate/index.vue.d.ts +23 -0
  306. package/dist/runtime/components/Edit/ScrollBoundary/index.vue.d.ts +2 -7
  307. package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +11 -3
  308. package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +1 -1
  309. package/dist/runtime/components/Edit/SystemRequirements/index.vue +3 -3
  310. package/dist/runtime/components/Edit/Toolbar/index.vue +3 -2
  311. package/dist/runtime/components/Edit/Transition/Height.vue +95 -0
  312. package/dist/runtime/components/Edit/Transition/Height.vue.d.ts +36 -0
  313. package/dist/runtime/components/Edit/Transition/index.vue +41 -0
  314. package/dist/runtime/components/Edit/Transition/index.vue.d.ts +19 -0
  315. package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +2 -7
  316. package/dist/runtime/components/Edit/index.d.ts +28 -15
  317. package/dist/runtime/components/Edit/index.js +54 -28
  318. package/dist/runtime/composables/defineBlokkli.js +16 -3
  319. package/dist/runtime/composables/defineBlokkliFeature.d.ts +4 -7
  320. package/dist/runtime/composables/defineBlokkliFragment.js +8 -1
  321. package/dist/runtime/composables/defineBlokkliProvider.d.ts +11 -0
  322. package/dist/runtime/composables/defineBlokkliProvider.js +46 -0
  323. package/dist/runtime/composables/useBlokkliHelper.d.ts +19 -0
  324. package/dist/runtime/composables/useBlokkliHelper.js +95 -0
  325. package/dist/runtime/constants/index.d.ts +3 -0
  326. package/dist/runtime/constants/index.js +3 -0
  327. package/dist/runtime/css/output.css +1 -1
  328. package/dist/runtime/helpers/addElementClasses.d.ts +2 -0
  329. package/dist/runtime/helpers/addElementClasses.js +24 -0
  330. package/dist/runtime/helpers/animationProvider.d.ts +38 -2
  331. package/dist/runtime/helpers/animationProvider.js +188 -47
  332. package/dist/runtime/helpers/bundles/index.d.ts +1 -0
  333. package/dist/runtime/helpers/bundles/index.js +4 -0
  334. package/dist/runtime/helpers/composables/defineRenderer.d.ts +8 -0
  335. package/dist/runtime/helpers/composables/defineRenderer.js +8 -0
  336. package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +5 -0
  337. package/dist/runtime/helpers/composables/useBlockRegistration.js +23 -0
  338. package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.d.ts +1 -1
  339. package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.js +3 -2
  340. package/dist/runtime/helpers/composables/useStateBasedCache.d.ts +4 -0
  341. package/dist/runtime/helpers/composables/useStateBasedCache.js +13 -0
  342. package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +23 -0
  343. package/dist/runtime/helpers/composables/useStickyToolbar.js +233 -0
  344. package/dist/runtime/helpers/definitionProvider.d.ts +3 -2
  345. package/dist/runtime/helpers/definitionProvider.js +17 -0
  346. package/dist/runtime/helpers/dom/index.d.ts +60 -0
  347. package/dist/runtime/helpers/dom/index.js +48 -0
  348. package/dist/runtime/helpers/domProvider.d.ts +58 -17
  349. package/dist/runtime/helpers/domProvider.js +320 -245
  350. package/dist/runtime/helpers/dropTargets/index.d.ts +6 -0
  351. package/dist/runtime/helpers/dropTargets/index.js +49 -0
  352. package/dist/runtime/helpers/eventBus.d.ts +1 -1
  353. package/dist/runtime/helpers/eventBus.js +2 -2
  354. package/dist/runtime/helpers/index.d.ts +10 -14
  355. package/dist/runtime/helpers/index.js +58 -121
  356. package/dist/runtime/helpers/indicatorsProvider.d.ts +10 -0
  357. package/dist/runtime/helpers/indicatorsProvider.js +23 -0
  358. package/dist/runtime/helpers/keyboardProvider.d.ts +2 -0
  359. package/dist/runtime/helpers/keyboardProvider.js +17 -1
  360. package/dist/runtime/helpers/pluginProvider.d.ts +10 -0
  361. package/dist/runtime/helpers/pluginProvider.js +33 -0
  362. package/dist/runtime/helpers/providers/blocks.d.ts +10 -0
  363. package/dist/runtime/helpers/providers/blocks.js +91 -0
  364. package/dist/runtime/helpers/providers/directive.d.ts +25 -0
  365. package/dist/runtime/helpers/providers/directive.js +208 -0
  366. package/dist/runtime/helpers/providers/element.d.ts +6 -0
  367. package/dist/runtime/helpers/providers/element.js +35 -0
  368. package/dist/runtime/helpers/providers/fields.d.ts +8 -0
  369. package/dist/runtime/helpers/providers/fields.js +47 -0
  370. package/dist/runtime/helpers/renderCycle.d.ts +1 -0
  371. package/dist/runtime/helpers/renderCycle.js +10 -0
  372. package/dist/runtime/helpers/runtimeHelpers/index.js +15 -12
  373. package/dist/runtime/helpers/selectionProvider.d.ts +27 -11
  374. package/dist/runtime/helpers/selectionProvider.js +79 -74
  375. package/dist/runtime/helpers/stateProvider.d.ts +12 -2
  376. package/dist/runtime/helpers/stateProvider.js +164 -20
  377. package/dist/runtime/helpers/storageProvider.d.ts +5 -3
  378. package/dist/runtime/helpers/storageProvider.js +61 -4
  379. package/dist/runtime/helpers/symbols.d.ts +2 -0
  380. package/dist/runtime/helpers/symbols.js +2 -0
  381. package/dist/runtime/helpers/textProvider.js +6 -0
  382. package/dist/runtime/helpers/themeProvider.d.ts +4 -1
  383. package/dist/runtime/helpers/themeProvider.js +28 -15
  384. package/dist/runtime/helpers/transform.js +1 -3
  385. package/dist/runtime/helpers/typesProvider.js +10 -26
  386. package/dist/runtime/helpers/uiProvider.d.ts +18 -3
  387. package/dist/runtime/helpers/uiProvider.js +114 -61
  388. package/dist/runtime/helpers/useTransitionedValue.d.ts +18 -0
  389. package/dist/runtime/helpers/useTransitionedValue.js +57 -0
  390. package/dist/runtime/helpers/webgl/index.d.ts +11 -2
  391. package/dist/runtime/helpers/webgl/index.js +162 -7
  392. package/dist/runtime/icons/anchor.svg +1 -0
  393. package/dist/runtime/icons/arrow-left.svg +1 -1
  394. package/dist/runtime/icons/arrow-right.svg +1 -1
  395. package/dist/runtime/icons/arrow-top-right.svg +1 -0
  396. package/dist/runtime/icons/calendar-clock.svg +1 -0
  397. package/dist/runtime/icons/calendar.svg +1 -0
  398. package/dist/runtime/icons/chart.svg +1 -0
  399. package/dist/runtime/icons/clock.svg +1 -0
  400. package/dist/runtime/icons/comment_add.svg +1 -5
  401. package/dist/runtime/icons/copy.svg +1 -0
  402. package/dist/runtime/icons/cursor-move.svg +1 -1
  403. package/dist/runtime/icons/delete.svg +1 -8
  404. package/dist/runtime/icons/diff.svg +1 -1
  405. package/dist/runtime/icons/duplicate.svg +1 -12
  406. package/dist/runtime/icons/edit.svg +1 -8
  407. package/dist/runtime/icons/eye-off.svg +1 -0
  408. package/dist/runtime/icons/eye.svg +1 -1
  409. package/dist/runtime/icons/info.svg +1 -1
  410. package/dist/runtime/icons/link.svg +1 -0
  411. package/dist/runtime/icons/reusable.svg +1 -5
  412. package/dist/runtime/icons/speedometer.svg +1 -0
  413. package/dist/runtime/plugins/blokkliDirectives.js +109 -0
  414. package/dist/runtime/types/blokkOptions.d.ts +8 -0
  415. package/dist/runtime/types/index.d.ts +278 -42
  416. package/dist/runtime/types/theme.d.ts +2 -1
  417. package/dist/shared/{editor.gz_ac6uT.d.mts → editor.CKsrTpc1.d.mts} +1 -1
  418. package/package.json +55 -38
  419. package/dist/modules/drupal/adapter/index.d.mts +0 -6
  420. package/dist/runtime/components/Edit/DragInteractions/index.vue +0 -364
  421. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +0 -51
  422. package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue +0 -22
  423. package/dist/runtime/components/Edit/Features/FieldAreas/index.vue +0 -41
  424. package/dist/runtime/plugins/blokkliEditable.js +0 -31
  425. /package/dist/runtime/components/Edit/{DragInteractions → Features/Analyze}/index.vue.d.ts +0 -0
  426. /package/dist/runtime/components/Edit/Features/{FieldAreas/Overlay/index.vue.d.ts → Anchors/Renderer.vue.d.ts} +0 -0
  427. /package/dist/runtime/components/Edit/Features/{FieldAreas → Anchors}/index.vue.d.ts +0 -0
  428. /package/dist/runtime/plugins/{blokkliEditable.d.ts → blokkliDirectives.d.ts} +0 -0
@@ -14,6 +14,7 @@ import {
14
14
  toShaderColor
15
15
  } from "#blokkli/helpers";
16
16
  import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
17
+ import defineRenderer from "#blokkli/helpers/composables/defineRenderer";
17
18
  import { ref, computed, useBlokkli, onBeforeUnmount } from "#imports";
18
19
  import {
19
20
  setBuffersAndAttributes,
@@ -23,6 +24,12 @@ import {
23
24
  import vs from "./vertex.glsl?raw";
24
25
  import fs from "./fragment.glsl?raw";
25
26
  import { RectangleBufferCollector } from "#blokkli/helpers/webgl";
27
+ import {
28
+ determineCanAddChildren,
29
+ getChildrenOrientation,
30
+ getGapSize,
31
+ MIN_GAP
32
+ } from "#blokkli/helpers/dropTargets";
26
33
  const props = defineProps({
27
34
  items: { type: Array, required: true },
28
35
  box: { type: Object, required: true },
@@ -30,7 +37,6 @@ const props = defineProps({
30
37
  mouseY: { type: Number, required: true },
31
38
  isTouch: { type: Boolean, required: true }
32
39
  });
33
- const MIN_GAP = 20;
34
40
  var RectRenderType = /* @__PURE__ */ ((RectRenderType2) => {
35
41
  RectRenderType2[RectRenderType2["DROP_AREA"] = 0] = "DROP_AREA";
36
42
  RectRenderType2[RectRenderType2["FIELD_1"] = 1] = "FIELD_1";
@@ -55,7 +61,8 @@ const {
55
61
  animation,
56
62
  state,
57
63
  runtimeConfig,
58
- types
64
+ types,
65
+ fields
59
66
  } = useBlokkli();
60
67
  const gl = animation.gl();
61
68
  const canvas = animation.getCanvasElement();
@@ -115,7 +122,7 @@ const emitDrop = async () => {
115
122
  if (!hostUuid || !fieldName) {
116
123
  return;
117
124
  }
118
- const field = dom.findField(hostUuid, fieldName);
125
+ const field = fields.find(hostUuid, fieldName);
119
126
  if (!field) {
120
127
  return;
121
128
  }
@@ -139,59 +146,28 @@ const emitDrop = async () => {
139
146
  }
140
147
  }
141
148
  eventBus.emit("dragging:end");
142
- eventBus.emit("item:dropped");
143
149
  };
144
- function getChildrenOrientation(element) {
145
- const computedStyle = window.getComputedStyle(element);
146
- if (computedStyle.display.includes("flex")) {
147
- if (computedStyle.flexDirection === "row" || computedStyle.flexDirection === "row-reverse") {
148
- return "horizontal";
149
- } else {
150
- return "vertical";
151
- }
152
- }
153
- if (computedStyle.display.includes("grid")) {
154
- if (computedStyle.gridTemplateColumns.split(" ").length > 1) {
155
- return "horizontal";
156
- } else {
157
- return "vertical";
158
- }
159
- }
160
- return "vertical";
161
- }
162
150
  const draggingBundles = computed(
163
151
  () => props.items.flatMap((item) => {
164
152
  const bundles = [];
165
- if ("itemBundle" in item && item.itemBundle) {
153
+ if (item.itemType === "existing" || item.itemType === "existing_structure") {
154
+ bundles.push(item.block.bundle);
155
+ if (item.block.library?.reusableBundle) {
156
+ bundles.push(item.block.library.reusableBundle);
157
+ }
158
+ } else if (item.itemBundle) {
166
159
  bundles.push(item.itemBundle);
167
160
  }
168
- if ("reusableBundle" in item && item.reusableBundle) {
169
- bundles.push(item.reusableBundle);
170
- }
171
161
  return bundles;
172
162
  }).filter(falsy)
173
163
  );
174
164
  const selectionUuids = computed(
175
165
  () => props.items.map((item) => {
176
166
  if (item.itemType === "existing") {
177
- return item.uuid;
167
+ return item.block.uuid;
178
168
  }
179
169
  }).filter(falsy)
180
170
  );
181
- function getGapSize(orientation, element) {
182
- const computedStyle = window.getComputedStyle(element);
183
- if (computedStyle.display.includes("grid") || computedStyle.display.includes("flex")) {
184
- const gap = orientation === "vertical" ? computedStyle.columnGap || computedStyle.gridColumnGap : computedStyle.rowGap || computedStyle.gridRowGap;
185
- if (gap) {
186
- const gapParts = gap.split(" ");
187
- const gapValue = gapParts[0];
188
- if (gapValue?.endsWith("px")) {
189
- return Number.parseFloat(gapValue);
190
- }
191
- }
192
- }
193
- return MIN_GAP;
194
- }
195
171
  const fieldChildCache = {};
196
172
  const buildChildId = (field, preceedingUuid, type, uuid) => {
197
173
  return `${field.key}:${preceedingUuid || ""}:${type || ""}:${uuid || ""}`;
@@ -300,25 +276,6 @@ function getInsertText(field) {
300
276
  const bundleLabel = getBundleLabel(field);
301
277
  return `${bundleLabel} \xBB <strong>${field.label}</strong>`;
302
278
  }
303
- const determineCanAddChildren = (field, children) => {
304
- if (field.cardinality !== -1) {
305
- const count = state.getFieldBlockCount(field.key);
306
- const childrenThatAreSelection = children.filter((child) => {
307
- const uuid = child.dataset.uuid;
308
- if (!uuid) {
309
- return false;
310
- }
311
- return selectionUuids.value.includes(uuid);
312
- }).length;
313
- const countAfter = count - childrenThatAreSelection + props.items.length;
314
- if (countAfter > field.cardinality) {
315
- return false;
316
- }
317
- }
318
- return !draggingBundles.value.length || draggingBundles.value.every(
319
- (bundle) => field.allowedBundles.includes(bundle)
320
- );
321
- };
322
279
  const buildEmptyChild = (field, children, orientation, fieldWidth, fieldHeight) => {
323
280
  if (children.length === 0) {
324
281
  const id = buildChildId(field, null, "empty");
@@ -351,12 +308,20 @@ const buildFieldRect = (key) => {
351
308
  if (!uuid || !name) {
352
309
  return;
353
310
  }
354
- const field = dom.findField(uuid, name);
311
+ const field = fields.find(uuid, name);
355
312
  if (!field) {
356
313
  return;
357
314
  }
358
315
  const childElements = [...field.element.children];
359
- const canAddChildren = determineCanAddChildren(field, childElements);
316
+ const currentCount = state.getFieldBlockCount(field.key);
317
+ const canAddChildren = determineCanAddChildren(
318
+ field,
319
+ childElements,
320
+ selectionUuids.value,
321
+ currentCount,
322
+ props.items.length,
323
+ draggingBundles.value
324
+ );
360
325
  const orientation = field.dropAlignment || getChildrenOrientation(field.element);
361
326
  const rect = dom.getFieldRect(field.key);
362
327
  if (!rect) {
@@ -406,10 +371,11 @@ const buildDropAreaRect = (area) => {
406
371
  cachedDropAreaRects[area.id] = dropAreaRect;
407
372
  return dropAreaRect;
408
373
  };
374
+ const alphaBase = gl ? 0.7 : 0.3;
409
375
  const colorTeal = rgbaToString(theme.teal.value.normal);
410
- const colorTealAlpha = rgbaToString(theme.teal.value.normal, 0.7);
376
+ const colorTealAlpha = rgbaToString(theme.teal.value.normal, alphaBase);
411
377
  const colorAccent = rgbaToString(theme.accent.value[800]);
412
- const colorAccentAlpha = rgbaToString(theme.accent.value[800], 0.7);
378
+ const colorAccentAlpha = rgbaToString(theme.accent.value[800], alphaBase);
413
379
  function getRectType(field) {
414
380
  if (field.nestingLevel >= 3) {
415
381
  return 4 /* FIELD_4 */;
@@ -482,6 +448,7 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
482
448
  false
483
449
  );
484
450
  }
451
+ this.processPendingRects();
485
452
  const hasChanged = lengthBefore !== this.positions.length;
486
453
  if (hasChanged) {
487
454
  this.bufferInfo = this.createBufferInfo();
@@ -521,22 +488,26 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
521
488
  return null;
522
489
  }
523
490
  }
524
- const collector = new DropTargetRectangleBufferCollector(gl);
525
- collector.addRectangle(
526
- {
527
- id: "active-hover-rect",
528
- type: "active-area",
529
- label: "Field Area",
530
- color: "red",
531
- colorAlpha: "red",
532
- x: 0,
533
- y: 0,
534
- width: ui.artboardSize.value.width,
535
- height: ui.artboardSize.value.height
536
- },
537
- 5 /* ACTIVE_AREA */,
538
- false
539
- );
491
+ const collector = new DropTargetRectangleBufferCollector(gl, {
492
+ deferredMode: true
493
+ });
494
+ if (gl) {
495
+ collector.addRectangle(
496
+ {
497
+ id: "active-hover-rect",
498
+ type: "active-area",
499
+ label: "Field Area",
500
+ color: "red",
501
+ colorAlpha: "red",
502
+ x: 0,
503
+ y: 0,
504
+ width: ui.artboardSize.value.width,
505
+ height: ui.artboardSize.value.height
506
+ },
507
+ 5 /* ACTIVE_AREA */,
508
+ false
509
+ );
510
+ }
540
511
  const fieldColors = computed(() => {
541
512
  return {
542
513
  "0": theme.accent.value[900],
@@ -577,6 +548,18 @@ const activeHoverRect = computed(() => {
577
548
  return [0, 0, 0, 0];
578
549
  }
579
550
  const outset = activeHoverField.value.field.nestingLevel === 0 ? 0 : 20;
551
+ if (activeHoverField.value.emptyChild) {
552
+ const emptyChildId = activeHoverField.value.emptyChild.id;
553
+ const adjustedRect = collector.rects[emptyChildId];
554
+ if (adjustedRect) {
555
+ return [
556
+ adjustedRect.x - outset,
557
+ adjustedRect.y - outset,
558
+ adjustedRect.width + 2 * outset,
559
+ adjustedRect.height + 2 * outset
560
+ ];
561
+ }
562
+ }
580
563
  return [
581
564
  activeHoverField.value.x - outset,
582
565
  activeHoverField.value.y - outset,
@@ -587,6 +570,9 @@ const activeHoverRect = computed(() => {
587
570
  const activeHoverColor = computed(() => {
588
571
  return getColorForField(activeHoverField.value);
589
572
  });
573
+ const activeHoverFieldNestingLevel = computed(() => {
574
+ return activeHoverField.value?.field.nestingLevel ?? 0;
575
+ });
590
576
  const uniforms = computed(() => {
591
577
  const index = active.value?.index;
592
578
  return {
@@ -597,7 +583,8 @@ const uniforms = computed(() => {
597
583
  u_color_hover_area: toShaderColor(activeHoverColor.value),
598
584
  u_color_area: toShaderColor(theme.teal.value.normal),
599
585
  u_active_rect_id: index === void 0 ? -1 : index,
600
- u_active_hover_rect: activeHoverRect.value
586
+ u_active_hover_rect: activeHoverRect.value,
587
+ u_active_hover_nesting_level: activeHoverFieldNestingLevel.value
601
588
  };
602
589
  });
603
590
  const dragBox = ref({
@@ -621,11 +608,11 @@ function setHoveredFieldArea(box, mouse) {
621
608
  }
622
609
  return;
623
610
  }
624
- const fields = Object.values(fieldCache);
611
+ const fields2 = Object.values(fieldCache);
625
612
  let highestNestingLevel = 0;
626
613
  let candidate = null;
627
- for (let i = 0; i < fields.length; i++) {
628
- const field = fields[i];
614
+ for (let i = 0; i < fields2.length; i++) {
615
+ const field = fields2[i];
629
616
  if (!field.canAddChildren) {
630
617
  continue;
631
618
  }
@@ -643,6 +630,8 @@ function setHoveredFieldArea(box, mouse) {
643
630
  activeHoverField.value = candidate;
644
631
  }
645
632
  }
633
+ let bufferInfo = null;
634
+ let bufferChanged = false;
646
635
  onBlokkliEvent("canvas:draw", () => {
647
636
  const scale = ui.artboardScale.value;
648
637
  const offset = { ...ui.artboardOffset.value };
@@ -653,10 +642,9 @@ onBlokkliEvent("canvas:draw", () => {
653
642
  height: props.box.height / scale
654
643
  };
655
644
  const mouseAbsolute = toCanvasSpaceCoordinates(props.mouseX, props.mouseY);
656
- if (gl && programInfo) {
657
- gl.useProgram(programInfo.program);
658
- animation.setSharedUniforms(gl, programInfo);
659
- }
645
+ const result = collector.getBufferInfo();
646
+ bufferInfo = result.info;
647
+ bufferChanged = result.hasChanged;
660
648
  if (!props.isTouch) {
661
649
  if (cursorIsInsideClipped()) {
662
650
  const closest = collector.getClosestIntersectingRect(
@@ -668,44 +656,46 @@ onBlokkliEvent("canvas:draw", () => {
668
656
  active.value = null;
669
657
  }
670
658
  }
671
- const { info, hasChanged } = collector.getBufferInfo();
672
- if (programInfo && gl) {
673
- setHoveredFieldArea(dragBox.value, mouseAbsolute);
674
- setUniforms(programInfo, uniforms.value);
675
- if (info) {
676
- if (hasChanged && gl && programInfo) {
677
- setBuffersAndAttributes(gl, programInfo, info);
678
- }
679
- if (gl) {
680
- drawBufferInfo(gl, info, gl.TRIANGLES);
659
+ setHoveredFieldArea(dragBox.value, mouseAbsolute);
660
+ if (!gl && ctx) {
661
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
662
+ const rects = Object.values(collector.rects);
663
+ for (let i = 0; i < rects.length; i++) {
664
+ const rect = rects[i];
665
+ if (active.value?.id === rect.id) {
666
+ ctx.fillStyle = rect.color;
667
+ } else {
668
+ ctx.fillStyle = rect.colorAlpha;
681
669
  }
670
+ ctx.fillRect(
671
+ (rect.x * scale + offset.x) * animation.dpi.value,
672
+ (rect.y * scale + offset.y) * animation.dpi.value,
673
+ rect.width * animation.dpi.value * scale,
674
+ rect.height * animation.dpi.value * scale
675
+ );
682
676
  }
683
- return;
684
- }
685
- if (!ctx) {
686
- return;
687
- }
688
- ctx.clearRect(0, 0, canvas.width, canvas.height);
689
- const rects = Object.values(collector.rects);
690
- for (let i = 0; i < rects.length; i++) {
691
- const rect = rects[i];
692
- if (active.value?.id === rect.id) {
693
- ctx.fillStyle = rect.color;
694
- } else {
695
- ctx.fillStyle = rect.colorAlpha;
696
- }
697
- ctx.fillRect(
698
- (rect.x * scale + offset.x) * animation.dpi.value,
699
- (rect.y * scale + offset.y) * animation.dpi.value,
700
- rect.width * animation.dpi.value * scale,
701
- rect.height * animation.dpi.value * scale
702
- );
703
677
  }
704
678
  });
679
+ if (gl && programInfo) {
680
+ defineRenderer("drop-targets", {
681
+ zIndex: 400,
682
+ only: true,
683
+ cursor: () => "grabbing",
684
+ render: () => {
685
+ gl.useProgram(programInfo.program);
686
+ animation.setSharedUniforms(gl, programInfo);
687
+ setUniforms(programInfo, uniforms.value);
688
+ if (!bufferInfo) {
689
+ return;
690
+ }
691
+ if (bufferChanged) {
692
+ setBuffersAndAttributes(gl, programInfo, bufferInfo);
693
+ }
694
+ drawBufferInfo(gl, bufferInfo, gl.TRIANGLES);
695
+ }
696
+ });
697
+ }
705
698
  onBeforeUnmount(() => {
706
- if (gl) {
707
- gl.clear(gl.COLOR_BUFFER_BIT);
708
- }
709
699
  if (ctx) {
710
700
  ctx.clearRect(0, 0, canvas.width, canvas.height);
711
701
  }
@@ -1,4 +1,4 @@
1
- import type { DropTargetEvent, BlokkliFieldElement, DraggableItem, Rectangle } from '#blokkli/types';
1
+ import type { DropTargetEvent, DraggableItem, Rectangle } from '#blokkli/types';
2
2
  type __VLS_Props = {
3
3
  items: DraggableItem[];
4
4
  box: Rectangle;
@@ -6,142 +6,13 @@ type __VLS_Props = {
6
6
  mouseY: number;
7
7
  isTouch: boolean;
8
8
  };
9
- type Orientation = 'horizontal' | 'vertical';
10
- type FieldRectChild = Rectangle & {
11
- id: string;
12
- label: string;
13
- };
14
- type FieldRect = Rectangle & {
15
- key: string;
16
- field: BlokkliFieldElement;
17
- label: string;
18
- canAddChildren: boolean;
19
- emptyChild?: FieldRectChild;
20
- orientation: Orientation;
21
- gap: number;
22
- childrenElements: HTMLElement[];
23
- };
24
- type DrawnRect = Rectangle & {
25
- id: string;
26
- type: 'field' | 'drop-area' | 'active-area';
27
- label: string;
28
- color: string;
29
- colorAlpha: string;
30
- field?: FieldRect;
31
- index: number;
32
- };
33
- declare const active: import("vue").Ref<{
34
- width: number;
35
- height: number;
36
- x: number;
37
- y: number;
38
- id: string;
39
- type: "field" | "drop-area" | "active-area";
40
- label: string;
41
- color: string;
42
- colorAlpha: string;
43
- field?: {
44
- width: number;
45
- height: number;
46
- x: number;
47
- y: number;
48
- key: string;
49
- field: {
50
- key: string;
51
- name: string;
52
- label: string;
53
- isNested: boolean;
54
- nestingLevel: number;
55
- fieldListType: import("#blokkli-build/generated-types").ValidFieldListTypes;
56
- hostEntityType: string;
57
- hostEntityBundle: string;
58
- hostEntityUuid: string;
59
- allowedBundles: string[];
60
- allowedFragments: string[];
61
- cardinality: number;
62
- element: HTMLElement;
63
- dropAlignment?: "vertical" | "horizontal" | undefined;
64
- };
65
- label: string;
66
- canAddChildren: boolean;
67
- emptyChild?: {
68
- width: number;
69
- height: number;
70
- x: number;
71
- y: number;
72
- id: string;
73
- label: string;
74
- } | undefined;
75
- orientation: Orientation;
76
- gap: number;
77
- childrenElements: HTMLElement[];
78
- } | undefined;
79
- index: number;
80
- } | null, DrawnRect | {
81
- width: number;
82
- height: number;
83
- x: number;
84
- y: number;
85
- id: string;
86
- type: "field" | "drop-area" | "active-area";
87
- label: string;
88
- color: string;
89
- colorAlpha: string;
90
- field?: {
91
- width: number;
92
- height: number;
93
- x: number;
94
- y: number;
95
- key: string;
96
- field: {
97
- key: string;
98
- name: string;
99
- label: string;
100
- isNested: boolean;
101
- nestingLevel: number;
102
- fieldListType: import("#blokkli-build/generated-types").ValidFieldListTypes;
103
- hostEntityType: string;
104
- hostEntityBundle: string;
105
- hostEntityUuid: string;
106
- allowedBundles: string[];
107
- allowedFragments: string[];
108
- cardinality: number;
109
- element: HTMLElement;
110
- dropAlignment?: "vertical" | "horizontal" | undefined;
111
- };
112
- label: string;
113
- canAddChildren: boolean;
114
- emptyChild?: {
115
- width: number;
116
- height: number;
117
- x: number;
118
- y: number;
119
- id: string;
120
- label: string;
121
- } | undefined;
122
- orientation: Orientation;
123
- gap: number;
124
- childrenElements: HTMLElement[];
125
- } | undefined;
126
- index: number;
127
- } | null>;
128
- declare const activeColorHex: import("vue").ComputedRef<string>;
129
- declare const __VLS_ctx: InstanceType<__VLS_PickNotAny<typeof __VLS_self, new () => {}>>;
130
9
  declare var __VLS_5: {
131
10
  color: string;
132
11
  label: string | undefined;
133
12
  };
134
- type __VLS_Slots = __VLS_PrettifyGlobal<__VLS_OmitStringIndex<typeof __VLS_ctx.$slots> & {
13
+ type __VLS_Slots = {} & {
135
14
  default?: (props: typeof __VLS_5) => any;
136
- }>;
137
- declare const __VLS_self: import("vue").DefineComponent<__VLS_Props, {
138
- active: typeof active;
139
- activeColorHex: typeof activeColorHex;
140
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
141
- drop: (data: DropTargetEvent) => any;
142
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
143
- onDrop?: ((data: DropTargetEvent) => any) | undefined;
144
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ };
145
16
  declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
146
17
  drop: (data: DropTargetEvent) => any;
147
18
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
@@ -1,4 +1,4 @@
1
- precision mediump float;
1
+ precision highp float;
2
2
 
3
3
  attribute vec2 a_position;
4
4
  attribute vec4 a_quad;
@@ -17,6 +17,7 @@ uniform vec3 u_color_field_3;
17
17
  uniform vec3 u_color_area;
18
18
  uniform vec3 u_color_hover_area;
19
19
  uniform vec4 u_active_hover_rect;
20
+ uniform float u_active_hover_nesting_level;
20
21
  uniform float u_dpi;
21
22
 
22
23
  varying vec4 v_quad;