@blokkli/editor 2.0.0-alpha.54 → 2.0.0-alpha.56

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 (214) hide show
  1. package/dist/global/constants/index.d.ts +1 -1
  2. package/dist/global/constants/index.js +1 -1
  3. package/dist/global/types/features.d.ts +5 -9
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +28 -35
  6. package/dist/modules/agent/index.mjs +46 -29
  7. package/dist/modules/agent/runtime/app/composables/agentProvider.js +2 -1
  8. package/dist/modules/agent/runtime/app/features/agent/Container.d.vue.ts +19 -0
  9. package/dist/modules/agent/runtime/app/features/agent/Container.vue +195 -0
  10. package/dist/modules/agent/runtime/app/features/agent/Container.vue.d.ts +19 -0
  11. package/dist/modules/agent/runtime/app/features/agent/index.vue +18 -164
  12. package/dist/modules/agent/runtime/app/features/agent/types.d.ts +9 -0
  13. package/dist/modules/agent/runtime/app/helpers/index.d.ts +7 -3
  14. package/dist/modules/agent/runtime/app/helpers/index.js +9 -3
  15. package/dist/modules/agent/runtime/app/prompts/fixReadability.js +51 -44
  16. package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -1
  17. package/dist/modules/agent/runtime/app/tools/check_readability/index.js +1 -0
  18. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +1 -1
  19. package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +6 -1
  20. package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.js +1 -0
  21. package/dist/modules/agent/runtime/app/types/index.d.ts +12 -0
  22. package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +34 -18
  23. package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +7 -0
  24. package/dist/modules/drupal/graphql/features/droppable-field-items.graphql +22 -0
  25. package/dist/modules/drupal/graphql/features/import-existing.graphql +0 -25
  26. package/dist/modules/drupal/graphql/features/workspace.graphql +9 -2
  27. package/dist/modules/drupal/graphql/mutations/update_droppable_field.graphql +21 -0
  28. package/dist/modules/drupal/index.mjs +6 -2
  29. package/dist/modules/drupal/runtime/adapter/index.js +75 -39
  30. package/dist/modules/readability/index.d.mts +11 -0
  31. package/dist/modules/readability/index.mjs +17 -0
  32. package/dist/modules/readability/runtime/adapter-extension.d.ts +2 -0
  33. package/dist/modules/readability/runtime/adapter-extension.js +5 -0
  34. package/dist/modules/readability/runtime/analyzers/builtin.d.ts +10 -0
  35. package/dist/modules/readability/runtime/analyzers/builtin.js +340 -0
  36. package/dist/runtime/components/BlokkliEditable.vue +10 -90
  37. package/dist/runtime/components/BlokkliItem.vue +2 -2
  38. package/dist/runtime/components/BlokkliProvider.vue +11 -5
  39. package/dist/runtime/composables/defineBlokkli.js +3 -1
  40. package/dist/runtime/composables/defineBlokkliFeature.d.ts +2 -3
  41. package/dist/runtime/editor/components/Actions/index.vue +1 -1
  42. package/dist/runtime/editor/components/AnimationCanvas/index.vue +41 -6
  43. package/dist/runtime/editor/components/AppMenu/Inner.d.vue.ts +7 -0
  44. package/dist/runtime/editor/components/AppMenu/Inner.vue +83 -0
  45. package/dist/runtime/editor/components/AppMenu/Inner.vue.d.ts +7 -0
  46. package/dist/runtime/editor/components/AppMenu/index.vue +5 -79
  47. package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
  48. package/dist/runtime/editor/components/ArtboardTooltip/index.vue +9 -1
  49. package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
  50. package/dist/runtime/editor/components/BlockPreviewItem/index.vue +12 -6
  51. package/dist/runtime/editor/components/BlokkliEditableEdit.d.vue.ts +23 -0
  52. package/dist/runtime/editor/components/BlokkliEditableEdit.vue +95 -0
  53. package/dist/runtime/editor/components/BlokkliEditableEdit.vue.d.ts +23 -0
  54. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.d.vue.ts +4 -1
  55. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +4 -1
  56. package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue.d.ts +4 -1
  57. package/dist/runtime/editor/components/BundleSelector/index.vue +10 -5
  58. package/dist/runtime/editor/components/Dialog/index.vue +0 -77
  59. package/dist/runtime/editor/components/EditIndicator.d.vue.ts +1 -0
  60. package/dist/runtime/editor/components/EditIndicator.vue +3 -2
  61. package/dist/runtime/editor/components/EditIndicator.vue.d.ts +1 -0
  62. package/dist/runtime/editor/components/EditProvider.d.vue.ts +3 -1
  63. package/dist/runtime/editor/components/EditProvider.vue +13 -4
  64. package/dist/runtime/editor/components/EditProvider.vue.d.ts +3 -1
  65. package/dist/runtime/editor/components/FeaturesRenderer/index.vue +1 -4
  66. package/dist/runtime/editor/components/Form/Text/index.d.vue.ts +5 -0
  67. package/dist/runtime/editor/components/Form/Text/index.vue +10 -4
  68. package/dist/runtime/editor/components/Form/Text/index.vue.d.ts +5 -0
  69. package/dist/runtime/editor/components/FormOverlay/index.vue +0 -24
  70. package/dist/runtime/editor/components/GrowOnly/index.d.vue.ts +10 -0
  71. package/dist/runtime/editor/components/GrowOnly/index.vue +34 -0
  72. package/dist/runtime/editor/components/GrowOnly/index.vue.d.ts +10 -0
  73. package/dist/runtime/editor/components/Konami/Game/index.vue +120 -0
  74. package/dist/runtime/editor/components/Konami/index.vue +7 -124
  75. package/dist/runtime/editor/components/Loading/index.vue +1 -1
  76. package/dist/runtime/editor/components/PluginConfigForm/Text/index.vue +1 -0
  77. package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -0
  78. package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +3 -1
  79. package/dist/runtime/editor/components/PreviewProvider.vue +6 -1
  80. package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +3 -1
  81. package/dist/runtime/editor/components/index.d.ts +11 -10
  82. package/dist/runtime/editor/components/index.js +32 -10
  83. package/dist/runtime/editor/composables/defineRenderer.d.ts +2 -2
  84. package/dist/runtime/editor/composables/defineRenderer.js +8 -3
  85. package/dist/runtime/editor/css/output.css +1 -1
  86. package/dist/runtime/editor/events/index.d.ts +6 -0
  87. package/dist/runtime/editor/features/analyze/Main.d.vue.ts +1 -0
  88. package/dist/runtime/editor/features/analyze/Main.vue +9 -8
  89. package/dist/runtime/editor/features/analyze/Main.vue.d.ts +1 -0
  90. package/dist/runtime/editor/features/analyze/Results/ResultsItem.vue +7 -15
  91. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +4 -2
  92. package/dist/runtime/editor/features/analyze/analyzers/axe.js +9 -9
  93. package/dist/runtime/editor/features/analyze/analyzers/readability.js +7 -7
  94. package/dist/runtime/editor/features/analyze/index.vue +26 -26
  95. package/dist/runtime/editor/features/analyze/readability/types.d.ts +18 -14
  96. package/dist/runtime/editor/features/anchors/index.vue +6 -2
  97. package/dist/runtime/editor/features/artboard/Renderer.vue +3 -2
  98. package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +78 -0
  99. package/dist/runtime/editor/features/block-scheduler/index.vue +34 -89
  100. package/dist/runtime/editor/features/breadcrumbs/index.vue +2 -2
  101. package/dist/runtime/editor/features/changelog/changelog.json +8 -0
  102. package/dist/runtime/editor/features/changelog/index.vue +10 -8
  103. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +152 -0
  104. package/dist/runtime/editor/features/clipboard/index.vue +13 -159
  105. package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -28
  106. package/dist/runtime/editor/features/command-palette/Palette/index.vue +17 -6
  107. package/dist/runtime/editor/features/command-palette/index.vue +7 -2
  108. package/dist/runtime/editor/features/comments/index.vue +6 -3
  109. package/dist/runtime/editor/features/debug/Main.vue +168 -0
  110. package/dist/runtime/editor/features/debug/Section/Features.vue +1 -2
  111. package/dist/runtime/editor/features/debug/index.vue +6 -170
  112. package/dist/runtime/editor/features/dev-mode/index.vue +2 -1
  113. package/dist/runtime/editor/features/diff/index.vue +6 -2
  114. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +15 -16
  115. package/dist/runtime/editor/features/dragging-overlay/index.vue +4 -3
  116. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.d.vue.ts +15 -0
  117. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +547 -0
  118. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue.d.ts +15 -0
  119. package/dist/runtime/editor/features/droppable-field-edit/index.d.vue.ts +3 -0
  120. package/dist/runtime/editor/features/droppable-field-edit/index.vue +231 -0
  121. package/dist/runtime/editor/features/droppable-field-edit/index.vue.d.ts +3 -0
  122. package/dist/runtime/editor/features/droppable-field-edit/types.d.ts +70 -0
  123. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +2 -2
  124. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +2 -2
  125. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
  126. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +6 -13
  127. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +3 -4
  128. package/dist/runtime/editor/features/fragments/index.vue +9 -4
  129. package/dist/runtime/editor/features/help/index.vue +7 -2
  130. package/dist/runtime/editor/features/highlights/Renderer/index.vue +11 -17
  131. package/dist/runtime/editor/features/history/index.vue +3 -2
  132. package/dist/runtime/editor/features/hover/Renderer/index.vue +87 -36
  133. package/dist/runtime/editor/features/hover/Renderer/vertex.glsl +5 -5
  134. package/dist/runtime/editor/features/hover/index.vue +1 -1
  135. package/dist/runtime/editor/features/import-existing/Dialog/Item.d.vue.ts +5 -0
  136. package/dist/runtime/editor/features/import-existing/Dialog/Item.vue +55 -0
  137. package/dist/runtime/editor/features/import-existing/Dialog/Item.vue.d.ts +5 -0
  138. package/dist/runtime/editor/features/import-existing/Dialog/index.d.vue.ts +7 -3
  139. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +107 -65
  140. package/dist/runtime/editor/features/import-existing/Dialog/index.vue.d.ts +7 -3
  141. package/dist/runtime/editor/features/import-existing/index.vue +19 -6
  142. package/dist/runtime/editor/features/import-existing/types.d.ts +0 -11
  143. package/dist/runtime/editor/features/library/ReusableDialog/index.vue +7 -33
  144. package/dist/runtime/editor/features/library/index.vue +14 -5
  145. package/dist/runtime/editor/features/media-library/Library/index.vue +3 -1
  146. package/dist/runtime/editor/features/media-library/index.vue +9 -2
  147. package/dist/runtime/editor/features/media-library/types.d.ts +2 -0
  148. package/dist/runtime/editor/features/multi-select/Renderer/index.vue +16 -15
  149. package/dist/runtime/editor/features/multi-select/index.vue +9 -3
  150. package/dist/runtime/editor/features/options/Form/Radios/index.vue +4 -8
  151. package/dist/runtime/editor/features/options/index.vue +7 -2
  152. package/dist/runtime/editor/features/preview-grant/index.vue +8 -2
  153. package/dist/runtime/editor/features/publish/index.vue +3 -2
  154. package/dist/runtime/editor/features/referenced-entities/index.vue +7 -2
  155. package/dist/runtime/editor/features/responsive-preview/index.vue +13 -11
  156. package/dist/runtime/editor/features/search/index.vue +6 -2
  157. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +6 -11
  158. package/dist/runtime/editor/features/selection/Renderer/index.vue +9 -14
  159. package/dist/runtime/editor/features/selection/index.vue +7 -4
  160. package/dist/runtime/editor/features/settings/index.vue +8 -3
  161. package/dist/runtime/editor/features/structure/index.vue +3 -2
  162. package/dist/runtime/editor/features/templates/CreateDialog/index.vue +1 -0
  163. package/dist/runtime/editor/features/templates/index.vue +14 -6
  164. package/dist/runtime/editor/features/theme/index.vue +2 -1
  165. package/dist/runtime/editor/features/tour/index.vue +6 -2
  166. package/dist/runtime/editor/features/translations/index.vue +7 -4
  167. package/dist/runtime/editor/features/workspace/Overlay/Item.d.vue.ts +3 -0
  168. package/dist/runtime/editor/features/workspace/Overlay/Item.vue +49 -0
  169. package/dist/runtime/editor/features/workspace/Overlay/Item.vue.d.ts +3 -0
  170. package/dist/runtime/editor/features/workspace/Overlay/index.vue +16 -104
  171. package/dist/runtime/editor/features/workspace/index.vue +6 -2
  172. package/dist/runtime/editor/helpers/webgl/index.d.ts +3 -2
  173. package/dist/runtime/editor/helpers/webgl/index.js +2 -3
  174. package/dist/runtime/editor/libraries/fzf.d.ts +3 -0
  175. package/dist/runtime/editor/libraries/fzf.js +7 -0
  176. package/dist/runtime/editor/libraries/twgl.d.ts +10 -0
  177. package/dist/runtime/editor/libraries/twgl.js +14 -0
  178. package/dist/runtime/editor/plugins/DebugOverlay/index.vue +3 -1
  179. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +39 -18
  180. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -0
  181. package/dist/runtime/editor/plugins/Sidebar/index.vue +12 -4
  182. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -0
  183. package/dist/runtime/editor/providers/animation.d.ts +5 -10
  184. package/dist/runtime/editor/providers/animation.js +10 -8
  185. package/dist/runtime/editor/providers/directive.d.ts +11 -0
  186. package/dist/runtime/editor/providers/directive.js +16 -0
  187. package/dist/runtime/editor/providers/features.d.ts +3 -3
  188. package/dist/runtime/editor/providers/features.js +1 -1
  189. package/dist/runtime/editor/providers/fieldValue.d.ts +27 -0
  190. package/dist/runtime/editor/providers/fieldValue.js +21 -1
  191. package/dist/runtime/editor/providers/keyboard.js +6 -3
  192. package/dist/runtime/editor/providers/readability.d.ts +28 -4
  193. package/dist/runtime/editor/providers/readability.js +30 -46
  194. package/dist/runtime/editor/providers/selection.d.ts +8 -0
  195. package/dist/runtime/editor/providers/selection.js +6 -0
  196. package/dist/runtime/editor/providers/texts.d.ts +1 -3
  197. package/dist/runtime/editor/providers/texts.js +34 -37
  198. package/dist/runtime/editor/providers/workspaces.d.ts +93 -0
  199. package/dist/runtime/editor/providers/workspaces.js +76 -0
  200. package/dist/runtime/editor/translations/de.json +918 -3616
  201. package/dist/runtime/editor/translations/fr.json +250 -3616
  202. package/dist/runtime/editor/translations/gsw_CH.json +918 -3616
  203. package/dist/runtime/editor/translations/it.json +250 -3616
  204. package/dist/runtime/editor/types/app.d.ts +2 -0
  205. package/dist/runtime/editor/types/features.d.ts +1 -1
  206. package/dist/runtime/editor/types/state.d.ts +7 -0
  207. package/dist/runtime/helpers/injections.d.ts +6 -0
  208. package/dist/runtime/helpers/injections.js +3 -0
  209. package/dist/runtime/types/definitions.d.ts +4 -0
  210. package/package.json +14 -4
  211. package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.d.ts +0 -6
  212. package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.js +0 -216
  213. package/dist/runtime/editor/features/workspace/types.d.ts +0 -59
  214. /package/dist/runtime/editor/features/{workspace → droppable-field-edit}/types.js +0 -0
