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

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 (218) 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/Toolbar/index.vue +1 -1
  82. package/dist/runtime/editor/components/index.d.ts +11 -10
  83. package/dist/runtime/editor/components/index.js +32 -10
  84. package/dist/runtime/editor/composables/defineRenderer.d.ts +2 -2
  85. package/dist/runtime/editor/composables/defineRenderer.js +8 -3
  86. package/dist/runtime/editor/css/output.css +1 -1
  87. package/dist/runtime/editor/events/index.d.ts +6 -0
  88. package/dist/runtime/editor/features/analyze/Main.d.vue.ts +1 -0
  89. package/dist/runtime/editor/features/analyze/Main.vue +9 -8
  90. package/dist/runtime/editor/features/analyze/Main.vue.d.ts +1 -0
  91. package/dist/runtime/editor/features/analyze/Results/ResultsItem.vue +7 -15
  92. package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +4 -2
  93. package/dist/runtime/editor/features/analyze/analyzers/axe.js +9 -9
  94. package/dist/runtime/editor/features/analyze/analyzers/readability.js +7 -7
  95. package/dist/runtime/editor/features/analyze/index.vue +26 -26
  96. package/dist/runtime/editor/features/analyze/readability/types.d.ts +18 -14
  97. package/dist/runtime/editor/features/anchors/index.vue +6 -2
  98. package/dist/runtime/editor/features/artboard/Renderer.vue +3 -2
  99. package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +78 -0
  100. package/dist/runtime/editor/features/block-scheduler/index.vue +34 -89
  101. package/dist/runtime/editor/features/breadcrumbs/index.vue +2 -2
  102. package/dist/runtime/editor/features/changelog/changelog.json +8 -0
  103. package/dist/runtime/editor/features/changelog/index.vue +10 -8
  104. package/dist/runtime/editor/features/clipboard/DropElement/index.vue +152 -0
  105. package/dist/runtime/editor/features/clipboard/index.vue +13 -159
  106. package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -28
  107. package/dist/runtime/editor/features/command-palette/Palette/index.vue +17 -6
  108. package/dist/runtime/editor/features/command-palette/index.vue +7 -2
  109. package/dist/runtime/editor/features/comments/index.vue +6 -3
  110. package/dist/runtime/editor/features/debug/Main.vue +168 -0
  111. package/dist/runtime/editor/features/debug/Section/Features.vue +1 -2
  112. package/dist/runtime/editor/features/debug/index.vue +6 -170
  113. package/dist/runtime/editor/features/dev-mode/index.vue +2 -1
  114. package/dist/runtime/editor/features/diff/index.vue +6 -2
  115. package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +15 -16
  116. package/dist/runtime/editor/features/dragging-overlay/index.vue +4 -3
  117. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.d.vue.ts +15 -0
  118. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +547 -0
  119. package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue.d.ts +15 -0
  120. package/dist/runtime/editor/features/droppable-field-edit/index.d.vue.ts +3 -0
  121. package/dist/runtime/editor/features/droppable-field-edit/index.vue +231 -0
  122. package/dist/runtime/editor/features/droppable-field-edit/index.vue.d.ts +3 -0
  123. package/dist/runtime/editor/features/droppable-field-edit/types.d.ts +70 -0
  124. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.d.vue.ts +1 -0
  125. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +34 -21
  126. package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue.d.ts +1 -0
  127. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +2 -2
  128. package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +2 -2
  129. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
  130. package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +6 -13
  131. package/dist/runtime/editor/features/editable-field/Overlay/index.vue +4 -4
  132. package/dist/runtime/editor/features/fragments/index.vue +9 -4
  133. package/dist/runtime/editor/features/help/index.vue +7 -2
  134. package/dist/runtime/editor/features/highlights/Renderer/index.vue +11 -17
  135. package/dist/runtime/editor/features/history/index.vue +3 -2
  136. package/dist/runtime/editor/features/hover/Renderer/index.vue +87 -36
  137. package/dist/runtime/editor/features/hover/Renderer/vertex.glsl +5 -5
  138. package/dist/runtime/editor/features/hover/index.vue +1 -1
  139. package/dist/runtime/editor/features/import-existing/Dialog/Item.d.vue.ts +5 -0
  140. package/dist/runtime/editor/features/import-existing/Dialog/Item.vue +55 -0
  141. package/dist/runtime/editor/features/import-existing/Dialog/Item.vue.d.ts +5 -0
  142. package/dist/runtime/editor/features/import-existing/Dialog/index.d.vue.ts +7 -3
  143. package/dist/runtime/editor/features/import-existing/Dialog/index.vue +107 -65
  144. package/dist/runtime/editor/features/import-existing/Dialog/index.vue.d.ts +7 -3
  145. package/dist/runtime/editor/features/import-existing/index.vue +19 -6
  146. package/dist/runtime/editor/features/import-existing/types.d.ts +0 -11
  147. package/dist/runtime/editor/features/library/ReusableDialog/index.vue +7 -33
  148. package/dist/runtime/editor/features/library/index.vue +14 -5
  149. package/dist/runtime/editor/features/media-library/Library/index.vue +3 -1
  150. package/dist/runtime/editor/features/media-library/index.vue +9 -2
  151. package/dist/runtime/editor/features/media-library/types.d.ts +2 -0
  152. package/dist/runtime/editor/features/multi-select/Renderer/index.vue +16 -15
  153. package/dist/runtime/editor/features/multi-select/index.vue +9 -3
  154. package/dist/runtime/editor/features/options/Form/Radios/index.vue +4 -8
  155. package/dist/runtime/editor/features/options/index.vue +7 -2
  156. package/dist/runtime/editor/features/preview-grant/index.vue +8 -2
  157. package/dist/runtime/editor/features/publish/index.vue +3 -2
  158. package/dist/runtime/editor/features/referenced-entities/index.vue +7 -2
  159. package/dist/runtime/editor/features/responsive-preview/index.vue +13 -11
  160. package/dist/runtime/editor/features/search/index.vue +6 -2
  161. package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +6 -11
  162. package/dist/runtime/editor/features/selection/Renderer/index.vue +9 -14
  163. package/dist/runtime/editor/features/selection/index.vue +7 -4
  164. package/dist/runtime/editor/features/settings/index.vue +8 -3
  165. package/dist/runtime/editor/features/structure/index.vue +3 -2
  166. package/dist/runtime/editor/features/templates/CreateDialog/index.vue +1 -0
  167. package/dist/runtime/editor/features/templates/index.vue +14 -6
  168. package/dist/runtime/editor/features/theme/index.vue +2 -1
  169. package/dist/runtime/editor/features/tour/index.vue +6 -2
  170. package/dist/runtime/editor/features/translations/index.vue +7 -4
  171. package/dist/runtime/editor/features/workspace/Overlay/Item.d.vue.ts +3 -0
  172. package/dist/runtime/editor/features/workspace/Overlay/Item.vue +49 -0
  173. package/dist/runtime/editor/features/workspace/Overlay/Item.vue.d.ts +3 -0
  174. package/dist/runtime/editor/features/workspace/Overlay/index.vue +16 -104
  175. package/dist/runtime/editor/features/workspace/index.vue +6 -2
  176. package/dist/runtime/editor/helpers/webgl/index.d.ts +3 -2
  177. package/dist/runtime/editor/helpers/webgl/index.js +2 -3
  178. package/dist/runtime/editor/libraries/fzf.d.ts +3 -0
  179. package/dist/runtime/editor/libraries/fzf.js +7 -0
  180. package/dist/runtime/editor/libraries/twgl.d.ts +10 -0
  181. package/dist/runtime/editor/libraries/twgl.js +14 -0
  182. package/dist/runtime/editor/plugins/DebugOverlay/index.vue +3 -1
  183. package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +39 -18
  184. package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -0
  185. package/dist/runtime/editor/plugins/Sidebar/index.vue +12 -4
  186. package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -0
  187. package/dist/runtime/editor/providers/animation.d.ts +5 -10
  188. package/dist/runtime/editor/providers/animation.js +10 -8
  189. package/dist/runtime/editor/providers/directive.d.ts +11 -0
  190. package/dist/runtime/editor/providers/directive.js +16 -0
  191. package/dist/runtime/editor/providers/features.d.ts +3 -3
  192. package/dist/runtime/editor/providers/features.js +1 -1
  193. package/dist/runtime/editor/providers/fieldValue.d.ts +27 -0
  194. package/dist/runtime/editor/providers/fieldValue.js +21 -1
  195. package/dist/runtime/editor/providers/keyboard.js +6 -3
  196. package/dist/runtime/editor/providers/readability.d.ts +28 -4
  197. package/dist/runtime/editor/providers/readability.js +30 -46
  198. package/dist/runtime/editor/providers/selection.d.ts +8 -0
  199. package/dist/runtime/editor/providers/selection.js +6 -0
  200. package/dist/runtime/editor/providers/texts.d.ts +1 -3
  201. package/dist/runtime/editor/providers/texts.js +34 -37
  202. package/dist/runtime/editor/providers/workspaces.d.ts +93 -0
  203. package/dist/runtime/editor/providers/workspaces.js +76 -0
  204. package/dist/runtime/editor/translations/de.json +918 -3616
  205. package/dist/runtime/editor/translations/fr.json +250 -3616
  206. package/dist/runtime/editor/translations/gsw_CH.json +918 -3616
  207. package/dist/runtime/editor/translations/it.json +250 -3616
  208. package/dist/runtime/editor/types/app.d.ts +2 -0
  209. package/dist/runtime/editor/types/features.d.ts +1 -1
  210. package/dist/runtime/editor/types/state.d.ts +7 -0
  211. package/dist/runtime/helpers/injections.d.ts +6 -0
  212. package/dist/runtime/helpers/injections.js +3 -0
  213. package/dist/runtime/types/definitions.d.ts +4 -0
  214. package/package.json +14 -4
  215. package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.d.ts +0 -6
  216. package/dist/runtime/editor/features/analyze/readability/builtinAnalyzer.js +0 -216
  217. package/dist/runtime/editor/features/workspace/types.d.ts +0 -59
  218. /package/dist/runtime/editor/features/{workspace → droppable-field-edit}/types.js +0 -0
