@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
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<DialogModal
|
|
3
|
+
id="help"
|
|
4
|
+
:title="$t('featureHelpTitle', 'Help')"
|
|
5
|
+
hide-buttons
|
|
6
|
+
icon="bk_mdi_help"
|
|
7
|
+
mono
|
|
8
|
+
@cancel="$emit('cancel')"
|
|
9
|
+
>
|
|
10
|
+
<div class="bk bk-help">
|
|
11
|
+
<div v-if="isTourEnabled" class="bk-help-section">
|
|
12
|
+
<button
|
|
13
|
+
class="bk-button bk-scheme-yellow bk-is-fullwidth"
|
|
14
|
+
:disabled="tour.isTouring.value"
|
|
15
|
+
@click="onStartTour"
|
|
16
|
+
>
|
|
17
|
+
{{ $t("tourLabel", "Take a tour") }}
|
|
18
|
+
</button>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="bk-help-section">
|
|
21
|
+
<h3>{{ $t("featureHelpShortcuts", "Shortcuts") }}</h3>
|
|
22
|
+
<Shortcuts />
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</DialogModal>
|
|
26
|
+
</template>
|
|
27
|
+
|
|
28
|
+
<script setup>
|
|
29
|
+
import { useBlokkli, computed, defineAsyncComponent } from "#imports";
|
|
30
|
+
import { DialogModal } from "#blokkli/editor/components";
|
|
31
|
+
const Shortcuts = defineAsyncComponent(() => import("../Shortcuts/index.vue"));
|
|
32
|
+
const { $t, features, tour } = useBlokkli();
|
|
33
|
+
const emit = defineEmits(["cancel"]);
|
|
34
|
+
const isTourEnabled = computed(
|
|
35
|
+
() => features.mountedFeatures.value.find((v) => v.id === "tour")
|
|
36
|
+
);
|
|
37
|
+
function onStartTour() {
|
|
38
|
+
tour.isTouring.value = true;
|
|
39
|
+
emit("cancel");
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
|
|
44
|
+
.bk.bk-help {
|
|
45
|
+
padding: 20px;
|
|
46
|
+
container-type: inline-size;
|
|
47
|
+
}
|
|
48
|
+
:is(.bk.bk-help .bk-help-section):not(:last-child) {
|
|
49
|
+
margin-bottom: 20px;
|
|
50
|
+
}
|
|
51
|
+
:is(.bk.bk-help .bk-help-section) > h3 {
|
|
52
|
+
font-size: var(--text-lg, 18px);
|
|
53
|
+
line-height: var(--bk-tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));
|
|
54
|
+
--bk-tw-font-weight: var(--font-weight-bold, 700);
|
|
55
|
+
font-weight: var(--font-weight-bold, 700);
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
+
cancel: () => any;
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
onCancel?: (() => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -1,28 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
weight="100"
|
|
8
|
-
key-code="F1"
|
|
9
|
-
>
|
|
10
|
-
<div class="bk bk-help">
|
|
11
|
-
<div v-if="isTourEnabled" class="bk-help-section">
|
|
12
|
-
<button
|
|
13
|
-
class="bk-button bk-scheme-yellow bk-is-fullwidth"
|
|
14
|
-
:disabled="tour.isTouring.value"
|
|
15
|
-
@click="tour.isTouring.value = true"
|
|
16
|
-
>
|
|
17
|
-
{{ $t("tourLabel", "Take a tour") }}
|
|
18
|
-
</button>
|
|
19
|
-
</div>
|
|
20
|
-
<div class="bk-help-section">
|
|
21
|
-
<h3>{{ $t("featureHelpShortcuts", "Shortcuts") }}</h3>
|
|
22
|
-
<Shortcuts />
|
|
23
|
-
</div>
|
|
24
|
-
</div>
|
|
25
|
-
</PluginSidebar>
|
|
2
|
+
<Teleport :to="ui.mainLayoutElement.value">
|
|
3
|
+
<BlokkliTransition name="slide-up">
|
|
4
|
+
<HelpDialog v-if="showDialog" @cancel="onClose" />
|
|
5
|
+
</BlokkliTransition>
|
|
6
|
+
</Teleport>
|
|
26
7
|
</template>
|
|
27
8
|
|
|
28
9
|
<script setup>
|
|
@@ -32,19 +13,59 @@ import {
|
|
|
32
13
|
computed,
|
|
33
14
|
defineAsyncComponent
|
|
34
15
|
} from "#imports";
|
|
35
|
-
import {
|
|
36
|
-
|
|
16
|
+
import { BlokkliTransition } from "#blokkli/editor/components";
|
|
17
|
+
import {
|
|
18
|
+
defineMenuButton,
|
|
19
|
+
defineShortcut,
|
|
20
|
+
onBlokkliEvent
|
|
21
|
+
} from "#blokkli/editor/composables";
|
|
22
|
+
const HelpDialog = defineAsyncComponent(() => import("./Dialog/index.vue"));
|
|
37
23
|
defineBlokkliFeature({
|
|
38
24
|
id: "help",
|
|
39
25
|
icon: "bk_mdi_help",
|
|
40
26
|
label: "Help",
|
|
41
|
-
description: "Provides a
|
|
27
|
+
description: "Provides a menu button to display a dialog with shortcuts and a link to the editor tour.",
|
|
42
28
|
viewports: ["desktop"]
|
|
43
29
|
});
|
|
44
|
-
const { $t,
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
);
|
|
30
|
+
const { $t, ui } = useBlokkli();
|
|
31
|
+
const showDialog = computed(() => ui.currentDialog.value?.id === "help");
|
|
32
|
+
function onOpen() {
|
|
33
|
+
ui.openDialog({ id: "help", alignment: "center" });
|
|
34
|
+
}
|
|
35
|
+
function onClose() {
|
|
36
|
+
ui.closeDialog("help");
|
|
37
|
+
}
|
|
38
|
+
defineMenuButton(() => {
|
|
39
|
+
return {
|
|
40
|
+
id: "help",
|
|
41
|
+
title: $t("featureHelpTitle", "Help"),
|
|
42
|
+
description: $t("helpMenuDescription", "View available keyboard shortcuts"),
|
|
43
|
+
icon: "bk_mdi_help",
|
|
44
|
+
secondary: true,
|
|
45
|
+
callback: onOpen
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
defineShortcut({
|
|
49
|
+
code: "F1",
|
|
50
|
+
label: $t("featureHelpTitle", "Help")
|
|
51
|
+
});
|
|
52
|
+
onBlokkliEvent("keyPressed", (e) => {
|
|
53
|
+
if (e.code !== "F1") {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (ui.hasNestedEditorOpen.value) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (ui.hasDialogOpen.value && !showDialog.value) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
e.originalEvent.preventDefault();
|
|
63
|
+
if (showDialog.value) {
|
|
64
|
+
onClose();
|
|
65
|
+
} else {
|
|
66
|
+
onOpen();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
48
69
|
</script>
|
|
49
70
|
|
|
50
71
|
<script>
|
|
@@ -52,19 +73,3 @@ export default {
|
|
|
52
73
|
name: "Help"
|
|
53
74
|
};
|
|
54
75
|
</script>
|
|
55
|
-
|
|
56
|
-
<style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
|
|
57
|
-
.bk.bk-help {
|
|
58
|
-
padding: 20px;
|
|
59
|
-
container-type: inline-size;
|
|
60
|
-
}
|
|
61
|
-
:is(.bk.bk-help .bk-help-section):not(:last-child) {
|
|
62
|
-
margin-bottom: 20px;
|
|
63
|
-
}
|
|
64
|
-
:is(.bk.bk-help .bk-help-section) > h3 {
|
|
65
|
-
font-size: var(--text-lg, 18px);
|
|
66
|
-
line-height: var(--bk-tw-leading, var(--text-lg--line-height, calc(1.75 / 1.125)));
|
|
67
|
-
--bk-tw-font-weight: var(--font-weight-bold, 700);
|
|
68
|
-
font-weight: var(--font-weight-bold, 700);
|
|
69
|
-
}
|
|
70
|
-
</style>
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="bk bk-history bk-control"
|
|
2
|
+
<div class="bk bk-history bk-control">
|
|
3
3
|
<ul v-if="mapped.length">
|
|
4
4
|
<li
|
|
5
5
|
v-for="item in mapped"
|
|
6
6
|
:key="item.index"
|
|
7
|
-
data-test="history-item"
|
|
8
|
-
:data-test-history-index="item.index"
|
|
9
|
-
:data-test-history-active="item.index === currentMutationIndex"
|
|
10
7
|
:class="{
|
|
11
8
|
'bk-is-not-active': item.index > currentMutationIndex,
|
|
12
9
|
'bk-is-active': item.index === currentMutationIndex,
|
|
@@ -17,7 +14,6 @@
|
|
|
17
14
|
<button
|
|
18
15
|
:disabled="!canEdit"
|
|
19
16
|
class="bk-history-item-button"
|
|
20
|
-
data-test="history-item-button"
|
|
21
17
|
@click="setHistoryIndex(item.index)"
|
|
22
18
|
>
|
|
23
19
|
<div>
|
|
@@ -55,8 +51,6 @@
|
|
|
55
51
|
</li>
|
|
56
52
|
<li
|
|
57
53
|
class="bk-is-last"
|
|
58
|
-
data-test="history-current-revision"
|
|
59
|
-
:data-test-history-active="currentMutationIndex === -1"
|
|
60
54
|
:class="[
|
|
61
55
|
currentMutationIndex === -1 ? 'bk-is-active' : 'bk-is-applied',
|
|
62
56
|
{ 'bk-has-shadow': !scrolledToEnd }
|
|
@@ -64,7 +58,6 @@
|
|
|
64
58
|
>
|
|
65
59
|
<button
|
|
66
60
|
class="bk-history-item-button"
|
|
67
|
-
data-test="history-item-button"
|
|
68
61
|
@click="setHistoryIndex(-1)"
|
|
69
62
|
>
|
|
70
63
|
<div>
|
|
@@ -83,7 +76,7 @@
|
|
|
83
76
|
</button>
|
|
84
77
|
</li>
|
|
85
78
|
</ul>
|
|
86
|
-
<div v-else class="bk-history-empty-message"
|
|
79
|
+
<div v-else class="bk-history-empty-message">
|
|
87
80
|
{{ $t("historyEmpty", "There are now changes yet.") }}
|
|
88
81
|
</div>
|
|
89
82
|
</div>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BlokkliNotification } from '../types.js';
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<BlokkliNotification, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlokkliNotification> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<li class="_bk_border-b _bk_border-b-mono-300">
|
|
3
|
+
<component
|
|
4
|
+
:is="href ? 'a' : 'div'"
|
|
5
|
+
:href="href || void 0"
|
|
6
|
+
:target="href ? '_blank' : void 0"
|
|
7
|
+
:rel="href ? 'noopener' : void 0"
|
|
8
|
+
class="bk-notification-item _bk_px-10 _bk_py-15 _bk_hover:border-mono-300 _bk_flex _bk_gap-8 _bk_group"
|
|
9
|
+
:class="{
|
|
10
|
+
'_bk_hover:bg-mono-100': href
|
|
11
|
+
}"
|
|
12
|
+
>
|
|
13
|
+
<div
|
|
14
|
+
class="_bk_shrink-0 _bk_size-25 _bk_rounded-full _bk_flex _bk_items-center _bk_justify-center"
|
|
15
|
+
:class="{
|
|
16
|
+
'_bk_bg-mono-200 _bk_text-mono-500': read,
|
|
17
|
+
'_bk_text-yellow-dark! _bk_bg-yellow-normal': !read
|
|
18
|
+
}"
|
|
19
|
+
>
|
|
20
|
+
<Icon :name="icon" class="_bk_size-15" />
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="_bk_min-w-0 _bk_flex-1">
|
|
24
|
+
<div class="_bk_text-sm _bk_text-mono-900 _bk_font-semibold _bk_leading-tight">
|
|
25
|
+
{{ title }}
|
|
26
|
+
</div>
|
|
27
|
+
<div class="_bk_text-xs _bk_text-mono-600 _bk_flex _bk_items-center _bk_gap-5 _bk_min-w-0 _bk_mt-3">
|
|
28
|
+
<div class="_bk_shrink-0 _bk_font-semibold">
|
|
29
|
+
<RelativeTime :timestamp="created" />
|
|
30
|
+
</div>
|
|
31
|
+
<template v-if="host">
|
|
32
|
+
<span class="_bk_truncate">{{ host.label }}</span>
|
|
33
|
+
</template>
|
|
34
|
+
</div>
|
|
35
|
+
<div v-if="message" class="_bk_text-sm _bk_mt-10">
|
|
36
|
+
{{ message }}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</component>
|
|
40
|
+
</li>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup>
|
|
44
|
+
import { computed } from "#imports";
|
|
45
|
+
import { Icon, RelativeTime } from "#blokkli/editor/components";
|
|
46
|
+
const props = defineProps({
|
|
47
|
+
uuid: { type: String, required: true },
|
|
48
|
+
read: { type: Boolean, required: true },
|
|
49
|
+
created: { type: String, required: true },
|
|
50
|
+
type: { type: null, required: true },
|
|
51
|
+
title: { type: String, required: true },
|
|
52
|
+
message: { type: String, required: false },
|
|
53
|
+
user: { type: [Object, null], required: false },
|
|
54
|
+
relatedEntityUuid: { type: String, required: false },
|
|
55
|
+
host: { type: [Object, null], required: true }
|
|
56
|
+
});
|
|
57
|
+
const ICONS = {
|
|
58
|
+
"comment:mention": "bk_mdi_alternate_email",
|
|
59
|
+
"comment:resolved": "bk_mdi_check_circle",
|
|
60
|
+
"comment:reply": "bk_mdi_chat",
|
|
61
|
+
"comment:thread": "bk_mdi_chat",
|
|
62
|
+
"edit-state:approved": "bk_mdi_verified",
|
|
63
|
+
generic: "bk_mdi_notifications"
|
|
64
|
+
};
|
|
65
|
+
const icon = computed(() => ICONS[props.type]);
|
|
66
|
+
function extraQuery() {
|
|
67
|
+
if (!props.relatedEntityUuid) {
|
|
68
|
+
return {};
|
|
69
|
+
}
|
|
70
|
+
switch (props.type) {
|
|
71
|
+
case "comment:mention":
|
|
72
|
+
case "comment:reply":
|
|
73
|
+
case "comment:resolved":
|
|
74
|
+
case "comment:thread":
|
|
75
|
+
return { blokkliComment: props.relatedEntityUuid };
|
|
76
|
+
}
|
|
77
|
+
return {};
|
|
78
|
+
}
|
|
79
|
+
const href = computed(() => {
|
|
80
|
+
if (!props.host) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
const url = new URL(props.host.url, window.location.origin);
|
|
84
|
+
url.searchParams.set("blokkliEditing", props.host.uuid);
|
|
85
|
+
for (const [key, value] of Object.entries(extraQuery())) {
|
|
86
|
+
url.searchParams.set(key, value);
|
|
87
|
+
}
|
|
88
|
+
return url.origin === window.location.origin ? url.pathname + url.search + url.hash : url.toString();
|
|
89
|
+
});
|
|
90
|
+
</script>
|
|
91
|
+
|
|
92
|
+
<script>
|
|
93
|
+
export default {
|
|
94
|
+
name: "NotificationItem"
|
|
95
|
+
};
|
|
96
|
+
</script>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BlokkliNotification } from '../types.js';
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<BlokkliNotification, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BlokkliNotification> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
|
+
unreadCount: number | null;
|
|
5
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:unreadCount": (value: number | null) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
8
|
+
unreadCount: number | null;
|
|
9
|
+
}> & Readonly<{
|
|
10
|
+
"onUpdate:unreadCount"?: ((value: number | null) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ScrollBoundary
|
|
3
|
+
class="_bk_w-[400px] _bk_overflow-auto bk-scrollbar-light _bk_max-h-[600px]"
|
|
4
|
+
>
|
|
5
|
+
<TransitionHeight>
|
|
6
|
+
<div
|
|
7
|
+
v-if="unreadCount"
|
|
8
|
+
class="_bk_flex _bk_items-center _bk_justify-end _bk_px-15 _bk_py-10 _bk_border-b _bk_border-b-mono-300"
|
|
9
|
+
>
|
|
10
|
+
<button
|
|
11
|
+
class="bk-notifications-mark-all _bk_flex _bk_items-center _bk_gap-5 _bk_text-sm _bk_text-mono-700 _bk_hover:text-accent-700"
|
|
12
|
+
@click.stop="onMarkAllRead"
|
|
13
|
+
>
|
|
14
|
+
<Icon name="bk_mdi_done_all" class="_bk_size-15" />
|
|
15
|
+
<span>{{ $t("notificationsMarkAllRead", "Mark all as read") }}</span>
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
</TransitionHeight>
|
|
19
|
+
|
|
20
|
+
<ul v-if="notifications.length" class="_bk_select-text">
|
|
21
|
+
<NotificationItem
|
|
22
|
+
v-for="notification in notifications"
|
|
23
|
+
:key="notification.uuid"
|
|
24
|
+
v-bind="notification"
|
|
25
|
+
/>
|
|
26
|
+
</ul>
|
|
27
|
+
<div
|
|
28
|
+
v-else
|
|
29
|
+
class="_bk_flex-1 _bk_flex _bk_items-center _bk_justify-center _bk_p-30 _bk_text-center _bk_text-sm _bk_text-mono-500"
|
|
30
|
+
>
|
|
31
|
+
{{ $t("notificationsEmpty", "No notifications.") }}
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div
|
|
35
|
+
v-if="hasMore"
|
|
36
|
+
class="_bk_sticky _bk_bottom-0 _bk_z-50 _bk_bg-linear-0 _bk_from-white _bk_to-white/0 _bk_via-65% _bk_via-white"
|
|
37
|
+
>
|
|
38
|
+
<button
|
|
39
|
+
class="_bk_w-full _bk_py-15 _bk_text-sm _bk_text-mono-700 _bk_hover:text-accent-700 _bk_disabled:opacity-40 _bk_disabled:cursor-default _bk_text-center _bk_font-semibold"
|
|
40
|
+
:disabled="isLoadingMore"
|
|
41
|
+
@click.stop="onLoadMore"
|
|
42
|
+
>
|
|
43
|
+
{{ $t("notificationsLoadMore", "Load more") }}
|
|
44
|
+
</button>
|
|
45
|
+
</div>
|
|
46
|
+
</ScrollBoundary>
|
|
47
|
+
</template>
|
|
48
|
+
|
|
49
|
+
<script setup>
|
|
50
|
+
import { computed, ref, useBlokkli } from "#imports";
|
|
51
|
+
import {
|
|
52
|
+
Icon,
|
|
53
|
+
ScrollBoundary,
|
|
54
|
+
TransitionHeight
|
|
55
|
+
} from "#blokkli/editor/components";
|
|
56
|
+
import { emitMessage } from "#blokkli/editor/events";
|
|
57
|
+
import NotificationItem from "../Item/index.vue";
|
|
58
|
+
const { $t, adapter } = useBlokkli();
|
|
59
|
+
const unreadCount = defineModel("unreadCount", { type: [Number, null], ...{
|
|
60
|
+
required: true
|
|
61
|
+
} });
|
|
62
|
+
const notifications = ref([]);
|
|
63
|
+
const nextCursor = ref(null);
|
|
64
|
+
const isLoadingMore = ref(false);
|
|
65
|
+
const hasMore = computed(() => nextCursor.value !== null);
|
|
66
|
+
const reportError = (additional) => emitMessage(
|
|
67
|
+
$t("notificationsLoadError", "Failed to load notifications."),
|
|
68
|
+
"error",
|
|
69
|
+
additional
|
|
70
|
+
);
|
|
71
|
+
try {
|
|
72
|
+
const initial = await adapter.loadNotifications({ markAsRead: true });
|
|
73
|
+
notifications.value = initial.items;
|
|
74
|
+
nextCursor.value = initial.nextCursor;
|
|
75
|
+
unreadCount.value = initial.unreadCount;
|
|
76
|
+
} catch (err) {
|
|
77
|
+
reportError(err);
|
|
78
|
+
}
|
|
79
|
+
const onLoadMore = async () => {
|
|
80
|
+
if (isLoadingMore.value || !hasMore.value) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
isLoadingMore.value = true;
|
|
84
|
+
try {
|
|
85
|
+
const next = await adapter.loadNotifications({
|
|
86
|
+
after: nextCursor.value ?? void 0,
|
|
87
|
+
markAsRead: true
|
|
88
|
+
});
|
|
89
|
+
const seen = new Set(notifications.value.map((n) => n.uuid));
|
|
90
|
+
notifications.value = [
|
|
91
|
+
...notifications.value,
|
|
92
|
+
...next.items.filter((n) => !seen.has(n.uuid))
|
|
93
|
+
];
|
|
94
|
+
nextCursor.value = next.nextCursor;
|
|
95
|
+
unreadCount.value = next.unreadCount;
|
|
96
|
+
} catch (err) {
|
|
97
|
+
reportError(err);
|
|
98
|
+
} finally {
|
|
99
|
+
isLoadingMore.value = false;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const onMarkAllRead = async () => {
|
|
103
|
+
try {
|
|
104
|
+
unreadCount.value = await adapter.markAllNotificationsAsRead();
|
|
105
|
+
notifications.value = notifications.value.map((n) => ({
|
|
106
|
+
...n,
|
|
107
|
+
read: true
|
|
108
|
+
}));
|
|
109
|
+
} catch (err) {
|
|
110
|
+
emitMessage(
|
|
111
|
+
$t(
|
|
112
|
+
"notificationsMarkAllReadError",
|
|
113
|
+
"Failed to mark notifications as read."
|
|
114
|
+
),
|
|
115
|
+
"error",
|
|
116
|
+
err
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
</script>
|
|
121
|
+
|
|
122
|
+
<script>
|
|
123
|
+
export default {
|
|
124
|
+
name: "NotificationsList"
|
|
125
|
+
};
|
|
126
|
+
</script>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{
|
|
4
|
+
unreadCount: number | null;
|
|
5
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
+
"update:unreadCount": (value: number | null) => any;
|
|
7
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
8
|
+
unreadCount: number | null;
|
|
9
|
+
}> & Readonly<{
|
|
10
|
+
"onUpdate:unreadCount"?: ((value: number | null) => any) | undefined;
|
|
11
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Sidebar
|
|
2
|
+
|
|
3
|
+
The sidebar pane lists the current user's notifications (mentions, resolved
|
|
4
|
+
comments, edit state events). The toolbar tab shows a badge with the number of
|
|
5
|
+
unread notifications.
|
|
6
|
+
|
|
7
|
+
## Deep linking
|
|
8
|
+
|
|
9
|
+
Each notification links to its host entity in edit mode. The feature builds the
|
|
10
|
+
URL from the host entity URL plus `?blokkliEditing=<uuid>` and any type-specific
|
|
11
|
+
query parameter (e.g. `blokkliComment=<uuid>` for comment notifications). Links
|
|
12
|
+
open in a new tab.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<PluginToolbarButton
|
|
3
|
+
id="notifications"
|
|
4
|
+
ref="toolbarButton"
|
|
5
|
+
:title="$t('notifications', 'Notifications')"
|
|
6
|
+
:tour-text="
|
|
7
|
+
$t(
|
|
8
|
+
'notificationsTourText',
|
|
9
|
+
'Shows notifications about mentions, resolved comments and other events.'
|
|
10
|
+
)
|
|
11
|
+
"
|
|
12
|
+
:active="isVisible"
|
|
13
|
+
:disabled="unreadCount === null"
|
|
14
|
+
:weight="-100"
|
|
15
|
+
region="before-sidebar"
|
|
16
|
+
icon="bk_mdi_notifications"
|
|
17
|
+
class="_bk_border-r _bk_border-r-mono-600 bk-has-dropdown-bottom"
|
|
18
|
+
@click="isVisible = !isVisible"
|
|
19
|
+
>
|
|
20
|
+
<template #after>
|
|
21
|
+
<BlokkliTransition name="context-menu">
|
|
22
|
+
<ToolbarDropdown
|
|
23
|
+
v-if="isVisible"
|
|
24
|
+
:toggle-element
|
|
25
|
+
class="_bk_origin-top-right"
|
|
26
|
+
:title="$t('notifications', 'Notifications')"
|
|
27
|
+
@close="isVisible = false"
|
|
28
|
+
>
|
|
29
|
+
<NotificationsList v-model:unread-count="unreadCount" />
|
|
30
|
+
</ToolbarDropdown>
|
|
31
|
+
</BlokkliTransition>
|
|
32
|
+
</template>
|
|
33
|
+
<template #icon-addon>
|
|
34
|
+
<div
|
|
35
|
+
v-if="unreadCount"
|
|
36
|
+
class="bk-sidebar-badge bk-is-yellow"
|
|
37
|
+
>
|
|
38
|
+
{{ unreadCount }}
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
</PluginToolbarButton>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script setup>
|
|
45
|
+
import {
|
|
46
|
+
ref,
|
|
47
|
+
computed,
|
|
48
|
+
useBlokkli,
|
|
49
|
+
defineBlokkliFeature,
|
|
50
|
+
useTemplateRef,
|
|
51
|
+
onMounted,
|
|
52
|
+
onUnmounted
|
|
53
|
+
} from "#imports";
|
|
54
|
+
import { PluginToolbarButton } from "#blokkli/editor/plugins";
|
|
55
|
+
import { ToolbarDropdown, BlokkliTransition } from "#blokkli/editor/components";
|
|
56
|
+
import NotificationsList from "./List/index.vue";
|
|
57
|
+
const { adapter } = defineBlokkliFeature({
|
|
58
|
+
id: "notifications",
|
|
59
|
+
icon: "bk_mdi_notifications",
|
|
60
|
+
label: "Notifications",
|
|
61
|
+
requiredAdapterMethods: [
|
|
62
|
+
"loadNotifications",
|
|
63
|
+
"loadUnreadNotificationsCount",
|
|
64
|
+
"markAllNotificationsAsRead"
|
|
65
|
+
],
|
|
66
|
+
description: "Shows notifications for the current user (mentions, resolved comments, edit state events)."
|
|
67
|
+
});
|
|
68
|
+
const { $t, ui } = useBlokkli();
|
|
69
|
+
const ID = "notifications";
|
|
70
|
+
const isVisible = computed({
|
|
71
|
+
get() {
|
|
72
|
+
return ui.openContextMenu.value === ID;
|
|
73
|
+
},
|
|
74
|
+
set(isOpen) {
|
|
75
|
+
if (isOpen) {
|
|
76
|
+
ui.openContextMenu.value = ID;
|
|
77
|
+
} else {
|
|
78
|
+
ui.openContextMenu.value = "";
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
const toolbarButton = useTemplateRef("toolbarButton");
|
|
83
|
+
const toggleElement = computed(
|
|
84
|
+
() => toolbarButton.value?.el ?? null
|
|
85
|
+
);
|
|
86
|
+
const unreadCount = ref(null);
|
|
87
|
+
const POLL_INTERVAL_MS = 6e4;
|
|
88
|
+
let lastFetchAt = 0;
|
|
89
|
+
const fetchUnreadCount = async () => {
|
|
90
|
+
try {
|
|
91
|
+
unreadCount.value = await adapter.loadUnreadNotificationsCount();
|
|
92
|
+
lastFetchAt = Date.now();
|
|
93
|
+
} catch {
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const maybeRefresh = () => {
|
|
97
|
+
if (isVisible.value || document.hidden) {
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (Date.now() - lastFetchAt < POLL_INTERVAL_MS) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
fetchUnreadCount();
|
|
104
|
+
};
|
|
105
|
+
let pollInterval = null;
|
|
106
|
+
onMounted(async () => {
|
|
107
|
+
await fetchUnreadCount();
|
|
108
|
+
pollInterval = setInterval(maybeRefresh, POLL_INTERVAL_MS);
|
|
109
|
+
document.addEventListener("visibilitychange", maybeRefresh);
|
|
110
|
+
});
|
|
111
|
+
onUnmounted(() => {
|
|
112
|
+
if (pollInterval) {
|
|
113
|
+
clearInterval(pollInterval);
|
|
114
|
+
}
|
|
115
|
+
document.removeEventListener("visibilitychange", maybeRefresh);
|
|
116
|
+
});
|
|
117
|
+
</script>
|
|
118
|
+
|
|
119
|
+
<script>
|
|
120
|
+
export default {
|
|
121
|
+
name: "Notifications"
|
|
122
|
+
};
|
|
123
|
+
</script>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|