@blokkli/editor 2.0.0-alpha.51 → 2.0.0-alpha.53

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 (377) hide show
  1. package/dist/chunks/tailwindConfig.mjs +3 -3
  2. package/dist/global/types/blockOptions.d.ts +18 -2
  3. package/dist/module.d.mts +2 -2
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +281 -18
  6. package/dist/modules/agent/index.d.mts +1 -1
  7. package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +1 -0
  8. package/dist/modules/agent/runtime/app/composables/agentProvider.js +7 -0
  9. package/dist/modules/agent/runtime/app/features/agent/Panel/DropHandler/index.d.vue.ts +2 -2
  10. package/dist/modules/agent/runtime/app/features/agent/Panel/DropHandler/index.vue +14 -49
  11. package/dist/modules/agent/runtime/app/features/agent/Panel/DropHandler/index.vue.d.ts +2 -2
  12. package/dist/modules/agent/runtime/app/features/agent/Panel/Feedback/index.d.vue.ts +10 -0
  13. package/dist/modules/agent/runtime/app/features/agent/Panel/Feedback/index.vue +102 -0
  14. package/dist/modules/agent/runtime/app/features/agent/Panel/Feedback/index.vue.d.ts +10 -0
  15. package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +8 -5
  16. package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.d.vue.ts +3 -3
  17. package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.vue +9 -5
  18. package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.vue.d.ts +3 -3
  19. package/dist/modules/agent/runtime/app/features/agent/Panel/index.d.vue.ts +7 -0
  20. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +16 -2
  21. package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue.d.ts +7 -0
  22. package/dist/modules/agent/runtime/app/features/agent/index.vue +29 -0
  23. package/dist/modules/agent/runtime/app/features/agent/types.d.ts +16 -0
  24. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +3 -1
  25. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.d.ts +2 -0
  26. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +8 -1
  27. package/dist/modules/charts/index.d.mts +1 -1
  28. package/dist/modules/charts/index.mjs +2 -3
  29. package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue +1 -1
  30. package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +1 -1
  31. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +16 -0
  32. package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +9 -0
  33. package/dist/modules/drupal/graphql/features/agent.graphql +20 -0
  34. package/dist/modules/drupal/graphql/features/publishNew.graphql +14 -0
  35. package/dist/modules/drupal/graphql/features/referenced-entities.graphql +21 -0
  36. package/dist/modules/drupal/graphql/features/textFieldValues.graphql +20 -0
  37. package/dist/modules/drupal/graphql/features/workspace.graphql +23 -0
  38. package/dist/modules/drupal/graphql/mutations/bulk_translate_field_values.graphql +19 -0
  39. package/dist/modules/drupal/graphql/mutations/clear_outdated_translation.graphql +15 -0
  40. package/dist/modules/drupal/graphql/mutations/ignore_analyze.graphql +15 -0
  41. package/dist/modules/drupal/graphql/mutations/request_translation.graphql +10 -0
  42. package/dist/modules/drupal/graphql/mutations/unignore_analyze.graphql +15 -0
  43. package/dist/modules/drupal/index.d.mts +1 -1
  44. package/dist/modules/drupal/index.mjs +16 -0
  45. package/dist/modules/drupal/runtime/adapter/index.js +180 -11
  46. package/dist/modules/iframes/index.d.mts +31 -0
  47. package/dist/modules/iframes/index.mjs +52 -0
  48. package/dist/modules/iframes/runtime/components/BlokkliIframe/index.d.vue.ts +18 -0
  49. package/dist/modules/iframes/runtime/components/BlokkliIframe/index.vue +61 -0
  50. package/dist/modules/iframes/runtime/components/BlokkliIframe/index.vue.d.ts +18 -0
  51. package/dist/modules/iframes/runtime/components/index.d.ts +1 -0
  52. package/dist/modules/iframes/runtime/components/index.js +1 -0
  53. package/dist/modules/iframes/runtime/features/iframes/Editor/index.d.vue.ts +12 -0
  54. package/dist/modules/iframes/runtime/features/iframes/Editor/index.vue +220 -0
  55. package/dist/modules/iframes/runtime/features/iframes/Editor/index.vue.d.ts +12 -0
  56. package/dist/modules/iframes/runtime/types.d.ts +10 -0
  57. package/dist/modules/index.d.mts +1 -1
  58. package/dist/modules/table-of-contents/index.d.mts +1 -1
  59. package/dist/runtime/components/Blocks/NotImplemented/index.vue +57 -0
  60. package/dist/runtime/components/BlokkliEditable.d.vue.ts +2 -1
  61. package/dist/runtime/components/BlokkliEditable.vue +58 -42
  62. package/dist/runtime/components/BlokkliEditable.vue.d.ts +2 -1
  63. package/dist/runtime/components/BlokkliItem.d.vue.ts +1 -1
  64. package/dist/runtime/components/BlokkliItem.vue.d.ts +1 -1
  65. package/dist/runtime/editor/adapter/index.d.ts +8 -1
  66. package/dist/runtime/editor/components/Actions/Interactions/index.vue +77 -17
  67. package/dist/runtime/editor/components/Actions/{ItemDropdown.vue → ItemDropdown/index.vue} +9 -10
  68. package/dist/runtime/editor/components/Actions/index.vue +586 -23
  69. package/dist/runtime/editor/components/AnimationCanvas/index.vue +1 -0
  70. package/dist/runtime/editor/components/AppMenu/MenuButton.vue +185 -1
  71. package/dist/runtime/editor/components/AppMenu/index.vue +24 -10
  72. package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +6 -2
  73. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +223 -3
  74. package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +6 -2
  75. package/dist/runtime/editor/components/AutoHeight/index.vue +23 -0
  76. package/dist/runtime/editor/components/Banner/Inner.d.vue.ts +30 -0
  77. package/dist/runtime/editor/components/Banner/Inner.vue +32 -0
  78. package/dist/runtime/editor/components/Banner/Inner.vue.d.ts +30 -0
  79. package/dist/runtime/editor/components/Banner/index.d.vue.ts +3 -13
  80. package/dist/runtime/editor/components/Banner/index.vue +2 -14
  81. package/dist/runtime/editor/components/Banner/index.vue.d.ts +3 -13
  82. package/dist/runtime/editor/components/BetaIndicator/index.d.vue.ts +6 -0
  83. package/dist/runtime/editor/components/BetaIndicator/index.vue +16 -0
  84. package/dist/runtime/editor/components/BetaIndicator/index.vue.d.ts +6 -0
  85. package/dist/runtime/editor/components/BlockPreviewItem/index.vue +51 -1
  86. package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue +27 -1
  87. package/dist/runtime/editor/components/BlockProxy/index.vue +148 -1
  88. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +59 -0
  89. package/dist/runtime/editor/components/BundleSelector/index.vue +170 -20
  90. package/dist/runtime/editor/components/Dialog/index.d.vue.ts +2 -0
  91. package/dist/runtime/editor/components/Dialog/index.vue +341 -0
  92. package/dist/runtime/editor/components/Dialog/index.vue.d.ts +2 -0
  93. package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue +117 -0
  94. package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +224 -28
  95. package/dist/runtime/editor/components/DiffViewer/DiffValue.d.vue.ts +1 -0
  96. package/dist/runtime/editor/components/DiffViewer/DiffValue.vue +5 -1
  97. package/dist/runtime/editor/components/DiffViewer/DiffValue.vue.d.ts +1 -0
  98. package/dist/runtime/editor/components/DiffViewer/State.vue +319 -0
  99. package/dist/runtime/editor/components/DraggableList.vue +103 -0
  100. package/dist/runtime/editor/components/Dropdown/index.vue +84 -0
  101. package/dist/runtime/editor/components/EditProvider.vue +72 -15
  102. package/dist/runtime/editor/components/FileDropHandler/index.d.vue.ts +23 -0
  103. package/dist/runtime/editor/components/FileDropHandler/index.vue +108 -0
  104. package/dist/runtime/editor/components/FileDropHandler/index.vue.d.ts +23 -0
  105. package/dist/runtime/editor/components/FlexTextarea/index.vue +4 -2
  106. package/dist/runtime/editor/components/Form/Datepicker/index.vue +149 -0
  107. package/dist/runtime/editor/components/Form/Toggle/index.vue +205 -1
  108. package/dist/runtime/editor/components/FormOverlay/index.vue +90 -0
  109. package/dist/runtime/editor/components/Icon/index.vue +6 -0
  110. package/dist/runtime/editor/components/Indicators/index.vue +161 -0
  111. package/dist/runtime/editor/components/InfoBox/index.vue +65 -0
  112. package/dist/runtime/editor/components/Konami/index.vue +119 -0
  113. package/dist/runtime/editor/components/Loading/index.d.vue.ts +6 -3
  114. package/dist/runtime/editor/components/Loading/index.vue +10 -5
  115. package/dist/runtime/editor/components/Loading/index.vue.d.ts +6 -3
  116. package/dist/runtime/editor/components/Messages/index.vue +131 -0
  117. package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +1 -0
  118. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +246 -12
  119. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +1 -0
  120. package/dist/runtime/editor/components/NotEditStateInfo/index.d.vue.ts +3 -0
  121. package/dist/runtime/editor/components/NotEditStateInfo/index.vue +19 -0
  122. package/dist/runtime/editor/components/NotEditStateInfo/index.vue.d.ts +3 -0
  123. package/dist/runtime/editor/components/Overlay/index.vue +84 -0
  124. package/dist/runtime/editor/components/Pagination/index.vue +41 -0
  125. package/dist/runtime/editor/components/PluginConfigForm/index.vue +23 -0
  126. package/dist/runtime/editor/components/PluginConfigFormInline/FilterSelect/index.vue +429 -0
  127. package/dist/runtime/editor/components/PluginConfigFormInline/index.d.vue.ts +22 -0
  128. package/dist/runtime/editor/components/PluginConfigFormInline/index.vue +150 -0
  129. package/dist/runtime/editor/components/PluginConfigFormInline/index.vue.d.ts +22 -0
  130. package/dist/runtime/editor/components/Popup/index.vue +77 -2
  131. package/dist/runtime/editor/components/PreviewProvider.vue +7 -0
  132. package/dist/runtime/editor/components/Resizable/index.vue +90 -1
  133. package/dist/runtime/editor/components/ScaleToFit/index.vue +30 -1
  134. package/dist/runtime/editor/components/SearchOverlay/index.d.vue.ts +43 -0
  135. package/dist/runtime/editor/components/SearchOverlay/index.vue +264 -0
  136. package/dist/runtime/editor/components/SearchOverlay/index.vue.d.ts +43 -0
  137. package/dist/runtime/editor/components/StatusIcon/index.vue +104 -0
  138. package/dist/runtime/editor/components/StatusIndicator/index.d.vue.ts +9 -0
  139. package/dist/runtime/editor/components/StatusIndicator/index.vue +16 -0
  140. package/dist/runtime/editor/components/StatusIndicator/index.vue.d.ts +9 -0
  141. package/dist/runtime/editor/components/SystemRequirements/index.vue +57 -0
  142. package/dist/runtime/editor/components/Tabs/index.d.vue.ts +30 -0
  143. package/dist/runtime/editor/components/Tabs/index.vue +32 -0
  144. package/dist/runtime/editor/components/Tabs/index.vue.d.ts +30 -0
  145. package/dist/runtime/editor/components/Toolbar/index.vue +214 -3
  146. package/dist/runtime/editor/components/Tooltip/Context.d.vue.ts +7 -0
  147. package/dist/runtime/editor/components/Tooltip/Context.vue +13 -0
  148. package/dist/runtime/editor/components/Tooltip/Context.vue.d.ts +7 -0
  149. package/dist/runtime/editor/components/Tooltip/Status.d.vue.ts +8 -0
  150. package/dist/runtime/editor/components/Tooltip/Status.vue +27 -0
  151. package/dist/runtime/editor/components/Tooltip/Status.vue.d.ts +8 -0
  152. package/dist/runtime/editor/components/Tooltip/index.d.vue.ts +27 -0
  153. package/dist/runtime/editor/components/Tooltip/index.vue +40 -0
  154. package/dist/runtime/editor/components/Tooltip/index.vue.d.ts +27 -0
  155. package/dist/runtime/editor/components/index.d.ts +59 -49
  156. package/dist/runtime/editor/components/index.js +59 -98
  157. package/dist/runtime/editor/composables/defineHighlight.d.ts +2 -0
  158. package/dist/runtime/editor/composables/defineHighlight.js +10 -0
  159. package/dist/runtime/editor/composables/index.d.ts +1 -0
  160. package/dist/runtime/editor/composables/index.js +1 -0
  161. package/dist/runtime/editor/composables/useBlockRegistration.js +8 -0
  162. package/dist/runtime/editor/composables/useStickyToolbar.d.ts +1 -0
  163. package/dist/runtime/editor/composables/useStickyToolbar.js +16 -0
  164. package/dist/runtime/editor/css/output.css +1 -1
  165. package/dist/runtime/editor/events/index.d.ts +10 -0
  166. package/dist/runtime/editor/features/add-list/Help/index.vue +193 -0
  167. package/dist/runtime/editor/features/add-list/index.vue +441 -0
  168. package/dist/runtime/editor/features/analyze/Ignored/index.d.vue.ts +7 -0
  169. package/dist/runtime/editor/features/analyze/Ignored/index.vue +35 -0
  170. package/dist/runtime/editor/features/analyze/Ignored/index.vue.d.ts +7 -0
  171. package/dist/runtime/editor/features/analyze/Main.vue +148 -24
  172. package/dist/runtime/editor/features/analyze/Results/Results.d.vue.ts +1 -9
  173. package/dist/runtime/editor/features/analyze/Results/Results.vue +0 -2
  174. package/dist/runtime/editor/features/analyze/Results/Results.vue.d.ts +1 -9
  175. package/dist/runtime/editor/features/analyze/Results/ResultsItem.d.vue.ts +1 -9
  176. package/dist/runtime/editor/features/analyze/Results/ResultsItem.vue +1 -2
  177. package/dist/runtime/editor/features/analyze/Results/ResultsItem.vue.d.ts +1 -9
  178. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodes.d.vue.ts +1 -9
  179. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodes.vue +11 -8
  180. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodes.vue.d.ts +1 -9
  181. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.d.vue.ts +3 -10
  182. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +63 -25
  183. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue.d.ts +3 -10
  184. package/dist/runtime/editor/features/analyze/analyzers/altText.js +2 -0
  185. package/dist/runtime/editor/features/analyze/analyzers/headingStructure.js +3 -0
  186. package/dist/runtime/editor/features/analyze/analyzers/helpers/hashString.d.ts +7 -0
  187. package/dist/runtime/editor/features/analyze/analyzers/helpers/hashString.js +8 -0
  188. package/dist/runtime/editor/features/analyze/analyzers/readability.js +6 -12
  189. package/dist/runtime/editor/features/analyze/analyzers/types.d.ts +20 -0
  190. package/dist/runtime/editor/features/analyze/index.vue +458 -0
  191. package/dist/runtime/editor/features/analyze/types.d.ts +12 -0
  192. package/dist/runtime/editor/features/artboard/Overview/index.vue +37 -4
  193. package/dist/runtime/editor/features/artboard/Renderer.vue +79 -9
  194. package/dist/runtime/editor/features/artboard/Scrollbar/index.vue +84 -0
  195. package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +1 -1
  196. package/dist/runtime/editor/features/block-scheduler/index.vue +114 -0
  197. package/dist/runtime/editor/features/breadcrumbs/index.vue +150 -0
  198. package/dist/runtime/editor/features/changelog/Dialog/index.vue +62 -7
  199. package/dist/runtime/editor/features/changelog/changelog.json +9 -1
  200. package/dist/runtime/editor/features/clipboard/index.vue +153 -1
  201. package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +39 -16
  202. package/dist/runtime/editor/features/command-palette/Palette/index.vue +24 -130
  203. package/dist/runtime/editor/features/comments/index.vue +235 -0
  204. package/dist/runtime/editor/features/complex-options/index.vue +4 -1
  205. package/dist/runtime/editor/features/debug/Main.vue +1 -1
  206. package/dist/runtime/editor/features/debug/Section/Features.vue +2 -4
  207. package/dist/runtime/editor/features/debug/index.vue +168 -0
  208. package/dist/runtime/editor/features/dev-mode/index.vue +92 -27
  209. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +1 -1
  210. package/dist/runtime/editor/features/dragging-overlay/index.vue +330 -0
  211. package/dist/runtime/editor/features/edit/index.vue +15 -17
  212. package/dist/runtime/editor/features/edit-form/Frame/index.vue +21 -4
  213. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.d.vue.ts +9 -1
  214. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +32 -3
  215. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue.d.ts +9 -1
  216. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +77 -0
  217. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +55 -56
  218. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +416 -8
  219. package/dist/runtime/editor/features/editable-mask/index.vue +9 -0
  220. package/dist/runtime/editor/features/entity-title/index.vue +40 -56
  221. package/dist/runtime/editor/features/fragments/Dialog/index.vue +90 -0
  222. package/dist/runtime/editor/features/help/Shortcuts/index.vue +71 -0
  223. package/dist/runtime/editor/features/help/index.vue +17 -0
  224. package/dist/runtime/editor/features/highlights/Renderer/fragment.glsl +89 -0
  225. package/dist/runtime/editor/features/highlights/Renderer/index.vue +408 -0
  226. package/dist/runtime/editor/features/highlights/Renderer/vertex.glsl +87 -0
  227. package/dist/runtime/editor/features/highlights/index.d.vue.ts +3 -0
  228. package/dist/runtime/editor/features/highlights/index.vue +20 -0
  229. package/dist/runtime/editor/features/highlights/index.vue.d.ts +3 -0
  230. package/dist/runtime/editor/features/history/List/index.vue +209 -0
  231. package/dist/runtime/editor/features/history/index.vue +0 -1
  232. package/dist/runtime/editor/features/hover/Renderer/index.vue +1 -1
  233. package/dist/runtime/editor/features/hover/Renderer/vertex.glsl +1 -1
  234. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +18 -0
  235. package/dist/runtime/editor/features/media-library/Library/index.vue +10 -30
  236. package/dist/runtime/editor/features/media-library/index.vue +331 -0
  237. package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +1 -1
  238. package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +1 -1
  239. package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +6 -2
  240. package/dist/runtime/editor/features/options/Form/Item.vue +21 -18
  241. package/dist/runtime/editor/features/options/Form/Radios/index.d.vue.ts +6 -0
  242. package/dist/runtime/editor/features/options/Form/Radios/index.vue +25 -6
  243. package/dist/runtime/editor/features/options/Form/Radios/index.vue.d.ts +6 -0
  244. package/dist/runtime/editor/features/options/Form/index.vue +1 -4
  245. package/dist/runtime/editor/features/options/index.vue +729 -0
  246. package/dist/runtime/editor/features/ownership/Banner/index.vue +9 -8
  247. package/dist/runtime/editor/features/ownership/index.vue +1 -1
  248. package/dist/runtime/editor/features/preview-grant/QrCode/index.vue +8 -3
  249. package/dist/runtime/editor/features/publish/Dialog/Item.vue +18 -20
  250. package/dist/runtime/editor/features/publish/Dialog/index.vue +5 -1
  251. package/dist/runtime/editor/features/publish/index.vue +835 -0
  252. package/dist/runtime/editor/features/publish/types.d.ts +5 -1
  253. package/dist/runtime/editor/features/referenced-entities/List/Item/index.d.vue.ts +4 -0
  254. package/dist/runtime/editor/features/referenced-entities/List/Item/index.vue +81 -0
  255. package/dist/runtime/editor/features/referenced-entities/List/Item/index.vue.d.ts +4 -0
  256. package/dist/runtime/editor/features/referenced-entities/List/index.d.vue.ts +11 -0
  257. package/dist/runtime/editor/features/referenced-entities/List/index.vue +78 -0
  258. package/dist/runtime/editor/features/referenced-entities/List/index.vue.d.ts +11 -0
  259. package/dist/runtime/editor/features/referenced-entities/index.d.vue.ts +3 -0
  260. package/dist/runtime/editor/features/referenced-entities/index.vue +36 -0
  261. package/dist/runtime/editor/features/referenced-entities/index.vue.d.ts +3 -0
  262. package/dist/runtime/editor/features/referenced-entities/types.d.ts +13 -0
  263. package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +188 -0
  264. package/dist/runtime/editor/features/search/Overlay/Results/Page/index.vue +1 -1
  265. package/dist/runtime/editor/features/search/index.vue +511 -0
  266. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +58 -0
  267. package/dist/runtime/editor/features/selection/index.vue +47 -15
  268. package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +23 -0
  269. package/dist/runtime/editor/features/settings/Dialog/index.vue +5 -2
  270. package/dist/runtime/editor/features/settings/index.vue +152 -0
  271. package/dist/runtime/editor/features/structure/List/Item/index.vue +7 -0
  272. package/dist/runtime/editor/features/structure/index.vue +178 -0
  273. package/dist/runtime/editor/features/templates/ManageDialog/Item.vue +3 -3
  274. package/dist/runtime/editor/features/templates/ManageDialog/index.vue +24 -3
  275. package/dist/runtime/editor/features/theme/index.vue +94 -0
  276. package/dist/runtime/editor/features/touch-action-bar/Bar/index.vue +34 -0
  277. package/dist/runtime/editor/features/tour/Overlay/index.vue +243 -13
  278. package/dist/runtime/editor/features/transform/Dialog/index.vue +132 -1
  279. package/dist/runtime/editor/features/translations/Banner/index.d.vue.ts +14 -1
  280. package/dist/runtime/editor/features/translations/Banner/index.vue +139 -12
  281. package/dist/runtime/editor/features/translations/Banner/index.vue.d.ts +14 -1
  282. package/dist/runtime/editor/features/translations/CsvDialog/Export/index.d.vue.ts +3 -0
  283. package/dist/runtime/editor/features/translations/CsvDialog/Export/index.vue +272 -0
  284. package/dist/runtime/editor/features/translations/CsvDialog/Export/index.vue.d.ts +3 -0
  285. package/dist/runtime/editor/features/translations/CsvDialog/Import/index.d.vue.ts +10 -0
  286. package/dist/runtime/editor/features/translations/CsvDialog/Import/index.vue +382 -0
  287. package/dist/runtime/editor/features/translations/CsvDialog/Import/index.vue.d.ts +10 -0
  288. package/dist/runtime/editor/features/translations/CsvDialog/csv.d.ts +22 -0
  289. package/dist/runtime/editor/features/translations/CsvDialog/csv.js +50 -0
  290. package/dist/runtime/editor/features/translations/CsvDialog/index.d.vue.ts +10 -0
  291. package/dist/runtime/editor/features/translations/CsvDialog/index.vue +37 -0
  292. package/dist/runtime/editor/features/translations/CsvDialog/index.vue.d.ts +10 -0
  293. package/dist/runtime/editor/features/translations/CsvDialog/po.d.ts +7 -0
  294. package/dist/runtime/editor/features/translations/CsvDialog/po.js +36 -0
  295. package/dist/runtime/editor/features/translations/SelectionTable/index.d.vue.ts +37 -0
  296. package/dist/runtime/editor/features/translations/SelectionTable/index.vue +102 -0
  297. package/dist/runtime/editor/features/translations/SelectionTable/index.vue.d.ts +37 -0
  298. package/dist/runtime/editor/features/translations/TranslateDialog/index.d.vue.ts +7 -0
  299. package/dist/runtime/editor/features/translations/TranslateDialog/index.vue +294 -0
  300. package/dist/runtime/editor/features/translations/TranslateDialog/index.vue.d.ts +7 -0
  301. package/dist/runtime/editor/features/translations/index.vue +276 -6
  302. package/dist/runtime/editor/features/translations/types.d.ts +47 -0
  303. package/dist/runtime/editor/features/validations/Overlay/index.vue +130 -0
  304. package/dist/runtime/editor/features/validations/index.vue +41 -0
  305. package/dist/runtime/editor/features/{assistant → workspace}/Overlay/index.d.vue.ts +2 -4
  306. package/dist/runtime/editor/features/workspace/Overlay/index.vue +177 -0
  307. package/dist/runtime/editor/features/{assistant → workspace}/Overlay/index.vue.d.ts +2 -4
  308. package/dist/runtime/editor/features/workspace/index.d.vue.ts +3 -0
  309. package/dist/runtime/editor/features/workspace/index.vue +46 -0
  310. package/dist/runtime/editor/features/workspace/index.vue.d.ts +3 -0
  311. package/dist/runtime/editor/features/workspace/types.d.ts +59 -0
  312. package/dist/runtime/editor/features/workspace/types.js +0 -0
  313. package/dist/runtime/editor/icons/svg/spinner.svg +2 -2
  314. package/dist/runtime/editor/plugins/ContextMenu/Menu/index.vue +21 -7
  315. package/dist/runtime/editor/plugins/ContextMenu/index.vue +4 -0
  316. package/dist/runtime/editor/plugins/ItemAction/index.d.vue.ts +9 -2
  317. package/dist/runtime/editor/plugins/ItemAction/index.vue +26 -16
  318. package/dist/runtime/editor/plugins/ItemAction/index.vue.d.ts +9 -2
  319. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +24 -26
  320. package/dist/runtime/editor/plugins/Sidebar/index.vue +612 -27
  321. package/dist/runtime/editor/plugins/ToolbarButton/index.d.vue.ts +13 -84
  322. package/dist/runtime/editor/plugins/ToolbarButton/index.vue +36 -22
  323. package/dist/runtime/editor/plugins/ToolbarButton/index.vue.d.ts +13 -84
  324. package/dist/runtime/editor/plugins/ViewOption/index.vue +13 -14
  325. package/dist/runtime/editor/providers/blocks.js +1 -0
  326. package/dist/runtime/editor/providers/cache.d.ts +23 -0
  327. package/dist/runtime/editor/providers/cache.js +29 -0
  328. package/dist/runtime/editor/providers/directive.d.ts +25 -0
  329. package/dist/runtime/editor/providers/directive.js +20 -0
  330. package/dist/runtime/editor/providers/fieldValue.d.ts +5 -5
  331. package/dist/runtime/editor/providers/fieldValue.js +8 -7
  332. package/dist/runtime/editor/providers/plugin.d.ts +14 -0
  333. package/dist/runtime/editor/providers/plugin.js +9 -0
  334. package/dist/runtime/editor/providers/readability.js +1 -1
  335. package/dist/runtime/editor/providers/selection.js +1 -1
  336. package/dist/runtime/editor/providers/state.d.ts +1 -0
  337. package/dist/runtime/editor/providers/state.js +1 -0
  338. package/dist/runtime/editor/providers/texts.js +11 -1
  339. package/dist/runtime/editor/providers/ui.d.ts +11 -0
  340. package/dist/runtime/editor/providers/ui.js +5 -1
  341. package/dist/runtime/editor/translations/de.json +316 -56
  342. package/dist/runtime/editor/translations/fr.json +310 -50
  343. package/dist/runtime/editor/translations/gsw_CH.json +311 -51
  344. package/dist/runtime/editor/translations/it.json +310 -50
  345. package/dist/runtime/editor/types/app.d.ts +2 -0
  346. package/dist/runtime/editor/types/definitions.d.ts +8 -0
  347. package/dist/runtime/editor/types/field.d.ts +1 -0
  348. package/dist/runtime/editor/types/state.d.ts +10 -0
  349. package/dist/runtime/editor/types/ui.d.ts +3 -1
  350. package/dist/runtime/helpers/tw.d.ts +15 -0
  351. package/dist/runtime/helpers/tw.js +3 -0
  352. package/dist/runtime/types/field.d.ts +1 -0
  353. package/dist/shared/{editor.DsGJIlGn.d.mts → editor.BTOBvmaz.d.mts} +20 -3
  354. package/dist/types.d.mts +1 -1
  355. package/package.json +16 -3
  356. package/dist/runtime/editor/features/analyze/Renderer/fragment.glsl +0 -74
  357. package/dist/runtime/editor/features/analyze/Renderer/index.d.vue.ts +0 -24
  358. package/dist/runtime/editor/features/analyze/Renderer/index.vue +0 -330
  359. package/dist/runtime/editor/features/analyze/Renderer/index.vue.d.ts +0 -24
  360. package/dist/runtime/editor/features/analyze/Renderer/vertex.glsl +0 -94
  361. package/dist/runtime/editor/features/assistant/Overlay/ResultMarkup/index.d.vue.ts +0 -7
  362. package/dist/runtime/editor/features/assistant/Overlay/ResultMarkup/index.vue +0 -17
  363. package/dist/runtime/editor/features/assistant/Overlay/ResultMarkup/index.vue.d.ts +0 -7
  364. package/dist/runtime/editor/features/assistant/Overlay/index.vue +0 -108
  365. package/dist/runtime/editor/features/assistant/docs.md +0 -7
  366. package/dist/runtime/editor/features/assistant/index.vue +0 -66
  367. package/dist/runtime/editor/features/assistant/types.d.ts +0 -37
  368. package/dist/runtime/editor/features/media-library/Library/FilterSelect/index.vue +0 -168
  369. package/dist/runtime/editor/providers/fieldValueAdapterTypes.d.ts +0 -13
  370. /package/dist/{runtime/editor/features/assistant → modules/iframes/runtime}/types.js +0 -0
  371. /package/dist/runtime/editor/components/Actions/{ItemDropdown.d.vue.ts → ItemDropdown/index.d.vue.ts} +0 -0
  372. /package/dist/runtime/editor/components/Actions/{ItemDropdown.vue.d.ts → ItemDropdown/index.vue.d.ts} +0 -0
  373. /package/dist/runtime/editor/{features/media-library/Library → components/PluginConfigFormInline}/FilterSelect/index.d.vue.ts +0 -0
  374. /package/dist/runtime/editor/{features/media-library/Library → components/PluginConfigFormInline}/FilterSelect/index.vue.d.ts +0 -0
  375. /package/dist/runtime/editor/features/{assistant → highlights/Renderer}/index.d.vue.ts +0 -0
  376. /package/dist/runtime/editor/features/{assistant → highlights/Renderer}/index.vue.d.ts +0 -0
  377. /package/dist/runtime/editor/{providers/fieldValueAdapterTypes.js → features/referenced-entities/types.js} +0 -0