@@ -31,6 +31,7 @@ import type { ReadabilityProvider } from '../providers/readability.js';
31
31
  import type { FieldValueProvider } from '../providers/fieldValue.js';
32
32
  import type { DragDropProvider } from '../providers/dragdrop.js';
33
33
  import type { CacheProvider } from '../providers/cache.js';
34
+ import type { WorkspacesProvider } from '../providers/workspaces.js';
34
35
  export interface BlokkliApp {
35
36
  /**
36
37
  * The adapter.
@@ -71,4 +72,5 @@ export interface BlokkliApp {
71
72
  fieldValue: FieldValueProvider;
72
73
  dragdrop: DragDropProvider;
73
74
  cache: CacheProvider;
75
+ workspaces: WorkspacesProvider;
74
76
  }
@@ -4,7 +4,7 @@ import type { AdapterMethods } from '#blokkli/editor/adapter';
4
4
  import type { BlokkliApp } from './app.js';
5
5
  import type { UserPermissions } from './permissions.js';
6
6
  export type FeatureDefinitionSetting = FeatureDefinitionSettingCheckbox | FeatureDefinitionSettingRadios<BlokkliIcon> | FeatureDefinitionSettingMethod<BlokkliApp> | FeatureDefinitionSettingSlider;
7
- export type FeatureDefinition<Methods extends AdapterMethods[] = [], T extends string = ''> = Omit<FeatureDefinitionBase<AdapterMethods, BlokkliIcon, T>, 'requiredAdapterMethods' | 'settings' | 'requiredPermissions'> & {
7
+ export type FeatureDefinition<Methods extends AdapterMethods[] = []> = Omit<FeatureDefinitionBase<AdapterMethods, BlokkliIcon>, 'requiredAdapterMethods' | 'settings' | 'requiredPermissions'> & {
8
8
  requiredAdapterMethods?: [...Methods];
9
9
  settings?: Record<string, FeatureDefinitionSetting>;
10
10
  requiredPermissions?: UserPermissions[];
@@ -70,6 +70,13 @@ export interface MappedState {
70
70
  entityType: string;
71
71
  entityBundle: string;
72
72
  }[];
73
+ droppableFieldValues?: {
74
+ uuid: string;
75
+ fieldName: string;
76
+ ids: string[];
77
+ entityType: string;
78
+ entityBundle: string;
79
+ }[];
73
80
  ignoredAnalyzeIdentifiers?: string[];
74
81
  }
75
82
  export type MutateWithLoadingStateFunction = (promise: () => Promise<MutationResponseLike<any>> | undefined, errorMessage?: string | false, successMessage?: string) => Promise<boolean>;
@@ -3,6 +3,7 @@ import type { EntityContext } from './../types/index.js';
3
3
  import type { DebugLogger } from '#blokkli/editor/providers/debug';
4
4
  import type { FieldListItemTyped, ValidFieldListTypes, ValidProviderTypes } from '#blokkli-build/generated-types';
5
5
  import type DraggableListComponent from '../editor/components/DraggableList.vue.js';
6
+ import type BlokkliEditableEditComponent from '../editor/components/BlokkliEditableEdit.vue.js';
6
7
  import type { BlokkliApp } from '#blokkli/editor/types/app';
7
8
  import type { MutatedField, MutatedItemProps, MutatedOptions } from '#blokkli/editor/types/state';
8
9
  import type { DefineBlokkliContext } from '#blokkli/types/definitions';
@@ -16,6 +17,7 @@ type ItemEditContext = {
16
17
  mutatedOptions: MutatedOptions;
17
18
  dom?: DomProvider;
18
19
  definitions: DefinitionProvider;
20
+ selectedUuids: ComputedRef<string[]>;
19
21
  useBlockRegistration?: (dom: DomProvider, uuid: string) => void;
20
22
  };
21
23
  export declare const INJECT_APP: InjectionKey<BlokkliApp>;
@@ -119,6 +121,10 @@ export declare const INJECT_PROVIDER_KEY: InjectionKey<string>;
119
121
  * The DraggableList component used during editing.
120
122
  */
121
123
  export declare const INJECT_EDIT_FIELD_LIST_COMPONENT: InjectionKey<typeof DraggableListComponent>;
124
+ /**
125
+ * The BlokkliEditableEdit component used during editing.
126
+ */
127
+ export declare const INJECT_EDIT_EDITABLE_COMPONENT: InjectionKey<typeof BlokkliEditableEditComponent>;
122
128
  /**
123
129
  * The reactive item props override object, used to override props values (during editing).
124
130
  */
@@ -64,6 +64,9 @@ export const INJECT_PROVIDER_KEY = Symbol(
64
64
  export const INJECT_EDIT_FIELD_LIST_COMPONENT = Symbol(
65
65
  "blokkli_edit_field_list_component"
66
66
  );
67
+ export const INJECT_EDIT_EDITABLE_COMPONENT = Symbol(
68
+ "blokkli_edit_editable_component"
69
+ );
67
70
  export const INJECT_ITEM_PROPS_OVERRIDE = Symbol(
68
71
  "blokkli_edit_item_props_override"
69
72
  );
@@ -79,6 +79,10 @@ export type DefineBlokkliContext<T extends BlockDefinitionOptionsInput = BlockDe
79
79
  * The provider context.
80
80
  */
81
81
  provider: ComputedRef<BlokkliProviderEntityContext | null>;
82
+ /**
83
+ * Whether the block is currently selected in the editor. Only available during editing.
84
+ */
85
+ isSelected?: ComputedRef<boolean>;
82
86
  };
83
87
  export type DefineProviderContext<T extends BlockDefinitionOptionsInput = BlockDefinitionOptionsInput, G extends ValidGlobalConfigKeys | undefined = undefined> = {
84
88
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blokkli/editor",
3
- "version": "2.0.0-alpha.53",
3
+ "version": "2.0.0-alpha.55",
4
4
  "description": "Interactive page building experience for Nuxt",
5
5
  "keywords": [
6
6
  "cms",
@@ -57,6 +57,9 @@
57
57
  ],
58
58
  "tailwind": [
59
59
  "./dist/modules/tailwind/index.d.mts"
60
+ ],
61
+ "readability": [
62
+ "./dist/modules/readability/index.d.mts"
60
63
  ]
61
64
  }
62
65
  },
