@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,54 @@
|
|
|
1
|
+
import { defineChartType } from "./define.js";
|
|
2
|
+
import {
|
|
3
|
+
xAxisOptions,
|
|
4
|
+
buildXAxisLabelOptions,
|
|
5
|
+
legendOptions,
|
|
6
|
+
buildLegendOptions,
|
|
7
|
+
gridOptions,
|
|
8
|
+
buildGridOptions,
|
|
9
|
+
mergeShared
|
|
10
|
+
} from "./shared.js";
|
|
11
|
+
export default defineChartType(($t) => {
|
|
12
|
+
const shared = mergeShared(
|
|
13
|
+
xAxisOptions($t),
|
|
14
|
+
legendOptions($t),
|
|
15
|
+
gridOptions($t)
|
|
16
|
+
);
|
|
17
|
+
return {
|
|
18
|
+
id: "heatmap",
|
|
19
|
+
hasMultipleSeries: true,
|
|
20
|
+
hasSeriesColors: false,
|
|
21
|
+
hasCategoryColors: false,
|
|
22
|
+
buildChartOptions(ctx) {
|
|
23
|
+
return {
|
|
24
|
+
dataLabels: { enabled: true },
|
|
25
|
+
plotOptions: {
|
|
26
|
+
heatmap: {
|
|
27
|
+
colorScale: { ranges: [] }
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
xaxis: {
|
|
31
|
+
...buildXAxisLabelOptions(ctx.typeOptions)
|
|
32
|
+
},
|
|
33
|
+
...buildLegendOptions(ctx.typeOptions),
|
|
34
|
+
...buildGridOptions(ctx.typeOptions)
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
buildSeries(ctx) {
|
|
38
|
+
return ctx.series.map((s) => ({
|
|
39
|
+
name: s.name,
|
|
40
|
+
data: s.data.map((value, i) => ({
|
|
41
|
+
x: ctx.categories[i] || "",
|
|
42
|
+
y: value
|
|
43
|
+
}))
|
|
44
|
+
}));
|
|
45
|
+
},
|
|
46
|
+
editor: {
|
|
47
|
+
label: $t("chartsTypeHeatmap", "Heatmap"),
|
|
48
|
+
icon: "bk_mdi_grid_view",
|
|
49
|
+
options: {
|
|
50
|
+
...shared.options
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { TranslateFunction, ChartTypeDefinition } from './types.js';
|
|
2
|
+
import type { TypeOptions as BarTypeOptions } from './bar.js';
|
|
3
|
+
import type { TypeOptions as LineTypeOptions } from './line.js';
|
|
4
|
+
import type { TypeOptions as AreaTypeOptions } from './area.js';
|
|
5
|
+
import type { TypeOptions as PieTypeOptions } from './pie.js';
|
|
6
|
+
import type { TypeOptions as DonutTypeOptions } from './donut.js';
|
|
7
|
+
import type { TypeOptions as HeatmapTypeOptions } from './heatmap.js';
|
|
8
|
+
import type { TypeOptions as RadialBarTypeOptions } from './radialBar.js';
|
|
9
|
+
import type { TypeOptions as RadarTypeOptions } from './radar.js';
|
|
10
|
+
export type ChartTypeOptionsMap = {
|
|
11
|
+
bar: BarTypeOptions;
|
|
12
|
+
line: LineTypeOptions;
|
|
13
|
+
area: AreaTypeOptions;
|
|
14
|
+
pie: PieTypeOptions;
|
|
15
|
+
donut: DonutTypeOptions;
|
|
16
|
+
heatmap: HeatmapTypeOptions;
|
|
17
|
+
radialBar: RadialBarTypeOptions;
|
|
18
|
+
radar: RadarTypeOptions;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Get a chart type definition using fallback labels (no real translations).
|
|
22
|
+
* Used by ChartRenderer which runs in both edit mode and production.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getChartTypeRuntime(id: string): ChartTypeDefinition | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Get all chart type definitions with translated labels.
|
|
27
|
+
* Used by editor components only.
|
|
28
|
+
*/
|
|
29
|
+
export declare function getChartTypes($t: TranslateFunction): ChartTypeDefinition[];
|
|
30
|
+
/**
|
|
31
|
+
* Get a single chart type definition with translated labels.
|
|
32
|
+
* Used by editor components only.
|
|
33
|
+
*/
|
|
34
|
+
export declare function getChartType(id: string, $t: TranslateFunction): ChartTypeDefinition | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Get the default type options for a chart type.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getDefaultTypeOptions(id: string): Record<string, unknown>;
|
|
39
|
+
export type { ChartTypeDefinition, ChartBuildContext, TranslateFunction, } from './types.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import barFactory from "./bar.js";
|
|
2
|
+
import lineFactory from "./line.js";
|
|
3
|
+
import areaFactory from "./area.js";
|
|
4
|
+
import pieFactory from "./pie.js";
|
|
5
|
+
import donutFactory from "./donut.js";
|
|
6
|
+
import heatmapFactory from "./heatmap.js";
|
|
7
|
+
import radialBarFactory from "./radialBar.js";
|
|
8
|
+
import radarFactory from "./radar.js";
|
|
9
|
+
const factories = [
|
|
10
|
+
barFactory,
|
|
11
|
+
lineFactory,
|
|
12
|
+
pieFactory,
|
|
13
|
+
areaFactory,
|
|
14
|
+
donutFactory,
|
|
15
|
+
heatmapFactory,
|
|
16
|
+
radialBarFactory,
|
|
17
|
+
radarFactory
|
|
18
|
+
];
|
|
19
|
+
const noopT = (_key, fallback) => fallback;
|
|
20
|
+
const runtimeCache = {};
|
|
21
|
+
function ensureRuntimeCache() {
|
|
22
|
+
if (Object.keys(runtimeCache).length === 0) {
|
|
23
|
+
for (const factory of factories) {
|
|
24
|
+
const def = factory(noopT);
|
|
25
|
+
runtimeCache[def.id] = def;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export function getChartTypeRuntime(id) {
|
|
30
|
+
ensureRuntimeCache();
|
|
31
|
+
return runtimeCache[id];
|
|
32
|
+
}
|
|
33
|
+
export function getChartTypes($t) {
|
|
34
|
+
return factories.map((factory) => factory($t));
|
|
35
|
+
}
|
|
36
|
+
export function getChartType(id, $t) {
|
|
37
|
+
return getChartTypes($t).find((def) => def.id === id);
|
|
38
|
+
}
|
|
39
|
+
export function getDefaultTypeOptions(id) {
|
|
40
|
+
const def = getChartTypeRuntime(id);
|
|
41
|
+
if (!def) return {};
|
|
42
|
+
const defaults = {};
|
|
43
|
+
for (const [key, opt] of Object.entries(def.editor.options)) {
|
|
44
|
+
defaults[key] = opt.default;
|
|
45
|
+
}
|
|
46
|
+
return defaults;
|
|
47
|
+
}
|
|
@@ -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: "line",
|
|
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("chartsTypeLine", "Line"),
|
|
50
|
+
icon: "bk_mdi_show_chart",
|
|
51
|
+
options: {
|
|
52
|
+
curved: {
|
|
53
|
+
type: "checkbox",
|
|
54
|
+
label: $t("chartsLineCurved", "Smooth curves"),
|
|
55
|
+
default: false,
|
|
56
|
+
group: "display"
|
|
57
|
+
},
|
|
58
|
+
markers: {
|
|
59
|
+
type: "checkbox",
|
|
60
|
+
label: $t("chartsLineMarkers", "Show markers"),
|
|
61
|
+
default: false,
|
|
62
|
+
group: "display"
|
|
63
|
+
},
|
|
64
|
+
...shared.options
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineChartType } from "./define.js";
|
|
2
|
+
export default defineChartType(($t) => ({
|
|
3
|
+
id: "pie",
|
|
4
|
+
hasMultipleSeries: false,
|
|
5
|
+
hasSeriesColors: false,
|
|
6
|
+
hasCategoryColors: true,
|
|
7
|
+
buildChartOptions(ctx) {
|
|
8
|
+
return {
|
|
9
|
+
labels: ctx.categories,
|
|
10
|
+
dataLabels: { enabled: !!ctx.typeOptions.showLabels }
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
buildSeries(ctx) {
|
|
14
|
+
return ctx.series[0]?.data || [];
|
|
15
|
+
},
|
|
16
|
+
editor: {
|
|
17
|
+
label: $t("chartsTypePie", "Pie"),
|
|
18
|
+
icon: "bk_mdi_pie_chart",
|
|
19
|
+
options: {
|
|
20
|
+
showLabels: {
|
|
21
|
+
type: "checkbox",
|
|
22
|
+
label: $t("chartsPieShowLabels", "Show labels"),
|
|
23
|
+
default: true,
|
|
24
|
+
group: "labels"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DataLabelsTypeOptions, LegendTypeOptions } from './shared.js';
|
|
2
|
+
export type TypeOptions = {
|
|
3
|
+
markers: boolean;
|
|
4
|
+
fillOpacity: string;
|
|
5
|
+
} & DataLabelsTypeOptions & LegendTypeOptions;
|
|
6
|
+
declare const _default: import("./types.js").ChartTypeFactory<TypeOptions>;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineChartType } from "./define.js";
|
|
2
|
+
import {
|
|
3
|
+
dataLabelsOptions,
|
|
4
|
+
buildDataLabelsOptions,
|
|
5
|
+
legendOptions,
|
|
6
|
+
buildLegendOptions,
|
|
7
|
+
mergeShared
|
|
8
|
+
} from "./shared.js";
|
|
9
|
+
export default defineChartType(($t) => {
|
|
10
|
+
const shared = mergeShared(dataLabelsOptions($t), legendOptions($t));
|
|
11
|
+
return {
|
|
12
|
+
id: "radar",
|
|
13
|
+
hasMultipleSeries: true,
|
|
14
|
+
hasSeriesColors: true,
|
|
15
|
+
hasCategoryColors: false,
|
|
16
|
+
buildChartOptions(ctx) {
|
|
17
|
+
return {
|
|
18
|
+
xaxis: { categories: ctx.categories },
|
|
19
|
+
markers: { size: ctx.typeOptions.markers ? 5 : 0 },
|
|
20
|
+
fill: { opacity: Number(ctx.typeOptions.fillOpacity) || 0.2 },
|
|
21
|
+
...buildDataLabelsOptions(ctx.typeOptions),
|
|
22
|
+
...buildLegendOptions(ctx.typeOptions)
|
|
23
|
+
};
|
|
24
|
+
},
|
|
25
|
+
buildSeries(ctx) {
|
|
26
|
+
return ctx.series.map((s) => ({ name: s.name, data: s.data }));
|
|
27
|
+
},
|
|
28
|
+
editor: {
|
|
29
|
+
label: $t("chartsTypeRadar", "Radar"),
|
|
30
|
+
icon: "bk_mdi_radar",
|
|
31
|
+
options: {
|
|
32
|
+
markers: {
|
|
33
|
+
type: "checkbox",
|
|
34
|
+
label: $t("chartsRadarMarkers", "Show markers"),
|
|
35
|
+
default: false,
|
|
36
|
+
group: "display"
|
|
37
|
+
},
|
|
38
|
+
fillOpacity: {
|
|
39
|
+
type: "radios",
|
|
40
|
+
label: $t("chartsRadarFillOpacity", "Fill opacity"),
|
|
41
|
+
default: "0.2",
|
|
42
|
+
options: {
|
|
43
|
+
"0.2": $t("chartsOpacityTransparent", "Transparent"),
|
|
44
|
+
"0.4": $t("chartsOpacityLight", "Light"),
|
|
45
|
+
"0.8": $t("chartsOpacitySolid", "Solid")
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
...shared.options
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { defineChartType } from "./define.js";
|
|
2
|
+
export default defineChartType(($t) => ({
|
|
3
|
+
id: "radialBar",
|
|
4
|
+
hasMultipleSeries: false,
|
|
5
|
+
hasSeriesColors: false,
|
|
6
|
+
hasCategoryColors: true,
|
|
7
|
+
buildChartOptions(ctx) {
|
|
8
|
+
const showLabels = !!ctx.typeOptions.showLabels;
|
|
9
|
+
const showTotal = !!ctx.typeOptions.showTotal;
|
|
10
|
+
return {
|
|
11
|
+
labels: ctx.categories,
|
|
12
|
+
plotOptions: {
|
|
13
|
+
radialBar: {
|
|
14
|
+
dataLabels: {
|
|
15
|
+
name: { show: showLabels },
|
|
16
|
+
value: { show: showLabels },
|
|
17
|
+
total: { show: showTotal }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
buildSeries(ctx) {
|
|
24
|
+
return ctx.series[0]?.data || [];
|
|
25
|
+
},
|
|
26
|
+
editor: {
|
|
27
|
+
label: $t("chartsTypeRadialBar", "Radial Bar"),
|
|
28
|
+
icon: "bk_mdi_track_changes",
|
|
29
|
+
options: {
|
|
30
|
+
showLabels: {
|
|
31
|
+
type: "checkbox",
|
|
32
|
+
label: $t("chartsRadialBarShowLabels", "Show labels"),
|
|
33
|
+
default: true,
|
|
34
|
+
group: "labels"
|
|
35
|
+
},
|
|
36
|
+
showTotal: {
|
|
37
|
+
type: "checkbox",
|
|
38
|
+
label: $t("chartsRadialBarShowTotal", "Show total"),
|
|
39
|
+
default: false,
|
|
40
|
+
group: "display"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}));
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
+
import type { BlockOptionDefinitionBase } from '../../../../global/types/blockOptions.js';
|
|
3
|
+
import type { TranslateFunction } from './types.js';
|
|
4
|
+
type SharedOptions = {
|
|
5
|
+
options: Record<string, BlockOptionDefinitionBase<BlokkliIcon>>;
|
|
6
|
+
};
|
|
7
|
+
export type XAxisTypeOptions = {
|
|
8
|
+
xaxisRotation: string;
|
|
9
|
+
};
|
|
10
|
+
export type DataLabelsTypeOptions = {
|
|
11
|
+
dataLabels: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type LegendTypeOptions = {
|
|
14
|
+
legendPosition: string;
|
|
15
|
+
};
|
|
16
|
+
export type GridTypeOptions = {
|
|
17
|
+
gridLines: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type StrokeWidthTypeOptions = {
|
|
20
|
+
strokeWidth: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Shared x-axis label options for chart types that display an x-axis.
|
|
24
|
+
*/
|
|
25
|
+
export declare function xAxisOptions($t: TranslateFunction): SharedOptions;
|
|
26
|
+
/**
|
|
27
|
+
* Build x-axis label config from type options.
|
|
28
|
+
* Returns properties to merge into the xaxis config object.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildXAxisLabelOptions(typeOptions: XAxisTypeOptions): Record<string, any>;
|
|
31
|
+
/**
|
|
32
|
+
* Data labels option — show values directly on chart elements.
|
|
33
|
+
*/
|
|
34
|
+
export declare function dataLabelsOptions($t: TranslateFunction): SharedOptions;
|
|
35
|
+
/**
|
|
36
|
+
* Build data labels config from type options.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildDataLabelsOptions(typeOptions: DataLabelsTypeOptions): Record<string, any>;
|
|
39
|
+
/**
|
|
40
|
+
* Legend position option for multi-series chart types.
|
|
41
|
+
*/
|
|
42
|
+
export declare function legendOptions($t: TranslateFunction): SharedOptions;
|
|
43
|
+
/**
|
|
44
|
+
* Build legend config from type options.
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildLegendOptions(typeOptions: LegendTypeOptions): Record<string, any>;
|
|
47
|
+
/**
|
|
48
|
+
* Grid lines option for chart types with axes.
|
|
49
|
+
*/
|
|
50
|
+
export declare function gridOptions($t: TranslateFunction): SharedOptions;
|
|
51
|
+
/**
|
|
52
|
+
* Build grid config from type options.
|
|
53
|
+
*/
|
|
54
|
+
export declare function buildGridOptions(typeOptions: GridTypeOptions): Record<string, any>;
|
|
55
|
+
/**
|
|
56
|
+
* Stroke width option for line-based chart types.
|
|
57
|
+
*/
|
|
58
|
+
export declare function strokeWidthOptions($t: TranslateFunction): SharedOptions;
|
|
59
|
+
/**
|
|
60
|
+
* Build stroke width config from type options.
|
|
61
|
+
*/
|
|
62
|
+
export declare function buildStrokeWidthOptions(typeOptions: StrokeWidthTypeOptions): Record<string, any>;
|
|
63
|
+
/**
|
|
64
|
+
* Merge multiple shared option sets into one.
|
|
65
|
+
*/
|
|
66
|
+
export declare function mergeShared(...sets: SharedOptions[]): SharedOptions;
|
|
67
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
export function xAxisOptions($t) {
|
|
2
|
+
return {
|
|
3
|
+
options: {
|
|
4
|
+
xaxisRotation: {
|
|
5
|
+
type: "radios",
|
|
6
|
+
label: $t("chartsXAxisRotation", "Label rotation"),
|
|
7
|
+
default: "auto",
|
|
8
|
+
options: {
|
|
9
|
+
auto: $t("chartsRotationAuto", "Auto"),
|
|
10
|
+
"-45": "-45\xB0",
|
|
11
|
+
"-90": "-90\xB0"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function buildXAxisLabelOptions(typeOptions) {
|
|
18
|
+
const rotation = typeOptions.xaxisRotation;
|
|
19
|
+
if (rotation && rotation !== "auto") {
|
|
20
|
+
return {
|
|
21
|
+
labels: {
|
|
22
|
+
rotate: Number(rotation),
|
|
23
|
+
rotateAlways: true
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
return {};
|
|
28
|
+
}
|
|
29
|
+
export function dataLabelsOptions($t) {
|
|
30
|
+
return {
|
|
31
|
+
options: {
|
|
32
|
+
dataLabels: {
|
|
33
|
+
type: "checkbox",
|
|
34
|
+
label: $t("chartsDataLabels", "Data labels"),
|
|
35
|
+
default: false,
|
|
36
|
+
group: "labels"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function buildDataLabelsOptions(typeOptions) {
|
|
42
|
+
return { dataLabels: { enabled: !!typeOptions.dataLabels } };
|
|
43
|
+
}
|
|
44
|
+
export function legendOptions($t) {
|
|
45
|
+
return {
|
|
46
|
+
options: {
|
|
47
|
+
legendPosition: {
|
|
48
|
+
type: "radios",
|
|
49
|
+
label: $t("chartsLegendPosition", "Legend position"),
|
|
50
|
+
default: "bottom",
|
|
51
|
+
options: {
|
|
52
|
+
bottom: $t("chartsPositionBottom", "Bottom"),
|
|
53
|
+
top: $t("chartsPositionTop", "Top"),
|
|
54
|
+
right: $t("chartsPositionRight", "Right")
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function buildLegendOptions(typeOptions) {
|
|
61
|
+
return { legend: { position: typeOptions.legendPosition || "bottom" } };
|
|
62
|
+
}
|
|
63
|
+
export function gridOptions($t) {
|
|
64
|
+
return {
|
|
65
|
+
options: {
|
|
66
|
+
gridLines: {
|
|
67
|
+
type: "checkbox",
|
|
68
|
+
label: $t("chartsGridLines", "Grid lines"),
|
|
69
|
+
default: true,
|
|
70
|
+
group: "display"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function buildGridOptions(typeOptions) {
|
|
76
|
+
return { grid: { show: !!typeOptions.gridLines } };
|
|
77
|
+
}
|
|
78
|
+
export function strokeWidthOptions($t) {
|
|
79
|
+
return {
|
|
80
|
+
options: {
|
|
81
|
+
strokeWidth: {
|
|
82
|
+
type: "radios",
|
|
83
|
+
label: $t("chartsStrokeWidth", "Line thickness"),
|
|
84
|
+
default: "2",
|
|
85
|
+
options: {
|
|
86
|
+
"2": $t("chartsStrokeThin", "Thin"),
|
|
87
|
+
"4": $t("chartsStrokeMedium", "Medium"),
|
|
88
|
+
"6": $t("chartsStrokeThick", "Thick")
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export function buildStrokeWidthOptions(typeOptions) {
|
|
95
|
+
return { stroke: { width: Number(typeOptions.strokeWidth) || 2 } };
|
|
96
|
+
}
|
|
97
|
+
export function mergeShared(...sets) {
|
|
98
|
+
const options = {};
|
|
99
|
+
for (const set of sets) {
|
|
100
|
+
Object.assign(options, set.options);
|
|
101
|
+
}
|
|
102
|
+
return { options };
|
|
103
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
+
import type { BlockOptionDefinitionBase } from '../../../../global/types/blockOptions.js';
|
|
3
|
+
export type TranslateFunction = (key: string, fallback: string) => string;
|
|
4
|
+
export type ChartBuildContext<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
5
|
+
title: string;
|
|
6
|
+
categories: string[];
|
|
7
|
+
series: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
color: string;
|
|
10
|
+
data: number[];
|
|
11
|
+
}>;
|
|
12
|
+
seriesColors: string[];
|
|
13
|
+
categoryColors: string[];
|
|
14
|
+
typeOptions: T;
|
|
15
|
+
};
|
|
16
|
+
export type ChartTypeDefinition<T extends Record<string, unknown> = Record<string, unknown>> = {
|
|
17
|
+
id: string;
|
|
18
|
+
hasMultipleSeries: boolean;
|
|
19
|
+
hasSeriesColors: boolean;
|
|
20
|
+
hasCategoryColors: boolean;
|
|
21
|
+
buildChartOptions: (ctx: ChartBuildContext<T>) => Record<string, any>;
|
|
22
|
+
buildSeries: (ctx: ChartBuildContext<T>) => any;
|
|
23
|
+
editor: {
|
|
24
|
+
label: string;
|
|
25
|
+
icon: BlokkliIcon;
|
|
26
|
+
options: Record<string, BlockOptionDefinitionBase<BlokkliIcon>>;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export type ChartTypeFactory<T extends Record<string, unknown> = Record<string, unknown>> = ($t: TranslateFunction) => ChartTypeDefinition<T>;
|
|
File without changes
|