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

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 +51 -39
  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 +153 -64
  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 +96 -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
@@ -32,6 +32,7 @@ import {
32
32
  nextTick
33
33
  } from "#imports";
34
34
  import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
35
+ import { renderCycle } from "#blokkli/helpers/renderCycle";
35
36
  const { adapter } = defineBlokkliFeature({
36
37
  icon: "drag",
37
38
  id: "dragging-overlay",
@@ -39,7 +40,18 @@ const { adapter } = defineBlokkliFeature({
39
40
  description: "Renders an overlay when dragging or placing a block.",
40
41
  screenshot: "feature-dragging-overlay.jpg"
41
42
  });
42
- const { eventBus, state, ui, animation, dom, selection, definitions } = useBlokkli();
43
+ const {
44
+ eventBus,
45
+ state,
46
+ ui,
47
+ animation,
48
+ dom,
49
+ selection,
50
+ definitions,
51
+ blocks,
52
+ directive,
53
+ fields
54
+ } = useBlokkli();
43
55
  const dragItemsComponent = ref(null);
44
56
  const isVisible = ref(false);
45
57
  const isTouching = ref(false);
@@ -76,7 +88,7 @@ function filterItemType(items) {
76
88
  return { itemType, item: items[0] };
77
89
  }
78
90
  const onDropNew = async (bundle, host, afterUuid) => {
79
- const field = dom.findField(host.uuid, host.fieldName);
91
+ const field = fields.find(host.uuid, host.fieldName);
80
92
  if (!field) {
81
93
  throw new Error(
82
94
  `Failed to locate field with name "${host.fieldName}" on UUID "${host.uuid}"`
@@ -105,7 +117,7 @@ const onDropNew = async (bundle, host, afterUuid) => {
105
117
  }
106
118
  };
107
119
  const onDropExisting = async (items, host, afterUuid) => {
108
- const uuids = items.map((v) => v.uuid);
120
+ const uuids = items.map((v) => v.block.uuid);
109
121
  await state.mutateWithLoadingState(
110
122
  () => adapter.moveMultipleBlocks({
111
123
  uuids,
@@ -126,13 +138,15 @@ const onDropExisting = async (items, host, afterUuid) => {
126
138
  }
127
139
  };
128
140
  const onDropReusable = async (item, host, afterUuid) => {
129
- await state.mutateWithLoadingState(
130
- () => adapter.addLibraryItem({
131
- libraryItemUuid: item.libraryItemUuid,
132
- host,
133
- afterUuid
134
- })
135
- );
141
+ if (adapter.addLibraryItem) {
142
+ await state.mutateWithLoadingState(
143
+ () => adapter.addLibraryItem({
144
+ libraryItemUuid: item.libraryItemUuid,
145
+ host,
146
+ afterUuid
147
+ })
148
+ );
149
+ }
136
150
  };
137
151
  const onDropClipboardItem = async (item, host, afterUuid) => {
138
152
  eventBus.emit("drop:clipboardItem", {
@@ -162,24 +176,28 @@ const onDropMediaLibraryItem = async (items, host, afterUuid) => {
162
176
  }
163
177
  };
164
178
  const onDropSearchContentItem = async (item, host, afterUuid) => {
165
- await state.mutateWithLoadingState(
166
- () => adapter.addContentSearchItem({
167
- item: item.searchItem,
168
- host,
169
- bundle: item.itemBundle,
170
- afterUuid
171
- })
172
- );
179
+ if (adapter.addContentSearchItem) {
180
+ await state.mutateWithLoadingState(
181
+ () => adapter.addContentSearchItem({
182
+ item: item.searchItem,
183
+ host,
184
+ bundle: item.itemBundle,
185
+ afterUuid
186
+ })
187
+ );
188
+ }
173
189
  };
174
190
  const onDropAction = (action, host, field, afterUuid) => {
175
191
  eventBus.emit("action:placed", {
192
+ id: action.actionType,
176
193
  preceedingUuid: afterUuid,
177
- action,
178
194
  host,
179
195
  field
180
196
  });
181
197
  };
198
+ let allUuidsBefore = [];
182
199
  const onDrop = (e) => {
200
+ allUuidsBefore = state.getAllUuids();
183
201
  mouseX.value = 0;
184
202
  mouseY.value = 0;
185
203
  nextTick(async () => {
@@ -203,40 +221,46 @@ const onDrop = (e) => {
203
221
  }
204
222
  eventBus.emit("dragging:end");
205
223
  eventBus.emit("item:dropped");
206
- const newUuid = state.mutations.value[state.mutations.value.length - 1]?.plugin?.affectedItemUuid;
207
- if (!newUuid) {
208
- return;
209
- }
210
- const newBlock = dom.findBlock(newUuid);
211
- if (!newBlock) {
212
- return;
213
- }
214
- const allSelected = [...selection.uuids.value, newBlock.uuid];
215
- eventBus.emit("select", allSelected);
216
- if (typed.itemType !== "new") {
217
- return;
218
- }
219
- const definition = definitions.getBlockDefinition(
220
- newBlock.itemBundle,
221
- newBlock.hostFieldListType
222
- );
223
- if (!definition?.editor?.addBehaviour?.startsWith("editable:")) {
224
- return;
225
- }
226
- const editableField = definition.editor.addBehaviour.split(":")[1];
227
- if (!editableField) {
228
- return;
229
- }
230
- const editableFieldElement = newBlock.element().querySelector(`[data-blokkli-editable-field="${editableField}"]`);
231
- if (!(editableFieldElement instanceof HTMLElement)) {
232
- return;
233
- }
234
- eventBus.emit("editable:focus", {
235
- fieldName: editableField,
236
- uuid: newUuid
237
- });
238
224
  });
239
225
  };
226
+ onBlokkliEvent("state:reloaded", async function() {
227
+ if (!allUuidsBefore.length) {
228
+ return;
229
+ }
230
+ const allUuidsAfter = state.getAllUuids();
231
+ const newUuid = allUuidsAfter.find((uuid) => !allUuidsBefore.includes(uuid));
232
+ allUuidsBefore = [];
233
+ if (!newUuid) {
234
+ return;
235
+ }
236
+ eventBus.emit("select", newUuid);
237
+ await renderCycle();
238
+ const newBlock = blocks.getBlock(newUuid);
239
+ if (!newBlock) {
240
+ return;
241
+ }
242
+ const allSelected = [...selection.uuids.value, newBlock.uuid];
243
+ eventBus.emit("select", allSelected);
244
+ const definition = definitions.getBlockDefinition(
245
+ newBlock.bundle,
246
+ newBlock.fieldListType
247
+ );
248
+ if (!definition?.editor?.addBehaviour?.startsWith("editable:")) {
249
+ return;
250
+ }
251
+ const editableField = definition.editor.addBehaviour.split(":")[1];
252
+ if (!editableField) {
253
+ return;
254
+ }
255
+ const editableFieldElement = directive.getEditablesForBlock(newUuid).find((v) => v.fieldName === editableField);
256
+ if (!editableFieldElement) {
257
+ return;
258
+ }
259
+ eventBus.emit("editable:focus", {
260
+ fieldName: editableField,
261
+ uuid: newUuid
262
+ });
263
+ });
240
264
  onBlokkliEvent("dragging:drop", onDrop);
241
265
  function loop() {
242
266
  if (!isVisible.value) {
@@ -270,17 +294,15 @@ onBlokkliEvent("dragging:start", (e) => {
270
294
  mouseY.value = e.coords.y;
271
295
  dom.updateVisibleRects();
272
296
  dragItems.value = e.items;
273
- if ("element" in item) {
274
- if (!isTouching.value) {
275
- document.removeEventListener("pointerup", onMouseUp);
276
- document.addEventListener("pointerup", onMouseUp);
277
- document.removeEventListener("pointermove", onMouseMove, {
278
- capture: true
279
- });
280
- document.addEventListener("pointermove", onMouseMove, { capture: true });
281
- }
282
- eventBus.on("animationFrame", loop);
297
+ if (!isTouching.value) {
298
+ document.removeEventListener("pointerup", onMouseUp);
299
+ document.addEventListener("pointerup", onMouseUp);
300
+ document.removeEventListener("pointermove", onMouseMove, {
301
+ capture: true
302
+ });
303
+ document.addEventListener("pointermove", onMouseMove, { capture: true });
283
304
  }
305
+ eventBus.on("animationFrame", loop);
284
306
  });
285
307
  onBlokkliEvent("dragging:end", () => {
286
308
  isVisible.value = false;
@@ -290,11 +312,15 @@ onBlokkliEvent("dragging:end", () => {
290
312
  document.removeEventListener("pointermove", onMouseMove, { capture: true });
291
313
  });
292
314
  onBlokkliEvent("keyPressed", (e) => {
315
+ if (ui.hasDialogOpen.value) {
316
+ return;
317
+ }
293
318
  if (e.code === "Escape") {
294
319
  eventBus.emit("dragging:end");
295
320
  }
296
321
  });
297
322
  onBlokkliEvent("block:append", (e) => {
323
+ allUuidsBefore = state.getAllUuids();
298
324
  onDropNew(e.bundle, e.host, e.afterUuid);
299
325
  });
300
326
  onUnmounted(() => {
@@ -3,6 +3,7 @@
3
3
  id="duplicate"
4
4
  :title="$t('duplicate', 'Duplicate')"
5
5
  :disabled="!canDuplicate"
6
+ edit-only
6
7
  meta
7
8
  key-code="D"
8
9
  multiple
@@ -31,22 +32,19 @@ function onClick(items) {
31
32
  );
32
33
  }
33
34
  const canDuplicate = computed(() => {
34
- if (state.editMode.value !== "editing") {
35
- return false;
36
- }
37
35
  const blocksByField = {};
38
36
  const fieldsByKey = {};
39
- const selectedCount = selection.blocks.value.length;
37
+ const selectedCount = selection.items.value.length;
40
38
  for (let i = 0; i < selectedCount; i++) {
41
- const block = selection.blocks.value[i];
42
- const field = state.getMutatedField(block.hostUuid, block.hostFieldName);
39
+ const block = selection.items.value[i];
40
+ const field = state.getMutatedField(block.host.uuid, block.host.fieldName);
43
41
  if (!field) {
44
42
  continue;
45
43
  }
46
44
  const fieldKey = getFieldKey(field.entityUuid, field.name);
47
45
  const fieldConfig = types.getFieldConfig(
48
46
  field.entityType,
49
- block.hostBundle,
47
+ block.host.bundle,
50
48
  field.name
51
49
  );
52
50
  if (!fieldConfig) {
@@ -77,7 +75,7 @@ const canDuplicate = computed(() => {
77
75
  if (field.cardinality !== -1 && count + blocks.length > field.cardinality) {
78
76
  return false;
79
77
  }
80
- const bundles = blocks.map((v) => v.itemBundle);
78
+ const bundles = blocks.map((v) => v.bundle);
81
79
  if (!field.allowedBundles.length || bundles.some((bundle) => !field.allowedBundles.includes(bundle))) {
82
80
  return false;
83
81
  }
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <PluginItemAction
3
- v-if="isEditing"
4
3
  id="edit"
5
- :title="$t('edit', 'Edit')"
4
+ edit-only
5
+ :title="$t('edit', 'Edit...')"
6
6
  :disabled="!canEdit"
7
7
  meta
8
8
  key-code="E"
@@ -24,27 +24,21 @@ defineBlokkliFeature({
24
24
  requiredAdapterMethods: ["formFrameBuilder"]
25
25
  });
26
26
  const { eventBus, selection, state, $t, adapter, definitions } = useBlokkli();
27
- const block = computed(() => {
28
- if (selection.blocks.value.length !== 1) {
29
- return null;
30
- }
31
- return selection.blocks.value[0];
32
- });
33
- const isEditing = computed(() => state.editMode.value === "editing");
34
27
  const canEdit = computed(() => {
35
- if (!block.value) {
28
+ const item = selection.item.value;
29
+ if (!item) {
36
30
  return false;
37
31
  }
38
32
  const definition = definitions.getBlockDefinition(
39
- block.value.itemBundle,
40
- block.value.hostFieldListType,
41
- block.value.parentBlockBundle
33
+ item.bundle,
34
+ item.fieldListType,
35
+ item.parentBlockBundle
42
36
  );
43
37
  if (definition?.editor?.disableEdit) {
44
38
  return false;
45
39
  }
46
- if (block.value.libraryItemUuid) {
47
- return !!adapter.getLibraryItemEditUrl && (state.editMode.value === "editing" || state.editMode.value === "translating") && !block.value.isNew;
40
+ if (item.library?.libraryItemUuid) {
41
+ return !!adapter.getLibraryItemEditUrl && (state.editMode.value === "editing" || state.editMode.value === "translating") && !item.isNew;
48
42
  }
49
43
  return state.editMode.value === "editing";
50
44
  });
@@ -56,22 +50,22 @@ function onClick(items) {
56
50
  return;
57
51
  }
58
52
  const item = items[0];
59
- if (item.libraryItemUuid && adapter.getLibraryItemEditUrl) {
60
- const url = adapter.getLibraryItemEditUrl(item.libraryItemUuid);
53
+ if (item.library?.libraryItemUuid && adapter.getLibraryItemEditUrl) {
54
+ const url = adapter.getLibraryItemEditUrl(item.library.libraryItemUuid);
61
55
  eventBus.emit("library:edit-item", {
62
56
  url,
63
- label: item.editTitle,
64
- uuid: item.libraryItemUuid
57
+ label: item.library.label,
58
+ uuid: item.library.libraryItemUuid
65
59
  });
66
60
  return;
67
61
  }
68
62
  eventBus.emit("item:edit", {
69
63
  uuid: item.uuid,
70
- bundle: item.itemBundle
64
+ bundle: item.bundle
71
65
  });
72
66
  }
73
- onBlokkliEvent("item:doubleClick", function(block2) {
74
- onClick([block2]);
67
+ onBlokkliEvent("item:doubleClick", function(block) {
68
+ onClick([block]);
75
69
  });
76
70
  </script>
77
71
 
@@ -6,15 +6,15 @@
6
6
  @touchmove.stop.capture.prevent
7
7
  >
8
8
  <iframe ref="iframe" allowtransparency :src="url" @load="onIFrameLoad" />
9
- <Transition name="bk-loading">
9
+ <BlokkliTransition name="loading">
10
10
  <Loading v-if="!isLoaded" />
11
- </Transition>
11
+ </BlokkliTransition>
12
12
  </div>
13
13
  </template>
14
14
 
15
15
  <script setup>
16
16
  import { ref, useBlokkli, onUnmounted, onMounted } from "#imports";
17
- import { Loading } from "#blokkli/components";
17
+ import { Loading, BlokkliTransition } from "#blokkli/components";
18
18
  const { eventBus } = useBlokkli();
19
19
  const iframe = ref(null);
20
20
  const isLoaded = ref(false);
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <Teleport to="body">
3
- <transition name="bk-slide-in" :duration="200">
3
+ <BlokkliTransition name="slide-in">
4
4
  <FormOverlay
5
5
  v-if="form"
6
6
  id="edit-form"
@@ -15,15 +15,16 @@
15
15
  @close="onClose"
16
16
  />
17
17
  </FormOverlay>
18
- </transition>
18
+ </BlokkliTransition>
19
19
  </Teleport>
20
20
  </template>
21
21
 
22
22
  <script setup>
23
23
  import { ref, computed, useBlokkli, defineBlokkliFeature } from "#imports";
24
- import { FormOverlay } from "#blokkli/components";
24
+ import { FormOverlay, BlokkliTransition } from "#blokkli/components";
25
25
  import FormFrame from "./Frame/index.vue";
26
26
  import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
27
+ import { itemEntityType } from "#blokkli-build/config";
27
28
  const { adapter } = defineBlokkliFeature({
28
29
  id: "edit-form",
29
30
  icon: "form",
@@ -31,7 +32,7 @@ const { adapter } = defineBlokkliFeature({
31
32
  description: "Listens to edit events and renders an iframe containing the edit form.",
32
33
  requiredAdapterMethods: ["formFrameBuilder"]
33
34
  });
34
- const { types, state, context, $t, dom, definitions } = useBlokkli();
35
+ const { types, state, context, $t, dom, definitions, blocks } = useBlokkli();
35
36
  const form = ref(null);
36
37
  const formUrl = computed(() => {
37
38
  if (form.value) {
@@ -99,13 +100,13 @@ onBlokkliEvent("item:edit", (e) => {
99
100
  if (!state.canEdit.value) {
100
101
  return;
101
102
  }
102
- const block = dom.findBlock(e.uuid);
103
+ const block = blocks.getBlock(e.uuid);
103
104
  if (!block) {
104
105
  return;
105
106
  }
106
107
  const definition = definitions.getBlockDefinition(
107
108
  e.bundle,
108
- block.hostFieldListType,
109
+ block.fieldListType,
109
110
  block.parentBlockBundle
110
111
  );
111
112
  if (definition?.editor?.disableEdit) {
@@ -156,12 +157,12 @@ onBlokkliEvent("add:block:new", (e) => {
156
157
  if (!state.canEdit.value) {
157
158
  return;
158
159
  }
159
- const field = dom.findField(e.host.uuid, e.host.fieldName);
160
- if (field) {
160
+ const field = dom.getRegisteredField(e.host.uuid, e.host.fieldName);
161
+ if (field?.entity.type === itemEntityType) {
161
162
  const definition = definitions.getBlockDefinition(
162
163
  e.bundle,
163
164
  field.fieldListType,
164
- field.hostEntityBundle
165
+ field.entity.bundle
165
166
  );
166
167
  if (definition?.editor?.disableEdit) {
167
168
  return;
@@ -4,13 +4,24 @@
4
4
  ref="iframe"
5
5
  :style="{ height: Math.max(height, 150) + 'px' }"
6
6
  :src="url"
7
+ @load="onIframeLoad"
7
8
  />
8
9
  </div>
9
10
  </template>
10
11
 
11
12
  <script setup>
12
- import { useBlokkli, ref, computed, onMounted, onBeforeUnmount } from "#imports";
13
- const { adapter } = useBlokkli();
13
+ import {
14
+ useBlokkli,
15
+ ref,
16
+ computed,
17
+ onMounted,
18
+ onBeforeUnmount,
19
+ useTemplateRef
20
+ } from "#imports";
21
+ import { itemEntityType } from "#blokkli-build/config";
22
+ const { adapter, ui, element } = useBlokkli();
23
+ const PROPAGATE_WHEEL = false;
24
+ const rootElement = ui.rootElement();
14
25
  const props = defineProps({
15
26
  modelValue: { type: String, required: true },
16
27
  type: { type: String, required: true },
@@ -18,9 +29,63 @@ const props = defineProps({
18
29
  host: { type: Object, required: true },
19
30
  initialHeight: { type: Number, required: true }
20
31
  });
32
+ const iframe = useTemplateRef("iframe");
33
+ function onIframeLoad() {
34
+ if (!iframe.value || !PROPAGATE_WHEEL) {
35
+ return;
36
+ }
37
+ const iframeDoc = iframe.value.contentDocument;
38
+ if (!iframeDoc) {
39
+ return;
40
+ }
41
+ let ckEditor = null;
42
+ iframe.value.contentDocument.addEventListener("wheel", (e) => {
43
+ if (!ckEditor) {
44
+ const el = element.query(
45
+ iframeDoc.documentElement,
46
+ ".ck-editor__editable",
47
+ "Find CKEditor in editable iframe."
48
+ );
49
+ if (el) {
50
+ ckEditor = el;
51
+ }
52
+ }
53
+ if (!ckEditor) {
54
+ return;
55
+ }
56
+ const scrollTop = ckEditor.scrollTop;
57
+ const scrollHeight = ckEditor.scrollHeight;
58
+ const clientHeight = ckEditor.clientHeight;
59
+ const isScrolledToTop = scrollTop === 0;
60
+ const isScrolledToBottom = scrollTop + clientHeight >= scrollHeight - 1;
61
+ const isScrollingDown = e.deltaY > 0;
62
+ const isScrollingUp = e.deltaY < 0;
63
+ const shouldPropagate = isScrollingUp && isScrolledToTop || isScrollingDown && isScrolledToBottom;
64
+ if (!shouldPropagate) {
65
+ return;
66
+ }
67
+ const wheelEvent = new WheelEvent("wheel", {
68
+ deltaX: e.deltaX,
69
+ deltaY: e.deltaY,
70
+ deltaZ: e.deltaZ,
71
+ deltaMode: e.deltaMode,
72
+ clientX: e.clientX,
73
+ clientY: e.clientY,
74
+ screenX: e.screenX,
75
+ screenY: e.screenY,
76
+ bubbles: true,
77
+ cancelable: true,
78
+ ctrlKey: e.ctrlKey,
79
+ shiftKey: e.shiftKey,
80
+ altKey: e.altKey,
81
+ metaKey: e.metaKey
82
+ });
83
+ rootElement?.dispatchEvent(wheelEvent);
84
+ });
85
+ }
21
86
  const height = ref(props.initialHeight);
22
87
  const url = computed(() => {
23
- if ("itemBundle" in props.host) {
88
+ if (props.host.type === itemEntityType) {
24
89
  return adapter.buildEditableFrameUrl({
25
90
  uuid: props.host.uuid,
26
91
  fieldName: props.fieldName
@@ -43,7 +108,7 @@ const onMessage = (e) => {
43
108
  };
44
109
  onMounted(() => {
45
110
  original.value = props.modelValue;
46
- height.value = props.initialHeight + 48;
111
+ height.value = props.initialHeight;
47
112
  window.addEventListener("message", onMessage);
48
113
  });
49
114
  onBeforeUnmount(() => {
@@ -1,9 +1,9 @@
1
- import type { DraggableExistingBlock, EditableFieldType, EntityContext } from '#blokkli/types';
1
+ import type { EditableFieldType, EntityContext } from '#blokkli/types';
2
2
  type __VLS_Props = {
3
3
  modelValue: string;
4
4
  type: EditableFieldType;
5
5
  fieldName: string;
6
- host: DraggableExistingBlock | EntityContext;
6
+ host: EntityContext;
7
7
  initialHeight: number;
8
8
  };
9
9
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
@@ -1,11 +1,16 @@
1
1
  <template>
2
- <div class="bk bk-editable-field-textarea">
2
+ <div
3
+ class="bk bk-editable-field-textarea"
4
+ :style="{
5
+ height: height + 'px'
6
+ }"
7
+ >
3
8
  <textarea
9
+ id="bk-editable-field-textarea"
4
10
  ref="input"
5
11
  :value="modelValue"
6
12
  enterkeyhint="done"
7
13
  rows="2"
8
- :style="inputStyle"
9
14
  v-bind="inputAttributes"
10
15
  @keydown.stop.capture="onKeyDown"
11
16
  @blur="onBlur"
@@ -13,12 +18,12 @@
13
18
  $emit('update:modelValue', $event.target.value)
14
19
  "
15
20
  />
16
- <div :style="inputStyle" class="bk-textarea" v-html="modelValue" />
17
21
  </div>
18
22
  </template>
19
23
 
20
24
  <script setup>
21
- import { useBlokkli, computed } from "#imports";
25
+ import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
26
+ import { useBlokkli, computed, useTemplateRef, ref } from "#imports";
22
27
  const { ui, selection } = useBlokkli();
23
28
  const props = defineProps({
24
29
  element: { type: null, required: true },
@@ -27,6 +32,8 @@ const props = defineProps({
27
32
  modelValue: { type: String, required: true }
28
33
  });
29
34
  const emit = defineEmits(["close", "save", "update:modelValue"]);
35
+ const input = useTemplateRef("input");
36
+ const height = ref(20);
30
37
  const onKeyDown = (e) => {
31
38
  if (e.code === "Escape") {
32
39
  e.preventDefault();
@@ -61,10 +68,7 @@ const onBlur = (e) => {
61
68
  emit("save");
62
69
  }, 100);
63
70
  };
64
- const inputStyle = computed(() => {
65
- const computedStyle = window.getComputedStyle(props.element);
66
- return {
67
- textAlign: computedStyle.textAlign
68
- };
71
+ onBlokkliEvent("animationFrame", () => {
72
+ height.value = Math.max(input.value?.scrollHeight ?? 20, 20);
69
73
  });
70
74
  </script>