@@ -93,6 +96,11 @@
93
96
  "types": "./dist/modules/tailwind/index.d.mts",
94
97
  "require": "./dist/modules/tailwind/index.mjs",
95
98
  "import": "./dist/modules/tailwind/index.mjs"
99
+ },
100
+ "./readability": {
101
+ "types": "./dist/modules/readability/index.d.mts",
102
+ "require": "./dist/modules/readability/index.mjs",
103
+ "import": "./dist/modules/readability/index.mjs"
96
104
  }
97
105
  },
98
106
  "scripts": {
@@ -107,8 +115,10 @@
107
115
  "styles:build": "postcss ./css/index.css -o ./src/runtime/editor/css/output.css",
108
116
  "styles:watch": "postcss ./css/index.css -o ./src/runtime/editor/css/output.css --watch",
109
117
  "dev:build": "npm run changelog && npm run dev:prepare && nuxi generate playground",
118
+ "dev:build-ssr": "npm run dev:prepare && nuxt build playground",
110
119
  "dev:start": "npx serve playground/.output/public",
111
120
  "dev:prepare": "PLAYGROUND_MODULE_BUILD=true nuxt-module-build build --stub && PLAYGROUND_MODULE_BUILD=true nuxt-module-build prepare && nuxi prepare playground",
121
+ "dev:analyze": "npx nuxt analyze playground",
112
122
  "release": "npm run lint && npm run prepack && changelogen --release",
113
123
  "changelog": "node ./scripts/changelog/index.cjs",
114
124
  "texts": "node ./scripts/texts/index.cjs",
@@ -145,7 +155,6 @@
145
155
  "devDependencies": {
146
156
  "@anthropic-ai/sdk": "^0.71.2",
147
157
  "@ckeditor/ckeditor5-vue": "^7.3.0",
148
- "@lunarisapp/readability": "^1.0.2",
149
158
  "@nuxt/devtools": "^3.1.1",
150
159
  "@nuxt/eslint-config": "^1.12.1",
151
160
  "@nuxt/module-builder": "^1.0.2",
@@ -190,6 +199,7 @@
190
199
  "postcss-url": "^10.1.3",
191
200
  "prettier": "^3.7.4",
192
201
  "prettier-plugin-glsl": "^0.2.2",
202
+ "syllable": "^5.0.1",
193
203
  "tailwindcss": "^3.4.17",
194
204
  "tsx": "^4.21.0",
195
205
  "unbuild": "^3.6.1",
@@ -200,7 +210,6 @@
200
210
  },
201
211
  "peerDependencies": {
202
212
  "@anthropic-ai/sdk": "*",
203
- "@lunarisapp/readability": "*",
204
213
  "@thedutchcoder/postcss-rem-to-px": "*",
205
214
  "acorn": "^8.0.0",
206
215
  "axe-core": "*",
@@ -213,12 +222,13 @@
213
222
  "postcss": "*",
214
223
  "postcss-import": "*",
215
224
  "postcss-replace": "*",
225
+ "syllable": "*",
216
226
  "tailwindcss": "*",
217
227
  "turndown": "^7.2.2",
218
228
  "typescript": "^5.0.0"
219
229
  },
220
230
  "peerDependenciesMeta": {
221
- "@lunarisapp/readability": {
231
+ "syllable": {
222
232
  "optional": true
223
233
  },
224
234
  "@thedutchcoder/postcss-rem-to-px": {
@@ -1,6 +0,0 @@
1
- import type { ReadabilityAnalyzer } from './types.js';
2
- /**
3
- * Create the built-in readability analyzer using language-specific algorithms:
4
- * LIX (en/fr), Wiener Sachtextformel (de), Gulpease (it).
5
- */
6
- export declare function createBuiltinReadabilityAnalyzer(): ReadabilityAnalyzer;
@@ -1,216 +0,0 @@
1
- const SCORE_CONFIGS = {
2
- en: {
3
- label: "FRE",
4
- compute: (tr, text) => tr.fleschReadingEase(text),
5
- direction: "higher_easier",
6
- bands: { easy: 60, ok: 30 },
7
- impactThresholds: [50, 30, 10],
8
- minWords: 15,
9
- referenceTable: [
10
- { range: "Above 70", label: "Very easy (simple, conversational)" },
11
- { range: "60\u201370", label: "Easy (standard web content)" },
12
- { range: "50\u201360", label: "Fairly difficult (could be simpler)" },
13
- { range: "30\u201350", label: "Difficult (academic, technical)" },
14
- {
15
- range: "Below 30",
16
- label: "Very difficult \u2014 this is what gets flagged"
17
- },
18
- { range: "Below 10", label: "Critical \u2014 must be simplified" }
19
- ]
20
- },
21
- de: {
22
- label: "WSTF",
23
- compute: (tr, text) => tr.wienerSachtextformel(text, 1),
24
- direction: "higher_harder",
25
- bands: { easy: 15, ok: 18 },
26
- impactThresholds: [16, 20, 24],
27
- minWords: 5,
28
- referenceTable: [
29
- { range: "Below 8", label: "Very easy (children's books)" },
30
- { range: "8\u201315", label: "Easy (standard website content)" },
31
- { range: "15\u201318", label: "Moderately difficult (could be simpler)" },
32
- {
33
- range: "Above 18",
34
- label: "Difficult \u2014 this is what gets flagged"
35
- },
36
- { range: "Above 24", label: "Critical \u2014 must be simplified" }
37
- ]
38
- },
39
- fr: {
40
- label: "LIX",
41
- compute: (tr, text) => tr.lix(text),
42
- direction: "higher_harder",
43
- bands: { easy: 40, ok: 59 },
44
- impactThresholds: [50, 60, 70],
45
- minWords: 5,
46
- referenceTable: [
47
- { range: "Below 25", label: "Very easy (children's books)" },
48
- { range: "25\u201340", label: "Easy (simple articles)" },
49
- { range: "40\u201350", label: "Medium (newspapers)" },
50
- { range: "50\u201360", label: "Difficult (official documents)" },
51
- {
52
- range: "Above 60",
53
- label: "Very difficult \u2014 this is what gets flagged"
54
- },
55
- { range: "Above 70", label: "Critical \u2014 must be simplified" }
56
- ]
57
- },
58
- it: {
59
- label: "Gulpease",
60
- compute: (tr, text) => tr.gulpeaseIndex(text),
61
- direction: "higher_easier",
62
- bands: { easy: 80, ok: 60 },
63
- impactThresholds: [60, 50, 40],
64
- minWords: 5,
65
- referenceTable: [
66
- { range: "Above 80", label: "Very easy (children's books)" },
67
- { range: "60\u201380", label: "Easy (simple articles)" },
68
- { range: "50\u201360", label: "Medium (newspapers)" },
69
- { range: "40\u201350", label: "Difficult (official documents)" },
70
- {
71
- range: "Below 40",
72
- label: "Very difficult \u2014 this is what gets flagged"
73
- },
74
- { range: "Below 30", label: "Critical \u2014 must be simplified" }
75
- ]
76
- }
77
- };
78
- const SUPPORTED_LANGUAGES = ["en", "de", "fr", "it"];
79
- function getConfig(langcode) {
80
- if (isSupportedLangcode(langcode)) {
81
- return SCORE_CONFIGS[langcode];
82
- }
83
- return SCORE_CONFIGS.en;
84
- }
85
- function isSupportedLangcode(v) {
86
- return v === "en" || v === "de" || v === "fr" || v === "it";
87
- }
88
- function mapLang(langcode) {
89
- const lc = (langcode || "").toLowerCase();
90
- if (lc.startsWith("de")) return "de_CH";
91
- if (lc.startsWith("fr")) return "fr";
92
- if (lc.startsWith("it")) return "it";
93
- return "en_GB";
94
- }
95
- function segmentWords(text) {
96
- if ("Segmenter" in Intl) {
97
- const seg = new Intl.Segmenter(void 0, { granularity: "word" });
98
- const out = [];
99
- for (const s of seg.segment(text)) {
100
- if (s.isWordLike)
101
- out.push(text.slice(s.index, s.index + s.segment.length));
102
- }
103
- return out;
104
- }
105
- return text.match(/\p{Letter}+(?:'\p{Letter}+)?/gu) ?? [];
106
- }
107
- function safe(fn) {
108
- try {
109
- const n = fn();
110
- return Number.isFinite(n) ? n : void 0;
111
- } catch {
112
- return void 0;
113
- }
114
- }
115
- function round(n) {
116
- return Math.round(n * 10) / 10;
117
- }
118
- function classifyBandGeneric(score, config) {
119
- if (config.direction === "higher_easier") {
120
- if (score >= config.bands.easy) return "easy";
121
- if (score >= config.bands.ok) return "ok";
122
- return "hard";
123
- }
124
- if (score <= config.bands.easy) return "easy";
125
- if (score <= config.bands.ok) return "ok";
126
- return "hard";
127
- }
128
- function impactForScoreGeneric(score, config) {
129
- const [moderate, serious, critical] = config.impactThresholds;
130
- if (config.direction === "higher_easier") {
131
- if (score < critical) return "critical";
132
- if (score < serious) return "serious";
133
- if (score < moderate) return "moderate";
134
- return "minor";
135
- }
136
- if (score >= critical) return "critical";
137
- if (score >= serious) return "serious";
138
- if (score >= moderate) return "moderate";
139
- return "minor";
140
- }
141
- function buildAgentContext(config) {
142
- const rows = config.referenceTable.map((row) => `- ${row.range}: ${row.label}`).join("\n");
143
- return `## ${config.label} Score Reference
144
-
145
- ${rows}`;
146
- }
147
- export function createBuiltinReadabilityAnalyzer() {
148
- let textReadability = null;
149
- let currentLangcode = "en";
150
- return {
151
- id: "builtin",
152
- label: (langcode) => {
153
- if (langcode === "de") return "Lesbarkeit";
154
- return "Readability";
155
- },
156
- description: "Analyzes text readability using language-specific algorithms (LIX, Wiener Sachtextformel, Gulpease).",
157
- supportedLanguages: SUPPORTED_LANGUAGES,
158
- get minWordsForConfidence() {
159
- return getConfig(currentLangcode).minWords;
160
- },
161
- get scoreLabel() {
162
- return getConfig(currentLangcode).label;
163
- },
164
- async init(langcode) {
165
- currentLangcode = langcode;
166
- const { TextReadability } = await import("@lunarisapp/readability");
167
- textReadability = new TextReadability({
168
- lang: mapLang(langcode),
169
- cache: true
170
- });
171
- },
172
- async analyze(texts, langcode) {
173
- if (!isSupportedLangcode(langcode)) {
174
- return texts.map(() => null);
175
- }
176
- if (!textReadability) {
177
- const { TextReadability } = await import("@lunarisapp/readability");
178
- textReadability = new TextReadability({
179
- lang: mapLang(langcode),
180
- cache: true
181
- });
182
- }
183
- const config = getConfig(langcode);
184
- const tr = textReadability;
185
- return texts.map((text) => {
186
- const trimmed = text.trim();
187
- if (!trimmed) return null;
188
- const words = segmentWords(trimmed);
189
- if (words.length < config.minWords) return null;
190
- const score = safe(() => config.compute(tr, trimmed));
191
- return score != null ? round(score) : null;
192
- });
193
- },
194
- classifyBand(score, langcode) {
195
- return classifyBandGeneric(score, getConfig(langcode));
196
- },
197
- impactForScore(score) {
198
- return impactForScoreGeneric(score, getConfig(currentLangcode));
199
- },
200
- getAgentContext() {
201
- return buildAgentContext(getConfig(currentLangcode));
202
- },
203
- getScaleInfo(langcode) {
204
- const config = getConfig(langcode);
205
- const t1 = Math.min(config.bands.easy, config.bands.ok);
206
- const t2 = Math.max(config.bands.easy, config.bands.ok);
207
- const padding = Math.round((t2 - t1) * 0.5);
208
- return {
209
- thresholds: [t1, t2],
210
- direction: config.direction,
211
- scaleMin: Math.max(0, t1 - padding),
212
- scaleMax: t2 + padding
213
- };
214
- }
215
- };
216
- }
@@ -1,59 +0,0 @@
1
- export type HostEntitySearchResultLabelMap = {
2
- label: string;
3
- bundles: Record<string, string>;
4
- };
5
- export type HostEntitySearchResultItem = {
6
- /**
7
- * The ID of the host entity.
8
- */
9
- id: string;
10
- /**
11
- * The UUID of the host entity.
12
- */
13
- uuid: string;
14
- /**
15
- * The entity type of the host entity.
16
- */
17
- entityType: string;
18
- /**
19
- * The entity bundle of the host entity.
20
- */
21
- bundle: string;
22
- /**
23
- * The label of the host entity.
24
- */
25
- label: string;
26
- /**
27
- * The url to start editing.
28
- */
29
- url: string;
30
- /**
31
- * If an edit state exists: The time when the edit state was last changed.
32
- */
33
- lastChanged: string | null;
34
- /**
35
- * If an edit state exists: The ID of the owner of the edit state.
36
- */
37
- uid: string | null;
38
- /**
39
- * Optional additional context used for searching (e.g. SKU, internal ID).
40
- *
41
- * Not displayed in the UI, but included in the fzf search.
42
- */
43
- context?: string;
44
- };
45
- export type HostEntitySearchResult = {
46
- items: HostEntitySearchResultItem[];
47
- /**
48
- * A map with keys that are entity types.
49
- */
50
- labelMap: HostEntitySearchResultLabelMap;
51
- };
52
- declare module '#blokkli/editor/adapter' {
53
- interface BlokkliAdapter<T> {
54
- /**
55
- * Search for host entities.
56
- */
57
- getHostEntities?: () => Promise<HostEntitySearchResult>;
58
- }
59
- }