@@ -120,3 +120,93 @@ const visible = computed(() => {
120
120
  return elements.value.filter((v) => v.text.includes(searchText.value.toLowerCase())).map((v) => v.name);
121
121
  });
122
122
  </script>
123
+
124
+ <style>
125
+ .bk-vars .bk-library-dialog-list {
126
+ display: grid;
127
+ gap: 20px
128
+ }
129
+ @container (min-width: 700px) {
130
+ .bk-vars .bk-library-dialog-list {
131
+ grid-template-columns: repeat(2, minmax(0, 1fr))
132
+ }
133
+ }
134
+ .bk-vars .bk-library-dialog-list > li {
135
+ cursor: pointer;
136
+ overflow: hidden;
137
+ border-radius: 4px;
138
+ border-width: 1px
139
+ }
140
+ .bk-vars .bk-library-dialog-list > li .bk-blokkli-item-label {
141
+ pointer-events: none;
142
+ font-weight: 600
143
+ }
144
+ @media not all and (hover: none) {
145
+ .bk-vars .bk-library-dialog-list > li:not(.bk-is-selected):hover {
146
+ --bk-tw-border-opacity: 1;
147
+ border-color: rgb(var(--bk-theme-mono-400) / var(--bk-tw-border-opacity, 1))
148
+ }
149
+ .bk-vars .bk-library-dialog-list > li:not(.bk-is-selected):hover .bk-block-preview-item-header {
150
+ --bk-tw-bg-opacity: 1;
151
+ background-color: rgb(var(--bk-theme-mono-200) / var(--bk-tw-bg-opacity, 1))
152
+ }
153
+ }
154
+ .bk-vars .bk-library-dialog-list > li.bk-is-selected {
155
+ --bk-tw-border-opacity: 1;
156
+ border-color: rgb(var(--bk-theme-accent-700) / var(--bk-tw-border-opacity, 1))
157
+ }
158
+ .bk-vars .bk-library-dialog-list > li.bk-is-selected .bk-block-preview-item-header {
159
+ --bk-tw-bg-opacity: 1;
160
+ background-color: rgb(var(--bk-theme-accent-700) / var(--bk-tw-bg-opacity, 1));
161
+ --bk-tw-text-opacity: 1;
162
+ color: rgb(255 255 255 / var(--bk-tw-text-opacity, 1))
163
+ }
164
+ .bk-vars .bk-library-dialog-list > li.bk-is-selected .bk-blokkli-item-label-icon {
165
+ --bk-tw-border-opacity: 1;
166
+ border-color: rgb(var(--bk-theme-accent-500) / var(--bk-tw-border-opacity, 1));
167
+ --bk-tw-bg-opacity: 1;
168
+ background-color: rgb(var(--bk-theme-accent-900) / var(--bk-tw-bg-opacity, 1));
169
+ --bk-tw-text-opacity: 1;
170
+ color: rgb(var(--bk-theme-accent-100) / var(--bk-tw-text-opacity, 1))
171
+ }
172
+ .bk-vars .bk-library-dialog-list > li.bk-is-selected .bk-blokkli-item-label {
173
+ --bk-tw-text-opacity: 1;
174
+ color: rgb(255 255 255 / var(--bk-tw-text-opacity, 1))
175
+ }
176
+ .bk-vars .bk-library-dialog-content {
177
+ position: relative
178
+ }
179
+ .bk-vars .bk-reusable-dialog-form .bk-info-box {
180
+ margin-top: 20px;
181
+ margin-bottom: 20px
182
+ }
183
+ .bk-vars .bk-library-dialog .bk-form-group,
184
+ .bk-vars .bk-library-dialog .bk-lead {
185
+ margin-top: 20px;
186
+ padding-left: 20px;
187
+ padding-right: 20px
188
+ }
189
+ .bk-vars .bk-library-dialog .bk-info-box {
190
+ margin-left: 20px;
191
+ margin-right: 20px;
192
+ margin-top: 15px;
193
+ margin-bottom: 15px
194
+ }
195
+ .bk-vars .bk-library-dialog .bk-library-dialog-content {
196
+ margin-top: 20px;
197
+ margin-bottom: 20px;
198
+ border-top-width: 1px;
199
+ --bk-tw-border-opacity: 1;
200
+ border-top-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
201
+ padding-left: 20px;
202
+ padding-right: 20px;
203
+ padding-top: 20px
204
+ }
205
+ .bk-vars .bk-library-pagination {
206
+ position: sticky;
207
+ bottom: 0px;
208
+ z-index: 50;
209
+ --bk-tw-bg-opacity: 1;
210
+ background-color: rgb(255 255 255 / var(--bk-tw-bg-opacity, 1))
211
+ }
212
+ </style>
@@ -58,3 +58,74 @@ const groups = computed(() => {
58
58
  });
