@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="bk-blokkli-item-options-number">
|
|
3
|
-
<button :disabled="
|
|
3
|
+
<button :disabled="modelValue <= min" @click.stop.prevent="decrement">
|
|
4
4
|
<Icon name="bk_mdi_remove" />
|
|
5
5
|
</button>
|
|
6
6
|
<input
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}"
|
|
14
14
|
/>
|
|
15
15
|
|
|
16
|
-
<button :disabled="
|
|
16
|
+
<button :disabled="modelValue >= max" @click.stop.prevent="increment">
|
|
17
17
|
<Icon name="bk_mdi_add" />
|
|
18
18
|
</button>
|
|
19
19
|
</div>
|
|
@@ -24,7 +24,7 @@ import { computed } from "#imports";
|
|
|
24
24
|
import { Icon } from "#blokkli/editor/components";
|
|
25
25
|
const props = defineProps({
|
|
26
26
|
label: { type: String, required: true },
|
|
27
|
-
modelValue: { type:
|
|
27
|
+
modelValue: { type: Number, required: false, default: 0 },
|
|
28
28
|
min: { type: Number, required: true },
|
|
29
29
|
max: { type: Number, required: true },
|
|
30
30
|
type: { type: String, required: false, default: "text" }
|
|
@@ -33,27 +33,17 @@ const width = computed(() => props.max.toString().length * 30);
|
|
|
33
33
|
const emit = defineEmits(["update:modelValue"]);
|
|
34
34
|
const text = computed({
|
|
35
35
|
get() {
|
|
36
|
-
return props.modelValue;
|
|
36
|
+
return String(props.modelValue);
|
|
37
37
|
},
|
|
38
38
|
set(v) {
|
|
39
|
-
emit("update:modelValue", (v
|
|
39
|
+
emit("update:modelValue", Number(v) || 0);
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
const numeric = computed(() => {
|
|
43
|
-
if (props.modelValue === void 0) {
|
|
44
|
-
return 0;
|
|
45
|
-
}
|
|
46
|
-
const v = Number.parseInt(props.modelValue);
|
|
47
|
-
if (Number.isNaN(v)) {
|
|
48
|
-
return 0;
|
|
49
|
-
}
|
|
50
|
-
return v;
|
|
51
|
-
});
|
|
52
42
|
function increment() {
|
|
53
|
-
|
|
43
|
+
emit("update:modelValue", props.modelValue + 1);
|
|
54
44
|
}
|
|
55
45
|
function decrement() {
|
|
56
|
-
|
|
46
|
+
emit("update:modelValue", props.modelValue - 1);
|
|
57
47
|
}
|
|
58
48
|
</script>
|
|
59
49
|
|
|
@@ -2,7 +2,7 @@ declare const _default: typeof __VLS_export;
|
|
|
2
2
|
export default _default;
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
4
|
label: string;
|
|
5
|
-
modelValue?:
|
|
5
|
+
modelValue?: number;
|
|
6
6
|
min: number;
|
|
7
7
|
max: number;
|
|
8
8
|
type?: string;
|
|
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
10
10
|
"update:modelValue": (...args: any[]) => void;
|
|
11
11
|
}, string, import("vue").PublicProps, Readonly<{
|
|
12
12
|
label: string;
|
|
13
|
-
modelValue?:
|
|
13
|
+
modelValue?: number;
|
|
14
14
|
min: number;
|
|
15
15
|
max: number;
|
|
16
16
|
type?: string;
|
|
@@ -18,5 +18,5 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
18
18
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
19
19
|
}>, {
|
|
20
20
|
type: string;
|
|
21
|
-
modelValue:
|
|
21
|
+
modelValue: number;
|
|
22
22
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -2,7 +2,7 @@ declare const _default: typeof __VLS_export;
|
|
|
2
2
|
export default _default;
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
4
|
label: string;
|
|
5
|
-
modelValue?:
|
|
5
|
+
modelValue?: number;
|
|
6
6
|
min: number;
|
|
7
7
|
max: number;
|
|
8
8
|
step: number;
|
|
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
10
10
|
"update:modelValue": (...args: any[]) => void;
|
|
11
11
|
}, string, import("vue").PublicProps, Readonly<{
|
|
12
12
|
label: string;
|
|
13
|
-
modelValue?:
|
|
13
|
+
modelValue?: number;
|
|
14
14
|
min: number;
|
|
15
15
|
max: number;
|
|
16
16
|
step: number;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { computed } from "#imports";
|
|
10
10
|
const props = defineProps({
|
|
11
11
|
label: { type: String, required: true },
|
|
12
|
-
modelValue: { type:
|
|
12
|
+
modelValue: { type: Number, required: false },
|
|
13
13
|
min: { type: Number, required: true },
|
|
14
14
|
max: { type: Number, required: true },
|
|
15
15
|
step: { type: Number, required: true }
|
|
@@ -17,14 +17,14 @@ const props = defineProps({
|
|
|
17
17
|
const emit = defineEmits(["update:modelValue"]);
|
|
18
18
|
const text = computed({
|
|
19
19
|
get() {
|
|
20
|
-
return props.modelValue
|
|
20
|
+
return String(props.modelValue ?? 0);
|
|
21
21
|
},
|
|
22
22
|
set(v) {
|
|
23
|
-
emit("update:modelValue", (v
|
|
23
|
+
emit("update:modelValue", Number(v) || 0);
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
const formatted = computed(() => {
|
|
27
|
-
const numValue =
|
|
27
|
+
const numValue = props.modelValue ?? 0;
|
|
28
28
|
const stepPrecision = (props.step.toString().split(".")[1] || "").length;
|
|
29
29
|
return numValue.toFixed(stepPrecision);
|
|
30
30
|
});
|
|
@@ -2,7 +2,7 @@ declare const _default: typeof __VLS_export;
|
|
|
2
2
|
export default _default;
|
|
3
3
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
4
|
label: string;
|
|
5
|
-
modelValue?:
|
|
5
|
+
modelValue?: number;
|
|
6
6
|
min: number;
|
|
7
7
|
max: number;
|
|
8
8
|
step: number;
|
|
@@ -10,7 +10,7 @@ declare const __VLS_export: import("vue").DefineComponent<{
|
|
|
10
10
|
"update:modelValue": (...args: any[]) => void;
|
|
11
11
|
}, string, import("vue").PublicProps, Readonly<{
|
|
12
12
|
label: string;
|
|
13
|
-
modelValue?:
|
|
13
|
+
modelValue?: number;
|
|
14
14
|
min: number;
|
|
15
15
|
max: number;
|
|
16
16
|
step: number;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
:option="plugin.option"
|
|
13
13
|
:property="plugin.property"
|
|
14
14
|
:mutated-value="currentValues[plugin.property]"
|
|
15
|
+
:uuid="firstUuid"
|
|
15
16
|
class="bk-blokkli-item-options-item"
|
|
16
17
|
:class="{
|
|
17
18
|
'bk-is-disabled': isDisabled(plugin)
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
:option="plugin.option"
|
|
34
35
|
:property="plugin.property"
|
|
35
36
|
:mutated-value="currentValues[plugin.property]"
|
|
37
|
+
:uuid="firstUuid"
|
|
36
38
|
class="bk-blokkli-item-options-item"
|
|
37
39
|
:class="{
|
|
38
40
|
'bk-is-disabled': isDisabled(plugin)
|
|
@@ -88,6 +90,9 @@ const props = defineProps({
|
|
|
88
90
|
uuids: { type: [Array, String], required: true },
|
|
89
91
|
definition: { type: null, required: true }
|
|
90
92
|
});
|
|
93
|
+
const firstUuid = computed(
|
|
94
|
+
() => Array.isArray(props.uuids) ? props.uuids[0] : void 0
|
|
95
|
+
);
|
|
91
96
|
let pointerTimeout = null;
|
|
92
97
|
let mouseLeaveTimeout = null;
|
|
93
98
|
function onMouseLeave() {
|
|
@@ -266,21 +271,26 @@ const optionGroups = computed(() => {
|
|
|
266
271
|
);
|
|
267
272
|
});
|
|
268
273
|
function setOptionValue(key, value) {
|
|
274
|
+
const optionDef = availableOptions.value.find((o) => o.property === key);
|
|
275
|
+
const storable = optionDef ? optionValueToStorable(
|
|
276
|
+
optionDef.option,
|
|
277
|
+
value
|
|
278
|
+
) : String(value);
|
|
269
279
|
if (Array.isArray(props.uuids)) {
|
|
270
280
|
props.uuids.forEach((uuid) => {
|
|
271
|
-
updated.set(uuid, key,
|
|
281
|
+
updated.set(uuid, key, storable);
|
|
272
282
|
if (!state.mutatedOptions[uuid]) {
|
|
273
283
|
state.mutatedOptions[uuid] = {};
|
|
274
284
|
}
|
|
275
|
-
state.mutatedOptions[uuid][key] =
|
|
276
|
-
eventBus.emit("option:update", { uuid, key, value });
|
|
285
|
+
state.mutatedOptions[uuid][key] = storable;
|
|
286
|
+
eventBus.emit("option:update", { uuid, key, value: storable });
|
|
277
287
|
});
|
|
278
288
|
} else {
|
|
279
|
-
updated.set("HOST", key,
|
|
289
|
+
updated.set("HOST", key, storable);
|
|
280
290
|
if (!state.mutatedOptions.HOST) {
|
|
281
291
|
state.mutatedOptions.HOST = {};
|
|
282
292
|
}
|
|
283
|
-
state.mutatedOptions.HOST[key] =
|
|
293
|
+
state.mutatedOptions.HOST[key] = storable;
|
|
284
294
|
}
|
|
285
295
|
}
|
|
286
296
|
onMounted(() => {
|
|
@@ -45,7 +45,11 @@ import {
|
|
|
45
45
|
import Overlay from "./Overlay/index.vue";
|
|
46
46
|
import { BlokkliTransition } from "#blokkli/editor/components";
|
|
47
47
|
import { PluginToolbarButton } from "#blokkli/editor/plugins";
|
|
48
|
-
import {
|
|
48
|
+
import {
|
|
49
|
+
onBlokkliEvent,
|
|
50
|
+
defineDropAreas,
|
|
51
|
+
defineDropHandler
|
|
52
|
+
} from "#blokkli/editor/composables";
|
|
49
53
|
import { falsy } from "#blokkli/helpers";
|
|
50
54
|
import { itemEntityType } from "#blokkli-build/config";
|
|
51
55
|
defineBlokkliFeature({
|
|
@@ -108,6 +112,26 @@ defineDropAreas((dragItems) => {
|
|
|
108
112
|
};
|
|
109
113
|
}).filter(falsy);
|
|
110
114
|
});
|
|
115
|
+
defineDropHandler("search_content", {
|
|
116
|
+
resolveBundles({ items, field }) {
|
|
117
|
+
const item = items[0];
|
|
118
|
+
return field.allowedBundles.filter((b) => item.itemBundles.includes(b));
|
|
119
|
+
},
|
|
120
|
+
async execute({ items, host, afterUuid, bundle }) {
|
|
121
|
+
if (!adapter.addContentSearchItem) {
|
|
122
|
+
throw new Error('Adapter does not implement "addContentSearchItem".');
|
|
123
|
+
}
|
|
124
|
+
const item = items[0];
|
|
125
|
+
await state.mutateWithLoadingState(
|
|
126
|
+
() => adapter.addContentSearchItem({
|
|
127
|
+
item: item.searchItem,
|
|
128
|
+
host,
|
|
129
|
+
bundle,
|
|
130
|
+
afterUuid
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
});
|
|
111
135
|
const isRendered = ref(false);
|
|
112
136
|
const isVisible = ref(false);
|
|
113
137
|
const overlay = useTemplateRef("overlay");
|
|
@@ -231,7 +231,7 @@ function selectInList(prev) {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
onBlokkliEvent("keyPressed", (e) => {
|
|
234
|
-
if (selection.isDragging.value || selection.isMultiSelecting.value || ui.hasDialogOpen.value || ui.hasTooltipOpen.value) {
|
|
234
|
+
if (selection.isDragging.value || selection.isMultiSelecting.value || ui.hasDialogOpen.value || ui.hasTooltipOpen.value || ui.hasNestedEditorOpen.value) {
|
|
235
235
|
return;
|
|
236
236
|
}
|
|
237
237
|
if (e.code === "Escape") {
|
|
@@ -240,7 +240,7 @@ onBlokkliEvent("keyPressed", (e) => {
|
|
|
240
240
|
eventBus.emit("select:host:unselect");
|
|
241
241
|
}
|
|
242
242
|
} else if (e.code === "Tab") {
|
|
243
|
-
if (tour.isTouring.value || ui.hasDialogOpen.value) {
|
|
243
|
+
if (tour.isTouring.value || ui.hasDialogOpen.value || ui.hasNestedEditorOpen.value) {
|
|
244
244
|
return;
|
|
245
245
|
}
|
|
246
246
|
e.originalEvent.preventDefault();
|
|
@@ -40,13 +40,37 @@ import {
|
|
|
40
40
|
import { PluginSidebar } from "#blokkli/editor/plugins";
|
|
41
41
|
import { ScrollBoundary } from "#blokkli/editor/components";
|
|
42
42
|
import List from "./List/index.vue";
|
|
43
|
+
import { defineDropHandler } from "#blokkli/editor/composables";
|
|
43
44
|
defineBlokkliFeature({
|
|
44
45
|
id: "structure",
|
|
45
46
|
icon: "bk_mdi_account_tree",
|
|
46
47
|
label: "Structure",
|
|
47
48
|
description: "Provides a sidebar button to render a structured list of all blocks on the current page."
|
|
48
49
|
});
|
|
49
|
-
const { $t, context } = useBlokkli();
|
|
50
|
+
const { $t, context, adapter, state, dom, ui, eventBus } = useBlokkli();
|
|
51
|
+
defineDropHandler("existing_structure", {
|
|
52
|
+
async execute({ items, host, afterUuid }) {
|
|
53
|
+
const uuids = items.map((v) => v.block.uuid);
|
|
54
|
+
await state.mutateWithLoadingState(
|
|
55
|
+
() => adapter.moveMultipleBlocks({
|
|
56
|
+
uuids,
|
|
57
|
+
afterUuid,
|
|
58
|
+
host
|
|
59
|
+
})
|
|
60
|
+
);
|
|
61
|
+
if (uuids.length >= 1 && uuids.length <= 10) {
|
|
62
|
+
for (let i = 0; i < uuids.length; i++) {
|
|
63
|
+
dom.refreshBlockRect(uuids[i]);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if (ui.isMobile.value && uuids.length) {
|
|
67
|
+
eventBus.emit("scrollIntoView", {
|
|
68
|
+
uuid: uuids[0],
|
|
69
|
+
center: true
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
50
74
|
const isLoaded = ref(false);
|
|
51
75
|
const visibleFieldKeys = reactive({});
|
|
52
76
|
const observer = new IntersectionObserver(function(entries) {
|
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Overlay v-if="tour.isTouring.value" @close="
|
|
3
|
-
<Popup
|
|
2
|
+
<Overlay v-if="tour.isTouring.value" @close="stopTour" />
|
|
3
|
+
<Popup
|
|
4
|
+
id="tour"
|
|
5
|
+
theme="warning"
|
|
6
|
+
position="top-left"
|
|
7
|
+
:title="$t('tourLabel', 'Take a tour')"
|
|
8
|
+
:text="
|
|
9
|
+
$t(
|
|
10
|
+
'tourIntro',
|
|
11
|
+
'Explore the most important features of the editor and learn how to get started using bl\xF6kkli.'
|
|
12
|
+
)
|
|
13
|
+
"
|
|
14
|
+
:cta="$t('tourStartButton', 'Start the tour')"
|
|
15
|
+
@submit="startTour"
|
|
16
|
+
/>
|
|
4
17
|
</template>
|
|
5
18
|
|
|
6
19
|
<script setup>
|
|
7
20
|
import { defineBlokkliFeature, useBlokkli } from "#imports";
|
|
8
21
|
import Overlay from "./Overlay/index.vue";
|
|
9
|
-
import Popup from "./Popup/index.vue";
|
|
10
22
|
import { defineMenuButton } from "#blokkli/editor/composables";
|
|
23
|
+
import { Popup } from "#blokkli/editor/components";
|
|
11
24
|
defineBlokkliFeature({
|
|
12
25
|
id: "tour",
|
|
13
26
|
label: "Tour",
|
|
14
27
|
icon: "bk_mdi_school-fill",
|
|
15
28
|
description: "Provides a tour overlay to get to know the editor."
|
|
16
29
|
});
|
|
17
|
-
const { tour, $t
|
|
18
|
-
|
|
19
|
-
const start = () => {
|
|
20
|
-
showTourPopup.value = false;
|
|
30
|
+
const { tour, $t } = useBlokkli();
|
|
31
|
+
function startTour() {
|
|
21
32
|
tour.isTouring.value = true;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
showTourPopup.value = false;
|
|
33
|
+
}
|
|
34
|
+
function stopTour() {
|
|
25
35
|
tour.isTouring.value = false;
|
|
26
|
-
}
|
|
36
|
+
}
|
|
27
37
|
defineMenuButton(() => {
|
|
28
38
|
return {
|
|
29
39
|
id: "tour",
|
|
@@ -32,7 +42,7 @@ defineMenuButton(() => {
|
|
|
32
42
|
icon: "bk_mdi_school-fill",
|
|
33
43
|
secondary: true,
|
|
34
44
|
weight: -10,
|
|
35
|
-
callback:
|
|
45
|
+
callback: startTour
|
|
36
46
|
};
|
|
37
47
|
});
|
|
38
48
|
</script>
|
|
@@ -118,9 +118,7 @@ function cancelTransform() {
|
|
|
118
118
|
}
|
|
119
119
|
watch(selection.uuids, async () => {
|
|
120
120
|
if (status.value === "idle") {
|
|
121
|
-
execute()
|
|
122
|
-
console.log(plugins.value);
|
|
123
|
-
});
|
|
121
|
+
await execute();
|
|
124
122
|
}
|
|
125
123
|
});
|
|
126
124
|
watch(selection.hasHostSelected, () => {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class ClipboardData {
|
|
2
|
+
private html;
|
|
3
|
+
private text;
|
|
4
|
+
constructor(data: DataTransfer);
|
|
5
|
+
hasHtml(): boolean;
|
|
6
|
+
hasText(): boolean;
|
|
7
|
+
/** Returns markdown converted from HTML, falling back to plain text. */
|
|
8
|
+
toMarkdown(): string;
|
|
9
|
+
/** Returns the raw plain text. */
|
|
10
|
+
toText(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
function convertNode(node) {
|
|
2
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
3
|
+
return node.textContent || "";
|
|
4
|
+
}
|
|
5
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
const el = node;
|
|
9
|
+
const tag = el.tagName.toLowerCase();
|
|
10
|
+
const children = Array.from(el.childNodes).map(convertNode).join("");
|
|
11
|
+
switch (tag) {
|
|
12
|
+
case "br":
|
|
13
|
+
return "\n";
|
|
14
|
+
case "p":
|
|
15
|
+
case "div":
|
|
16
|
+
return children + "\n\n";
|
|
17
|
+
case "strong":
|
|
18
|
+
case "b":
|
|
19
|
+
return `**${children}**`;
|
|
20
|
+
case "em":
|
|
21
|
+
case "i":
|
|
22
|
+
return `*${children}*`;
|
|
23
|
+
case "del":
|
|
24
|
+
case "s":
|
|
25
|
+
return `~~${children}~~`;
|
|
26
|
+
case "code":
|
|
27
|
+
if (el.parentElement?.tagName.toLowerCase() === "pre") {
|
|
28
|
+
return children;
|
|
29
|
+
}
|
|
30
|
+
return `\`${children}\``;
|
|
31
|
+
case "pre": {
|
|
32
|
+
const codeEl = el.querySelector("code");
|
|
33
|
+
const content = codeEl ? convertNode(codeEl) : children;
|
|
34
|
+
return `
|
|
35
|
+
\`\`\`
|
|
36
|
+
${content}
|
|
37
|
+
\`\`\`
|
|
38
|
+
`;
|
|
39
|
+
}
|
|
40
|
+
case "h1":
|
|
41
|
+
return `# ${children}
|
|
42
|
+
|
|
43
|
+
`;
|
|
44
|
+
case "h2":
|
|
45
|
+
return `## ${children}
|
|
46
|
+
|
|
47
|
+
`;
|
|
48
|
+
case "h3":
|
|
49
|
+
return `### ${children}
|
|
50
|
+
|
|
51
|
+
`;
|
|
52
|
+
case "h4":
|
|
53
|
+
return `#### ${children}
|
|
54
|
+
|
|
55
|
+
`;
|
|
56
|
+
case "h5":
|
|
57
|
+
return `##### ${children}
|
|
58
|
+
|
|
59
|
+
`;
|
|
60
|
+
case "h6":
|
|
61
|
+
return `###### ${children}
|
|
62
|
+
|
|
63
|
+
`;
|
|
64
|
+
case "a": {
|
|
65
|
+
const href = el.getAttribute("href");
|
|
66
|
+
return href ? `[${children}](${href})` : children;
|
|
67
|
+
}
|
|
68
|
+
case "ul":
|
|
69
|
+
case "ol":
|
|
70
|
+
return "\n" + children + "\n";
|
|
71
|
+
case "li": {
|
|
72
|
+
const parent = el.parentElement;
|
|
73
|
+
if (parent?.tagName.toLowerCase() === "ol") {
|
|
74
|
+
const index = Array.from(parent.children).indexOf(el) + 1;
|
|
75
|
+
return `${index}. ${children.trim()}
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
return `- ${children.trim()}
|
|
79
|
+
`;
|
|
80
|
+
}
|
|
81
|
+
case "blockquote":
|
|
82
|
+
return children.trim().split("\n").map((line) => `> ${line}`).join("\n") + "\n";
|
|
83
|
+
case "table": {
|
|
84
|
+
const rows = [];
|
|
85
|
+
el.querySelectorAll("tr").forEach((tr) => {
|
|
86
|
+
const cells = [];
|
|
87
|
+
tr.querySelectorAll("td, th").forEach((cell) => {
|
|
88
|
+
cells.push(convertNode(cell).replace(/\n/g, " ").trim());
|
|
89
|
+
});
|
|
90
|
+
if (cells.length) {
|
|
91
|
+
rows.push(cells);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
if (!rows.length) return "";
|
|
95
|
+
const colCount = Math.max(...rows.map((r) => r.length));
|
|
96
|
+
const colWidths = Array.from(
|
|
97
|
+
{ length: colCount },
|
|
98
|
+
(_, i) => Math.max(3, ...rows.map((r) => (r[i] || "").length))
|
|
99
|
+
);
|
|
100
|
+
const formatRow = (cells) => "| " + colWidths.map((w, i) => (cells[i] || "").padEnd(w)).join(" | ") + " |";
|
|
101
|
+
const separator = "| " + colWidths.map((w) => "-".repeat(w)).join(" | ") + " |";
|
|
102
|
+
const [header, ...body] = rows;
|
|
103
|
+
if (!header) return "";
|
|
104
|
+
const lines = [formatRow(header), separator];
|
|
105
|
+
for (const row of body) {
|
|
106
|
+
lines.push(formatRow(row));
|
|
107
|
+
}
|
|
108
|
+
return "\n" + lines.join("\n") + "\n";
|
|
109
|
+
}
|
|
110
|
+
case "thead":
|
|
111
|
+
case "tbody":
|
|
112
|
+
case "tfoot":
|
|
113
|
+
case "colgroup":
|
|
114
|
+
case "col":
|
|
115
|
+
case "tr":
|
|
116
|
+
case "td":
|
|
117
|
+
case "th":
|
|
118
|
+
case "caption":
|
|
119
|
+
return children;
|
|
120
|
+
case "hr":
|
|
121
|
+
return "\n---\n";
|
|
122
|
+
case "style":
|
|
123
|
+
case "script":
|
|
124
|
+
return "";
|
|
125
|
+
default:
|
|
126
|
+
return children;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function htmlToMarkdown(html) {
|
|
130
|
+
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
131
|
+
return convertNode(doc.body).replace(/\n{3,}/g, "\n\n").trim();
|
|
132
|
+
}
|
|
133
|
+
export class ClipboardData {
|
|
134
|
+
html;
|
|
135
|
+
text;
|
|
136
|
+
constructor(data) {
|
|
137
|
+
this.html = data.getData("text/html");
|
|
138
|
+
this.text = data.getData("text/plain");
|
|
139
|
+
}
|
|
140
|
+
hasHtml() {
|
|
141
|
+
return !!this.html;
|
|
142
|
+
}
|
|
143
|
+
hasText() {
|
|
144
|
+
return !!this.text;
|
|
145
|
+
}
|
|
146
|
+
/** Returns markdown converted from HTML, falling back to plain text. */
|
|
147
|
+
toMarkdown() {
|
|
148
|
+
if (this.html) {
|
|
149
|
+
return htmlToMarkdown(this.html);
|
|
150
|
+
}
|
|
151
|
+
return this.text;
|
|
152
|
+
}
|
|
153
|
+
/** Returns the raw plain text. */
|
|
154
|
+
toText() {
|
|
155
|
+
return this.text;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
@@ -55,6 +55,11 @@ export function optionValueToStorable(definition, value) {
|
|
|
55
55
|
if (typeof value === "string") {
|
|
56
56
|
return value;
|
|
57
57
|
}
|
|
58
|
+
} else if (definition.type === "json") {
|
|
59
|
+
if (typeof value === "string") {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
return JSON.stringify(value);
|
|
58
63
|
}
|
|
59
64
|
return "";
|
|
60
65
|
}
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
<svg
|
|
1
|
+
<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M19 15L17.74 17.74L15 19L17.74 20.25L19 23L20.25 20.25L23 19L20.25 17.74" />
|
|
3
|
+
<path d="M9 4L6.5 9.5L1 12L6.5 14.5L9 20L11.5 14.5L17 12L11.5 9.5" />
|
|
4
|
+
<path d="M19 1L17.74 3.75L15 5L17.74 6.26L19 9L20.25 6.26L23 5L20.25 3.75" />
|
|
5
|
+
</svg>
|
|
@@ -34,8 +34,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
34
34
|
width: number;
|
|
35
35
|
height: number;
|
|
36
36
|
};
|
|
37
|
-
minHeight: number;
|
|
38
37
|
minWidth: number;
|
|
38
|
+
minHeight: number;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
@@ -34,8 +34,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
|
34
34
|
width: number;
|
|
35
35
|
height: number;
|
|
36
36
|
};
|
|
37
|
-
minHeight: number;
|
|
38
37
|
minWidth: number;
|
|
38
|
+
minHeight: number;
|
|
39
39
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
40
40
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
41
41
|
declare const _default: typeof __VLS_export;
|
|
@@ -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
|
} & {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</slot>
|
|
18
18
|
<slot name="badge" />
|
|
19
19
|
<div class="bk-tooltip">
|
|
20
|
-
<span>{{ title }}</span>
|
|
20
|
+
<span>{{ tooltipTitle || title }}</span>
|
|
21
21
|
<ShortcutIndicator
|
|
22
22
|
v-if="keyCode"
|
|
23
23
|
:meta
|
|
@@ -132,6 +132,7 @@ import {
|
|
|
132
132
|
const props = defineProps({
|
|
133
133
|
id: { type: String, required: true },
|
|
134
134
|
title: { type: String, required: true },
|
|
135
|
+
tooltipTitle: { type: String, required: false, default: void 0 },
|
|
135
136
|
tourText: { type: String, required: false, default: void 0 },
|
|
136
137
|
editOnly: { type: Boolean, required: false },
|
|
137
138
|
icon: { type: null, required: true },
|
|
@@ -148,7 +149,7 @@ const props = defineProps({
|
|
|
148
149
|
beta: { type: Boolean, required: false },
|
|
149
150
|
isLoading: { type: Boolean, required: false }
|
|
150
151
|
});
|
|
151
|
-
const emit = defineEmits(["updated"]);
|
|
152
|
+
const emit = defineEmits(["updated", "toggle"]);
|
|
152
153
|
const { storage, state, ui, $t } = useBlokkli();
|
|
153
154
|
const tourElement = useTemplateRef("tourElement");
|
|
154
155
|
const sidebarDetached = useTemplateRef("sidebarDetached");
|
|
@@ -197,6 +198,7 @@ const onAttachDetached = () => {
|
|
|
197
198
|
emit("updated");
|
|
198
199
|
};
|
|
199
200
|
const toggleSidebar = () => {
|
|
201
|
+
emit("toggle");
|
|
200
202
|
if (isDetached.value) {
|
|
201
203
|
isDetached.value = false;
|
|
202
204
|
return;
|