@blokkli/editor 2.0.0-alpha.23 → 2.0.0-alpha.25

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 (259) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +252 -92
  3. package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +38 -0
  4. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +1 -1
  5. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +15 -0
  6. package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +6 -0
  7. package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +28 -3
  8. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -4
  9. package/dist/runtime/blokkliPlugins/Sidebar/index.vue +11 -3
  10. package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +138 -3
  11. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +5 -1
  12. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +116 -0
  13. package/dist/runtime/blokkliPlugins/TourItem/index.vue +22 -13
  14. package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +22 -0
  15. package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +98 -0
  16. package/dist/runtime/blokkliPlugins/index.d.ts +1 -3
  17. package/dist/runtime/blokkliPlugins/index.js +0 -4
  18. package/dist/runtime/components/Blocks/NotImplemented/index.vue +24 -0
  19. package/dist/runtime/components/Blocks/NotImplemented/index.vue.d.ts +6 -0
  20. package/dist/runtime/components/BlokkliEditable.vue.d.ts +11 -0
  21. package/dist/runtime/components/BlokkliItem.vue +16 -3
  22. package/dist/runtime/components/BlokkliItem.vue.d.ts +2 -0
  23. package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -1
  24. package/dist/runtime/components/Edit/Actions/ItemDropdown.vue +1 -1
  25. package/dist/runtime/components/Edit/Actions/index.vue +78 -73
  26. package/dist/runtime/components/Edit/AddListItem/index.vue +9 -35
  27. package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +6 -15
  28. package/dist/runtime/components/Edit/AppMenu/MenuButton.vue +39 -0
  29. package/dist/runtime/{blokkliPlugins/MenuButton/index.vue.d.ts → components/Edit/AppMenu/MenuButton.vue.d.ts} +0 -4
  30. package/dist/runtime/components/Edit/AppMenu/index.vue +62 -40
  31. package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +6 -0
  32. package/dist/runtime/components/Edit/BlockProxy/index.vue +2 -2
  33. package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +3 -0
  34. package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +4 -1
  35. package/dist/runtime/components/Edit/Dialog/index.vue +33 -47
  36. package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
  37. package/dist/runtime/components/Edit/DraggableList.vue +12 -9
  38. package/dist/runtime/components/Edit/EditIndicator.vue +11 -4
  39. package/dist/runtime/components/Edit/EditProvider.vue +75 -55
  40. package/dist/runtime/components/Edit/EditProvider.vue.d.ts +1 -1
  41. package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +53 -0
  42. package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue.d.ts +7 -0
  43. package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue +41 -0
  44. package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue.d.ts +5 -0
  45. package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue +13 -50
  46. package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue.d.ts +5 -0
  47. package/dist/runtime/components/Edit/Features/AddList/index.vue +76 -119
  48. package/dist/runtime/components/Edit/Features/Analyze/Icon.vue +85 -0
  49. package/dist/runtime/components/Edit/Features/Analyze/Icon.vue.d.ts +5 -0
  50. package/dist/runtime/components/Edit/Features/Analyze/Main.vue +288 -59
  51. package/dist/runtime/components/Edit/Features/Analyze/Main.vue.d.ts +8 -1
  52. package/dist/runtime/components/Edit/Features/Analyze/Renderer/fragment.glsl +25 -13
  53. package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue +114 -52
  54. package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue.d.ts +16 -2
  55. package/dist/runtime/components/Edit/Features/Analyze/Renderer/vertex.glsl +31 -11
  56. package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +2 -0
  57. package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +8 -1
  58. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +4 -4
  59. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +20 -2
  60. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +11 -18
  61. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +10 -3
  62. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +46 -40
  63. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +10 -4
  64. package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +8 -4
  65. package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +1 -0
  66. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +4 -3
  67. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +2 -1
  68. package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +61 -20
  69. package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +15 -1
  70. package/dist/runtime/components/Edit/Features/Analyze/index.vue +23 -2
  71. package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +22 -8
  72. package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +42 -21
  73. package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +10 -4
  74. package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue +2 -28
  75. package/dist/runtime/components/Edit/Features/Assistant/index.vue +18 -14
  76. package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +11 -1
  77. package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +2 -2
  78. package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +1 -1
  79. package/dist/runtime/components/Edit/Features/Clipboard/index.vue +52 -18
  80. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +0 -2
  81. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +6 -4
  82. package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +77 -27
  83. package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +7 -4
  84. package/dist/runtime/components/Edit/Features/Comments/index.vue +2 -2
  85. package/dist/runtime/components/Edit/Features/Debug/Main.vue.d.ts +1 -1
  86. package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +2 -2
  87. package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +1 -1
  88. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue +113 -0
  89. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue.d.ts +25 -0
  90. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +8 -97
  91. package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/fragment.glsl +2 -5
  92. package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/index.vue +38 -5
  93. package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/vertex.glsl +10 -1
  94. package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +1 -2
  95. package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +8 -2
  96. package/dist/runtime/components/Edit/Features/EditForm/index.vue +3 -9
  97. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +1 -1
  98. package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +4 -3
  99. package/dist/runtime/components/Edit/Features/EditableField/index.vue +2 -2
  100. package/dist/runtime/components/Edit/Features/EditableMask/index.vue +1 -1
  101. package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +7 -2
  102. package/dist/runtime/components/Edit/Features/Exit/index.vue +12 -9
  103. package/dist/runtime/components/Edit/Features/Fragments/index.vue +27 -31
  104. package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +1 -0
  105. package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +25 -24
  106. package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +4 -4
  107. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +9 -2
  108. package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +13 -3
  109. package/dist/runtime/components/Edit/Features/Library/index.vue +26 -24
  110. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +3 -2
  111. package/dist/runtime/components/Edit/Features/MultiSelect/Renderer/index.vue +1 -3
  112. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +1 -1
  113. package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -1
  114. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +10 -0
  115. package/dist/runtime/components/Edit/Features/Publish/index.vue +17 -15
  116. package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue +3 -2
  117. package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +3 -2
  118. package/dist/runtime/components/Edit/Features/Revert/index.vue +24 -18
  119. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +8 -2
  120. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +12 -2
  121. package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue +11 -3
  122. package/dist/runtime/components/Edit/Features/Search/index.vue +1 -1
  123. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +128 -31
  124. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +6 -6
  125. package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +3 -6
  126. package/dist/runtime/components/Edit/Features/Selection/Renderer/index.vue +1 -1
  127. package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +1 -0
  128. package/dist/runtime/components/Edit/Features/Settings/index.vue +26 -18
  129. package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +3 -3
  130. package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +2 -2
  131. package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +3 -3
  132. package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue +2 -2
  133. package/dist/runtime/components/Edit/Features/Tour/index.vue +12 -10
  134. package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +7 -1
  135. package/dist/runtime/components/Edit/Features/Transform/index.vue +1 -1
  136. package/dist/runtime/components/Edit/Features/Translations/index.vue +18 -17
  137. package/dist/runtime/components/Edit/Form/Textarea/index.vue +1 -1
  138. package/dist/runtime/components/Edit/FormOverlay/index.vue +13 -4
  139. package/dist/runtime/components/Edit/Indicators/index.vue +1 -1
  140. package/dist/runtime/components/Edit/InfoBox/index.vue +3 -2
  141. package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +6 -1
  142. package/dist/runtime/components/Edit/ItemIconBox/index.vue +41 -0
  143. package/dist/runtime/components/Edit/{AddListItemIcon → ItemIconBox}/index.vue.d.ts +5 -5
  144. package/dist/runtime/components/Edit/Konami/Game/index.vue +0 -1
  145. package/dist/runtime/components/Edit/Konami/index.vue +3 -5
  146. package/dist/runtime/components/Edit/Messages/Item/index.vue +11 -2
  147. package/dist/runtime/components/Edit/Messages/index.vue +6 -1
  148. package/dist/runtime/components/Edit/Overlay/index.vue +70 -0
  149. package/dist/runtime/components/Edit/Overlay/index.vue.d.ts +2 -0
  150. package/dist/runtime/components/Edit/PreviewProvider.vue +3 -3
  151. package/dist/runtime/components/Edit/ScaleToFit/index.vue +4 -4
  152. package/dist/runtime/components/Edit/SystemRequirements/index.vue +36 -36
  153. package/dist/runtime/components/Edit/Toolbar/index.vue +47 -48
  154. package/dist/runtime/components/Edit/index.d.ts +2 -2
  155. package/dist/runtime/components/Edit/index.js +2 -2
  156. package/dist/runtime/composables/defineBlokkliFeature.d.ts +1 -1
  157. package/dist/runtime/composables/useBlokkli.d.ts +6 -1
  158. package/dist/runtime/composables/useBlokkli.js +4 -1
  159. package/dist/runtime/css/output.css +1 -1
  160. package/dist/runtime/helpers/composables/defineAddAction.d.ts +2 -0
  161. package/dist/runtime/helpers/composables/defineAddAction.js +10 -0
  162. package/dist/runtime/helpers/composables/defineElementStyle.d.ts +2 -0
  163. package/dist/runtime/helpers/composables/defineElementStyle.js +33 -0
  164. package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +1 -1
  165. package/dist/runtime/helpers/composables/defineItemDropdownAction.js +2 -2
  166. package/dist/runtime/helpers/composables/defineMenuButton.d.ts +2 -0
  167. package/dist/runtime/helpers/composables/defineMenuButton.js +10 -0
  168. package/dist/runtime/helpers/composables/defineRenderer.d.ts +1 -1
  169. package/dist/runtime/helpers/composables/onBroadcastEvent.d.ts +1 -1
  170. package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +1 -1
  171. package/dist/runtime/helpers/composables/useBlockRegistration.js +12 -1
  172. package/dist/runtime/helpers/composables/useDebugLogger.d.ts +1 -1
  173. package/dist/runtime/helpers/composables/useDialog.d.ts +3 -0
  174. package/dist/runtime/helpers/composables/useDialog.js +16 -0
  175. package/dist/runtime/helpers/composables/useFocusTrap.d.ts +52 -0
  176. package/dist/runtime/helpers/composables/useFocusTrap.js +59 -0
  177. package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +1 -1
  178. package/dist/runtime/helpers/{useTransitionedValue.js → composables/useTransitionedValue.js} +1 -1
  179. package/dist/runtime/helpers/dropTargets/index.d.ts +1 -1
  180. package/dist/runtime/helpers/dropTargets/index.js +17 -3
  181. package/dist/runtime/helpers/imports/index.d.ts +2 -1
  182. package/dist/runtime/helpers/imports/index.js +10 -1
  183. package/dist/runtime/helpers/{animationProvider.d.ts → providers/animation.d.ts} +100 -7
  184. package/dist/runtime/helpers/{animationProvider.js → providers/animation.js} +21 -11
  185. package/dist/runtime/helpers/providers/blocks.d.ts +25 -3
  186. package/dist/runtime/helpers/providers/blocks.js +19 -0
  187. package/dist/runtime/helpers/providers/commands.d.ts +41 -0
  188. package/dist/runtime/helpers/{commandsProvider.js → providers/commands.js} +1 -1
  189. package/dist/runtime/helpers/providers/debug.d.ts +125 -0
  190. package/dist/runtime/helpers/{debugProvider.js → providers/debug.js} +2 -2
  191. package/dist/runtime/helpers/providers/definition.d.ts +87 -0
  192. package/dist/runtime/helpers/providers/directive.d.ts +88 -2
  193. package/dist/runtime/helpers/providers/directive.js +18 -2
  194. package/dist/runtime/helpers/providers/dom.d.ts +225 -0
  195. package/dist/runtime/helpers/{domProvider.js → providers/dom.js} +34 -76
  196. package/dist/runtime/helpers/providers/dropArea.d.ts +47 -0
  197. package/dist/runtime/helpers/{dropAreaProvider.js → providers/dropArea.js} +1 -1
  198. package/dist/runtime/helpers/providers/element.d.ts +58 -1
  199. package/dist/runtime/helpers/providers/features.d.ts +56 -0
  200. package/dist/runtime/helpers/{featuresProvider.js → providers/features.js} +1 -1
  201. package/dist/runtime/helpers/providers/fields.d.ts +19 -4
  202. package/dist/runtime/helpers/providers/fields.js +1 -1
  203. package/dist/runtime/helpers/providers/indicators.d.ts +44 -0
  204. package/dist/runtime/helpers/providers/keyboard.d.ts +76 -0
  205. package/dist/runtime/helpers/{keyboardProvider.js → providers/keyboard.js} +1 -8
  206. package/dist/runtime/helpers/providers/plugin.d.ts +81 -0
  207. package/dist/runtime/helpers/providers/plugin.js +64 -0
  208. package/dist/runtime/helpers/{selectionProvider.d.ts → providers/selection.d.ts} +4 -1
  209. package/dist/runtime/helpers/{selectionProvider.js → providers/selection.js} +1 -1
  210. package/dist/runtime/helpers/providers/state.d.ts +227 -0
  211. package/dist/runtime/helpers/{stateProvider.js → providers/state.js} +3 -3
  212. package/dist/runtime/helpers/providers/storage.d.ts +64 -0
  213. package/dist/runtime/helpers/{textProvider.d.ts → providers/texts.d.ts} +1 -1
  214. package/dist/runtime/helpers/providers/theme.d.ts +119 -0
  215. package/dist/runtime/helpers/{themeProvider.js → providers/theme.js} +3 -3
  216. package/dist/runtime/helpers/providers/tour.d.ts +49 -0
  217. package/dist/runtime/helpers/{tourProvider.js → providers/tour.js} +1 -1
  218. package/dist/runtime/helpers/providers/types.d.ts +170 -0
  219. package/dist/runtime/helpers/{typesProvider.js → providers/types.js} +45 -1
  220. package/dist/runtime/helpers/providers/ui.d.ts +339 -0
  221. package/dist/runtime/helpers/{uiProvider.js → providers/ui.js} +94 -86
  222. package/dist/runtime/helpers/runtimeHelpers/index.d.ts +1 -1
  223. package/dist/runtime/helpers/symbols.d.ts +1 -0
  224. package/dist/runtime/helpers/symbols.js +3 -0
  225. package/dist/runtime/icons/click.svg +1 -0
  226. package/dist/runtime/types/blockOptions.d.ts +349 -0
  227. package/dist/runtime/types/index.d.ts +34 -31
  228. package/package.json +2 -2
  229. package/dist/runtime/blokkliPlugins/AddAction/index.vue +0 -96
  230. package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +0 -26
  231. package/dist/runtime/blokkliPlugins/MenuButton/index.vue +0 -68
  232. package/dist/runtime/components/Edit/AddListItemIcon/index.vue +0 -19
  233. package/dist/runtime/helpers/commandsProvider.d.ts +0 -9
  234. package/dist/runtime/helpers/debugProvider.d.ts +0 -33
  235. package/dist/runtime/helpers/definitionProvider.d.ts +0 -19
  236. package/dist/runtime/helpers/domProvider.d.ts +0 -90
  237. package/dist/runtime/helpers/dropAreaProvider.d.ts +0 -9
  238. package/dist/runtime/helpers/featuresProvider.d.ts +0 -17
  239. package/dist/runtime/helpers/indicatorsProvider.d.ts +0 -10
  240. package/dist/runtime/helpers/keyboardProvider.d.ts +0 -20
  241. package/dist/runtime/helpers/pluginProvider.d.ts +0 -26
  242. package/dist/runtime/helpers/pluginProvider.js +0 -62
  243. package/dist/runtime/helpers/stateProvider.d.ts +0 -47
  244. package/dist/runtime/helpers/storageProvider.d.ts +0 -17
  245. package/dist/runtime/helpers/themeProvider.d.ts +0 -30
  246. package/dist/runtime/helpers/tourProvider.d.ts +0 -11
  247. package/dist/runtime/helpers/typesProvider.d.ts +0 -36
  248. package/dist/runtime/helpers/uiProvider.d.ts +0 -60
  249. package/dist/runtime/types/blokkOptions.d.ts +0 -100
  250. /package/dist/runtime/helpers/{addElementClasses.d.ts → composables/addElementClasses.d.ts} +0 -0
  251. /package/dist/runtime/helpers/{addElementClasses.js → composables/addElementClasses.js} +0 -0
  252. /package/dist/runtime/helpers/{useTransitionedValue.d.ts → composables/useTransitionedValue.d.ts} +0 -0
  253. /package/dist/runtime/helpers/{broadcastProvider.d.ts → providers/broadcast.d.ts} +0 -0
  254. /package/dist/runtime/helpers/{broadcastProvider.js → providers/broadcast.js} +0 -0
  255. /package/dist/runtime/helpers/{definitionProvider.js → providers/definition.js} +0 -0
  256. /package/dist/runtime/helpers/{indicatorsProvider.js → providers/indicators.js} +0 -0
  257. /package/dist/runtime/helpers/{storageProvider.js → providers/storage.js} +0 -0
  258. /package/dist/runtime/helpers/{textProvider.js → providers/texts.js} +0 -0
  259. /package/dist/runtime/types/{blokkOptions.js → blockOptions.js} +0 -0
