@blokkli/editor 2.0.0-alpha.35 → 2.0.0-alpha.37
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 +10 -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 +126 -7
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +273 -25
- package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +2 -2
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +34 -17
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.d.ts +2 -20
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.js +0 -3
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue +1 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +1 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.d.vue.ts +1 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +67 -86
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue.d.ts +1 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +10 -12
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/de.md +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/en.md +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +1 -5
- 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 +94 -38
- package/dist/modules/agent/runtime/app/helpers/index.d.ts +16 -19
- package/dist/modules/agent/runtime/app/helpers/index.js +22 -46
- package/dist/modules/agent/runtime/app/helpers/pageStructure.js +1 -1
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.js +5 -9
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +2 -3
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_template/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/analyze_content/index.js +120 -0
- package/dist/modules/agent/runtime/app/tools/check_readability/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/check_readability/index.js +57 -0
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +1 -1
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +176 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +1 -1
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +7 -5
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +2 -1
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +2 -3
- package/dist/modules/agent/runtime/app/tools/helpers.d.ts +53 -0
- package/dist/modules/agent/runtime/app/tools/helpers.js +187 -0
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +1 -44
- package/dist/modules/agent/runtime/app/tools/schemas.js +0 -174
- package/dist/modules/agent/runtime/app/tools/search_content/index.js +40 -47
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +2 -5
- package/dist/modules/agent/runtime/app/types/index.d.ts +0 -61
- package/dist/modules/agent/runtime/server/Session.d.ts +29 -8
- package/dist/modules/agent/runtime/server/Session.js +168 -85
- package/dist/modules/agent/runtime/server/SessionManager.d.ts +3 -0
- package/dist/modules/agent/runtime/server/SessionManager.js +4 -1
- package/dist/modules/agent/runtime/server/agent.js +3 -2
- 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/server/default-skills/fixReadability.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/fixReadability.js +69 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +28 -0
- package/dist/modules/agent/runtime/server/server-tools/index.d.ts +10 -2
- package/dist/modules/agent/runtime/server/server-tools/index.js +1 -1
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +1 -1
- package/dist/modules/agent/runtime/shared/types.d.ts +81 -12
- package/dist/modules/agent/runtime/shared/types.js +22 -10
- package/dist/modules/charts/index.d.mts +35 -0
- package/dist/modules/charts/index.mjs +57 -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 +86 -0
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +136 -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 +93 -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 +66 -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 +40 -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 +89 -0
- package/dist/modules/charts/runtime/chartTypes/area.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/area.js +68 -0
- package/dist/modules/charts/runtime/chartTypes/bar.d.ts +8 -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 +6 -0
- package/dist/modules/charts/runtime/chartTypes/donut.js +45 -0
- package/dist/modules/charts/runtime/chartTypes/heatmap.d.ts +4 -0
- package/dist/modules/charts/runtime/chartTypes/heatmap.js +54 -0
- package/dist/modules/charts/runtime/chartTypes/index.d.ts +39 -0
- package/dist/modules/charts/runtime/chartTypes/index.js +47 -0
- package/dist/modules/charts/runtime/chartTypes/line.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/line.js +68 -0
- package/dist/modules/charts/runtime/chartTypes/pie.d.ts +5 -0
- package/dist/modules/charts/runtime/chartTypes/pie.js +28 -0
- package/dist/modules/charts/runtime/chartTypes/radar.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/radar.js +52 -0
- package/dist/modules/charts/runtime/chartTypes/radialBar.d.ts +6 -0
- package/dist/modules/charts/runtime/chartTypes/radialBar.js +44 -0
- package/dist/modules/charts/runtime/chartTypes/shared.d.ts +67 -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 +147 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +120 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue.d.ts +147 -0
- package/dist/modules/charts/runtime/components/index.d.ts +1 -0
- package/dist/modules/charts/runtime/components/index.js +1 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.d.vue.ts +16 -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 +16 -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 +89 -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/{runtime/editor/features/clipboard/List → modules/charts/runtime/features/charts/Editor/FootnoteEditor}/index.d.vue.ts +4 -5
- package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue +61 -0
- package/dist/{runtime/editor/features/clipboard/List → modules/charts/runtime/features/charts/Editor/FootnoteEditor}/index.vue.d.ts +4 -5
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.d.vue.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue +45 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue.d.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +249 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +11 -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 +26 -0
- package/dist/modules/charts/runtime/helpers/index.js +80 -0
- package/dist/modules/charts/runtime/types.d.ts +33 -0
- package/dist/modules/charts/runtime/types.js +0 -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.d.ts +3 -1
- package/dist/modules/drupal/runtime/adapter/index.js +16 -12
- 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 +9 -4
- 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/defineBlokkli.js +1 -1
- package/dist/runtime/composables/useBlokkliHelper.js +4 -2
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +17 -27
- package/dist/runtime/editor/components/Banner/index.d.vue.ts +13 -2
- package/dist/runtime/editor/components/Banner/index.vue +4 -2
- package/dist/runtime/editor/components/Banner/index.vue.d.ts +13 -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.d.vue.ts +1 -0
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue +3 -2
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/EditProvider.d.vue.ts +2 -0
- package/dist/runtime/editor/components/EditProvider.vue +11 -7
- package/dist/runtime/editor/components/EditProvider.vue.d.ts +2 -0
- package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +5 -1
- package/dist/runtime/editor/components/FlexTextarea/index.vue +24 -101
- package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +5 -1
- 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 +43 -16
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +13 -3
- package/dist/runtime/editor/components/Popup/index.d.vue.ts +30 -0
- package/dist/runtime/editor/components/Popup/index.vue +82 -0
- package/dist/runtime/editor/components/Popup/index.vue.d.ts +30 -0
- 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/Resizable/index.vue +4 -1
- package/dist/runtime/editor/components/ShortcutIndicator/index.vue +1 -1
- package/dist/runtime/editor/components/Toolbar/index.vue +107 -6
- package/dist/runtime/editor/components/index.d.ts +4 -1
- package/dist/runtime/editor/components/index.js +6 -0
- package/dist/runtime/editor/composables/defineDropAreas.js +3 -3
- package/dist/runtime/editor/composables/defineDropHandler.d.ts +3 -0
- package/dist/runtime/editor/composables/defineDropHandler.js +10 -0
- package/dist/runtime/editor/composables/index.d.ts +1 -0
- package/dist/runtime/editor/composables/index.js +1 -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 +16 -0
- package/dist/runtime/editor/features/add-list/Help/Item.vue +5 -2
- package/dist/runtime/editor/features/add-list/index.vue +58 -1
- package/dist/runtime/editor/features/analyze/Main.d.vue.ts +3 -2
- package/dist/runtime/editor/features/analyze/Main.vue +28 -44
- package/dist/runtime/editor/features/analyze/Main.vue.d.ts +3 -2
- package/dist/runtime/editor/features/analyze/analyzers/readability.js +65 -0
- package/dist/runtime/editor/features/analyze/analyzers/types.d.ts +19 -0
- package/dist/runtime/editor/features/analyze/index.vue +18 -15
- package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
- package/dist/runtime/editor/features/clipboard/DropElement/Video.d.vue.ts +8 -0
- package/dist/runtime/editor/features/clipboard/{List/Item → DropElement}/Video.vue +1 -5
- package/dist/runtime/editor/features/clipboard/DropElement/Video.vue.d.ts +8 -0
- package/dist/runtime/editor/features/clipboard/DropElement/helpers.d.ts +1 -0
- package/dist/runtime/editor/features/clipboard/DropElement/helpers.js +14 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.d.vue.ts +16 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue +97 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue.d.ts +16 -0
- package/dist/runtime/editor/features/clipboard/helpers.d.ts +15 -0
- package/dist/runtime/editor/features/clipboard/helpers.js +62 -0
- package/dist/runtime/editor/features/clipboard/index.vue +586 -338
- package/dist/runtime/editor/features/clipboard/types.d.ts +14 -2
- 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/dragging-overlay/DragItems/index.vue +17 -5
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +2 -2
- package/dist/runtime/editor/features/dragging-overlay/index.vue +125 -219
- package/dist/runtime/editor/features/edit/index.vue +20 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +4 -4
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +6 -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/library/index.vue +14 -0
- package/dist/runtime/editor/features/media-library/index.vue +32 -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/ComplexType/index.d.vue.ts +11 -0
- package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +36 -0
- package/dist/runtime/editor/features/options/Form/ComplexType/index.vue.d.ts +11 -0
- package/dist/runtime/editor/features/options/Form/Item.d.vue.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Item.vue +24 -50
- package/dist/runtime/editor/features/options/Form/Item.vue.d.ts +5 -4
- 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 +15 -5
- package/dist/runtime/editor/features/search/index.vue +25 -1
- package/dist/runtime/editor/features/selection/index.vue +2 -2
- package/dist/runtime/editor/features/structure/index.vue +25 -1
- package/dist/runtime/editor/features/tour/index.vue +22 -12
- package/dist/runtime/editor/features/transform/index.vue +1 -3
- package/dist/runtime/editor/helpers/clipboardData/index.d.ts +11 -0
- package/dist/runtime/editor/helpers/clipboardData/index.js +157 -0
- package/dist/runtime/editor/helpers/options/index.js +5 -0
- package/dist/runtime/editor/icons/svg/stars.svg +5 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +15 -4
- package/dist/runtime/editor/plugins/Sidebar/index.vue +4 -2
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +15 -4
- package/dist/runtime/editor/providers/analyze.d.ts +43 -0
- package/dist/runtime/editor/providers/analyze.js +78 -0
- package/dist/runtime/editor/providers/animation.d.ts +4 -0
- package/dist/runtime/editor/providers/animation.js +6 -0
- 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/dragdrop.d.ts +55 -0
- package/dist/runtime/editor/providers/dragdrop.js +37 -0
- package/dist/runtime/editor/providers/fields.d.ts +19 -1
- package/dist/runtime/editor/providers/fields.js +54 -2
- package/dist/runtime/editor/providers/storage.js +15 -0
- package/dist/runtime/editor/providers/ui.d.ts +6 -0
- package/dist/runtime/editor/providers/ui.js +19 -0
- package/dist/runtime/editor/translations/de.json +338 -58
- package/dist/runtime/editor/translations/fr.json +331 -51
- package/dist/runtime/editor/translations/gsw_CH.json +336 -56
- package/dist/runtime/editor/translations/it.json +331 -51
- package/dist/runtime/editor/types/app.d.ts +4 -2
- package/dist/runtime/editor/types/draggable.d.ts +1 -0
- package/dist/runtime/editor/types/ui.d.ts +1 -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 +6 -2
- package/dist/runtime/helpers/injections.js +3 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +14 -0
- package/dist/runtime/types/blockOptions.d.ts +2 -1
- package/dist/runtime/types/definitions.d.ts +12 -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.BdBm1Z7C.d.mts} +34 -0
- package/dist/types.d.mts +1 -1
- package/package.json +21 -3
- package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +0 -104
- package/dist/runtime/editor/features/clipboard/List/Item/File.d.vue.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/File.vue +0 -60
- package/dist/runtime/editor/features/clipboard/List/Item/File.vue.d.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/Video.d.vue.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/Video.vue.d.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/index.vue +0 -72
- package/dist/runtime/editor/features/tour/Popup/index.d.vue.ts +0 -9
- package/dist/runtime/editor/features/tour/Popup/index.vue +0 -34
- package/dist/runtime/editor/features/tour/Popup/index.vue.d.ts +0 -9
- package/dist/runtime/editor/providers/dropArea.d.ts +0 -48
- package/dist/runtime/editor/providers/dropArea.js +0 -22
- /package/dist/modules/agent/runtime/app/tools/{get_available_bundles → analyze_content}/index.d.ts +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { getColorIdAtIndex } from "../../helpers/index.js";
|
|
3
|
+
import { getChartTypeRuntime, getDefaultTypeOptions } from "../../chartTypes/index.js";
|
|
4
|
+
import { COLORS } from "#blokkli-build/charts-config";
|
|
5
|
+
const SINGLE_SERIES_TYPES = ["pie", "donut", "radialBar"];
|
|
6
|
+
export const chartTypeEnum = z.enum([
|
|
7
|
+
"bar",
|
|
8
|
+
"line",
|
|
9
|
+
"pie",
|
|
10
|
+
"area",
|
|
11
|
+
"donut",
|
|
12
|
+
"heatmap",
|
|
13
|
+
"radialBar",
|
|
14
|
+
"radar"
|
|
15
|
+
]);
|
|
16
|
+
const colorIds = Object.keys(COLORS);
|
|
17
|
+
export const chartColorEnum = z.enum(colorIds);
|
|
18
|
+
export const chartSeriesSchema = z.object({
|
|
19
|
+
name: z.string().describe("Series name (shown in legend)"),
|
|
20
|
+
color: chartColorEnum.optional().describe(
|
|
21
|
+
"Color ID from available chart colors. Auto-assigned if omitted."
|
|
22
|
+
),
|
|
23
|
+
data: z.array(z.number()).describe("Data values, one per category")
|
|
24
|
+
});
|
|
25
|
+
export const chartDataSchema = z.object({
|
|
26
|
+
title: z.string().optional().default("").describe("Chart title"),
|
|
27
|
+
type: chartTypeEnum.describe("Chart type"),
|
|
28
|
+
categories: z.array(z.string()).min(1).describe("Category labels (x-axis or slice names)"),
|
|
29
|
+
series: z.array(chartSeriesSchema).min(1).describe("Data series"),
|
|
30
|
+
categoryColors: z.array(chartColorEnum).optional().describe(
|
|
31
|
+
"Color IDs per category (for pie/donut/radialBar). Auto-assigned if omitted."
|
|
32
|
+
),
|
|
33
|
+
footnotes: z.array(z.string()).optional().default([]).describe(
|
|
34
|
+
"Footnote texts. Reference in categories/series names as {1}, {2}, etc."
|
|
35
|
+
),
|
|
36
|
+
typeOptions: z.record(z.string(), z.union([z.string(), z.boolean(), z.number()])).optional().describe(
|
|
37
|
+
"Type-specific rendering options. Use get_chart_type_options to see available keys."
|
|
38
|
+
)
|
|
39
|
+
});
|
|
40
|
+
export function validateChartData(data, colors) {
|
|
41
|
+
const colorIds2 = Object.keys(colors);
|
|
42
|
+
for (let i = 0; i < data.series.length; i++) {
|
|
43
|
+
const series = data.series[i];
|
|
44
|
+
if (series.data.length !== data.categories.length) {
|
|
45
|
+
return {
|
|
46
|
+
error: `Series "${series.name}" has ${series.data.length} data values but there are ${data.categories.length} categories. Each series must have exactly one value per category.`
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
for (let i = 0; i < data.series.length; i++) {
|
|
51
|
+
const series = data.series[i];
|
|
52
|
+
if (!series.color) {
|
|
53
|
+
series.color = getColorIdAtIndex(i, colors);
|
|
54
|
+
} else if (!colors[series.color]) {
|
|
55
|
+
return {
|
|
56
|
+
error: `Invalid color ID "${series.color}" on series "${series.name}". Available colors: ${colorIds2.join(", ")}`
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const isSingleSeries = SINGLE_SERIES_TYPES.includes(data.type);
|
|
61
|
+
if (isSingleSeries) {
|
|
62
|
+
if (!data.categoryColors || data.categoryColors.length !== data.categories.length) {
|
|
63
|
+
data.categoryColors = data.categories.map(
|
|
64
|
+
(_, i) => getColorIdAtIndex(i, colors)
|
|
65
|
+
);
|
|
66
|
+
} else {
|
|
67
|
+
for (let i = 0; i < data.categoryColors.length; i++) {
|
|
68
|
+
const id = data.categoryColors[i];
|
|
69
|
+
if (!colors[id]) {
|
|
70
|
+
return {
|
|
71
|
+
error: `Invalid categoryColor ID "${id}" at index ${i}. Available colors: ${colorIds2.join(", ")}`
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
} else if (!data.categoryColors || data.categoryColors.length !== data.categories.length) {
|
|
77
|
+
data.categoryColors = data.categories.map(
|
|
78
|
+
(_, i) => getColorIdAtIndex(i, colors)
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
const defaults = getDefaultTypeOptions(data.type);
|
|
82
|
+
const typeDef = getChartTypeRuntime(data.type);
|
|
83
|
+
if (data.typeOptions && typeDef) {
|
|
84
|
+
for (const key of Object.keys(data.typeOptions)) {
|
|
85
|
+
if (!(key in typeDef.editor.options)) {
|
|
86
|
+
const availableKeys = Object.keys(typeDef.editor.options);
|
|
87
|
+
return {
|
|
88
|
+
error: `Invalid typeOption "${key}" for chart type "${data.type}". Available options: ${availableKeys.join(", ")}`
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
data.typeOptions = { ...defaults, ...data.typeOptions || {} };
|
|
94
|
+
if (!data.footnotes) {
|
|
95
|
+
data.footnotes = [];
|
|
96
|
+
}
|
|
97
|
+
return { data };
|
|
98
|
+
}
|
|
99
|
+
export function findChartOptionKey(ctx, uuid) {
|
|
100
|
+
const { blocks, definitions, selection } = ctx.app;
|
|
101
|
+
const block = blocks.getBlock(uuid);
|
|
102
|
+
if (!block) return { error: `Paragraph not found: ${uuid}` };
|
|
103
|
+
const bundle = block.library?.reusableBundle || block.bundle;
|
|
104
|
+
const selectionItem = selection.items.value.find((v) => v.uuid === uuid);
|
|
105
|
+
const definition = definitions.getBlockDefinition(
|
|
106
|
+
bundle,
|
|
107
|
+
selectionItem?.fieldListType ?? "default",
|
|
108
|
+
selectionItem?.parentBlockBundle
|
|
109
|
+
);
|
|
110
|
+
if (!definition?.options) {
|
|
111
|
+
return { error: `Paragraph "${uuid}" (${bundle}) has no chart option.` };
|
|
112
|
+
}
|
|
113
|
+
const chartEntry = Object.entries(definition.options).find(
|
|
114
|
+
([_, opt]) => opt.type === "json" && "dataType" in opt && opt.dataType === "chart"
|
|
115
|
+
);
|
|
116
|
+
if (!chartEntry) {
|
|
117
|
+
return { error: `Paragraph "${uuid}" (${bundle}) has no chart option.` };
|
|
118
|
+
}
|
|
119
|
+
return { key: chartEntry[0] };
|
|
120
|
+
}
|
|
121
|
+
export function findChartBundle(ctx, allowedBundles) {
|
|
122
|
+
const { definitions } = ctx.app;
|
|
123
|
+
for (const bundle of allowedBundles) {
|
|
124
|
+
const def = definitions.getDefaultDefinition(bundle);
|
|
125
|
+
if (!def?.options) continue;
|
|
126
|
+
const entry = Object.entries(def.options).find(
|
|
127
|
+
([_, opt]) => opt.type === "json" && "dataType" in opt && opt.dataType === "chart"
|
|
128
|
+
);
|
|
129
|
+
if (entry) {
|
|
130
|
+
return { bundle, key: entry[0] };
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
error: `No block type with a chart option is allowed in this field.`
|
|
135
|
+
};
|
|
136
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
import {
|
|
4
|
+
mutationResultSchema,
|
|
5
|
+
parentSchema,
|
|
6
|
+
positionSchema
|
|
7
|
+
} from "#blokkli/agent/app/tools/schemas";
|
|
8
|
+
import { resolvePosition } from "#blokkli/agent/app/tools/helpers";
|
|
9
|
+
import {
|
|
10
|
+
chartDataSchema,
|
|
11
|
+
validateChartData,
|
|
12
|
+
findChartBundle
|
|
13
|
+
} from "../chart_schemas.js";
|
|
14
|
+
import { COLORS } from "#blokkli-build/charts-config";
|
|
15
|
+
const paramsSchema = z.object({
|
|
16
|
+
chart: chartDataSchema,
|
|
17
|
+
parent: parentSchema.describe("The parent entity to add the chart to"),
|
|
18
|
+
position: positionSchema
|
|
19
|
+
});
|
|
20
|
+
export default defineBlokkliAgentTool({
|
|
21
|
+
name: "create_chart",
|
|
22
|
+
description: "Create a new chart on the page. Series colors are auto-assigned if omitted. For pie/donut/radialBar charts, only the first series is used and each category gets its own color (auto-assigned if categoryColors is omitted). Use get_chart_type_options to discover available typeOptions for the chosen chart type before setting them.",
|
|
23
|
+
category: "mutation",
|
|
24
|
+
prunedSummary: (r) => r.success ? "created chart" : "rejected",
|
|
25
|
+
modes: ["editing"],
|
|
26
|
+
lazy: true,
|
|
27
|
+
label($t) {
|
|
28
|
+
return $t("aiAgentCreateChartRunning", "Creating chart...");
|
|
29
|
+
},
|
|
30
|
+
paramsSchema,
|
|
31
|
+
resultSchema: mutationResultSchema,
|
|
32
|
+
requiredAdapterMethods: ["addNewBlocks"],
|
|
33
|
+
execute(ctx, params) {
|
|
34
|
+
const { fields } = ctx.app;
|
|
35
|
+
const field = fields.find(params.parent.uuid, params.parent.field);
|
|
36
|
+
if (!field) {
|
|
37
|
+
return {
|
|
38
|
+
error: `Field not found: ${params.parent.field} on entity ${params.parent.uuid}`
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const chartBundle = findChartBundle(ctx, field.allowedBundles);
|
|
42
|
+
if ("error" in chartBundle) {
|
|
43
|
+
return {
|
|
44
|
+
error: `No block type with a chart option is allowed in field "${params.parent.field}". Allowed bundles: ${field.allowedBundles.length ? field.allowedBundles.join(", ") : "none"}`
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const chartData = {
|
|
48
|
+
title: params.chart.title,
|
|
49
|
+
type: params.chart.type,
|
|
50
|
+
categories: params.chart.categories,
|
|
51
|
+
series: params.chart.series.map((s) => ({
|
|
52
|
+
name: s.name,
|
|
53
|
+
color: s.color || "",
|
|
54
|
+
data: s.data
|
|
55
|
+
})),
|
|
56
|
+
categoryColors: params.chart.categoryColors || [],
|
|
57
|
+
footnotes: params.chart.footnotes,
|
|
58
|
+
typeOptions: params.chart.typeOptions || {}
|
|
59
|
+
};
|
|
60
|
+
const result = validateChartData(chartData, COLORS);
|
|
61
|
+
if ("error" in result) return result;
|
|
62
|
+
const resolved = resolvePosition(
|
|
63
|
+
ctx.app,
|
|
64
|
+
params.parent.uuid,
|
|
65
|
+
params.parent.field,
|
|
66
|
+
params.position
|
|
67
|
+
);
|
|
68
|
+
if ("error" in resolved) return resolved;
|
|
69
|
+
const { $t } = ctx.app;
|
|
70
|
+
const blockUuid = crypto.randomUUID();
|
|
71
|
+
return {
|
|
72
|
+
type: "add",
|
|
73
|
+
label: $t("aiAgentCreateChartDone", "Added chart"),
|
|
74
|
+
apply: (adapter) => adapter.addNewBlocks({
|
|
75
|
+
blocks: [
|
|
76
|
+
{
|
|
77
|
+
bundle: chartBundle.bundle,
|
|
78
|
+
blockUuid,
|
|
79
|
+
options: {
|
|
80
|
+
[chartBundle.key]: JSON.stringify(result.data)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
host: {
|
|
85
|
+
type: params.parent.type,
|
|
86
|
+
uuid: params.parent.uuid,
|
|
87
|
+
fieldName: params.parent.field
|
|
88
|
+
},
|
|
89
|
+
afterUuid: resolved.afterUuid
|
|
90
|
+
})
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
import {
|
|
4
|
+
chartTypeEnum,
|
|
5
|
+
chartColorEnum,
|
|
6
|
+
chartSeriesSchema,
|
|
7
|
+
findChartOptionKey
|
|
8
|
+
} from "../chart_schemas.js";
|
|
9
|
+
import { COLORS } from "#blokkli-build/charts-config";
|
|
10
|
+
import { getDefaultChartData } from "../../../helpers/index.js";
|
|
11
|
+
const paramsSchema = z.object({
|
|
12
|
+
uuid: z.string().describe("UUID of the chart paragraph")
|
|
13
|
+
});
|
|
14
|
+
const resultSchema = z.object({
|
|
15
|
+
title: z.string().describe("Chart title"),
|
|
16
|
+
type: chartTypeEnum.describe("Chart type"),
|
|
17
|
+
categories: z.array(z.string()).describe("Category labels"),
|
|
18
|
+
series: z.array(chartSeriesSchema.required()).describe("Data series with colors"),
|
|
19
|
+
categoryColors: z.array(chartColorEnum).describe("Color IDs per category"),
|
|
20
|
+
footnotes: z.array(z.string()).describe("Footnote texts"),
|
|
21
|
+
typeOptions: z.record(z.string(), z.union([z.string(), z.boolean(), z.number()])).describe("Current type-specific rendering options")
|
|
22
|
+
});
|
|
23
|
+
export default defineBlokkliAgentTool({
|
|
24
|
+
name: "get_chart_data",
|
|
25
|
+
description: "Get the current data of a chart. Returns the chart type, categories, series, colors, footnotes, and typeOptions. Use this to inspect a chart before updating it.",
|
|
26
|
+
category: "query",
|
|
27
|
+
volatile: true,
|
|
28
|
+
prunedSummary: (r) => `chart data (${r.type})`,
|
|
29
|
+
modes: ["readonly", "editing", "translating", "review"],
|
|
30
|
+
lazy: true,
|
|
31
|
+
label($t) {
|
|
32
|
+
return $t("aiAgentGetChartDataRunning", "Getting chart data...");
|
|
33
|
+
},
|
|
34
|
+
paramsSchema,
|
|
35
|
+
resultSchema,
|
|
36
|
+
execute(ctx, params) {
|
|
37
|
+
const { state, $t } = ctx.app;
|
|
38
|
+
const chartOption = findChartOptionKey(ctx, params.uuid);
|
|
39
|
+
if ("error" in chartOption) return chartOption;
|
|
40
|
+
const item = state.getFieldListItem(params.uuid);
|
|
41
|
+
const rawData = item?.options?.[chartOption.key];
|
|
42
|
+
let data;
|
|
43
|
+
if (rawData) {
|
|
44
|
+
try {
|
|
45
|
+
data = JSON.parse(rawData);
|
|
46
|
+
} catch {
|
|
47
|
+
data = getDefaultChartData(COLORS);
|
|
48
|
+
}
|
|
49
|
+
} else {
|
|
50
|
+
data = getDefaultChartData(COLORS);
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
result: {
|
|
54
|
+
title: data.title || "",
|
|
55
|
+
type: data.type,
|
|
56
|
+
categories: data.categories,
|
|
57
|
+
series: data.series,
|
|
58
|
+
categoryColors: data.categoryColors || [],
|
|
59
|
+
footnotes: data.footnotes || [],
|
|
60
|
+
typeOptions: data.typeOptions || {}
|
|
61
|
+
},
|
|
62
|
+
label: $t("aiAgentGetChartDataDone", "Got chart data"),
|
|
63
|
+
affectedUuids: [params.uuid]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
import { blockOptionsMapSchema } from "#blokkli/agent/app/tools/schemas";
|
|
4
|
+
import { buildBlockOptionsMapFromDefinitions } from "#blokkli/agent/app/tools/helpers";
|
|
5
|
+
import { getChartTypeRuntime } from "../../../chartTypes/index.js";
|
|
6
|
+
import { chartTypeEnum } from "../chart_schemas.js";
|
|
7
|
+
const paramsSchema = z.object({
|
|
8
|
+
type: chartTypeEnum.describe("The chart type to get options for")
|
|
9
|
+
});
|
|
10
|
+
const resultSchema = z.object({
|
|
11
|
+
type: z.string().describe("The chart type ID"),
|
|
12
|
+
options: blockOptionsMapSchema.describe("Available typeOptions")
|
|
13
|
+
});
|
|
14
|
+
export default defineBlokkliAgentTool({
|
|
15
|
+
name: "get_chart_type_options",
|
|
16
|
+
description: "Get available typeOptions for a chart type. Call this before setting typeOptions on create_chart or update_chart to know which keys are valid, their types, defaults, and allowed values.",
|
|
17
|
+
category: "query",
|
|
18
|
+
volatile: true,
|
|
19
|
+
lazy: true,
|
|
20
|
+
prunedSummary: (r) => `options for ${r.type}`,
|
|
21
|
+
modes: ["editing"],
|
|
22
|
+
label($t) {
|
|
23
|
+
return $t("aiAgentGetChartTypeOptionsRunning", "Getting chart options...");
|
|
24
|
+
},
|
|
25
|
+
paramsSchema,
|
|
26
|
+
resultSchema,
|
|
27
|
+
execute(_ctx, params) {
|
|
28
|
+
const def = getChartTypeRuntime(params.type);
|
|
29
|
+
if (!def) {
|
|
30
|
+
return { error: `Unknown chart type: ${params.type}` };
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
result: {
|
|
34
|
+
type: params.type,
|
|
35
|
+
options: buildBlockOptionsMapFromDefinitions(def.editor.options)
|
|
36
|
+
},
|
|
37
|
+
label: `Chart options for "${def.editor.label}"`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
3
|
+
import { mutationResultSchema } from "#blokkli/agent/app/tools/schemas";
|
|
4
|
+
import {
|
|
5
|
+
chartTypeEnum,
|
|
6
|
+
chartColorEnum,
|
|
7
|
+
chartSeriesSchema,
|
|
8
|
+
validateChartData,
|
|
9
|
+
findChartOptionKey
|
|
10
|
+
} from "../chart_schemas.js";
|
|
11
|
+
import { COLORS } from "#blokkli-build/charts-config";
|
|
12
|
+
import { getDefaultChartData } from "../../../helpers/index.js";
|
|
13
|
+
const paramsSchema = z.object({
|
|
14
|
+
uuid: z.string().describe("UUID of the chart paragraph to update"),
|
|
15
|
+
title: z.string().optional().describe("Chart title"),
|
|
16
|
+
type: chartTypeEnum.optional().describe("Chart type"),
|
|
17
|
+
categories: z.array(z.string()).min(1).optional().describe(
|
|
18
|
+
"Category labels (x-axis or slice names). Replaces all existing categories."
|
|
19
|
+
),
|
|
20
|
+
series: z.array(chartSeriesSchema).min(1).optional().describe("Data series. Replaces all existing series."),
|
|
21
|
+
categoryColors: z.array(chartColorEnum).optional().describe(
|
|
22
|
+
"Color IDs per category (for pie/donut/radialBar). Auto-assigned if omitted."
|
|
23
|
+
),
|
|
24
|
+
footnotes: z.array(z.string()).optional().describe(
|
|
25
|
+
"Footnote texts. Reference in categories/series names as {1}, {2}, etc."
|
|
26
|
+
),
|
|
27
|
+
typeOptions: z.record(z.string(), z.union([z.string(), z.boolean(), z.number()])).optional().describe(
|
|
28
|
+
"Type-specific rendering options. Use get_chart_type_options to see available keys."
|
|
29
|
+
)
|
|
30
|
+
});
|
|
31
|
+
export default defineBlokkliAgentTool({
|
|
32
|
+
name: "update_chart",
|
|
33
|
+
description: "Update an existing chart. Provide only the properties you want to change \u2014 they will be merged with the current chart data. Arrays (series, categories, footnotes) are replaced entirely when provided, not merged element-by-element.",
|
|
34
|
+
category: "mutation",
|
|
35
|
+
prunedSummary: (r) => r.success ? "updated chart" : "rejected",
|
|
36
|
+
modes: ["editing"],
|
|
37
|
+
lazy: true,
|
|
38
|
+
label($t) {
|
|
39
|
+
return $t("aiAgentUpdateChartRunning", "Updating chart...");
|
|
40
|
+
},
|
|
41
|
+
paramsSchema,
|
|
42
|
+
resultSchema: mutationResultSchema,
|
|
43
|
+
requiredAdapterMethods: ["updateOptions"],
|
|
44
|
+
execute(ctx, params) {
|
|
45
|
+
const { state } = ctx.app;
|
|
46
|
+
const chartOption = findChartOptionKey(ctx, params.uuid);
|
|
47
|
+
if ("error" in chartOption) return chartOption;
|
|
48
|
+
let current;
|
|
49
|
+
const item = state.getFieldListItem(params.uuid);
|
|
50
|
+
const rawData = item?.options?.[chartOption.key];
|
|
51
|
+
if (rawData) {
|
|
52
|
+
try {
|
|
53
|
+
current = JSON.parse(rawData);
|
|
54
|
+
} catch {
|
|
55
|
+
current = getDefaultChartData(COLORS);
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
current = getDefaultChartData(COLORS);
|
|
59
|
+
}
|
|
60
|
+
const merged = {
|
|
61
|
+
title: params.title !== void 0 ? params.title : current.title,
|
|
62
|
+
type: params.type !== void 0 ? params.type : current.type,
|
|
63
|
+
categories: params.categories !== void 0 ? params.categories : current.categories,
|
|
64
|
+
series: params.series !== void 0 ? params.series.map((s) => ({
|
|
65
|
+
name: s.name,
|
|
66
|
+
color: s.color || "",
|
|
67
|
+
data: s.data
|
|
68
|
+
})) : current.series,
|
|
69
|
+
categoryColors: params.categoryColors !== void 0 ? params.categoryColors : current.categoryColors,
|
|
70
|
+
footnotes: params.footnotes !== void 0 ? params.footnotes : current.footnotes,
|
|
71
|
+
typeOptions: params.typeOptions !== void 0 ? params.typeOptions : current.typeOptions || {}
|
|
72
|
+
};
|
|
73
|
+
const result = validateChartData(merged, COLORS);
|
|
74
|
+
if ("error" in result) return result;
|
|
75
|
+
const { $t } = ctx.app;
|
|
76
|
+
return {
|
|
77
|
+
type: "options",
|
|
78
|
+
label: $t("aiAgentUpdateChartDone", "Updated chart"),
|
|
79
|
+
affectedUuids: [params.uuid],
|
|
80
|
+
apply: (adapter) => adapter.updateOptions([
|
|
81
|
+
{
|
|
82
|
+
uuid: params.uuid,
|
|
83
|
+
key: chartOption.key,
|
|
84
|
+
value: JSON.stringify(result.data)
|
|
85
|
+
}
|
|
86
|
+
])
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { XAxisTypeOptions, DataLabelsTypeOptions, LegendTypeOptions, GridTypeOptions, StrokeWidthTypeOptions } from './shared.js';
|
|
2
|
+
export type TypeOptions = {
|
|
3
|
+
curved: boolean;
|
|
4
|
+
markers: boolean;
|
|
5
|
+
} & XAxisTypeOptions & DataLabelsTypeOptions & LegendTypeOptions & GridTypeOptions & StrokeWidthTypeOptions;
|
|
6
|
+
declare const _default: import("./types.js").ChartTypeFactory<TypeOptions>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { defineChartType } from "./define.js";
|
|
2
|
+
import {
|
|
3
|
+
xAxisOptions,
|
|
4
|
+
buildXAxisLabelOptions,
|
|
5
|
+
dataLabelsOptions,
|
|
6
|
+
buildDataLabelsOptions,
|
|
7
|
+
legendOptions,
|
|
8
|
+
buildLegendOptions,
|
|
9
|
+
gridOptions,
|
|
10
|
+
buildGridOptions,
|
|
11
|
+
strokeWidthOptions,
|
|
12
|
+
buildStrokeWidthOptions,
|
|
13
|
+
mergeShared
|
|
14
|
+
} from "./shared.js";
|
|
15
|
+
export default defineChartType(($t) => {
|
|
16
|
+
const shared = mergeShared(
|
|
17
|
+
xAxisOptions($t),
|
|
18
|
+
dataLabelsOptions($t),
|
|
19
|
+
legendOptions($t),
|
|
20
|
+
gridOptions($t),
|
|
21
|
+
strokeWidthOptions($t)
|
|
22
|
+
);
|
|
23
|
+
return {
|
|
24
|
+
id: "area",
|
|
25
|
+
hasMultipleSeries: true,
|
|
26
|
+
hasSeriesColors: true,
|
|
27
|
+
hasCategoryColors: false,
|
|
28
|
+
buildChartOptions(ctx) {
|
|
29
|
+
const strokeWidth = buildStrokeWidthOptions(ctx.typeOptions);
|
|
30
|
+
return {
|
|
31
|
+
stroke: {
|
|
32
|
+
curve: ctx.typeOptions.curved ? "smooth" : "straight",
|
|
33
|
+
...strokeWidth.stroke
|
|
34
|
+
},
|
|
35
|
+
markers: { size: ctx.typeOptions.markers ? 5 : 0 },
|
|
36
|
+
xaxis: {
|
|
37
|
+
categories: ctx.categories,
|
|
38
|
+
...buildXAxisLabelOptions(ctx.typeOptions)
|
|
39
|
+
},
|
|
40
|
+
...buildDataLabelsOptions(ctx.typeOptions),
|
|
41
|
+
...buildLegendOptions(ctx.typeOptions),
|
|
42
|
+
...buildGridOptions(ctx.typeOptions)
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
buildSeries(ctx) {
|
|
46
|
+
return ctx.series.map((s) => ({ name: s.name, data: s.data }));
|
|
47
|
+
},
|
|
48
|
+
editor: {
|
|
49
|
+
label: $t("chartsTypeArea", "Area"),
|
|
50
|
+
icon: "bk_mdi_area_chart",
|
|
51
|
+
options: {
|
|
52
|
+
curved: {
|
|
53
|
+
type: "checkbox",
|
|
54
|
+
label: $t("chartsAreaCurved", "Smooth curves"),
|
|
55
|
+
default: false,
|
|
56
|
+
group: "display"
|
|
57
|
+
},
|
|
58
|
+
markers: {
|
|
59
|
+
type: "checkbox",
|
|
60
|
+
label: $t("chartsAreaMarkers", "Show markers"),
|
|
61
|
+
default: false,
|
|
62
|
+
group: "display"
|
|
63
|
+
},
|
|
64
|
+
...shared.options
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { XAxisTypeOptions, DataLabelsTypeOptions, LegendTypeOptions, GridTypeOptions } from './shared.js';
|
|
2
|
+
export type TypeOptions = {
|
|
3
|
+
stacked: boolean;
|
|
4
|
+
horizontal: boolean;
|
|
5
|
+
borderRadius: string;
|
|
6
|
+
} & XAxisTypeOptions & DataLabelsTypeOptions & LegendTypeOptions & GridTypeOptions;
|
|
7
|
+
declare const _default: import("./types.js").ChartTypeFactory<TypeOptions>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defineChartType } from "./define.js";
|
|
2
|
+
import {
|
|
3
|
+
xAxisOptions,
|
|
4
|
+
buildXAxisLabelOptions,
|
|
5
|
+
dataLabelsOptions,
|
|
6
|
+
buildDataLabelsOptions,
|
|
7
|
+
legendOptions,
|
|
8
|
+
buildLegendOptions,
|
|
9
|
+
gridOptions,
|
|
10
|
+
buildGridOptions,
|
|
11
|
+
mergeShared
|
|
12
|
+
} from "./shared.js";
|
|
13
|
+
export default defineChartType(($t) => {
|
|
14
|
+
const shared = mergeShared(
|
|
15
|
+
xAxisOptions($t),
|
|
16
|
+
dataLabelsOptions($t),
|
|
17
|
+
legendOptions($t),
|
|
18
|
+
gridOptions($t)
|
|
19
|
+
);
|
|
20
|
+
return {
|
|
21
|
+
id: "bar",
|
|
22
|
+
hasMultipleSeries: true,
|
|
23
|
+
hasSeriesColors: true,
|
|
24
|
+
hasCategoryColors: false,
|
|
25
|
+
buildChartOptions(ctx) {
|
|
26
|
+
return {
|
|
27
|
+
chart: { stacked: !!ctx.typeOptions.stacked },
|
|
28
|
+
plotOptions: {
|
|
29
|
+
bar: {
|
|
30
|
+
horizontal: !!ctx.typeOptions.horizontal,
|
|
31
|
+
borderRadius: Number(ctx.typeOptions.borderRadius) || 0
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
xaxis: {
|
|
35
|
+
categories: ctx.categories,
|
|
36
|
+
...buildXAxisLabelOptions(ctx.typeOptions)
|
|
37
|
+
},
|
|
38
|
+
...buildDataLabelsOptions(ctx.typeOptions),
|
|
39
|
+
...buildLegendOptions(ctx.typeOptions),
|
|
40
|
+
...buildGridOptions(ctx.typeOptions)
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
buildSeries(ctx) {
|
|
44
|
+
return ctx.series.map((s) => ({ name: s.name, data: s.data }));
|
|
45
|
+
},
|
|
46
|
+
editor: {
|
|
47
|
+
label: $t("chartsTypeBar", "Bar"),
|
|
48
|
+
icon: "bk_mdi_bar_chart",
|
|
49
|
+
options: {
|
|
50
|
+
stacked: {
|
|
51
|
+
type: "checkbox",
|
|
52
|
+
label: $t("chartsBarStacked", "Stacked"),
|
|
53
|
+
default: false,
|
|
54
|
+
group: "display"
|
|
55
|
+
},
|
|
56
|
+
horizontal: {
|
|
57
|
+
type: "checkbox",
|
|
58
|
+
label: $t("chartsBarHorizontal", "Horizontal"),
|
|
59
|
+
default: false,
|
|
60
|
+
group: "display"
|
|
61
|
+
},
|
|
62
|
+
borderRadius: {
|
|
63
|
+
type: "radios",
|
|
64
|
+
label: $t("chartsBorderRadius", "Corner radius"),
|
|
65
|
+
default: "0",
|
|
66
|
+
options: {
|
|
67
|
+
"0": $t("chartsBorderRadiusNone", "None"),
|
|
68
|
+
"4": $t("chartsBorderRadiusSmall", "Small"),
|
|
69
|
+
"8": $t("chartsBorderRadiusLarge", "Large")
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
...shared.options
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
});
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { defineChartType } from "./define.js";
|
|
2
|
+
export default defineChartType(($t) => ({
|
|
3
|
+
id: "donut",
|
|
4
|
+
hasMultipleSeries: false,
|
|
5
|
+
hasSeriesColors: false,
|
|
6
|
+
hasCategoryColors: true,
|
|
7
|
+
buildChartOptions(ctx) {
|
|
8
|
+
const show = !!ctx.typeOptions.showTotal;
|
|
9
|
+
return {
|
|
10
|
+
labels: ctx.categories,
|
|
11
|
+
dataLabels: { enabled: !!ctx.typeOptions.showLabels },
|
|
12
|
+
plotOptions: {
|
|
13
|
+
pie: {
|
|
14
|
+
donut: {
|
|
15
|
+
labels: {
|
|
16
|
+
show,
|
|
17
|
+
total: { show }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
buildSeries(ctx) {
|
|
25
|
+
return ctx.series[0]?.data || [];
|
|
26
|
+
},
|
|
27
|
+
editor: {
|
|
28
|
+
label: $t("chartsTypeDonut", "Donut"),
|
|
29
|
+
icon: "bk_mdi_donut_large",
|
|
30
|
+
options: {
|
|
31
|
+
showTotal: {
|
|
32
|
+
type: "checkbox",
|
|
33
|
+
label: $t("chartsDonutShowTotal", "Show total"),
|
|
34
|
+
default: false,
|
|
35
|
+
group: "display"
|
|
36
|
+
},
|
|
37
|
+
showLabels: {
|
|
38
|
+
type: "checkbox",
|
|
39
|
+
label: $t("chartsDonutShowLabels", "Show labels"),
|
|
40
|
+
default: true,
|
|
41
|
+
group: "labels"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { XAxisTypeOptions, LegendTypeOptions, GridTypeOptions } from './shared.js';
|
|
2
|
+
export type TypeOptions = XAxisTypeOptions & LegendTypeOptions & GridTypeOptions;
|
|
3
|
+
declare const _default: import("./types.js").ChartTypeFactory<TypeOptions>;
|
|
4
|
+
export default _default;
|