@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,249 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bk-chart-editor" @wheel.capture.stop>
|
|
3
|
+
<div class="bk-chart-editor-top">
|
|
4
|
+
<div class="bk-chart-editor-top-actions">
|
|
5
|
+
<div class="bk-chart-editor-actions">
|
|
6
|
+
<button type="button" :disabled="!canUndo" @click="undo">
|
|
7
|
+
<Icon name="bk_mdi_undo" />
|
|
8
|
+
</button>
|
|
9
|
+
<button type="button" :disabled="!canRedo" @click="redo">
|
|
10
|
+
<Icon name="bk_mdi_redo" />
|
|
11
|
+
</button>
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
<ChartTypePicker v-model="data.type" />
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<ChartTypeOptions
|
|
18
|
+
v-if="chartDef"
|
|
19
|
+
v-model:title="data.title"
|
|
20
|
+
:options="chartDef.editor.options"
|
|
21
|
+
:type-options="data.typeOptions || {}"
|
|
22
|
+
@update:type-options="data.typeOptions = $event"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="bk-chart-editor-main">
|
|
27
|
+
<div class="bk-chart-editor-section">
|
|
28
|
+
<div class="bk-chart-editor-preview-header">
|
|
29
|
+
<label class="bk-form-label">{{
|
|
30
|
+
$t("chartsPreview", "Preview")
|
|
31
|
+
}}</label>
|
|
32
|
+
<div class="bk-chart-editor-preview-actions">
|
|
33
|
+
<button
|
|
34
|
+
v-if="!autoUpdate"
|
|
35
|
+
type="button"
|
|
36
|
+
class="bk-button bk-is-small"
|
|
37
|
+
@click="refreshPreview"
|
|
38
|
+
>
|
|
39
|
+
{{ $t("chartsRefreshPreview", "Refresh Preview") }}
|
|
40
|
+
</button>
|
|
41
|
+
<FormToggle
|
|
42
|
+
v-model="autoUpdate"
|
|
43
|
+
:label="$t('chartsAutoUpdate', 'Auto-update')"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
<Preview
|
|
48
|
+
:uuid
|
|
49
|
+
:option-key="optionKey"
|
|
50
|
+
:data="previewData"
|
|
51
|
+
:stale="isStale"
|
|
52
|
+
/>
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
<div class="bk-chart-editor-section">
|
|
56
|
+
<label class="bk-form-label">{{ $t("chartsData", "Data") }}</label>
|
|
57
|
+
<DataTable
|
|
58
|
+
:categories="data.categories"
|
|
59
|
+
:series="data.series"
|
|
60
|
+
:category-colors="data.categoryColors"
|
|
61
|
+
:has-multiple-series="caps.hasMultipleSeries"
|
|
62
|
+
:has-series-colors="caps.hasSeriesColors"
|
|
63
|
+
:has-category-colors="caps.hasCategoryColors"
|
|
64
|
+
:colors="COLORS"
|
|
65
|
+
:remove-row="removeRow"
|
|
66
|
+
:remove-series="removeSeries"
|
|
67
|
+
@update:categories="data.categories = $event"
|
|
68
|
+
@update:series="data.series = $event"
|
|
69
|
+
@update:category-colors="data.categoryColors = $event"
|
|
70
|
+
/>
|
|
71
|
+
<div class="bk-chart-data-table-actions">
|
|
72
|
+
<button type="button" class="bk-button bk-is-small" @click="addRow">
|
|
73
|
+
<Icon name="bk_mdi_add_row_below" />
|
|
74
|
+
{{ $t("chartsAddRow", "Add row") }}
|
|
75
|
+
</button>
|
|
76
|
+
<button
|
|
77
|
+
v-if="caps.hasMultipleSeries"
|
|
78
|
+
type="button"
|
|
79
|
+
class="bk-button bk-is-small"
|
|
80
|
+
@click="addSeries"
|
|
81
|
+
>
|
|
82
|
+
<Icon name="bk_mdi_add_column_right" />
|
|
83
|
+
{{ $t("chartsAddColumn", "Add column") }}
|
|
84
|
+
</button>
|
|
85
|
+
<CsvImport :colors="COLORS" @import="importData" />
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
<div class="bk-chart-editor-section">
|
|
90
|
+
<FootnoteEditor
|
|
91
|
+
:footnotes="data.footnotes"
|
|
92
|
+
@update:footnotes="data.footnotes = $event"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
|
|
99
|
+
<script setup>
|
|
100
|
+
import { ref, computed, watch, useBlokkli, onBeforeUnmount } from "#imports";
|
|
101
|
+
import { getDefaultChartData, getFirstColorId } from "../../../helpers";
|
|
102
|
+
import { getChartType, getDefaultTypeOptions } from "../../../chartTypes";
|
|
103
|
+
import { COLORS } from "#blokkli-build/charts-config";
|
|
104
|
+
import { useChartEditorState } from "./useChartEditorState";
|
|
105
|
+
import { Icon, FormToggle } from "#blokkli/editor/components";
|
|
106
|
+
import ChartTypePicker from "./ChartTypePicker/index.vue";
|
|
107
|
+
import DataTable from "./DataTable/index.vue";
|
|
108
|
+
import CsvImport from "./CsvImport/index.vue";
|
|
109
|
+
import FootnoteEditor from "./FootnoteEditor/index.vue";
|
|
110
|
+
import Preview from "./Preview/index.vue";
|
|
111
|
+
import ChartTypeOptions from "./ChartTypeOptions/index.vue";
|
|
112
|
+
import { onBlokkliEvent } from "#blokkli/editor/composables";
|
|
113
|
+
const props = defineProps({
|
|
114
|
+
uuid: { type: String, required: true },
|
|
115
|
+
optionKey: { type: String, required: true }
|
|
116
|
+
});
|
|
117
|
+
const { $t, state } = useBlokkli();
|
|
118
|
+
function getCurrentData() {
|
|
119
|
+
const rawData = state.mutatedOptions[props.uuid]?.data || state.getFieldListItem(props.uuid)?.options?.data;
|
|
120
|
+
if (rawData) {
|
|
121
|
+
try {
|
|
122
|
+
const parsed = JSON.parse(rawData);
|
|
123
|
+
if (parsed && Array.isArray(parsed.series) && parsed.series.length > 0) {
|
|
124
|
+
const fallbackId = getFirstColorId(COLORS);
|
|
125
|
+
for (const series of parsed.series) {
|
|
126
|
+
if (!COLORS[series.color]) {
|
|
127
|
+
series.color = fallbackId;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
if (Array.isArray(parsed.categoryColors)) {
|
|
131
|
+
for (let i = 0; i < parsed.categoryColors.length; i++) {
|
|
132
|
+
if (!COLORS[parsed.categoryColors[i]]) {
|
|
133
|
+
parsed.categoryColors[i] = fallbackId;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
} else {
|
|
137
|
+
parsed.categoryColors = parsed.categories.map(
|
|
138
|
+
(_, i) => {
|
|
139
|
+
const ids = Object.keys(COLORS);
|
|
140
|
+
return ids[i % ids.length] || fallbackId;
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
if (!Array.isArray(parsed.footnotes)) {
|
|
145
|
+
parsed.footnotes = [];
|
|
146
|
+
}
|
|
147
|
+
if (!parsed.typeOptions || typeof parsed.typeOptions !== "object") {
|
|
148
|
+
parsed.typeOptions = getDefaultTypeOptions(parsed.type);
|
|
149
|
+
}
|
|
150
|
+
return parsed;
|
|
151
|
+
}
|
|
152
|
+
} catch {
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return getDefaultChartData(COLORS);
|
|
156
|
+
}
|
|
157
|
+
const {
|
|
158
|
+
data,
|
|
159
|
+
canUndo,
|
|
160
|
+
canRedo,
|
|
161
|
+
undo,
|
|
162
|
+
redo,
|
|
163
|
+
addRow,
|
|
164
|
+
addSeries,
|
|
165
|
+
removeRow,
|
|
166
|
+
removeSeries,
|
|
167
|
+
importData
|
|
168
|
+
} = useChartEditorState(getCurrentData(), COLORS);
|
|
169
|
+
const autoUpdate = ref(true);
|
|
170
|
+
const previewData = ref(
|
|
171
|
+
JSON.parse(JSON.stringify(data.value))
|
|
172
|
+
);
|
|
173
|
+
const isStale = ref(false);
|
|
174
|
+
let debounceTimer = null;
|
|
175
|
+
function refreshPreview() {
|
|
176
|
+
previewData.value = JSON.parse(JSON.stringify(data.value));
|
|
177
|
+
isStale.value = false;
|
|
178
|
+
}
|
|
179
|
+
watch(
|
|
180
|
+
data,
|
|
181
|
+
() => {
|
|
182
|
+
if (autoUpdate.value) {
|
|
183
|
+
if (debounceTimer) clearTimeout(debounceTimer);
|
|
184
|
+
isStale.value = true;
|
|
185
|
+
debounceTimer = setTimeout(refreshPreview, 500);
|
|
186
|
+
} else {
|
|
187
|
+
isStale.value = true;
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{ deep: true }
|
|
191
|
+
);
|
|
192
|
+
watch(autoUpdate, (enabled) => {
|
|
193
|
+
if (enabled) {
|
|
194
|
+
refreshPreview();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
onBeforeUnmount(() => {
|
|
198
|
+
if (debounceTimer) clearTimeout(debounceTimer);
|
|
199
|
+
});
|
|
200
|
+
const chartDef = computed(() => getChartType(data.value.type, $t));
|
|
201
|
+
const caps = computed(() => {
|
|
202
|
+
const def = chartDef.value;
|
|
203
|
+
return {
|
|
204
|
+
hasMultipleSeries: def?.hasMultipleSeries ?? true,
|
|
205
|
+
hasSeriesColors: def?.hasSeriesColors ?? true,
|
|
206
|
+
hasCategoryColors: def?.hasCategoryColors ?? false
|
|
207
|
+
};
|
|
208
|
+
});
|
|
209
|
+
const typeOptionsCache = {
|
|
210
|
+
...data.value.typeOptions
|
|
211
|
+
};
|
|
212
|
+
watch(
|
|
213
|
+
() => data.value.type,
|
|
214
|
+
(type) => {
|
|
215
|
+
const defaults = getDefaultTypeOptions(type);
|
|
216
|
+
const merged = {};
|
|
217
|
+
for (const key of Object.keys(defaults)) {
|
|
218
|
+
merged[key] = key in typeOptionsCache ? typeOptionsCache[key] : defaults[key];
|
|
219
|
+
}
|
|
220
|
+
data.value.typeOptions = merged;
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
watch(
|
|
224
|
+
() => data.value.typeOptions,
|
|
225
|
+
(opts) => {
|
|
226
|
+
if (opts) {
|
|
227
|
+
Object.assign(typeOptionsCache, opts);
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
{ deep: true }
|
|
231
|
+
);
|
|
232
|
+
function getData() {
|
|
233
|
+
return data.value;
|
|
234
|
+
}
|
|
235
|
+
onBlokkliEvent("keyPressed", (e) => {
|
|
236
|
+
if (e.code === "z" && e.meta) {
|
|
237
|
+
e.originalEvent.preventDefault();
|
|
238
|
+
if (canUndo.value) {
|
|
239
|
+
undo();
|
|
240
|
+
}
|
|
241
|
+
} else if (e.code === "Z" && e.meta && e.shift) {
|
|
242
|
+
e.originalEvent.preventDefault();
|
|
243
|
+
if (canRedo.value) {
|
|
244
|
+
redo();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
defineExpose({ getData });
|
|
249
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { BlokkliChartData } from '../../../types.js';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
uuid: string;
|
|
4
|
+
optionKey: string;
|
|
5
|
+
};
|
|
6
|
+
declare function getData(): BlokkliChartData;
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
8
|
+
getData: typeof getData;
|
|
9
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
|
+
declare const _default: typeof __VLS_export;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BlokkliChartData, ChartColor, ChartSeries } from '../../../types.js';
|
|
2
|
+
export declare function useChartEditorState(initial: BlokkliChartData, colors: Record<string, ChartColor>): {
|
|
3
|
+
data: any;
|
|
4
|
+
canUndo: any;
|
|
5
|
+
canRedo: any;
|
|
6
|
+
undo: () => void;
|
|
7
|
+
redo: () => void;
|
|
8
|
+
addRow: () => void;
|
|
9
|
+
addSeries: () => void;
|
|
10
|
+
removeRow: (index: number) => void;
|
|
11
|
+
removeSeries: (index: number) => void;
|
|
12
|
+
importData: (payload: {
|
|
13
|
+
categories: string[];
|
|
14
|
+
series: ChartSeries[];
|
|
15
|
+
categoryColors: string[];
|
|
16
|
+
}) => void;
|
|
17
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ref, watch, nextTick, computed } from "#imports";
|
|
2
|
+
import { getColorIdAtIndex } from "../../../helpers/index.js";
|
|
3
|
+
const MAX_HISTORY = 50;
|
|
4
|
+
function clone(v) {
|
|
5
|
+
return JSON.parse(JSON.stringify(v));
|
|
6
|
+
}
|
|
7
|
+
export function useChartEditorState(initial, colors) {
|
|
8
|
+
const data = ref(clone(initial));
|
|
9
|
+
const stack = ref([clone(initial)]);
|
|
10
|
+
const index = ref(0);
|
|
11
|
+
let isApplying = false;
|
|
12
|
+
const canUndo = computed(() => index.value > 0);
|
|
13
|
+
const canRedo = computed(() => index.value < stack.value.length - 1);
|
|
14
|
+
watch(
|
|
15
|
+
data,
|
|
16
|
+
(newVal) => {
|
|
17
|
+
if (isApplying) return;
|
|
18
|
+
stack.value.splice(index.value + 1);
|
|
19
|
+
stack.value.push(clone(newVal));
|
|
20
|
+
if (stack.value.length > MAX_HISTORY) {
|
|
21
|
+
stack.value.shift();
|
|
22
|
+
}
|
|
23
|
+
index.value = stack.value.length - 1;
|
|
24
|
+
},
|
|
25
|
+
{ deep: true }
|
|
26
|
+
);
|
|
27
|
+
function undo() {
|
|
28
|
+
if (!canUndo.value) return;
|
|
29
|
+
isApplying = true;
|
|
30
|
+
index.value--;
|
|
31
|
+
data.value = clone(stack.value[index.value]);
|
|
32
|
+
nextTick(() => {
|
|
33
|
+
isApplying = false;
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function redo() {
|
|
37
|
+
if (!canRedo.value) return;
|
|
38
|
+
isApplying = true;
|
|
39
|
+
index.value++;
|
|
40
|
+
data.value = clone(stack.value[index.value]);
|
|
41
|
+
nextTick(() => {
|
|
42
|
+
isApplying = false;
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function addRow() {
|
|
46
|
+
data.value.categories.push(`Category ${data.value.categories.length + 1}`);
|
|
47
|
+
for (const s of data.value.series) {
|
|
48
|
+
s.data.push(0);
|
|
49
|
+
}
|
|
50
|
+
data.value.categoryColors.push(
|
|
51
|
+
getColorIdAtIndex(data.value.categoryColors.length, colors)
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
function addSeries() {
|
|
55
|
+
data.value.series.push({
|
|
56
|
+
name: `Series ${data.value.series.length + 1}`,
|
|
57
|
+
color: getColorIdAtIndex(data.value.series.length, colors),
|
|
58
|
+
data: Array.from({ length: data.value.categories.length }).fill(
|
|
59
|
+
0
|
|
60
|
+
)
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function removeRow(index2) {
|
|
64
|
+
data.value.categories.splice(index2, 1);
|
|
65
|
+
for (const s of data.value.series) {
|
|
66
|
+
s.data.splice(index2, 1);
|
|
67
|
+
}
|
|
68
|
+
data.value.categoryColors.splice(index2, 1);
|
|
69
|
+
}
|
|
70
|
+
function removeSeries(index2) {
|
|
71
|
+
data.value.series.splice(index2, 1);
|
|
72
|
+
}
|
|
73
|
+
function importData(payload) {
|
|
74
|
+
data.value.categories = payload.categories;
|
|
75
|
+
data.value.series = payload.series;
|
|
76
|
+
data.value.categoryColors = payload.categoryColors;
|
|
77
|
+
}
|
|
78
|
+
return {
|
|
79
|
+
data,
|
|
80
|
+
canUndo,
|
|
81
|
+
canRedo,
|
|
82
|
+
undo,
|
|
83
|
+
redo,
|
|
84
|
+
addRow,
|
|
85
|
+
addSeries,
|
|
86
|
+
removeRow,
|
|
87
|
+
removeSeries,
|
|
88
|
+
importData
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<NestedEditorOverlay
|
|
3
|
+
v-if="uuid"
|
|
4
|
+
:uuid
|
|
5
|
+
:title="$t('chartsEditorTitle', 'Edit chart')"
|
|
6
|
+
icon="bk_mdi_area_chart"
|
|
7
|
+
theme="accent"
|
|
8
|
+
:element
|
|
9
|
+
@submit="onSubmit"
|
|
10
|
+
@close="onSubmit"
|
|
11
|
+
>
|
|
12
|
+
<ChartsEditor ref="editorRef" :uuid :option-key="optionKey" />
|
|
13
|
+
</NestedEditorOverlay>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { onBlokkliEvent } from "#blokkli/editor/composables";
|
|
18
|
+
import {
|
|
19
|
+
defineBlokkliFeature,
|
|
20
|
+
ref,
|
|
21
|
+
useTemplateRef,
|
|
22
|
+
useBlokkli,
|
|
23
|
+
computed
|
|
24
|
+
} from "#imports";
|
|
25
|
+
import { NestedEditorOverlay } from "#blokkli/editor/components";
|
|
26
|
+
import ChartsEditor from "./Editor/index.vue";
|
|
27
|
+
defineBlokkliFeature({
|
|
28
|
+
id: "charts",
|
|
29
|
+
icon: "bk_mdi_area_chart",
|
|
30
|
+
label: "Charts",
|
|
31
|
+
description: "Add and edit interactive charts.",
|
|
32
|
+
requiredAdapterMethods: ["updateOptions"]
|
|
33
|
+
});
|
|
34
|
+
const { $t, state, adapter, dom, blocks } = useBlokkli();
|
|
35
|
+
const uuid = ref(null);
|
|
36
|
+
const optionKey = ref("data");
|
|
37
|
+
const element = computed(() => {
|
|
38
|
+
if (!uuid.value) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const block = blocks.getBlock(uuid.value);
|
|
42
|
+
if (!block) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return dom.getDragElement(block);
|
|
46
|
+
});
|
|
47
|
+
const isLoading = ref(false);
|
|
48
|
+
const editorRef = useTemplateRef("editorRef");
|
|
49
|
+
async function onSubmit() {
|
|
50
|
+
if (!uuid.value || !editorRef.value) return;
|
|
51
|
+
const chartData = editorRef.value.getData();
|
|
52
|
+
isLoading.value = true;
|
|
53
|
+
await state.mutateWithLoadingState(
|
|
54
|
+
() => adapter.updateOptions([
|
|
55
|
+
{
|
|
56
|
+
uuid: uuid.value,
|
|
57
|
+
key: optionKey.value,
|
|
58
|
+
value: JSON.stringify(chartData)
|
|
59
|
+
}
|
|
60
|
+
]),
|
|
61
|
+
$t("chartsEditorSaveError", "The chart could not be saved.")
|
|
62
|
+
);
|
|
63
|
+
isLoading.value = false;
|
|
64
|
+
uuid.value = null;
|
|
65
|
+
}
|
|
66
|
+
onBlokkliEvent("option:edit-complex", (data) => {
|
|
67
|
+
if (data.dataType === "chart") {
|
|
68
|
+
uuid.value = data.uuid;
|
|
69
|
+
optionKey.value = data.key;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
</script>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BlokkliChartData, ChartColor } from '../types.js';
|
|
2
|
+
export declare const SUPERSCRIPTS: Record<string, string>;
|
|
3
|
+
/**
|
|
4
|
+
* Replace `{1}`, `{2}`, etc. with Unicode superscript characters.
|
|
5
|
+
*/
|
|
6
|
+
export declare function applyFootnotes(text: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Resolve a color ID to a concrete CSS color value that ApexCharts can use.
|
|
9
|
+
*
|
|
10
|
+
* Plain values like '#ff0000' or 'rgb(255, 0, 0)' are returned as-is.
|
|
11
|
+
* Values containing 'var(' (e.g. 'rgb(var(--theme-primary))') are resolved
|
|
12
|
+
* by setting the value on a DOM element and reading the computed color.
|
|
13
|
+
*
|
|
14
|
+
* Falls back to the first defined color if the ID is not found.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveChartColor(colorId: string, colors: Record<string, ChartColor>, el?: HTMLElement | null): string;
|
|
17
|
+
/**
|
|
18
|
+
* Get the fallback color ID (first defined color).
|
|
19
|
+
*/
|
|
20
|
+
export declare function getFirstColorId(colors: Record<string, ChartColor>): string;
|
|
21
|
+
/**
|
|
22
|
+
* Get a color ID for the given index, cycling through available colors.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getColorIdAtIndex(index: number, colors: Record<string, ChartColor>): string;
|
|
25
|
+
export declare function getDefaultChartData(colors: Record<string, ChartColor>): BlokkliChartData;
|
|
26
|
+
export declare function parseNumericInput(raw: string): number;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export const SUPERSCRIPTS = {
|
|
2
|
+
"1": "\xB9",
|
|
3
|
+
"2": "\xB2",
|
|
4
|
+
"3": "\xB3",
|
|
5
|
+
"4": "\u2074",
|
|
6
|
+
"5": "\u2075",
|
|
7
|
+
"6": "\u2076",
|
|
8
|
+
"7": "\u2077",
|
|
9
|
+
"8": "\u2078",
|
|
10
|
+
"9": "\u2079",
|
|
11
|
+
"0": "\u2070"
|
|
12
|
+
};
|
|
13
|
+
export function applyFootnotes(text) {
|
|
14
|
+
return text.replace(
|
|
15
|
+
/\{(\d)\}/g,
|
|
16
|
+
(_, d) => SUPERSCRIPTS[d] || `{${d}}`
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
export function resolveChartColor(colorId, colors, el) {
|
|
20
|
+
const ids = Object.keys(colors);
|
|
21
|
+
const entry = colors[colorId] || colors[ids[0] || ""];
|
|
22
|
+
if (!entry) {
|
|
23
|
+
return "#888888";
|
|
24
|
+
}
|
|
25
|
+
const value = entry.color;
|
|
26
|
+
if (!value.includes("var(")) {
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
const target = el || document.documentElement;
|
|
30
|
+
const prev = target.style.color;
|
|
31
|
+
target.style.color = value;
|
|
32
|
+
const resolved = getComputedStyle(target).color;
|
|
33
|
+
target.style.color = prev;
|
|
34
|
+
return resolved || value;
|
|
35
|
+
}
|
|
36
|
+
export function getFirstColorId(colors) {
|
|
37
|
+
return Object.keys(colors)[0] || "";
|
|
38
|
+
}
|
|
39
|
+
export function getColorIdAtIndex(index, colors) {
|
|
40
|
+
const ids = Object.keys(colors);
|
|
41
|
+
return ids[index % ids.length] || ids[0] || "";
|
|
42
|
+
}
|
|
43
|
+
export function getDefaultChartData(colors) {
|
|
44
|
+
return {
|
|
45
|
+
title: "",
|
|
46
|
+
type: "bar",
|
|
47
|
+
categories: ["Category 1", "Category 2", "Category 3"],
|
|
48
|
+
series: [
|
|
49
|
+
{
|
|
50
|
+
name: "Series 1",
|
|
51
|
+
color: getColorIdAtIndex(0, colors),
|
|
52
|
+
data: [30, 40, 35]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
categoryColors: [
|
|
56
|
+
getColorIdAtIndex(0, colors),
|
|
57
|
+
getColorIdAtIndex(1, colors),
|
|
58
|
+
getColorIdAtIndex(2, colors)
|
|
59
|
+
],
|
|
60
|
+
footnotes: [],
|
|
61
|
+
typeOptions: {}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function parseNumericInput(raw) {
|
|
65
|
+
let str = raw.trim();
|
|
66
|
+
if (!str) return 0;
|
|
67
|
+
str = str.replace(/'/g, "");
|
|
68
|
+
if (str.includes(",")) {
|
|
69
|
+
const isThousandsSep = /,\d{3}(?:,\d{3})*$/.test(str);
|
|
70
|
+
if (isThousandsSep) {
|
|
71
|
+
str = str.replace(/,/g, "");
|
|
72
|
+
} else {
|
|
73
|
+
str = str.replace(/\./g, "");
|
|
74
|
+
const lastComma = str.lastIndexOf(",");
|
|
75
|
+
str = str.slice(0, lastComma) + "." + str.slice(lastComma + 1);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const value = Number.parseFloat(str);
|
|
79
|
+
return Number.isFinite(value) ? value : 0;
|
|
80
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ChartTypeOptionsMap } from './chartTypes/index.js';
|
|
2
|
+
export type ChartType = 'bar' | 'line' | 'pie' | 'area' | 'donut' | 'heatmap' | 'radialBar' | 'radar';
|
|
3
|
+
export type ChartTypeOptions = ChartTypeOptionsMap[ChartType];
|
|
4
|
+
export type ChartSeries = {
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* The color identifier as defined in the module options.
|
|
8
|
+
*/
|
|
9
|
+
color: string;
|
|
10
|
+
data: number[];
|
|
11
|
+
};
|
|
12
|
+
type ChartDataBase = {
|
|
13
|
+
title: string;
|
|
14
|
+
categories: string[];
|
|
15
|
+
series: ChartSeries[];
|
|
16
|
+
/**
|
|
17
|
+
* Color identifiers per category, used for pie/donut charts where each
|
|
18
|
+
* slice has its own color.
|
|
19
|
+
*/
|
|
20
|
+
categoryColors: string[];
|
|
21
|
+
footnotes: string[];
|
|
22
|
+
};
|
|
23
|
+
export type BlokkliChartData = {
|
|
24
|
+
[K in ChartType]: ChartDataBase & {
|
|
25
|
+
type: K;
|
|
26
|
+
typeOptions?: Partial<ChartTypeOptionsMap[K]>;
|
|
27
|
+
};
|
|
28
|
+
}[ChartType];
|
|
29
|
+
export type ChartColor = {
|
|
30
|
+
color: string;
|
|
31
|
+
label: string;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
File without changes
|
|
@@ -7,6 +7,7 @@ mutation pbAddFragmentParagraph(
|
|
|
7
7
|
$hostUuid: String!
|
|
8
8
|
$hostFieldName: String!
|
|
9
9
|
$afterUuid: String
|
|
10
|
+
$options: String
|
|
10
11
|
) {
|
|
11
12
|
state: paragraphsEditMutationState(
|
|
12
13
|
entityType: $entityType
|
|
@@ -18,6 +19,7 @@ mutation pbAddFragmentParagraph(
|
|
|
18
19
|
hostType: $hostType
|
|
19
20
|
hostUuid: $hostUuid
|
|
20
21
|
hostFieldName: $hostFieldName
|
|
22
|
+
options: $options
|
|
21
23
|
) {
|
|
22
24
|
...paragraphsBlokkliMutationResult
|
|
23
25
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import { type BlokkliAdapterFactory } from '#blokkli/editor/adapter';
|
|
2
|
+
import type { ParagraphsBlokkliEditStateFragment } from '#graphql-operations';
|
|
3
|
+
declare const _default: BlokkliAdapterFactory<ParagraphsBlokkliEditStateFragment>;
|
|
2
4
|
export default _default;
|
|
@@ -704,14 +704,18 @@ export default defineBlokkliEditAdapter(
|
|
|
704
704
|
}).then(mapMutation);
|
|
705
705
|
}
|
|
706
706
|
if (hasMutation("pbAddFragmentParagraph")) {
|
|
707
|
-
adapter.fragmentsAddBlock = (e) =>
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
707
|
+
adapter.fragmentsAddBlock = (e) => {
|
|
708
|
+
const options = e.options ? JSON.stringify(e.options) : void 0;
|
|
709
|
+
return useGraphqlMutation("pbAddFragmentParagraph", {
|
|
710
|
+
...ctx.value,
|
|
711
|
+
hostType: e.host.type,
|
|
712
|
+
hostFieldName: e.host.fieldName,
|
|
713
|
+
hostUuid: e.host.uuid,
|
|
714
|
+
afterUuid: e.preceedingUuid,
|
|
715
|
+
name: e.name,
|
|
716
|
+
options
|
|
717
|
+
}).then(mapMutation);
|
|
718
|
+
};
|
|
715
719
|
}
|
|
716
720
|
if (hasMutation("pbReplaceMedia")) {
|
|
717
721
|
adapter.mediaLibraryReplaceMedia = (e) => useGraphqlMutation("pbReplaceMedia", {
|
|
@@ -848,19 +852,19 @@ export default defineBlokkliEditAdapter(
|
|
|
848
852
|
}
|
|
849
853
|
}
|
|
850
854
|
return false;
|
|
851
|
-
})?.possibleParagraphBundles
|
|
855
|
+
})?.possibleParagraphBundles;
|
|
852
856
|
} else if (e.type === "plaintext") {
|
|
853
857
|
return config.clipboard.find((v) => {
|
|
854
858
|
return v?.__typename === "ParagraphsBlokkliSupportedClipboardRichText";
|
|
855
|
-
})?.possibleParagraphBundles
|
|
859
|
+
})?.possibleParagraphBundles;
|
|
856
860
|
} else if (e.type === "image") {
|
|
857
861
|
return config.clipboard.find((v) => {
|
|
858
862
|
return v?.__typename === "ParagraphsBlokkliSupportedClipboardImage";
|
|
859
|
-
})?.possibleParagraphBundles
|
|
863
|
+
})?.possibleParagraphBundles;
|
|
860
864
|
} else if (e.type === "file") {
|
|
861
865
|
return config.clipboard.find((v) => {
|
|
862
866
|
return v?.__typename === "ParagraphsBlokkliSupportedClipboardFile";
|
|
863
|
-
})?.possibleParagraphBundles
|
|
867
|
+
})?.possibleParagraphBundles;
|
|
864
868
|
}
|
|
865
869
|
};
|
|
866
870
|
}
|