@@ -3,8 +3,8 @@
3
3
  <div class="bk-analyze-button">
4
4
  <button
5
5
  class="bk-button bk-is-primary"
6
- :disabled="!isStale"
7
- @click="onClick"
6
+ :disabled="buttonDisabled"
7
+ @click.prevent="onClick"
8
8
  >
9
9
  {{ $t("analyzeButtonLabel", "Analyze Page") }}
10
10
  </button>
@@ -16,17 +16,29 @@
16
16
  }}
17
17
  </RelativeTime>
18
18
  </p>
19
- <p v-if="isStale && hasRunOnce" class="bk-message-info">
20
- {{
21
- $t(
22
- "analyzeStaleMessage",
23
- "The contents of the page have changed since last analyzing the page. Please run the analyzers again to get updated results."
24
- )
25
- }}
19
+
20
+ <div v-if="analyzerStatuses.length > 1" class="bk-analyze-statuses">
21
+ <div
22
+ v-for="analyzer in analyzerStatuses"
23
+ :key="analyzer.id"
24
+ class="bk-analyze-status-item"
25
+ >
26
+ <span class="bk-analyze-status-title">{{ analyzer.title }}</span>
27
+ <span
28
+ class="bk-analyze-status-label"
29
+ :class="{ 'bk-is-stale': analyzer.isStale }"
30
+ >
31
+ {{ analyzer.status }}
32
+ </span>
33
+ </div>
34
+ </div>
35
+
36
+ <p v-if="staleMessage" class="bk-message-info">
37
+ {{ staleMessage }}
26
38
  </p>
