@blokkli/editor 2.0.0-alpha.35 → 2.0.0-alpha.36
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.
- package/dist/global/types/blockOptions.d.ts +9 -2
- package/dist/global/types/definitions.d.ts +12 -5
- package/dist/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +56 -4
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +38 -20
- package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +2 -2
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +3 -3
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +34 -60
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.d.vue.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +138 -0
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue.d.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue +5 -1
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +175 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +5 -0
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +10 -1
- package/dist/modules/agent/runtime/app/tools/schemas.js +36 -23
- package/dist/modules/agent/runtime/server/Session.d.ts +4 -2
- package/dist/modules/agent/runtime/server/Session.js +61 -57
- package/dist/modules/agent/runtime/server/agentPrompt.d.ts +9 -1
- package/dist/modules/agent/runtime/server/agentPrompt.js +26 -0
- package/dist/modules/agent/runtime/shared/types.d.ts +35 -1
- package/dist/modules/charts/index.d.mts +35 -0
- package/dist/modules/charts/index.mjs +43 -0
- package/dist/modules/charts/runtime/blokkli/skills/charts.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/skills/charts.js +42 -0
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +63 -0
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +98 -0
- package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.js +86 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.js +74 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.js +42 -0
- package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.js +101 -0
- package/dist/modules/charts/runtime/chartTypes/area.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/area.js +68 -0
- package/dist/modules/charts/runtime/chartTypes/bar.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/bar.js +76 -0
- package/dist/modules/charts/runtime/chartTypes/define.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/define.js +3 -0
- package/dist/modules/charts/runtime/chartTypes/donut.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/donut.js +45 -0
- package/dist/modules/charts/runtime/chartTypes/heatmap.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/heatmap.js +54 -0
- package/dist/modules/charts/runtime/chartTypes/index.d.ts +21 -0
- package/dist/modules/charts/runtime/chartTypes/index.js +47 -0
- package/dist/modules/charts/runtime/chartTypes/line.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/line.js +68 -0
- package/dist/modules/charts/runtime/chartTypes/pie.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/pie.js +28 -0
- package/dist/modules/charts/runtime/chartTypes/radar.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/radar.js +52 -0
- package/dist/modules/charts/runtime/chartTypes/radialBar.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/radialBar.js +44 -0
- package/dist/modules/charts/runtime/chartTypes/shared.d.ts +52 -0
- package/dist/modules/charts/runtime/chartTypes/shared.js +103 -0
- package/dist/modules/charts/runtime/chartTypes/types.d.ts +29 -0
- package/dist/modules/charts/runtime/chartTypes/types.js +0 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.d.vue.ts +4 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +120 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue.d.ts +4 -0
- package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.d.vue.ts +3 -0
- package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.vue +29 -0
- package/dist/modules/charts/runtime/components/Fragment/BlokkliChart.vue.d.ts +3 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.d.vue.ts +15 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue +97 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue.d.ts +15 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.d.vue.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue +34 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue.d.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.d.vue.ts +12 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +49 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue.d.ts +12 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.d.vue.ts +19 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue +90 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue.d.ts +19 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.d.vue.ts +23 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +224 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue.d.ts +23 -0
- package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.d.vue.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue +61 -0
- package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue.d.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.d.vue.ts +8 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue +23 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue.d.ts +8 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +243 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +17 -0
- package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.js +90 -0
- package/dist/modules/charts/runtime/features/charts/index.d.vue.ts +3 -0
- package/dist/modules/charts/runtime/features/charts/index.vue +72 -0
- package/dist/modules/charts/runtime/features/charts/index.vue.d.ts +3 -0
- package/dist/modules/charts/runtime/helpers/index.d.ts +1 -0
- package/dist/modules/charts/runtime/helpers/index.js +17 -0
- package/dist/modules/charts/runtime/types.d.ts +51 -0
- package/dist/modules/charts/runtime/types.js +64 -0
- package/dist/modules/drupal/graphql/features/fragments.graphql +2 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/runtime/adapter/index.js +12 -8
- package/dist/modules/table-of-contents/index.d.mts +11 -0
- package/dist/modules/table-of-contents/index.mjs +24 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.d.vue.ts +44 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue +43 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue.d.ts +44 -0
- package/dist/modules/table-of-contents/runtime/types/index.d.ts +4 -0
- package/dist/modules/table-of-contents/runtime/types/index.js +0 -0
- package/dist/runtime/components/Blocks/Fragment/index.vue +6 -2
- package/dist/runtime/components/BlokkliItem.vue +8 -3
- package/dist/runtime/components/BlokkliProvider.d.vue.ts +7 -0
- package/dist/runtime/components/BlokkliProvider.vue +7 -1
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +7 -0
- package/dist/runtime/composables/useBlokkliHelper.js +4 -2
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +4 -20
- package/dist/runtime/editor/components/Banner/index.d.vue.ts +12 -2
- package/dist/runtime/editor/components/Banner/index.vue +4 -2
- package/dist/runtime/editor/components/Banner/index.vue.d.ts +12 -2
- package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +27 -0
- package/dist/runtime/editor/components/Dropdown/index.vue +107 -0
- package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +27 -0
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue +1 -1
- package/dist/runtime/editor/components/EditProvider.d.vue.ts +2 -0
- package/dist/runtime/editor/components/EditProvider.vue +4 -3
- package/dist/runtime/editor/components/EditProvider.vue.d.ts +2 -0
- package/dist/runtime/editor/components/Form/Radio/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Radio/index.vue +3 -2
- package/dist/runtime/editor/components/Form/Radio/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/ItemIcon/index.vue +10 -2
- package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +13 -3
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +15 -7
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +13 -3
- package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +2 -0
- package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
- package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +2 -0
- package/dist/runtime/editor/components/ShortcutIndicator/index.vue +1 -1
- package/dist/runtime/editor/components/index.d.ts +3 -1
- package/dist/runtime/editor/components/index.js +4 -0
- package/dist/runtime/editor/composables/onElementResize.js +0 -1
- package/dist/runtime/editor/composables/useEditableFieldOverride.js +4 -5
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +7 -0
- package/dist/runtime/editor/features/add-list/Help/Item.vue +5 -2
- package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
- package/dist/runtime/editor/features/clipboard/index.vue +1 -1
- package/dist/runtime/editor/features/debug/index.vue +1 -1
- package/dist/runtime/editor/features/dev-mode/index.vue +86 -2
- package/dist/runtime/editor/features/edit/index.vue +20 -0
- package/dist/runtime/editor/features/fragments/types.d.ts +1 -0
- package/dist/runtime/editor/features/hover/Renderer/index.vue +30 -3
- package/dist/runtime/editor/features/hover/index.vue +1 -1
- package/dist/runtime/editor/features/options/Form/Checkbox/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +3 -3
- package/dist/runtime/editor/features/options/Form/Checkbox/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +5 -5
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Item.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Item.vue +14 -48
- package/dist/runtime/editor/features/options/Form/Item.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Number/index.d.vue.ts +3 -3
- package/dist/runtime/editor/features/options/Form/Number/index.vue +7 -17
- package/dist/runtime/editor/features/options/Form/Number/index.vue.d.ts +3 -3
- package/dist/runtime/editor/features/options/Form/Range/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Range/index.vue +4 -4
- package/dist/runtime/editor/features/options/Form/Range/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/index.vue +10 -5
- package/dist/runtime/editor/features/selection/index.vue +2 -2
- package/dist/runtime/editor/features/transform/index.vue +1 -3
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +1 -1
- package/dist/runtime/editor/providers/definition.d.ts +2 -2
- package/dist/runtime/editor/providers/definition.js +7 -1
- package/dist/runtime/editor/providers/dom.d.ts +5 -0
- package/dist/runtime/editor/providers/dom.js +11 -2
- package/dist/runtime/editor/providers/fields.d.ts +19 -1
- package/dist/runtime/editor/providers/fields.js +54 -2
- package/dist/runtime/editor/translations/de.json +269 -1
- package/dist/runtime/editor/translations/fr.json +269 -1
- package/dist/runtime/editor/translations/gsw_CH.json +269 -1
- package/dist/runtime/editor/translations/it.json +269 -1
- package/dist/runtime/helpers/imports/index.d.ts +8 -1
- package/dist/runtime/helpers/imports/index.js +15 -6
- package/dist/runtime/helpers/injections.d.ts +5 -1
- package/dist/runtime/helpers/injections.js +3 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +14 -0
- package/dist/runtime/types/definitions.d.ts +8 -5
- package/dist/runtime/types/provider.d.ts +2 -0
- package/dist/shared/editor.6D5vApr0.mjs +30 -0
- package/dist/shared/{editor.DMFfaLVE.mjs → editor.BFIzNSQM.mjs} +1 -30
- package/dist/shared/{editor.Iax3GCvt.d.mts → editor.CWQIFIEQ.d.mts} +22 -0
- package/dist/types.d.mts +1 -1
- package/package.json +17 -1
- package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +0 -104
- /package/dist/modules/agent/runtime/app/tools/{get_available_bundles → get_bundle_info}/index.d.ts +0 -0
- /package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.d.vue.ts +0 -0
- /package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue.d.ts +0 -0
|
@@ -344,7 +344,14 @@ type DefinitionOptionRadiosBase<Icon extends string = string> = {
|
|
|
344
344
|
*/
|
|
345
345
|
group?: string;
|
|
346
346
|
} & (DefinitionOptionRadiosColors | DefinitionOptionRadiosGrid | DefinitionOptionRadiosRadios | DefinitionOptionRadiosIconsBase<Icon>);
|
|
347
|
-
|
|
347
|
+
type DefinitionOptionJson = {
|
|
348
|
+
type: 'json';
|
|
349
|
+
label: string;
|
|
350
|
+
default: string;
|
|
351
|
+
description?: string;
|
|
352
|
+
group?: string;
|
|
353
|
+
};
|
|
354
|
+
export type BlockOptionDefinitionBase<Icon extends string = string> = DefinitionOptionJson | DefinitionOptionColor | DefinitionOptionCheckbox | DefinitionOptionCheckboxes | DefinitionOptionRadiosBase<Icon> | DefinitionOptionText | DefinitionOptionRange | DefinitionOptionNumber | DefinitionOptionDateTimeLocal;
|
|
348
355
|
/**
|
|
349
356
|
* Runtime block option array with validation data.
|
|
350
357
|
* The third element varies by option type:
|
|
@@ -353,7 +360,7 @@ export type BlockOptionDefinitionBase<Icon extends string = string> = Definition
|
|
|
353
360
|
* - datetime-local: optional [min?, max?] tuple
|
|
354
361
|
* - other types: no third element
|
|
355
362
|
*/
|
|
356
|
-
export type RuntimeBlockOptionArray = ['text', string] | ['checkbox', boolean] | ['color', `#${string}`] | ['radios', string, string[]] | ['checkboxes', string[], string[]] | ['number', number, [number, number]] | ['range', number, [number, number]] | ['datetime-local', string | undefined] | [
|
|
363
|
+
export type RuntimeBlockOptionArray = ['text', string] | ['json', string] | ['checkbox', boolean] | ['color', `#${string}`] | ['radios', string, string[]] | ['checkboxes', string[], string[]] | ['number', number, [number, number]] | ['range', number, [number, number]] | ['datetime-local', string | undefined] | [
|
|
357
364
|
'datetime-local',
|
|
358
365
|
string | undefined,
|
|
359
366
|
[
|
|
@@ -15,7 +15,14 @@ export type BlockDefinitionRenderForFieldListBase<FieldListTypes extends string
|
|
|
15
15
|
export type BlockDefinitionRenderForFieldListTypeBase<FieldListTypes extends string = string> = {
|
|
16
16
|
fieldListType: FieldListTypes;
|
|
17
17
|
};
|
|
18
|
-
export type
|
|
18
|
+
export type BlockDefinitionRenderForProviderTypeBase<ProviderType extends string = string> = {
|
|
19
|
+
providerType: ProviderType;
|
|
20
|
+
};
|
|
21
|
+
export type PropsFieldMapping = {
|
|
22
|
+
type: 'editable' | 'droppable' | 'field';
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
export type BlockDefinitionRenderForBase<BundleWithNested extends string = string, FieldListTypes extends string = string, ProviderType extends string = string> = BlockDefinitionRenderForParentBase<BundleWithNested> | BlockDefinitionRenderForFieldListBase<FieldListTypes> | BlockDefinitionRenderForFieldListTypeBase<FieldListTypes> | BlockDefinitionRenderForProviderTypeBase<ProviderType>;
|
|
19
26
|
export type BlokkliDefinitionInputEditorBase<Options extends BlockDefinitionOptionsInputBase = BlockDefinitionOptionsInputBase, Icon extends string = string, PropsType = Record<string, any>> = {
|
|
20
27
|
/**
|
|
21
28
|
* The icon rendered in the editor.
|
|
@@ -152,7 +159,7 @@ export type BlokkliDefinitionInputEditorBase<Options extends BlockDefinitionOpti
|
|
|
152
159
|
*/
|
|
153
160
|
mapDiffProps?: (props?: PropsType) => Record<string, string>;
|
|
154
161
|
};
|
|
155
|
-
export type BlockDefinitionInputBase<Options extends BlockDefinitionOptionsInputBase = BlockDefinitionOptionsInputBase, GlobalOptions extends string[] | undefined = string[], Bundle extends string = string, ChunkNames extends string = string, BundleWithNested extends string = string, FieldListTypes extends string = string, Icon extends string = string, BundlePropsMap extends Record<string, Record<string, any>> = Record<string, Record<string, any
|
|
162
|
+
export type BlockDefinitionInputBase<Options extends BlockDefinitionOptionsInputBase = BlockDefinitionOptionsInputBase, GlobalOptions extends string[] | undefined = string[], Bundle extends string = string, ChunkNames extends string = string, BundleWithNested extends string = string, FieldListTypes extends string = string, Icon extends string = string, BundlePropsMap extends Record<string, Record<string, any>> = Record<string, Record<string, any>>, ProviderTypes extends string = string> = {
|
|
156
163
|
/**
|
|
157
164
|
* The bundle ID of the block, e.g. "text" or "section_title".
|
|
158
165
|
*/
|
|
@@ -162,7 +169,7 @@ export type BlockDefinitionInputBase<Options extends BlockDefinitionOptionsInput
|
|
|
162
169
|
* If a bundle is defined, then this component will be rendered if the
|
|
163
170
|
* parent matches the given bundle.
|
|
164
171
|
*/
|
|
165
|
-
renderFor?: BlockDefinitionRenderForBase<BundleWithNested, FieldListTypes> | BlockDefinitionRenderForBase<BundleWithNested, FieldListTypes>[];
|
|
172
|
+
renderFor?: BlockDefinitionRenderForBase<BundleWithNested, FieldListTypes, ProviderTypes> | BlockDefinitionRenderForBase<BundleWithNested, FieldListTypes, ProviderTypes>[];
|
|
166
173
|
/**
|
|
167
174
|
* The name of the chunk group.
|
|
168
175
|
*
|
|
@@ -216,7 +223,7 @@ export type BlockDefinitionInputBase<Options extends BlockDefinitionOptionsInput
|
|
|
216
223
|
* </script>
|
|
217
224
|
* ```
|
|
218
225
|
*/
|
|
219
|
-
propsFieldMapping?: Bundle extends keyof BundlePropsMap ?
|
|
226
|
+
propsFieldMapping?: Bundle extends keyof BundlePropsMap ? Record<keyof BundlePropsMap[Bundle], PropsFieldMapping | null> : Record<string, PropsFieldMapping | null>;
|
|
220
227
|
};
|
|
221
228
|
export type FragmentDefinitionInputBase<Options extends BlockDefinitionOptionsInputBase = BlockDefinitionOptionsInputBase, GlobalOptions extends string[] | undefined = string[], ChunkNames extends string = string, Icon extends string = string> = {
|
|
222
229
|
/**
|
|
@@ -274,5 +281,5 @@ export type ProviderDefinitionInputBase<Options extends BlockDefinitionOptionsIn
|
|
|
274
281
|
* These options will be merged with the component-specific options.
|
|
275
282
|
*/
|
|
276
283
|
globalOptions?: GlobalOptions;
|
|
277
|
-
propsFieldMapping?: Record<string,
|
|
284
|
+
propsFieldMapping?: Record<string, PropsFieldMapping | null>;
|
|
278
285
|
};
|
package/dist/module.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NuxtModule } from 'nuxt/schema';
|
|
2
|
-
import { M as ModuleOptions } from './shared/editor.
|
|
3
|
-
export { a as ModuleHooks } from './shared/editor.
|
|
2
|
+
import { M as ModuleOptions } from './shared/editor.CWQIFIEQ.mjs';
|
|
3
|
+
export { a as ModuleHooks } from './shared/editor.CWQIFIEQ.mjs';
|
|
4
4
|
import 'consola';
|
|
5
5
|
import '../dist/global/types/definitions.js';
|
|
6
6
|
import '../dist/global/types/theme.js';
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -8,16 +8,17 @@ import * as ts from 'typescript';
|
|
|
8
8
|
import { parseAndWalk } from 'oxc-walker';
|
|
9
9
|
import path__default, { basename, dirname as dirname$1 } from 'node:path';
|
|
10
10
|
import { dirname, resolve, relative } from 'pathe';
|
|
11
|
-
import { C as Collector, a as CollectedFile
|
|
11
|
+
import { C as Collector, a as CollectedFile } from './shared/editor.BFIzNSQM.mjs';
|
|
12
12
|
import micromatch from 'micromatch';
|
|
13
13
|
import { hash } from 'ohash';
|
|
14
14
|
import fs__default, { readFileSync, existsSync, readdirSync } from 'node:fs';
|
|
15
15
|
import { LANGUAGES, BK_VISIBLE_LANGUAGES, BK_HIDDEN_GLOBALLY } from './global/constants';
|
|
16
16
|
import { createRequire } from 'node:module';
|
|
17
|
+
import { d as defineCodeTemplate, a as defineFileTemplate, w as withHelper } from './shared/editor.6D5vApr0.mjs';
|
|
17
18
|
import { defu, createDefu } from 'defu';
|
|
18
19
|
|
|
19
20
|
const name = "@blokkli/editor";
|
|
20
|
-
const version = "2.0.0-alpha.
|
|
21
|
+
const version = "2.0.0-alpha.36";
|
|
21
22
|
|
|
22
23
|
function sortObjectKeys(obj) {
|
|
23
24
|
if (Array.isArray(obj)) {
|
|
@@ -277,6 +278,8 @@ function getVariations(definition) {
|
|
|
277
278
|
return `block:${bundle}__p:${v.parentBundle}`;
|
|
278
279
|
} else if ("fieldList" in v) {
|
|
279
280
|
return `block:${bundle}__f:${v.fieldList}`;
|
|
281
|
+
} else if ("providerType" in v) {
|
|
282
|
+
return `block:${bundle}__t:${v.providerType}`;
|
|
280
283
|
} else {
|
|
281
284
|
return `block:${bundle}__f:${v.fieldListType}`;
|
|
282
285
|
}
|
|
@@ -1140,6 +1143,10 @@ class ModuleHelper {
|
|
|
1140
1143
|
if (!fieldListTypes.includes("default")) {
|
|
1141
1144
|
fieldListTypes.push("default");
|
|
1142
1145
|
}
|
|
1146
|
+
const providerTypes = providedOptions.providerTypes || [];
|
|
1147
|
+
if (!providerTypes.includes("default")) {
|
|
1148
|
+
providerTypes.push("default");
|
|
1149
|
+
}
|
|
1143
1150
|
const chunkNames = providedOptions.chunkNames || [];
|
|
1144
1151
|
if (!chunkNames.includes("global")) {
|
|
1145
1152
|
chunkNames.push("global");
|
|
@@ -1148,6 +1155,7 @@ class ModuleHelper {
|
|
|
1148
1155
|
...providedOptions,
|
|
1149
1156
|
pattern,
|
|
1150
1157
|
fieldListTypes: fieldListTypes.filter(onlyUnique),
|
|
1158
|
+
providerTypes: providerTypes.filter(onlyUnique),
|
|
1151
1159
|
chunkNames: chunkNames.filter(onlyUnique)
|
|
1152
1160
|
};
|
|
1153
1161
|
this.paths.editAdapter = this.findEditAdapterPath();
|
|
@@ -1261,7 +1269,17 @@ class ModuleContext {
|
|
|
1261
1269
|
templates = [];
|
|
1262
1270
|
templateContents = /* @__PURE__ */ new Map();
|
|
1263
1271
|
adapterExtensions = [];
|
|
1272
|
+
featureFragments = /* @__PURE__ */ new Set();
|
|
1264
1273
|
collectors = [];
|
|
1274
|
+
addFeatureFragment(name) {
|
|
1275
|
+
if (this.featureFragments.has(name)) {
|
|
1276
|
+
throw new Error(`A feature fragment with name "${name}" already exists.`);
|
|
1277
|
+
}
|
|
1278
|
+
this.featureFragments.add(name);
|
|
1279
|
+
}
|
|
1280
|
+
getFeatureFragmentNames() {
|
|
1281
|
+
return [...this.featureFragments.values()];
|
|
1282
|
+
}
|
|
1265
1283
|
registerAdapterExtension(namespace, path) {
|
|
1266
1284
|
if (this.adapterExtensions.some((e) => e.namespace === namespace)) {
|
|
1267
1285
|
throw new Error(`Duplicate adapter extension namespace: ${namespace}`);
|
|
@@ -1469,9 +1487,12 @@ function toTypeLiteral(value) {
|
|
|
1469
1487
|
const USED_MATERIAL_ICONS = [
|
|
1470
1488
|
"bk_mdi_account_tree",
|
|
1471
1489
|
"bk_mdi_add",
|
|
1490
|
+
"bk_mdi_add_column_right",
|
|
1472
1491
|
"bk_mdi_add_comment",
|
|
1492
|
+
"bk_mdi_add_row_below",
|
|
1473
1493
|
"bk_mdi_anchor",
|
|
1474
1494
|
"bk_mdi_architecture",
|
|
1495
|
+
"bk_mdi_area_chart",
|
|
1475
1496
|
"bk_mdi_arrow_downward",
|
|
1476
1497
|
"bk_mdi_arrow_drop_down",
|
|
1477
1498
|
"bk_mdi_arrow_left",
|
|
@@ -1504,6 +1525,7 @@ const USED_MATERIAL_ICONS = [
|
|
|
1504
1525
|
"bk_mdi_dock_to_left",
|
|
1505
1526
|
"bk_mdi_dock_to_right",
|
|
1506
1527
|
"bk_mdi_done_all",
|
|
1528
|
+
"bk_mdi_donut_large",
|
|
1507
1529
|
"bk_mdi_drag_pan",
|
|
1508
1530
|
"bk_mdi_edit",
|
|
1509
1531
|
"bk_mdi_exit_to_app",
|
|
@@ -1530,10 +1552,12 @@ const USED_MATERIAL_ICONS = [
|
|
|
1530
1552
|
"bk_mdi_palette",
|
|
1531
1553
|
"bk_mdi_person",
|
|
1532
1554
|
"bk_mdi_person-fill",
|
|
1555
|
+
"bk_mdi_pie_chart",
|
|
1533
1556
|
"bk_mdi_priority_high",
|
|
1534
1557
|
"bk_mdi_publish",
|
|
1535
1558
|
"bk_mdi_qr_code",
|
|
1536
1559
|
"bk_mdi_question_mark",
|
|
1560
|
+
"bk_mdi_radar",
|
|
1537
1561
|
"bk_mdi_radio_button_checked",
|
|
1538
1562
|
"bk_mdi_redo",
|
|
1539
1563
|
"bk_mdi_remove",
|
|
@@ -1548,6 +1572,7 @@ const USED_MATERIAL_ICONS = [
|
|
|
1548
1572
|
"bk_mdi_sentiment_dissatisfied",
|
|
1549
1573
|
"bk_mdi_sentiment_worried",
|
|
1550
1574
|
"bk_mdi_settings",
|
|
1575
|
+
"bk_mdi_show_chart",
|
|
1551
1576
|
"bk_mdi_speed",
|
|
1552
1577
|
"bk_mdi_stack_group",
|
|
1553
1578
|
"bk_mdi_stop",
|
|
@@ -1557,6 +1582,7 @@ const USED_MATERIAL_ICONS = [
|
|
|
1557
1582
|
"bk_mdi_text_select_end",
|
|
1558
1583
|
"bk_mdi_texture",
|
|
1559
1584
|
"bk_mdi_title",
|
|
1585
|
+
"bk_mdi_track_changes",
|
|
1560
1586
|
"bk_mdi_trackpad_input",
|
|
1561
1587
|
"bk_mdi_translate",
|
|
1562
1588
|
"bk_mdi_tune",
|
|
@@ -2686,6 +2712,7 @@ const editorConfig = defineCodeTemplate(
|
|
|
2686
2712
|
"editor-config",
|
|
2687
2713
|
(ctx) => {
|
|
2688
2714
|
const settingsOverride = ctx.helper.options.settingsOverride || {};
|
|
2715
|
+
const featureFragmentNames = ctx.getFeatureFragmentNames();
|
|
2689
2716
|
return `
|
|
2690
2717
|
export const hasCustomTheme = ${JSON.stringify(ctx.theme.hasCustomTheme)}
|
|
2691
2718
|
|
|
@@ -2708,6 +2735,8 @@ export const defaultLanguage = ${JSON.stringify(
|
|
|
2708
2735
|
export const forceDefaultLanguage = ${JSON.stringify(
|
|
2709
2736
|
!!ctx.helper.options.forceDefaultLanguage
|
|
2710
2737
|
)}
|
|
2738
|
+
|
|
2739
|
+
export const featureFragmentNames = ${JSON.stringify(featureFragmentNames)}
|
|
2711
2740
|
`;
|
|
2712
2741
|
},
|
|
2713
2742
|
(ctx) => {
|
|
@@ -2760,6 +2789,11 @@ export declare const templateEntityType: string | null
|
|
|
2760
2789
|
* Whether to always force the default language, even on translation pages.
|
|
2761
2790
|
*/
|
|
2762
2791
|
export declare const forceDefaultLanguage: boolean
|
|
2792
|
+
|
|
2793
|
+
/**
|
|
2794
|
+
* The fragment names provided by features.
|
|
2795
|
+
*/
|
|
2796
|
+
export declare const featureFragmentNames: string[]
|
|
2763
2797
|
`;
|
|
2764
2798
|
}
|
|
2765
2799
|
);
|
|
@@ -2978,6 +3012,8 @@ function toRuntimeOptionArray(option) {
|
|
|
2978
3012
|
return [option.type, option.default];
|
|
2979
3013
|
} else if (option.type === "color") {
|
|
2980
3014
|
return [option.type, option.default];
|
|
3015
|
+
} else if (option.type === "json") {
|
|
3016
|
+
return [option.type, option.default];
|
|
2981
3017
|
}
|
|
2982
3018
|
return [option.type, option.default];
|
|
2983
3019
|
}
|
|
@@ -3026,9 +3062,20 @@ const runtimeOptions = defineCodeTemplate(
|
|
|
3026
3062
|
});
|
|
3027
3063
|
if (isBlock(item.definition)) {
|
|
3028
3064
|
if (item.definition.propsFieldMapping) {
|
|
3065
|
+
const mapping = Object.entries(
|
|
3066
|
+
item.definition.propsFieldMapping
|
|
3067
|
+
).reduce(
|
|
3068
|
+
(acc, [propName, mapping2]) => {
|
|
3069
|
+
if (mapping2) {
|
|
3070
|
+
acc[propName] = [mapping2.type, mapping2.name];
|
|
3071
|
+
}
|
|
3072
|
+
return acc;
|
|
3073
|
+
},
|
|
3074
|
+
{}
|
|
3075
|
+
);
|
|
3029
3076
|
FIELD_MAPPING.set(
|
|
3030
3077
|
item.definition.bundle,
|
|
3031
|
-
JSON.stringify(
|
|
3078
|
+
JSON.stringify(mapping, null, 2)
|
|
3032
3079
|
);
|
|
3033
3080
|
}
|
|
3034
3081
|
}
|
|
@@ -3094,8 +3141,10 @@ export type RuntimeBlockOptions = {
|
|
|
3094
3141
|
${runtimeMappedOptionTypes}
|
|
3095
3142
|
}
|
|
3096
3143
|
|
|
3144
|
+
export type PropsFieldMappingType = 'editable' | 'droppable' | 'field'
|
|
3145
|
+
|
|
3097
3146
|
export declare const OPTIONS: Record<string, Record<string, RuntimeBlockOptionArray>>
|
|
3098
|
-
export declare const FIELD_MAPPING: Record<string, Record<string, string>>
|
|
3147
|
+
export declare const FIELD_MAPPING: Record<string, Record<string, [PropsFieldMappingType, string]>>
|
|
3099
3148
|
`;
|
|
3100
3149
|
},
|
|
3101
3150
|
{
|
|
@@ -3191,6 +3240,7 @@ const generatedTypes = defineCodeTemplate(
|
|
|
3191
3240
|
};
|
|
3192
3241
|
const chunkNames = ctx.helper.options.chunkNames || ["global"];
|
|
3193
3242
|
const fieldListTypes = ctx.helper.options.fieldListTypes || ["default"];
|
|
3243
|
+
const providerTypes = ctx.helper.options.providerTypes || ["default"];
|
|
3194
3244
|
const globalOptions = ctx.helper.options.globalOptions || {};
|
|
3195
3245
|
const validGlobalOptions = Object.keys(globalOptions);
|
|
3196
3246
|
const blockBundlesWithNested = [];
|
|
@@ -3250,6 +3300,8 @@ import type { FieldListItem } from "${ctx.helper.relativePaths.TYPES}"
|
|
|
3250
3300
|
|
|
3251
3301
|
export type ValidFieldListTypes = ${toStringUnion(fieldListTypes)}
|
|
3252
3302
|
|
|
3303
|
+
export type ValidProviderTypes = ${toStringUnion(providerTypes)}
|
|
3304
|
+
|
|
3253
3305
|
export type BlockBundle = ${toStringUnion(validBlockBundles)}
|
|
3254
3306
|
|
|
3255
3307
|
export type BlockBundleWithNested = ${toStringUnion(blockBundlesWithNested)}
|
|
@@ -3,7 +3,8 @@ import { fileURLToPath } from 'node:url';
|
|
|
3
3
|
import * as path from 'node:path';
|
|
4
4
|
import { d as defineBlokkliModule } from '../../shared/editor.CGf7C_0M.mjs';
|
|
5
5
|
import * as fs from 'node:fs';
|
|
6
|
-
import { C as Collector, a as CollectedFile
|
|
6
|
+
import { C as Collector, a as CollectedFile } from '../../shared/editor.BFIzNSQM.mjs';
|
|
7
|
+
import { d as defineCodeTemplate } from '../../shared/editor.6D5vApr0.mjs';
|
|
7
8
|
|
|
8
9
|
function toImportName(prefix, fileName) {
|
|
9
10
|
const name = fileName.split(/[-_]/).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
|
|
@@ -90,7 +91,7 @@ class AgentCollector extends Collector {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
function createClientTemplate(toolCollector, promptCollector,
|
|
94
|
+
function createClientTemplate(toolCollector, promptCollector, options) {
|
|
94
95
|
return defineCodeTemplate(
|
|
95
96
|
"agent-client",
|
|
96
97
|
(ctx) => {
|
|
@@ -126,10 +127,15 @@ function createClientTemplate(toolCollector, promptCollector, defaultPrompts, mo
|
|
|
126
127
|
);
|
|
127
128
|
}
|
|
128
129
|
exports$1.push(
|
|
129
|
-
`export const defaultPrompts = ${JSON.stringify(defaultPrompts)}`
|
|
130
|
+
`export const defaultPrompts = ${JSON.stringify(options.defaultPrompts ?? [])}`
|
|
131
|
+
);
|
|
132
|
+
exports$1.push(`export const models = ${JSON.stringify(options.models)}`);
|
|
133
|
+
exports$1.push(
|
|
134
|
+
`export const agentName = ${JSON.stringify(options.agentName ?? "Blocki")}`
|
|
135
|
+
);
|
|
136
|
+
exports$1.push(
|
|
137
|
+
`export const hasWebFetch = ${JSON.stringify(!!options.allowedFetchOrigins)}`
|
|
130
138
|
);
|
|
131
|
-
exports$1.push(`export const models = ${JSON.stringify(models)}`);
|
|
132
|
-
exports$1.push(`export const agentName = ${JSON.stringify(agentName)}`);
|
|
133
139
|
const parts = [];
|
|
134
140
|
if (imports.length > 0) {
|
|
135
141
|
parts.push(imports.join("\n"));
|
|
@@ -146,6 +152,7 @@ export const agentPrompts: AgentPromptItem[]
|
|
|
146
152
|
export const defaultPrompts: string[]
|
|
147
153
|
export const agentName: string
|
|
148
154
|
export const models: AgentModelDefinition[]
|
|
155
|
+
export const hasWebFetch: boolean
|
|
149
156
|
`;
|
|
150
157
|
}
|
|
151
158
|
);
|
|
@@ -283,15 +290,19 @@ export default defineNuxtConfig({
|
|
|
283
290
|
"#blokkli/agent/server",
|
|
284
291
|
moduleResolver.resolve("./runtime/server")
|
|
285
292
|
);
|
|
293
|
+
const moduleBlokkliDirs = ctx.helper.options.blokkliDirs || [];
|
|
286
294
|
const moduleToolsDir = moduleResolver.resolve("./runtime/app/tools");
|
|
287
295
|
const projectToolsDir = path.resolve(nuxt.options.rootDir, "blokkli/tools");
|
|
288
296
|
const mcpTools = new AgentCollector(ctx.helper, {
|
|
289
297
|
composable: "defineBlokkliAgentTool",
|
|
290
298
|
importPrefix: "tool",
|
|
291
299
|
dependency: "agent-mcp-tools",
|
|
292
|
-
dirs: [
|
|
300
|
+
dirs: [
|
|
301
|
+
moduleToolsDir,
|
|
302
|
+
projectToolsDir,
|
|
303
|
+
...moduleBlokkliDirs.map((d) => path.join(d, "tools"))
|
|
304
|
+
]
|
|
293
305
|
});
|
|
294
|
-
await mcpTools.init();
|
|
295
306
|
ctx.context.addCollector(mcpTools);
|
|
296
307
|
const projectPromptsDir = path.resolve(
|
|
297
308
|
nuxt.options.rootDir,
|
|
@@ -301,18 +312,14 @@ export default defineNuxtConfig({
|
|
|
301
312
|
composable: "defineBlokkliAgentPrompt",
|
|
302
313
|
importPrefix: "prompt",
|
|
303
314
|
dependency: "agent-prompts",
|
|
304
|
-
dirs: [
|
|
315
|
+
dirs: [
|
|
316
|
+
projectPromptsDir,
|
|
317
|
+
...moduleBlokkliDirs.map((d) => path.join(d, "prompts"))
|
|
318
|
+
]
|
|
305
319
|
});
|
|
306
|
-
await promptsCollector.init();
|
|
307
320
|
ctx.context.addCollector(promptsCollector);
|
|
308
321
|
ctx.context.addTemplate(
|
|
309
|
-
createClientTemplate(
|
|
310
|
-
mcpTools,
|
|
311
|
-
promptsCollector,
|
|
312
|
-
options.defaultPrompts || [],
|
|
313
|
-
options.models,
|
|
314
|
-
options.agentName ?? "Blocki"
|
|
315
|
-
)
|
|
322
|
+
createClientTemplate(mcpTools, promptsCollector, options)
|
|
316
323
|
);
|
|
317
324
|
const relativeToolsDir = path.relative(
|
|
318
325
|
nuxt.options.buildDir,
|
|
@@ -326,6 +333,11 @@ export default defineNuxtConfig({
|
|
|
326
333
|
projectPromptsDir
|
|
327
334
|
);
|
|
328
335
|
nuxt.options.typescript.tsConfig.include.push(relativePromptsDir);
|
|
336
|
+
for (const dir of moduleBlokkliDirs) {
|
|
337
|
+
const toolsDir = path.join(dir, "tools");
|
|
338
|
+
const relDir = path.relative(nuxt.options.buildDir, toolsDir);
|
|
339
|
+
nuxt.options.typescript.tsConfig.include.push(relDir);
|
|
340
|
+
}
|
|
329
341
|
const moduleSkillsDir = moduleResolver.resolve(
|
|
330
342
|
"./runtime/server/default-skills"
|
|
331
343
|
);
|
|
@@ -337,9 +349,12 @@ export default defineNuxtConfig({
|
|
|
337
349
|
composable: "defineBlokkliAgentSkill",
|
|
338
350
|
importPrefix: "skill",
|
|
339
351
|
dependency: "agent-server",
|
|
340
|
-
dirs: [
|
|
352
|
+
dirs: [
|
|
353
|
+
moduleSkillsDir,
|
|
354
|
+
projectSkillsDir,
|
|
355
|
+
...moduleBlokkliDirs.map((d) => path.join(d, "skills"))
|
|
356
|
+
]
|
|
341
357
|
});
|
|
342
|
-
await skillsCollector.init();
|
|
343
358
|
ctx.context.addCollector(skillsCollector);
|
|
344
359
|
const moduleSystemPromptsDir = moduleResolver.resolve(
|
|
345
360
|
"./runtime/server/default-system-prompts"
|
|
@@ -352,9 +367,12 @@ export default defineNuxtConfig({
|
|
|
352
367
|
composable: "defineBlokkliAgentSystemPrompt",
|
|
353
368
|
importPrefix: "systemPrompt",
|
|
354
369
|
dependency: "agent-server",
|
|
355
|
-
dirs: [
|
|
370
|
+
dirs: [
|
|
371
|
+
moduleSystemPromptsDir,
|
|
372
|
+
projectSystemPromptsDir,
|
|
373
|
+
...moduleBlokkliDirs.map((d) => path.join(d, "system-prompts"))
|
|
374
|
+
]
|
|
356
375
|
});
|
|
357
|
-
await systemPromptCollector.init();
|
|
358
376
|
ctx.context.addCollector(systemPromptCollector);
|
|
359
377
|
ctx.context.addTemplate(
|
|
360
378
|
createServerTemplate({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Ref } from '#imports';
|
|
2
2
|
import { type Attachment, type ConversationItem, type ActiveItem, type MutationAction } from '#blokkli/agent/app/types';
|
|
3
|
-
import type { ClientPlanState, UsageTurn } from '#blokkli/agent/shared/types';
|
|
3
|
+
import type { ClientPlanState, UsageTurn, Transcript } from '#blokkli/agent/shared/types';
|
|
4
4
|
import type { AgentConversationSummary } from '#blokkli/agent/app/features/agent/types';
|
|
5
5
|
import type { BlokkliApp } from '#blokkli/editor/types/app';
|
|
6
6
|
import type { FullBlokkliAdapter } from '#blokkli/editor/adapter';
|
|
@@ -43,7 +43,7 @@ export type AgentProvider = {
|
|
|
43
43
|
newConversation: () => void;
|
|
44
44
|
getTranscript: () => void;
|
|
45
45
|
onToolComponentDone: (result: unknown) => void;
|
|
46
|
-
transcriptContent: Ref<
|
|
46
|
+
transcriptContent: Ref<Transcript | null>;
|
|
47
47
|
showTranscript: Ref<boolean>;
|
|
48
48
|
conversationList: Ref<AgentConversationSummary[]>;
|
|
49
49
|
showConversationList: Ref<boolean>;
|
|
@@ -38,7 +38,7 @@ export default function(app, adapter, agentName) {
|
|
|
38
38
|
const pendingToolCall = ref(null);
|
|
39
39
|
let pendingToolCallResolve = null;
|
|
40
40
|
const plan = ref(null);
|
|
41
|
-
const transcriptContent = ref(
|
|
41
|
+
const transcriptContent = ref(null);
|
|
42
42
|
const showTranscript = ref(false);
|
|
43
43
|
const activeConversationId = ref(null);
|
|
44
44
|
const conversationList = ref([]);
|
|
@@ -283,7 +283,7 @@ export default function(app, adapter, agentName) {
|
|
|
283
283
|
send({ type: "init", tools, pageContext });
|
|
284
284
|
isReady.value = true;
|
|
285
285
|
hasBeenReady.value = true;
|
|
286
|
-
if (adapter.agentConversations) {
|
|
286
|
+
if (adapter.agentConversations && !pendingPrompt) {
|
|
287
287
|
try {
|
|
288
288
|
const latest = await adapter.agentConversations.loadLatest();
|
|
289
289
|
if (latest) {
|
|
@@ -492,7 +492,7 @@ export default function(app, adapter, agentName) {
|
|
|
492
492
|
}
|
|
493
493
|
break;
|
|
494
494
|
case "transcript":
|
|
495
|
-
transcriptContent.value = data.
|
|
495
|
+
transcriptContent.value = data.transcript;
|
|
496
496
|
showTranscript.value = true;
|
|
497
497
|
break;
|
|
498
498
|
case "conversation_state":
|
|
@@ -1,38 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="bk-agent-input-actions">
|
|
3
3
|
<div class="bk-agent-input-actions-left">
|
|
4
|
-
<
|
|
5
|
-
<button
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<Icon name="bk_mdi_more_horiz" />
|
|
12
|
-
</button>
|
|
13
|
-
<BlokkliTransition name="drop-up">
|
|
14
|
-
<div v-if="showMenu" class="bk-agent-more-dropdown">
|
|
15
|
-
<TokenUsage :usage-turns />
|
|
16
|
-
<hr />
|
|
17
|
-
<DropdownItem
|
|
18
|
-
icon="bk_mdi_add"
|
|
19
|
-
:text="$t('aiAgentNewConversation', 'Start new conversation')"
|
|
20
|
-
@click="onNewConversation"
|
|
21
|
-
/>
|
|
22
|
-
<DropdownItem
|
|
23
|
-
icon="bk_mdi_history"
|
|
24
|
-
:text="$t('aiAgentPastConversations', 'Past conversations')"
|
|
25
|
-
@click="onShowConversations"
|
|
26
|
-
/>
|
|
27
|
-
<hr />
|
|
28
|
-
<DropdownItem
|
|
29
|
-
icon="bk_mdi_bug_report"
|
|
30
|
-
:text="$t('aiAgentShowTranscript', 'Show transcript...')"
|
|
31
|
-
@click="onShowTranscript"
|
|
32
|
-
/>
|
|
4
|
+
<Dropdown ref="dropdown" :disabled="!isConnected">
|
|
5
|
+
<template #button>
|
|
6
|
+
<div
|
|
7
|
+
class="bk-button bk-is-white bk-is-small bk-is-icon-only"
|
|
8
|
+
:title="$t('aiAgentMoreOptions', 'More options')"
|
|
9
|
+
>
|
|
10
|
+
<Icon name="bk_mdi_more_horiz" />
|
|
33
11
|
</div>
|
|
34
|
-
</
|
|
35
|
-
|
|
12
|
+
</template>
|
|
13
|
+
<TokenUsage :usage-turns />
|
|
14
|
+
<hr />
|
|
15
|
+
<DropdownItem
|
|
16
|
+
icon="bk_mdi_add"
|
|
17
|
+
:text="$t('aiAgentNewConversation', 'Start new conversation')"
|
|
18
|
+
@click="onNewConversation"
|
|
19
|
+
/>
|
|
20
|
+
<DropdownItem
|
|
21
|
+
icon="bk_mdi_history"
|
|
22
|
+
:text="$t('aiAgentPastConversations', 'Past conversations')"
|
|
23
|
+
@click="onShowConversations"
|
|
24
|
+
/>
|
|
25
|
+
<hr />
|
|
26
|
+
<DropdownItem
|
|
27
|
+
icon="bk_mdi_bug_report"
|
|
28
|
+
:text="$t('aiAgentShowTranscript', 'Show transcript...')"
|
|
29
|
+
@click="onShowTranscript"
|
|
30
|
+
/>
|
|
31
|
+
</Dropdown>
|
|
36
32
|
</div>
|
|
37
33
|
<div class="bk-agent-input-actions-right">
|
|
38
34
|
<div v-show="hasText" class="bk-agent-input-actions-keyboard">
|
|
@@ -59,15 +55,8 @@
|
|
|
59
55
|
</template>
|
|
60
56
|
|
|
61
57
|
<script setup>
|
|
62
|
-
import {
|
|
63
|
-
|
|
64
|
-
onMounted,
|
|
65
|
-
onBeforeUnmount,
|
|
66
|
-
useTemplateRef,
|
|
67
|
-
useBlokkli
|
|
68
|
-
} from "#imports";
|
|
69
|
-
import { Icon, BlokkliTransition } from "#blokkli/editor/components";
|
|
70
|
-
import DropdownItem from "./DropdownItem/index.vue";
|
|
58
|
+
import { useTemplateRef, useBlokkli } from "#imports";
|
|
59
|
+
import { Icon, Dropdown, DropdownItem } from "#blokkli/editor/components";
|
|
71
60
|
import TokenUsage from "./TokenUsage/index.vue";
|
|
72
61
|
defineProps({
|
|
73
62
|
isProcessing: { type: Boolean, required: true },
|
|
@@ -77,33 +66,18 @@ defineProps({
|
|
|
77
66
|
usageTurns: { type: Array, required: true }
|
|
78
67
|
});
|
|
79
68
|
const emit = defineEmits(["submit", "cancel", "new-conversation", "show-transcript", "show-conversations"]);
|
|
80
|
-
const { $t
|
|
81
|
-
const
|
|
82
|
-
const showMenu = ref(false);
|
|
83
|
-
function closeMenu() {
|
|
84
|
-
showMenu.value = false;
|
|
85
|
-
}
|
|
86
|
-
function onDocumentClick(e) {
|
|
87
|
-
if (!menuContainer.value?.contains(e.target)) {
|
|
88
|
-
closeMenu();
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
eventBus.on("mouse:up", closeMenu);
|
|
92
|
-
onMounted(() => document.addEventListener("click", onDocumentClick));
|
|
93
|
-
onBeforeUnmount(() => {
|
|
94
|
-
document.removeEventListener("click", onDocumentClick);
|
|
95
|
-
eventBus.off("mouse:up", closeMenu);
|
|
96
|
-
});
|
|
69
|
+
const { $t } = useBlokkli();
|
|
70
|
+
const dropdown = useTemplateRef("dropdown");
|
|
97
71
|
function onNewConversation() {
|
|
98
|
-
|
|
72
|
+
dropdown.value?.close();
|
|
99
73
|
emit("new-conversation");
|
|
100
74
|
}
|
|
101
75
|
function onShowConversations() {
|
|
102
|
-
|
|
76
|
+
dropdown.value?.close();
|
|
103
77
|
emit("show-conversations");
|
|
104
78
|
}
|
|
105
79
|
function onShowTranscript() {
|
|
106
|
-
|
|
80
|
+
dropdown.value?.close();
|
|
107
81
|
emit("show-transcript");
|
|
108
82
|
}
|
|
109
83
|
</script>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Transcript } from '#blokkli/agent/shared/types';
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
5
|
+
transcript: Transcript;
|
|
6
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
7
|
+
transcript: Transcript;
|
|
8
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|