@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
|
@@ -11,6 +11,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
11
11
|
* The title displayed in the sidebar header.
|
|
12
12
|
*/
|
|
13
13
|
title: string;
|
|
14
|
+
/**
|
|
15
|
+
* The title for the tooltip. Falls back to the title.
|
|
16
|
+
*/
|
|
17
|
+
tooltipTitle?: string;
|
|
14
18
|
/**
|
|
15
19
|
* Optional text for the interactive tour.
|
|
16
20
|
*
|
|
@@ -92,8 +96,9 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
92
96
|
isLoading?: boolean;
|
|
93
97
|
}, {
|
|
94
98
|
showSidebar: () => void;
|
|
95
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
96
|
-
updated: () =>
|
|
99
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
100
|
+
updated: () => void;
|
|
101
|
+
toggle: () => void;
|
|
97
102
|
}, string, import("vue").PublicProps, Readonly<{
|
|
98
103
|
/**
|
|
99
104
|
* Unique identifier for this sidebar.
|
|
@@ -103,6 +108,10 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
103
108
|
* The title displayed in the sidebar header.
|
|
104
109
|
*/
|
|
105
110
|
title: string;
|
|
111
|
+
/**
|
|
112
|
+
* The title for the tooltip. Falls back to the title.
|
|
113
|
+
*/
|
|
114
|
+
tooltipTitle?: string;
|
|
106
115
|
/**
|
|
107
116
|
* Optional text for the interactive tour.
|
|
108
117
|
*
|
|
@@ -184,16 +193,18 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
184
193
|
isLoading?: boolean;
|
|
185
194
|
}> & Readonly<{
|
|
186
195
|
onUpdated?: (() => any) | undefined;
|
|
196
|
+
onToggle?: (() => any) | undefined;
|
|
187
197
|
}>, {
|
|
188
198
|
keyCode: string;
|
|
189
199
|
size: {
|
|
190
200
|
width: number;
|
|
191
201
|
height: number;
|
|
192
202
|
};
|
|
193
|
-
|
|
203
|
+
tourText: string;
|
|
194
204
|
minWidth: number;
|
|
205
|
+
minHeight: number;
|
|
195
206
|
region: SidebarRegion;
|
|
196
|
-
|
|
207
|
+
tooltipTitle: string;
|
|
197
208
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
198
209
|
icon?: (props: {}) => any;
|
|
199
210
|
} & {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Ref, type ComputedRef } from '#imports';
|
|
2
|
+
import type { AdaptersProvider } from './adapters.js';
|
|
3
|
+
import type { StateProvider } from './state.js';
|
|
4
|
+
import type { UiProvider } from './ui.js';
|
|
5
|
+
import type { AdapterContext } from '#blokkli/editor/adapter';
|
|
6
|
+
import type { TextProvider } from './texts.js';
|
|
7
|
+
import type { AnalyzeNode, AnalyzeResult, Analyzer, AnalyzerType } from '../features/analyze/analyzers/types.js';
|
|
8
|
+
import { AnalyzerContext } from '../features/analyze/analyzers/helpers/Context.js';
|
|
9
|
+
export type AnalyzeProvider = {
|
|
10
|
+
/**
|
|
11
|
+
* All available analyzers, fetched once from adapters.
|
|
12
|
+
* Empty array until initialized.
|
|
13
|
+
*/
|
|
14
|
+
analyzers: Readonly<Ref<Analyzer[]>>;
|
|
15
|
+
/**
|
|
16
|
+
* Whether analyzers have been fetched and initialized.
|
|
17
|
+
*/
|
|
18
|
+
isInitialized: Readonly<Ref<boolean>>;
|
|
19
|
+
/**
|
|
20
|
+
* Fetch analyzers and call init() on each one. Idempotent.
|
|
21
|
+
*/
|
|
22
|
+
ensureInitialized: () => Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Create an AnalyzerContext scoped to the given element.
|
|
25
|
+
*/
|
|
26
|
+
createContext: (element: HTMLElement, signal?: AbortSignal) => AnalyzerContext;
|
|
27
|
+
/**
|
|
28
|
+
* Run a single analyzer and return its results as a flat array.
|
|
29
|
+
*/
|
|
30
|
+
runAnalyzer: (analyzer: Analyzer, context: AnalyzerContext) => Promise<AnalyzeResult[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Run analyzeText on all analyzers that support it.
|
|
33
|
+
* Optionally filter by analyzer type.
|
|
34
|
+
* Returns nodes per analyzer per text.
|
|
35
|
+
*/
|
|
36
|
+
runOnTexts: (texts: string[], analyzerType?: AnalyzerType) => Promise<Array<{
|
|
37
|
+
analyzerId: string;
|
|
38
|
+
analyzerLabel?: string;
|
|
39
|
+
text: string;
|
|
40
|
+
nodes: AnalyzeNode[];
|
|
41
|
+
}>>;
|
|
42
|
+
};
|
|
43
|
+
export default function analyzeProvider(adapters: AdaptersProvider, state: StateProvider, ui: UiProvider, context: ComputedRef<AdapterContext>, $t: TextProvider): AnalyzeProvider;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { ref } from "#imports";
|
|
2
|
+
import { AnalyzerContext } from "../features/analyze/analyzers/helpers/Context.js";
|
|
3
|
+
import { normalizeToArray } from "../features/analyze/analyzers/helpers/normalizeArray.js";
|
|
4
|
+
export default function analyzeProvider(adapters, state, ui, context, $t) {
|
|
5
|
+
const analyzers = ref([]);
|
|
6
|
+
const isInitialized = ref(false);
|
|
7
|
+
let initPromise = null;
|
|
8
|
+
async function doInit() {
|
|
9
|
+
const fetched = await adapters.getAggregated("getAnalyzers");
|
|
10
|
+
const initCtx = new AnalyzerContext(
|
|
11
|
+
context.value.language,
|
|
12
|
+
ui.interfaceLanguage.value,
|
|
13
|
+
ui.providerElement,
|
|
14
|
+
state,
|
|
15
|
+
$t
|
|
16
|
+
);
|
|
17
|
+
await Promise.all(
|
|
18
|
+
fetched.map(async (analyzer) => {
|
|
19
|
+
if (analyzer.init) {
|
|
20
|
+
await analyzer.init(initCtx);
|
|
21
|
+
}
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
analyzers.value = fetched;
|
|
25
|
+
isInitialized.value = true;
|
|
26
|
+
}
|
|
27
|
+
function ensureInitialized() {
|
|
28
|
+
if (isInitialized.value) {
|
|
29
|
+
return Promise.resolve();
|
|
30
|
+
}
|
|
31
|
+
if (!initPromise) {
|
|
32
|
+
initPromise = doInit();
|
|
33
|
+
}
|
|
34
|
+
return initPromise;
|
|
35
|
+
}
|
|
36
|
+
function createContext(element, signal) {
|
|
37
|
+
return new AnalyzerContext(
|
|
38
|
+
context.value.language,
|
|
39
|
+
ui.interfaceLanguage.value,
|
|
40
|
+
element,
|
|
41
|
+
state,
|
|
42
|
+
$t,
|
|
43
|
+
signal
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
async function runAnalyzer(analyzer, ctx) {
|
|
47
|
+
return normalizeToArray(analyzer.run(ctx));
|
|
48
|
+
}
|
|
49
|
+
async function runOnTexts(texts, analyzerType) {
|
|
50
|
+
await ensureInitialized();
|
|
51
|
+
let textAnalyzers = analyzers.value.filter((a) => a.analyzeText);
|
|
52
|
+
if (analyzerType) {
|
|
53
|
+
textAnalyzers = textAnalyzers.filter((a) => a.type === analyzerType);
|
|
54
|
+
}
|
|
55
|
+
const results = [];
|
|
56
|
+
for (const text of texts) {
|
|
57
|
+
for (const analyzer of textAnalyzers) {
|
|
58
|
+
const nodes = await analyzer.analyzeText(text, context.value.language);
|
|
59
|
+
const label = typeof analyzer.label === "function" ? analyzer.label(context.value.language) : analyzer.label;
|
|
60
|
+
results.push({
|
|
61
|
+
analyzerId: analyzer.id,
|
|
62
|
+
analyzerLabel: label,
|
|
63
|
+
text,
|
|
64
|
+
nodes
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return results;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
analyzers,
|
|
72
|
+
isInitialized,
|
|
73
|
+
ensureInitialized,
|
|
74
|
+
createContext,
|
|
75
|
+
runAnalyzer,
|
|
76
|
+
runOnTexts
|
|
77
|
+
};
|
|
78
|
+
}
|
|
@@ -182,6 +182,10 @@ export type AnimationProvider = {
|
|
|
182
182
|
* Defaults to 'move' when pressing Space, otherwise determined by highest zIndex renderer.
|
|
183
183
|
*/
|
|
184
184
|
cursor: ComputedRef<CursorKeyword>;
|
|
185
|
+
/**
|
|
186
|
+
* Get the current mouse coordinates.
|
|
187
|
+
*/
|
|
188
|
+
getMouseCoords: () => Coord;
|
|
185
189
|
/**
|
|
186
190
|
* Handle a click event by calling onClick handlers on renderers.
|
|
187
191
|
* Returns true if any renderer claimed the click, false otherwise.
|
|
@@ -437,6 +437,11 @@ export default function(eventBus, ui, storage, selection, debug, keyboard) {
|
|
|
437
437
|
onBlokkliEvent("select:toggle", requestDraw);
|
|
438
438
|
onBlokkliEvent("option:update", requestDraw);
|
|
439
439
|
onBlokkliEvent("state:reloaded", requestDraw);
|
|
440
|
+
onBlokkliEvent("dragging:move", (e) => {
|
|
441
|
+
mouseX = e.x;
|
|
442
|
+
mouseY = e.y;
|
|
443
|
+
requestDraw();
|
|
444
|
+
});
|
|
440
445
|
const dpi = computed(() => {
|
|
441
446
|
const viewportWidth = ui.viewport.value.width;
|
|
442
447
|
const viewportHeight = ui.viewport.value.height;
|
|
@@ -513,6 +518,7 @@ export default function(eventBus, ui, storage, selection, debug, keyboard) {
|
|
|
513
518
|
setCanvasElement,
|
|
514
519
|
removeCanvasElement,
|
|
515
520
|
cursor,
|
|
521
|
+
getMouseCoords: () => ({ x: mouseX, y: mouseY }),
|
|
516
522
|
handleClick,
|
|
517
523
|
registerRenderer,
|
|
518
524
|
unregisterRenderer,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Ref, type ComputedRef } from '#imports';
|
|
2
2
|
import type { BlockDefinition, FragmentDefinition, ProviderDefinition } from '#blokkli-build/definitions';
|
|
3
|
-
import type { ValidFieldListTypes, BlockBundleWithNested } from '#blokkli-build/generated-types';
|
|
3
|
+
import type { ValidFieldListTypes, BlockBundleWithNested, ValidProviderTypes } from '#blokkli-build/generated-types';
|
|
4
4
|
import type { DeepReadonly } from 'vue';
|
|
5
5
|
import type { BlockDefinitionOptionsInput } from '../../types/definitions.js';
|
|
6
6
|
import type { RuntimeBlockOptionArray } from '../../../global/types/blockOptions.js';
|
|
@@ -95,4 +95,4 @@ export type DefinitionProvider = {
|
|
|
95
95
|
*/
|
|
96
96
|
bundlesWithAutoAdd: ComputedRef<string[]>;
|
|
97
97
|
};
|
|
98
|
-
export default function (): DefinitionProvider;
|
|
98
|
+
export default function (providerType: ValidProviderTypes): DefinitionProvider;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed, ref, readonly } from "#imports";
|
|
2
2
|
import definitions from "#blokkli-build/definitions";
|
|
3
3
|
import { OPTIONS } from "#blokkli-build/runtime-options";
|
|
4
|
-
export default function() {
|
|
4
|
+
export default function(providerType) {
|
|
5
5
|
const blocks = ref(definitions.blocks);
|
|
6
6
|
const fragments = ref(definitions.fragments);
|
|
7
7
|
const providers = ref(definitions.providers);
|
|
@@ -42,6 +42,8 @@ export default function() {
|
|
|
42
42
|
acc[bundle + "__field:" + renderFor.fieldList] = definition;
|
|
43
43
|
} else if ("fieldListType" in renderFor) {
|
|
44
44
|
acc[bundle + "__field:" + renderFor.fieldListType] = definition;
|
|
45
|
+
} else if (renderFor.providerType) {
|
|
46
|
+
acc[bundle + "__provider:" + renderFor.providerType] = definition;
|
|
45
47
|
}
|
|
46
48
|
});
|
|
47
49
|
} else {
|
|
@@ -80,6 +82,10 @@ export default function() {
|
|
|
80
82
|
return blocksByKey.value[forParentBundle];
|
|
81
83
|
}
|
|
82
84
|
}
|
|
85
|
+
const forProviderType = bundle + "__provider:" + providerType;
|
|
86
|
+
if (blocksByKey.value[forProviderType]) {
|
|
87
|
+
return blocksByKey.value[forProviderType];
|
|
88
|
+
}
|
|
83
89
|
return blocksByKey.value[bundle];
|
|
84
90
|
}
|
|
85
91
|
function getFragmentDefinition(name) {
|
|
@@ -7,6 +7,7 @@ import type { ElementProvider } from './element.js';
|
|
|
7
7
|
import type { Rectangle } from '../types/geometry.js';
|
|
8
8
|
import type { DraggableExistingBlock, DraggableItem } from '../types/draggable.js';
|
|
9
9
|
import type { RegisteredField, RegisterFieldData, RenderedFieldListItem } from '../types/field.js';
|
|
10
|
+
import type { BlokkliFragmentName } from '#blokkli-build/definitions';
|
|
10
11
|
type RegisteredFieldType = {
|
|
11
12
|
entityType: string;
|
|
12
13
|
entityBundle: string;
|
|
@@ -186,6 +187,10 @@ export type DomProvider = {
|
|
|
186
187
|
* Get the drag element for a block.
|
|
187
188
|
*/
|
|
188
189
|
getDragElement: (block: DraggableExistingBlock | RenderedFieldListItem) => HTMLElement | undefined;
|
|
190
|
+
/**
|
|
191
|
+
* The fragments that are generally available to be added anywhere on the page.
|
|
192
|
+
*/
|
|
193
|
+
generallyAvailableFragments: ComputedRef<BlokkliFragmentName[]>;
|
|
189
194
|
/**
|
|
190
195
|
* Get debug data for troubleshooting.
|
|
191
196
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { reactive, ref, computed, onMounted } from "#imports";
|
|
2
|
-
import { falsy } from "#blokkli/helpers";
|
|
2
|
+
import { falsy, onlyUnique } from "#blokkli/helpers";
|
|
3
3
|
import { cloneElementWithStyles } from "../helpers/dom/index.js";
|
|
4
4
|
import {
|
|
5
5
|
onBlokkliEvent,
|
|
@@ -28,6 +28,14 @@ export default function(ui, debug, state, element) {
|
|
|
28
28
|
const isInitalizing = ref(true);
|
|
29
29
|
let settleTimeout = null;
|
|
30
30
|
const settleKey = ref(0);
|
|
31
|
+
const generallyAvailableFragments = computed(() => {
|
|
32
|
+
return Object.values(registeredFields).flatMap((field) => {
|
|
33
|
+
if (field && field.allowedFragments.length) {
|
|
34
|
+
return field.allowedFragments;
|
|
35
|
+
}
|
|
36
|
+
return null;
|
|
37
|
+
}).filter(falsy).filter(onlyUnique);
|
|
38
|
+
});
|
|
31
39
|
const observedElements = {};
|
|
32
40
|
function getBoundingClientRect(element2) {
|
|
33
41
|
logger.log("getBoundingClientRect", element2);
|
|
@@ -526,6 +534,7 @@ export default function(ui, debug, state, element) {
|
|
|
526
534
|
getRegisteredField,
|
|
527
535
|
getFieldsAllowingFragment,
|
|
528
536
|
registeredBlocks: computed(() => registeredBlocks),
|
|
529
|
-
getBoundingClientRect
|
|
537
|
+
getBoundingClientRect,
|
|
538
|
+
generallyAvailableFragments
|
|
530
539
|
};
|
|
531
540
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { DraggableItemTypes, DraggableItem } from '../types/draggable.js';
|
|
2
|
+
import type { BlokkliFieldElement, BlokkliItemHost } from '#blokkli/editor/types/field';
|
|
3
|
+
import type { DropArea } from '#blokkli/editor/types/ui';
|
|
4
|
+
type MaybePromise<T> = T | Promise<T>;
|
|
5
|
+
export type DropResolveContext<K extends keyof DraggableItemTypes> = {
|
|
6
|
+
items: DraggableItemTypes[K][];
|
|
7
|
+
field: BlokkliFieldElement;
|
|
8
|
+
host: BlokkliItemHost;
|
|
9
|
+
afterUuid: string | null;
|
|
10
|
+
};
|
|
11
|
+
export type DropExecuteContext<K extends keyof DraggableItemTypes> = DropResolveContext<K> & {
|
|
12
|
+
bundle: string;
|
|
13
|
+
};
|
|
14
|
+
export type DropExecuteResult = {
|
|
15
|
+
/** If true, the dispatcher will focus the editable field after the block is added. */
|
|
16
|
+
focusEditable?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type DropHandler<K extends keyof DraggableItemTypes> = {
|
|
19
|
+
/**
|
|
20
|
+
* Optional. Called at drop time to refine which bundles are applicable.
|
|
21
|
+
* Can read DataTransfer, detect content types, re-map via clipboardMapBundle, etc.
|
|
22
|
+
* Returns the refined list of possible bundles.
|
|
23
|
+
* If omitted, the overlay calls execute() directly without bundle resolution.
|
|
24
|
+
*/
|
|
25
|
+
resolveBundles?: (ctx: DropResolveContext<K>) => string[] | Promise<string[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Called to perform the actual mutation.
|
|
28
|
+
* If resolveBundles was provided, `ctx.bundle` is the resolved bundle
|
|
29
|
+
* (either the single result or the user's BundleSelector pick).
|
|
30
|
+
*/
|
|
31
|
+
execute: (ctx: DropExecuteContext<K>) => MaybePromise<DropExecuteResult | void>;
|
|
32
|
+
};
|
|
33
|
+
type DropAreaProviderFunction = (items: DraggableItem[]) => DropArea[] | DropArea | undefined;
|
|
34
|
+
export type DragDropProvider = {
|
|
35
|
+
registerDropHandler: <K extends keyof DraggableItemTypes>(itemType: K, handler: DropHandler<K>) => void;
|
|
36
|
+
unregisterDropHandler: <K extends keyof DraggableItemTypes>(itemType: K, handler: DropHandler<K>) => void;
|
|
37
|
+
getDropHandler: <K extends keyof DraggableItemTypes>(itemType: K) => DropHandler<K> | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Register a drop area provider function.
|
|
40
|
+
*
|
|
41
|
+
* The function will be called when drop areas are requested during drag operations.
|
|
42
|
+
* It receives the currently dragged items and can return drop areas where those items can be dropped.
|
|
43
|
+
*/
|
|
44
|
+
addDropArea: (fn: DropAreaProviderFunction) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Unregister a drop area provider function.
|
|
47
|
+
*/
|
|
48
|
+
removeDropArea: (fn: DropAreaProviderFunction) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Get all drop areas from all registered providers.
|
|
51
|
+
*/
|
|
52
|
+
getDropAreas: (items: DraggableItem[]) => DropArea[];
|
|
53
|
+
};
|
|
54
|
+
export default function (): DragDropProvider;
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { falsy } from "../../helpers/index.js";
|
|
2
|
+
export default function() {
|
|
3
|
+
const handlers = /* @__PURE__ */ new Map();
|
|
4
|
+
let dropAreaFunctions = [];
|
|
5
|
+
const registerDropHandler = (itemType, handler) => {
|
|
6
|
+
handlers.set(itemType, handler);
|
|
7
|
+
};
|
|
8
|
+
const unregisterDropHandler = (itemType, handler) => {
|
|
9
|
+
if (handlers.get(itemType) === handler) {
|
|
10
|
+
handlers.delete(itemType);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const getDropHandler = (itemType) => {
|
|
14
|
+
return handlers.get(itemType);
|
|
15
|
+
};
|
|
16
|
+
const addDropArea = (fn) => {
|
|
17
|
+
dropAreaFunctions.push(fn);
|
|
18
|
+
};
|
|
19
|
+
const removeDropArea = (fn) => {
|
|
20
|
+
dropAreaFunctions = dropAreaFunctions.filter((v) => v !== fn);
|
|
21
|
+
};
|
|
22
|
+
const getDropAreas = (items) => dropAreaFunctions.flatMap((fn) => {
|
|
23
|
+
const v = fn(items);
|
|
24
|
+
if (v) {
|
|
25
|
+
return v;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}).filter(falsy);
|
|
29
|
+
return {
|
|
30
|
+
registerDropHandler,
|
|
31
|
+
unregisterDropHandler,
|
|
32
|
+
getDropHandler,
|
|
33
|
+
addDropArea,
|
|
34
|
+
removeDropArea,
|
|
35
|
+
getDropAreas
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BlokkliFieldElement } from '../types/field.js';
|
|
2
2
|
import type { DomProvider } from './dom.js';
|
|
3
3
|
import type { BlockDefinitionProvider } from './types.js';
|
|
4
|
+
import type { StateProvider } from './state.js';
|
|
4
5
|
export type FieldsProvider = {
|
|
5
6
|
/**
|
|
6
7
|
* Find a field element by host entity UUID and field name.
|
|
@@ -19,5 +20,22 @@ export type FieldsProvider = {
|
|
|
19
20
|
* @returns The field element with metadata, or undefined if not found
|
|
20
21
|
*/
|
|
21
22
|
find: (uuid: string, fieldName: string) => BlokkliFieldElement | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Get the z-index of the field containing the given block UUID.
|
|
25
|
+
*
|
|
26
|
+
* @param uuid - The block UUID
|
|
27
|
+
* @returns The z-index of the field, or 0 if not found
|
|
28
|
+
*/
|
|
29
|
+
getFieldZIndex: (uuid: string) => number;
|
|
30
|
+
/**
|
|
31
|
+
* Compare field priority between two blocks.
|
|
32
|
+
* Returns > 0 if uuidA wins, < 0 if uuidB wins, 0 if equal.
|
|
33
|
+
* Uses z-index as primary sort, DOM order as tiebreaker.
|
|
34
|
+
*
|
|
35
|
+
* @param uuidA - First block UUID
|
|
36
|
+
* @param uuidB - Second block UUID
|
|
37
|
+
* @returns Comparison result
|
|
38
|
+
*/
|
|
39
|
+
compareFieldPriority: (uuidA: string, uuidB: string) => number;
|
|
22
40
|
};
|
|
23
|
-
export default function (dom: DomProvider, types: BlockDefinitionProvider): FieldsProvider;
|
|
41
|
+
export default function (dom: DomProvider, types: BlockDefinitionProvider, state: StateProvider): FieldsProvider;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { onBlokkliEvent } from "#blokkli/editor/composables";
|
|
2
|
-
export default function(dom, types) {
|
|
2
|
+
export default function(dom, types, state) {
|
|
3
3
|
const fieldCache = /* @__PURE__ */ new Map();
|
|
4
|
+
const fieldInfoCache = /* @__PURE__ */ new Map();
|
|
5
|
+
const comparisonCache = /* @__PURE__ */ new Map();
|
|
4
6
|
function find(uuid, fieldName) {
|
|
5
7
|
const key = uuid + ":" + fieldName;
|
|
6
8
|
const cached = fieldCache.get(key);
|
|
@@ -38,10 +40,60 @@ export default function(dom, types) {
|
|
|
38
40
|
fieldCache.set(key, fieldElement);
|
|
39
41
|
return fieldElement;
|
|
40
42
|
}
|
|
43
|
+
function getFieldInfo(uuid) {
|
|
44
|
+
const cached = fieldInfoCache.get(uuid);
|
|
45
|
+
if (cached !== void 0) {
|
|
46
|
+
return cached;
|
|
47
|
+
}
|
|
48
|
+
const fieldKey = state.getFieldKeyForUuid(uuid);
|
|
49
|
+
if (!fieldKey) {
|
|
50
|
+
fieldInfoCache.set(uuid, null);
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
const separatorIndex = fieldKey.indexOf(":");
|
|
54
|
+
const entityUuid = fieldKey.substring(0, separatorIndex);
|
|
55
|
+
const fieldName = fieldKey.substring(separatorIndex + 1);
|
|
56
|
+
const field = dom.getRegisteredField(entityUuid, fieldName);
|
|
57
|
+
const info = field ? { zIndex: field.zIndex, element: field.element } : null;
|
|
58
|
+
fieldInfoCache.set(uuid, info);
|
|
59
|
+
return info;
|
|
60
|
+
}
|
|
61
|
+
function getFieldZIndex(uuid) {
|
|
62
|
+
return getFieldInfo(uuid)?.zIndex ?? 0;
|
|
63
|
+
}
|
|
64
|
+
function compareFieldPriority(uuidA, uuidB) {
|
|
65
|
+
const cacheKey = uuidA + "\0" + uuidB;
|
|
66
|
+
const cached = comparisonCache.get(cacheKey);
|
|
67
|
+
if (cached !== void 0) {
|
|
68
|
+
return cached;
|
|
69
|
+
}
|
|
70
|
+
const fieldA = getFieldInfo(uuidA);
|
|
71
|
+
const fieldB = getFieldInfo(uuidB);
|
|
72
|
+
const zIndexA = fieldA?.zIndex ?? 0;
|
|
73
|
+
const zIndexB = fieldB?.zIndex ?? 0;
|
|
74
|
+
let result = 0;
|
|
75
|
+
if (zIndexA !== zIndexB) {
|
|
76
|
+
result = zIndexA - zIndexB;
|
|
77
|
+
} else {
|
|
78
|
+
const elA = fieldA?.element;
|
|
79
|
+
const elB = fieldB?.element;
|
|
80
|
+
if (elA && elB && elA !== elB) {
|
|
81
|
+
const position = elA.compareDocumentPosition(elB);
|
|
82
|
+
if (position & Node.DOCUMENT_POSITION_FOLLOWING) result = -1;
|
|
83
|
+
else if (position & Node.DOCUMENT_POSITION_PRECEDING) result = 1;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
comparisonCache.set(cacheKey, result);
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
41
89
|
onBlokkliEvent("state:reloaded", () => {
|
|
42
90
|
fieldCache.clear();
|
|
91
|
+
fieldInfoCache.clear();
|
|
92
|
+
comparisonCache.clear();
|
|
43
93
|
});
|
|
44
94
|
return {
|
|
45
|
-
find
|
|
95
|
+
find,
|
|
96
|
+
getFieldZIndex,
|
|
97
|
+
compareFieldPriority
|
|
46
98
|
};
|
|
47
99
|
}
|
|
@@ -6,6 +6,12 @@ import {
|
|
|
6
6
|
} from "#imports";
|
|
7
7
|
import { storageDefaults } from "#blokkli-build/editor-config";
|
|
8
8
|
const PREFIX = "blokkli:";
|
|
9
|
+
const migrations = {
|
|
10
|
+
showTourPopup: (oldValue) => ({
|
|
11
|
+
key: "popup:tour:closed",
|
|
12
|
+
value: !oldValue
|
|
13
|
+
})
|
|
14
|
+
};
|
|
9
15
|
const getExisting = (key) => {
|
|
10
16
|
try {
|
|
11
17
|
const value = localStorage.getItem(key);
|
|
@@ -114,5 +120,14 @@ export default async function(adapter, context) {
|
|
|
114
120
|
values.value[storageKey] = void 0;
|
|
115
121
|
window.localStorage.removeItem(storageKey);
|
|
116
122
|
};
|
|
123
|
+
for (const [oldKey, migrate] of Object.entries(migrations)) {
|
|
124
|
+
const oldStorageKey = PREFIX + oldKey;
|
|
125
|
+
const oldValue = getExisting(oldStorageKey);
|
|
126
|
+
if (oldValue !== void 0) {
|
|
127
|
+
const { key, value } = migrate(oldValue);
|
|
128
|
+
localStorage.setItem(PREFIX + key, JSON.stringify(value));
|
|
129
|
+
localStorage.removeItem(oldStorageKey);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
117
132
|
return { use, useWithContextPrefix, clearAll, clear };
|
|
118
133
|
}
|
|
@@ -375,6 +375,12 @@ export type UiProvider = {
|
|
|
375
375
|
* When true, adds 'bk-has-sidebar-right' class to document root.
|
|
376
376
|
*/
|
|
377
377
|
hasSidebarRight: ComputedRef<boolean>;
|
|
378
|
+
/**
|
|
379
|
+
* Whether any sidebar is active in the right-bottom region.
|
|
380
|
+
*
|
|
381
|
+
* When true, adds 'bk-has-sidebar-right-bottom' class to document root.
|
|
382
|
+
*/
|
|
383
|
+
hasSidebarRightBottom: ComputedRef<boolean>;
|
|
378
384
|
/**
|
|
379
385
|
* Reference to the main layout element.
|
|
380
386
|
*
|
|
@@ -190,12 +190,18 @@ export default function(eventBus, providerElement, storage, context, element, ma
|
|
|
190
190
|
};
|
|
191
191
|
const activeSidebarsLeft = ref([]);
|
|
192
192
|
const activeSidebarsRight = ref([]);
|
|
193
|
+
const activeSidebarsRightBottom = ref([]);
|
|
193
194
|
function setActiveSidebar(region, id) {
|
|
194
195
|
if (region === "left") {
|
|
195
196
|
if (activeSidebarsLeft.value.includes(id)) {
|
|
196
197
|
return;
|
|
197
198
|
}
|
|
198
199
|
activeSidebarsLeft.value.push(id);
|
|
200
|
+
} else if (region === "right-bottom") {
|
|
201
|
+
if (activeSidebarsRightBottom.value.includes(id)) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
activeSidebarsRightBottom.value.push(id);
|
|
199
205
|
} else {
|
|
200
206
|
if (activeSidebarsRight.value.includes(id)) {
|
|
201
207
|
return;
|
|
@@ -208,6 +214,10 @@ export default function(eventBus, providerElement, storage, context, element, ma
|
|
|
208
214
|
activeSidebarsLeft.value = activeSidebarsLeft.value.filter(
|
|
209
215
|
(v) => v !== id
|
|
210
216
|
);
|
|
217
|
+
} else if (region === "right-bottom") {
|
|
218
|
+
activeSidebarsRightBottom.value = activeSidebarsRightBottom.value.filter(
|
|
219
|
+
(v) => v !== id
|
|
220
|
+
);
|
|
211
221
|
} else {
|
|
212
222
|
activeSidebarsRight.value = activeSidebarsRight.value.filter(
|
|
213
223
|
(v) => v !== id
|
|
@@ -220,6 +230,9 @@ export default function(eventBus, providerElement, storage, context, element, ma
|
|
|
220
230
|
const hasSidebarRight = computed(() => {
|
|
221
231
|
return !!activeSidebarsRight.value.length;
|
|
222
232
|
});
|
|
233
|
+
const hasSidebarRightBottom = computed(() => {
|
|
234
|
+
return !!activeSidebarsRightBottom.value.length;
|
|
235
|
+
});
|
|
223
236
|
const blockingPaddingX = computed(() => 15);
|
|
224
237
|
const blockingPaddingY = computed(() => 50);
|
|
225
238
|
const viewportPadding = computed(() => 10);
|
|
@@ -326,6 +339,11 @@ export default function(eventBus, providerElement, storage, context, element, ma
|
|
|
326
339
|
"bk-has-sidebar-right",
|
|
327
340
|
hasSidebarRight
|
|
328
341
|
);
|
|
342
|
+
addElementClasses(
|
|
343
|
+
document.documentElement,
|
|
344
|
+
"bk-has-sidebar-right-bottom",
|
|
345
|
+
hasSidebarRightBottom
|
|
346
|
+
);
|
|
329
347
|
addElementClasses(document.documentElement, ["bk-html-root"]);
|
|
330
348
|
addElementClasses(document.body, "bk-body");
|
|
331
349
|
addElementClasses(document.documentElement, CLASS_PROXY_MODE, isProxyMode);
|
|
@@ -418,6 +436,7 @@ export default function(eventBus, providerElement, storage, context, element, ma
|
|
|
418
436
|
removeActiveSidebar,
|
|
419
437
|
hasSidebarLeft,
|
|
420
438
|
hasSidebarRight,
|
|
439
|
+
hasSidebarRightBottom,
|
|
421
440
|
mainLayoutElement,
|
|
422
441
|
openDialog,
|
|
423
442
|
closeDialog,
|