27
39
  </div>
28
40
 
29
- <div v-if="resultsFiltered.length" class="bk-analyze-wrapper">
41
+ <div v-if="results.length" class="bk-analyze-wrapper">
30
42
  <div class="bk-analyze-form">
31
43
  <FormSelect
32
44
  id="category"
@@ -35,18 +47,29 @@
35
47
  :options="categoryOptions"
36
48
  />
37
49
  </div>
38
- <AnalyzeSummary :results="resultsFiltered" />
39
- <Results :results="resultsFiltered" />
50
+ <AnalyzeSummary :results="results" />
51
+ <Results v-model="activeId" :results="results" />
40
52
  </div>
41
53
  </div>
42
54
  <Renderer
43
- v-if="resultsFiltered.length && !isStale"
44
- :results="resultsFiltered"
55
+ v-if="results.length"
56
+ v-model="activeId"
57
+ :results
58
+ :is-stale
59
+ :manual-analyzer-ids
60
+ :is-running
45
61
  />
46
62
  </template>
47
63
 
48
64
  <script setup>
49
- import { computed, useBlokkli, useState, ref } from "#imports";
65
+ import {
66
+ computed,
67
+ useBlokkli,
68
+ useState,
69
+ onMounted,
70
+ onUnmounted,
71
+ watch
72
+ } from "#imports";
50
73
  import Results from "./Results/Results.vue";
