@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
@@ -2,6 +2,6 @@ export declare const BK_HIDDEN_GLOBALLY = "bkHiddenGlobally";
2
2
  export declare const BK_VISIBLE_LANGUAGES = "bkVisibleLanguages";
3
3
  export declare const SETTINGS_GROUP: readonly ["appearance", "artboard", "behavior", "beta", "advanced"];
4
4
  export declare const VIEWPORT: readonly ["mobile", "desktop"];
5
- export declare const LANGUAGES: readonly ["de", "fr", "it", "gsw_CH"];
5
+ export declare const TRANSLATION_LANGUAGES: readonly ["de", "fr", "it", "gsw_CH"];
6
6
  export type SettingsGroup = (typeof SETTINGS_GROUP)[number];
7
7
  export type Viewport = (typeof VIEWPORT)[number];
@@ -8,4 +8,4 @@ export const SETTINGS_GROUP = [
8
8
  "advanced"
9
9
  ];
10
10
  export const VIEWPORT = ["mobile", "desktop"];
11
- export const LANGUAGES = ["de", "fr", "it", "gsw_CH"];
11
+ export const TRANSLATION_LANGUAGES = ["de", "fr", "it", "gsw_CH"];
@@ -37,7 +37,7 @@ export type FeatureDefinitionSettingMethod<T> = {
37
37
  viewports?: Viewport[];
38
38
  };
39
39
  export type FeatureDefinitionSettingBase<Icon extends string = string> = FeatureDefinitionSettingCheckbox | FeatureDefinitionSettingRadios<Icon> | FeatureDefinitionSettingMethod<any> | FeatureDefinitionSettingSlider;
