@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
@@ -1,8 +1,14 @@
1
+ import type { AnalyzeNodeTargetMapped } from '#blokkli/analyzer/types';
1
2
  type __VLS_Props = {
2
3
  resultId: string;
3
- target: string | HTMLElement | {
4
- uuid: string;
5
- };
4
+ target: AnalyzeNodeTargetMapped;
6
5
  };
7
- 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?: string;
8
+ };
9
+ declare const _default: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
+ "update:modelValue": (value: string) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
13
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
14
  export default _default;
@@ -1,11 +1,11 @@
1
1
  <template>
2
2
  <svg :width="size" :height="size" :viewBox="`0 0 ${size} ${size}`">
3
3
  <circle
4
- v-if="data.length === 1"
4
+ v-if="dataWithValues.length === 1"
5
5
  :cx="radius"
6
6
  :cy="radius"
7
7
  :r="radius"
8
- :fill="data[0]?.color"
8
+ :fill="dataWithValues[0]?.color"
9
9
  />
10
10
  <g v-else :transform="`translate(${radius}, ${radius})`">
11
11
  <path
@@ -40,11 +40,14 @@ const props = defineProps({
40
40
  percentage: { type: Number, required: false, default: void 0 }
41
41
  });
42
42
  const size = computed(() => props.radius * 2);
