@blokkli/editor 2.0.0-alpha.35 → 2.0.0-alpha.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global/types/blockOptions.d.ts +10 -2
- package/dist/global/types/definitions.d.ts +12 -5
- package/dist/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +126 -7
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +273 -25
- package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +2 -2
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +34 -17
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.d.ts +2 -20
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.js +0 -3
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue +1 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +1 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.d.vue.ts +1 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +67 -86
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue.d.ts +1 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +10 -12
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/de.md +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/en.md +2 -2
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +1 -5
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.d.vue.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +138 -0
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue.d.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue +94 -38
- package/dist/modules/agent/runtime/app/helpers/index.d.ts +16 -19
- package/dist/modules/agent/runtime/app/helpers/index.js +22 -46
- package/dist/modules/agent/runtime/app/helpers/pageStructure.js +1 -1
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.js +5 -9
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +2 -3
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/add_template/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/analyze_content/index.js +120 -0
- package/dist/modules/agent/runtime/app/tools/check_readability/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/check_readability/index.js +57 -0
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +1 -1
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +176 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +1 -1
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +7 -5
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +2 -1
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +2 -3
- package/dist/modules/agent/runtime/app/tools/helpers.d.ts +53 -0
- package/dist/modules/agent/runtime/app/tools/helpers.js +187 -0
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +2 -6
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +1 -44
- package/dist/modules/agent/runtime/app/tools/schemas.js +0 -174
- package/dist/modules/agent/runtime/app/tools/search_content/index.js +40 -47
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +2 -5
- package/dist/modules/agent/runtime/app/types/index.d.ts +0 -61
- package/dist/modules/agent/runtime/server/Session.d.ts +29 -8
- package/dist/modules/agent/runtime/server/Session.js +168 -85
- package/dist/modules/agent/runtime/server/SessionManager.d.ts +3 -0
- package/dist/modules/agent/runtime/server/SessionManager.js +4 -1
- package/dist/modules/agent/runtime/server/agent.js +3 -2
- package/dist/modules/agent/runtime/server/agentPrompt.d.ts +9 -1
- package/dist/modules/agent/runtime/server/agentPrompt.js +26 -0
- package/dist/modules/agent/runtime/server/default-skills/fixReadability.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/fixReadability.js +69 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +28 -0
- package/dist/modules/agent/runtime/server/server-tools/index.d.ts +10 -2
- package/dist/modules/agent/runtime/server/server-tools/index.js +1 -1
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +1 -1
- package/dist/modules/agent/runtime/shared/types.d.ts +81 -12
- package/dist/modules/agent/runtime/shared/types.js +22 -10
- package/dist/modules/charts/index.d.mts +35 -0
- package/dist/modules/charts/index.mjs +57 -0
- package/dist/modules/charts/runtime/blokkli/skills/charts.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/skills/charts.js +42 -0
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +86 -0
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +136 -0
- package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/create_chart/index.js +93 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_data/index.js +66 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/get_chart_type_options/index.js +40 -0
- package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.d.ts +2 -0
- package/dist/modules/charts/runtime/blokkli/tools/update_chart/index.js +89 -0
- package/dist/modules/charts/runtime/chartTypes/area.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/area.js +68 -0
- package/dist/modules/charts/runtime/chartTypes/bar.d.ts +8 -0
- package/dist/modules/charts/runtime/chartTypes/bar.js +76 -0
- package/dist/modules/charts/runtime/chartTypes/define.d.ts +2 -0
- package/dist/modules/charts/runtime/chartTypes/define.js +3 -0
- package/dist/modules/charts/runtime/chartTypes/donut.d.ts +6 -0
- package/dist/modules/charts/runtime/chartTypes/donut.js +45 -0
- package/dist/modules/charts/runtime/chartTypes/heatmap.d.ts +4 -0
- package/dist/modules/charts/runtime/chartTypes/heatmap.js +54 -0
- package/dist/modules/charts/runtime/chartTypes/index.d.ts +39 -0
- package/dist/modules/charts/runtime/chartTypes/index.js +47 -0
- package/dist/modules/charts/runtime/chartTypes/line.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/line.js +68 -0
- package/dist/modules/charts/runtime/chartTypes/pie.d.ts +5 -0
- package/dist/modules/charts/runtime/chartTypes/pie.js +28 -0
- package/dist/modules/charts/runtime/chartTypes/radar.d.ts +7 -0
- package/dist/modules/charts/runtime/chartTypes/radar.js +52 -0
- package/dist/modules/charts/runtime/chartTypes/radialBar.d.ts +6 -0
- package/dist/modules/charts/runtime/chartTypes/radialBar.js +44 -0
- package/dist/modules/charts/runtime/chartTypes/shared.d.ts +67 -0
- package/dist/modules/charts/runtime/chartTypes/shared.js +103 -0
- package/dist/modules/charts/runtime/chartTypes/types.d.ts +29 -0
- package/dist/modules/charts/runtime/chartTypes/types.js +0 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.d.vue.ts +147 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +120 -0
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue.d.ts +147 -0
- package/dist/modules/charts/runtime/components/index.d.ts +1 -0
- package/dist/modules/charts/runtime/components/index.js +1 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.d.vue.ts +16 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue +97 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/index.vue.d.ts +16 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.d.vue.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue +34 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypePicker/index.vue.d.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.d.vue.ts +12 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +49 -0
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue.d.ts +12 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.d.vue.ts +19 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue +89 -0
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/index.vue.d.ts +19 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.d.vue.ts +23 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +224 -0
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue.d.ts +23 -0
- package/dist/{runtime/editor/features/clipboard/List → modules/charts/runtime/features/charts/Editor/FootnoteEditor}/index.d.vue.ts +4 -5
- package/dist/modules/charts/runtime/features/charts/Editor/FootnoteEditor/index.vue +61 -0
- package/dist/{runtime/editor/features/clipboard/List → modules/charts/runtime/features/charts/Editor/FootnoteEditor}/index.vue.d.ts +4 -5
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.d.vue.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue +45 -0
- package/dist/modules/charts/runtime/features/charts/Editor/Preview/index.vue.d.ts +10 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +249 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +11 -0
- package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +17 -0
- package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.js +90 -0
- package/dist/modules/charts/runtime/features/charts/index.d.vue.ts +3 -0
- package/dist/modules/charts/runtime/features/charts/index.vue +72 -0
- package/dist/modules/charts/runtime/features/charts/index.vue.d.ts +3 -0
- package/dist/modules/charts/runtime/helpers/index.d.ts +26 -0
- package/dist/modules/charts/runtime/helpers/index.js +80 -0
- package/dist/modules/charts/runtime/types.d.ts +33 -0
- package/dist/modules/charts/runtime/types.js +0 -0
- package/dist/modules/drupal/graphql/features/fragments.graphql +2 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/runtime/adapter/index.d.ts +3 -1
- package/dist/modules/drupal/runtime/adapter/index.js +16 -12
- package/dist/modules/table-of-contents/index.d.mts +11 -0
- package/dist/modules/table-of-contents/index.mjs +24 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.d.vue.ts +44 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue +43 -0
- package/dist/modules/table-of-contents/runtime/components/BlokkliTableOfContents/index.vue.d.ts +44 -0
- package/dist/modules/table-of-contents/runtime/types/index.d.ts +4 -0
- package/dist/modules/table-of-contents/runtime/types/index.js +0 -0
- package/dist/runtime/components/Blocks/Fragment/index.vue +6 -2
- package/dist/runtime/components/BlokkliItem.vue +9 -4
- package/dist/runtime/components/BlokkliProvider.d.vue.ts +7 -0
- package/dist/runtime/components/BlokkliProvider.vue +7 -1
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +7 -0
- package/dist/runtime/composables/defineBlokkli.js +1 -1
- package/dist/runtime/composables/useBlokkliHelper.js +4 -2
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +17 -27
- package/dist/runtime/editor/components/Banner/index.d.vue.ts +13 -2
- package/dist/runtime/editor/components/Banner/index.vue +4 -2
- package/dist/runtime/editor/components/Banner/index.vue.d.ts +13 -2
- package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +27 -0
- package/dist/runtime/editor/components/Dropdown/index.vue +107 -0
- package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +27 -0
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.d.vue.ts +1 -0
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue +3 -2
- package/dist/{modules/agent/runtime/app/features/agent/Panel/Input/Actions → runtime/editor/components}/DropdownItem/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/EditProvider.d.vue.ts +2 -0
- package/dist/runtime/editor/components/EditProvider.vue +11 -7
- package/dist/runtime/editor/components/EditProvider.vue.d.ts +2 -0
- package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +5 -1
- package/dist/runtime/editor/components/FlexTextarea/index.vue +24 -101
- package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +5 -1
- package/dist/runtime/editor/components/Form/Radio/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Radio/index.vue +3 -2
- package/dist/runtime/editor/components/Form/Radio/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/ItemIcon/index.vue +10 -2
- package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +13 -3
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +43 -16
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +13 -3
- package/dist/runtime/editor/components/Popup/index.d.vue.ts +30 -0
- package/dist/runtime/editor/components/Popup/index.vue +82 -0
- package/dist/runtime/editor/components/Popup/index.vue.d.ts +30 -0
- package/dist/runtime/editor/components/PreviewProvider.d.vue.ts +2 -0
- package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
- package/dist/runtime/editor/components/PreviewProvider.vue.d.ts +2 -0
- package/dist/runtime/editor/components/Resizable/index.vue +4 -1
- package/dist/runtime/editor/components/ShortcutIndicator/index.vue +1 -1
- package/dist/runtime/editor/components/Toolbar/index.vue +107 -6
- package/dist/runtime/editor/components/index.d.ts +4 -1
- package/dist/runtime/editor/components/index.js +6 -0
- package/dist/runtime/editor/composables/defineDropAreas.js +3 -3
- package/dist/runtime/editor/composables/defineDropHandler.d.ts +3 -0
- package/dist/runtime/editor/composables/defineDropHandler.js +10 -0
- package/dist/runtime/editor/composables/index.d.ts +1 -0
- package/dist/runtime/editor/composables/index.js +1 -0
- package/dist/runtime/editor/composables/onElementResize.js +0 -1
- package/dist/runtime/editor/composables/useEditableFieldOverride.js +4 -5
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +16 -0
- package/dist/runtime/editor/features/add-list/Help/Item.vue +5 -2
- package/dist/runtime/editor/features/add-list/index.vue +58 -1
- package/dist/runtime/editor/features/analyze/Main.d.vue.ts +3 -2
- package/dist/runtime/editor/features/analyze/Main.vue +28 -44
- package/dist/runtime/editor/features/analyze/Main.vue.d.ts +3 -2
- package/dist/runtime/editor/features/analyze/analyzers/readability.js +65 -0
- package/dist/runtime/editor/features/analyze/analyzers/types.d.ts +19 -0
- package/dist/runtime/editor/features/analyze/index.vue +18 -15
- package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
- package/dist/runtime/editor/features/clipboard/DropElement/Video.d.vue.ts +8 -0
- package/dist/runtime/editor/features/clipboard/{List/Item → DropElement}/Video.vue +1 -5
- package/dist/runtime/editor/features/clipboard/DropElement/Video.vue.d.ts +8 -0
- package/dist/runtime/editor/features/clipboard/DropElement/helpers.d.ts +1 -0
- package/dist/runtime/editor/features/clipboard/DropElement/helpers.js +14 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.d.vue.ts +16 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue +97 -0
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue.d.ts +16 -0
- package/dist/runtime/editor/features/clipboard/helpers.d.ts +15 -0
- package/dist/runtime/editor/features/clipboard/helpers.js +62 -0
- package/dist/runtime/editor/features/clipboard/index.vue +586 -338
- package/dist/runtime/editor/features/clipboard/types.d.ts +14 -2
- package/dist/runtime/editor/features/debug/index.vue +1 -1
- package/dist/runtime/editor/features/dev-mode/index.vue +86 -2
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +17 -5
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +2 -2
- package/dist/runtime/editor/features/dragging-overlay/index.vue +125 -219
- package/dist/runtime/editor/features/edit/index.vue +20 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +4 -4
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +6 -0
- package/dist/runtime/editor/features/fragments/types.d.ts +1 -0
- package/dist/runtime/editor/features/hover/Renderer/index.vue +30 -3
- package/dist/runtime/editor/features/hover/index.vue +1 -1
- package/dist/runtime/editor/features/library/index.vue +14 -0
- package/dist/runtime/editor/features/media-library/index.vue +32 -1
- package/dist/runtime/editor/features/options/Form/Checkbox/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +3 -3
- package/dist/runtime/editor/features/options/Form/Checkbox/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +5 -5
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/ComplexType/index.d.vue.ts +11 -0
- package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +36 -0
- package/dist/runtime/editor/features/options/Form/ComplexType/index.vue.d.ts +11 -0
- package/dist/runtime/editor/features/options/Form/Item.d.vue.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Item.vue +24 -50
- package/dist/runtime/editor/features/options/Form/Item.vue.d.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Number/index.d.vue.ts +3 -3
- package/dist/runtime/editor/features/options/Form/Number/index.vue +7 -17
- package/dist/runtime/editor/features/options/Form/Number/index.vue.d.ts +3 -3
- package/dist/runtime/editor/features/options/Form/Range/index.d.vue.ts +2 -2
- package/dist/runtime/editor/features/options/Form/Range/index.vue +4 -4
- package/dist/runtime/editor/features/options/Form/Range/index.vue.d.ts +2 -2
- package/dist/runtime/editor/features/options/Form/index.vue +15 -5
- package/dist/runtime/editor/features/search/index.vue +25 -1
- package/dist/runtime/editor/features/selection/index.vue +2 -2
- package/dist/runtime/editor/features/structure/index.vue +25 -1
- package/dist/runtime/editor/features/tour/index.vue +22 -12
- package/dist/runtime/editor/features/transform/index.vue +1 -3
- package/dist/runtime/editor/helpers/clipboardData/index.d.ts +11 -0
- package/dist/runtime/editor/helpers/clipboardData/index.js +157 -0
- package/dist/runtime/editor/helpers/options/index.js +5 -0
- package/dist/runtime/editor/icons/svg/stars.svg +5 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +15 -4
- package/dist/runtime/editor/plugins/Sidebar/index.vue +4 -2
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +15 -4
- package/dist/runtime/editor/providers/analyze.d.ts +43 -0
- package/dist/runtime/editor/providers/analyze.js +78 -0
- package/dist/runtime/editor/providers/animation.d.ts +4 -0
- package/dist/runtime/editor/providers/animation.js +6 -0
- package/dist/runtime/editor/providers/definition.d.ts +2 -2
- package/dist/runtime/editor/providers/definition.js +7 -1
- package/dist/runtime/editor/providers/dom.d.ts +5 -0
- package/dist/runtime/editor/providers/dom.js +11 -2
- package/dist/runtime/editor/providers/dragdrop.d.ts +55 -0
- package/dist/runtime/editor/providers/dragdrop.js +37 -0
- package/dist/runtime/editor/providers/fields.d.ts +19 -1
- package/dist/runtime/editor/providers/fields.js +54 -2
- package/dist/runtime/editor/providers/storage.js +15 -0
- package/dist/runtime/editor/providers/ui.d.ts +6 -0
- package/dist/runtime/editor/providers/ui.js +19 -0
- package/dist/runtime/editor/translations/de.json +338 -58
- package/dist/runtime/editor/translations/fr.json +331 -51
- package/dist/runtime/editor/translations/gsw_CH.json +336 -56
- package/dist/runtime/editor/translations/it.json +331 -51
- package/dist/runtime/editor/types/app.d.ts +4 -2
- package/dist/runtime/editor/types/draggable.d.ts +1 -0
- package/dist/runtime/editor/types/ui.d.ts +1 -1
- package/dist/runtime/helpers/imports/index.d.ts +8 -1
- package/dist/runtime/helpers/imports/index.js +15 -6
- package/dist/runtime/helpers/injections.d.ts +6 -2
- package/dist/runtime/helpers/injections.js +3 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +14 -0
- package/dist/runtime/types/blockOptions.d.ts +2 -1
- package/dist/runtime/types/definitions.d.ts +12 -5
- package/dist/runtime/types/provider.d.ts +2 -0
- package/dist/shared/editor.6D5vApr0.mjs +30 -0
- package/dist/shared/{editor.DMFfaLVE.mjs → editor.BFIzNSQM.mjs} +1 -30
- package/dist/shared/{editor.Iax3GCvt.d.mts → editor.BdBm1Z7C.d.mts} +34 -0
- package/dist/types.d.mts +1 -1
- package/package.json +21 -3
- package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +0 -104
- package/dist/runtime/editor/features/clipboard/List/Item/File.d.vue.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/File.vue +0 -60
- package/dist/runtime/editor/features/clipboard/List/Item/File.vue.d.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/Video.d.vue.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/Item/Video.vue.d.ts +0 -4
- package/dist/runtime/editor/features/clipboard/List/index.vue +0 -72
- package/dist/runtime/editor/features/tour/Popup/index.d.vue.ts +0 -9
- package/dist/runtime/editor/features/tour/Popup/index.vue +0 -34
- package/dist/runtime/editor/features/tour/Popup/index.vue.d.ts +0 -9
- package/dist/runtime/editor/providers/dropArea.d.ts +0 -48
- package/dist/runtime/editor/providers/dropArea.js +0 -22
- /package/dist/modules/agent/runtime/app/tools/{get_available_bundles → analyze_content}/index.d.ts +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="container" class="bk-dropdown-menu">
|
|
3
|
+
<button
|
|
4
|
+
class="bk-dropdown-menu-trigger"
|
|
5
|
+
:disabled="disabled"
|
|
6
|
+
@click="showMenu = !showMenu"
|
|
7
|
+
>
|
|
8
|
+
<slot name="button" />
|
|
9
|
+
</button>
|
|
10
|
+
<BlokkliTransition name="drop-up">
|
|
11
|
+
<div
|
|
12
|
+
v-if="showMenu"
|
|
13
|
+
ref="contentEl"
|
|
14
|
+
class="bk-dropdown-menu-content"
|
|
15
|
+
:class="positionClass"
|
|
16
|
+
@keydown="onContentKeydown"
|
|
17
|
+
>
|
|
18
|
+
<slot :close="close" />
|
|
19
|
+
</div>
|
|
20
|
+
</BlokkliTransition>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script setup>
|
|
25
|
+
import {
|
|
26
|
+
ref,
|
|
27
|
+
computed,
|
|
28
|
+
watch,
|
|
29
|
+
nextTick,
|
|
30
|
+
onMounted,
|
|
31
|
+
onBeforeUnmount,
|
|
32
|
+
useTemplateRef,
|
|
33
|
+
useBlokkli
|
|
34
|
+
} from "#imports";
|
|
35
|
+
import { BlokkliTransition } from "#blokkli/editor/components";
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
position: { type: String, required: false, default: "bottom-left" },
|
|
38
|
+
disabled: { type: Boolean, required: false, default: false }
|
|
39
|
+
});
|
|
40
|
+
const { eventBus } = useBlokkli();
|
|
41
|
+
const container = useTemplateRef("container");
|
|
42
|
+
const contentEl = useTemplateRef("contentEl");
|
|
43
|
+
const showMenu = ref(false);
|
|
44
|
+
const positionClass = computed(() => `bk-is-${props.position}`);
|
|
45
|
+
function getFocusableItems() {
|
|
46
|
+
if (!contentEl.value) return [];
|
|
47
|
+
return Array.from(
|
|
48
|
+
contentEl.value.querySelectorAll("button, input, [tabindex]")
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
function focusTrigger() {
|
|
52
|
+
const trigger = container.value?.querySelector(
|
|
53
|
+
".bk-dropdown-menu-trigger"
|
|
54
|
+
);
|
|
55
|
+
trigger?.focus();
|
|
56
|
+
}
|
|
57
|
+
function close() {
|
|
58
|
+
if (!showMenu.value) return;
|
|
59
|
+
showMenu.value = false;
|
|
60
|
+
focusTrigger();
|
|
61
|
+
}
|
|
62
|
+
watch(showMenu, (open) => {
|
|
63
|
+
if (open) {
|
|
64
|
+
nextTick(() => {
|
|
65
|
+
const items = getFocusableItems();
|
|
66
|
+
items[0]?.focus();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
function onContentKeydown(e) {
|
|
71
|
+
const { key } = e;
|
|
72
|
+
if (key === "Escape") {
|
|
73
|
+
e.preventDefault();
|
|
74
|
+
e.stopPropagation();
|
|
75
|
+
close();
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
e.stopPropagation();
|
|
81
|
+
const items = getFocusableItems();
|
|
82
|
+
if (!items.length) return;
|
|
83
|
+
const current = items.indexOf(document.activeElement);
|
|
84
|
+
let next;
|
|
85
|
+
if (key === "ArrowDown") {
|
|
86
|
+
next = current < items.length - 1 ? current + 1 : 0;
|
|
87
|
+
} else {
|
|
88
|
+
next = current > 0 ? current - 1 : items.length - 1;
|
|
89
|
+
}
|
|
90
|
+
items[next]?.focus();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
e.stopPropagation();
|
|
94
|
+
}
|
|
95
|
+
function onDocumentClick(e) {
|
|
96
|
+
if (!container.value?.contains(e.target)) {
|
|
97
|
+
close();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
eventBus.on("mouse:up", close);
|
|
101
|
+
onMounted(() => document.addEventListener("click", onDocumentClick));
|
|
102
|
+
onBeforeUnmount(() => {
|
|
103
|
+
document.removeEventListener("click", onDocumentClick);
|
|
104
|
+
eventBus.off("mouse:up", close);
|
|
105
|
+
});
|
|
106
|
+
defineExpose({ close });
|
|
107
|
+
</script>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
position?: 'bottom-left' | 'top-left' | 'top-right';
|
|
3
|
+
disabled?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare function close(): void;
|
|
6
|
+
declare var __VLS_1: {}, __VLS_9: {
|
|
7
|
+
close: typeof close;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
button?: (props: typeof __VLS_1) => any;
|
|
11
|
+
} & {
|
|
12
|
+
default?: (props: typeof __VLS_9) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
15
|
+
close: typeof close;
|
|
16
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
position: "bottom-left" | "top-left" | "top-right";
|
|
19
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -2,6 +2,7 @@ import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
icon: BlokkliIcon;
|
|
4
4
|
text: string;
|
|
5
|
+
disabled?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
8
|
click: () => any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<button @click="$emit('click')">
|
|
2
|
+
<button class="bk-dropdown-menu-item" :disabled @click="$emit('click')">
|
|
3
3
|
<Icon :name="icon" />
|
|
4
4
|
<span>{{ text }}</span>
|
|
5
5
|
</button>
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
import { Icon } from "#blokkli/editor/components";
|
|
10
10
|
defineProps({
|
|
11
11
|
icon: { type: null, required: true },
|
|
12
|
-
text: { type: String, required: true }
|
|
12
|
+
text: { type: String, required: true },
|
|
13
|
+
disabled: { type: Boolean, required: false }
|
|
13
14
|
});
|
|
14
15
|
defineEmits(["click"]);
|
|
15
16
|
</script>
|
|
@@ -2,6 +2,7 @@ import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
icon: BlokkliIcon;
|
|
4
4
|
text: string;
|
|
5
|
+
disabled?: boolean;
|
|
5
6
|
};
|
|
6
7
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
8
|
click: () => any;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '#blokkli-build/styles.css';
|
|
2
2
|
import type { EditPermission } from '#blokkli/types/provider';
|
|
3
|
+
import type { ValidProviderTypes } from '#blokkli-build/generated-types';
|
|
3
4
|
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
6
|
entity?: T;
|
|
@@ -10,6 +11,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
10
11
|
isolate?: boolean;
|
|
11
12
|
permissions: Array<EditPermission | null>;
|
|
12
13
|
providerEl: HTMLElement;
|
|
14
|
+
providerType: ValidProviderTypes;
|
|
13
15
|
}> & (typeof globalThis extends {
|
|
14
16
|
__VLS_PROPS_FALLBACK: infer P;
|
|
15
17
|
} ? P : {});
|
|
@@ -100,7 +100,6 @@ import commandsProvider from "#blokkli/editor/providers/commands";
|
|
|
100
100
|
import tourProvider from "#blokkli/editor/providers/tour";
|
|
101
101
|
import debugProvider from "#blokkli/editor/providers/debug";
|
|
102
102
|
import definitionProvider from "#blokkli/editor/providers/definition";
|
|
103
|
-
import dropAreasProvider from "#blokkli/editor/providers/dropArea";
|
|
104
103
|
import blocksProvider from "#blokkli/editor/providers/blocks";
|
|
105
104
|
import indicatorsProvider from "#blokkli/editor/providers/indicators";
|
|
106
105
|
import pluginProvider from "#blokkli/editor/providers/plugin";
|
|
@@ -109,6 +108,8 @@ import fieldsProvider from "#blokkli/editor/providers/fields";
|
|
|
109
108
|
import iconsProvider from "#blokkli/editor/providers/icons";
|
|
110
109
|
import permissionsProvider from "#blokkli/editor/providers/permissions";
|
|
111
110
|
import adaptersProvider from "#blokkli/editor/providers/adapters";
|
|
111
|
+
import analyzeProviderFn from "#blokkli/editor/providers/analyze";
|
|
112
|
+
import dragdropProvider from "#blokkli/editor/providers/dragdrop";
|
|
112
113
|
import { eventBus } from "#blokkli/editor/events";
|
|
113
114
|
import "#blokkli-build/styles.css";
|
|
114
115
|
import getAdapter from "#blokkli-build/edit-adapter";
|
|
@@ -139,7 +140,8 @@ const props = defineProps({
|
|
|
139
140
|
language: { type: String, required: false, default: "en" },
|
|
140
141
|
isolate: { type: Boolean, required: false },
|
|
141
142
|
permissions: { type: Array, required: true },
|
|
142
|
-
providerEl: { type: null, required: true }
|
|
143
|
+
providerEl: { type: null, required: true },
|
|
144
|
+
providerType: { type: null, required: true }
|
|
143
145
|
});
|
|
144
146
|
defineSlots();
|
|
145
147
|
const mainLayoutElement = useTemplateRef("mainLayoutElement");
|
|
@@ -166,7 +168,7 @@ const route = useRoute();
|
|
|
166
168
|
const toolbarLoaded = ref(false);
|
|
167
169
|
const featuresLoaded = ref(false);
|
|
168
170
|
const isInitializing = ref(true);
|
|
169
|
-
const definitions = definitionProvider();
|
|
171
|
+
const definitions = definitionProvider(props.providerType);
|
|
170
172
|
const $t = textProvider(context);
|
|
171
173
|
const state = await editStateProvider(
|
|
172
174
|
eventBus,
|
|
@@ -185,7 +187,6 @@ const element = elementProvider(debug);
|
|
|
185
187
|
const features = featuresProvider(storage);
|
|
186
188
|
const commands = commandsProvider();
|
|
187
189
|
const tour = tourProvider();
|
|
188
|
-
const dropAreas = dropAreasProvider();
|
|
189
190
|
const broadcast = broadcastProvider();
|
|
190
191
|
const icons = iconsProvider();
|
|
191
192
|
const ui = uiProvider(
|
|
@@ -213,8 +214,10 @@ const animation = animationProvider(
|
|
|
213
214
|
const types = await typesProvider(adapter, selection, context);
|
|
214
215
|
const indicators = indicatorsProvider();
|
|
215
216
|
const directive = directiveProvider(debug, ui);
|
|
216
|
-
const fields = fieldsProvider(dom, types);
|
|
217
|
+
const fields = fieldsProvider(dom, types, state);
|
|
217
218
|
const permissionsInstance = await permissionsProvider(adapter);
|
|
219
|
+
const analyze = analyzeProviderFn(adapters, state, ui, context, $t);
|
|
220
|
+
const dragdrop = dragdropProvider();
|
|
218
221
|
const mutatedEntityProps = computed(() => state.mutatedItemProps.HOST);
|
|
219
222
|
const mutatedEntity = computed(() => {
|
|
220
223
|
return {
|
|
@@ -282,7 +285,6 @@ const app = {
|
|
|
282
285
|
debug,
|
|
283
286
|
definitions,
|
|
284
287
|
dom,
|
|
285
|
-
dropAreas,
|
|
286
288
|
element,
|
|
287
289
|
eventBus,
|
|
288
290
|
directive,
|
|
@@ -300,7 +302,9 @@ const app = {
|
|
|
300
302
|
ui,
|
|
301
303
|
fields,
|
|
302
304
|
icons,
|
|
303
|
-
permissions: permissionsInstance
|
|
305
|
+
permissions: permissionsInstance,
|
|
306
|
+
analyze,
|
|
307
|
+
dragdrop
|
|
304
308
|
};
|
|
305
309
|
provide(INJECT_APP, app);
|
|
306
310
|
function textWithHighlight(title, text) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '#blokkli-build/styles.css';
|
|
2
2
|
import type { EditPermission } from '#blokkli/types/provider';
|
|
3
|
+
import type { ValidProviderTypes } from '#blokkli-build/generated-types';
|
|
3
4
|
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
6
|
entity?: T;
|
|
@@ -10,6 +11,7 @@ declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
10
11
|
isolate?: boolean;
|
|
11
12
|
permissions: Array<EditPermission | null>;
|
|
12
13
|
providerEl: HTMLElement;
|
|
14
|
+
providerType: ValidProviderTypes;
|
|
13
15
|
}> & (typeof globalThis extends {
|
|
14
16
|
__VLS_PROPS_FALLBACK: infer P;
|
|
15
17
|
} ? P : {});
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { ClipboardData } from '#blokkli/editor/helpers/clipboardData';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
maxHeight?: number;
|
|
3
4
|
minHeight?: number;
|
|
4
5
|
submitOnEnter?: boolean;
|
|
5
6
|
/** When true, convert pasted HTML to markdown */
|
|
6
7
|
pasteMarkdown?: boolean;
|
|
8
|
+
/** Called before the built-in paste handling. Return true to skip it. */
|
|
9
|
+
onBeforePaste?: (data: ClipboardData) => boolean;
|
|
7
10
|
textareaClass?: boolean;
|
|
11
|
+
autofocus?: boolean;
|
|
8
12
|
};
|
|
9
13
|
type __VLS_ModelProps = {
|
|
10
14
|
modelValue: string;
|
|
@@ -24,8 +28,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
24
28
|
onSubmit?: (() => any) | undefined;
|
|
25
29
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
26
30
|
}>, {
|
|
27
|
-
maxHeight: number;
|
|
28
31
|
minHeight: number;
|
|
32
|
+
maxHeight: number;
|
|
29
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
34
|
declare const _default: typeof __VLS_export;
|
|
31
35
|
export default _default;
|
|
@@ -15,14 +15,16 @@
|
|
|
15
15
|
}"
|
|
16
16
|
@keydown.capture.stop="onKeydown"
|
|
17
17
|
@keyup.capture.stop
|
|
18
|
+
@pointerdown="onPointerDown"
|
|
18
19
|
@paste="onPaste"
|
|
19
20
|
/>
|
|
20
21
|
</div>
|
|
21
22
|
</template>
|
|
22
23
|
|
|
23
24
|
<script setup>
|
|
24
|
-
import { useTemplateRef, ref, computed, watch } from "#imports";
|
|
25
|
+
import { useTemplateRef, ref, computed, watch, onMounted } from "#imports";
|
|
25
26
|
import { onBlokkliEvent } from "#blokkli/editor/composables";
|
|
27
|
+
import { ClipboardData } from "#blokkli/editor/helpers/clipboardData";
|
|
26
28
|
defineOptions({
|
|
27
29
|
inheritAttrs: false
|
|
28
30
|
});
|
|
@@ -31,7 +33,9 @@ const props = defineProps({
|
|
|
31
33
|
minHeight: { type: Number, required: false, default: 70 },
|
|
32
34
|
submitOnEnter: { type: Boolean, required: false },
|
|
33
35
|
pasteMarkdown: { type: Boolean, required: false },
|
|
34
|
-
|
|
36
|
+
onBeforePaste: { type: Function, required: false },
|
|
37
|
+
textareaClass: { type: Boolean, required: false },
|
|
38
|
+
autofocus: { type: Boolean, required: false }
|
|
35
39
|
});
|
|
36
40
|
const emit = defineEmits(["submit", "keydown"]);
|
|
37
41
|
const modelValue = defineModel({ type: String, ...{ required: true } });
|
|
@@ -41,6 +45,11 @@ const isScrollable = computed(() => {
|
|
|
41
45
|
if (!props.maxHeight) return false;
|
|
42
46
|
return height.value >= props.maxHeight;
|
|
43
47
|
});
|
|
48
|
+
function onPointerDown(e) {
|
|
49
|
+
if (e.target instanceof HTMLElement) {
|
|
50
|
+
e.target.setPointerCapture(e.pointerId);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
44
53
|
function onKeydown(e) {
|
|
45
54
|
emit("keydown", e);
|
|
46
55
|
if (props.submitOnEnter && e.key === "Enter" && !e.shiftKey) {
|
|
@@ -48,107 +57,16 @@ function onKeydown(e) {
|
|
|
48
57
|
emit("submit");
|
|
49
58
|
}
|
|
50
59
|
}
|
|
51
|
-
function convertNode(node) {
|
|
52
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
53
|
-
return node.textContent || "";
|
|
54
|
-
}
|
|
55
|
-
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
56
|
-
return "";
|
|
57
|
-
}
|
|
58
|
-
const el = node;
|
|
59
|
-
const tag = el.tagName.toLowerCase();
|
|
60
|
-
const children = Array.from(el.childNodes).map(convertNode).join("");
|
|
61
|
-
switch (tag) {
|
|
62
|
-
case "br":
|
|
63
|
-
return "\n";
|
|
64
|
-
case "p":
|
|
65
|
-
case "div":
|
|
66
|
-
return children + "\n\n";
|
|
67
|
-
case "strong":
|
|
68
|
-
case "b":
|
|
69
|
-
return `**${children}**`;
|
|
70
|
-
case "em":
|
|
71
|
-
case "i":
|
|
72
|
-
return `*${children}*`;
|
|
73
|
-
case "del":
|
|
74
|
-
case "s":
|
|
75
|
-
return `~~${children}~~`;
|
|
76
|
-
case "code":
|
|
77
|
-
if (el.parentElement?.tagName.toLowerCase() === "pre") {
|
|
78
|
-
return children;
|
|
79
|
-
}
|
|
80
|
-
return `\`${children}\``;
|
|
81
|
-
case "pre": {
|
|
82
|
-
const codeEl = el.querySelector("code");
|
|
83
|
-
const content = codeEl ? convertNode(codeEl) : children;
|
|
84
|
-
return `
|
|
85
|
-
\`\`\`
|
|
86
|
-
${content}
|
|
87
|
-
\`\`\`
|
|
88
|
-
`;
|
|
89
|
-
}
|
|
90
|
-
case "h1":
|
|
91
|
-
return `# ${children}
|
|
92
|
-
|
|
93
|
-
`;
|
|
94
|
-
case "h2":
|
|
95
|
-
return `## ${children}
|
|
96
|
-
|
|
97
|
-
`;
|
|
98
|
-
case "h3":
|
|
99
|
-
return `### ${children}
|
|
100
|
-
|
|
101
|
-
`;
|
|
102
|
-
case "h4":
|
|
103
|
-
return `#### ${children}
|
|
104
|
-
|
|
105
|
-
`;
|
|
106
|
-
case "h5":
|
|
107
|
-
return `##### ${children}
|
|
108
|
-
|
|
109
|
-
`;
|
|
110
|
-
case "h6":
|
|
111
|
-
return `###### ${children}
|
|
112
|
-
|
|
113
|
-
`;
|
|
114
|
-
case "a": {
|
|
115
|
-
const href = el.getAttribute("href");
|
|
116
|
-
return href ? `[${children}](${href})` : children;
|
|
117
|
-
}
|
|
118
|
-
case "ul":
|
|
119
|
-
case "ol":
|
|
120
|
-
return "\n" + children + "\n";
|
|
121
|
-
case "li": {
|
|
122
|
-
const parent = el.parentElement;
|
|
123
|
-
if (parent?.tagName.toLowerCase() === "ol") {
|
|
124
|
-
const index = Array.from(parent.children).indexOf(el) + 1;
|
|
125
|
-
return `${index}. ${children.trim()}
|
|
126
|
-
`;
|
|
127
|
-
}
|
|
128
|
-
return `- ${children.trim()}
|
|
129
|
-
`;
|
|
130
|
-
}
|
|
131
|
-
case "blockquote":
|
|
132
|
-
return children.trim().split("\n").map((line) => `> ${line}`).join("\n") + "\n";
|
|
133
|
-
case "hr":
|
|
134
|
-
return "\n---\n";
|
|
135
|
-
case "style":
|
|
136
|
-
case "script":
|
|
137
|
-
return "";
|
|
138
|
-
default:
|
|
139
|
-
return children;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
function htmlToMarkdown(html) {
|
|
143
|
-
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
144
|
-
return convertNode(doc.body).replace(/\n{3,}/g, "\n\n").trim();
|
|
145
|
-
}
|
|
146
60
|
function onPaste(e) {
|
|
147
|
-
if (!
|
|
148
|
-
const
|
|
149
|
-
if (
|
|
61
|
+
if (!e.clipboardData) return;
|
|
62
|
+
const data = new ClipboardData(e.clipboardData);
|
|
63
|
+
if (props.onBeforePaste?.(data)) {
|
|
64
|
+
e.preventDefault();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (!props.pasteMarkdown || !data.hasHtml()) return;
|
|
150
68
|
e.preventDefault();
|
|
151
|
-
const markdown =
|
|
69
|
+
const markdown = data.toMarkdown();
|
|
152
70
|
const el = textarea.value;
|
|
153
71
|
if (!el) return;
|
|
154
72
|
const start = el.selectionStart;
|
|
@@ -171,6 +89,11 @@ onBlokkliEvent("animationFrame", () => {
|
|
|
171
89
|
const newHeight = Math.max(scrollHeight, props.minHeight);
|
|
172
90
|
height.value = props.maxHeight ? Math.min(newHeight, props.maxHeight) : newHeight;
|
|
173
91
|
});
|
|
92
|
+
onMounted(() => {
|
|
93
|
+
if (props.autofocus && textarea.value) {
|
|
94
|
+
textarea.value.focus();
|
|
95
|
+
}
|
|
96
|
+
});
|
|
174
97
|
defineExpose({
|
|
175
98
|
focus: () => textarea.value?.focus(),
|
|
176
99
|
blur: () => textarea.value?.blur(),
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { ClipboardData } from '#blokkli/editor/helpers/clipboardData';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
maxHeight?: number;
|
|
3
4
|
minHeight?: number;
|
|
4
5
|
submitOnEnter?: boolean;
|
|
5
6
|
/** When true, convert pasted HTML to markdown */
|
|
6
7
|
pasteMarkdown?: boolean;
|
|
8
|
+
/** Called before the built-in paste handling. Return true to skip it. */
|
|
9
|
+
onBeforePaste?: (data: ClipboardData) => boolean;
|
|
7
10
|
textareaClass?: boolean;
|
|
11
|
+
autofocus?: boolean;
|
|
8
12
|
};
|
|
9
13
|
type __VLS_ModelProps = {
|
|
10
14
|
modelValue: string;
|
|
@@ -24,8 +28,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
24
28
|
onSubmit?: (() => any) | undefined;
|
|
25
29
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
26
30
|
}>, {
|
|
27
|
-
maxHeight: number;
|
|
28
31
|
minHeight: number;
|
|
32
|
+
maxHeight: number;
|
|
29
33
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
30
34
|
declare const _default: typeof __VLS_export;
|
|
31
35
|
export default _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="bk-form-label">
|
|
4
4
|
{{ label }}<span v-if="required" class="bk-required-indicator">*</span>
|
|
5
5
|
</div>
|
|
6
|
-
<div>
|
|
6
|
+
<div :class="{ 'bk-radio-inline': inline }">
|
|
7
7
|
<label v-for="option in options" :key="option.value" class="bk-radio">
|
|
8
8
|
<input
|
|
9
9
|
v-model="value"
|
|
@@ -27,7 +27,8 @@ defineProps({
|
|
|
27
27
|
options: { type: Array, required: true },
|
|
28
28
|
required: { type: Boolean, required: false },
|
|
29
29
|
disabled: { type: Boolean, required: false },
|
|
30
|
-
description: { type: String, required: false }
|
|
30
|
+
description: { type: String, required: false },
|
|
31
|
+
inline: { type: Boolean, required: false }
|
|
31
32
|
});
|
|
32
33
|
const value = defineModel({ type: String });
|
|
33
34
|
</script>
|
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
<script setup>
|
|
9
9
|
import { computed, useBlokkli } from "#imports";
|
|
10
10
|
import { Icon } from "#blokkli/editor/components";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
fragmentBlockBundle,
|
|
13
|
+
fromLibraryBlockBundle
|
|
14
|
+
} from "#blokkli-build/config";
|
|
12
15
|
const props = defineProps({
|
|
13
16
|
bundle: { type: String, required: false },
|
|
14
17
|
icon: { type: null, required: false }
|
|
@@ -26,7 +29,12 @@ const iconName = computed(() => {
|
|
|
26
29
|
return name;
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
|
-
|
|
32
|
+
if (props.icon) {
|
|
33
|
+
return props.icon;
|
|
34
|
+
} else if (props.bundle === fragmentBlockBundle) {
|
|
35
|
+
return "bk_mdi_newspaper";
|
|
36
|
+
}
|
|
37
|
+
return "bk_mdi_question_mark";
|
|
30
38
|
});
|
|
31
39
|
</script>
|
|
32
40
|
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
2
|
export type NestedEditorOverlayProps = {
|
|
3
|
-
url
|
|
3
|
+
url?: string;
|
|
4
4
|
uuid: string;
|
|
5
5
|
title: string;
|
|
6
|
-
theme: 'lime' | 'red';
|
|
6
|
+
theme: 'lime' | 'red' | 'accent';
|
|
7
7
|
icon: BlokkliIcon;
|
|
8
8
|
blockUuid?: string;
|
|
9
9
|
element?: HTMLElement | null;
|
|
10
10
|
};
|
|
11
|
-
declare
|
|
11
|
+
declare var __VLS_38: {};
|
|
12
|
+
type __VLS_Slots = {} & {
|
|
13
|
+
default?: (props: typeof __VLS_38) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import("vue").DefineComponent<NestedEditorOverlayProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
16
|
close: (...args: any[]) => void;
|
|
13
17
|
submit: (...args: any[]) => void;
|
|
14
18
|
}, string, import("vue").PublicProps, Readonly<NestedEditorOverlayProps> & Readonly<{
|
|
15
19
|
onClose?: ((...args: any[]) => any) | undefined;
|
|
16
20
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
17
21
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
18
23
|
declare const _default: typeof __VLS_export;
|
|
19
24
|
export default _default;
|
|
25
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
26
|
+
new (): {
|
|
27
|
+
$slots: S;
|
|
28
|
+
};
|
|
29
|
+
};
|