@@ -37,6 +37,11 @@ export type EditableFieldFocusEvent = {
37
37
  fieldName: string;
38
38
  uuid?: string;
39
39
  };
40
+ export type DroppableFieldOpenEvent = {
41
+ fieldName: string;
42
+ uuid: string;
43
+ entityType: string;
44
+ };
40
45
  export type EditableFieldUpdateEvent = {
41
46
  name: string;
42
47
  entityUuid: string;
@@ -236,6 +241,7 @@ export interface EventbusEvents {
236
241
  'editable:focus': EditableFieldFocusEvent;
237
242
  'editable:update': EditableFieldUpdateEvent;
238
243
  'editable:save': undefined;
244
+ 'droppable:open': DroppableFieldOpenEvent;
239
245
  'drop:clipboardItem': DropClipboardItemEvent;
240
246
  'sidebar:close': undefined;
241
247
  'sidebar:open': string;
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  langcode: string;
4
4
  analyze: AnalyzeProvider;
5
5
  isShown: boolean;
6
+ shouldRender: boolean;
6
7
  };
7
8
  type __VLS_ModelProps = {
8
9
  modelValue?: boolean;
@@ -53,7 +53,7 @@
53
53
  </p>
54
54
  </div>
55
55
 
56
- <div v-if="results.length" class="bk-analyze-wrapper">
56
+ <div v-if="results.length && shouldRender" class="bk-analyze-wrapper">
57
57
  <div v-if="categoryOptions.length > 2" class="bk-analyze-form">
58
58
  <FormSelect
59
59
  id="category"
@@ -77,11 +77,9 @@ import {
77
77
  useState,
78
78
  onMounted,
79
79
  onUnmounted,
80
- watch
80
+ watch,
81
+ defineAsyncComponent
81
82
  } from "#imports";
82
- import Results from "./Results/Results.vue";
83
- import IgnoredResults from "./Ignored/index.vue";
84
- import AnalyzeSummary from "./Summary/index.vue";
85
83
  import { useAnalyzeHelper } from "./helper";
86
84
  import {
87
85
  FormSelect,
@@ -91,10 +89,14 @@ import {
91
89
  import { renderCycle } from "#blokkli/editor/helpers/vue";
92
90
  import { defineHighlight, onBlokkliEvent } from "#blokkli/editor/composables";
93
91
  import { falsy } from "#blokkli/helpers";
92
+ const AnalyzeSummary = defineAsyncComponent(() => import("./Summary/index.vue"));
93
+ const IgnoredResults = defineAsyncComponent(() => import("./Ignored/index.vue"));
94
+ const Results = defineAsyncComponent(() => import("./Results/Results.vue"));
94
95
  const props = defineProps({
95
96
  langcode: { type: String, required: true },
96
97
  analyze: { type: Object, required: true },
97
- isShown: { type: Boolean, required: true }
98
+ isShown: { type: Boolean, required: true },
99
+ shouldRender: { type: Boolean, required: true }
98
100
  });
99
101
  const ALL = "ALL";
100
102
  const {
@@ -182,8 +184,7 @@ defineHighlight(() => {
182
184
  const id = result.id + "_____" + target.globalIndex;
183
185
  let label = result.title;
184
186
  if (node.score != null) {
185
- const scoreLabel = readability.analyzer.value.scoreLabel;
186
- label += ` \xB7 ${scoreLabel} ${readability.formatScore(node.score)}`;
187
+ label += ` \xB7 ${readability.scoreLabel.value} ${readability.formatScore(node.score)}`;
187
188
  }
188
189
  highlights.push({
189
190
  id,
@@ -3,6 +3,7 @@ type __VLS_Props = {
3
3
  langcode: string;
4
4
  analyze: AnalyzeProvider;
5
5
  isShown: boolean;
6
+ shouldRender: boolean;
6
7
  };
7
8
  type __VLS_ModelProps = {
8
9
  modelValue?: boolean;
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="bk-analyze-results-item">
2
+ <div class="_bk_py-20 _bk_border-b _bk_border-b-mono-300 _bk_first:pt-0 _bk_last:border-b-0">
3
3
  <div class="bk-analyze-results-item-tags">
4
4
  <Status :status :title="key" />
5
5
  <div class="bk-pill bk-is-mono">{{ categoryLabel }}</div>
@@ -10,10 +10,12 @@
10
10
  </a>
11
11
  </div>
12
12
  </div>
13
- <h3>{{ title }}</h3>
14
- <p v-if="descriptionMapped || link">
15
- {{ descriptionMapped }}
16
- </p>
13
+ <h3 class="_bk_font-semibold _bk_text-base">{{ title }}</h3>
14
+ <div
15
+ v-if="description"
16
+ class="_bk_text-sm _bk_text-mono-600 _bk_mt-5 bk-analyze-results-item-description"
17
+ v-html="description"
18
+ />
17
19
 
18
20
  <ResultsItemNodes :nodes :result-id="id" />
19
21
  </div>
@@ -41,15 +43,5 @@ const { $t } = useBlokkli();
41
43
  const categoryLabel = computed(() => {
42
44
  return getCategoryLabel(props.category);
43
45
  });
44
- const descriptionMapped = computed(() => {
45
- if (!props.description) {
46
- return "";
47
- }
48
- const punctuation = /[.!?]$/;
49
- if (punctuation.test(props.description.trim())) {
50
- return props.description;
51
- }
52
- return props.description + ".";
53
- });
54
46
  const key = computed(() => `${props.plugin}:${props.id}`);
55
47
  </script>
@@ -14,7 +14,9 @@
14
14
  @click.prevent="onClick"
15
15
  >
16
16
  <div v-if="node.score != null && node.scoreLabel">
17
- <span class="bk-pill _bk_shrink-0">{{ node.score.toFixed(1) }}</span>
17
+ <span class="bk-pill _bk_shrink-0">{{
18
+ readability.formatScore(node.score)
19
+ }}</span>
18
20
  </div>
19
21
  <span class="_bk_truncate _bk_w-full _bk_inline-block _bk_font-mono">{{
20
22
  getLabel()
@@ -57,7 +59,7 @@ const props = defineProps({
57
59
  node: { type: Object, required: true },
58
60
  target: { type: Object, required: true }
59
61
  });
60
- const { $t, ui, eventBus, dom, blocks, element } = useBlokkli();
62
+ const { $t, ui, eventBus, dom, blocks, element, readability } = useBlokkli();
61
63
  const activeIndex = computed(() => {
62
64
  const index = ui.activeHighlightId.value.split("_____")[1];
63
65
  if (index === void 0) {
@@ -56,15 +56,15 @@ export default defineAnalyzer((options) => {
56
56
  id: "axe",
57
57
  label: "Axe (Accessibility Check)",
58
58
  requireRawPage: true,
59
- init: async function(context) {
60
- const axeModule = await import("axe-core");
61
- axe = axeModule.default;
62
- const locale = await getLocale(context.interfaceLangcode) ?? {};
63
- axe.configure({
64
- locale
65
- });
66
- },
67
- run: function() {
59
+ run: async function(ctx) {
60
+ if (!axe) {
61
+ const axeModule = await import("axe-core");
62
+ axe = axeModule.default;
63
+ const locale = await getLocale(ctx.langcode) ?? {};
64
+ axe.configure({
65
+ locale
66
+ });
67
+ }
68
68
  return axe.run(elementContext, options?.runOptions ?? {}).then((result) => {
69
69
  return [
70
70
  ...mapAxeResults(result.incomplete, "incomplete"),
@@ -37,8 +37,11 @@ function buildDescription(lang, band, $t) {
37
37
  return parts.join(" \xB7 ");
38
38
  }
39
39
  async function analyzeViaProvider(readabilityProvider, langcode, $t) {
40
+ if (!readabilityProvider.isAvailable.value) {
41
+ return [];
42
+ }
40
43
  const result = await readabilityProvider.analyzeAllFields();
41
- const analyzer = readabilityProvider.analyzer.value;
44
+ const scoreLabel = readabilityProvider.scoreLabel.value;
42
45
  const hardNodes = [];
43
46
  const okNodes = [];
44
47
  for (const [key, fieldResult] of Object.entries(result)) {
@@ -49,7 +52,7 @@ async function analyzeViaProvider(readabilityProvider, langcode, $t) {
49
52
  const fieldTextElements = fieldElement ? collectTextElements(fieldElement) : [];
50
53
  for (let i = 0; i < fieldResult.chunks.length; i++) {
51
54
  const chunk = fieldResult.chunks[i];
52
- if (chunk.band === "easy" || chunk.band === null || chunk.score === null)
55
+ if (chunk.band === "easy" || chunk.band === null || chunk.score === null || chunk.impact === null)
53
56
  continue;
54
57
  const targets = [];
55
58
  const textElement = fieldTextElements[i];
@@ -58,9 +61,9 @@ async function analyzeViaProvider(readabilityProvider, langcode, $t) {
58
61
  }
59
62
  const node = {
60
63
  description: buildDescription(langcode, chunk.band, $t),
61
- impact: analyzer.impactForScore(chunk.score),
64
+ impact: chunk.impact,
62
65
  score: chunk.score,
63
- scoreLabel: analyzer.scoreLabel,
66
+ scoreLabel,
64
67
  uuid,
65
68
  identifier: hashString(chunk.text),
66
69
  targets
@@ -115,9 +118,6 @@ export default defineAnalyzer(() => {
115
118
  },
116
119
  description: "Analyzes text readability using language-specific algorithms. Flags hard-to-read text blocks.",
117
120
  continuous: true,
118
- async init(context) {
119
- await context.readability.ensureInitialized();
120
- },
121
121
  run(context) {
122
122
  return analyzeViaProvider(
123
123
  context.readability,
@@ -11,7 +11,7 @@
11
11
  <template #icon>
12
12
  <AnalyzeIcon :is-running />
13
13
  </template>
14
- <template #default="{ isShown }">
14
+ <template #default="{ isShown, shouldRender }">
15
15
  <div v-if="ui.isProxyMode.value" class="bk-sidebar-padding bk">
16
16
  <InfoBox
17
17
  :text="
@@ -32,6 +32,7 @@
32
32
  :langcode="context.language"
33
33
  :analyze
34
34
  :is-shown
35
+ :should-render
35
36
  />
36
37
  </template>
37
38
  <template v-if="issueCount" #badge>
@@ -321,34 +322,33 @@ export default {
321
322
  width: 18px;
322
323
  height: 18px;
323
324
  fill: currentColor
324
- }
325
- .bk.bk-analyze .bk-analyze-results-item {
326
- border-bottom-width: 1px;
327
- --bk-tw-border-opacity: 1;
328
- border-bottom-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
329
- padding-top: 20px;
330
- padding-bottom: 20px
331
- }
332
- .bk.bk-analyze .bk-analyze-results-item:first-child {
333
- padding-top: 0px
334
- }
335
- .bk.bk-analyze .bk-analyze-results-item:last-child {
336
- border-bottom-width: 0
337
- }
338
- .bk.bk-analyze .bk-analyze-results-item > h3 {
339
- font-size: 16px;
340
- line-height: 24px;
341
- font-weight: 600
342
- }
343
- .bk.bk-analyze .bk-analyze-results-item > p {
344
- margin-top: 5px;
345
- font-size: 14px;
346
- line-height: 20px;
347
- --bk-tw-text-opacity: 1;
348
- color: rgb(var(--bk-theme-mono-600) / var(--bk-tw-text-opacity, 1))
349
325
  }
350
326
  .bk.bk-analyze .bk-analyze-results-item:hover .bk-analyze-results-item-help span {
351
327
  opacity: 1
328
+ }
329
+ .bk.bk-analyze .bk-analyze-results-item-description ul {
330
+ margin-left: 15px;
331
+ list-style-type: disc
332
+ }
333
+ .bk.bk-analyze .bk-analyze-results-item-description ol {
334
+ margin-left: 15px;
335
+ list-style-type: decimal
336
+ }
337
+ .bk.bk-analyze .bk-analyze-results-item-description ul,
338
+ .bk.bk-analyze .bk-analyze-results-item-description ol,
339
+ .bk.bk-analyze .bk-analyze-results-item-description p {
340
+ margin-top: 8px;
341
+ margin-bottom: 8px
342
+ }
343
+ .bk.bk-analyze .bk-analyze-results-item-description ul:first-child,
344
+ .bk.bk-analyze .bk-analyze-results-item-description ol:first-child,
345
+ .bk.bk-analyze .bk-analyze-results-item-description p:first-child {
346
+ margin-top: 0px
347
+ }
348
+ .bk.bk-analyze .bk-analyze-results-item-description ul:last-child,
349
+ .bk.bk-analyze .bk-analyze-results-item-description ol:last-child,
350
+ .bk.bk-analyze .bk-analyze-results-item-description p:last-child {
351
+ margin-bottom: 0px
352
352
  }
353
353
  .bk.bk-analyze .bk-analyze-results-item-nodes {
354
354
  margin-top: 10px;
@@ -29,28 +29,33 @@ export type ReadabilityAnalysisResult = Record<string, ReadabilityFieldResult>;
29
29
  /**
30
30
  * Interface for a readability analyzer.
31
31
  *
32
- * One analyzer is active at a time. The built-in default uses
33
- * LIX/CLI/ARI/Gulpease. Adapters can override with a custom implementation
34
- * (e.g. CEFR via API).
32
+ * Adapters can provide a custom analyzer via `getReadabilityAnalyzer`
33
+ * on an adapter extension; the built-in implementation lives in the
34
+ * `@blokkli/readability` sub-module.
35
+ *
36
+ * Every per-language method takes the active langcode explicitly — analyzers
37
+ * are stateless with respect to language. The `analyze` method is responsible
38
+ * for any async setup (e.g. loading language data on first call).
35
39
  */
36
40
  export type ReadabilityAnalyzer = {
37
41
  id: string;
38
42
  label?: string | ((langcode: string) => string);
39
43
  description?: string;
40
44
  supportedLanguages?: string[];
41
- minWordsForConfidence?: number;
42
45
  /**
43
- * Short label for the primary score metric (e.g. "LIX", "Gulpease", "CEFR").
44
- * Used by the UI to display scores like "LIX: 45".
46
+ * Short label for the primary score metric in the given language
47
+ * (e.g. "LIX", "Gulpease", "CEFR").
45
48
  */
46
- scoreLabel: string;
49
+ scoreLabel(langcode: string): string;
47
50
  /**
48
- * Optional initialization (e.g. lazy-load a library).
51
+ * Minimum word count required to produce a confident score in the given
52
+ * language.
49
53
  */
50
- init?(langcode: string): void | Promise<void>;
54
+ minWordsForConfidence?(langcode: string): number;
51
55
  /**
52
56
  * Score an array of plain-text strings.
53
57
  * Returns one primary score per input text (null if not scorable).
58
+ * Implementations may perform lazy setup on first call.
54
59
  */
55
60
  analyze(texts: string[], langcode: string): Promise<(number | null)[]>;
56
61
  /**
@@ -60,18 +65,17 @@ export type ReadabilityAnalyzer = {
60
65
  /**
61
66
  * Determine the impact severity for a score.
62
67
  */
63
- impactForScore(score: number): AnalyzeImpact;
68
+ impactForScore(score: number, langcode: string): AnalyzeImpact;
64
69
  /**
65
- * Return context text for the agent prompt (e.g. LIX reference table).
70
+ * Return context text for the agent prompt (e.g. score reference table).
66
71
  */
67
- getAgentContext(): string;
72
+ getAgentContext(langcode: string): string;
68
73
  /**
69
74
  * Optional display formatting for a score value.
70
75
  */
71
- formatScore?(value: number): string;
76
+ formatScore?(value: number, langcode: string): string;
72
77
  /**
73
78
  * Return scale information for visualizing score bands.
74
- * Used by the UI to render a score bar with thresholds.
75
79
  *
76
80
  * - `thresholds`: The two boundary values between easy/ok and ok/hard.
77
81
  * Listed in ascending order (lower value first).
@@ -12,9 +12,13 @@
12
12
  </template>
13
13
 
14
14
  <script setup>
15
- import { useBlokkli, defineBlokkliFeature } from "#imports";
15
+ import {
16
+ useBlokkli,
17
+ defineBlokkliFeature,
18
+ defineAsyncComponent
19
+ } from "#imports";
16
20
  import { PluginViewOption } from "#blokkli/editor/plugins";
17
- import AnchorOverlay from "./Overlay/index.vue";
21
+ const AnchorOverlay = defineAsyncComponent(() => import("./Overlay/index.vue"));
18
22
  defineBlokkliFeature({
19
23
  id: "anchors",
20
24
  label: "Anchors",
@@ -58,7 +58,8 @@ import {
58
58
  computed,
59
59
  useBlokkli,
60
60
  onMounted,
61
- onBeforeUnmount
61
+ onBeforeUnmount,
62
+ defineAsyncComponent
62
63
  } from "#imports";
63
64
  import {
64
65
  calculateIntersection,
@@ -70,7 +71,6 @@ import {
70
71
  PluginViewOption,
71
72
  PluginContextMenu
72
73
  } from "#blokkli/editor/plugins";
73
- import Overview from "./Overview/index.vue";
74
74
  import Scrollbar from "./Scrollbar/index.vue";
75
75
  import { addElementClasses, onBlokkliEvent } from "#blokkli/editor/composables";
76
76
  import { asValidNumber } from "#blokkli/editor/helpers/math";
@@ -81,6 +81,7 @@ import {
81
81
  mouse,
82
82
  dom as domPlugin
83
83
  } from "artboard-deluxe";
84
+ const Overview = defineAsyncComponent(() => import("./Overview/index.vue"));
84
85
  const props = defineProps({
85
86
  persist: { type: Boolean, required: true },
86
87
  momentum: { type: Boolean, required: true },
@@ -230,3 +230,81 @@ async function onSubmit() {
230
230
  emit("close");
231
231
  }
232
232
  </script>
233
+
234
+ <style>
235
+ .bk.bk-block-scheduler-dialog {
236
+ min-height: calc(100vh - 350px);
237
+ }
238
+
239
+ .bk .bk-schedule-section-content {
240
+ padding-top: 5px;
241
+ padding-bottom: 25px;
242
+ }
243
+
244
+ .bk .bk-schedule-section-mixed .bk-button {
245
+ margin-top: 20px;
246
+ }
247
+
248
+ .bk .bk-schedule-section {
249
+ border-bottom-width: 1px;
250
+ --bk-tw-border-opacity: 1;
251
+ border-bottom-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
252
+ }
253
+
254
+ .bk .bk-schedule-section:first-child {
255
+ border-top-width: 1px;
256
+ --bk-tw-border-opacity: 1;
257
+ border-top-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
258
+ }
259
+
260
+ .bk .bk-schedule-section > .bk-checkbox-toggle {
261
+ align-items: center;
262
+ padding-top: 15px;
263
+ padding-bottom: 15px;
264
+ }
265
+
266
+ .bk .bk-schedule-section-toggle-title {
267
+ margin-right: auto;
268
+ display: flex;
269
+ align-items: center;
270
+ gap: 10px;
271
+ }
272
+
273
+ .bk .bk-schedule-section-toggle-title .bk-icon svg {
274
+ width: 25px;
275
+ height: 25px;
276
+ fill: currentColor;
277
+ }
278
+
279
+ .bk .bk-schedule-section-toggle-title-label {
280
+ font-size: 20px;
281
+ line-height: 28px;
282
+ font-weight: 700;
283
+ }
284
+
285
+ .bk .bk-block-scheduler-table {
286
+ margin-top: 20px;
287
+ border-radius: 6px;
288
+ border-width: 1px;
289
+ --bk-tw-border-opacity: 1;
290
+ border-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
291
+ --bk-tw-bg-opacity: 1;
292
+ background-color: rgb(var(--bk-theme-mono-100) / var(--bk-tw-bg-opacity, 1));
293
+ padding: 20px;
294
+ }
295
+
296
+ .bk .bk-block-scheduler-table table {
297
+ margin-top: 20px;
298
+ }
299
+
300
+ .bk .bk-block-scheduler-table table thead {
301
+ --bk-tw-bg-opacity: 1;
302
+ background-color: rgb(var(--bk-theme-mono-100) / var(--bk-tw-bg-opacity, 1));
303
+ }
304
+
305
+ .bk .bk-block-scheduler-table-title {
306
+ font-size: 20px;
307
+ line-height: 28px;
308
+ font-weight: 700;
309
+ }
310
+ </style>
@@ -37,10 +37,16 @@
37
37
  </template>
38
38
 
39
39
  <script setup>
40
- import { useBlokkli, defineBlokkliFeature, computed, ref } from "#imports";
40
+ import {
41
+ useBlokkli,
42
+ defineBlokkliFeature,
43
+ computed,
44
+ ref,
45
+ defineAsyncComponent
46
+ } from "#imports";
41
47
  import { PluginItemAction } from "#blokkli/editor/plugins";
42
48
  import { BlokkliTransition, Icon } from "#blokkli/editor/components";
43
- import SchedulerDialog from "./Dialog/index.vue";
49
+ const SchedulerDialog = defineAsyncComponent(() => import("./Dialog/index.vue"));
44
50
  defineBlokkliFeature({
45
51
  id: "block-scheduler",
46
52
  icon: "bk_mdi_calendar_month",
@@ -102,115 +108,54 @@ export default {
102
108
  </script>
103
109
 
104
110
  <style>
105
- .bk.bk-block-scheduler-dialog {
106
- min-height: calc(100vh - 350px);
107
- }
111
+ .bk .bk-item-action.bk-has-schedule {
108
112
 
109
- .bk .bk-schedule-section-content {
110
- padding-top: 5px;
111
- padding-bottom: 25px;
113
+ background-color: rgb(var(--bk-theme-yellow-dark) / 0.5)
112
114
  }
113
115
 
114
- .bk .bk-schedule-section-mixed .bk-button {
115
- margin-top: 20px;
116
- }
116
+ .bk .bk-item-action.bk-has-schedule:hover {
117
117
 
118
- .bk .bk-schedule-section {
119
- border-bottom-width: 1px;
120
- --bk-tw-border-opacity: 1;
121
- border-bottom-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
118
+ background-color: rgb(var(--bk-theme-yellow-dark) / 0.7)
122
119
  }
123
120
 
124
- .bk .bk-schedule-section:first-child {
125
- border-top-width: 1px;
126
- --bk-tw-border-opacity: 1;
127
- border-top-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
128
- }
121
+ .bk .bk-item-action.bk-has-schedule .bk-icon-clock {
129
122
 
130
- .bk .bk-schedule-section > .bk-checkbox-toggle {
131
- align-items: center;
132
- padding-top: 15px;
133
- padding-bottom: 15px;
134
- }
123
+ --bk-tw-text-opacity: 1;
135
124
 
136
- .bk .bk-schedule-section-toggle-title {
137
- margin-right: auto;
138
- display: flex;
139
- align-items: center;
140
- gap: 10px;
125
+ color: rgb(var(--bk-theme-yellow-light) / var(--bk-tw-text-opacity, 1))
141
126
  }
127
+ .bk .bk-schedule-action-icon {
142
128
 
143
- .bk .bk-schedule-section-toggle-title .bk-icon svg {
144
- width: 25px;
145
- height: 25px;
146
- fill: currentColor;
129
+ position: relative
147
130
  }
131
+ .bk .bk-schedule-action-icon .bk-schedule-action-icon-check {
148
132
 
149
- .bk .bk-schedule-section-toggle-title-label {
150
- font-size: 20px;
151
- line-height: 28px;
152
- font-weight: 700;
153
- }
133
+ position: absolute;
154
134
 
155
- .bk .bk-block-scheduler-table {
156
- margin-top: 20px;
157
- border-radius: 6px;
158
- border-width: 1px;
159
- --bk-tw-border-opacity: 1;
160
- border-color: rgb(var(--bk-theme-mono-300) / var(--bk-tw-border-opacity, 1));
161
- --bk-tw-bg-opacity: 1;
162
- background-color: rgb(var(--bk-theme-mono-100) / var(--bk-tw-bg-opacity, 1));
163
- padding: 20px;
164
- }
135
+ top: -5px;
165
136
 
166
- .bk .bk-block-scheduler-table table {
167
- margin-top: 20px;
168
- }
137
+ right: -5px;
169
138
 
170
- .bk .bk-block-scheduler-table table thead {
171
- --bk-tw-bg-opacity: 1;
172
- background-color: rgb(var(--bk-theme-mono-100) / var(--bk-tw-bg-opacity, 1));
173
- }
139
+ display: flex;
174
140
 
175
- .bk .bk-block-scheduler-table-title {
176
- font-size: 20px;
177
- line-height: 28px;
178
- font-weight: 700;
179
- }
141
+ width: 15px;
180
142
 
181
- .bk .bk-schedule-action-icon {
182
- position: relative;
183
- }
143
+ height: 15px;
184
144
 
185
- .bk .bk-schedule-action-icon .bk-schedule-action-icon-check {
186
- position: absolute;
187
- top: -5px;
188
- right: -5px;
189
- display: flex;
190
- width: 15px;
191
- height: 15px;
192
- align-items: center;
193
- justify-content: center;
194
- border-radius: 9999px;
195
- --bk-tw-bg-opacity: 1;
196
- background-color: rgb(var(--bk-theme-yellow-normal) / var(--bk-tw-bg-opacity, 1));
197
- }
145
+ align-items: center;
198
146
 
199
- .bk .bk-schedule-action-icon .bk-schedule-action-icon-check svg {
200
- width: 10px;
201
- height: 10px;
202
- }
147
+ justify-content: center;
203
148
 
204
- .bk .bk-item-action.bk-has-schedule {
205
- background-color: rgb(var(--bk-theme-yellow-dark) / 0.5);
206
- }
149
+ border-radius: 9999px;
207
150
 
208
- .bk .bk-item-action.bk-has-schedule:hover {
209
- background-color: rgb(var(--bk-theme-yellow-dark) / 0.7);
151
+ --bk-tw-bg-opacity: 1;
152
+
153
+ background-color: rgb(var(--bk-theme-yellow-normal) / var(--bk-tw-bg-opacity, 1))
210
154
  }
155
+ .bk .bk-schedule-action-icon .bk-schedule-action-icon-check svg {
156
+
157
+ width: 10px;
211
158
 
212
- .bk .bk-item-action.bk-has-schedule .bk-icon-clock {
213
- --bk-tw-text-opacity: 1;
214
- color: rgb(var(--bk-theme-yellow-light) / var(--bk-tw-text-opacity, 1));
159
+ height: 10px
215
160
  }
216
161
  </style>
@@ -44,9 +44,9 @@
44
44
  <span>{{ crumb.label }}</span>
45
45
  </button>
46
46
  </li>
47
- <li v-if="selection.activeEditableLabel.value">
47
+ <li v-if="selection.activeFieldLabel.value">
48
48
  <div class="bk-breadcrumb-inner bk-is-editable">
49
- <span>{{ selection.activeEditableLabel.value }}</span>
49
+ <span>{{ selection.activeFieldLabel.value }}</span>
50
50
  </div>
51
51
  </li>
52
52
  </ul>