@blokkli/editor 2.0.0-alpha.32 → 2.0.0-alpha.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global/constants/index.d.ts +1 -0
- package/dist/global/constants/index.js +1 -0
- package/dist/global/types/features.d.ts +4 -0
- package/dist/module.d.mts +5 -27
- package/dist/module.json +1 -1
- package/dist/module.mjs +430 -10823
- package/dist/modules/agent/index.d.mts +64 -0
- package/dist/modules/agent/index.mjs +407 -0
- package/dist/modules/agent/runtime/app/composables/agentProvider.d.ts +55 -0
- package/dist/modules/agent/runtime/app/composables/agentProvider.js +875 -0
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentPrompt.d.ts +32 -0
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentPrompt.js +6 -0
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.d.ts +65 -0
- package/dist/modules/agent/runtime/app/composables/defineBlokkliAgentTool.js +6 -0
- package/dist/modules/agent/runtime/app/composables/index.d.ts +4 -0
- package/dist/modules/agent/runtime/app/composables/index.js +2 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.d.vue.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.vue +62 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Attachment/index.vue.d.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.d.vue.ts +9 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue +38 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Assistant/index.vue.d.ts +9 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.d.vue.ts +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.vue +68 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Error/index.vue.d.ts +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.d.vue.ts +10 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.vue +72 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/ServerTool/index.vue.d.ts +10 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.d.vue.ts +13 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.vue +37 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Tool/index.vue.d.ts +13 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.d.vue.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.vue +17 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/Unknown/index.vue.d.ts +8 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.d.vue.ts +11 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue +29 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/User/index.vue.d.ts +11 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.d.vue.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.vue +30 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Item/index.vue.d.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.d.vue.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.vue +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/Thinking/index.vue.d.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.d.vue.ts +13 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.vue +46 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Conversation/index.vue.d.ts +13 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.d.vue.ts +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.vue +50 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ConversationList/index.vue.d.ts +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.d.vue.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue +160 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/DebugGallery/index.vue.d.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.d.vue.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.vue +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/DropdownItem/index.vue.d.ts +12 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.d.vue.ts +7 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.vue +67 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/TokenUsage/index.vue.d.ts +7 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.d.vue.ts +23 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +109 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue.d.ts +23 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.d.vue.ts +45 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue +120 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/index.vue.d.ts +45 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.d.vue.ts +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.vue +47 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/PendingMutation/index.vue.d.ts +15 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.d.vue.ts +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.vue +55 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Plan/index.vue.d.ts +14 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.d.vue.ts +25 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.vue +36 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/ToolCard/index.vue.d.ts +25 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/de.md +19 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/en.md +18 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.d.vue.ts +10 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +44 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue.d.ts +10 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.d.vue.ts +58 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue +274 -0
- package/dist/modules/agent/runtime/app/features/agent/Panel/index.vue.d.ts +58 -0
- package/dist/modules/agent/runtime/app/features/agent/index.d.vue.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue +162 -0
- package/dist/modules/agent/runtime/app/features/agent/index.vue.d.ts +3 -0
- package/dist/modules/agent/runtime/app/features/agent/types.d.ts +58 -0
- package/dist/modules/agent/runtime/app/features/agent/types.js +0 -0
- package/dist/modules/agent/runtime/app/helpers/index.d.ts +55 -0
- package/dist/modules/agent/runtime/app/helpers/index.js +88 -0
- package/dist/modules/agent/runtime/app/helpers/pageStructure.d.ts +5 -0
- package/dist/modules/agent/runtime/app/helpers/pageStructure.js +106 -0
- package/dist/modules/agent/runtime/app/helpers/validation.d.ts +35 -0
- package/dist/modules/agent/runtime/app/helpers/validation.js +77 -0
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraph/index.js +69 -0
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.js +83 -0
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.js +62 -0
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.js +289 -0
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.js +76 -0
- package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/add_template/index.js +58 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.d.vue.ts +19 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +113 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue.d.ts +19 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +17 -0
- package/dist/modules/agent/runtime/app/tools/ask_question/index.js +54 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.d.vue.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.vue +190 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Component.vue.d.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.d.vue.ts +20 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.vue +90 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/Item.vue.d.ts +20 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/index.d.ts +18 -0
- package/dist/modules/agent/runtime/app/tools/batch_rewrite_text/index.js +55 -0
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.js +47 -0
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.js +47 -0
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.js +144 -0
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.js +180 -0
- package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_all_fragments/index.js +33 -0
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_all_page_content/index.js +93 -0
- package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_available_bundles/index.js +104 -0
- package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_child_paragraphs/index.js +108 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.js +192 -0
- package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_mutation_history/index.js +102 -0
- package/dist/modules/agent/runtime/app/tools/get_page_structure/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_page_structure/index.js +113 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.js +275 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraph_options/index.js +63 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.js +180 -0
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/get_selected_paragraphs/index.js +46 -0
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.js +54 -0
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.js +69 -0
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.js +95 -0
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.js +80 -0
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.js +85 -0
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +128 -0
- package/dist/modules/agent/runtime/app/tools/schemas.js +242 -0
- package/dist/modules/agent/runtime/app/tools/search_content/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/search_content/index.js +65 -0
- package/dist/modules/agent/runtime/app/tools/search_media/index.d.ts +14 -0
- package/dist/modules/agent/runtime/app/tools/search_media/index.js +60 -0
- package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/search_reusable_paragraphs/index.js +75 -0
- package/dist/modules/agent/runtime/app/tools/search_templates/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/search_templates/index.js +51 -0
- package/dist/modules/agent/runtime/app/tools/search_text/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/search_text/index.js +114 -0
- package/dist/modules/agent/runtime/app/tools/select_media/Component.d.vue.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/select_media/Component.vue +70 -0
- package/dist/modules/agent/runtime/app/tools/select_media/Component.vue.d.ts +29 -0
- package/dist/modules/agent/runtime/app/tools/select_media/index.d.ts +30 -0
- package/dist/modules/agent/runtime/app/tools/select_media/index.js +74 -0
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.js +109 -0
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.js +74 -0
- package/dist/modules/agent/runtime/app/tools/web_fetch/index.d.ts +2 -0
- package/dist/modules/agent/runtime/app/tools/web_fetch/index.js +51 -0
- package/dist/modules/agent/runtime/app/types/index.d.ts +440 -0
- package/dist/modules/agent/runtime/app/types/index.js +51 -0
- package/dist/modules/agent/runtime/server/Session.d.ts +94 -0
- package/dist/modules/agent/runtime/server/Session.js +734 -0
- package/dist/modules/agent/runtime/server/SessionManager.d.ts +21 -0
- package/dist/modules/agent/runtime/server/SessionManager.js +80 -0
- package/dist/modules/agent/runtime/server/agent.d.ts +2 -0
- package/dist/modules/agent/runtime/server/agent.js +148 -0
- package/dist/modules/agent/runtime/server/agentPrompt.d.ts +22 -0
- package/dist/modules/agent/runtime/server/agentPrompt.js +53 -0
- package/dist/modules/agent/runtime/server/default-skills/adding-new-paragraphs.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/adding-new-paragraphs.js +21 -0
- package/dist/modules/agent/runtime/server/default-skills/pageReview.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/pageReview.js +28 -0
- package/dist/modules/agent/runtime/server/default-skills/reusable-paragraphs.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/reusable-paragraphs.js +21 -0
- package/dist/modules/agent/runtime/server/default-skills/rewriteAndTranslate.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-skills/rewriteAndTranslate.js +14 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/architecture.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/architecture.js +39 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/available-skills.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/available-skills.js +18 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/available-tools.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/available-tools.js +18 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/fragments.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/fragments.js +19 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +22 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/interaction.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/interaction.js +20 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/introduction.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/introduction.js +14 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/page-context.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/page-context.js +60 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/paragraph-bundles.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/paragraph-bundles.js +37 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/plan-mode.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/plan-mode.js +36 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/security.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/security.js +27 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/workflow.d.ts +2 -0
- package/dist/modules/agent/runtime/server/default-system-prompts/workflow.js +22 -0
- package/dist/modules/agent/runtime/server/fetch.d.ts +2 -0
- package/dist/modules/agent/runtime/server/fetch.js +127 -0
- package/dist/modules/agent/runtime/server/helpers.d.ts +77 -0
- package/dist/modules/agent/runtime/server/helpers.js +352 -0
- package/dist/modules/agent/runtime/server/providers/anthropic.d.ts +12 -0
- package/dist/modules/agent/runtime/server/providers/anthropic.js +128 -0
- package/dist/modules/agent/runtime/server/providers/openai.d.ts +12 -0
- package/dist/modules/agent/runtime/server/providers/openai.js +165 -0
- package/dist/modules/agent/runtime/server/providers/types.d.ts +74 -0
- package/dist/modules/agent/runtime/server/providers/types.js +0 -0
- package/dist/modules/agent/runtime/server/server-tools/complete_plan_step/index.d.ts +3 -0
- package/dist/modules/agent/runtime/server/server-tools/complete_plan_step/index.js +79 -0
- package/dist/modules/agent/runtime/server/server-tools/create_plan/index.d.ts +9 -0
- package/dist/modules/agent/runtime/server/server-tools/create_plan/index.js +86 -0
- package/dist/modules/agent/runtime/server/server-tools/index.d.ts +86 -0
- package/dist/modules/agent/runtime/server/server-tools/index.js +30 -0
- package/dist/modules/agent/runtime/server/server-tools/load_skill/index.d.ts +7 -0
- package/dist/modules/agent/runtime/server/server-tools/load_skill/index.js +58 -0
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.d.ts +7 -0
- package/dist/modules/agent/runtime/server/server-tools/load_tools/index.js +43 -0
- package/dist/modules/agent/runtime/server/skills/defineBlokkliAgentSkill.d.ts +23 -0
- package/dist/modules/agent/runtime/server/skills/defineBlokkliAgentSkill.js +3 -0
- package/dist/modules/agent/runtime/server/skills/index.d.ts +2 -0
- package/dist/modules/agent/runtime/server/skills/index.js +1 -0
- package/dist/modules/agent/runtime/server/skills/types.d.ts +45 -0
- package/dist/modules/agent/runtime/server/skills/types.js +0 -0
- package/dist/modules/agent/runtime/server/system-prompts/defineBlokkliAgentSystemPrompt.d.ts +21 -0
- package/dist/modules/agent/runtime/server/system-prompts/defineBlokkliAgentSystemPrompt.js +3 -0
- package/dist/modules/agent/runtime/server/system-prompts/helpers.d.ts +20 -0
- package/dist/modules/agent/runtime/server/system-prompts/helpers.js +41 -0
- package/dist/modules/agent/runtime/server/system-prompts/index.d.ts +2 -0
- package/dist/modules/agent/runtime/server/system-prompts/index.js +1 -0
- package/dist/modules/agent/runtime/server/system-prompts/types.d.ts +49 -0
- package/dist/modules/agent/runtime/server/system-prompts/types.js +0 -0
- package/dist/modules/agent/runtime/shared/placeholders.d.ts +4 -0
- package/dist/modules/agent/runtime/shared/placeholders.js +1 -0
- package/dist/modules/agent/runtime/shared/types.d.ts +426 -0
- package/dist/modules/agent/runtime/shared/types.js +147 -0
- package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +27 -2
- package/dist/modules/drupal/graphql/features/agent.graphql +69 -0
- package/dist/modules/drupal/graphql/features/search.graphql +5 -0
- package/dist/modules/drupal/graphql/features/templates.graphql +36 -2
- package/dist/modules/drupal/graphql/mutations/add_multiple.graphql +25 -0
- package/dist/modules/drupal/graphql/mutations/bulk_update_field_values.graphql +15 -0
- package/dist/modules/drupal/graphql/mutations/rearrange.graphql +23 -0
- package/dist/modules/drupal/graphql/mutations/replace_entity_reference.graphql +25 -0
- package/dist/modules/drupal/graphql/mutations/swap.graphql +16 -0
- package/dist/modules/drupal/index.d.mts +18 -2
- package/dist/modules/drupal/index.mjs +60 -12
- package/dist/modules/drupal/runtime/adapter/index.js +246 -21
- package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.d.vue.ts +9 -0
- package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.vue +26 -0
- package/dist/modules/drupal/runtime/components/BlokkliDrupalEditTemplate/index.vue.d.ts +9 -0
- package/dist/runtime/components/Blocks/Fragment/index.vue +11 -2
- package/dist/runtime/components/BlokkliItem.vue +3 -1
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +5 -3
- package/dist/runtime/composables/defineBlokkliFeature.js +2 -1
- package/dist/runtime/editor/adapter/index.d.ts +45 -4
- package/dist/runtime/editor/adapter/index.js +3 -0
- package/dist/runtime/editor/components/Actions/ItemDropdown.vue +6 -1
- package/dist/runtime/editor/components/Actions/index.vue +4 -1
- package/dist/runtime/editor/components/AddListItem/index.d.vue.ts +9 -1
- package/dist/runtime/editor/components/AddListItem/index.vue +36 -2
- package/dist/runtime/editor/components/AddListItem/index.vue.d.ts +9 -1
- package/dist/runtime/editor/components/AnimationCanvas/index.vue +17 -7
- package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +3 -1
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue +4 -3
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +3 -1
- package/dist/runtime/editor/components/AutoHeight/index.d.vue.ts +16 -0
- package/dist/runtime/editor/components/AutoHeight/index.vue +32 -0
- package/dist/runtime/editor/components/AutoHeight/index.vue.d.ts +16 -0
- package/dist/runtime/editor/components/BlockPreviewItem/index.d.vue.ts +5 -1
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue +10 -7
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue.d.ts +5 -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/Dialog/index.d.vue.ts +2 -2
- package/dist/runtime/editor/components/Dialog/index.vue.d.ts +2 -2
- package/dist/runtime/editor/components/DiffViewer/DiffValue.d.vue.ts +7 -0
- package/dist/runtime/editor/components/DiffViewer/DiffValue.vue +21 -0
- package/dist/runtime/editor/components/DiffViewer/DiffValue.vue.d.ts +7 -0
- package/dist/runtime/editor/components/DiffViewer/State.vue +4 -9
- package/dist/runtime/editor/components/EditProvider.vue +25 -4
- package/dist/runtime/editor/components/FeaturesRenderer/index.vue +26 -8
- package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +31 -0
- package/dist/runtime/editor/components/FlexTextarea/index.vue +179 -0
- package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +31 -0
- package/dist/runtime/editor/components/Form/Text/index.vue +23 -11
- package/dist/runtime/editor/components/Form/Toggle/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Toggle/index.vue +7 -3
- package/dist/runtime/editor/components/Form/Toggle/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/Icon/index.vue +3 -1
- package/dist/runtime/editor/components/Indicators/index.vue +20 -10
- package/dist/runtime/editor/components/ItemIcon/index.d.vue.ts +3 -0
- package/dist/runtime/editor/components/ItemIcon/index.vue +3 -2
- package/dist/runtime/editor/components/ItemIcon/index.vue.d.ts +3 -0
- package/dist/runtime/editor/components/ItemIconBox/index.vue +4 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +3 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +150 -71
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +3 -1
- package/dist/runtime/editor/components/PluginConfigForm/index.vue +6 -2
- package/dist/runtime/editor/components/RelativeTime/index.d.vue.ts +3 -2
- package/dist/runtime/editor/components/RelativeTime/index.vue +21 -7
- package/dist/runtime/editor/components/RelativeTime/index.vue.d.ts +3 -2
- package/dist/runtime/editor/components/StatusIcon/index.d.vue.ts +9 -0
- package/dist/runtime/editor/components/StatusIcon/index.vue +31 -0
- package/dist/runtime/editor/components/StatusIcon/index.vue.d.ts +9 -0
- package/dist/runtime/editor/components/SystemRequirements/index.vue +5 -1
- package/dist/runtime/editor/components/Transition/Height.vue +3 -2
- package/dist/runtime/editor/components/Transition/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Transition/index.vue +2 -1
- package/dist/runtime/editor/components/Transition/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/index.d.ts +10 -6
- package/dist/runtime/editor/components/index.js +19 -11
- package/dist/runtime/editor/composables/index.d.ts +2 -0
- package/dist/runtime/editor/composables/index.js +2 -0
- package/dist/runtime/editor/composables/onElementResize.d.ts +3 -0
- package/dist/runtime/editor/composables/onElementResize.js +37 -0
- package/dist/runtime/editor/composables/useEditableFieldOverride.d.ts +24 -0
- package/dist/runtime/editor/composables/useEditableFieldOverride.js +130 -0
- package/dist/runtime/editor/composables/useStickyToolbar.d.ts +4 -3
- package/dist/runtime/editor/composables/useStickyToolbar.js +26 -10
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/events/index.d.ts +31 -0
- package/dist/runtime/editor/features/add-list/Actions/Action.d.vue.ts +8 -1
- package/dist/runtime/editor/features/add-list/Actions/Action.vue +7 -1
- package/dist/runtime/editor/features/add-list/Actions/Action.vue.d.ts +8 -1
- package/dist/runtime/editor/features/add-list/Actions/index.d.vue.ts +11 -1
- package/dist/runtime/editor/features/add-list/Actions/index.vue +29 -8
- package/dist/runtime/editor/features/add-list/Actions/index.vue.d.ts +11 -1
- package/dist/runtime/editor/features/add-list/Blocks/index.d.vue.ts +11 -2
- package/dist/runtime/editor/features/add-list/Blocks/index.vue +27 -1
- package/dist/runtime/editor/features/add-list/Blocks/index.vue.d.ts +11 -2
- package/dist/runtime/editor/features/add-list/Help/Item.d.vue.ts +12 -0
- package/dist/runtime/editor/features/add-list/Help/Item.vue +186 -0
- package/dist/runtime/editor/features/add-list/Help/Item.vue.d.ts +12 -0
- package/dist/runtime/editor/features/add-list/Help/index.d.vue.ts +13 -0
- package/dist/runtime/editor/features/add-list/Help/index.vue +127 -0
- package/dist/runtime/editor/features/add-list/Help/index.vue.d.ts +13 -0
- package/dist/runtime/editor/features/add-list/docs.md +2 -2
- package/dist/runtime/editor/features/add-list/index.vue +108 -9
- package/dist/runtime/editor/features/add-list/types.d.ts +5 -0
- package/dist/runtime/editor/features/analyze/Main.vue +4 -1
- package/dist/runtime/editor/features/analyze/Summary/Chart.vue +9 -9
- package/dist/runtime/editor/features/analyze/index.vue +2 -14
- package/dist/runtime/editor/features/analyze/types.d.ts +4 -1
- package/dist/runtime/editor/features/artboard/Renderer.vue +43 -0
- package/dist/runtime/editor/features/assistant/docs.md +5 -5
- package/dist/runtime/editor/features/breadcrumbs/index.vue +4 -1
- package/dist/runtime/editor/features/clipboard/index.vue +6 -2
- package/dist/runtime/editor/features/comments/index.vue +1 -0
- package/dist/runtime/editor/features/comments/types.d.ts +6 -0
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.d.vue.ts +2 -1
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +32 -13
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue.d.ts +2 -1
- package/dist/runtime/editor/features/dragging-overlay/Renderer/fragment.glsl +77 -2
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.d.vue.ts +1 -0
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue +143 -52
- package/dist/runtime/editor/features/dragging-overlay/Renderer/index.vue.d.ts +1 -0
- package/dist/runtime/editor/features/dragging-overlay/Renderer/vertex.glsl +84 -31
- package/dist/runtime/editor/features/dragging-overlay/index.vue +3 -2
- package/dist/runtime/editor/features/edit/index.vue +7 -1
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue +13 -23
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +10 -102
- package/dist/runtime/editor/features/editable-field/types.d.ts +12 -2
- package/dist/runtime/editor/features/entity-title/index.vue +7 -7
- package/dist/runtime/editor/features/fragments/index.vue +1 -1
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue +8 -13
- package/dist/runtime/editor/features/library/ReusableDialog/index.vue +6 -1
- package/dist/runtime/editor/features/library/index.vue +14 -5
- package/dist/runtime/editor/features/library/types.d.ts +6 -0
- package/dist/runtime/editor/features/media-library/Library/Item.d.vue.ts +2 -2
- package/dist/runtime/editor/features/media-library/Library/Item.vue +17 -1
- package/dist/runtime/editor/features/media-library/Library/Item.vue.d.ts +2 -2
- package/dist/runtime/editor/features/media-library/Library/index.vue +6 -1
- package/dist/runtime/editor/features/media-library/index.vue +4 -4
- package/dist/runtime/editor/features/options/Form/index.vue +11 -43
- package/dist/runtime/editor/features/ownership/Banner/index.d.vue.ts +6 -3
- package/dist/runtime/editor/features/ownership/Banner/index.vue +10 -1
- package/dist/runtime/editor/features/ownership/Banner/index.vue.d.ts +6 -3
- package/dist/runtime/editor/features/ownership/index.vue +18 -6
- package/dist/runtime/editor/features/ownership/types.d.ts +5 -0
- package/dist/runtime/editor/features/publish/index.vue +5 -1
- package/dist/runtime/editor/features/search/Overlay/index.vue +5 -2
- package/dist/runtime/editor/features/search/index.vue +64 -3
- package/dist/runtime/editor/features/search/types.d.ts +16 -1
- package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -3
- package/dist/runtime/editor/features/selection/AddButtons/index.vue +24 -4
- package/dist/runtime/editor/features/selection/Renderer/index.vue +5 -1
- package/dist/runtime/editor/features/selection/index.vue +5 -1
- package/dist/runtime/editor/features/settings/Dialog/index.vue +3 -1
- package/dist/runtime/editor/features/settings/index.vue +4 -1
- package/dist/runtime/editor/features/templates/CreateDialog/index.vue +21 -2
- package/dist/runtime/editor/features/templates/Dialog/Item/index.d.vue.ts +1 -1
- package/dist/runtime/editor/features/templates/Dialog/Item/index.vue +3 -3
- package/dist/runtime/editor/features/templates/Dialog/Item/index.vue.d.ts +1 -1
- package/dist/runtime/editor/features/templates/Dialog/index.vue +21 -5
- package/dist/runtime/editor/features/templates/ManageDialog/Item.d.vue.ts +8 -0
- package/dist/runtime/editor/features/templates/ManageDialog/Item.vue +147 -0
- package/dist/runtime/editor/features/templates/ManageDialog/Item.vue.d.ts +8 -0
- package/dist/runtime/editor/features/templates/ManageDialog/index.vue +30 -107
- package/dist/runtime/editor/features/templates/index.vue +7 -5
- package/dist/runtime/editor/features/templates/types.d.ts +11 -2
- package/dist/runtime/editor/features/transform/Dialog/index.vue +6 -1
- package/dist/runtime/editor/features/transform/index.vue +25 -20
- package/dist/runtime/editor/features/transform/types.d.ts +6 -4
- package/dist/runtime/editor/features/validations/index.vue +6 -1
- package/dist/runtime/editor/helpers/date/index.d.ts +1 -0
- package/dist/runtime/editor/helpers/date/index.js +3 -0
- package/dist/runtime/editor/helpers/options/index.d.ts +20 -0
- package/dist/runtime/editor/helpers/options/index.js +60 -0
- package/dist/runtime/editor/helpers/webgl/index.d.ts +5 -1
- package/dist/runtime/editor/helpers/webgl/index.js +45 -13
- package/dist/runtime/editor/icons/svg/stars.svg +1 -0
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue +13 -10
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +3 -1
- package/dist/runtime/editor/plugins/Sidebar/index.vue +14 -2
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +3 -1
- package/dist/runtime/editor/providers/adapters.d.ts +33 -0
- package/dist/runtime/editor/providers/adapters.js +88 -0
- package/dist/runtime/editor/providers/animation.js +3 -0
- package/dist/runtime/editor/providers/definition.d.ts +7 -0
- package/dist/runtime/editor/providers/definition.js +6 -0
- package/dist/runtime/editor/providers/dom.d.ts +7 -0
- package/dist/runtime/editor/providers/dom.js +12 -0
- package/dist/runtime/editor/providers/permissions.d.ts +6 -0
- package/dist/runtime/editor/providers/permissions.js +9 -0
- package/dist/runtime/editor/providers/plugin.d.ts +1 -0
- package/dist/runtime/editor/providers/state.js +1 -0
- package/dist/runtime/editor/providers/texts.js +20 -6
- package/dist/runtime/editor/providers/types.d.ts +7 -0
- package/dist/runtime/editor/providers/types.js +4 -0
- package/dist/runtime/editor/providers/ui.d.ts +40 -0
- package/dist/runtime/editor/providers/ui.js +27 -1
- package/dist/runtime/editor/translations/de.json +2738 -0
- package/dist/runtime/editor/translations/fr.json +2738 -0
- package/dist/runtime/editor/translations/gsw_CH.json +2738 -0
- package/dist/runtime/editor/translations/it.json +2738 -0
- package/dist/runtime/editor/types/app.d.ts +9 -2
- package/dist/runtime/editor/types/definitions.d.ts +5 -0
- package/dist/runtime/editor/types/features.d.ts +3 -1
- package/dist/runtime/editor/types/permissions.d.ts +17 -0
- package/dist/runtime/editor/types/permissions.js +0 -0
- package/dist/runtime/types/index.d.ts +6 -0
- package/dist/shared/editor.CGf7C_0M.mjs +10 -0
- package/dist/shared/editor.DMFfaLVE.mjs +175 -0
- package/dist/shared/{editor.BKQCh70G.d.mts → editor.Iax3GCvt.d.mts} +94 -40
- package/dist/types.d.mts +8 -2
- package/package.json +29 -7
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
/>
|
|
39
39
|
</div>
|
|
40
40
|
|
|
41
|
-
<div class="bk
|
|
41
|
+
<div class="bk-artboard-tooltip-info">
|
|
42
42
|
<button :disabled="!hasChanged" @click.prevent="discard">
|
|
43
43
|
{{ $t("editableFieldDiscard", "Discard") }}
|
|
44
44
|
</button>
|
|
@@ -70,18 +70,12 @@ import { falsy } from "#blokkli/helpers";
|
|
|
70
70
|
import InputPlaintext from "./Plaintext/index.vue";
|
|
71
71
|
import InputContenteditable from "./Contenteditable/index.vue";
|
|
72
72
|
import InputFrame from "./Frame/index.vue";
|
|
73
|
-
import { FIELD_MAPPING } from "#blokkli-build/runtime-options";
|
|
74
73
|
import { itemEntityType } from "#blokkli-build/config";
|
|
75
|
-
import {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
$t,
|
|
81
|
-
types,
|
|
82
|
-
element: elementProvider,
|
|
83
|
-
definitions
|
|
84
|
-
} = useBlokkli();
|
|
74
|
+
import {
|
|
75
|
+
onBlokkliEvent,
|
|
76
|
+
useEditableFieldOverride
|
|
77
|
+
} from "#blokkli/editor/composables";
|
|
78
|
+
const { state, adapter, $t, types, element: elementProvider } = useBlokkli();
|
|
85
79
|
const props = defineProps({
|
|
86
80
|
fieldName: { type: String, required: true },
|
|
87
81
|
host: { type: Object, required: true },
|
|
@@ -94,10 +88,10 @@ const emit = defineEmits(["close"]);
|
|
|
94
88
|
const scrollHeight = ref(0);
|
|
95
89
|
const loaded = ref(false);
|
|
96
90
|
const originalText = ref("");
|
|
97
|
-
const originalMutatedProp = ref(void 0);
|
|
98
91
|
const modelValue = ref("");
|
|
99
92
|
const form = useTemplateRef("form");
|
|
100
93
|
const isClosing = ref(false);
|
|
94
|
+
const override = useEditableFieldOverride(props.fieldName, props.host);
|
|
101
95
|
const hasChanged = computed(
|
|
102
96
|
() => modelValue.value.trim() !== originalText.value.trim()
|
|
103
97
|
);
|
|
@@ -123,63 +117,8 @@ const errorText = computed(() => {
|
|
|
123
117
|
}
|
|
124
118
|
return void 0;
|
|
125
119
|
});
|
|
126
|
-
function findMatchingProp(mapping) {
|
|
127
|
-
return Object.entries(mapping).find(
|
|
128
|
-
([_prop, fieldName]) => fieldName === props.fieldName
|
|
129
|
-
)?.[0] ?? null;
|
|
130
|
-
}
|
|
131
|
-
const providerDefinition = computed(() => {
|
|
132
|
-
return definitions.getProviderDefinition(props.host.type, props.host.bundle);
|
|
133
|
-
});
|
|
134
|
-
const matchingProp = computed(() => {
|
|
135
|
-
if (props.host.type === itemEntityType) {
|
|
136
|
-
const mapping = FIELD_MAPPING[props.host.bundle];
|
|
137
|
-
if (mapping) {
|
|
138
|
-
return findMatchingProp(mapping);
|
|
139
|
-
}
|
|
140
|
-
} else {
|
|
141
|
-
if (providerDefinition.value) {
|
|
142
|
-
const mapping = providerDefinition.value.propsFieldMapping;
|
|
143
|
-
if (mapping) {
|
|
144
|
-
return findMatchingProp(mapping);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return null;
|
|
149
|
-
});
|
|
150
|
-
const mutatedItemPropsKey = computed(
|
|
151
|
-
() => providerDefinition.value ? "HOST" : props.host.uuid
|
|
152
|
-
);
|
|
153
|
-
const usesMutatedProps = computed(() => !!matchingProp.value);
|
|
154
|
-
const usesDirectDom = computed(() => !props.isComponent && !matchingProp.value);
|
|
155
120
|
function restoreOriginalState() {
|
|
156
|
-
|
|
157
|
-
const key = mutatedItemPropsKey.value;
|
|
158
|
-
if (originalMutatedProp.value === void 0) {
|
|
159
|
-
if (state.mutatedItemProps[key]) {
|
|
160
|
-
state.mutatedItemProps[key] = void 0;
|
|
161
|
-
}
|
|
162
|
-
} else {
|
|
163
|
-
if (state.mutatedItemProps[key]) {
|
|
164
|
-
state.mutatedItemProps[key][matchingProp.value] = originalMutatedProp.value;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
if (usesDirectDom.value) {
|
|
169
|
-
const el = props.element;
|
|
170
|
-
if (isMarkup.value) {
|
|
171
|
-
el.innerHTML = originalText.value;
|
|
172
|
-
} else {
|
|
173
|
-
el.textContent = originalText.value;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
if (props.isComponent) {
|
|
177
|
-
eventBus.emit("editable:update", {
|
|
178
|
-
name: props.fieldName,
|
|
179
|
-
entityUuid: props.host.uuid,
|
|
180
|
-
value: originalText.value
|
|
181
|
-
});
|
|
182
|
-
}
|
|
121
|
+
override.restore();
|
|
183
122
|
}
|
|
184
123
|
async function persistValue() {
|
|
185
124
|
if (props.host.type === itemEntityType) {
|
|
@@ -225,27 +164,7 @@ async function save() {
|
|
|
225
164
|
}
|
|
226
165
|
onBlokkliEvent("window:clickAway", save);
|
|
227
166
|
watch(modelValue, (newText) => {
|
|
228
|
-
|
|
229
|
-
if (!state.mutatedItemProps[mutatedItemPropsKey.value]) {
|
|
230
|
-
state.mutatedItemProps[mutatedItemPropsKey.value] = {};
|
|
231
|
-
}
|
|
232
|
-
state.mutatedItemProps[mutatedItemPropsKey.value][matchingProp.value] = newText;
|
|
233
|
-
}
|
|
234
|
-
if (usesDirectDom.value) {
|
|
235
|
-
const el = props.element;
|
|
236
|
-
if (props.config.type === "plain") {
|
|
237
|
-
el.textContent = newText;
|
|
238
|
-
} else {
|
|
239
|
-
el.innerHTML = newText;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if (props.isComponent) {
|
|
243
|
-
eventBus.emit("editable:update", {
|
|
244
|
-
name: props.fieldName,
|
|
245
|
-
entityUuid: props.host.uuid,
|
|
246
|
-
value: newText
|
|
247
|
-
});
|
|
248
|
-
}
|
|
167
|
+
override.setValue(newText);
|
|
249
168
|
});
|
|
250
169
|
const focusInput = (el) => {
|
|
251
170
|
if (!el) {
|
|
@@ -283,21 +202,10 @@ onMounted(() => {
|
|
|
283
202
|
const el = props.element;
|
|
284
203
|
if (props.isComponent) {
|
|
285
204
|
modelValue.value = props.value || "";
|
|
286
|
-
} else if (matchingProp.value) {
|
|
287
|
-
if (providerDefinition.value) {
|
|
288
|
-
modelValue.value = state.mutatedEntity.value[matchingProp.value] || "";
|
|
289
|
-
} else {
|
|
290
|
-
modelValue.value = state.getFieldListItem(props.host.uuid)?.props?.[matchingProp.value] ?? "";
|
|
291
|
-
}
|
|
292
|
-
} else if (isMarkup.value) {
|
|
293
|
-
modelValue.value = el.innerHTML;
|
|
294
205
|
} else {
|
|
295
|
-
modelValue.value =
|
|
206
|
+
modelValue.value = override.originalValue;
|
|
296
207
|
}
|
|
297
208
|
originalText.value = modelValue.value;
|
|
298
|
-
if (usesMutatedProps.value && matchingProp.value) {
|
|
299
|
-
originalMutatedProp.value = state.mutatedItemProps[mutatedItemPropsKey.value]?.[matchingProp.value];
|
|
300
|
-
}
|
|
301
209
|
nextTick(() => {
|
|
302
210
|
scrollHeight.value = el.scrollHeight;
|
|
303
211
|
loaded.value = true;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { EntityTypeRestriction } from '#blokkli/editor/types/definitions';
|
|
2
|
+
import type { UpdateEntityFieldValueEvent } from '#blokkli/editor/adapter';
|
|
1
3
|
export type EditableFieldType = 'plain' | 'markup' | 'table' | 'frame';
|
|
2
4
|
export type EditableFieldConfig = {
|
|
3
5
|
name: string;
|
|
@@ -9,12 +11,12 @@ export type EditableFieldConfig = {
|
|
|
9
11
|
maxLength: number;
|
|
10
12
|
};
|
|
11
13
|
export type DroppableFieldConfig = {
|
|
14
|
+
type: 'reference' | 'link';
|
|
12
15
|
name: string;
|
|
13
16
|
label: string;
|
|
14
17
|
entityType: string;
|
|
15
18
|
entityBundle: string;
|
|
16
|
-
|
|
17
|
-
allowedBundles: string[];
|
|
19
|
+
allowed: EntityTypeRestriction[];
|
|
18
20
|
cardinality: number;
|
|
19
21
|
required: boolean;
|
|
20
22
|
};
|
|
@@ -23,6 +25,10 @@ export type UpdateFieldValueEvent = {
|
|
|
23
25
|
fieldName: string;
|
|
24
26
|
fieldValue: string;
|
|
25
27
|
};
|
|
28
|
+
export type UpdateFieldValueBatchedEvent = {
|
|
29
|
+
items: UpdateFieldValueEvent[];
|
|
30
|
+
entityItems: UpdateEntityFieldValueEvent[];
|
|
31
|
+
};
|
|
26
32
|
type AdapterBuildEditableFrameUrl = {
|
|
27
33
|
fieldName: string;
|
|
28
34
|
uuid?: string;
|
|
@@ -45,6 +51,10 @@ declare module '#blokkli/editor/adapter' {
|
|
|
45
51
|
* Update the value of a single entity field.
|
|
46
52
|
*/
|
|
47
53
|
updateEntityFieldValue?: (e: UpdateEntityFieldValueEvent) => Promise<MutationResponseLike<T>> | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Update the values of multiple block and entity fields in a single batch.
|
|
56
|
+
*/
|
|
57
|
+
updateFieldValueBatched?: (e: UpdateFieldValueBatchedEvent) => Promise<MutationResponseLike<T>> | undefined;
|
|
48
58
|
/**
|
|
49
59
|
* Build the iframe URL for an editable of type "frame".
|
|
50
60
|
*/
|
|
@@ -111,13 +111,13 @@ const tourText = computed(() => {
|
|
|
111
111
|
"<p>Shows the title and status of the current page.</p><p>Click on the title to open the page edit form.</p>"
|
|
112
112
|
);
|
|
113
113
|
return `
|
|
114
|
-
${intro}
|
|
115
|
-
<ul>
|
|
116
|
-
<li><div class="bk-status-indicator"></div>${statusUnpublished.value}</li>
|
|
117
|
-
<li><div class="bk-status-indicator bk-is-warning"></div>${statusPending.value}</li>
|
|
118
|
-
<li><div class="bk-status-indicator bk-is-success"></div>${statusPublished.value}</li>
|
|
119
|
-
</ul>
|
|
120
|
-
`;
|
|
114
|
+
${intro}
|
|
115
|
+
<ul>
|
|
116
|
+
<li><div class="bk-status-indicator"></div>${statusUnpublished.value}</li>
|
|
117
|
+
<li><div class="bk-status-indicator bk-is-warning"></div>${statusPending.value}</li>
|
|
118
|
+
<li><div class="bk-status-indicator bk-is-success"></div>${statusPublished.value}</li>
|
|
119
|
+
</ul>
|
|
120
|
+
`;
|
|
121
121
|
});
|
|
122
122
|
defineTourItem(() => {
|
|
123
123
|
return {
|
|
@@ -52,7 +52,7 @@ defineAddAction(() => {
|
|
|
52
52
|
icon: "bk_mdi_newspaper",
|
|
53
53
|
color: "accent",
|
|
54
54
|
itemBundle: fragmentBlockBundle,
|
|
55
|
-
title: $t("fragmentsAddFragmentAction", "
|
|
55
|
+
title: $t("fragmentsAddFragmentAction", "Fragment"),
|
|
56
56
|
weight: 20,
|
|
57
57
|
description: $t(
|
|
58
58
|
"fragmentsAddFragmentDescription",
|
|
@@ -17,24 +17,19 @@
|
|
|
17
17
|
@cancel="$emit('cancel')"
|
|
18
18
|
>
|
|
19
19
|
<div class="bk">
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
id="import-existing-fields"
|
|
25
|
-
v-model="selectedFields"
|
|
26
|
-
:label="
|
|
20
|
+
<FormCheckboxes
|
|
21
|
+
id="import-existing-fields"
|
|
22
|
+
v-model="selectedFields"
|
|
23
|
+
:label="
|
|
27
24
|
$t(
|
|
28
25
|
'importExistingFieldsLabel',
|
|
29
26
|
'Which content would you like to import?'
|
|
30
27
|
)
|
|
31
28
|
"
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</template>
|
|
37
|
-
</ConfigForm>
|
|
29
|
+
:options="fieldOptions"
|
|
30
|
+
inline
|
|
31
|
+
/>
|
|
32
|
+
<ConfigForm v-model="filters" :config />
|
|
38
33
|
<div class="bk-import-existing-dialog-results">
|
|
39
34
|
<div class="bk-form-label">
|
|
40
35
|
{{ $t("importExistingPagesTitle", "Select page") }}
|
|
@@ -57,7 +57,12 @@
|
|
|
57
57
|
|
|
58
58
|
<script setup>
|
|
59
59
|
import { ref, useBlokkli, onMounted, useTemplateRef, watch } from "#imports";
|
|
60
|
-
import {
|
|
60
|
+
import {
|
|
61
|
+
DialogModal,
|
|
62
|
+
InfoBox,
|
|
63
|
+
FormText,
|
|
64
|
+
FormItem
|
|
65
|
+
} from "#blokkli/editor/components";
|
|
61
66
|
import { realBackgroundColor } from "#blokkli/editor/helpers/dom";
|
|
62
67
|
defineEmits(["confirm", "cancel"]);
|
|
63
68
|
const { dom, $t, blocks, ui } = useBlokkli();
|
|
@@ -45,6 +45,8 @@
|
|
|
45
45
|
<NestedEditorOverlay
|
|
46
46
|
v-if="editingLibraryItem"
|
|
47
47
|
v-bind="editingLibraryItem"
|
|
48
|
+
theme="lime"
|
|
49
|
+
icon="reusable"
|
|
48
50
|
:title="$t('libraryItemEditOverlayTitle', 'Edit reusable block')"
|
|
49
51
|
@submit="onSubmitLibraryItem"
|
|
50
52
|
@close="cancelLibraryItemEdit"
|
|
@@ -74,8 +76,11 @@ const { adapter } = defineBlokkliFeature({
|
|
|
74
76
|
requiredAdapterMethods: ["makeBlockReusable", "detachReusableBlock"],
|
|
75
77
|
dependencies: ["add-list"]
|
|
76
78
|
});
|
|
77
|
-
const { selection, state, types, $t, eventBus, definitions, ui } = useBlokkli();
|
|
79
|
+
const { selection, state, types, $t, eventBus, definitions, ui, permissions } = useBlokkli();
|
|
78
80
|
const showReusableDialog = useDialog("library-reusable", "center");
|
|
81
|
+
const userCanCreateLibraryItem = computed(
|
|
82
|
+
() => permissions.hasPermission("create_library_item")
|
|
83
|
+
);
|
|
79
84
|
async function selectNewlyAdded(cb) {
|
|
80
85
|
const uuidsBefore = state.getAllUuids();
|
|
81
86
|
await cb();
|
|
@@ -161,11 +166,15 @@ const fromLibraryAllowedInList = computed(() => {
|
|
|
161
166
|
return types.allowedTypesInList.value.includes(fromLibraryBlockBundle);
|
|
162
167
|
});
|
|
163
168
|
const canMakeReusable = computed(
|
|
164
|
-
() => !isReusable.value && itemBundle?.value?.allowReusable && fromLibraryAllowedInList.value
|
|
169
|
+
() => !isReusable.value && itemBundle?.value?.allowReusable && fromLibraryAllowedInList.value && userCanCreateLibraryItem.value
|
|
165
170
|
);
|
|
166
171
|
const editingLibraryItem = ref(null);
|
|
167
172
|
onBlokkliEvent("library:edit-item", function(e) {
|
|
168
|
-
editingLibraryItem.value =
|
|
173
|
+
editingLibraryItem.value = {
|
|
174
|
+
uuid: e.uuid,
|
|
175
|
+
blockUuid: e.blockUuid,
|
|
176
|
+
url: e.url
|
|
177
|
+
};
|
|
169
178
|
});
|
|
170
179
|
function cancelLibraryItemEdit() {
|
|
171
180
|
editingLibraryItem.value = null;
|
|
@@ -180,10 +189,10 @@ defineAddAction(() => {
|
|
|
180
189
|
}
|
|
181
190
|
return {
|
|
182
191
|
id: "library",
|
|
183
|
-
title: $t("libraryAddFromLibrary", "
|
|
192
|
+
title: $t("libraryAddFromLibrary", "From library"),
|
|
184
193
|
description: $t(
|
|
185
194
|
"libraryAddDescription",
|
|
186
|
-
"Add a reusable block from the block library."
|
|
195
|
+
"<p>Add a reusable block from the block library. Changes to that block will become visible on all pages.</p>"
|
|
187
196
|
),
|
|
188
197
|
icon: "reusable",
|
|
189
198
|
color: "lime",
|
|
@@ -79,3 +79,9 @@ declare module '#blokkli/editor/events' {
|
|
|
79
79
|
'library:edit-item': LibraryEditItemEvent;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
declare module '#blokkli/editor/types/permissions' {
|
|
83
|
+
interface UserPermissionMap {
|
|
84
|
+
create_library_item: 'Create new library items from existing blocks';
|
|
85
|
+
edit_library_item: 'Edit library items.';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -14,9 +14,9 @@ type __VLS_ModelProps = {
|
|
|
14
14
|
};
|
|
15
15
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
16
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
-
"update:modelValue": (value: string[]
|
|
17
|
+
"update:modelValue": (value: string[]) => any;
|
|
18
18
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
-
"onUpdate:modelValue"?: ((value: string[]
|
|
19
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
20
20
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
22
22
|
export default _default;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:data-item-bundle="targetBundles[0]"
|
|
9
9
|
:data-media-id="mediaId"
|
|
10
10
|
:data-media-bundle="mediaBundle"
|
|
11
|
+
@click="onClick"
|
|
11
12
|
>
|
|
12
13
|
<div class="bk-media-library-items-item-box">
|
|
13
14
|
<label @click.stop>
|
|
@@ -36,6 +37,21 @@ const props = defineProps({
|
|
|
36
37
|
mediaBundle: { type: String, required: false },
|
|
37
38
|
isDisabled: { type: Boolean, required: false }
|
|
38
39
|
});
|
|
39
|
-
const selected = defineModel({ type: Array
|
|
40
|
+
const selected = defineModel({ type: Array, ...{
|
|
41
|
+
default: () => {
|
|
42
|
+
return [];
|
|
43
|
+
}
|
|
44
|
+
} });
|
|
40
45
|
const isSelected = computed(() => selected.value?.includes(props.mediaId));
|
|
46
|
+
function onClick(e) {
|
|
47
|
+
if (e.ctrlKey) {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
e.preventDefault();
|
|
50
|
+
if (isSelected.value) {
|
|
51
|
+
selected.value = selected.value.filter((v) => v !== props.mediaId);
|
|
52
|
+
} else {
|
|
53
|
+
selected.value.push(props.mediaId);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
41
57
|
</script>
|
|
@@ -14,9 +14,9 @@ type __VLS_ModelProps = {
|
|
|
14
14
|
};
|
|
15
15
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
16
16
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
-
"update:modelValue": (value: string[]
|
|
17
|
+
"update:modelValue": (value: string[]) => any;
|
|
18
18
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
19
|
-
"onUpdate:modelValue"?: ((value: string[]
|
|
19
|
+
"onUpdate:modelValue"?: ((value: string[]) => any) | undefined;
|
|
20
20
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
21
|
declare const _default: typeof __VLS_export;
|
|
22
22
|
export default _default;
|
|
@@ -78,7 +78,12 @@ import {
|
|
|
78
78
|
nextTick,
|
|
79
79
|
useTemplateRef
|
|
80
80
|
} from "#imports";
|
|
81
|
-
import {
|
|
81
|
+
import {
|
|
82
|
+
Sortli,
|
|
83
|
+
Icon,
|
|
84
|
+
Pagination,
|
|
85
|
+
FormToggle
|
|
86
|
+
} from "#blokkli/editor/components";
|
|
82
87
|
import Item from "./Item.vue";
|
|
83
88
|
import { falsy } from "#blokkli/helpers";
|
|
84
89
|
import { onBlokkliEvent } from "#blokkli/editor/composables";
|
|
@@ -48,10 +48,10 @@ defineDropAreas((dragItems) => {
|
|
|
48
48
|
}
|
|
49
49
|
return directive.getDroppableElements().map((field) => {
|
|
50
50
|
const config = types.getDroppableFieldConfig(field.fieldName, field);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (!
|
|
51
|
+
const allowedBundles = config.allowed.find(
|
|
52
|
+
(v) => v.type === "media"
|
|
53
|
+
)?.bundles;
|
|
54
|
+
if (!allowedBundles || !allowedBundles.includes(item.mediaBundle)) {
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
57
|
const isBlock = field.type === itemEntityType;
|
|
@@ -56,32 +56,16 @@ import {
|
|
|
56
56
|
BK_VISIBLE_LANGUAGES
|
|
57
57
|
} from "./../../../../../global/constants";
|
|
58
58
|
import { fromLibraryBlockBundle, itemEntityType } from "#blokkli-build/config";
|
|
59
|
+
import {
|
|
60
|
+
getAvailableOptions,
|
|
61
|
+
getMutatedOptionValue,
|
|
62
|
+
optionValueToStorable
|
|
63
|
+
} from "#blokkli/editor/helpers/options";
|
|
59
64
|
if (import.meta.hot) {
|
|
60
65
|
import.meta.hot.accept("#blokkli/runtime-helpers", () => {
|
|
61
66
|
});
|
|
62
67
|
}
|
|
63
68
|
const activeGroup = ref("");
|
|
64
|
-
function optionValueToStorable(definition, value) {
|
|
65
|
-
if (definition.type === "checkbox") {
|
|
66
|
-
if (typeof value === "string" && (value === "1" || value === "0")) {
|
|
67
|
-
return value;
|
|
68
|
-
} else if (typeof value === "boolean") {
|
|
69
|
-
return value === true ? "1" : "0";
|
|
70
|
-
}
|
|
71
|
-
return "0";
|
|
72
|
-
} else if (definition.type === "text" || definition.type === "radios" || definition.type === "datetime-local") {
|
|
73
|
-
if (typeof value === "string") {
|
|
74
|
-
return value;
|
|
75
|
-
}
|
|
76
|
-
} else if (definition.type === "checkboxes") {
|
|
77
|
-
if (Array.isArray(value)) {
|
|
78
|
-
return value.join(",");
|
|
79
|
-
} else if (typeof value === "string") {
|
|
80
|
-
return value;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return "";
|
|
84
|
-
}
|
|
85
69
|
function onToggleGroup(label) {
|
|
86
70
|
if (activeGroup.value === label) {
|
|
87
71
|
activeGroup.value = "";
|
|
@@ -180,30 +164,14 @@ const availableOptions = computed(() => {
|
|
|
180
164
|
if (!props.definition) {
|
|
181
165
|
return [];
|
|
182
166
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
189
|
-
return acc;
|
|
190
|
-
}, {});
|
|
191
|
-
return Object.entries({ ...options, ...global }).map(([property, option]) => {
|
|
192
|
-
return {
|
|
193
|
-
property,
|
|
194
|
-
option
|
|
195
|
-
};
|
|
196
|
-
});
|
|
167
|
+
return getAvailableOptions(
|
|
168
|
+
props.definition.options,
|
|
169
|
+
props.definition.globalOptions,
|
|
170
|
+
definitions.globalOptions.value
|
|
171
|
+
);
|
|
197
172
|
});
|
|
198
173
|
function getOptionValue(uuid, key, defaultValue) {
|
|
199
|
-
|
|
200
|
-
return "";
|
|
201
|
-
}
|
|
202
|
-
const blockMutatedOptions = state.mutatedOptions[uuid];
|
|
203
|
-
if (blockMutatedOptions !== void 0 && blockMutatedOptions[key] !== void 0) {
|
|
204
|
-
return blockMutatedOptions[key];
|
|
205
|
-
}
|
|
206
|
-
return defaultValue;
|
|
174
|
+
return getMutatedOptionValue(state.mutatedOptions, uuid, key, defaultValue);
|
|
207
175
|
}
|
|
208
176
|
const currentValues = computed(() => {
|
|
209
177
|
return availableOptions.value.reduce((acc, v) => {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
canTakeOwnership: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
5
|
submit: () => any;
|
|
3
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
4
7
|
onSubmit?: (() => any) | undefined;
|
|
5
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
9
|
declare const _default: typeof __VLS_export;
|
|
7
10
|
export default _default;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
id="ownership"
|
|
4
4
|
icon="bk_mdi_person-fill"
|
|
5
5
|
:text
|
|
6
|
-
:button
|
|
6
|
+
:button
|
|
7
7
|
@click="$emit('submit')"
|
|
8
8
|
/>
|
|
9
9
|
</template>
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
<script setup>
|
|
12
12
|
import { computed, useBlokkli, onMounted, onBeforeUnmount } from "#imports";
|
|
13
13
|
import { Banner } from "#blokkli/editor/components";
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
canTakeOwnership: { type: Boolean, required: true }
|
|
16
|
+
});
|
|
14
17
|
defineEmits(["submit"]);
|
|
15
18
|
const { state, $t, ui } = useBlokkli();
|
|
16
19
|
const name = computed(() => {
|
|
@@ -26,6 +29,12 @@ const text = computed(() => {
|
|
|
26
29
|
"This page is currently being edited by @name. Changes can only be made by one person at a time."
|
|
27
30
|
).replace("@name", name.value);
|
|
28
31
|
});
|
|
32
|
+
const button = computed(() => {
|
|
33
|
+
if (!props.canTakeOwnership) {
|
|
34
|
+
return void 0;
|
|
35
|
+
}
|
|
36
|
+
return $t("ownershipTakeOwnership", "Assign to me");
|
|
37
|
+
});
|
|
29
38
|
onMounted(() => {
|
|
30
39
|
ui.setSelectionColor("ownership", "mono");
|
|
31
40
|
});
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
canTakeOwnership: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
5
|
submit: () => any;
|
|
3
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
4
7
|
onSubmit?: (() => any) | undefined;
|
|
5
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions,
|
|
8
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
9
|
declare const _default: typeof __VLS_export;
|
|
7
10
|
export default _default;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport to="#bk-banner-list">
|
|
3
|
-
<OwnershipBanner
|
|
3
|
+
<OwnershipBanner
|
|
4
|
+
v-if="shouldRender"
|
|
5
|
+
:can-take-ownership
|
|
6
|
+
@submit="takeOwnership"
|
|
7
|
+
/>
|
|
4
8
|
</Teleport>
|
|
5
9
|
</template>
|
|
6
10
|
|
|
@@ -14,15 +18,23 @@ const { adapter } = defineBlokkliFeature({
|
|
|
14
18
|
requiredAdapterMethods: ["takeOwnership"],
|
|
15
19
|
description: "Renders a large button to take ownership of the current edit state."
|
|
16
20
|
});
|
|
17
|
-
const { state, $t } = useBlokkli();
|
|
21
|
+
const { state, $t, permissions } = useBlokkli();
|
|
18
22
|
const shouldRender = computed(
|
|
19
23
|
() => !state.owner.value?.currentUserIsOwner && state.permissions.value.includes("edit")
|
|
20
24
|
);
|
|
21
|
-
const
|
|
22
|
-
() =>
|
|
23
|
-
$t("ownershipError", "Error in assigning"),
|
|
24
|
-
$t("ownershipSuccess", "You are now the owner.")
|
|
25
|
+
const canTakeOwnership = computed(
|
|
26
|
+
() => permissions.hasPermission("take_ownership")
|
|
25
27
|
);
|
|
28
|
+
function takeOwnership() {
|
|
29
|
+
if (!canTakeOwnership.value) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
state.mutateWithLoadingState(
|
|
33
|
+
() => adapter.takeOwnership(),
|
|
34
|
+
$t("ownershipError", "Error in assigning"),
|
|
35
|
+
$t("ownershipSuccess", "You are now the owner.")
|
|
36
|
+
);
|
|
37
|
+
}
|
|
26
38
|
</script>
|
|
27
39
|
|
|
28
40
|
<script>
|
|
@@ -16,7 +16,11 @@ import {
|
|
|
16
16
|
} from "#imports";
|
|
17
17
|
import { BlokkliTransition } from "#blokkli/editor/components";
|
|
18
18
|
import PublishDialog from "./Dialog/index.vue";
|
|
19
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
defineMenuButton,
|
|
21
|
+
onBlokkliEvent,
|
|
22
|
+
useDialog
|
|
23
|
+
} from "#blokkli/editor/composables";
|
|
20
24
|
const { adapter, settings } = defineBlokkliFeature({
|
|
21
25
|
id: "publish",
|
|
22
26
|
icon: "bk_mdi_publish",
|
|
@@ -93,11 +93,14 @@ function focusInput() {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
defineExpose({ focusInput });
|
|
96
|
-
const adapterContentSearchTabs = adapter.getContentSearchTabs ? await adapter.getContentSearchTabs() :
|
|
96
|
+
const adapterContentSearchTabs = adapter.getContentSearchTabs ? await adapter.getContentSearchTabs() : [];
|
|
97
97
|
const tabsMap = computed(() => {
|
|
98
98
|
return {
|
|
99
99
|
on_this_page: $t("searchBoxOnThisPage", "On this page"),
|
|
100
|
-
...adapterContentSearchTabs
|
|
100
|
+
...adapterContentSearchTabs.reduce((acc, tab2) => {
|
|
101
|
+
acc[tab2.id] = tab2.title;
|
|
102
|
+
return acc;
|
|
103
|
+
}, {})
|
|
101
104
|
};
|
|
102
105
|
});
|
|
103
106
|
const tabItems = computed(() => {
|