51
74
  import AnalyzeSummary from "./Summary/index.vue";
52
75
  import Renderer from "./Renderer/index.vue";
@@ -54,87 +77,288 @@ import { useAnalyzeHelper } from "./helper";
54
77
  import { FormSelect, RelativeTime } from "#blokkli/components";
55
78
  import { AnalyzerContext } from "./analyzers/helpers/Context";
56
79
  import { normalizeToArray } from "./analyzers/helpers/normalizeArray";
57
- import { falsy } from "#blokkli/helpers";
58
80
  import { renderCycle } from "#blokkli/helpers/renderCycle";
59
81
  const props = defineProps({
60
82
  langcode: { type: String, required: true },
61
83
  analyzers: { type: Array, required: true }
62
84
  });
63
85
  const ALL = "ALL";
64
- const { $t, ui, state } = useBlokkli();
86
+ const { $t, ui, state, directive, dom } = useBlokkli();
65
87
  const { getCategoryLabel } = useAnalyzeHelper();
66
- const currentPlugin = ref("readability");
88
+ const refreshKey = computed(() => {
89
+ return `dom:${dom.settleKey.value}_directive:${directive.settleKey.value}_state:${state.refreshKey.value}`;
90
+ });
91
+ const isRunning = defineModel({ type: Boolean, ...{ default: false } });
92
+ let currentAbortController = null;
67
93
  const hasRunOnce = useState(() => false);
