@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
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
import { computed, useBlokkli, defineBlokkliFeature } from "#imports";
|
|
17
17
|
import { PluginItemAction } from "#blokkli/editor/plugins";
|
|
18
18
|
import { onBlokkliEvent } from "#blokkli/editor/composables";
|
|
19
|
+
import { featureFragmentNames } from "#blokkli-build/editor-config";
|
|
20
|
+
import { fragmentBlockBundle } from "#blokkli-build/config";
|
|
19
21
|
defineBlokkliFeature({
|
|
20
22
|
id: "edit",
|
|
21
23
|
icon: "bk_mdi_edit",
|
|
@@ -27,11 +29,20 @@ const { eventBus, selection, state, $t, adapter, definitions, permissions } = us
|
|
|
27
29
|
const userCanEditLibraryItems = computed(
|
|
28
30
|
() => permissions.hasPermission("edit_library_item")
|
|
29
31
|
);
|
|
32
|
+
function isFragment(item) {
|
|
33
|
+
return item.bundle === fragmentBlockBundle;
|
|
34
|
+
}
|
|
35
|
+
function isFeatureFragment(item) {
|
|
36
|
+
return !!item.fragment?.name && featureFragmentNames.includes(item.fragment.name);
|
|
37
|
+
}
|
|
30
38
|
const canEdit = computed(() => {
|
|
31
39
|
const item = selection.item.value;
|
|
32
40
|
if (!item) {
|
|
33
41
|
return false;
|
|
34
42
|
}
|
|
43
|
+
if (isFragment(item)) {
|
|
44
|
+
return isFeatureFragment(item);
|
|
45
|
+
}
|
|
35
46
|
const definition = definitions.getBlockDefinition(
|
|
36
47
|
item.bundle,
|
|
37
48
|
item.fieldListType,
|
|
@@ -66,6 +77,15 @@ function onClick(items) {
|
|
|
66
77
|
});
|
|
67
78
|
return;
|
|
68
79
|
}
|
|
80
|
+
if (isFragment(item)) {
|
|
81
|
+
if (isFeatureFragment(item)) {
|
|
82
|
+
eventBus.emit("fragment:edit", {
|
|
83
|
+
uuid: item.uuid,
|
|
84
|
+
name: item.fragment.name
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
69
89
|
eventBus.emit("item:edit", {
|
|
70
90
|
uuid: item.uuid,
|
|
71
91
|
bundle: item.bundle
|
|
@@ -5,15 +5,18 @@
|
|
|
5
5
|
v-model="modelValue"
|
|
6
6
|
class="bk bk-editable-field-textarea"
|
|
7
7
|
enterkeyhint="done"
|
|
8
|
+
submit-on-enter
|
|
8
9
|
rows="2"
|
|
9
10
|
v-bind="inputAttributes"
|
|
11
|
+
autofocus
|
|
10
12
|
@keydown="onKeyDown"
|
|
11
13
|
@blur="onBlur"
|
|
14
|
+
@submit="save"
|
|
12
15
|
/>
|
|
13
16
|
</template>
|
|
14
17
|
|
|
15
18
|
<script setup>
|
|
16
|
-
import { useBlokkli, computed
|
|
19
|
+
import { useBlokkli, computed } from "#imports";
|
|
17
20
|
import { FlexTextarea } from "#blokkli/editor/components";
|
|
18
21
|
const { ui, selection } = useBlokkli();
|
|
19
22
|
const props = defineProps({
|
|
@@ -23,7 +26,6 @@ const props = defineProps({
|
|
|
23
26
|
});
|
|
24
27
|
const modelValue = defineModel({ type: String, ...{ required: true } });
|
|
25
28
|
const emit = defineEmits(["discard", "save"]);
|
|
26
|
-
const textarea = useTemplateRef("textarea");
|
|
27
29
|
function discard() {
|
|
28
30
|
emit("discard");
|
|
29
31
|
}
|
|
@@ -38,8 +40,6 @@ const onKeyDown = (e) => {
|
|
|
38
40
|
if (e.code === "Escape") {
|
|
39
41
|
e.preventDefault();
|
|
40
42
|
discard();
|
|
41
|
-
} else if (e.code === "Enter") {
|
|
42
|
-
e.preventDefault();
|
|
43
43
|
save();
|
|
44
44
|
}
|
|
45
45
|
};
|
|
@@ -45,6 +45,12 @@
|
|
|
45
45
|
<div v-if="errorText" class="bk-editable-field-info-error">
|
|
46
46
|
{{ errorText }}
|
|
47
47
|
</div>
|
|
48
|
+
<div
|
|
49
|
+
v-else-if="config.type === 'plain'"
|
|
50
|
+
class="bk-editable-field-info-hint"
|
|
51
|
+
>
|
|
52
|
+
{{ $t("textareaNewLineHint", "Shift + Enter for new line") }}
|
|
53
|
+
</div>
|
|
48
54
|
<div v-if="!isMarkup" class="bk-editable-field-info-count">
|
|
49
55
|
<span>{{ count }}</span>
|
|
50
56
|
<span v-if="maxlength >= 1"> / {{ maxlength }}</span>
|
|
@@ -15,7 +15,17 @@ import { RectangleBufferCollector } from "#blokkli/editor/helpers/webgl";
|
|
|
15
15
|
import { isInsideRect } from "#blokkli/editor/helpers/geometry";
|
|
16
16
|
import { toShaderColor } from "#blokkli/editor/helpers/color";
|
|
17
17
|
import { defineRenderer, onBlokkliEvent } from "#blokkli/editor/composables";
|
|
18
|
-
const {
|
|
18
|
+
const {
|
|
19
|
+
animation,
|
|
20
|
+
theme,
|
|
21
|
+
dom,
|
|
22
|
+
selection,
|
|
23
|
+
state,
|
|
24
|
+
ui,
|
|
25
|
+
directive,
|
|
26
|
+
blocks,
|
|
27
|
+
fields
|
|
28
|
+
} = useBlokkli();
|
|
19
29
|
const MAX_RECTS = 11;
|
|
20
30
|
function getDeepestUuid(uuids) {
|
|
21
31
|
if (uuids.length === 0) {
|
|
@@ -29,6 +39,10 @@ function getDeepestUuid(uuids) {
|
|
|
29
39
|
if (level > maxLevel) {
|
|
30
40
|
maxLevel = level;
|
|
31
41
|
deepestUuid = uuid;
|
|
42
|
+
} else if (level === maxLevel) {
|
|
43
|
+
if (fields.compareFieldPriority(uuid, deepestUuid) > 0) {
|
|
44
|
+
deepestUuid = uuid;
|
|
45
|
+
}
|
|
32
46
|
}
|
|
33
47
|
}
|
|
34
48
|
return deepestUuid;
|
|
@@ -119,12 +133,22 @@ function updateHoverState(mouseX, mouseY, offset, scale, artboardSize) {
|
|
|
119
133
|
) || deepestUuid !== previousDeepestUuid;
|
|
120
134
|
let hoveredEditableFieldRect = null;
|
|
121
135
|
const editableRects = directive.getVisible("editable");
|
|
136
|
+
let fallbackEditableRect = null;
|
|
122
137
|
for (let i = 0; i < editableRects.length; i++) {
|
|
123
138
|
const editableRect = editableRects[i];
|
|
124
|
-
if (isInsideRect(artboardMouseX, artboardMouseY, editableRect))
|
|
139
|
+
if (!isInsideRect(artboardMouseX, artboardMouseY, editableRect)) continue;
|
|
140
|
+
const key = editableRect.key;
|
|
141
|
+
const entityUuid = key.split(":")[2];
|
|
142
|
+
if (deepestUuid && entityUuid === deepestUuid) {
|
|
125
143
|
hoveredEditableFieldRect = editableRect;
|
|
126
144
|
break;
|
|
127
145
|
}
|
|
146
|
+
if (!fallbackEditableRect && !hoveredUuids.includes(entityUuid)) {
|
|
147
|
+
fallbackEditableRect = editableRect;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (!hoveredEditableFieldRect) {
|
|
151
|
+
hoveredEditableFieldRect = fallbackEditableRect;
|
|
128
152
|
}
|
|
129
153
|
if (!hoveredChanged) {
|
|
130
154
|
const editableFieldChanged = hoveredEditableFieldRect === null !== (previousEditableFieldRect === null) || hoveredEditableFieldRect && previousEditableFieldRect && (hoveredEditableFieldRect.x !== previousEditableFieldRect.x || hoveredEditableFieldRect.y !== previousEditableFieldRect.y || hoveredEditableFieldRect.width !== previousEditableFieldRect.width || hoveredEditableFieldRect.height !== previousEditableFieldRect.height);
|
|
@@ -138,7 +162,10 @@ function updateHoverState(mouseX, mouseY, offset, scale, artboardSize) {
|
|
|
138
162
|
for (let i = 0; i < unselectedHoveredUuids.length; i++) {
|
|
139
163
|
const uuid = unselectedHoveredUuids[i];
|
|
140
164
|
const level = Math.min(state.getNestingLevel(uuid), 9);
|
|
141
|
-
|
|
165
|
+
const existing = nestingMap.get(level);
|
|
166
|
+
if (!existing) {
|
|
167
|
+
nestingMap.set(level, uuid);
|
|
168
|
+
} else if (fields.compareFieldPriority(uuid, existing) > 0) {
|
|
142
169
|
nestingMap.set(level, uuid);
|
|
143
170
|
}
|
|
144
171
|
}
|
|
@@ -17,7 +17,7 @@ defineBlokkliFeature({
|
|
|
17
17
|
const { selection, ui, dom, animation, $t } = useBlokkli();
|
|
18
18
|
const isLocked = ref(false);
|
|
19
19
|
const isVisible = computed(
|
|
20
|
-
() => !isLocked.value && dom.isReady.value && !selection.isMultiSelecting.value && !selection.activeEditableLabel.value && !selection.isDragging.value && !ui.hasTransformOverlayOpen.value && !ui.hasDialogOpen.value && !ui.isAnimating.value
|
|
20
|
+
() => !isLocked.value && dom.isReady.value && !selection.isMultiSelecting.value && !selection.activeEditableLabel.value && !selection.isDragging.value && !ui.hasTransformOverlayOpen.value && !ui.hasDialogOpen.value && !ui.hasNestedEditorOpen.value && !ui.isAnimating.value
|
|
21
21
|
);
|
|
22
22
|
</script>
|
|
23
23
|
|
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
} from "#blokkli/editor/components";
|
|
65
65
|
import {
|
|
66
66
|
defineAddAction,
|
|
67
|
+
defineDropHandler,
|
|
67
68
|
onBlokkliEvent,
|
|
68
69
|
useDialog
|
|
69
70
|
} from "#blokkli/editor/composables";
|
|
@@ -183,6 +184,19 @@ function onSubmitLibraryItem() {
|
|
|
183
184
|
eventBus.emit("reloadState");
|
|
184
185
|
cancelLibraryItemEdit();
|
|
185
186
|
}
|
|
187
|
+
defineDropHandler("reusable", {
|
|
188
|
+
async execute({ items, host, afterUuid }) {
|
|
189
|
+
if (adapter.addLibraryItem) {
|
|
190
|
+
await state.mutateWithLoadingState(
|
|
191
|
+
() => adapter.addLibraryItem({
|
|
192
|
+
libraryItemUuid: items[0].libraryItemUuid,
|
|
193
|
+
host,
|
|
194
|
+
afterUuid
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
});
|
|
186
200
|
defineAddAction(() => {
|
|
187
201
|
if (!adapter.addLibraryItem || !adapter.getLibraryItems || !isSupportedOnEntity.value) {
|
|
188
202
|
return;
|
|
@@ -22,7 +22,7 @@ import { PluginSidebar } from "#blokkli/editor/plugins";
|
|
|
22
22
|
import Library from "./Library/index.vue";
|
|
23
23
|
import { falsy } from "#blokkli/helpers";
|
|
24
24
|
import { itemEntityType } from "#blokkli-build/config";
|
|
25
|
-
import { defineDropAreas } from "#blokkli/editor/composables";
|
|
25
|
+
import { defineDropAreas, defineDropHandler } from "#blokkli/editor/composables";
|
|
26
26
|
defineBlokkliFeature({
|
|
27
27
|
id: "media-library",
|
|
28
28
|
icon: "bk_mdi_image",
|
|
@@ -99,6 +99,37 @@ defineDropAreas((dragItems) => {
|
|
|
99
99
|
}
|
|
100
100
|
}).filter(falsy);
|
|
101
101
|
});
|
|
102
|
+
defineDropHandler("media_library", {
|
|
103
|
+
resolveBundles({ items, field }) {
|
|
104
|
+
const allSameBundles = [...new Set(items.map((v) => v.mediaBundle)).values()].length === 1;
|
|
105
|
+
if (!allSameBundles) {
|
|
106
|
+
return [];
|
|
107
|
+
}
|
|
108
|
+
const item = items[0];
|
|
109
|
+
return field.allowedBundles.filter((b) => item.itemBundles.includes(b));
|
|
110
|
+
},
|
|
111
|
+
async execute({ items, host, afterUuid, bundle }) {
|
|
112
|
+
if (adapter.mediaLibraryAddBlock && items.length === 1) {
|
|
113
|
+
await state.mutateWithLoadingState(
|
|
114
|
+
() => adapter.mediaLibraryAddBlock({
|
|
115
|
+
preceedingUuid: afterUuid,
|
|
116
|
+
host,
|
|
117
|
+
item: items[0],
|
|
118
|
+
targetBundle: bundle
|
|
119
|
+
})
|
|
120
|
+
);
|
|
121
|
+
} else if (adapter.mediaLibraryAddBlocks && items.length > 1) {
|
|
122
|
+
await state.mutateWithLoadingState(
|
|
123
|
+
() => adapter.mediaLibraryAddBlocks({
|
|
124
|
+
preceedingUuid: afterUuid,
|
|
125
|
+
host,
|
|
126
|
+
items,
|
|
127
|
+
targetBundle: bundle
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
102
133
|
</script>
|
|
103
134
|
|
|
104
135
|
<script>
|
|
@@ -3,14 +3,14 @@ export default _default;
|
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
4
|
label: string;
|
|
5
5
|
property: string;
|
|
6
|
-
modelValue?:
|
|
6
|
+
modelValue?: boolean;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
"update:modelValue": (...args: any[]) => void;
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<{
|
|
11
11
|
label: string;
|
|
12
12
|
property: string;
|
|
13
|
-
modelValue?:
|
|
13
|
+
modelValue?: boolean;
|
|
14
14
|
required?: boolean;
|
|
15
15
|
}> & Readonly<{
|
|
16
16
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -13,16 +13,16 @@ const { $t, state } = useBlokkli();
|
|
|
13
13
|
const props = defineProps({
|
|
14
14
|
label: { type: String, required: true },
|
|
15
15
|
property: { type: String, required: true },
|
|
16
|
-
modelValue: { type:
|
|
16
|
+
modelValue: { type: Boolean, required: false },
|
|
17
17
|
required: { type: Boolean, required: false }
|
|
18
18
|
});
|
|
19
19
|
const emit = defineEmits(["update:modelValue"]);
|
|
20
20
|
const checked = computed({
|
|
21
21
|
get() {
|
|
22
|
-
return props.modelValue
|
|
22
|
+
return props.modelValue ?? false;
|
|
23
23
|
},
|
|
24
24
|
set(v) {
|
|
25
|
-
emit("update:modelValue", v
|
|
25
|
+
emit("update:modelValue", v);
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
defineCommands(() => {
|
|
@@ -3,14 +3,14 @@ export default _default;
|
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
4
|
label: string;
|
|
5
5
|
property: string;
|
|
6
|
-
modelValue?:
|
|
6
|
+
modelValue?: boolean;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
9
|
"update:modelValue": (...args: any[]) => void;
|
|
10
10
|
}, string, import("vue").PublicProps, Readonly<{
|
|
11
11
|
label: string;
|
|
12
12
|
property: string;
|
|
13
|
-
modelValue?:
|
|
13
|
+
modelValue?: boolean;
|
|
14
14
|
required?: boolean;
|
|
15
15
|
}> & Readonly<{
|
|
16
16
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
@@ -3,7 +3,7 @@ export default _default;
|
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
4
|
label: string;
|
|
5
5
|
property: string;
|
|
6
|
-
modelValue?: string;
|
|
6
|
+
modelValue?: string[];
|
|
7
7
|
options: {
|
|
8
8
|
value: string;
|
|
9
9
|
label: string;
|
|
@@ -14,7 +14,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<{
|
|
15
15
|
label: string;
|
|
16
16
|
property: string;
|
|
17
|
-
modelValue?: string;
|
|
17
|
+
modelValue?: string[];
|
|
18
18
|
options: {
|
|
19
19
|
value: string;
|
|
20
20
|
label: string;
|
|
@@ -43,7 +43,7 @@ const { $t, state } = useBlokkli();
|
|
|
43
43
|
const props = defineProps({
|
|
44
44
|
label: { type: String, required: true },
|
|
45
45
|
property: { type: String, required: true },
|
|
46
|
-
modelValue: { type:
|
|
46
|
+
modelValue: { type: Array, required: false },
|
|
47
47
|
options: { type: Array, required: true },
|
|
48
48
|
isGrouped: { type: Boolean, required: false }
|
|
49
49
|
});
|
|
@@ -52,13 +52,13 @@ const isOpen = ref(false);
|
|
|
52
52
|
const optionOrder = computed(() => props.options.map((v) => v.value));
|
|
53
53
|
const checked = computed({
|
|
54
54
|
get() {
|
|
55
|
-
return
|
|
55
|
+
return props.modelValue || [];
|
|
56
56
|
},
|
|
57
57
|
set(newValue) {
|
|
58
|
-
const
|
|
58
|
+
const sorted = newValue.filter(Boolean).sort((a, b) => {
|
|
59
59
|
return optionOrder.value.indexOf(a) - optionOrder.value.indexOf(b);
|
|
60
|
-
})
|
|
61
|
-
emit("update:modelValue",
|
|
60
|
+
});
|
|
61
|
+
emit("update:modelValue", sorted);
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
const visibleLabel = computed(() => {
|
|
@@ -3,7 +3,7 @@ export default _default;
|
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
4
|
label: string;
|
|
5
5
|
property: string;
|
|
6
|
-
modelValue?: string;
|
|
6
|
+
modelValue?: string[];
|
|
7
7
|
options: {
|
|
8
8
|
value: string;
|
|
9
9
|
label: string;
|
|
@@ -14,7 +14,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
14
14
|
}, string, import("vue").PublicProps, Readonly<{
|
|
15
15
|
label: string;
|
|
16
16
|
property: string;
|
|
17
|
-
modelValue?: string;
|
|
17
|
+
modelValue?: string[];
|
|
18
18
|
options: {
|
|
19
19
|
value: string;
|
|
20
20
|
label: string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
|
+
uuid: string;
|
|
5
|
+
property: string;
|
|
6
|
+
dataType: string;
|
|
7
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
8
|
+
uuid: string;
|
|
9
|
+
property: string;
|
|
10
|
+
dataType: string;
|
|
11
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
v-if="config"
|
|
4
|
+
class="bk-blokkli-item-options-complex-type"
|
|
5
|
+
@click="onClick"
|
|
6
|
+
>
|
|
7
|
+
<Icon :name="config.editorIcon" />
|
|
8
|
+
<span>{{ $t(config.editorButtonLabel, config.editorButtonLabel) }}</span>
|
|
9
|
+
</button>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { useBlokkli } from "#imports";
|
|
14
|
+
import { Icon } from "#blokkli/editor/components";
|
|
15
|
+
import { COMPLEX_OPTION_TYPES } from "#blokkli-build/complex-option-types";
|
|
16
|
+
const { eventBus, $t } = useBlokkli();
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
uuid: { type: String, required: true },
|
|
19
|
+
property: { type: String, required: true },
|
|
20
|
+
dataType: { type: String, required: true }
|
|
21
|
+
});
|
|
22
|
+
const config = COMPLEX_OPTION_TYPES[props.dataType];
|
|
23
|
+
function onClick() {
|
|
24
|
+
eventBus.emit("option:edit-complex", {
|
|
25
|
+
uuid: props.uuid,
|
|
26
|
+
key: props.property,
|
|
27
|
+
dataType: props.dataType
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<script>
|
|
33
|
+
export default {
|
|
34
|
+
name: "OptionsFormComplexType"
|
|
35
|
+
};
|
|
36
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
|
+
uuid: string;
|
|
5
|
+
property: string;
|
|
6
|
+
dataType: string;
|
|
7
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
8
|
+
uuid: string;
|
|
9
|
+
property: string;
|
|
10
|
+
dataType: string;
|
|
11
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockOptionDefinitionBase } from './../../../../../global/types/blockOptions.js';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
option:
|
|
3
|
+
option: BlockOptionDefinitionBase;
|
|
4
4
|
property: string;
|
|
5
5
|
mutatedValue: any;
|
|
6
6
|
isGrouped?: boolean;
|
|
7
|
+
uuid?: string;
|
|
7
8
|
};
|
|
8
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
-
update: (data:
|
|
10
|
+
update: (data: unknown) => any;
|
|
10
11
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
-
onUpdate?: ((data:
|
|
12
|
+
onUpdate?: ((data: unknown) => any) | undefined;
|
|
12
13
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
14
|
declare const _default: typeof __VLS_export;
|
|
14
15
|
export default _default;
|
|
@@ -74,6 +74,12 @@
|
|
|
74
74
|
:min="option.min"
|
|
75
75
|
:max="option.max"
|
|
76
76
|
/>
|
|
77
|
+
<OptionComplexType
|
|
78
|
+
v-else-if="option.type === 'json' && option.dataType && uuid"
|
|
79
|
+
:uuid="uuid"
|
|
80
|
+
:property="property"
|
|
81
|
+
:data-type="option.dataType"
|
|
82
|
+
/>
|
|
77
83
|
</div>
|
|
78
84
|
</div>
|
|
79
85
|
</template>
|
|
@@ -88,18 +94,16 @@ import OptionColor from "./Color/index.vue";
|
|
|
88
94
|
import OptionRange from "./Range/index.vue";
|
|
89
95
|
import OptionNumber from "./Number/index.vue";
|
|
90
96
|
import OptionDateTimeLocal from "./DateTimeLocal/index.vue";
|
|
91
|
-
import
|
|
92
|
-
isValidDatetimeLocalValue,
|
|
93
|
-
mapCheckboxTrue
|
|
94
|
-
} from "#blokkli/helpers/runtimeHelpers";
|
|
97
|
+
import OptionComplexType from "./ComplexType/index.vue";
|
|
95
98
|
import { BK_VISIBLE_LANGUAGES } from "./../../../../../global/constants";
|
|
96
99
|
const { state, $t: $blokkliText } = useBlokkli();
|
|
97
100
|
const emit = defineEmits(["update"]);
|
|
98
101
|
const props = defineProps({
|
|
99
|
-
option: { type:
|
|
102
|
+
option: { type: null, required: true },
|
|
100
103
|
property: { type: String, required: true },
|
|
101
104
|
mutatedValue: { type: null, required: true },
|
|
102
|
-
isGrouped: { type: Boolean, required: false }
|
|
105
|
+
isGrouped: { type: Boolean, required: false },
|
|
106
|
+
uuid: { type: String, required: false }
|
|
103
107
|
});
|
|
104
108
|
const hoveredOption = ref("");
|
|
105
109
|
const showLabel = computed(() => {
|
|
@@ -113,12 +117,17 @@ const showLabel = computed(() => {
|
|
|
113
117
|
const label = computed(
|
|
114
118
|
() => $blokkliText(`blockOption_${props.property}_label`, props.option.label)
|
|
115
119
|
);
|
|
116
|
-
const description = computed(
|
|
117
|
-
()
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
);
|
|
120
|
+
const description = computed(() => {
|
|
121
|
+
if (!props.option.description) {
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
124
|
+
const key = `blockOption_${props.property}_description`;
|
|
125
|
+
const translation = $blokkliText(key, props.option.description);
|
|
126
|
+
if (key === translation) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
return translation;
|
|
130
|
+
});
|
|
122
131
|
const checkboxOptions = computed(() => {
|
|
123
132
|
if (props.option.type !== "checkboxes") {
|
|
124
133
|
return [];
|
|
@@ -140,47 +149,12 @@ const checkboxOptions = computed(() => {
|
|
|
140
149
|
};
|
|
141
150
|
});
|
|
142
151
|
});
|
|
143
|
-
const validCheckboxValues = computed(
|
|
144
|
-
() => checkboxOptions.value.map((v) => v.value)
|
|
145
|
-
);
|
|
146
|
-
const validateValue = (v) => {
|
|
147
|
-
if (props.option.type === "text") {
|
|
148
|
-
if (typeof v === "string") {
|
|
149
|
-
return v;
|
|
150
|
-
}
|
|
151
|
-
} else if (props.option.type === "datetime-local") {
|
|
152
|
-
if (typeof v === "string" && isValidDatetimeLocalValue(v)) {
|
|
153
|
-
return v;
|
|
154
|
-
}
|
|
155
|
-
} else if (props.option.type === "color") {
|
|
156
|
-
if (typeof v === "string" && v.startsWith("#") && v.length === 7) {
|
|
157
|
-
return v;
|
|
158
|
-
}
|
|
159
|
-
} else if (props.option.type === "radios" && typeof v === "string") {
|
|
160
|
-
if (props.option.options[v]) {
|
|
161
|
-
return v;
|
|
162
|
-
}
|
|
163
|
-
} else if (props.option.type === "checkbox") {
|
|
164
|
-
return mapCheckboxTrue(v);
|
|
165
|
-
} else if (props.option.type === "checkboxes") {
|
|
166
|
-
const items = Array.isArray(v) ? v : (typeof v === "string" ? v : "").split(",");
|
|
167
|
-
return items.filter((key) => {
|
|
168
|
-
return validCheckboxValues.value.includes(key);
|
|
169
|
-
}).join(",");
|
|
170
|
-
} else if (props.option.type === "range" || props.option.type === "number") {
|
|
171
|
-
if (typeof v === "number") {
|
|
172
|
-
return v.toString();
|
|
173
|
-
} else if (typeof v === "string") {
|
|
174
|
-
return v;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
152
|
const value = computed({
|
|
179
153
|
get() {
|
|
180
|
-
return
|
|
154
|
+
return props.mutatedValue;
|
|
181
155
|
},
|
|
182
|
-
set(
|
|
183
|
-
emit("update",
|
|
156
|
+
set(v) {
|
|
157
|
+
emit("update", v);
|
|
184
158
|
}
|
|
185
159
|
});
|
|
186
160
|
</script>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockOptionDefinitionBase } from './../../../../../global/types/blockOptions.js';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
option:
|
|
3
|
+
option: BlockOptionDefinitionBase;
|
|
4
4
|
property: string;
|
|
5
5
|
mutatedValue: any;
|
|
6
6
|
isGrouped?: boolean;
|
|
7
|
+
uuid?: string;
|
|
7
8
|
};
|
|
8
9
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
9
|
-
update: (data:
|
|
10
|
+
update: (data: unknown) => any;
|
|
10
11
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
-
onUpdate?: ((data:
|
|
12
|
+
onUpdate?: ((data: unknown) => any) | undefined;
|
|
12
13
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
14
|
declare const _default: typeof __VLS_export;
|
|
14
15
|
export default _default;
|
|
@@ -2,7 +2,7 @@ declare const _default: typeof __VLS_export;
|
|
|
2
2
|
export default _default;
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
4
|
label: string;
|
|
5
|
-
modelValue?:
|
|
5
|
+
modelValue?: number;
|
|
6
6
|
min: number;
|
|
7
7
|
max: number;
|
|
8
8
|
type?: string;
|
|
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
10
10
|
"update:modelValue": (...args: any[]) => void;
|
|
11
11
|
}, string, import("vue").PublicProps, Readonly<{
|
|
12
12
|
label: string;
|
|
13
|
-
modelValue?:
|
|
13
|
+
modelValue?: number;
|
|
14
14
|
min: number;
|
|
15
15
|
max: number;
|
|
16
16
|
type?: string;
|
|
@@ -18,5 +18,5 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
18
18
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
type: string;
|
|
21
|
-
modelValue:
|
|
21
|
+
modelValue: number;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|