@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
@@ -1,5 +1,4 @@
1
- import { eventBus } from "#blokkli/helpers/eventBus";
2
- import { useRuntimeConfig, computed, watch } from "#imports";
1
+ import { useRuntimeConfig, computed } from "#imports";
3
2
  import { onlyUnique } from "./index.js";
4
3
  class ConfigMap {
5
4
  configs = [];
@@ -52,38 +51,23 @@ export default async function(adapter, selection, context) {
52
51
  const droppableFieldConfigData = adapter.getDroppableFieldConfig ? await adapter.getDroppableFieldConfig() : [];
53
52
  const droppableFieldConfig = new ConfigMap(droppableFieldConfigData);
54
53
  const allowedTypesInList = computed(() => {
55
- if (!selection.blocks.value.length) {
54
+ if (!selection.items.value.length) {
56
55
  return [];
57
56
  }
58
57
  let hostType = "";
59
58
  let hostBundle = "";
60
59
  let fieldName = "";
61
- for (let i = 0; i < selection.blocks.value.length; i++) {
62
- const block = selection.blocks.value[i];
63
- if (i !== 0 && (hostType !== block.hostType || hostBundle !== block.hostBundle || fieldName !== block.hostFieldName)) {
60
+ for (let i = 0; i < selection.items.value.length; i++) {
61
+ const block = selection.items.value[i];
62
+ if (i !== 0 && (hostType !== block.host.type || hostBundle !== block.host.bundle || fieldName !== block.host.fieldName)) {
64
63
  return [];
65
64
  }
66
- hostType = block.hostType;
67
- hostBundle = block.hostBundle;
68
- fieldName = block.hostFieldName;
65
+ hostType = block.host.type;
66
+ hostBundle = block.host.bundle;
67
+ fieldName = block.host.fieldName;
69
68
  }
70
69
  return fieldConfig.forName(hostType, hostBundle, fieldName)?.allowedBundles || [];
71
70
  });
72
- watch(selection.blocks, () => {
73
- if (selection.blocks.value.length !== 1) {
74
- return;
75
- }
76
- const item = selection.blocks.value[0];
77
- const hasNested = itemBundlesWithNested.includes(item.itemBundle);
78
- if (hasNested) {
79
- const nestedFields = fieldConfig.forEntityTypeAndBundle(itemEntityType, item.itemBundle).map((v) => v.name) || [];
80
- if (nestedFields.length === 1) {
81
- eventBus.emit("setActiveFieldKey", `${item.uuid}:${nestedFields[0]}`);
82
- return;
83
- }
84
- }
85
- eventBus.emit("setActiveFieldKey", `${item.hostUuid}:${item.hostFieldName}`);
86
- });
87
71
  const itemBundlesWithNested = fieldConfig.forEntityType(itemEntityType).map((v) => v.entityBundle) || [];
88
72
  const typeMap = bundleDefinitions.reduce((acc, type) => {
89
73
  acc[type.id] = type;
@@ -96,8 +80,8 @@ export default async function(adapter, selection, context) {
96
80
  return fieldConfig.forName(entityType, entityBundle, fieldName);
97
81
  }
98
82
  function getDroppableFieldConfig(fieldName, host) {
99
- const entityType = "entityType" in host ? host.entityType : host.type;
100
- const entityBundle = "itemBundle" in host ? host.itemBundle : host.bundle;
83
+ const entityType = "itemType" in host ? host.block.host.type : host.type;
84
+ const entityBundle = "itemType" in host ? host.block.host.bundle : host.bundle;
101
85
  const config = droppableFieldConfig.forName(
102
86
  entityType,
103
87
  entityBundle,
@@ -3,10 +3,13 @@ import type { StorageProvider } from './storageProvider.js';
3
3
  import type { AddListOrientation, Coord, Rectangle, Size } from '#blokkli/types';
4
4
  import type { Viewport } from '#blokkli/constants';
5
5
  import type { StateProvider } from './stateProvider.js';
6
+ import type { AdapterContext } from '#blokkli/adapter';
7
+ import type { ThemeColorName } from '#blokkli/types/theme';
8
+ import type { ElementProvider } from './providers/element.js';
6
9
  export type UiProvider = {
7
10
  rootElement: () => HTMLElement;
8
11
  artboardElement: () => HTMLElement;
9
- providerElement: () => HTMLElement;
12
+ providerElement: HTMLElement;
10
13
  menu: {
11
14
  isOpen: Readonly<Ref<boolean>>;
12
15
  close: () => void;
@@ -14,9 +17,16 @@ export type UiProvider = {
14
17
  };
15
18
  isMobile: ComputedRef<boolean>;
16
19
  isDesktop: ComputedRef<boolean>;
17
- isArtboard: () => boolean;
18
20
  isAnimating: Ref<boolean>;
21
+ isAnalyzing: Ref<boolean>;
19
22
  isProxyMode: Ref<boolean>;
23
+ hasDialogOpen: Ref<boolean>;
24
+ hasTooltipOpen: ComputedRef<boolean>;
25
+ openTooltip: Ref<string>;
26
+ selectionColor: ComputedRef<ThemeColorName | null>;
27
+ setSelectionColor: (id: string, color: ThemeColorName) => void;
28
+ removeSelectionColor: (id: string) => void;
29
+ hasTransformOverlayOpen: Ref<boolean>;
20
30
  isTransforming: ComputedRef<boolean>;
21
31
  setTransform: (label?: string | null | undefined) => void;
22
32
  transformLabel: ComputedRef<string>;
@@ -35,7 +45,12 @@ export type UiProvider = {
35
45
  artboardScale: Ref<number>;
36
46
  artboardOffset: Ref<Coord>;
37
47
  selectionTopLeft: Ref<Coord>;
48
+ interfaceLanguage: ComputedRef<string>;
49
+ locale: ComputedRef<string>;
50
+ formatDate: (date: string | Date, options?: Intl.DateTimeFormatOptions) => string;
38
51
  getAbsoluteElementRect: (v: HTMLElement | Rectangle, scale?: number, offset?: Coord) => Rectangle;
39
52
  getViewportRelativeRect: (rect: Rectangle, scale?: number, offset?: Coord) => Rectangle;
53
+ setBannerHeight: (id: string, height: number) => void;
54
+ removeBanner: (id: string) => void;
40
55
  };
41
- export default function (storage: StorageProvider, state: StateProvider): UiProvider;
56
+ export default function (providerElement: HTMLElement, storage: StorageProvider, state: StateProvider, context: ComputedRef<AdapterContext>, element: ElementProvider): UiProvider;
@@ -2,29 +2,53 @@ import {
2
2
  onMounted,
3
3
  onBeforeUnmount,
4
4
  ref,
5
- computed,
6
- watch
5
+ computed
7
6
  } from "vue";
8
7
  import { eventBus } from "./eventBus.js";
9
8
  import { falsy } from "./index.js";
10
- const ARTBOARD_CLASS = "bk-is-artboard";
9
+ import { addElementClasses } from "./addElementClasses.js";
10
+ import { defaultLanguage, forceDefaultLanguage } from "#blokkli-build/config";
11
11
  const CLASS_PROXY_MODE = "bk-is-proxy-mode";
12
- export default function(storage, state) {
12
+ const localeMap = {
13
+ de: "de-CH",
14
+ fr: "fr-CH",
15
+ it: "it-CH",
16
+ en: "en-GB"
17
+ };
18
+ export default function(providerElement, storage, state, context, element) {
13
19
  let cachedRootElement = null;
14
20
  let cachedArtboardElement = null;
15
- let cachedProviderElement = null;
21
+ const interfaceLanguage = computed(() => {
22
+ return forceDefaultLanguage ? defaultLanguage : context.value.language;
23
+ });
24
+ const locale = computed(() => {
25
+ const lang = interfaceLanguage.value;
26
+ return localeMap[lang] || lang;
27
+ });
16
28
  const isProxyMode = ref(false);
17
29
  const menuIsOpen = ref(false);
30
+ const hasDialogOpen = ref(false);
31
+ const openTooltip = ref("");
32
+ const hasTransformOverlayOpen = ref(false);
18
33
  const isAnimating = ref(false);
34
+ const isAnalyzing = ref(false);
19
35
  const transformLabel = ref("");
20
36
  const openContextMenu = ref("");
37
+ const banners = ref({});
38
+ function setBannerHeight(id, height) {
39
+ banners.value[id] = height;
40
+ }
41
+ function removeBanner(id) {
42
+ banners.value[id] = 0;
43
+ }
21
44
  const selectionTopLeft = ref({ x: 0, y: 0 });
22
- const useAnimationsSetting = storage.use("useAnimations", true);
23
- const useAnimations = computed(() => useAnimationsSetting.value);
24
45
  const baseSettings = storage.use("feature:settings:settings", {});
25
46
  const lowPerformanceMode = computed(
26
47
  () => baseSettings.value.lowPerformanceMode
27
48
  );
49
+ const useAnimations = computed(
50
+ () => baseSettings.value.useAnimations !== false
51
+ );
28
52
  const viewportBlockingRectsMap = ref(
29
53
  {}
30
54
  );
@@ -61,7 +85,11 @@ export default function(storage, state) {
61
85
  if (cachedArtboardElement) {
62
86
  return cachedArtboardElement;
63
87
  }
64
- const el = document.querySelector(".bk-main-canvas");
88
+ const el = element.query(
89
+ document.documentElement,
90
+ ".bk-main-canvas",
91
+ "Get main canvas."
92
+ );
65
93
  if (!el || !(el instanceof HTMLElement)) {
66
94
  throw new Error("Failed to locate artboard element.");
67
95
  }
@@ -72,24 +100,17 @@ export default function(storage, state) {
72
100
  if (cachedRootElement) {
73
101
  return cachedRootElement;
74
102
  }
75
- const el = document.querySelector("#nuxt-root");
103
+ const el = element.query(
104
+ document.documentElement,
105
+ "#nuxt-root",
106
+ "Get Nuxt root element."
107
+ );
76
108
  if (!el || !(el instanceof HTMLElement)) {
77
109
  throw new Error("Failed to locate root Nuxt element.");
78
110
  }
79
111
  cachedRootElement = el;
80
112
  return el;
81
113
  };
82
- const providerElement = () => {
83
- if (cachedProviderElement) {
84
- return cachedProviderElement;
85
- }
86
- const el = document.querySelector('[data-blokkli-provider-active="true"]');
87
- if (!el || !(el instanceof HTMLElement)) {
88
- throw new Error("Failed to locate provider element.");
89
- }
90
- cachedProviderElement = el;
91
- return el;
92
- };
93
114
  const appViewport = computed(() => {
94
115
  if (viewportWidth.value < 1024) {
95
116
  return "mobile";
@@ -109,16 +130,6 @@ export default function(storage, state) {
109
130
  eventBus.emit("ui:resized");
110
131
  }, 400);
111
132
  };
112
- const isArtboard = () => {
113
- return document.documentElement.classList.contains(ARTBOARD_CLASS);
114
- };
115
- watch(isAnimating, (is) => {
116
- if (is) {
117
- document.documentElement.classList.add("bk-is-animating");
118
- } else {
119
- document.documentElement.classList.remove("bk-is-animating");
120
- }
121
- });
122
133
  const toolbarHeight = computed(() => {
123
134
  if (isMobile.value) {
124
135
  return 80;
@@ -167,6 +178,11 @@ export default function(storage, state) {
167
178
  height -= 70;
168
179
  }
169
180
  }
181
+ const bannerHeights = Object.values(banners.value).filter(Boolean);
182
+ bannerHeights.forEach((bannerHeight) => {
183
+ height -= bannerHeight;
184
+ });
185
+ height -= bannerHeights.length * 10;
170
186
  return height;
171
187
  });
172
188
  const blockingPaddingX = computed(() => 15);
@@ -200,35 +216,6 @@ export default function(storage, state) {
200
216
  height: visibleViewportHeight.value - 20
201
217
  };
202
218
  });
203
- function setProxyModeClass() {
204
- document.documentElement.classList.remove(CLASS_PROXY_MODE);
205
- if (isProxyMode.value) {
206
- document.documentElement.classList.add(CLASS_PROXY_MODE);
207
- }
208
- }
209
- watch(isProxyMode, setProxyModeClass);
210
- onMounted(() => {
211
- document.documentElement.classList.add("bk-html-root");
212
- document.body.classList.add("bk-body");
213
- document.documentElement.classList.add(ARTBOARD_CLASS);
214
- setProxyModeClass();
215
- viewportWidth.value = window.innerWidth;
216
- viewportHeight.value = window.innerHeight;
217
- window.addEventListener("resize", onResize);
218
- const artboard = artboardElement();
219
- resizeObserver.observe(artboard);
220
- });
221
- onBeforeUnmount(() => {
222
- window.removeEventListener("resize", onResize);
223
- document.documentElement.classList.remove("bk-html-root");
224
- document.body.classList.remove("bk-body");
225
- document.documentElement.classList.remove(ARTBOARD_CLASS);
226
- document.documentElement.classList.remove(CLASS_PROXY_MODE);
227
- clearTimeout(resizeTimeout);
228
- const artboard = artboardElement();
229
- resizeObserver.unobserve(artboard);
230
- resizeObserver.disconnect();
231
- });
232
219
  const viewport = computed(() => {
233
220
  return {
234
221
  width: viewportWidth.value,
@@ -260,6 +247,60 @@ export default function(storage, state) {
260
247
  function setTransform(label) {
261
248
  transformLabel.value = label || "";
262
249
  }
250
+ function formatDate(date, options) {
251
+ const dateObj = typeof date === "string" ? new Date(date) : date;
252
+ const defaultOptions = {
253
+ year: "numeric",
254
+ month: "2-digit",
255
+ day: "2-digit",
256
+ hour: "2-digit",
257
+ minute: "2-digit"
258
+ };
259
+ return dateObj.toLocaleString(locale.value, options || defaultOptions);
260
+ }
261
+ addElementClasses(document.documentElement, "bk-is-animating", isAnimating);
262
+ addElementClasses(
263
+ document.documentElement,
264
+ "bk-has-sidebar-left",
265
+ activeSidebarLeft
266
+ );
267
+ addElementClasses(
268
+ document.documentElement,
269
+ "bk-has-sidebar-right",
270
+ activeSidebarRight
271
+ );
272
+ addElementClasses(document.documentElement, ["bk-html-root"]);
273
+ addElementClasses(document.body, "bk-body");
274
+ addElementClasses(document.documentElement, CLASS_PROXY_MODE, isProxyMode);
275
+ addElementClasses(document.documentElement, "bk-is-analyzing", isAnalyzing);
276
+ onMounted(() => {
277
+ viewportWidth.value = window.innerWidth;
278
+ viewportHeight.value = window.innerHeight;
279
+ window.addEventListener("resize", onResize);
280
+ const artboard = artboardElement();
281
+ resizeObserver.observe(artboard);
282
+ });
283
+ onBeforeUnmount(() => {
284
+ window.removeEventListener("resize", onResize);
285
+ clearTimeout(resizeTimeout);
286
+ const artboard = artboardElement();
287
+ resizeObserver.unobserve(artboard);
288
+ resizeObserver.disconnect();
289
+ });
290
+ const hasTooltipOpen = computed(() => !!openTooltip.value);
291
+ const selectionColors = ref([]);
292
+ function setSelectionColor(id, color) {
293
+ selectionColors.value = [
294
+ ...selectionColors.value.filter((v) => v.id !== id),
295
+ { id, color }
296
+ ];
297
+ }
298
+ function removeSelectionColor(id) {
299
+ selectionColors.value = selectionColors.value.filter((v) => v.id !== id);
300
+ }
301
+ const selectionColor = computed(() => {
302
+ return selectionColors.value[selectionColors.value.length - 1]?.color ?? null;
303
+ });
263
304
  return {
264
305
  menu: {
265
306
  isOpen: menuIsOpen,
@@ -271,8 +312,8 @@ export default function(storage, state) {
271
312
  providerElement,
272
313
  isMobile,
273
314
  isDesktop,
274
- isArtboard,
275
315
  isAnimating,
316
+ isAnalyzing,
276
317
  isTransforming,
277
318
  setTransform,
278
319
  transformLabel: computed(() => transformLabel.value),
@@ -293,6 +334,18 @@ export default function(storage, state) {
293
334
  selectionTopLeft,
294
335
  lowPerformanceMode,
295
336
  getAbsoluteElementRect,
296
- getViewportRelativeRect
337
+ getViewportRelativeRect,
338
+ interfaceLanguage,
339
+ locale,
340
+ formatDate,
341
+ hasDialogOpen,
342
+ hasTransformOverlayOpen,
343
+ hasTooltipOpen,
344
+ openTooltip,
345
+ selectionColor,
346
+ setSelectionColor,
347
+ removeSelectionColor,
348
+ setBannerHeight,
349
+ removeBanner
297
350
  };
298
351
  }
@@ -0,0 +1,18 @@
1
+ import type { RGB } from '#blokkli/types/theme';
2
+ interface TransitionOptions {
3
+ /**
4
+ * Duration in milliseconds.
5
+ */
6
+ duration?: number;
7
+ /**
8
+ * The easing method. Defaults to "ease out quad".
9
+ */
10
+ easing?: (t: number) => number;
11
+ }
12
+ /**
13
+ * Creates a computed property from the given callback and transitions between values.
14
+ *
15
+ * Returns a method that, when called, will return the current transitioned value.
16
+ */
17
+ export declare function useTransitionedValue<T extends RGB | number>(valueCallback: () => T, options?: TransitionOptions): () => T;
18
+ export {};
@@ -0,0 +1,57 @@
1
+ import { computed, watch } from "vue";
2
+ import { easeOutQuad } from "./easing.js";
3
+ function isRGB(value) {
4
+ return Array.isArray(value) && value.length === 3;
5
+ }
6
+ function lerp(start, end, t) {
7
+ return start + (end - start) * t;
8
+ }
9
+ function interpolateColor(from, to, t) {
10
+ return [
11
+ lerp(from[0], to[0], t),
12
+ lerp(from[1], to[1], t),
13
+ lerp(from[2], to[2], t)
14
+ ];
15
+ }
16
+ function interpolateValue(from, to, t) {
17
+ if (isRGB(from) && isRGB(to)) {
18
+ return interpolateColor(from, to, t);
19
+ } else if (typeof from === "number" && typeof to === "number") {
20
+ return lerp(from, to, t);
21
+ }
22
+ return to;
23
+ }
24
+ function cloneValue(value) {
25
+ if (isRGB(value)) {
26
+ return [...value];
27
+ }
28
+ return value;
29
+ }
30
+ export function useTransitionedValue(valueCallback, options = {}) {
31
+ const { duration = 300, easing = easeOutQuad } = options;
32
+ const value = computed(valueCallback);
33
+ const initial = value.value;
34
+ let current = cloneValue(initial);
35
+ let target = cloneValue(initial);
36
+ let from = cloneValue(initial);
37
+ let startTime = null;
38
+ watch(value, (newValue) => {
39
+ from = cloneValue(current);
40
+ target = cloneValue(newValue);
41
+ startTime = Date.now();
42
+ });
43
+ return function getCurrentValue() {
44
+ if (startTime !== null) {
45
+ const elapsed = Date.now() - startTime;
46
+ const rawProgress = Math.min(elapsed / duration, 1);
47
+ if (rawProgress >= 1) {
48
+ current = cloneValue(target);
49
+ startTime = null;
50
+ } else {
51
+ const easedProgress = easing(rawProgress);
52
+ current = interpolateValue(from, target, easedProgress);
53
+ }
54
+ }
55
+ return current;
56
+ };
57
+ }
@@ -8,10 +8,16 @@ type RectangleBufferRect = Rectangle & {
8
8
  };
9
9
  type RectangleBufferCollectorOptions = {
10
10
  padding?: number;
11
+ deferredMode?: boolean;
11
12
  };
12
13
  type PlacedRectangle = Rectangle & {
13
14
  originalY: number;
14
15
  };
16
+ type PendingRect<T> = {
17
+ rect: Omit<T, 'index'>;
18
+ type: number;
19
+ checkOverlap: boolean;
20
+ };
15
21
  export declare class RectangleBufferCollector<T extends RectangleBufferRect> {
16
22
  gl?: WebGLRenderingContext;
17
23
  added: Set<string>;
@@ -26,10 +32,13 @@ export declare class RectangleBufferCollector<T extends RectangleBufferRect> {
26
32
  index: number;
27
33
  bufferInfo: BufferInfo | null;
28
34
  placedRects: PlacedRectangle[];
29
- constructor(gl?: WebGLRenderingContext, _options?: RectangleBufferCollectorOptions);
35
+ deferredMode: boolean;
36
+ pendingRects: PendingRect<T>[];
37
+ constructor(gl?: WebGLRenderingContext, options?: RectangleBufferCollectorOptions);
30
38
  reset(): void;
31
- getIdealPosition(x: number, y: number, width: number, height: number): Rectangle;
39
+ getIdealPosition(x: number, y: number, width: number, height: number, isEmptyField?: boolean): Rectangle;
32
40
  addRectangle(rect: Omit<T, 'index'>, type: number, checkOverlap?: boolean): void;
41
+ processPendingRects(): void;
33
42
  getIndex(id: string): number | undefined;
34
43
  updateRectangle(): void;
35
44
  createBufferInfo(): BufferInfo | null;
@@ -14,12 +14,18 @@ export class RectangleBufferCollector {
14
14
  index = 0;
15
15
  bufferInfo = null;
16
16
  placedRects = [];
17
- constructor(gl, _options) {
17
+ deferredMode = false;
18
+ pendingRects = [];
19
+ constructor(gl, options) {
18
20
  this.gl = gl;
21
+ this.deferredMode = options?.deferredMode || false;
19
22
  }
20
23
  reset() {
21
24
  this.added = /* @__PURE__ */ new Set();
22
- this.rects = {};
25
+ if (!this.deferredMode) {
26
+ this.rects = {};
27
+ }
28
+ this.placedRects = [];
23
29
  this.positions = [];
24
30
  this.indices = [];
25
31
  this.rectId = [];
@@ -29,8 +35,10 @@ export class RectangleBufferCollector {
29
35
  this.radius = [];
30
36
  this.index = 0;
31
37
  this.bufferInfo = null;
38
+ this.pendingRects = [];
32
39
  }
33
- getIdealPosition(x, y, width, height) {
40
+ getIdealPosition(x, y, width, height, isEmptyField = false) {
41
+ const MIN_HEIGHT = 5;
34
42
  const rect = {
35
43
  x,
36
44
  y,
@@ -40,19 +48,63 @@ export class RectangleBufferCollector {
40
48
  };
41
49
  const intersections = [];
42
50
  for (let i = 0; i < this.placedRects.length; i++) {
43
- if (intersects(rect, this.placedRects[i])) {
44
- intersections.push(this.placedRects[i]);
51
+ const placed = this.placedRects[i];
52
+ const testRect = { ...rect, height: Math.max(height, MIN_HEIGHT) };
53
+ const testPlaced = {
54
+ ...placed,
55
+ height: Math.max(placed.height, MIN_HEIGHT)
56
+ };
57
+ if (intersects(testRect, testPlaced)) {
58
+ intersections.push(placed);
45
59
  }
46
60
  }
47
61
  if (intersections.length === 0) {
48
62
  this.placedRects.push(rect);
49
63
  return rect;
50
64
  }
51
- intersections.sort((a, b) => b.originalY - a.originalY);
65
+ intersections.sort((a, b) => a.originalY - b.originalY);
66
+ if (isEmptyField) {
67
+ for (let i = 0; i < intersections.length; i++) {
68
+ const existingRect = intersections[i];
69
+ const rectsAbove = this.placedRects.filter(
70
+ (r) => r.y + r.height <= existingRect.y && r.x < x + width && r.x + r.width > x
71
+ );
72
+ let prevBottom = 0;
73
+ if (rectsAbove.length > 0) {
74
+ prevBottom = Math.max(...rectsAbove.map((r) => r.y + r.height));
75
+ }
76
+ const nextTop = existingRect.y;
77
+ const availableSpace = nextTop - prevBottom;
78
+ if (availableSpace >= height) {
79
+ const centeredY = prevBottom + (availableSpace - height) / 2;
80
+ const centeredRect = { ...rect, y: centeredY };
81
+ let hasIntersection = false;
82
+ for (const placed of this.placedRects) {
83
+ const testCentered = {
84
+ ...centeredRect,
85
+ height: Math.max(height, MIN_HEIGHT)
86
+ };
87
+ const testPlaced = {
88
+ ...placed,
89
+ height: Math.max(placed.height, MIN_HEIGHT)
90
+ };
91
+ if (intersects(testCentered, testPlaced)) {
92
+ hasIntersection = true;
93
+ break;
94
+ }
95
+ }
96
+ if (!hasIntersection) {
97
+ rect.y = centeredY;
98
+ this.placedRects.push(rect);
99
+ return rect;
100
+ }
101
+ }
102
+ }
103
+ }
52
104
  for (let i = 0; i < intersections.length; i++) {
53
105
  const existingRect = intersections[i];
54
106
  let iterations = 0;
55
- const direction = y > existingRect.originalY ? -1 : 1;
107
+ const direction = y < existingRect.originalY ? -1 : 1;
56
108
  while (intersects(rect, existingRect) && iterations < 10) {
57
109
  rect.y = y + direction * (10 * (iterations + 1));
58
110
  iterations++;
@@ -65,6 +117,10 @@ export class RectangleBufferCollector {
65
117
  return rect;
66
118
  }
67
119
  addRectangle(rect, type, checkOverlap = false) {
120
+ if (this.deferredMode) {
121
+ this.pendingRects.push({ rect, type, checkOverlap });
122
+ return;
123
+ }
68
124
  const { x, y, width, height } = checkOverlap ? this.getIdealPosition(rect.x, rect.y, rect.width, rect.height) : rect;
69
125
  this.positions.push(
70
126
  x,
@@ -119,6 +175,105 @@ export class RectangleBufferCollector {
119
175
  this.added.add(rect.id);
120
176
  this.index++;
121
177
  }
178
+ processPendingRects() {
179
+ if (!this.deferredMode) {
180
+ return;
181
+ }
182
+ if (!this.pendingRects.length) {
183
+ return;
184
+ }
185
+ const sortedPending = [...this.pendingRects].sort(
186
+ (a, b) => a.rect.y - b.rect.y
187
+ );
188
+ const passes = [
189
+ sortedPending.filter((p) => !p.rect.id.includes(":empty:")),
190
+ // Non-empty rects
191
+ sortedPending.filter((p) => p.rect.id.includes(":empty:"))
192
+ // Empty rects
193
+ ];
194
+ for (const pass of passes) {
195
+ for (const { rect, type, checkOverlap } of pass) {
196
+ if (this.added.has(rect.id)) {
197
+ continue;
198
+ }
199
+ let finalPosition;
200
+ const existing = this.rects[rect.id];
201
+ if (existing) {
202
+ finalPosition = {
203
+ x: existing.x,
204
+ y: existing.y,
205
+ width: existing.width,
206
+ height: existing.height
207
+ };
208
+ } else if (checkOverlap) {
209
+ const isEmptyField = rect.id.includes(":empty:");
210
+ finalPosition = this.getIdealPosition(
211
+ rect.x,
212
+ rect.y,
213
+ rect.width,
214
+ rect.height,
215
+ isEmptyField
216
+ );
217
+ } else {
218
+ finalPosition = {
219
+ x: rect.x,
220
+ y: rect.y,
221
+ width: rect.width,
222
+ height: rect.height
223
+ };
224
+ }
225
+ const { x, y, width, height } = finalPosition;
226
+ this.positions.push(
227
+ x,
228
+ y,
229
+ // Lower left corner
230
+ 0,
231
+ x + width,
232
+ y,
233
+ // Lower right corner
234
+ 1,
235
+ x + width,
236
+ y + height,
237
+ // Upper right corner
238
+ 2,
239
+ x,
240
+ y + height,
241
+ // Upper left corner
242
+ 3
243
+ );
244
+ const baseIndex = 4 * this.index;
245
+ this.indices.push(
246
+ baseIndex,
247
+ baseIndex + 1,
248
+ baseIndex + 2,
249
+ baseIndex,
250
+ baseIndex + 2,
251
+ baseIndex + 3
252
+ );
253
+ const r = rect.radius || [4, 4, 4, 4];
254
+ this.radius.push(...r, ...r, ...r, ...r);
255
+ this.rectId.push(this.index, this.index, this.index, this.index);
256
+ this.types.push(type, type, type, type);
257
+ this.quad.push(x, y, width, height);
258
+ this.quad.push(x, y, width, height);
259
+ this.quad.push(x, y, width, height);
260
+ this.quad.push(x, y, width, height);
261
+ const state = rect.state || 0;
262
+ this.state.push(state, state, state, state);
263
+ this.rects[rect.id] = {
264
+ ...rect,
265
+ index: this.index,
266
+ x,
267
+ y,
268
+ width,
269
+ height
270
+ };
271
+ this.added.add(rect.id);
272
+ this.index++;
273
+ }
274
+ this.pendingRects = [];
275
+ }
276
+ }
122
277
  getIndex(id) {
123
278
  return this.rects[id]?.index;
124
279
  }