68
- const results = useState("blokkli:analyze", () => []);
69
- const isLoading = useState(() => false);
94
+ const continuousResults = useState(
95
+ "blokkli:analyze:continuous",
96
+ () => []
97
+ );
98
+ const manualResults = useState(
99
+ "blokkli:analyze:manual",
100
+ () => []
101
+ );
102
+ const activeId = useState(() => "");
70
103
  const lastRun = useState(() => 0);
71
104
  const lastRunKey = useState(() => "");
72
105
  const selectedCategory = useState(() => ALL);
73
106
  const hasInitialized = useState(() => false);
74
107
  const providerRootElement = ui.providerElement;
75
- const resultsFiltered = computed(() => {
108
+ const continuousAnalyzers = computed(
109
+ () => props.analyzers.filter((a) => a.continuous)
110
+ );
111
+ const manualAnalyzers = computed(
112
+ () => props.analyzers.filter((a) => !a.continuous)
113
+ );
114
+ const hasContinuousAnalyzers = computed(
115
+ () => continuousAnalyzers.value.length > 0
116
+ );
117
+ const hasManualAnalyzers = computed(() => manualAnalyzers.value.length > 0);
118
+ const allResults = computed(() => {
119
+ const merged = [...continuousResults.value, ...manualResults.value];
120
+ const mappedResults = [];
121
+ let currentIndex = 0;
122
+ for (let i = 0; i < merged.length; i++) {
123
+ const result = merged[i];
124
+ if (!result) {
125
+ continue;
126
+ }
127
+ const nodes = Array.isArray(result.nodes) ? result.nodes : [result.nodes];
128
+ const mappedNodes = [];
129
+ for (let j = 0; j < nodes.length; j++) {
130
+ const node = nodes[j];
131
+ if (!node) {
132
+ continue;
133
+ }
134
+ const targets = Array.isArray(node.targets) ? node.targets : [node.targets];
135
+ const mappedTargets = [];
136
+ for (let k = 0; k < targets.length; k++) {
137
+ const target = targets[k];
138
+ if (!target) {
139
+ continue;
140
+ }
141
+ mappedTargets.push({ target, globalIndex: currentIndex });
142
+ currentIndex++;
143
+ }
144
+ mappedNodes.push({
145
+ ...node,
146
+ targets: mappedTargets
147
+ });
148
+ }
149
+ mappedResults.push({
150
+ ...result,
151
+ plugin: result.pluginId,
152
+ nodes: mappedNodes
153
+ });
154
+ }
155
+ return mappedResults;
156
+ });
157
+ const results = computed(() => {
76
158
  if (selectedCategory.value === ALL) {
77
- return results.value;
159
+ return allResults.value;
78
160
  }
79
- return results.value.filter((v) => v.category === selectedCategory.value);
161
+ return allResults.value.filter((v) => v.category === selectedCategory.value);
80
162
  });
81
163
  const isStale = computed(() => lastRunKey.value !== state.refreshKey.value);
82
- function getContext() {
164
+ const buttonDisabled = computed(() => {
165
+ if (isRunning.value) {
166
+ return true;
167
+ }
168
+ if (!isStale.value) {
169
+ return false;
170
+ }
171
+ return false;
172
+ });
173
+ const staleMessage = computed(() => {
174
+ if (hasManualAnalyzers.value && manualResults.value.length === 0) {
175
+ return $t(
176
+ "analyzeClickButton",
177
+ "Click the button above to run the analysis."
178
+ );
179
+ }
180
+ if (hasManualAnalyzers.value && isStale.value) {
181
+ return $t(
182
+ "analyzeResultsOutdated",
183
+ "Results are outdated. Click the button to update."
184
+ );
185
+ }
186
+ return "";
187
+ });
188
+ const analyzerStatuses = computed(() => {
189
+ if (!hasRunOnce.value) {
190
+ return [];
191
+ }
192
+ return props.analyzers.map((analyzer) => {
193
+ const status = analyzer.continuous ? $t("analyzeStatusUpToDate", "Up-to-date") : isStale.value ? $t("analyzeStatusStale", "Stale") : $t("analyzeStatusUpToDate", "Up-to-date");
194
+ const title = typeof analyzer.label === "function" ? analyzer.label(ui.interfaceLanguage.value) : analyzer.label;
195
+ return {
196
+ id: analyzer.id,
197
+ title: title ?? analyzer.id,
198
+ status,
199
+ isStale: !analyzer.continuous && isStale.value
200
+ };
201
+ });
202
+ });
203
+ const manualAnalyzerIds = computed(
204
+ () => new Set(manualAnalyzers.value.map((a) => a.id))
205
+ );
206
+ let refreshTimeout = null;
207
+ watch(refreshKey, () => {
208
+ if (!hasContinuousAnalyzers.value) {
209
+ return;
210
+ }
211
+ if (currentAbortController) {
212
+ currentAbortController.abort("refreshKey updated");
213
+ }
214
+ if (refreshTimeout) {
215
+ window.clearTimeout(refreshTimeout);
216
+ }
217
+ isRunning.value = true;
218
+ refreshTimeout = window.setTimeout(() => {
219
+ runContinuous();
220
+ }, 100);
221
+ });
222
+ onUnmounted(() => {
223
+ if (currentAbortController) {
224
+ currentAbortController.abort("refreshKey updated");
225
+ currentAbortController = null;
226
+ }
227
+ });
228
+ function getContext(signal) {
83
229
  return new AnalyzerContext(
84
230
  props.langcode,
85
231
  ui.interfaceLanguage.value,
86
232
  providerRootElement,
87
233
  state,
88
- $t
234
+ $t,
235
+ signal
89
236
  );
90
237
  }
238
+ async function runContinuous() {
239
+ if (!continuousAnalyzers.value.length) {
240
+ return;
241
+ }
242
+ if (currentAbortController) {
243
+ currentAbortController.abort("refreshKey updated");
244
+ }
245
+ const abortController = new AbortController();
246
+ currentAbortController = abortController;
247
+ isRunning.value = true;
248
+ let wasAborted = false;
249
+ try {
250
+ const context = getContext(abortController.signal);
251
+ if (!hasInitialized.value) {
252
+ await Promise.all(
253
+ props.analyzers.map(async (analyzer) => {
254
+ if (analyzer.init) {
255
+ await analyzer.init(context);
256
+ }
257
+ })
258
+ );
259
+ hasInitialized.value = true;
260
+ }
261
+ if (abortController.signal.aborted) {
262
+ wasAborted = true;
263
+ return;
264
+ }
265
+ const newResults = [];
266
+ for (let i = 0; i < continuousAnalyzers.value.length; i++) {
267
+ if (abortController.signal.aborted) {
268
+ wasAborted = true;
269
+ return;
270
+ }
271
+ const analyzer = continuousAnalyzers.value[i];
272
+ const result = (await normalizeToArray(analyzer.run(context))).map(
273
+ (v) => {
274
+ return {
275
+ ...v,
276
+ pluginId: analyzer.id
277
+ };
278
+ }
279
+ );
280
+ newResults.push(...result);
281
+ }
282
+ if (abortController.signal.aborted) {
283
+ wasAborted = true;
284
+ return;
285
+ }
286
+ continuousResults.value = newResults;
287
+ hasRunOnce.value = true;
288
+ lastRun.value = Date.now() / 1e3;
289
+ } catch (error) {
290
+ if (error instanceof Error && error.name === "AbortError") {
291
+ wasAborted = true;
292
+ return;
293
+ }
294
+ throw error;
295
+ } finally {
296
+ if (currentAbortController === abortController) {
297
+ currentAbortController = null;
298
+ if (!wasAborted) {
299
+ isRunning.value = false;
300
+ }
301
+ }
302
+ }
303
+ }
91
304
  async function onClick() {
92
- if (isLoading.value) {
305
+ if (isRunning.value) {
93
306
  return;
94
307
  }
95
- const requiresRawPage = props.analyzers.some(
308
+ const requiresRawPage = manualAnalyzers.value.some(
96
309
  (analyzer) => analyzer.requireRawPage
97
310
  );
98
311
  if (requiresRawPage) {
99
312
  ui.isAnalyzing.value = true;
100
313
  }
101
- isLoading.value = true;
314
+ isRunning.value = true;
102
315
  await renderCycle();
103
- const context = getContext();
104
- if (!hasInitialized.value) {
105
- await Promise.all(
106
- props.analyzers.map(async (analyzer) => {
107
- if (analyzer.init) {
108
- await analyzer.init(context);
316
+ const currentRefreshKey = state.refreshKey.value;
317
+ try {
318
+ const context = getContext();
319
+ if (!hasInitialized.value) {
320
+ await Promise.all(
321
+ props.analyzers.map(async (analyzer) => {
322
+ if (analyzer.init) {
323
+ await analyzer.init(context);
324
+ }
325
+ })
326
+ );
327
+ }
328
+ hasInitialized.value = true;
329
+ const newManualResults = [];
330
+ for (let i = 0; i < manualAnalyzers.value.length; i++) {
331
+ const analyzer = manualAnalyzers.value[i];
332
+ const result = (await normalizeToArray(analyzer.run(context))).map(
333
+ (v) => {
334
+ return {
335
+ ...v,
336
+ pluginId: analyzer.id
337
+ };
109
338
  }
110
- })
111
- );
112
- }
113
- hasInitialized.value = true;
114
- const newResults = [];
115
- for (let i = 0; i < props.analyzers.length; i++) {
116
- const analyzer = props.analyzers[i];
117
- currentPlugin.value = analyzer.id;
118
- const result = await normalizeToArray(analyzer.run(context));
119
- const mapped = result.filter(falsy).map((v) => {
120
- return {
121
- ...v,
122
- plugin: analyzer.id
123
- };
124
- });
125
- newResults.push(...mapped);
126
- }
127
- results.value = newResults;
128
- isLoading.value = false;
129
- hasRunOnce.value = true;
130
- lastRun.value = Date.now() / 1e3;
131
- lastRunKey.value = state.refreshKey.value;
132
- if (requiresRawPage) {
133
- ui.isAnalyzing.value = false;
339
+ );
340
+ newManualResults.push(...result);
341
+ }
342
+ manualResults.value = newManualResults;
343
+ hasRunOnce.value = true;
344
+ lastRun.value = Date.now() / 1e3;
345
+ if (state.refreshKey.value === currentRefreshKey) {
346
+ lastRunKey.value = currentRefreshKey;
347
+ }
348
+ } catch (error) {
349
+ if (error instanceof Error && error.name === "AbortError") {
350
+ return;
351
+ }
352
+ throw error;
353
+ } finally {
354
+ isRunning.value = false;
355
+ if (requiresRawPage) {
356
+ ui.isAnalyzing.value = false;
357
+ }
134
358
  }
135
359
  }
136
360
  const categoryOptions = computed(() => {
137
- const set = results.value.reduce((acc, v) => {
361
+ const set = allResults.value.reduce((acc, v) => {
138
362
  acc.add(v.category);
139
363
  return acc;
140
364
  }, /* @__PURE__ */ new Set());
@@ -152,4 +376,9 @@ const categoryOptions = computed(() => {
152
376
  ...categories
153
377
  ];
154
378
  });
379
+ onMounted(async () => {
380
+ if (hasContinuousAnalyzers.value) {
381
+ await runContinuous();
382
+ }
383
+ });
155
384
  </script>
@@ -3,5 +3,12 @@ type __VLS_Props = {
3
3
  langcode: string;
4
4
  analyzers: Analyzer[];
5
5
  };
6
- declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
+ type __VLS_PublicProps = __VLS_Props & {
7
+ modelValue?: boolean;
8
+ };
9
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "update:modelValue": (value: boolean) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
14
  export default _default;
@@ -7,6 +7,10 @@ in float v_rect_type;
7
7
  in vec3 v_color;
8
8
  in vec2 v_rect_size;
9
9
  in vec2 v_rect_center;
10
+ in float v_opacity;
11
+ in float v_border_opacity;
12
+ in float v_border_factor;
13
+ in float v_fill_opacity;
10
14
 
11
15
  out vec4 fragColor;
12
16
 
@@ -28,35 +32,43 @@ float sdRoundBox(vec2 p, vec2 b, vec4 radii) {
28
32
  }
29
33
 
30
34
  void main() {
31
- float borderThickness = 2.0 * u_dpi;
35
+ float borderThickness = 2.0 * u_dpi * v_border_factor;
32
36
  vec2 size = v_rect_size;
33
- vec4 radius = vec4(0.0); // No rounded corners for now
37
+ vec4 radius = vec4(4.0 * u_dpi * v_border_factor);
34
38
 
35
39
  vec2 posRelativeToQuad = gl_FragCoord.xy - v_rect_center;
36
40
 
37
- float mainDist = sdRoundBox(posRelativeToQuad, size / 2.0, radius);
41
+ // Outer rounded rectangle (includes border)
42
+ float outerDist = sdRoundBox(posRelativeToQuad, size / 2.0, radius);
38
43
 
39
- // Calculate fill alpha (inside the rectangle)
40
- float fillAlpha = 1.0 - smoothstep(-1.0, 0.0, mainDist);
44
+ // Inner rounded rectangle (fill area, excluding border)
45
+ float innerDist = sdRoundBox(
46
+ posRelativeToQuad,
47
+ size / 2.0 - borderThickness,
48
+ radius - borderThickness
49
+ );
41
50
 
42
- // Calculate border alpha (edge of the rectangle)
43
- float borderAlpha =
44
- 1.0 - smoothstep(-1.0, 0.0, abs(mainDist) - borderThickness);
51
+ // Calculate fill alpha (inside the inner rectangle)
52
+ float fillAlpha = 1.0 - smoothstep(-1.0, 0.0, innerDist);
53
+
54
+ // Calculate border alpha (between outer and inner)
55
+ float outerAlpha = 1.0 - smoothstep(-1.0, 0.0, outerDist);
56
+ float borderAlpha = outerAlpha * (1.0 - fillAlpha);
45
57
 
46
58
  // Background (transparent)
47
59
  vec4 bg = vec4(0.0, 0.0, 0.0, 0.0);
48
60
 
49
- // Fill (semi-transparent)
50
- vec4 fill = vec4(v_color, 0.3);
61
+ // Fill (semi-transparent) - use fill opacity from vertex shader
62
+ vec4 fill = vec4(v_color, v_fill_opacity * v_opacity);
51
63
 
52
- // Border (fully opaque)
53
- vec4 border = vec4(v_color, 1.0);
64
+ // Border - use opacity calculated in vertex shader
65
+ vec4 border = vec4(v_color, v_border_opacity);
54
66
 
55
67
  // Mix background with fill
56
68
  vec4 res_with_fill = mix(bg, fill, fillAlpha);
57
69
 
58
70
  // Mix with border
59
- vec4 finalColor = mix(res_with_fill, border, borderAlpha * border.a);
71
+ vec4 finalColor = mix(res_with_fill, border, borderAlpha);
60
72
 
61
73
  fragColor = finalColor;
62
74
  }