43
+ const dataWithValues = computed(
44
+ () => props.data.filter((item) => item.value > 0)
45
+ );
43
46
  const segments = computed(() => {
44
47
  const total = props.data.reduce((sum, item) => sum + item.value, 0);
45
48
  if (total === 0) return [];
46
49
  let currentAngle = -90;
47
- return props.data.map((item) => {
50
+ return props.data.filter((item) => item.value > 0).map((item) => {
48
51
  const percentage = item.value / total;
49
52
  const angle = percentage * 360;
50
53
  const startAngle = currentAngle;
@@ -77,7 +80,8 @@ function createPieSegment(cx, cy, radius, startAngle, endAngle) {
77
80
  const largeArc = endAngle - startAngle > 180 ? 1 : 0;
78
81
  if (endAngle - startAngle >= 360) {
79
82
  return `
80
- M ${cx + radius} ${cy}
83
+ M ${cx} ${cy}
84
+ L ${cx + radius} ${cy}
81
85
  A ${radius} ${radius} 0 1 1 ${cx + radius} ${cy + 1e-3}
82
86
  Z
83
87
  `;
@@ -54,6 +54,7 @@ export default defineAnalyzer((options) => {
54
54
  };
55
55
  return {
56
56
  id: "axe",
57
+ label: "Axe (Accessibility Check)",
57
58
  requireRawPage: true,
58
59
  init: function(context) {
59
60
  const locale = getLocale(context.interfaceLangcode) ?? {};
@@ -1,6 +1,6 @@
1
1
  import type { FieldListItemTyped } from '#blokkli-build/generated-types';
2
- import type { StateProvider } from '#blokkli/helpers/stateProvider';
3
- import type { TextProvider } from '#blokkli/helpers/textProvider';
2
+ import type { StateProvider } from '#blokkli/helpers/providers/state';
3
+ import type { TextProvider } from '#blokkli/helpers/providers/texts';
4
4
  import type { MutatedField } from '#blokkli/types';
5
5
  import type { AnalyzeCategory, AnalyzeNode, AnalyzeResult, AnalyzeStatus } from '../types.js';
6
6
  import { type TextElement } from './collectTextElements.js';
@@ -10,12 +10,13 @@ export declare class AnalyzerContext {
10
10
  readonly providerRootElement: HTMLElement;
11
11
  private state;
12
12
  readonly $t: TextProvider;
13
+ readonly signal?: AbortSignal | undefined;
13
14
  readonly mutatedFields: Readonly<MutatedField[]>;
14
15
  /**
15
16
  * The collected text elements.
16
17
  */
17
18
  private textElements;
18
- constructor(langcode: string, interfaceLangcode: string, providerRootElement: HTMLElement, state: StateProvider, $t: TextProvider);
19
+ constructor(langcode: string, interfaceLangcode: string, providerRootElement: HTMLElement, state: StateProvider, $t: TextProvider, signal?: AbortSignal | undefined);
19
20
  /**
20
21
  * Get the field list item for a block UUID.
21
22
  */
@@ -1,11 +1,12 @@
1
1
  import { collectTextElements } from "./collectTextElements.js";
2
2
  export class AnalyzerContext {
3
- constructor(langcode, interfaceLangcode, providerRootElement, state, $t) {
3
+ constructor(langcode, interfaceLangcode, providerRootElement, state, $t, signal) {
4
4
  this.langcode = langcode;
5
5
  this.interfaceLangcode = interfaceLangcode;
6
6
  this.providerRootElement = providerRootElement;
7
7
  this.state = state;
8
8
  this.$t = $t;
9
+ this.signal = signal;
9
10
  this.mutatedFields = JSON.parse(JSON.stringify(state.mutatedFields.value));
10
11
  }
11
12
  mutatedFields;
@@ -10,7 +10,7 @@ const LIX_BANDS = { easyMax: 40, okMax: 59 };
10
10
  const CLI_HARD_MIN = 12;
11
11
  const ARI_HARD_MIN = 12;
12
12
  const GULPEASE_BANDS = { easyMin: 80, okMin: 60 };
13
- const MIN_WORDS_FOR_CONFIDENCE = 30;
13
+ const MIN_WORDS_FOR_CONFIDENCE = 5;
14
14
  function mapLang(langcode) {
15
15
  const lc = (langcode || "").toLowerCase();
16
16
  if (lc.startsWith("de")) return "de_CH";
@@ -70,22 +70,48 @@ function summarizeImpact(nodes) {
70
70
  function format(n, d = 1) {
71
71
  return typeof n === "number" && Number.isFinite(n) ? n.toFixed(d) : "\u2014";
72
72
  }
73
- function analyzeReadability(tr, blocks, langcode, $t) {
73
+ function analyzeReadability(tr, blocks, langcode, $t, cache) {
74
74
  const lang = langcode ?? "en";
75
75
  const nodes = [];
76
76
  for (const b of blocks) {
77
77
  const text = (b.text || "").trim();
78
78
  if (!text) continue;
79
79
  const words = segmentWords(text);
80
- if (words.length < MIN_WORDS_FOR_CONFIDENCE) continue;
81
- const sentences = Math.max(1, countSentences(text));
82
- const avgSentLen = words.length / sentences;
83
- const lix = safe(() => tr.lix(text));
84
- const cli = safe(() => tr.colemanLiauIndex(text));
85
- const ari = safe(() => tr.automatedReadabilityIndex(text));
86
- const gulpease = lang === "it" ? safe(() => tr.gulpeaseIndex(text)) : void 0;
87
- const band = toBand(lang, { lix, cli, ari, gulpease });
88
- if (band !== "hard") continue;
80
+ if (words.length < MIN_WORDS_FOR_CONFIDENCE) {
81
+ continue;
82
+ }
83
+ const cacheKey = `${langcode}:${text}`;
84
+ let scores;
85
+ const cached = cache.get(cacheKey);
86
+ if (cached) {
87
+ scores = cached;
88
+ } else {
89
+ const sentences = Math.max(1, countSentences(text));
90
+ const avgSentLen = words.length / sentences;
91
+ const lix = safe(() => tr.lix(text));
92
+ const cli = safe(() => tr.colemanLiauIndex(text));
93
+ const ari = safe(() => tr.automatedReadabilityIndex(text));
94
+ const gulpease = lang === "it" ? safe(() => tr.gulpeaseIndex(text)) : void 0;
95
+ scores = {
96
+ lix,
97
+ cli,
98
+ ari,
99
+ gulpease,
100
+ words: words.length,
101
+ sentences,
102
+ avgSentLen
103
+ };
104
+ cache.set(cacheKey, scores);
105
+ }
106
+ const band = toBand(lang, {
107
+ lix: scores.lix,
108
+ cli: scores.cli,
109
+ ari: scores.ari,
110
+ gulpease: scores.gulpease
111
+ });
112
+ if (band !== "hard") {
113
+ continue;
114
+ }
89
115
  const parts = [];
90
116
  parts.push(
91
117
  $t("analyzerReadabiliyHardToRead", `Hard to read (@lang).`).replace(
@@ -93,16 +119,21 @@ function analyzeReadability(tr, blocks, langcode, $t) {
93
119
  lang.toUpperCase()
94
120
  )
95
121
  );
96
- if (lix != null) parts.push(`LIX ${format(lix)}`);
97
- if (lang === "it" && gulpease != null)
98
- parts.push(`Gulpease ${format(gulpease)}`);
99
- if (cli != null) parts.push(`CLI ${format(cli)}`);
100
- if (avgSentLen > 25) {
122
+ if (scores.lix != null) {
123
+ parts.push(`LIX ${format(scores.lix)}`);
124
+ }
125
+ if (lang === "it" && scores.gulpease != null) {
126
+ parts.push(`Gulpease ${format(scores.gulpease)}`);
127
+ }
128
+ if (scores.cli != null) {
129
+ parts.push(`CLI ${format(scores.cli)}`);
130
+ }
131
+ if (scores.avgSentLen > 25) {
101
132
  parts.push(
102
133
  $t(
103
134
  "analyzerReadabiliyAverageSentenceLength",
104
135
  `Average sentence length @length \u2192 split sentences.`
105
- ).replace("@length", format(avgSentLen))
136
+ ).replace("@length", format(scores.avgSentLen))
106
137
  );
107
138
  } else {
108
139
  parts.push(
@@ -114,7 +145,7 @@ function analyzeReadability(tr, blocks, langcode, $t) {
114
145
  }
115
146
  nodes.push({
116
147
  description: parts.join(" \xB7 "),
117
- impact: impactFor(lix),
148
+ impact: impactFor(scores.lix),
118
149
  targets: [b.element]
119
150
  });
120
151
  }
@@ -142,8 +173,16 @@ function safe(fn) {
142
173
  }
143
174
  export default defineAnalyzer(() => {
144
175
  let textReadability = null;
176
+ const cache = /* @__PURE__ */ new Map();
145
177
  return {
146
178
  id: "readability",
179
+ label: (langcode) => {
180
+ if (langcode === "de") {
181
+ return "Lesbarkeit";
182
+ }
183
+ return "Readability";
184
+ },
185
+ continuous: true,
147
186
  init: function(context) {
148
187
  textReadability = new TextReadability({
149
188
  lang: mapLang(context.langcode),
@@ -154,11 +193,13 @@ export default defineAnalyzer(() => {
154
193
  if (!isSupportedLangcode(context.langcode)) {
155
194
  return;
156
195
  }
196
+ const elements = context.getTextElements();
157
197
  return analyzeReadability(
158
198
  textReadability,
159
- context.getTextElements(),
199
+ elements,
160
200
  context.langcode,
161
- context.$t
201
+ context.$t,
202
+ cache
162
203
  );
163
204
  }
164
205
  };
@@ -5,6 +5,10 @@ export type AnalyzeCategory = 'accessibility' | 'seo' | 'text' | 'content';
5
5
  export type AnalyzeNodeTarget = string | HTMLElement | {
6
6
  uuid: string;
7
7
  };
8
+ export type AnalyzeNodeTargetMapped = {
9
+ target: AnalyzeNodeTarget;
10
+ globalIndex: number;
11
+ };
8
12
  export type AnalyzeNode = {
9
13
  description?: string;
10
14
  impact?: AnalyzeImpact;
@@ -16,6 +20,9 @@ export type AnalyzeNode = {
16
20
  */
17
21
  targets: AnalyzeNodeTarget | AnalyzeNodeTarget[];
18
22
  };
23
+ export type AnalyzeNodeMapped = Omit<AnalyzeNode, 'targets'> & {
24
+ targets: AnalyzeNodeTargetMapped[];
25
+ };
19
26
  export type AnalyzeResult = {
20
27
  id: string;
21
28
  title: string;
@@ -30,15 +37,22 @@ export type AnalyzeResult = {
30
37
  */
31
38
  scoreTargets?: boolean;
32
39
  };
33
- export type AnalyzeResultMapped = AnalyzeResult & {
40
+ export type AnalyzeResultMapped = Omit<AnalyzeResult, 'nodes'> & {
34
41
  plugin: string;
42
+ nodes: AnalyzeNodeMapped[];
35
43
  };
36
44
  export type Analyzer = {
37
45
  id: string;
46
+ label?: string | ((langcode: string) => string);
38
47
  /**
39
48
  * If true, the raw page (without editor UI) is required for this analyzer.
40
49
  */
41
50
  requireRawPage?: boolean;
51
+ /**
52
+ * If true, the analyzer is called automatically. This assumes it runs without
53
+ * blocking the main thread.
54
+ */
55
+ continuous?: boolean;
42
56
  init?: (context: AnalyzerContext) => void | Promise<void>;
43
57
  run: (context: AnalyzerContext) => undefined | null | AnalyzeResult | AnalyzeResult[] | Promise<undefined | null | AnalyzeResult | AnalyzeResult[]>;
44
58
  };
@@ -4,9 +4,27 @@
4
4
  :title="$t('analyzeSidebarTitle', 'Analyze')"
5
5
  :tour-text="$t('analyzeTourText', 'Analyze the content of your page')"
6
6
  icon="speedometer"
7
+ weight="10"
8
+ :is-loading="isRunning"
7
9
  >
10
+ <template #icon>
11
+ <AnalyzeIcon :is-running />
12
+ </template>
13
+ <div v-if="ui.isProxyMode.value" class="bk-sidebar-padding bk">
14
+ <InfoBox
15
+ :text="
16
+ $t(
17
+ 'analyzeNotAvailableInStructureView',
18
+ 'Analyze is not available in structure view.'
19
+ )
20
+ "
21
+ icon="tree"
22
+ />
23
+ </div>
8
24
  <AnalyzerMain
25
+ v-else
9
26
  :key="animation.renderKey.value"
27
+ v-model="isRunning"
10
28
  :langcode="context.language"
11
29
  :analyzers
12
30
  />
@@ -14,9 +32,11 @@
14
32
  </template>
15
33
 
16
34
  <script setup>
17
- import { useBlokkli, defineBlokkliFeature } from "#imports";
35
+ import { useBlokkli, defineBlokkliFeature, ref } from "#imports";
18
36
  import { PluginSidebar } from "#blokkli/plugins";
37
+ import { InfoBox } from "#blokkli/components";
19
38
  import AnalyzerMain from "./Main.vue";
39
+ import AnalyzeIcon from "./Icon.vue";
20
40
  const { adapter } = defineBlokkliFeature({
21
41
  id: "analyze",
22
42
  label: "Analyze",
@@ -25,6 +45,8 @@ const { adapter } = defineBlokkliFeature({
25
45
  description: "Analyze blocks and page for SEO, accessibility, etc.",
26
46
  viewports: []
27
47
  });
48
+ const { $t, context, animation, ui } = useBlokkli();
49
+ const isRunning = ref(false);
28
50
  function getAdapterAnalyzers() {
29
51
  const result = adapter.getAnalyzers();
30
52
  if (Array.isArray(result)) {
@@ -38,7 +60,6 @@ function getAdapterAnalyzers() {
38
60
  });
39
61
  }
40
62
  const analyzers = await getAdapterAnalyzers();
41
- const { $t, context, animation } = useBlokkli();
42
63
  </script>
43
64
 
44
65
  <script>
@@ -18,14 +18,16 @@
18
18
  </template>
19
19
 
20
20
  <script setup>
21
- import { overview } from "artboard-deluxe";
21
+ import {
22
+ overview
23
+ } from "artboard-deluxe";
22
24
  import {
23
25
  onBeforeUnmount,
24
26
  onMounted,
25
- ref,
26
27
  useBlokkli,
27
28
  computed,
28
- useTemplateRef
29
+ useTemplateRef,
30
+ watch
29
31
  } from "#imports";
30
32
  import { ViewportBlockingRect } from "#blokkli/components";
31
33
  import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
@@ -40,9 +42,9 @@ const selectedColor = computed(() => {
40
42
  return theme.getColorString("accent", "700", 1);
41
43
  });
42
44
  const overviewEl = useTemplateRef("overviewEl");
43
- const overviewArtboardEl = ref();
44
- const overviewVisibleEl = ref();
45
- const canvas = ref();
45
+ const overviewArtboardEl = useTemplateRef("overviewArtboardEl");
46
+ const overviewVisibleEl = useTemplateRef("overviewVisibleEl");
47
+ const canvas = useTemplateRef("canvas");
46
48
  let pluginOverview = null;
47
49
  function updateCanvas() {
48
50
  const ctx = canvas.value?.getContext("2d");
@@ -78,6 +80,13 @@ function updateCanvas() {
78
80
  }
79
81
  }
80
82
  onBlokkliEvent("animationFrame", updateCanvas);
83
+ const overviewOptions = computed(() => {
84
+ return {
85
+ padding: 15,
86
+ autoHeight: true,
87
+ maxHeight: ui.visibleViewportPadded.value.height
88
+ };
89
+ });
81
90
  onMounted(() => {
82
91
  if (overviewEl.value && overviewArtboardEl.value && overviewVisibleEl.value) {
83
92
  const el = overviewEl.value.$el;
@@ -87,13 +96,18 @@ onMounted(() => {
87
96
  element: el,
88
97
  artboardElement: overviewArtboardEl.value,
89
98
  visibleAreaElement: overviewVisibleEl.value,
90
- padding: 20,
91
- autoHeight: true
99
+ ...overviewOptions.value
92
100
  })
93
101
  );
94
102
  }
95
103
  }
96
104
  });
105
+ watch(overviewOptions, (newOptions) => {
106
+ if (!pluginOverview) {
107
+ return;
108
+ }
109
+ pluginOverview.options.setMultiple(newOptions);
110
+ });
97
111
  onBeforeUnmount(() => {
98
112
  if (pluginOverview) {
99
113
  props.artboard.removePlugin(pluginOverview);
@@ -38,7 +38,10 @@
38
38
  key-code="O"
39
39
  weight="90"
40
40
  >
41
- <Teleport v-if="isActive && dom.isReady.value" to="body">
41
+ <Teleport
42
+ v-if="isActive && dom.isReady.value"
43
+ :to="ui.mainLayoutElement.value"
44
+ >
42
45
  <Overview :artboard="artboard" />
43
46
  </Teleport>
44
47
  </PluginViewOption>
@@ -68,7 +71,7 @@ import {
68
71
  mouse,
69
72
  dom as domPlugin
70
73
  } from "artboard-deluxe";
71
- import { addElementClasses } from "#blokkli/helpers/addElementClasses";
74
+ import { addElementClasses } from "#blokkli/helpers/composables/addElementClasses";
72
75
  const props = defineProps({
73
76
  persist: { type: Boolean, required: true },
74
77
  momentum: { type: Boolean, required: true },
@@ -166,45 +169,63 @@ watch(options, function(newOptions) {
166
169
  const AUTOSCROLL_EDGE_ZONE = 130;
167
170
  const AUTOSCROLL_SPEED = 12;
168
171
  let autoScrollSpeed = 1;
172
+ let lastScrollDirection = 0;
169
173
  function edgeStep(distance) {
170
174
  const ratio = distance / AUTOSCROLL_EDGE_ZONE;
171
175
  return Math.pow(ratio, 3) * AUTOSCROLL_SPEED;
172
176
  }
173
177
  let hasLeftAddList = false;
178
+ let hasLeftEdgeZone = false;
174
179
  onBlokkliEvent("dragging:end", () => {
175
180
  hasLeftAddList = false;
181
+ hasLeftEdgeZone = false;
182
+ autoScrollSpeed = 1;
183
+ lastScrollDirection = 0;
176
184
  });
177
- onBlokkliEvent("animationFrame:before", ({ time, mouseY, mouseX }) => {
185
+ function handleAutoScroll(mouseX, mouseY) {
178
186
  if (selection.isDragging.value) {
179
- if (ui.addListOrientation.value === "horizontal") {
180
- if (!hasLeftAddList) {
181
- if (isInsideRect(mouseX, mouseY, ui.visibleViewportPadded.value)) {
182
- hasLeftAddList = true;
183
- } else {
184
- return;
185
- }
187
+ if (!hasLeftAddList) {
188
+ if (isInsideRect(mouseX, mouseY, ui.visibleViewportPadded.value)) {
189
+ hasLeftAddList = true;
190
+ } else {
191
+ return;
186
192
  }
187
193
  }
188
- const viewportHeight = ui.viewport.value.height;
194
+ const viewportHeight = ui.visibleViewport.value.height;
189
195
  const currentOffset = artboard.getOffset();
190
- const y = Math.min(Math.max(mouseY, 0), viewportHeight);
196
+ const y = Math.min(
197
+ Math.max(mouseY - ui.visibleViewport.value.y, 0),
198
+ viewportHeight
199
+ );
200
+ const isInEdgeZone = y < AUTOSCROLL_EDGE_ZONE || y > viewportHeight - AUTOSCROLL_EDGE_ZONE;
201
+ if (!isInEdgeZone && !hasLeftEdgeZone) {
202
+ hasLeftEdgeZone = true;
203
+ }
191
204
  let dy = 0;
192
- if (y < AUTOSCROLL_EDGE_ZONE) {
193
- const dist = AUTOSCROLL_EDGE_ZONE - y;
194
- dy = edgeStep(dist);
195
- } else if (y > viewportHeight - AUTOSCROLL_EDGE_ZONE) {
196
- const dist = y - (viewportHeight - AUTOSCROLL_EDGE_ZONE);
197
- dy = -edgeStep(dist);
198
- } else {
205
+ let currentDirection = 0;
206
+ if (hasLeftEdgeZone && isInEdgeZone) {
207
+ if (y < AUTOSCROLL_EDGE_ZONE) {
208
+ const dist = AUTOSCROLL_EDGE_ZONE - y;
209
+ dy = edgeStep(dist);
210
+ currentDirection = 1;
211
+ } else if (y > viewportHeight - AUTOSCROLL_EDGE_ZONE) {
212
+ const dist = y - (viewportHeight - AUTOSCROLL_EDGE_ZONE);
213
+ dy = -edgeStep(dist);
214
+ currentDirection = -1;
215
+ }
216
+ }
217
+ if (currentDirection !== 0 && currentDirection !== lastScrollDirection) {
199
218
  autoScrollSpeed = 1;
219
+ lastScrollDirection = currentDirection;
200
220
  }
201
221
  if (dy !== 0) {
202
222
  artboard.setOffset(null, currentOffset.y + dy * autoScrollSpeed);
203
223
  autoScrollSpeed = Math.min(autoScrollSpeed * 1.01, 2.25);
204
224
  }
205
- } else {
206
- autoScrollSpeed = 1;
207
225
  }
226
+ }
227
+ onBlokkliEvent("animationFrame:before", ({ time, mouseY, mouseX }) => {
228
+ handleAutoScroll(mouseX, mouseY);
208
229
  artboard.loop(time);
209
230
  const artboardSize = artboard.getArtboardSize();
210
231
  if (artboardSize) {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <Teleport to="body">
2
+ <Teleport :to="ui.mainLayoutElement.value" defer>
3
3
  <div
4
4
  class="bk bk-artboard-scrollbar"
5
5
  :class="'bk-orientation-' + orientation"
@@ -13,13 +13,19 @@
13
13
 
14
14
  <script setup>
15
15
  import { scrollbar } from "artboard-deluxe";
16
- import { onBeforeUnmount, onMounted, ref } from "#imports";
16
+ import {
17
+ onBeforeUnmount,
18
+ onMounted,
19
+ useBlokkli,
20
+ useTemplateRef
21
+ } from "#imports";
17
22
  const props = defineProps({
18
23
  artboard: { type: Object, required: true },
19
24
  orientation: { type: String, required: true }
20
25
  });
21
- const el = ref();
22
- const thumb = ref();
26
+ const { ui } = useBlokkli();
27
+ const el = useTemplateRef("el");
28
+ const thumb = useTemplateRef("thumb");
23
29
  let scrollbarPlugin = null;
24
30
  onMounted(() => {
25
31
  if (el.value && thumb.value) {
@@ -68,37 +68,11 @@ import { useBlokkli, ref } from "#imports";
68
68
  import ResultMarkup from "./ResultMarkup/index.vue";
69
69
  const { $t, adapter } = useBlokkli();
70
70
  const emit = defineEmits(["close", "submit"]);
71
- const prompt = ref(
72
- `Write content for a page talking about VueJS. Please come up with good titles and content for each section.
73
-
74
- # Origins
75
- Write about when Vue was created and by whom.
76
-
77
- # Release of Vue 2
78
- When was it released, what were the changes.
79
-
80
- # Release of Vue 3
81
- Write about the big changes introduced in Vue 3.
82
-
83
- # Comparison to React
84
- `
85
- );
71
+ const prompt = ref("");
86
72
  const isGenerating = ref(false);
87
73
  const result = ref({
88
74
  type: "markup",
89
- content: `
90
- <h2>Origins</h2>
91
- <p>Vue was created in 2014 by Evan You, a former Google engineer. It was initially released to the public in February 2014.</p>
92
-
93
- <h2>Release of Vue 2</h2>
94
- <p>Vue 2 was released in September 2016. This release introduced significant improvements in performance and the virtual DOM implementation, making Vue even more efficient and capable.</p>
95
-
96
- <h2>Release of Vue 3</h2>
97
- <p>Vue 3, released in September 2020, brought several major changes, including the composition API, better TypeScript integration, and significant improvements in terms of performance, tree-shaking, and the overall developer experience.</p>
98
-
99
- <h2>Comparison to React</h2>
100
- <p>Vue is often compared to React due to their shared focus on building user interfaces. While React is developed and maintained by Facebook, Vue is an open-source project led by Evan You. Both frameworks have their strengths and weaknesses, and the choice between them often depends on the specific requirements of a project and the preferences of the development team.</p>
101
- `
75
+ content: ""
102
76
  });
103
77
  const onSubmit = () => {
104
78
  if (!result.value) {
@@ -1,25 +1,14 @@
1
1
  <template>
2
- <Teleport to="body">
2
+ <Teleport :to="ui.mainLayoutElement.value">
3
3
  <BlokkliTransition name="slide-in">
4
4
  <Overlay v-if="placedAction" @close="onClose" @submit="onSubmit" />
5
5
  </BlokkliTransition>
6
6
  </Teleport>
7
-
8
- <PluginAddAction
9
- type="assistant"
10
- :title="$t('assistantAddAction', 'Add with AI Assistant')"
11
- :description="
12
- $t('assistantAddActionDescription', 'Add content using an AI assistant.')
13
- "
14
- icon="robot"
15
- color="rose"
16
- @placed="placedAction = $event"
17
- />
18
7
  </template>
19
8
 
20
9
  <script setup>
21
10
  import { useBlokkli, defineBlokkliFeature, ref } from "#imports";
22
- import { PluginAddAction } from "#blokkli/plugins";
11
+ import defineAddAction from "#blokkli/helpers/composables/defineAddAction";
23
12
  import { BlokkliTransition } from "#blokkli/components";
24
13
  import Overlay from "./Overlay/index.vue";
25
14
  const { adapter } = defineBlokkliFeature({
@@ -34,7 +23,7 @@ const { adapter } = defineBlokkliFeature({
34
23
  screenshot: "feature-assistant.jpg",
35
24
  dependencies: ["add-list"]
36
25
  });
37
- const { state, $t } = useBlokkli();
26
+ const { state, $t, ui } = useBlokkli();
38
27
  const placedAction = ref(null);
39
28
  const onClose = () => {
40
29
  placedAction.value = null;
@@ -52,6 +41,21 @@ const onSubmit = async (result) => {
52
41
  }
53
42
  onClose();
54
43
  };
44
+ defineAddAction(() => {
45
+ return {
46
+ id: "assistant",
47
+ title: $t("assistantAddAction", "Add with AI Assistant"),
48
+ description: $t(
49
+ "assistantAddActionDescription",
50
+ "Add content using an AI assistant."
51
+ ),
52
+ icon: "robot",
53
+ color: "rose",
54
+ callback: (data) => {
55
+ placedAction.value = data;
56
+ }
57
+ };
58
+ });
55
59
  </script>
56
60
 
57
61
  <script>