40
- export type FeatureDefinitionBase<AdapterMethodsType extends string = string, Icon extends string = string, FeatureId extends string = string> = {
40
+ export type FeatureDefinitionBase<AdapterMethodsType extends string = string, Icon extends string = string> = {
41
41
  /**
42
42
  * The unique ID of the feature.
43
43
  */
@@ -54,14 +54,6 @@ export type FeatureDefinitionBase<AdapterMethodsType extends string = string, Ic
54
54
  * Description of the feature.
55
55
  */
56
56
  description?: string;
57
- /**
58
- * Dependencies of the feature.
59
- *
60
- * Loads this feature only after all of the given features have loaded.
61
- *
62
- * If one of the dependencies does not load, this feature won't load too.
63
- */
64
- dependencies?: FeatureId[];
65
57
  /**
66
58
  * The viewports for which this feature will be loaded.
67
59
  */
@@ -88,4 +80,8 @@ export type FeatureDefinitionBase<AdapterMethodsType extends string = string, Ic
88
80
  * If true, the feature has to be explicitly enabled before it is loaded.
89
81
  */
90
82
  beta?: boolean;
83
+ /**
84
+ * If true, the feature is only enabled in dev mode.
85
+ */
86
+ devOnly?: boolean;
91
87
  };
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@blokkli/editor",
3
3
  "configKey": "blokkli",
4
- "version": "2.0.0-alpha.54",
4
+ "version": "2.0.0-alpha.56",
5
5
  "compatibility": {
6
6
  "nuxt": ">=3.15.0"
7
7
  },
package/dist/module.mjs CHANGED
@@ -10,7 +10,7 @@ import { dirname, resolve, relative } from 'pathe';
10
10
  import micromatch from 'micromatch';
11
11
  import { hash } from 'ohash';
12
12
  import fs__default, { readFileSync, existsSync, readdirSync } from 'node:fs';
13
- import { LANGUAGES, BK_VISIBLE_LANGUAGES, BK_HIDDEN_GLOBALLY } from './global/constants';
13
+ import { TRANSLATION_LANGUAGES, BK_VISIBLE_LANGUAGES, BK_HIDDEN_GLOBALLY } from './global/constants';
14
14
  import { createRequire } from 'node:module';
15
15
  import { d as defineCodeTemplate, a as defineFileTemplate, w as withHelper } from './shared/editor.6D5vApr0.mjs';
16
16
  import { defu, createDefu } from 'defu';
@@ -19,7 +19,7 @@ import 'typescript';
19
19
  import 'oxc-walker';
20
20
 
21
21
  const name = "@blokkli/editor";
22
- const version = "2.0.0-alpha.54";
22
+ const version = "2.0.0-alpha.56";
23
23
 
24
24
  function validateOption(optionKey, option, icons) {
25
25
  const errors = [];
@@ -1540,12 +1540,14 @@ const USED_MATERIAL_ICONS = [
1540
1540
  "bk_mdi_join",
1541
1541
  "bk_mdi_keyboard_arrow_down",
1542
1542
  "bk_mdi_keyboard_command_key",
1543
+ "bk_mdi_laptop_mac",
1543
1544
  "bk_mdi_lists",
1544
1545
  "bk_mdi_lock",
1545
1546
  "bk_mdi_logo_dev",
1546
1547
  "bk_mdi_menu",
1547
1548
  "bk_mdi_mobile",
1548
1549
  "bk_mdi_mobile_rotate",
1550
+ "bk_mdi_monitor",
1549
1551
  "bk_mdi_newspaper",
1550
1552
  "bk_mdi_open_in_new",
1551
1553
  "bk_mdi_palette",
@@ -1562,6 +1564,7 @@ const USED_MATERIAL_ICONS = [
1562
1564
  "bk_mdi_redo",
1563
1565
  "bk_mdi_remove",
1564
1566
  "bk_mdi_replay",
1567
+ "bk_mdi_resize",
1565
1568
  "bk_mdi_robot",
1566
1569
  "bk_mdi_save",
1567
1570
  "bk_mdi_school-fill",
@@ -1580,6 +1583,7 @@ const USED_MATERIAL_ICONS = [
1580
1583
  "bk_mdi_swap_horiz",
1581
1584
  "bk_mdi_swap_horizontal_circle",
1582
1585
  "bk_mdi_swap_vert",
1586
+ "bk_mdi_tablet",
1583
1587
  "bk_mdi_text_compare",
1584
1588
  "bk_mdi_text_select_end",
1585
1589
  "bk_mdi_texture",
@@ -1684,6 +1688,9 @@ const features = defineCodeTemplate(
1684
1688
  const declarations = [];
1685
1689
  const imports = /* @__PURE__ */ new Map();
1686
1690
  for (const feature of features) {
1691
+ if (feature.definition.devOnly && !ctx.helper.isDev) {
1692
+ continue;
1693
+ }
1687
1694
  const componentVarName = toValidVariableName(`component_${feature.id}`);
1688
1695
  const declarationVarName = toValidVariableName(`feature_${feature.id}`);
1689
1696
  declarations.push(
@@ -1761,43 +1768,35 @@ const TRANSLATIONS_DIR = "./runtime/editor/translations";
1761
1768
  const translations = defineCodeTemplate(
1762
1769
  "translations",
1763
1770
  (ctx) => {
1764
- const imports = LANGUAGES.map((lang) => {
1771
+ const userTranslations = ctx.helper.options.translations;
1772
+ const hasUserTranslations = userTranslations && Object.keys(userTranslations).length > 0;
1773
+ const loaderEntries = TRANSLATION_LANGUAGES.map((lang) => {
1765
1774
  const relativePath = ctx.helper.toModuleBuildRelative(
1766
1775
  ctx.helper.resolvers.module.resolve(`${TRANSLATIONS_DIR}/${lang}.json`)
1767
1776
  );
1768
- return `import raw_${lang} from '${relativePath}'`;
1769
- }).join("\n");
1770
- const userTranslations = ctx.helper.options.translations;
1771
- const processedEntries = LANGUAGES.map((lang) => {
1772
- return ` '${lang}': Object.fromEntries(
1773
- Object.entries(raw_${lang}).map(([k, v]) => [k, v.translation])
1774
- )`;
1777
+ const body = hasUserTranslations ? `defu(userTranslations['${lang}'] ?? {}, mod.default)` : `mod.default`;
1778
+ return ` '${lang}': async () => {
1779
+ const mod = await import('${relativePath}')
1780
+ return ${body}
1781
+ }`;
1775
1782
  }).join(",\n");
1776
- const hasUserTranslations = userTranslations && Object.keys(userTranslations).length > 0;
1777
- if (hasUserTranslations) {
1778
- return `import { defu } from 'defu'
1779
- ${imports}
1783
+ const preamble = hasUserTranslations ? `import { defu } from 'defu'
1780
1784
 
1781
- const defaultTranslations = {
1782
- ${processedEntries}
1783
- }
1785
+ const userTranslations = ${JSON.stringify(userTranslations)}
1784
1786
 
1785
- export const translations = defu(${JSON.stringify(userTranslations)}, defaultTranslations)
1786
- `;
1787
- }
1788
- return `${imports}
1789
-
1790
- export const translations = {
1791
- ${processedEntries}
1787
+ ` : "";
1788
+ return `${preamble}export const translationLoaders = {
1789
+ ${loaderEntries}
1792
1790
  }
1793
1791
  `;
1794
1792
  },
1795
1793
  () => {
1796
- const typeUnion = LANGUAGES.map((lang) => `'${lang}'`).join(" | ");
1794
+ const typeUnion = ["en", ...TRANSLATION_LANGUAGES].map((lang) => `'${lang}'`).join(" | ");
1797
1795
  return `
1798
1796
  export type InterfaceLanguage = ${typeUnion}
1799
1797
  export type TranslationMap = Record<string, string>
1800
- export const translations: Record<InterfaceLanguage, TranslationMap>
1798
+ export type TranslationLoaders = Partial<Record<InterfaceLanguage, () => Promise<TranslationMap>>>
1799
+ export const translationLoaders: TranslationLoaders
1801
1800
  `;
1802
1801
  }
1803
1802
  );
@@ -3071,10 +3070,9 @@ export default definitions
3071
3070
  if (!file.definition) {
3072
3071
  continue;
3073
3072
  }
3074
- if (isBlock(file.definition)) {
3075
- continue;
3073
+ if (isFragment(file.definition)) {
3074
+ fragmentNames.push(`'${file.definition.name}'`);
3076
3075
  }
3077
- fragmentNames.push(`'${file.definition.name}'`);
3078
3076
  }
3079
3077
  return `
3080
3078
  import type { GlobalOptionsKey } from '#blokkli-build/generated-types'
@@ -3905,12 +3903,7 @@ class FeatureCollector extends Collector {
3905
3903
  );
3906
3904
  }
3907
3905
  getEnabledFeatures() {
3908
- return [...this.files.values()].filter((v) => v.isEnabled()).map((v) => v.getDefinition()).filter(falsy).filter((v) => !this.disabledFeatures.has(v.id)).filter((v) => {
3909
- if (!this.helper.isDev && v.id === "dev-mode") {
3910
- return false;
3911
- }
3912
- return true;
3913
- });
3906
+ return [...this.files.values()].filter((v) => v.isEnabled()).map((v) => v.getDefinition()).filter(falsy).filter((v) => !this.disabledFeatures.has(v.id));
3914
3907
  }
3915
3908
  async init() {
3916
3909
  const builtinFeatures = await resolveFiles(
@@ -109,13 +109,12 @@ class AgentCollector extends Collector {
109
109
  }
110
110
  }
111
111
 
112
- function createClientTemplate(toolCollector, promptCollector, skillsCollector, options, routes) {
112
+ function createClientTemplate(toolCollector, skillsCollector, options, routes) {
113
113
  return defineCodeTemplate(
114
114
  "agent-client",
115
115
  (ctx) => {
116
116
  const rel = (p) => ctx.helper.toModuleBuildRelative(p).replace(/\.ts$/, "");
117
117
  const tools = toolCollector.getItems();
118
- const prompts = promptCollector.getItems();
119
118
  const imports = [];
120
119
  const exports$1 = [];
121
120
  for (const tool of tools) {
@@ -127,20 +126,6 @@ function createClientTemplate(toolCollector, promptCollector, skillsCollector, o
127
126
  exports$1.push(
128
127
  `export const mcpTools = [
129
128
  ${tools.map((t) => t.importName).join(",\n ")}
130
- ]`
131
- );
132
- }
133
- for (const prompt of prompts) {
134
- imports.push(
135
- `import ${prompt.importName} from '${rel(prompt.filePath)}'`
136
- );
137
- }
138
- if (prompts.length === 0) {
139
- exports$1.push("export const agentPrompts = []");
140
- } else {
141
- exports$1.push(
142
- `export const agentPrompts = [
143
- ${prompts.map((p) => p.importName).join(",\n ")}
144
129
  ]`
145
130
  );
146
131
  }
@@ -148,9 +133,6 @@ function createClientTemplate(toolCollector, promptCollector, skillsCollector, o
148
133
  `export const defaultPrompts = ${JSON.stringify(options.defaultPrompts ?? [])}`
149
134
  );
150
135
  exports$1.push(`export const models = ${JSON.stringify(options.models)}`);
151
- exports$1.push(
152
- `export const agentName = ${JSON.stringify(options.agentName ?? "Superbl\xF6kkli")}`
153
- );
154
136
  exports$1.push(
155
137
  `export const hasWebFetch = ${JSON.stringify(!!options.allowedFetchOrigins)}`
156
138
  );
@@ -200,7 +182,7 @@ ${entries}
200
182
  agentToolNameType = "string";
201
183
  }
202
184
  return `import type { z } from 'zod'
203
- import type { McpToolDefinition, AgentPromptItem } from '#blokkli/agent/app/types'
185
+ import type { McpToolDefinition } from '#blokkli/agent/app/types'
204
186
  import type { AgentModelDefinition } from '#blokkli/agent/shared/types'
205
187
 
206
188
  type _ToolParams<T> = T extends { paramsSchema: infer P extends z.ZodType } ? z.infer<P> : never
@@ -216,9 +198,7 @@ export const routeFetch: string
216
198
  export const routeStream: string
217
199
  export const routeRoute: string
218
200
  export const mcpTools: McpToolDefinition[]
219
- export const agentPrompts: AgentPromptItem[]
220
201
  export const defaultPrompts: string[]
221
- export const agentName: string
222
202
  export const models: AgentModelDefinition[]
223
203
  export const hasWebFetch: boolean
224
204
  export const toolNames: readonly AgentToolName[]
@@ -228,6 +208,48 @@ export const skillNames: readonly AgentSkillName[]
228
208
  );
229
209
  }
230
210
 
211
+ function createPromptsTemplate(promptCollector, options) {
212
+ return defineCodeTemplate(
213
+ "agent-prompts",
214
+ (ctx) => {
215
+ const rel = (p) => ctx.helper.toModuleBuildRelative(p).replace(/\.ts$/, "");
216
+ const prompts = promptCollector.getItems();
217
+ const imports = [];
218
+ const exports$1 = [];
219
+ for (const prompt of prompts) {
220
+ imports.push(
221
+ `import ${prompt.importName} from '${rel(prompt.filePath)}'`
222
+ );
223
+ }
224
+ if (prompts.length === 0) {
225
+ exports$1.push("export const agentPrompts = []");
226
+ } else {
227
+ exports$1.push(
228
+ `export const agentPrompts = [
229
+ ${prompts.map((p) => p.importName).join(",\n ")}
230
+ ]`
231
+ );
232
+ }
233
+ exports$1.push(
234
+ `export const agentName = ${JSON.stringify(options.agentName ?? "Superbl\xF6kkli")}`
235
+ );
236
+ const parts = [];
237
+ if (imports.length > 0) {
238
+ parts.push(imports.join("\n"));
239
+ }
240
+ parts.push(exports$1.join("\n"));
241
+ return parts.join("\n\n") + "\n";
242
+ },
243
+ () => {
244
+ return `import type { AgentPromptItem } from '#blokkli/agent/app/types'
245
+
246
+ export const agentPrompts: AgentPromptItem[]
247
+ export const agentName: string
248
+ `;
249
+ }
250
+ );
251
+ }
252
+
231
253
  function createServerTemplate(options) {
232
254
  const {
233
255
  moduleOptions,
@@ -675,14 +697,9 @@ export default defineNuxtConfig({
675
697
  });
676
698
  ctx.context.addCollector(skillsCollector);
677
699
  ctx.context.addTemplate(
678
- createClientTemplate(
679
- mcpTools,
680
- promptsCollector,
681
- skillsCollector,
682
- options,
683
- routes
684
- )
700
+ createClientTemplate(mcpTools, skillsCollector, options, routes)
685
701
  );
702
+ ctx.context.addTemplate(createPromptsTemplate(promptsCollector, options));
686
703
  const moduleSystemPromptsDir = moduleResolver.resolve(
687
704
  "./runtime/server/default-system-prompts"
688
705
  );
@@ -281,9 +281,10 @@ export default function(app, adapter, agentName) {
281
281
  const ctx = createToolContext();
282
282
  const resolved = await resolveTools(mcpTools, ctx);
283
283
  toolMap = createToolMap(resolved);
284
- const toolNames = getToolInfoForServer(
284
+ const toolNames = await getToolInfoForServer(
285
285
  resolved,
286
286
  state.editMode.value,
287
+ app,
287
288
  adapter
288
289
  );
289
290
  let contentSearchTabs;
@@ -0,0 +1,19 @@
1
+ import type { PendingPromptRequest } from './types.js';
2
+ import type { FullBlokkliAdapter } from '#blokkli/editor/adapter';
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ declare const __VLS_export: import("vue").DefineComponent<{
6
+ isShown: boolean;
7
+ agentName: string;
8
+ adapter: FullBlokkliAdapter<any>;
9
+ pendingPromptRequest: PendingPromptRequest | null;
10
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ consumed: () => any;
12
+ }, string, import("vue").PublicProps, Readonly<{
13
+ isShown: boolean;
14
+ agentName: string;
15
+ adapter: FullBlokkliAdapter<any>;
16
+ pendingPromptRequest: PendingPromptRequest | null;
17
+ }> & Readonly<{
18
+ onConsumed?: (() => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -0,0 +1,195 @@
1
+ <template>
2
+ <AgentPanel
3
+ :is-shown
4
+ :agent-name
5
+ :conversation
6
+ :active-item
7
+ :is-thinking
8
+ :is-processing
9
+ :is-connected
10
+ :has-been-ready
11
+ :pending-tool-call
12
+ :pending-mutation
13
+ :auto-approve
14
+ :conversation-list
15
+ :show-conversation-list
16
+ :plan
17
+ :tool-details
18
+ :usage-turns="usageTurns"
19
+ :page-context="pageContext"
20
+ :supports-feedback="!!adapter.submitConversationFeedback"
21
+ :feedback-item-ids="feedbackItemIds"
22
+ @connect="connect"
23
+ @send-prompt="sendPrompt"
24
+ @retry="retry"
25
+ @cancel="cancel"
26
+ @approve="approve"
27
+ @reject="reject"
28
+ @set-auto-approve="setAutoApprove"
29
+ @new-conversation="newConversation"
30
+ @get-transcript="getTranscript"
31
+ @tool-component-done="onToolComponentDone"
32
+ @switch-conversation="switchConversation"
33
+ @delete-conversation="deleteConversation"
34
+ @submit-feedback="onSubmitFeedback"
35
+ @feedback-done="onFeedbackDone"
36
+ @show-conversations="onShowConversations"
37
+ @hide-conversations="onHideConversations"
38
+ @approve-plan="approvePlan"
39
+ @reject-plan="rejectPlan"
40
+ />
41
+
42
+ <Teleport :to="ui.mainLayoutElement.value">
43
+ <BlokkliTransition name="slide-up">
44
+ <DialogModal
45
+ v-if="showTranscript"
46
+ id="agent-transcript"
47
+ title="Agent Transcript"
48
+ :width="900"
49
+ hide-buttons
50
+ full-screen
51
+ @cancel="showTranscript = false"
52
+ >
53
+ <AgentTranscript
54
+ v-if="transcriptContent"
55
+ :transcript="transcriptContent"
56
+ />
57
+ </DialogModal>
58
+ </BlokkliTransition>
59
+ </Teleport>
60
+ </template>
61
+
62
+ <script setup>
63
+ import {
64
+ useBlokkli,
65
+ onBeforeUnmount,
66
+ watch,
67
+ defineAsyncComponent
68
+ } from "#imports";
69
+ import { DialogModal, BlokkliTransition } from "#blokkli/editor/components";
70
+ import agentProvider from "#blokkli/agent/app/composables/agentProvider";
71
+ import AgentPanel from "./Panel/index.vue";
72
+ const AgentTranscript = defineAsyncComponent(
73
+ () => import("./Transcript/index.vue")
74
+ );
75
+ const props = defineProps({
76
+ isShown: { type: Boolean, required: true },
77
+ agentName: { type: String, required: true },
78
+ adapter: { type: Object, required: true },
79
+ pendingPromptRequest: { type: [Object, null], required: true }
80
+ });
81
+ const emit = defineEmits(["consumed"]);
82
+ const app = useBlokkli();
83
+ const { ui } = app;
84
+ const {
85
+ connect,
86
+ disconnect,
87
+ conversation,
88
+ activeItem,
89
+ isProcessing,
90
+ isThinking,
91
+ isConnected,
92
+ hasBeenReady,
93
+ autoApprove,
94
+ pendingMutation,
95
+ pendingToolCall,
96
+ plan,
97
+ approvePlan,
98
+ rejectPlan,
99
+ usageTurns,
100
+ sendPrompt,
101
+ runToolForPrompt,
102
+ retry,
103
+ approve,
104
+ reject,
105
+ setAutoApprove,
106
+ cancel,
107
+ newConversation,
108
+ getTranscript,
109
+ onToolComponentDone,
110
+ transcriptContent,
111
+ showTranscript,
112
+ toolDetails,
113
+ conversationList,
114
+ showConversationList,
115
+ switchConversation,
116
+ deleteConversation,
117
+ refreshConversationList,
118
+ activeConversationId,
119
+ feedbackItemIds,
120
+ pageContext
121
+ } = agentProvider(app, props.adapter, props.agentName);
122
+ async function onSubmitFeedback(rating, comment) {
123
+ if (!props.adapter.submitConversationFeedback) return;
124
+ const conversationId = activeConversationId.value;
125
+ if (!conversationId) return;
126
+ const lastItem = conversation.value[conversation.value.length - 1];
127
+ if (!lastItem) return;
128
+ try {
129
+ await props.adapter.submitConversationFeedback({
130
+ conversationId,
131
+ rating,
132
+ lastItemId: lastItem.id,
133
+ comment
134
+ });
135
+ } catch (e) {
136
+ console.warn("[blokkli agent] Failed to submit feedback:", e);
137
+ }
138
+ }
139
+ function onFeedbackDone() {
140
+ const lastItem = conversation.value[conversation.value.length - 1];
141
+ if (lastItem) {
142
+ feedbackItemIds.value.add(lastItem.id);
143
+ }
144
+ }
145
+ async function onShowConversations() {
146
+ await refreshConversationList();
147
+ showConversationList.value = true;
148
+ }
149
+ function onHideConversations() {
150
+ showConversationList.value = false;
151
+ }
152
+ watch(
153
+ () => props.pendingPromptRequest,
154
+ async (request) => {
155
+ if (!request) return;
156
+ emit("consumed");
157
+ const { prompt, selectedUuids } = request;
158
+ const promptText = prompt.getPrompt(app);
159
+ const userPromptText = prompt.getUserPrompt?.(app);
160
+ let preSeededResults = void 0;
161
+ let autoExecuteTools = void 0;
162
+ if (prompt.preExecute) {
163
+ const preResult = await prompt.preExecute({
164
+ app,
165
+ selectedUuids,
166
+ runTool: runToolForPrompt
167
+ });
168
+ if (preResult) {
169
+ preSeededResults = preResult.preSeededResults;
170
+ autoExecuteTools = preResult.autoExecuteTools;
171
+ }
172
+ }
173
+ sendPrompt(
174
+ promptText,
175
+ userPromptText,
176
+ selectedUuids,
177
+ void 0,
178
+ prompt.tools,
179
+ prompt.skills,
180
+ preSeededResults,
181
+ autoExecuteTools
182
+ );
183
+ },
184
+ { immediate: true }
185
+ );
186
+ onBeforeUnmount(() => {
187
+ disconnect();
188
+ });
189
+ </script>
190
+
191
+ <script>
192
+ export default {
193
+ name: "AgentContainer"
194
+ };
195
+ </script>
@@ -0,0 +1,19 @@
1
+ import type { PendingPromptRequest } from './types.js';
2
+ import type { FullBlokkliAdapter } from '#blokkli/editor/adapter';
3
+ declare const _default: typeof __VLS_export;
4
+ export default _default;
5
+ declare const __VLS_export: import("vue").DefineComponent<{
6
+ isShown: boolean;
7
+ agentName: string;
8
+ adapter: FullBlokkliAdapter<any>;
9
+ pendingPromptRequest: PendingPromptRequest | null;
10
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
11
+ consumed: () => any;
12
+ }, string, import("vue").PublicProps, Readonly<{
13
+ isShown: boolean;
14
+ agentName: string;
15
+ adapter: FullBlokkliAdapter<any>;
16
+ pendingPromptRequest: PendingPromptRequest | null;
17
+ }> & Readonly<{
18
+ onConsumed?: (() => any) | undefined;
19
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;