59
59
  });
60
60
  </script>
61
+
62
+ <style>
63
+ .bk .bk-help-shortcuts table {
64
+ width: 100%;
65
+ font-size: 14px;
66
+ line-height: 20px;
67
+ }
68
+
69
+ @container (min-width: 500px) {
70
+ .bk .bk-help-shortcuts table {
71
+ font-size: 18px;
72
+ line-height: 28px;
73
+ }
74
+ }
75
+
76
+ .bk .bk-help-shortcuts table .bk-shortcut > kbd {
77
+ border-width: 1px !important;
78
+ --bk-tw-border-opacity: 1 !important;
79
+ border-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1)) !important;
80
+ --bk-tw-bg-opacity: 1 !important;
81
+ background-color: rgb(var(--bk-theme-mono-100) / var(--bk-tw-bg-opacity, 1)) !important;
82
+ --bk-tw-text-opacity: 1 !important;
83
+ color: rgb(var(--bk-theme-mono-800) / var(--bk-tw-text-opacity, 1)) !important;
84
+ }
85
+
86
+ @container (min-width: 500px) {
87
+
88
+ .bk .bk-help-shortcuts table .bk-shortcut {
89
+ font-size: 16px;
90
+ line-height: 24px;
91
+ }
92
+ .bk .bk-help-shortcuts table .bk-shortcut > kbd {
93
+ font-size: 16px;
94
+ line-height: 24px;
95
+ }
96
+ }
97
+
98
+ .bk .bk-help-shortcuts table tr {
99
+ border-bottom-width: 1px;
100
+ --bk-tw-border-opacity: 1;
101
+ border-bottom-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
102
+ }
103
+
104
+ .bk .bk-help-shortcuts table tr.bk-is-heading {
105
+ border-bottom-width: 2px;
106
+ --bk-tw-border-opacity: 1;
107
+ border-bottom-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
108
+ }
109
+
110
+ .bk .bk-help-shortcuts table th {
111
+ padding-top: 30px;
112
+ padding-bottom: 10px;
113
+ text-align: left;
114
+ font-size: 12px;
115
+ line-height: 16px;
116
+ font-weight: 600;
117
+ text-transform: uppercase;
118
+ --bk-tw-text-opacity: 1;
119
+ color: rgb(var(--bk-theme-mono-900) / var(--bk-tw-text-opacity, 1));
120
+ }
121
+
122
+ .bk .bk-help-shortcuts table td {
123
+ padding-top: 10px;
124
+ padding-bottom: 10px;
125
+ }
126
+
127
+ .bk .bk-help-shortcuts table td:first-child {
128
+ width: 0;
129
+ padding-right: 10px;
130
+ }
131
+ </style>
@@ -47,3 +47,20 @@ export default {
47
47
  name: "Help"
48
48
  };
