@blokkli/editor 2.0.0-alpha.59 → 2.0.0-alpha.61
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/module.json +1 -1
- package/dist/module.mjs +28 -11
- package/dist/modules/agent/index.mjs +2 -5
- package/dist/modules/agent/runtime/app/features/agent/Container.vue +3 -3
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +15 -3
- package/dist/modules/agent/runtime/app/features/agent/index.vue +5 -1
- package/dist/modules/agent/runtime/app/features/agent/types.d.ts +2 -1
- package/dist/modules/agent/runtime/app/helpers/mutationResult.d.ts +38 -0
- package/dist/modules/agent/runtime/app/helpers/mutationResult.js +49 -0
- package/dist/modules/agent/runtime/app/prompts/fixReadability.js +3 -3
- package/dist/modules/agent/runtime/app/providers/agentProvider.d.ts +2 -1
- package/dist/modules/agent/runtime/app/providers/agentProvider.js +6 -6
- package/dist/modules/agent/runtime/app/providers/toolsProvider.js +3 -13
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.d.ts +25 -0
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +24 -0
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +32 -0
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +6 -4
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/add_template/index.js +5 -3
- package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +3 -3
- package/dist/modules/agent/runtime/app/tools/ask_question/index.js +7 -6
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.d.vue.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue +172 -0
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue.d.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +28 -0
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.js +80 -0
- package/dist/modules/agent/runtime/app/tools/check_readability_for_texts/index.d.ts +17 -0
- package/dist/modules/agent/runtime/app/tools/check_readability_for_texts/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +16 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.d.ts +10 -1
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +16 -0
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +16 -0
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +5 -3
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +31 -0
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.js +7 -7
- package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.d.ts +7 -0
- package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.d.ts +10 -0
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +3 -3
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.d.ts +35 -0
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.d.ts +20 -0
- package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +30 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +15 -11
- package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.d.ts +25 -0
- package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/get_page_structure/index.d.ts +8 -0
- package/dist/modules/agent/runtime/app/tools/get_page_structure/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/get_page_text/index.d.ts +8 -0
- package/dist/modules/agent/runtime/app/tools/get_page_text/index.js +65 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +81 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +20 -12
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.d.ts +14 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +38 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.js +7 -6
- package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.d.ts +12 -0
- package/dist/modules/agent/runtime/app/tools/get_readability_issues/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +16 -0
- package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.js +62 -0
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.d.ts +9 -0
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +16 -0
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/helpers.d.ts +8 -2
- package/dist/modules/agent/runtime/app/tools/helpers.js +9 -9
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +21 -0
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +20 -0
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +19 -0
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +25 -5
- package/dist/modules/agent/runtime/app/tools/schemas.js +37 -10
- package/dist/modules/agent/runtime/app/tools/search_content/index.d.ts +15 -0
- package/dist/modules/agent/runtime/app/tools/search_content/index.js +8 -7
- package/dist/modules/agent/runtime/app/tools/search_media/index.d.ts +5 -1
- package/dist/modules/agent/runtime/app/tools/search_media/index.js +3 -3
- package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.d.ts +16 -0
- package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/search_templates/index.d.ts +13 -0
- package/dist/modules/agent/runtime/app/tools/search_templates/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/search_text/index.d.ts +15 -0
- package/dist/modules/agent/runtime/app/tools/search_text/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/select_media/Component.vue +1 -1
- package/dist/modules/agent/runtime/app/tools/select_media/index.d.ts +2 -2
- package/dist/modules/agent/runtime/app/tools/select_media/index.js +2 -2
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +19 -0
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +17 -0
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.js +3 -2
- package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +13 -4
- package/dist/modules/agent/runtime/app/tools/update_text_fields/index.js +8 -7
- package/dist/modules/agent/runtime/app/tools/web_fetch/index.d.ts +17 -0
- package/dist/modules/agent/runtime/app/tools/web_fetch/index.js +2 -2
- package/dist/modules/agent/runtime/app/types/index.d.ts +6 -9
- package/dist/modules/agent/runtime/app/types/index.js +4 -3
- package/dist/modules/agent/runtime/server/agent.js +1 -2
- package/dist/modules/agent/runtime/server/classes/Session/index.d.ts +2 -2
- package/dist/modules/agent/runtime/server/classes/Session/index.js +10 -5
- package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +2 -1
- package/dist/modules/agent/runtime/shared/toolParams.d.ts +19 -0
- package/dist/modules/agent/runtime/shared/toolParams.js +6 -0
- package/dist/modules/agent/runtime/shared/toolResult.d.ts +4 -0
- package/dist/modules/agent/runtime/shared/toolResult.js +5 -0
- package/dist/modules/agent/runtime/shared/types.d.ts +23 -4
- package/dist/modules/agent/runtime/shared/types.js +6 -1
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +4 -13
- package/dist/modules/drupal/graphql/features/notifications.graphql +39 -0
- package/dist/modules/drupal/index.mjs +6 -1
- package/dist/modules/drupal/runtime/adapter/index.js +38 -0
- package/dist/runtime/editor/components/Actions/ItemDropdown/Item.vue +0 -1
- package/dist/runtime/editor/components/Actions/ScrollArrow/index.d.vue.ts +13 -0
- package/dist/runtime/editor/components/Actions/ScrollArrow/index.vue +52 -0
- package/dist/runtime/editor/components/Actions/ScrollArrow/index.vue.d.ts +13 -0
- package/dist/runtime/editor/components/Actions/Title/index.vue +9 -8
- package/dist/runtime/editor/components/Actions/index.vue +47 -7
- package/dist/runtime/editor/components/Actions/useToolbarScroll.d.ts +25 -0
- package/dist/runtime/editor/components/Actions/useToolbarScroll.js +125 -0
- package/dist/runtime/editor/components/AddListItem/index.vue +0 -2
- package/dist/runtime/editor/components/AppMenu/MenuButton.vue +1 -3
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue +4 -1
- package/dist/runtime/editor/components/Avatar/index.vue +0 -1
- package/dist/runtime/editor/components/BlockPreviewRenderer/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/BundleSelector/index.vue +0 -4
- package/dist/runtime/editor/components/Dialog/index.d.vue.ts +2 -2
- package/dist/runtime/editor/components/Dialog/index.vue +1 -3
- package/dist/runtime/editor/components/Dialog/index.vue.d.ts +2 -2
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.d.vue.ts +8 -0
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue +12 -2
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue.d.ts +8 -0
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.d.vue.ts +8 -0
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue +14 -2
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue.d.ts +8 -0
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.d.vue.ts +2 -2
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +0 -2
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue.d.ts +2 -2
- package/dist/runtime/editor/components/DiffApproval/index.vue +3 -2
- package/dist/runtime/editor/components/Dropdown/index.vue +0 -39
- package/dist/runtime/editor/components/DropdownItem/index.d.vue.ts +12 -2
- package/dist/runtime/editor/components/DropdownItem/index.vue +46 -2
- package/dist/runtime/editor/components/DropdownItem/index.vue.d.ts +12 -2
- package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Form/Datepicker/index.vue +0 -1
- package/dist/runtime/editor/components/Form/TextDark/index.vue +0 -1
- package/dist/runtime/editor/components/Form/Textarea/index.vue +0 -1
- package/dist/runtime/editor/components/Form/Toggle/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Toggle/index.vue +9 -2
- package/dist/runtime/editor/components/Form/Toggle/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/FormOverlay/index.vue +0 -1
- package/dist/runtime/editor/components/Icon/index.vue +0 -2
- package/dist/runtime/editor/components/Messages/Item/index.vue +4 -1
- package/dist/runtime/editor/components/Messages/index.vue +3 -0
- package/dist/runtime/editor/components/Panel/Sheet/index.vue +1 -1
- package/dist/runtime/editor/components/Popup/index.vue +0 -2
- package/dist/runtime/editor/components/RichText/Editor/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/RichText/Editor/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/ScheduleDate/index.vue +1 -3
- package/dist/runtime/editor/components/SearchOverlay/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/SearchOverlay/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.d.vue.ts +3 -0
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +74 -0
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue.d.ts +3 -0
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.d.vue.ts +7 -0
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.vue +16 -0
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/index.vue.d.ts +7 -0
- package/dist/runtime/editor/components/Toolbar/ViewOptions/index.d.vue.ts +3 -0
- package/dist/runtime/editor/components/Toolbar/ViewOptions/index.vue +57 -0
- package/dist/runtime/editor/components/Toolbar/ViewOptions/index.vue.d.ts +3 -0
- package/dist/runtime/editor/components/Toolbar/index.vue +3 -56
- package/dist/runtime/editor/components/ToolbarDropdown/index.d.vue.ts +21 -0
- package/dist/runtime/editor/components/ToolbarDropdown/index.vue +36 -0
- package/dist/runtime/editor/components/ToolbarDropdown/index.vue.d.ts +21 -0
- package/dist/runtime/editor/components/Tooltip/Context.vue +3 -1
- package/dist/runtime/editor/components/Tooltip/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Tooltip/index.vue +4 -1
- package/dist/runtime/editor/components/Tooltip/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/index.d.ts +1 -0
- package/dist/runtime/editor/components/index.js +1 -0
- package/dist/runtime/editor/composables/defineViewOption.d.ts +5 -0
- package/dist/runtime/editor/composables/defineViewOption.js +10 -0
- package/dist/runtime/editor/composables/index.d.ts +3 -0
- package/dist/runtime/editor/composables/index.js +2 -0
- package/dist/runtime/editor/composables/useDismiss.d.ts +30 -0
- package/dist/runtime/editor/composables/useDismiss.js +43 -0
- package/dist/runtime/editor/composables/useGlobalBlokkliObject.d.ts +3 -3
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +23 -0
- package/dist/runtime/editor/features/add-list/Actions/index.vue +0 -1
- package/dist/runtime/editor/features/add-list/Blocks/index.vue +0 -1
- package/dist/runtime/editor/features/add-list/Help/Item.vue +2 -7
- package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
- package/dist/runtime/editor/features/add-list/index.vue +0 -2
- package/dist/runtime/editor/features/anchors/index.vue +11 -11
- package/dist/runtime/editor/features/anchors/types.d.ts +1 -0
- package/dist/runtime/editor/features/anchors/types.js +1 -0
- package/dist/runtime/editor/features/artboard/Renderer.vue +30 -28
- package/dist/runtime/editor/features/block-scheduler/Dialog/ScheduleSection.vue +0 -3
- package/dist/runtime/editor/features/block-scheduler/index.vue +0 -1
- package/dist/runtime/editor/features/block-transfer/SummaryDialog/index.vue +0 -4
- package/dist/runtime/editor/features/breadcrumbs/Crumb/index.vue +0 -5
- package/dist/runtime/editor/features/changelog/changelog.json +16 -0
- package/dist/runtime/editor/features/command-palette/Palette/Item/index.vue +0 -3
- package/dist/runtime/editor/features/command-palette/Palette/index.vue +0 -1
- package/dist/runtime/editor/features/comments/AddForm/index.vue +0 -1
- package/dist/runtime/editor/features/comments/Comment/Actions/index.vue +0 -4
- package/dist/runtime/editor/features/comments/Comment/index.d.vue.ts +14 -0
- package/dist/runtime/editor/features/comments/Comment/index.vue +29 -8
- package/dist/runtime/editor/features/comments/Comment/index.vue.d.ts +14 -0
- package/dist/runtime/editor/features/comments/CommentInput/index.d.vue.ts +1 -1
- package/dist/runtime/editor/features/comments/CommentInput/index.vue +0 -3
- package/dist/runtime/editor/features/comments/CommentInput/index.vue.d.ts +1 -1
- package/dist/runtime/editor/features/comments/Sidebar/AddForm/index.vue +0 -1
- package/dist/runtime/editor/features/comments/Sidebar/index.d.vue.ts +16 -0
- package/dist/runtime/editor/features/comments/Sidebar/index.vue +13 -8
- package/dist/runtime/editor/features/comments/Sidebar/index.vue.d.ts +16 -0
- package/dist/runtime/editor/features/comments/Thread/ReplyForm/index.vue +0 -1
- package/dist/runtime/editor/features/comments/Thread/index.d.vue.ts +16 -0
- package/dist/runtime/editor/features/comments/Thread/index.vue +26 -6
- package/dist/runtime/editor/features/comments/Thread/index.vue.d.ts +16 -0
- package/dist/runtime/editor/features/comments/index.vue +28 -3
- package/dist/runtime/editor/features/delete/types.d.ts +1 -0
- package/dist/runtime/editor/features/delete/types.js +1 -0
- package/dist/runtime/editor/features/dev-mode/index.vue +17 -15
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -0
- package/dist/runtime/editor/features/duplicate/types.d.ts +1 -0
- package/dist/runtime/editor/features/duplicate/types.js +1 -0
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +0 -2
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +0 -1
- package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/index.vue +0 -5
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +0 -5
- package/dist/runtime/editor/features/editable-mask/index.vue +21 -20
- package/dist/runtime/editor/features/entity-title/index.vue +0 -4
- package/dist/runtime/editor/features/fragments/Dialog/index.vue +0 -4
- package/dist/runtime/editor/features/grid/index.vue +16 -15
- package/dist/runtime/editor/features/grid/types.d.ts +1 -0
- package/dist/runtime/editor/features/grid/types.js +1 -0
- package/dist/runtime/editor/features/help/Dialog/index.d.vue.ts +7 -0
- package/dist/runtime/editor/features/help/Dialog/index.vue +57 -0
- package/dist/runtime/editor/features/help/Dialog/index.vue.d.ts +7 -0
- package/dist/runtime/editor/features/help/index.vue +52 -47
- package/dist/runtime/editor/features/history/List/index.vue +2 -9
- package/dist/runtime/editor/features/history/types.d.ts +1 -0
- package/dist/runtime/editor/features/history/types.js +1 -0
- package/dist/runtime/editor/features/notifications/Item/index.d.vue.ts +4 -0
- package/dist/runtime/editor/features/notifications/Item/index.vue +96 -0
- package/dist/runtime/editor/features/notifications/Item/index.vue.d.ts +4 -0
- package/dist/runtime/editor/features/notifications/List/index.d.vue.ts +11 -0
- package/dist/runtime/editor/features/notifications/List/index.vue +126 -0
- package/dist/runtime/editor/features/notifications/List/index.vue.d.ts +11 -0
- package/dist/runtime/editor/features/notifications/docs.md +12 -0
- package/dist/runtime/editor/features/notifications/index.d.vue.ts +3 -0
- package/dist/runtime/editor/features/notifications/index.vue +123 -0
- package/dist/runtime/editor/features/notifications/index.vue.d.ts +3 -0
- package/dist/runtime/editor/features/notifications/types.d.ts +132 -0
- package/dist/runtime/editor/features/notifications/types.js +20 -0
- package/dist/runtime/editor/features/options/Form/Checkbox/index.vue +6 -2
- package/dist/runtime/editor/features/options/Form/Checkboxes/index.vue +14 -4
- package/dist/runtime/editor/features/options/Form/Color/index.vue +1 -1
- package/dist/runtime/editor/features/options/Form/ComplexType/index.vue +0 -1
- package/dist/runtime/editor/features/options/Form/DateTimeLocal/index.vue +0 -1
- package/dist/runtime/editor/features/options/Form/Group.vue +3 -1
- package/dist/runtime/editor/features/options/Form/Item.vue +1 -2
- package/dist/runtime/editor/features/options/Form/Number/index.vue +9 -3
- package/dist/runtime/editor/features/options/Form/Radios/index.vue +3 -2
- package/dist/runtime/editor/features/options/Form/Range/index.vue +8 -2
- package/dist/runtime/editor/features/options/Form/Text/index.vue +6 -2
- package/dist/runtime/editor/features/options/index.vue +7 -1
- package/dist/runtime/editor/features/ownership/Banner/index.vue +3 -1
- package/dist/runtime/editor/features/ownership/types.d.ts +1 -0
- package/dist/runtime/editor/features/ownership/types.js +1 -0
- package/dist/runtime/editor/features/preview-grant/types.d.ts +1 -0
- package/dist/runtime/editor/features/preview-grant/types.js +1 -0
- package/dist/runtime/editor/features/proxy-view/index.vue +24 -21
- package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +0 -2
- package/dist/runtime/editor/features/publish/Dialog/index.vue +1 -2
- package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +0 -1
- package/dist/runtime/editor/features/revert/types.d.ts +1 -0
- package/dist/runtime/editor/features/revert/types.js +1 -0
- package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +18 -8
- package/dist/runtime/editor/features/swap/types.d.ts +1 -0
- package/dist/runtime/editor/features/swap/types.js +1 -0
- package/dist/runtime/editor/features/translations/Banner/index.vue +4 -1
- package/dist/runtime/editor/features/translations/CsvDialog/Import/index.vue +4 -1
- package/dist/runtime/editor/features/translations/TranslateDialog/index.vue +7 -2
- package/dist/runtime/editor/plugins/BlockIndicator/index.vue +0 -2
- package/dist/runtime/editor/plugins/ContextMenu/Menu/index.vue +4 -36
- package/dist/runtime/editor/plugins/ItemAction/index.vue +0 -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 +2 -2
- package/dist/runtime/editor/plugins/Sidebar/index.vue +7 -50
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -2
- package/dist/runtime/editor/plugins/ToolbarButton/index.d.vue.ts +8 -2
- package/dist/runtime/editor/plugins/ToolbarButton/index.vue +122 -28
- package/dist/runtime/editor/plugins/ToolbarButton/index.vue.d.ts +8 -2
- package/dist/runtime/editor/plugins/index.d.ts +1 -2
- package/dist/runtime/editor/plugins/index.js +1 -3
- package/dist/runtime/editor/providers/fieldValue.js +11 -13
- package/dist/runtime/editor/providers/plugin.d.ts +12 -0
- package/dist/runtime/editor/providers/plugin.js +9 -0
- package/dist/runtime/editor/translations/de.json +53 -19
- package/dist/runtime/editor/translations/fr.json +16 -4
- package/dist/runtime/editor/translations/gsw_CH.json +53 -19
- package/dist/runtime/editor/translations/it.json +16 -4
- package/package.json +6 -6
- package/dist/runtime/editor/plugins/ViewOption/index.d.vue.ts +0 -139
- package/dist/runtime/editor/plugins/ViewOption/index.vue +0 -99
- package/dist/runtime/editor/plugins/ViewOption/index.vue.d.ts +0 -139
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import 'typescript';
|
|
|
19
19
|
import 'oxc-walker';
|
|
20
20
|
|
|
21
21
|
const name = "@blokkli/editor";
|
|
22
|
-
const version = "2.0.0-alpha.
|
|
22
|
+
const version = "2.0.0-alpha.61";
|
|
23
23
|
|
|
24
24
|
function validateOption(optionKey, option, icons) {
|
|
25
25
|
const errors = [];
|
|
@@ -1512,6 +1512,7 @@ const USED_MATERIAL_ICONS = [
|
|
|
1512
1512
|
"bk_mdi_add_column_right",
|
|
1513
1513
|
"bk_mdi_add_comment",
|
|
1514
1514
|
"bk_mdi_add_row_below",
|
|
1515
|
+
"bk_mdi_alternate_email",
|
|
1515
1516
|
"bk_mdi_anchor",
|
|
1516
1517
|
"bk_mdi_architecture",
|
|
1517
1518
|
"bk_mdi_area_chart",
|
|
@@ -1552,6 +1553,7 @@ const USED_MATERIAL_ICONS = [
|
|
|
1552
1553
|
"bk_mdi_construction",
|
|
1553
1554
|
"bk_mdi_content_copy",
|
|
1554
1555
|
"bk_mdi_content_paste",
|
|
1556
|
+
"bk_mdi_crop_9_16",
|
|
1555
1557
|
"bk_mdi_csv",
|
|
1556
1558
|
"bk_mdi_dashboard",
|
|
1557
1559
|
"bk_mdi_data_object",
|
|
@@ -1569,6 +1571,7 @@ const USED_MATERIAL_ICONS = [
|
|
|
1569
1571
|
"bk_mdi_exit_to_app",
|
|
1570
1572
|
"bk_mdi_expand_all",
|
|
1571
1573
|
"bk_mdi_extension",
|
|
1574
|
+
"bk_mdi_eye_tracking",
|
|
1572
1575
|
"bk_mdi_feature_search",
|
|
1573
1576
|
"bk_mdi_fit_screen",
|
|
1574
1577
|
"bk_mdi_format_bold",
|
|
@@ -1601,11 +1604,13 @@ const USED_MATERIAL_ICONS = [
|
|
|
1601
1604
|
"bk_mdi_lists",
|
|
1602
1605
|
"bk_mdi_lock",
|
|
1603
1606
|
"bk_mdi_logo_dev",
|
|
1607
|
+
"bk_mdi_mark_chat_read",
|
|
1604
1608
|
"bk_mdi_menu",
|
|
1605
1609
|
"bk_mdi_mobile",
|
|
1606
1610
|
"bk_mdi_mobile_rotate",
|
|
1607
1611
|
"bk_mdi_monitor",
|
|
1608
1612
|
"bk_mdi_newspaper",
|
|
1613
|
+
"bk_mdi_notifications",
|
|
1609
1614
|
"bk_mdi_open_in_new",
|
|
1610
1615
|
"bk_mdi_palette",
|
|
1611
1616
|
"bk_mdi_person",
|
|
@@ -1658,6 +1663,7 @@ const USED_MATERIAL_ICONS = [
|
|
|
1658
1663
|
"bk_mdi_undo",
|
|
1659
1664
|
"bk_mdi_unpublished",
|
|
1660
1665
|
"bk_mdi_upload",
|
|
1666
|
+
"bk_mdi_verified",
|
|
1661
1667
|
"bk_mdi_video_camera_back",
|
|
1662
1668
|
"bk_mdi_visibility",
|
|
1663
1669
|
"bk_mdi_visibility_off",
|
|
@@ -1921,7 +1927,9 @@ export default adapterExtensions
|
|
|
1921
1927
|
}
|
|
1922
1928
|
);
|
|
1923
1929
|
|
|
1930
|
+
const logger$2 = useLogger("@blokkli/editor");
|
|
1924
1931
|
let processor = null;
|
|
1932
|
+
let processorUnavailable = false;
|
|
1925
1933
|
function postcssMangleClasses(selectorParser) {
|
|
1926
1934
|
const plugin = () => ({
|
|
1927
1935
|
postcssPlugin: "postcss-mangle-blokkli-classes",
|
|
@@ -1963,12 +1971,16 @@ function postcssMangleClasses(selectorParser) {
|
|
|
1963
1971
|
plugin.postcss = true;
|
|
1964
1972
|
return plugin;
|
|
1965
1973
|
}
|
|
1974
|
+
async function ensureProcessor() {
|
|
1975
|
+
if (processor || processorUnavailable) return processor;
|
|
1976
|
+
processor = await createProcessor();
|
|
1977
|
+
return processor;
|
|
1978
|
+
}
|
|
1966
1979
|
async function processCSS(css, from, contentPaths) {
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
}
|
|
1980
|
+
const proc = await ensureProcessor();
|
|
1981
|
+
if (!proc) return css;
|
|
1970
1982
|
const sourceDirectives = contentPaths?.length ? "\n" + contentPaths.map((dir) => `@source "${dir}/**/*.vue";`).join("\n") : "";
|
|
1971
|
-
const result = await
|
|
1983
|
+
const result = await proc.process(css + sourceDirectives, {
|
|
1972
1984
|
from: from || "module.css"
|
|
1973
1985
|
});
|
|
1974
1986
|
return result.css;
|
|
@@ -2006,12 +2018,13 @@ async function createProcessor() {
|
|
|
2006
2018
|
return postcss(plugins);
|
|
2007
2019
|
} catch (e) {
|
|
2008
2020
|
if (e.code === "MODULE_NOT_FOUND") {
|
|
2021
|
+
processorUnavailable = true;
|
|
2009
2022
|
const missing = e.message.match(/Cannot find module '([^']+)'/)?.[1] || "unknown";
|
|
2010
|
-
|
|
2011
|
-
`
|
|
2012
|
-
|
|
2013
|
-
npm install -D postcss tailwindcss @tailwindcss/postcss postcss-import postcss-nesting postcss-replace @thedutchcoder/postcss-rem-to-px`
|
|
2023
|
+
logger$2.warn(
|
|
2024
|
+
`bl\xF6kkli's PostCSS pipeline is disabled \u2014 missing dependency "${missing}". This is only required if you author custom bl\xF6kkli modules or features that use Tailwind v4 \`@apply\` / \`theme()\` in their <style> blocks. To enable it, install:
|
|
2025
|
+
npm install -D postcss tailwindcss @tailwindcss/postcss postcss-import postcss-nesting postcss-replace @thedutchcoder/postcss-rem-to-px`
|
|
2014
2026
|
);
|
|
2027
|
+
return null;
|
|
2015
2028
|
}
|
|
2016
2029
|
throw e;
|
|
2017
2030
|
}
|
|
@@ -2174,6 +2187,7 @@ async function stripDistBoilerplate(css) {
|
|
|
2174
2187
|
return result.css;
|
|
2175
2188
|
}
|
|
2176
2189
|
async function processStyleBlocks(code, filePath, tailwindConfigPath) {
|
|
2190
|
+
if (!await ensureProcessor()) return code;
|
|
2177
2191
|
const styleRegex = /<style([^>]*)>([\s\S]*?)<\/style>/g;
|
|
2178
2192
|
let result = code;
|
|
2179
2193
|
let styleMatch;
|
|
@@ -4378,8 +4392,11 @@ const module$1 = defineNuxtModule({
|
|
|
4378
4392
|
blockCollector,
|
|
4379
4393
|
theme
|
|
4380
4394
|
);
|
|
4381
|
-
const
|
|
4382
|
-
|
|
4395
|
+
const distMarker = helper.resolvers.module.resolve(
|
|
4396
|
+
"./modules/tailwind/index.mjs"
|
|
4397
|
+
);
|
|
4398
|
+
const isRunningFromDist = helper.fileCache.fileExists(distMarker);
|
|
4399
|
+
if (!isRunningFromDist) {
|
|
4383
4400
|
context.addContentPath(helper.resolvers.module.resolve("./runtime"));
|
|
4384
4401
|
context.addContentPath(helper.resolvers.module.resolve("./modules"));
|
|
4385
4402
|
}
|
|
@@ -176,8 +176,8 @@ function createClientTemplate(toolCollector, skillsCollector, options, routes) {
|
|
|
176
176
|
const entries = toolsWithNames.map((t) => {
|
|
177
177
|
const importPath = rel(t.filePath);
|
|
178
178
|
return ` '${t.name}': {
|
|
179
|
-
params:
|
|
180
|
-
result:
|
|
179
|
+
params: z.infer<typeof import('${importPath}')['paramsSchema']>
|
|
180
|
+
result: z.infer<typeof import('${importPath}')['resultSchema']>
|
|
181
181
|
}`;
|
|
182
182
|
}).join("\n");
|
|
183
183
|
toolMapBlock = `export interface AgentToolMap {
|
|
@@ -192,9 +192,6 @@ ${entries}
|
|
|
192
192
|
import type { McpToolDefinition } from '#blokkli/agent/app/types'
|
|
193
193
|
import type { AgentModelDefinition } from '#blokkli/agent/shared/types'
|
|
194
194
|
|
|
195
|
-
type _ToolParams<T> = T extends { paramsSchema: infer P extends z.ZodType } ? z.infer<P> : never
|
|
196
|
-
type _ToolResult<T> = T extends { resultSchema: infer R extends z.ZodType } ? z.infer<R> : never
|
|
197
|
-
|
|
198
195
|
${toolMapBlock}
|
|
199
196
|
|
|
200
197
|
export type AgentToolName = ${agentToolNameType}
|
|
@@ -78,7 +78,7 @@ const agentApp = {
|
|
|
78
78
|
provide(INJECT_AGENT_APP, agentApp);
|
|
79
79
|
async function consumePromptRequest(request) {
|
|
80
80
|
emit("consumed");
|
|
81
|
-
const { prompt,
|
|
81
|
+
const { prompt, selectedBlocks } = request;
|
|
82
82
|
const promptText = prompt.getPrompt(blokkli);
|
|
83
83
|
const userPromptText = prompt.getUserPrompt?.(blokkli);
|
|
84
84
|
let preSeededResults = void 0;
|
|
@@ -86,7 +86,7 @@ async function consumePromptRequest(request) {
|
|
|
86
86
|
if (prompt.preExecute) {
|
|
87
87
|
const preResult = await prompt.preExecute({
|
|
88
88
|
app: blokkli,
|
|
89
|
-
|
|
89
|
+
selectedBlocks,
|
|
90
90
|
runTool: tools.runForPrompt
|
|
91
91
|
});
|
|
92
92
|
if (preResult) {
|
|
@@ -97,7 +97,7 @@ async function consumePromptRequest(request) {
|
|
|
97
97
|
agent.sendPrompt({
|
|
98
98
|
prompt: promptText,
|
|
99
99
|
displayPrompt: userPromptText,
|
|
100
|
-
|
|
100
|
+
selectedBlocks,
|
|
101
101
|
autoLoadTools: prompt.tools,
|
|
102
102
|
autoLoadSkills: prompt.skills,
|
|
103
103
|
preSeededResults,
|
|
@@ -243,16 +243,27 @@ function scrollToBottomOnSend() {
|
|
|
243
243
|
isAtBottom.value = true;
|
|
244
244
|
nextTick(scrollToBottom);
|
|
245
245
|
}
|
|
246
|
+
function snapshotInitialSelection() {
|
|
247
|
+
if (conversation.value.length) return void 0;
|
|
248
|
+
const items = app.selection.items.value;
|
|
249
|
+
if (!items.length) return void 0;
|
|
250
|
+
return items.map((item) => ({
|
|
251
|
+
uuid: item.uuid,
|
|
252
|
+
bundle: item.bundle,
|
|
253
|
+
label: app.types.getBlockLabel(item.bundle)
|
|
254
|
+
}));
|
|
255
|
+
}
|
|
246
256
|
function onWelcomePrompt(prompt) {
|
|
247
|
-
agent.sendPrompt({ prompt });
|
|
257
|
+
agent.sendPrompt({ prompt, selectedBlocks: snapshotInitialSelection() });
|
|
248
258
|
scrollToBottomOnSend();
|
|
249
259
|
}
|
|
250
260
|
function onSubmit(submitAttachments) {
|
|
251
261
|
const text = inputValue.value.trim();
|
|
252
262
|
if (!text && !submitAttachments.length || isProcessing.value || !isConnected.value)
|
|
253
263
|
return;
|
|
264
|
+
const selectedBlocks = snapshotInitialSelection();
|
|
254
265
|
if (!submitAttachments.length) {
|
|
255
|
-
agent.sendPrompt({ prompt: inputValue.value });
|
|
266
|
+
agent.sendPrompt({ prompt: inputValue.value, selectedBlocks });
|
|
256
267
|
} else {
|
|
257
268
|
const attachmentBlocks = submitAttachments.map(
|
|
258
269
|
(att) => `<attachment type="${att.type}">
|
|
@@ -265,7 +276,8 @@ ${attachmentBlocks}` : attachmentBlocks;
|
|
|
265
276
|
agent.sendPrompt({
|
|
266
277
|
prompt,
|
|
267
278
|
displayPrompt: text,
|
|
268
|
-
attachments: submitAttachments
|
|
279
|
+
attachments: submitAttachments,
|
|
280
|
+
selectedBlocks
|
|
269
281
|
});
|
|
270
282
|
}
|
|
271
283
|
inputValue.value = "";
|
|
@@ -149,7 +149,11 @@ defineItemDropdownAction(() => {
|
|
|
149
149
|
app.eventBus.emit("sidebar:open", "agent");
|
|
150
150
|
pendingPromptRequest.value = {
|
|
151
151
|
prompt,
|
|
152
|
-
|
|
152
|
+
selectedBlocks: app.selection.items.value.map((item) => ({
|
|
153
|
+
uuid: item.uuid,
|
|
154
|
+
bundle: item.bundle,
|
|
155
|
+
label: app.types.getBlockLabel(item.bundle)
|
|
156
|
+
}))
|
|
153
157
|
};
|
|
154
158
|
}
|
|
155
159
|
};
|
|
@@ -2,13 +2,14 @@ import type { AgentPromptDefinition } from '#blokkli/agent/app/types';
|
|
|
2
2
|
import type { BlokkliUser } from '#blokkli/editor/types/user';
|
|
3
3
|
import type { AdapterSearchArguments } from '#blokkli/editor/adapter';
|
|
4
4
|
import type { PluginConfigInput } from '#blokkli/editor/types/pluginConfig';
|
|
5
|
+
import type { SelectedBlock } from '#blokkli/agent/shared/types';
|
|
5
6
|
/**
|
|
6
7
|
* A pending request from the outer feature's item-dropdown action that the
|
|
7
8
|
* inner container consumes on mount (or on change if already mounted).
|
|
8
9
|
*/
|
|
9
10
|
export type PendingPromptRequest = {
|
|
10
11
|
prompt: AgentPromptDefinition;
|
|
11
|
-
|
|
12
|
+
selectedBlocks: SelectedBlock[];
|
|
12
13
|
};
|
|
13
14
|
export type AgentConversationHostInfo = {
|
|
14
15
|
entityType: string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { BlokkliApp } from '#blokkli/editor/types/app';
|
|
2
|
+
/**
|
|
3
|
+
* Tree-shaped entry in the `newParagraphs` payload returned by mutation tools.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the input shape of `add_paragraphs` — nested children are grouped by
|
|
6
|
+
* paragraph field name so the LLM can verify the structure round-tripped. A
|
|
7
|
+
* flat list was previously emitted; the model could not tell whether a child
|
|
8
|
+
* UUID was actually a sibling that got placed at the top level by mistake.
|
|
9
|
+
*/
|
|
10
|
+
export type NewParagraphNode = {
|
|
11
|
+
uuid: string;
|
|
12
|
+
bundle: string;
|
|
13
|
+
paragraphFields?: string[];
|
|
14
|
+
children?: Record<string, NewParagraphNode[]>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Build the tree-shaped `newParagraphs` payload from a flat list of newly
|
|
18
|
+
* created block UUIDs (computed as the set diff of `getAllUuids()` before vs
|
|
19
|
+
* after a mutation).
|
|
20
|
+
*
|
|
21
|
+
* A block whose host is ALSO in `newUuids` is nested under that parent's
|
|
22
|
+
* `children[fieldName]`. Top-level entries are blocks whose parent already
|
|
23
|
+
* existed before the mutation — these were inserted into the target field.
|
|
24
|
+
*
|
|
25
|
+
* Per-block lookup uses `app.blocks.getBlock` (host metadata) and
|
|
26
|
+
* `app.types.fieldConfig` (paragraph-field discovery), so no extra adapter
|
|
27
|
+
* round-trips are needed.
|
|
28
|
+
*/
|
|
29
|
+
export declare function buildNewParagraphsTree(newUuids: string[], app: BlokkliApp, itemEntityType: string): NewParagraphNode[];
|
|
30
|
+
/**
|
|
31
|
+
* Count every node in a `newParagraphs` tree, including nested children.
|
|
32
|
+
*
|
|
33
|
+
* The tree-shaped envelope means a top-level array of length 1 can still
|
|
34
|
+
* represent dozens of added blocks (one parent with many children). Callers
|
|
35
|
+
* that report "added N paragraphs" should count recursively so the figure
|
|
36
|
+
* stays honest.
|
|
37
|
+
*/
|
|
38
|
+
export declare function countNewParagraphs(nodes: NewParagraphNode[]): number;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export function buildNewParagraphsTree(newUuids, app, itemEntityType) {
|
|
2
|
+
if (!newUuids.length) return [];
|
|
3
|
+
const newSet = new Set(newUuids);
|
|
4
|
+
const nodes = /* @__PURE__ */ new Map();
|
|
5
|
+
const roots = [];
|
|
6
|
+
const pendingChildren = /* @__PURE__ */ new Map();
|
|
7
|
+
for (const uuid of newUuids) {
|
|
8
|
+
const block = app.blocks.getBlock(uuid);
|
|
9
|
+
if (!block) continue;
|
|
10
|
+
const paragraphFields = app.types.fieldConfig.forEntityTypeAndBundle(itemEntityType, block.bundle).map((f) => f.name);
|
|
11
|
+
const node = {
|
|
12
|
+
uuid,
|
|
13
|
+
bundle: block.bundle,
|
|
14
|
+
...paragraphFields.length ? { paragraphFields } : {}
|
|
15
|
+
};
|
|
16
|
+
nodes.set(uuid, node);
|
|
17
|
+
const host = block.host;
|
|
18
|
+
if (host.type === itemEntityType && newSet.has(host.uuid)) {
|
|
19
|
+
let perField = pendingChildren.get(host.uuid);
|
|
20
|
+
if (!perField) {
|
|
21
|
+
perField = /* @__PURE__ */ new Map();
|
|
22
|
+
pendingChildren.set(host.uuid, perField);
|
|
23
|
+
}
|
|
24
|
+
const bucket = perField.get(host.fieldName) ?? [];
|
|
25
|
+
bucket.push(node);
|
|
26
|
+
perField.set(host.fieldName, bucket);
|
|
27
|
+
} else {
|
|
28
|
+
roots.push(node);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
for (const [parentUuid, perField] of pendingChildren) {
|
|
32
|
+
const parent = nodes.get(parentUuid);
|
|
33
|
+
if (!parent) continue;
|
|
34
|
+
parent.children = Object.fromEntries(perField);
|
|
35
|
+
}
|
|
36
|
+
return roots;
|
|
37
|
+
}
|
|
38
|
+
export function countNewParagraphs(nodes) {
|
|
39
|
+
let total = 0;
|
|
40
|
+
for (const node of nodes) {
|
|
41
|
+
total += 1;
|
|
42
|
+
if (node.children) {
|
|
43
|
+
for (const childList of Object.values(node.children)) {
|
|
44
|
+
total += countNewParagraphs(childList);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return total;
|
|
49
|
+
}
|
|
@@ -28,11 +28,11 @@ export default defineBlokkliAgentPrompt({
|
|
|
28
28
|
"Fix the readability of the selected paragraphs."
|
|
29
29
|
);
|
|
30
30
|
},
|
|
31
|
-
async preExecute({
|
|
31
|
+
async preExecute({ selectedBlocks, runTool }) {
|
|
32
32
|
const readability = await runTool(
|
|
33
33
|
"get_readability_issues",
|
|
34
|
-
|
|
35
|
-
uuids:
|
|
34
|
+
selectedBlocks.length ? {
|
|
35
|
+
uuids: selectedBlocks.map((b) => b.uuid)
|
|
36
36
|
} : {}
|
|
37
37
|
);
|
|
38
38
|
const fields = Object.entries(readability.result).flatMap(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Ref } from '#imports';
|
|
2
2
|
import type { Attachment, PreSeededToolResult, AutoExecuteTool } from '#blokkli/agent/app/types';
|
|
3
|
+
import type { SelectedBlock } from '#blokkli/agent/shared/types';
|
|
3
4
|
import type { BlokkliApp } from '#blokkli/editor/types/app';
|
|
4
5
|
import type { FullBlokkliAdapter } from '#blokkli/editor/adapter';
|
|
5
6
|
import type { SocketProvider } from './socketProvider.js';
|
|
@@ -9,7 +10,7 @@ import type { ToolsProvider } from './toolsProvider.js';
|
|
|
9
10
|
export type SendPromptOptions = {
|
|
10
11
|
prompt: string;
|
|
11
12
|
displayPrompt?: string;
|
|
12
|
-
|
|
13
|
+
selectedBlocks?: SelectedBlock[];
|
|
13
14
|
attachments?: Attachment[];
|
|
14
15
|
autoLoadTools?: string[];
|
|
15
16
|
autoLoadSkills?: string[];
|
|
@@ -9,19 +9,19 @@ function buildSendContext(options) {
|
|
|
9
9
|
const {
|
|
10
10
|
prompt,
|
|
11
11
|
displayPrompt,
|
|
12
|
-
|
|
12
|
+
selectedBlocks,
|
|
13
13
|
autoLoadTools,
|
|
14
14
|
autoLoadSkills,
|
|
15
15
|
preSeededResults,
|
|
16
16
|
autoExecuteTools,
|
|
17
17
|
promptId
|
|
18
18
|
} = options;
|
|
19
|
-
const hasData = !!promptId || displayPrompt !== void 0 && displayPrompt !== prompt || !!
|
|
19
|
+
const hasData = !!promptId || displayPrompt !== void 0 && displayPrompt !== prompt || !!selectedBlocks?.length || !!autoLoadTools?.length || !!autoLoadSkills?.length || !!preSeededResults?.length || !!autoExecuteTools?.length;
|
|
20
20
|
if (!hasData) return void 0;
|
|
21
21
|
return {
|
|
22
22
|
promptId,
|
|
23
23
|
serverPrompt: displayPrompt !== void 0 && displayPrompt !== prompt ? prompt : void 0,
|
|
24
|
-
|
|
24
|
+
selectedBlocks: selectedBlocks?.length ? [...selectedBlocks] : void 0,
|
|
25
25
|
autoLoadTools: autoLoadTools?.length ? [...autoLoadTools] : void 0,
|
|
26
26
|
autoLoadSkills: autoLoadSkills?.length ? [...autoLoadSkills] : void 0,
|
|
27
27
|
preSeededResults: preSeededResults?.length ? preSeededResults : void 0,
|
|
@@ -217,7 +217,7 @@ export default function agentProvider({
|
|
|
217
217
|
const {
|
|
218
218
|
prompt,
|
|
219
219
|
displayPrompt,
|
|
220
|
-
|
|
220
|
+
selectedBlocks,
|
|
221
221
|
attachments,
|
|
222
222
|
autoLoadTools,
|
|
223
223
|
autoLoadSkills,
|
|
@@ -280,7 +280,7 @@ export default function agentProvider({
|
|
|
280
280
|
socket.send({
|
|
281
281
|
type: "start",
|
|
282
282
|
prompt,
|
|
283
|
-
|
|
283
|
+
selectedBlocks: selectedBlocks?.length ? selectedBlocks : void 0,
|
|
284
284
|
autoLoadTools: resolvedAutoLoadTools?.length ? resolvedAutoLoadTools : void 0,
|
|
285
285
|
autoLoadSkills: resolvedAutoLoadSkills?.length ? resolvedAutoLoadSkills : void 0,
|
|
286
286
|
preSeededResults: serverPreSeeded,
|
|
@@ -323,7 +323,7 @@ export default function agentProvider({
|
|
|
323
323
|
displayPrompt: isEdit ? void 0 : displayedText,
|
|
324
324
|
attachments: target.attachments,
|
|
325
325
|
rollbackToUserMessageIndex: userMessageIndex,
|
|
326
|
-
|
|
326
|
+
selectedBlocks: ctx?.selectedBlocks,
|
|
327
327
|
autoLoadTools: ctx?.autoLoadTools,
|
|
328
328
|
autoLoadSkills: ctx?.autoLoadSkills,
|
|
329
329
|
preSeededResults: isEdit ? void 0 : ctx?.preSeededResults,
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
asRecord,
|
|
12
12
|
splitMeta
|
|
13
13
|
} from "#blokkli/agent/app/helpers";
|
|
14
|
+
import { buildNewParagraphsTree } from "#blokkli/agent/app/helpers/mutationResult";
|
|
14
15
|
import { mcpTools } from "#blokkli-build/agent-client";
|
|
15
16
|
import { itemEntityType } from "#blokkli-build/config";
|
|
16
17
|
import { generateId } from "#blokkli/agent/app/helpers/id";
|
|
@@ -104,22 +105,11 @@ export default function toolsProvider({
|
|
|
104
105
|
return newUuids;
|
|
105
106
|
}
|
|
106
107
|
function buildMutationResult(newUuids) {
|
|
107
|
-
const newParagraphs = action.type === "add"
|
|
108
|
-
const block = app.blocks.getBlock(uuid);
|
|
109
|
-
if (!block) return null;
|
|
110
|
-
const blockFieldNames = app.types.fieldConfig.forEntityTypeAndBundle(itemEntityType, block.bundle).map((f) => f.name);
|
|
111
|
-
return {
|
|
112
|
-
uuid,
|
|
113
|
-
bundle: block.bundle,
|
|
114
|
-
...blockFieldNames.length ? { paragraphFields: blockFieldNames } : {}
|
|
115
|
-
};
|
|
116
|
-
}).filter(
|
|
117
|
-
(b) => b !== null
|
|
118
|
-
) : void 0;
|
|
108
|
+
const newParagraphs = action.type === "add" ? buildNewParagraphsTree(newUuids, app, itemEntityType) : [];
|
|
119
109
|
return {
|
|
120
110
|
success: true,
|
|
121
111
|
historyIndex: state.currentMutationIndex.value,
|
|
122
|
-
newParagraphs: newParagraphs
|
|
112
|
+
newParagraphs: newParagraphs.length ? newParagraphs : void 0,
|
|
123
113
|
...action.result
|
|
124
114
|
};
|
|
125
115
|
}
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const paramsSchema: z.ZodObject<{
|
|
3
|
+
itemId: z.ZodString;
|
|
4
|
+
itemEntityType: z.ZodString;
|
|
5
|
+
itemEntityBundle: z.ZodString;
|
|
6
|
+
targetBundle: z.ZodString;
|
|
7
|
+
parent: z.ZodObject<{
|
|
8
|
+
type: z.ZodString;
|
|
9
|
+
uuid: z.ZodString;
|
|
10
|
+
field: z.ZodString;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
position: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
15
|
+
type: z.ZodEnum<{
|
|
16
|
+
rewrite: "rewrite";
|
|
17
|
+
delete: "delete";
|
|
18
|
+
add: "add";
|
|
19
|
+
move: "move";
|
|
20
|
+
options: "options";
|
|
21
|
+
}>;
|
|
22
|
+
label: z.ZodString;
|
|
23
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
24
|
+
error: z.ZodString;
|
|
25
|
+
}, z.core.$strip>]>;
|
|
1
26
|
declare const _default: any;
|
|
2
27
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
|
3
3
|
import { mutationResultSchema, parentSchema, positionSchema } from "../schemas.js";
|
|
4
4
|
import { resolvePosition } from "../helpers.js";
|
|
5
5
|
import { requireBundlePermission } from "../../helpers/validation.js";
|
|
6
|
-
const paramsSchema = z.object({
|
|
6
|
+
export const paramsSchema = z.object({
|
|
7
7
|
itemId: z.string().describe("Content item ID from search_content results"),
|
|
8
8
|
itemEntityType: z.string().describe("Entity type of the content item"),
|
|
9
9
|
itemEntityBundle: z.string().describe("Entity bundle of the content item"),
|
|
@@ -13,6 +13,7 @@ const paramsSchema = z.object({
|
|
|
13
13
|
parent: parentSchema.describe("The parent entity to add the paragraph to"),
|
|
14
14
|
position: positionSchema
|
|
15
15
|
});
|
|
16
|
+
export const resultSchema = mutationResultSchema;
|
|
16
17
|
export default defineBlokkliAgentTool({
|
|
17
18
|
name: "add_content_search_paragraphs",
|
|
18
19
|
description: "Add a paragraph using a content item from search results. Use search_content first to find content items, then use this tool to add one to the page.",
|
|
@@ -28,7 +29,7 @@ export default defineBlokkliAgentTool({
|
|
|
28
29
|
);
|
|
29
30
|
},
|
|
30
31
|
paramsSchema,
|
|
31
|
-
resultSchema
|
|
32
|
+
resultSchema,
|
|
32
33
|
requiredAdapterMethods: ["addContentSearchItem"],
|
|
33
34
|
execute(ctx, params) {
|
|
34
35
|
const denied = requireBundlePermission(
|
|
@@ -1,2 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const paramsSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
parent: z.ZodObject<{
|
|
5
|
+
type: z.ZodString;
|
|
6
|
+
uuid: z.ZodString;
|
|
7
|
+
field: z.ZodString;
|
|
8
|
+
}, z.core.$strip>;
|
|
9
|
+
position: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
12
|
+
type: z.ZodEnum<{
|
|
13
|
+
rewrite: "rewrite";
|
|
14
|
+
delete: "delete";
|
|
15
|
+
add: "add";
|
|
16
|
+
move: "move";
|
|
17
|
+
options: "options";
|
|
18
|
+
}>;
|
|
19
|
+
label: z.ZodString;
|
|
20
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
21
|
+
error: z.ZodString;
|
|
22
|
+
}, z.core.$strip>]>;
|
|
1
23
|
declare const _default: any;
|
|
2
24
|
export default _default;
|
|
@@ -3,11 +3,12 @@ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
|
3
3
|
import { mutationResultSchema, parentSchema, positionSchema } from "../schemas.js";
|
|
4
4
|
import { resolvePosition } from "../helpers.js";
|
|
5
5
|
import { fragmentBlockBundle } from "#blokkli-build/config";
|
|
6
|
-
const paramsSchema = z.object({
|
|
6
|
+
export const paramsSchema = z.object({
|
|
7
7
|
name: z.string().describe("The fragment name to add"),
|
|
8
8
|
parent: parentSchema.describe("The parent entity to add the fragment to"),
|
|
9
9
|
position: positionSchema
|
|
10
10
|
});
|
|
11
|
+
export const resultSchema = mutationResultSchema;
|
|
11
12
|
export default defineBlokkliAgentTool({
|
|
12
13
|
name: "add_fragment",
|
|
13
14
|
description: "Add a fragment paragraph to the page.",
|
|
@@ -19,7 +20,7 @@ export default defineBlokkliAgentTool({
|
|
|
19
20
|
return $t("aiAgentAddFragmentRunning", "Adding fragment", { more: true });
|
|
20
21
|
},
|
|
21
22
|
paramsSchema,
|
|
22
|
-
resultSchema
|
|
23
|
+
resultSchema,
|
|
23
24
|
requiredAdapterMethods: ["fragmentsAddBlock"],
|
|
24
25
|
execute(ctx, params) {
|
|
25
26
|
const { fields, definitions, permissions } = ctx.app;
|
|
@@ -1,2 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const paramsSchema: z.ZodObject<{
|
|
3
|
+
mediaId: z.ZodString;
|
|
4
|
+
mediaBundle: z.ZodString;
|
|
5
|
+
targetBundle: z.ZodString;
|
|
6
|
+
parent: z.ZodObject<{
|
|
7
|
+
type: z.ZodString;
|
|
8
|
+
uuid: z.ZodString;
|
|
9
|
+
field: z.ZodString;
|
|
10
|
+
}, z.core.$strip>;
|
|
11
|
+
position: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
}, z.core.$strip>;
|
|
13
|
+
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
14
|
+
type: z.ZodEnum<{
|
|
15
|
+
rewrite: "rewrite";
|
|
16
|
+
delete: "delete";
|
|
17
|
+
add: "add";
|
|
18
|
+
move: "move";
|
|
19
|
+
options: "options";
|
|
20
|
+
}>;
|
|
21
|
+
label: z.ZodString;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
error: z.ZodString;
|
|
24
|
+
}, z.core.$strip>]>;
|
|
1
25
|
declare const _default: any;
|
|
2
26
|
export default _default;
|
|
@@ -3,7 +3,7 @@ import { defineBlokkliAgentTool } from "#blokkli/agent/app/composables";
|
|
|
3
3
|
import { mutationResultSchema, parentSchema, positionSchema } from "../schemas.js";
|
|
4
4
|
import { resolvePosition } from "../helpers.js";
|
|
5
5
|
import { requireBundlePermission } from "../../helpers/validation.js";
|
|
6
|
-
const paramsSchema = z.object({
|
|
6
|
+
export const paramsSchema = z.object({
|
|
7
7
|
mediaId: z.string().describe("Media item ID from search_media results"),
|
|
8
8
|
mediaBundle: z.string().describe('Media bundle type (e.g., "image")'),
|
|
9
9
|
targetBundle: z.string().describe(
|
|
@@ -12,6 +12,7 @@ const paramsSchema = z.object({
|
|
|
12
12
|
parent: parentSchema.describe("The parent entity to add the paragraph to"),
|
|
13
13
|
position: positionSchema
|
|
14
14
|
});
|
|
15
|
+
export const resultSchema = mutationResultSchema;
|
|
15
16
|
export default defineBlokkliAgentTool({
|
|
16
17
|
name: "add_media_paragraph",
|
|
17
18
|
description: "Add a paragraph using a media item from the library. Use search_media first to find media items, then use this tool to add one to the page.",
|
|
@@ -25,7 +26,7 @@ export default defineBlokkliAgentTool({
|
|
|
25
26
|
});
|
|
26
27
|
},
|
|
27
28
|
paramsSchema,
|
|
28
|
-
resultSchema
|
|
29
|
+
resultSchema,
|
|
29
30
|
requiredAdapterMethods: ["mediaLibraryAddBlock"],
|
|
30
31
|
execute(ctx, params) {
|
|
31
32
|
const denied = requireBundlePermission(
|
|
@@ -1,2 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
type OptionValue = string | boolean | number | string[];
|
|
3
|
+
type BlockInput = {
|
|
4
|
+
bundle: string;
|
|
5
|
+
contentFields?: Record<string, string | {
|
|
6
|
+
entityType: string;
|
|
7
|
+
entityId: string;
|
|
8
|
+
}>;
|
|
9
|
+
options?: Record<string, OptionValue>;
|
|
10
|
+
children?: Record<string, BlockInput[]>;
|
|
11
|
+
};
|
|
12
|
+
export declare const paramsSchema: z.ZodObject<{
|
|
13
|
+
paragraphs: z.ZodArray<z.ZodType<BlockInput, unknown, z.core.$ZodTypeInternals<BlockInput, unknown>>>;
|
|
14
|
+
parent: z.ZodObject<{
|
|
15
|
+
type: z.ZodString;
|
|
16
|
+
uuid: z.ZodString;
|
|
17
|
+
field: z.ZodString;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
position: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
export declare const resultSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
22
|
+
type: z.ZodEnum<{
|
|
23
|
+
rewrite: "rewrite";
|
|
24
|
+
delete: "delete";
|
|
25
|
+
add: "add";
|
|
26
|
+
move: "move";
|
|
27
|
+
options: "options";
|
|
28
|
+
}>;
|
|
29
|
+
label: z.ZodString;
|
|
30
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
31
|
+
error: z.ZodString;
|
|
32
|
+
}, z.core.$strip>]>;
|
|
1
33
|
declare const _default: any;
|
|
2
34
|
export default _default;
|