49
49
  </script>
50
+
51
+ <style>
52
+ .bk.bk-help {
53
+ padding: 20px;
54
+ container-type: inline-size
55
+ }
56
+
57
+ .bk.bk-help .bk-help-section:not(:last-child) {
58
+ margin-bottom: 20px
59
+ }
60
+
61
+ .bk.bk-help .bk-help-section > h3 {
62
+ font-size: 18px;
63
+ line-height: 28px;
64
+ font-weight: 700
65
+ }
66
+ </style>
@@ -0,0 +1,89 @@
1
+ #version 300 es
2
+
3
+ precision highp float;
4
+
5
+ in vec4 v_quad;
6
+ in vec3 v_color1;
7
+ in vec3 v_color2;
8
+ in vec2 v_rect_size;
9
+ in vec2 v_rect_center;
10
+ in float v_border_factor;
11
+ in vec2 v_rect_size_artboard;
12
+ in float v_active;
13
+
14
+ out vec4 fragColor;
15
+
16
+ uniform float u_dpi;
17
+ uniform float u_scale;
18
+ uniform float u_opacity;
19
+
20
+ int pseudoQuadrant(vec2 p) {
21
+ return int(floor(step(0.0, p.x) + 2.0 * step(0.0, -p.y)));
22
+ }
23
+
24
+ float sdRoundBox(vec2 p, vec2 b, vec4 radii) {
25
+ int idx = pseudoQuadrant(p);
26
+ float cr;
27
+ if (idx == 0) cr = radii[0];
28
+ else if (idx == 1) cr = radii[1];
29
+ else if (idx == 2) cr = radii[3];
30
+ else cr = radii[2];
31
+ vec2 q = abs(p) - b + cr;
32
+ return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - cr;
33
+ }
34
+
35
+ void main() {
36
+ float borderThickness = (1.5 + v_active * 1.5) * u_dpi * v_border_factor;
37
+ vec2 size = v_rect_size;
38
+ vec4 radius = vec4(4.0 * u_dpi * v_border_factor);
39
+ float borderSoftness = 1.0;
40
+
41
+ vec2 posRelativeToQuad = gl_FragCoord.xy - v_rect_center;
42
+
43
+ // Signed distance to the outer edge of the border.
44
+ float mainDist = sdRoundBox(posRelativeToQuad, size / 2.0, radius);
45
+
46
+ // Border alpha (band around the edge).
47
+ float borderAlpha =
48
+ 1.0 -
49
+ smoothstep(-borderSoftness, 0.0, abs(mainDist) - borderThickness);
50
+
51
+ // Determine border color: striped if two different colors, solid otherwise.
52
+ // Calculate perimeter distance in artboard space for scale-independent stripes.
53
+ vec2 viewportToArtboardRatio = v_rect_size_artboard / v_rect_size;
54
+ vec2 posRelativeToQuad_artboard = posRelativeToQuad * viewportToArtboardRatio;
55
+ vec2 halfSize_artboard = v_rect_size_artboard / 2.0;
56
+ vec2 posFromTopLeft = posRelativeToQuad_artboard + halfSize_artboard;
57
+ vec2 p = clamp(posFromTopLeft, vec2(0.0), v_rect_size_artboard);
58
+
59
+ float perimeterDistance = 0.0;
60
+ float width = v_rect_size_artboard.x;
61
+ float height = v_rect_size_artboard.y;
62
+
63
+ vec2 absP = abs(posRelativeToQuad_artboard);
64
+ float dx = absP.x - halfSize_artboard.x;
65
+ float dy = absP.y - halfSize_artboard.y;
66
+
67
+ if (dy > dx) {
68
+ if (posRelativeToQuad_artboard.y > 0.0) {
69
+ perimeterDistance = p.x;
70
+ } else {
71
+ perimeterDistance = height + p.x;
72
+ }
73
+ } else {
74
+ if (posRelativeToQuad_artboard.x < 0.0) {
75
+ perimeterDistance = height - p.y;
76
+ } else {
77
+ perimeterDistance = width + (height - p.y);
78
+ }
79
+ }
80
+
81
+ // Stripe pattern: alternate between color1 and color2 along perimeter.
82
+ float stripeLength = 14.0 - u_scale;
83
+ float stripePhase = mod(perimeterDistance, stripeLength * 2.0);
84
+ vec3 borderColor = stripePhase < stripeLength ? v_color1 : v_color2;
85
+
86
+ vec4 finalColor = vec4(borderColor, borderAlpha);
87
+ finalColor.a *= u_opacity;
88
+ fragColor = finalColor;
89
+ }
@@ -0,0 +1,408 @@
1
+ <template>
2
+ <Teleport to="#bk-canvas-overlay">
3
+ <div
4
+ v-if="tooltipHighlights.length"
5
+ v-show="showTooltip"
6
+ class="bk _bk_fixed _bk_top-0 _bk_left-0 _bk_z-analyze-tooltip _bk_flex _bk_flex-row _bk_-mt-25 _bk_shadow-lg"
7
+ :style="{
8
+ transform: `translate(${tooltipPosition.x}px, ${tooltipPosition.y}px)`
9
+ }"
10
+ @pointerenter="isTooltipHovered = true"
11
+ @pointerleave="isTooltipHovered = false"
12
+ >
13
+ <button
14
+ v-for="(highlight, i) in tooltipHighlights"
15
+ :key="i"
16
+ class="_bk_cursor-pointer _bk_relative _bk_flex _bk_items-center _bk_gap-5 _bk_px-8 _bk_h-25 _bk_text-xs _bk_font-semibold _bk_whitespace-nowrap _bk_bg-scheme-normal _bk_text-scheme-text _bk_first:rounded-l _bk_last:rounded-r bk-highlight-tooltip-item _bk_group/tooltip"
17
+ :class="'bk-scheme-' + highlight.color"
18
+ @click.prevent="onTooltipItemClick(highlight)"
19
+ >
20
+ <Icon :name="highlight.icon" class="_bk_size-15" />
21
+ <span>{{ highlight.label }}</span>
22
+ <Tooltip
23
+ v-if="highlight.description"
24
+ :label="highlight.description"
25
+ placement="center-before"
26
+ />
27
+ </button>
28
+ </div>
29
+ </Teleport>
30
+ </template>
31
+
32
+ <script setup>
33
+ import { useBlokkli, computed, ref } from "#imports";
34
+ import {
35
+ setBuffersAndAttributes,
36
+ drawBufferInfo,
37
+ setUniforms,
38
+ createBufferInfoFromArrays
39
+ } from "twgl.js";
40
+ import vs from "./vertex.glsl?raw";
41
+ import fs from "./fragment.glsl?raw";
42
+ import { RectangleBufferCollector } from "#blokkli/editor/helpers/webgl";
43
+ import { toShaderColor } from "#blokkli/editor/helpers/color";
44
+ import { defineRenderer, onBlokkliEvent } from "#blokkli/editor/composables";
45
+ import { Icon, Tooltip } from "#blokkli/editor/components";
46
+ const { animation, ui, theme, selection, plugins, dom, blocks, state } = useBlokkli();
47
+ const showTooltip = computed(() => {
48
+ return !ui.isChangingOptions.value && !selection.isMultiSelecting.value && !selection.activeEditableLabel.value && !selection.isDragging.value;
49
+ });
50
+ const COLOR_PRIORITY = {
51
+ red: 2,
52
+ yellow: 1
53
+ };
54
+ function resolveHighlightElement(item) {
55
+ if (item.element) {
56
+ return item.element;
57
+ }
58
+ if (item.uuid) {
59
+ const block = blocks.getBlock(item.uuid);
60
+ if (block) {
61
+ return dom.getDragElement(block) ?? null;
62
+ }
63
+ }
64
+ return null;
65
+ }
66
+ function getColorsForGroup(highlights) {
67
+ const uniqueColors = [...new Set(highlights.map((h) => h.color))].sort(
68
+ (a, b) => (COLOR_PRIORITY[b] || 0) - (COLOR_PRIORITY[a] || 0)
69
+ );
70
+ const color1 = colorToRGB(uniqueColors[0]);
71
+ const color2 = uniqueColors.length > 1 ? colorToRGB(uniqueColors[1]) : color1;
72
+ return [color1, color2];
73
+ }
74
+ function colorToRGB(color) {
75
+ if (color === "red") {
76
+ return theme.red.value.normal;
77
+ }
78
+ return theme.yellow.value.normal;
79
+ }
80
+ const groups = computed(() => {
81
+ const allHighlights = plugins.get("highlight");
82
+ const elementMap = /* @__PURE__ */ new Map();
83
+ for (const highlight of allHighlights) {
84
+ const el = resolveHighlightElement(highlight);
85
+ if (!el) {
86
+ continue;
87
+ }
88
+ const existing = elementMap.get(el);
89
+ if (existing) {
90
+ existing.push(highlight);
91
+ } else {
92
+ elementMap.set(el, [highlight]);
93
+ }
94
+ }
95
+ const result = [];
96
+ for (const [element, highlights] of elementMap) {
97
+ const [color1, color2] = getColorsForGroup(highlights);
98
+ const uuids = [
99
+ ...new Set(highlights.map((h) => h.uuid).filter((u) => !!u))
100
+ ];
101
+ result.push({ element, highlights, uuids, color1, color2 });
102
+ }
103
+ return result;
104
+ });
105
+ class HighlightsRectangleBufferCollector extends RectangleBufferCollector {
106
+ prevKey = "";
107
+ rectCache = /* @__PURE__ */ new Map();
108
+ color1Data = [];
109
+ color2Data = [];
110
+ activeData = [];
111
+ clearCache() {
112
+ this.rectCache.clear();
113
+ this.prevKey = "";
114
+ }
115
+ reset() {
116
+ super.reset();
117
+ this.color1Data = [];
118
+ this.color2Data = [];
119
+ this.activeData = [];
120
+ }
121
+ addHighlightRectangle(rect, color1, color2, active) {
122
+ this.addRectangle(rect, 0);
123
+ const c1 = toShaderColor(color1);
124
+ const c2 = toShaderColor(color2);
125
+ const a = active ? 1 : 0;
126
+ for (let v = 0; v < 4; v++) {
127
+ this.color1Data.push(c1[0], c1[1], c1[2]);
128
+ this.color2Data.push(c2[0], c2[1], c2[2]);
129
+ this.activeData.push(a);
130
+ }
131
+ }
132
+ createBufferInfo(gl) {
133
+ return createBufferInfoFromArrays(gl, {
134
+ a_position: {
135
+ numComponents: 3,
136
+ data: this.positions,
137
+ type: gl.FLOAT
138
+ },
139
+ a_rect_id: {
140
+ numComponents: 1,
141
+ data: this.rectId,
142
+ type: gl.FLOAT
143
+ },
144
+ a_state: {
145
+ numComponents: 1,
146
+ data: this.state,
147
+ type: gl.FLOAT
148
+ },
149
+ a_rect_type: {
150
+ numComponents: 1,
151
+ data: this.types,
152
+ type: gl.FLOAT
153
+ },
154
+ a_rect_radius: {
155
+ numComponents: 4,
156
+ data: this.radius,
157
+ type: gl.FLOAT
158
+ },
159
+ a_quad: {
160
+ numComponents: 4,
161
+ data: this.quad,
162
+ type: gl.FLOAT
163
+ },
164
+ a_color1: {
165
+ numComponents: 3,
166
+ data: this.color1Data,
167
+ type: gl.FLOAT
168
+ },
169
+ a_color2: {
170
+ numComponents: 3,
171
+ data: this.color2Data,
172
+ type: gl.FLOAT
173
+ },
174
+ a_active: {
175
+ numComponents: 1,
176
+ data: this.activeData,
177
+ type: gl.FLOAT
178
+ },
179
+ indices: this.indices
180
+ });
181
+ }
182
+ getBufferInfo(gl, force) {
183
+ const activeId = ui.activeHighlightId.value;
184
+ const key = activeId + "_" + groups.value.map((group, index) => {
185
+ const colors = group.highlights.map((h) => h.color).join(",");
186
+ const uuid = group.uuids[0];
187
+ if (uuid) {
188
+ const block = blocks.getBlock(uuid);
189
+ const dragEl = block ? dom.getDragElement(block) : null;
190
+ if (dragEl && dragEl === group.element) {
191
+ const blockRect = dom.getBlockRect(uuid);
192
+ if (blockRect) {
193
+ this.rectCache.set(group.element, blockRect);
194
+ return `${index}_${blockRect.time}_${colors}`;
195
+ }
196
+ }
197
+ }
198
+ if (!this.rectCache.has(group.element)) {
199
+ const rect2 = ui.getAbsoluteElementRect(group.element);
200
+ this.rectCache.set(group.element, rect2);
201
+ }
202
+ const rect = this.rectCache.get(group.element);
203
+ if (!rect) {
204
+ return `${index}_no_rect`;
205
+ }
206
+ return `${index}_${rect.x}_${rect.y}_${rect.width}_${rect.height}_${colors}`;
207
+ }).join("_");
208
+ const hasChanged = force || this.prevKey !== key;
209
+ if (hasChanged) {
210
+ this.reset();
211
+ for (let i = 0; i < groups.value.length; i++) {
212
+ const group = groups.value[i];
213
+ const id = `highlight_${i}`;
214
+ if (this.added.has(id)) {
215
+ continue;
216
+ }
217
+ const rect = this.rectCache.get(group.element);
218
+ if (!rect) {
219
+ continue;
220
+ }
221
+ const isActive = !!activeId && group.highlights.some((h) => h.id === activeId);
222
+ this.addHighlightRectangle(
223
+ {
224
+ id,
225
+ x: rect.x,
226
+ y: rect.y,
227
+ width: rect.width,
228
+ height: rect.height
229
+ },
230
+ group.color1,
231
+ group.color2,
232
+ isActive
233
+ );
234
+ }
235
+ this.prevKey = key;
236
+ }
237
+ if (hasChanged && gl) {
238
+ this.bufferInfo = this.createBufferInfo(gl);
239
+ }
240
+ return { info: this.bufferInfo, hasChanged };
241
+ }
242
+ }
243
+ const { collector } = defineRenderer("highlights-overlay", {
244
+ zIndex: 500,
245
+ collector: () => new HighlightsRectangleBufferCollector(),
246
+ program: () => ({ shaders: [vs, fs] }),
247
+ enabled: () => !selection.isMultiSelecting.value && !selection.isDragging.value && !ui.isChangingOptions.value && !selection.activeEditableLabel.value && !ui.isApproving.value,
248
+ render: (_ctx, gl, program) => {
249
+ gl.useProgram(program.program);
250
+ const { info } = collector.getBufferInfo(gl);
251
+ if (!info) {
252
+ return;
253
+ }
254
+ setUniforms(program, {
255
+ u_opacity: 1
256
+ });
257
+ animation.setSharedUniforms(gl, program);
258
+ setBuffersAndAttributes(gl, program, info);
259
+ drawBufferInfo(gl, info, gl.TRIANGLES);
260
+ },
261
+ renderFallback: (ctx, ctx2d) => {
262
+ collector.getBufferInfo();
263
+ if (groups.value.length === 0) {
264
+ return;
265
+ }
266
+ const borderRadius = 4 * ctx.dpi;
267
+ const lineWidth = 2 * ctx.dpi;
268
+ const activeLineWidth = 4 * ctx.dpi;
269
+ const activeId = ui.activeHighlightId.value;
270
+ for (let i = 0; i < groups.value.length; i++) {
271
+ const group = groups.value[i];
272
+ const rect = collector.rectCache.get(group.element);
273
+ if (!rect) {
274
+ continue;
275
+ }
276
+ const isActive = !!activeId && group.highlights.some((h) => h.id === activeId);
277
+ const x = (rect.x * ctx.artboardScale + ctx.artboardOffset.x) * ctx.dpi;
278
+ const y = (rect.y * ctx.artboardScale + ctx.artboardOffset.y) * ctx.dpi;
279
+ const width = rect.width * ctx.artboardScale * ctx.dpi;
280
+ const height = rect.height * ctx.artboardScale * ctx.dpi;
281
+ ctx2d.lineWidth = isActive ? activeLineWidth : lineWidth;
282
+ ctx2d.strokeStyle = `rgb(${group.color1[0]}, ${group.color1[1]}, ${group.color1[2]})`;
283
+ ctx2d.beginPath();
284
+ ctx2d.roundRect(x, y, width, height, borderRadius);
285
+ ctx2d.stroke();
286
+ }
287
+ }
288
+ });
289
+ onBlokkliEvent("ui:resized", function() {
290
+ collector.clearCache();
291
+ collector.reset();
292
+ });
293
+ onBlokkliEvent("state:reloaded", function() {
294
+ collector.clearCache();
295
+ collector.reset();
296
+ });
297
+ onBlokkliEvent("option:finish-change", () => {
298
+ collector.clearCache();
299
+ collector.reset();
300
+ });
301
+ const hoveredGroupIndex = ref(null);
302
+ const isTooltipHovered = ref(false);
303
+ let pendingIndex = null;
304
+ let pendingChangedAt = 0;
305
+ const ANCESTOR_DELAY = 150;
306
+ const tooltipHighlights = computed(() => {
307
+ if (hoveredGroupIndex.value === null) {
308
+ return [];
309
+ }
310
+ const group = groups.value[hoveredGroupIndex.value];
311
+ return group ? group.highlights : [];
312
+ });
313
+ const tooltipPosition = computed(() => {
314
+ if (hoveredGroupIndex.value === null) {
315
+ return { x: 0, y: 0 };
316
+ }
317
+ const group = groups.value[hoveredGroupIndex.value];
318
+ if (!group) {
319
+ return { x: 0, y: 0 };
320
+ }
321
+ const rect = collector.rectCache.get(group.element);
322
+ if (!rect) {
323
+ return { x: 0, y: 0 };
324
+ }
325
+ const scale = ui.artboardScale.value;
326
+ const offset = ui.artboardOffset.value;
327
+ return {
328
+ x: rect.x * scale + offset.x,
329
+ y: rect.y * scale + offset.y
330
+ };
331
+ });
332
+ function onTooltipItemClick(highlight) {
333
+ highlight.onClick();
334
+ }
335
+ onBlokkliEvent("canvas:draw", (e) => {
336
+ const artboardX = (e.mouseX - e.artboardOffset.x) / e.artboardScale;
337
+ const artboardY = (e.mouseY - e.artboardOffset.y) / e.artboardScale;
338
+ if (isTooltipHovered.value) {
339
+ return;
340
+ }
341
+ let bestIndex = null;
342
+ let bestUuid = null;
343
+ let bestArea = Infinity;
344
+ for (let i = 0; i < groups.value.length; i++) {
345
+ const group = groups.value[i];
346
+ const rect = collector.rectCache.get(group.element);
347
+ if (!rect) {
348
+ continue;
349
+ }
350
+ if (artboardX >= rect.x && artboardX <= rect.x + rect.width && artboardY >= rect.y && artboardY <= rect.y + rect.height) {
351
+ if (bestIndex === null) {
352
+ bestIndex = i;
353
+ bestUuid = group.uuids[0] ?? null;
354
+ bestArea = rect.width * rect.height;
355
+ continue;
356
+ }
357
+ const uuid = group.uuids[0];
358
+ if (uuid && bestUuid && uuid !== bestUuid) {
359
+ if (state.isChildOf(uuid, bestUuid)) {
360
+ bestIndex = i;
361
+ bestUuid = uuid;
362
+ bestArea = rect.width * rect.height;
363
+ }
364
+ continue;
365
+ }
366
+ const area = rect.width * rect.height;
367
+ if (area < bestArea) {
368
+ bestIndex = i;
369
+ bestUuid = uuid ?? null;
370
+ bestArea = area;
371
+ }
372
+ }
373
+ }
374
+ if (bestIndex === hoveredGroupIndex.value) {
375
+ pendingIndex = bestIndex;
376
+ return;
377
+ }
378
+ let needsDelay = false;
379
+ if (bestIndex !== null && hoveredGroupIndex.value !== null) {
380
+ const currentEl = groups.value[hoveredGroupIndex.value]?.element;
381
+ const nextEl = groups.value[bestIndex]?.element;
382
+ if (currentEl && nextEl && nextEl.contains(currentEl)) {
383
+ needsDelay = true;
384
+ }
385
+ }
386
+ if (needsDelay) {
387
+ if (bestIndex !== pendingIndex) {
388
+ pendingIndex = bestIndex;
389
+ pendingChangedAt = e.time;
390
+ }
391
+ if (e.time - pendingChangedAt >= ANCESTOR_DELAY) {
392
+ hoveredGroupIndex.value = pendingIndex;
393
+ }
394
+ } else {
395
+ pendingIndex = bestIndex;
396
+ hoveredGroupIndex.value = bestIndex;
397
+ }
398
+ });
399
+ onBlokkliEvent("window:clickAway", () => {
400
+ hoveredGroupIndex.value = null;
401
+ });
402
+ </script>
403
+
404
+ <script>
405
+ export default {
406
+ name: "HighlightsRenderer"
407
+ };
408
+ </script>