@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
|
@@ -107,6 +107,31 @@ export type AddNewBlockEvent = {
|
|
|
107
107
|
bundle: string;
|
|
108
108
|
host: BlokkliItemHost;
|
|
109
109
|
afterUuid: string | null;
|
|
110
|
+
/** Optional UUID to use for the new block. If not provided, the adapter generates one. */
|
|
111
|
+
blockUuid?: string;
|
|
112
|
+
};
|
|
113
|
+
export type BlockFieldValue = {
|
|
114
|
+
fieldName: string;
|
|
115
|
+
fieldValue: string | {
|
|
116
|
+
entityType: string;
|
|
117
|
+
entityId: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
export type AddNewBlocksEventBlock = {
|
|
121
|
+
bundle: string;
|
|
122
|
+
/** UUID for the new block. */
|
|
123
|
+
blockUuid: string;
|
|
124
|
+
/** Optional default values for the block's editable/droppable fields. */
|
|
125
|
+
values?: BlockFieldValue[];
|
|
126
|
+
/** Storable option values for this block. */
|
|
127
|
+
options?: Record<string, string>;
|
|
128
|
+
/** Nested child blocks keyed by block field name. */
|
|
129
|
+
children?: Record<string, AddNewBlocksEventBlock[]>;
|
|
130
|
+
};
|
|
131
|
+
export type AddNewBlocksEvent = {
|
|
132
|
+
blocks: AddNewBlocksEventBlock[];
|
|
133
|
+
host: BlokkliItemHost;
|
|
134
|
+
afterUuid: string | null;
|
|
110
135
|
};
|
|
111
136
|
export type UpdateMutatedFieldsEvent = {
|
|
112
137
|
fields: MutatedField[];
|
|
@@ -151,6 +176,10 @@ export type GlobalPointerUpEvent = GlobalPointerEvent & {
|
|
|
151
176
|
*/
|
|
152
177
|
duration: number;
|
|
153
178
|
};
|
|
179
|
+
export type ScrollSelectionIntoViewEvent = {
|
|
180
|
+
center?: boolean;
|
|
181
|
+
immediate?: boolean;
|
|
182
|
+
};
|
|
154
183
|
export interface EventbusEvents {
|
|
155
184
|
select: string | string[];
|
|
156
185
|
'select:unselect': undefined;
|
|
@@ -178,6 +207,8 @@ export interface EventbusEvents {
|
|
|
178
207
|
'block:append': BlockAppendEvent;
|
|
179
208
|
'item:doubleClick': RenderedFieldListItem;
|
|
180
209
|
scrollIntoView: ScrollIntoViewEvent;
|
|
210
|
+
scrollSelectionIntoView: ScrollSelectionIntoViewEvent;
|
|
211
|
+
highlight: HTMLElement | null;
|
|
181
212
|
'animationFrame:before': AnimationFrameBeforeEvent;
|
|
182
213
|
'animationFrame:after': undefined;
|
|
183
214
|
'canvas:draw': CanvasDrawEvent;
|
|
@@ -2,7 +2,14 @@ import type { AddAction } from '#blokkli/editor/types/actions';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
action: AddAction;
|
|
4
4
|
selectableBundles: string[];
|
|
5
|
+
helpActive: boolean;
|
|
5
6
|
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
help: (data: HTMLElement) => void;
|
|
9
|
+
startHelp: (data: HTMLElement) => void;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onHelp?: ((data: HTMLElement) => any) | undefined;
|
|
12
|
+
onStartHelp?: ((data: HTMLElement) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
14
|
declare const _default: typeof __VLS_export;
|
|
8
15
|
export default _default;
|
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
:color="action.color"
|
|
13
13
|
:disabled
|
|
14
14
|
no-context-menu
|
|
15
|
+
use-help
|
|
16
|
+
:help-active
|
|
17
|
+
@start-help="$emit('startHelp', $event)"
|
|
18
|
+
@help="$emit('help', $event)"
|
|
15
19
|
/>
|
|
16
20
|
</template>
|
|
17
21
|
|
|
@@ -21,8 +25,10 @@ import { computed, useTemplateRef, useBlokkli } from "#imports";
|
|
|
21
25
|
import { defineTourItem } from "#blokkli/editor/composables";
|
|
22
26
|
const props = defineProps({
|
|
23
27
|
action: { type: Object, required: true },
|
|
24
|
-
selectableBundles: { type: Array, required: true }
|
|
28
|
+
selectableBundles: { type: Array, required: true },
|
|
29
|
+
helpActive: { type: Boolean, required: true }
|
|
25
30
|
});
|
|
31
|
+
defineEmits(["help", "startHelp"]);
|
|
26
32
|
const { selection } = useBlokkli();
|
|
27
33
|
const item = useTemplateRef("item");
|
|
28
34
|
const bundleDisabled = computed(() => {
|
|
@@ -2,7 +2,14 @@ import type { AddAction } from '#blokkli/editor/types/actions';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
action: AddAction;
|
|
4
4
|
selectableBundles: string[];
|
|
5
|
+
helpActive: boolean;
|
|
5
6
|
};
|
|
6
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
help: (data: HTMLElement) => void;
|
|
9
|
+
startHelp: (data: HTMLElement) => void;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
|
+
onHelp?: ((data: HTMLElement) => any) | undefined;
|
|
12
|
+
onStartHelp?: ((data: HTMLElement) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
7
14
|
declare const _default: typeof __VLS_export;
|
|
8
15
|
export default _default;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
import type { AddListHelp } from '../types.js';
|
|
2
|
+
import type { AddAction } from '#blokkli/editor/types/actions';
|
|
1
3
|
type __VLS_Props = {
|
|
2
4
|
selectableBundles: string[];
|
|
5
|
+
actions: AddAction[];
|
|
6
|
+
helpActive: boolean;
|
|
3
7
|
};
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
help: (date: AddListHelp) => void;
|
|
10
|
+
startHelp: (date: AddListHelp) => void;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onHelp?: ((date: AddListHelp) => any) | undefined;
|
|
13
|
+
onStartHelp?: ((date: AddListHelp) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
15
|
declare const _default: typeof __VLS_export;
|
|
6
16
|
export default _default;
|
|
@@ -5,27 +5,48 @@
|
|
|
5
5
|
:key="action.id"
|
|
6
6
|
:action="action"
|
|
7
7
|
:selectable-bundles
|
|
8
|
+
:help-active
|
|
9
|
+
@help="onHelp(action, $event)"
|
|
10
|
+
@start-help="onStartHelp(action, $event)"
|
|
8
11
|
/>
|
|
9
12
|
</Sortli>
|
|
10
13
|
</template>
|
|
11
14
|
|
|
12
15
|
<script setup>
|
|
13
|
-
import { computed, useBlokkli } from "#imports";
|
|
14
16
|
import { Sortli } from "#blokkli/editor/components";
|
|
15
17
|
import ActionButton from "./Action.vue";
|
|
16
|
-
defineProps({
|
|
17
|
-
selectableBundles: { type: Array, required: true }
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const actions = computed(() => {
|
|
21
|
-
return plugins.get("addAction").sort((a, b) => a.weight - b.weight);
|
|
18
|
+
const props = defineProps({
|
|
19
|
+
selectableBundles: { type: Array, required: true },
|
|
20
|
+
actions: { type: Array, required: true },
|
|
21
|
+
helpActive: { type: Boolean, required: true }
|
|
22
22
|
});
|
|
23
|
+
const emit = defineEmits(["help", "startHelp"]);
|
|
24
|
+
function onStartHelp(action, element) {
|
|
25
|
+
if (props.helpActive) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
emit("startHelp", {
|
|
29
|
+
type: "action",
|
|
30
|
+
id: action.id,
|
|
31
|
+
element
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function onHelp(action, element) {
|
|
35
|
+
if (!props.helpActive) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
emit("help", {
|
|
39
|
+
type: "action",
|
|
40
|
+
id: action.id,
|
|
41
|
+
element
|
|
42
|
+
});
|
|
43
|
+
}
|
|
23
44
|
function buildItemAction(element) {
|
|
24
45
|
const actionType = element.dataset.sortliId;
|
|
25
46
|
if (!actionType) {
|
|
26
47
|
return;
|
|
27
48
|
}
|
|
28
|
-
const action = actions.
|
|
49
|
+
const action = props.actions.find((v) => v.id === actionType);
|
|
29
50
|
if (!action) {
|
|
30
51
|
return;
|
|
31
52
|
}
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
+
import type { AddListHelp } from '../types.js';
|
|
2
|
+
import type { AddAction } from '#blokkli/editor/types/actions';
|
|
1
3
|
type __VLS_Props = {
|
|
2
4
|
selectableBundles: string[];
|
|
5
|
+
actions: AddAction[];
|
|
6
|
+
helpActive: boolean;
|
|
3
7
|
};
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
help: (date: AddListHelp) => void;
|
|
10
|
+
startHelp: (date: AddListHelp) => void;
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
12
|
+
onHelp?: ((date: AddListHelp) => any) | undefined;
|
|
13
|
+
onStartHelp?: ((date: AddListHelp) => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
15
|
declare const _default: typeof __VLS_export;
|
|
6
16
|
export default _default;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { BlockBundleDefinition } from '#blokkli/editor/types/definitions';
|
|
2
|
+
import type { AddListHelp } from '../types.js';
|
|
2
3
|
declare const _default: typeof __VLS_export;
|
|
3
4
|
export default _default;
|
|
4
5
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
5
6
|
hideDisabledBlocks?: boolean;
|
|
6
7
|
selectableBundles: string[];
|
|
7
8
|
generallyAvailableBundles: BlockBundleDefinition[];
|
|
8
|
-
|
|
9
|
+
helpActive: boolean;
|
|
10
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
help: (date: AddListHelp) => void;
|
|
12
|
+
startHelp: (date: AddListHelp) => void;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
9
14
|
hideDisabledBlocks?: boolean;
|
|
10
15
|
selectableBundles: string[];
|
|
11
16
|
generallyAvailableBundles: BlockBundleDefinition[];
|
|
12
|
-
|
|
17
|
+
helpActive: boolean;
|
|
18
|
+
}> & Readonly<{
|
|
19
|
+
onHelp?: ((date: AddListHelp) => any) | undefined;
|
|
20
|
+
onStartHelp?: ((date: AddListHelp) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -13,7 +13,11 @@
|
|
|
13
13
|
:color="type.isFavorite ? 'yellow' : 'default'"
|
|
14
14
|
:is-auto-add="type.isAutoAdd"
|
|
15
15
|
data-element-type="new"
|
|
16
|
+
use-help
|
|
17
|
+
:help-active
|
|
16
18
|
:data-item-bundle="type.id"
|
|
19
|
+
@help="onHelp(type, $event)"
|
|
20
|
+
@start-help="onStartHelp(type, $event)"
|
|
17
21
|
/>
|
|
18
22
|
</Sortli>
|
|
19
23
|
|
|
@@ -42,8 +46,30 @@ import { defineCommands } from "#blokkli/editor/composables";
|
|
|
42
46
|
const props = defineProps({
|
|
43
47
|
hideDisabledBlocks: { type: Boolean, required: false },
|
|
44
48
|
selectableBundles: { type: Array, required: true },
|
|
45
|
-
generallyAvailableBundles: { type: Array, required: true }
|
|
49
|
+
generallyAvailableBundles: { type: Array, required: true },
|
|
50
|
+
helpActive: { type: Boolean, required: true }
|
|
46
51
|
});
|
|
52
|
+
const emit = defineEmits(["help", "startHelp"]);
|
|
53
|
+
function onHelp(item, element) {
|
|
54
|
+
if (!props.helpActive) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
emit("help", {
|
|
58
|
+
type: "bundle",
|
|
59
|
+
id: item.id,
|
|
60
|
+
element
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function onStartHelp(item, element) {
|
|
64
|
+
if (props.helpActive) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
emit("startHelp", {
|
|
68
|
+
type: "bundle",
|
|
69
|
+
id: item.id,
|
|
70
|
+
element
|
|
71
|
+
});
|
|
72
|
+
}
|
|
47
73
|
const {
|
|
48
74
|
selection,
|
|
49
75
|
storage,
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import type { BlockBundleDefinition } from '#blokkli/editor/types/definitions';
|
|
2
|
+
import type { AddListHelp } from '../types.js';
|
|
2
3
|
declare const _default: typeof __VLS_export;
|
|
3
4
|
export default _default;
|
|
4
5
|
declare const __VLS_export: import("vue").DefineComponent<{
|
|
5
6
|
hideDisabledBlocks?: boolean;
|
|
6
7
|
selectableBundles: string[];
|
|
7
8
|
generallyAvailableBundles: BlockBundleDefinition[];
|
|
8
|
-
|
|
9
|
+
helpActive: boolean;
|
|
10
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
11
|
+
help: (date: AddListHelp) => void;
|
|
12
|
+
startHelp: (date: AddListHelp) => void;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
9
14
|
hideDisabledBlocks?: boolean;
|
|
10
15
|
selectableBundles: string[];
|
|
11
16
|
generallyAvailableBundles: BlockBundleDefinition[];
|
|
12
|
-
|
|
17
|
+
helpActive: boolean;
|
|
18
|
+
}> & Readonly<{
|
|
19
|
+
onHelp?: ((date: AddListHelp) => any) | undefined;
|
|
20
|
+
onStartHelp?: ((date: AddListHelp) => any) | undefined;
|
|
21
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AddAction } from '#blokkli/editor/types/actions';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
type: 'bundle' | 'action';
|
|
4
|
+
id: string;
|
|
5
|
+
actions: AddAction[];
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
9
|
+
height: any;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="el"
|
|
4
|
+
class="bk-add-list-help-item"
|
|
5
|
+
:style="{
|
|
6
|
+
visibility: isVisible ? 'visible' : 'hidden'
|
|
7
|
+
}"
|
|
8
|
+
>
|
|
9
|
+
<div v-if="type === 'bundle'" class="bk-add-list-help-image">
|
|
10
|
+
<img v-if="imageUrl" :src="imageUrl" />
|
|
11
|
+
<div v-else>
|
|
12
|
+
<ItemIcon :bundle="undefined" :icon />
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<h2>
|
|
16
|
+
<ItemIconBox :bundle :icon :color />
|
|
17
|
+
<span>{{ title }}</span>
|
|
18
|
+
</h2>
|
|
19
|
+
|
|
20
|
+
<hr />
|
|
21
|
+
|
|
22
|
+
<div v-if="text" class="bk-add-list-help-description" v-html="text" />
|
|
23
|
+
|
|
24
|
+
<template v-for="section in sections" :key="section.title">
|
|
25
|
+
<hr />
|
|
26
|
+
<div class="bk-add-list-help-label">
|
|
27
|
+
{{ section.title }}
|
|
28
|
+
</div>
|
|
29
|
+
<div
|
|
30
|
+
v-for="field in section.fields"
|
|
31
|
+
:key="field.name"
|
|
32
|
+
class="bk-add-list-help-fields-item"
|
|
33
|
+
>
|
|
34
|
+
<ul>
|
|
35
|
+
<li v-if="section.fields.length > 1" class="bk-is-field">
|
|
36
|
+
{{ field.label }}
|
|
37
|
+
</li>
|
|
38
|
+
<li
|
|
39
|
+
v-for="allowed in field.items"
|
|
40
|
+
:key="field.name + allowed.bundle"
|
|
41
|
+
class="bk-is-bundle"
|
|
42
|
+
>
|
|
43
|
+
<ItemIconBox
|
|
44
|
+
:bundle="allowed.bundle"
|
|
45
|
+
:icon="allowed.icon"
|
|
46
|
+
is-tiny
|
|
47
|
+
/>
|
|
48
|
+
<span>{{ allowed.label }}</span>
|
|
49
|
+
</li>
|
|
50
|
+
</ul>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<script setup>
|
|
57
|
+
import { ItemIconBox, ItemIcon } from "#blokkli/editor/components";
|
|
58
|
+
import { itemEntityType, fragmentBlockBundle } from "#blokkli-build/config";
|
|
59
|
+
import { computed, ref, useBlokkli, useTemplateRef } from "#imports";
|
|
60
|
+
import { onElementResize } from "#blokkli/editor/composables";
|
|
61
|
+
import { falsy } from "#blokkli/helpers";
|
|
62
|
+
const props = defineProps({
|
|
63
|
+
type: { type: String, required: true },
|
|
64
|
+
id: { type: String, required: true },
|
|
65
|
+
actions: { type: Array, required: true },
|
|
66
|
+
isVisible: { type: Boolean, required: true }
|
|
67
|
+
});
|
|
68
|
+
const el = useTemplateRef("el");
|
|
69
|
+
const height = ref(0);
|
|
70
|
+
onElementResize(el, (size) => {
|
|
71
|
+
height.value = size.height;
|
|
72
|
+
});
|
|
73
|
+
defineExpose({
|
|
74
|
+
height
|
|
75
|
+
});
|
|
76
|
+
const { types, $t, definitions } = useBlokkli();
|
|
77
|
+
const reusableBlockTypes = computed(
|
|
78
|
+
() => types.generallyAvailableBundles.filter((v) => v.allowReusable)
|
|
79
|
+
);
|
|
80
|
+
const fragments = computed(() => {
|
|
81
|
+
return definitions.fragmentDefinitions.value.map((v) => {
|
|
82
|
+
return {
|
|
83
|
+
bundle: fragmentBlockBundle,
|
|
84
|
+
label: v.label,
|
|
85
|
+
icon: v.editor?.icon ?? "bk_mdi_newspaper"
|
|
86
|
+
};
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
const bundleDefinition = computed(() => {
|
|
90
|
+
if (props.type === "bundle") {
|
|
91
|
+
return types.getBlockBundleDefinition(props.id);
|
|
92
|
+
}
|
|
93
|
+
return void 0;
|
|
94
|
+
});
|
|
95
|
+
const action = computed(() => {
|
|
96
|
+
if (props.type === "action") {
|
|
97
|
+
return props.actions.find((v) => v.id === props.id);
|
|
98
|
+
}
|
|
99
|
+
return void 0;
|
|
100
|
+
});
|
|
101
|
+
const title = computed(() => {
|
|
102
|
+
return bundleDefinition.value?.label ?? action.value?.title ?? "";
|
|
103
|
+
});
|
|
104
|
+
const text = computed(() => {
|
|
105
|
+
return bundleDefinition.value?.description ?? action.value?.description;
|
|
106
|
+
});
|
|
107
|
+
const imageUrl = computed(() => {
|
|
108
|
+
if (bundle.value) {
|
|
109
|
+
const imagePath = definitions.getBlockImage(bundle.value);
|
|
110
|
+
if (imagePath) {
|
|
111
|
+
return imagePath;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return bundleDefinition.value?.imageUrl;
|
|
115
|
+
});
|
|
116
|
+
const bundle = computed(() => {
|
|
117
|
+
return bundleDefinition.value?.id;
|
|
118
|
+
});
|
|
119
|
+
const icon = computed(() => {
|
|
120
|
+
return action.value?.icon;
|
|
121
|
+
});
|
|
122
|
+
const color = computed(() => {
|
|
123
|
+
return action.value?.color;
|
|
124
|
+
});
|
|
125
|
+
const fields = computed(() => {
|
|
126
|
+
if (props.type !== "bundle") {
|
|
127
|
+
return [];
|
|
128
|
+
}
|
|
129
|
+
const fieldConfigs = types.fieldConfig.forEntityTypeAndBundle(
|
|
130
|
+
itemEntityType,
|
|
131
|
+
props.id
|
|
132
|
+
);
|
|
133
|
+
return fieldConfigs.map((field) => {
|
|
134
|
+
const items = field.allowedBundles.map((bundleId) => {
|
|
135
|
+
return types.getBlockBundleDefinition(bundleId);
|
|
136
|
+
}).filter(falsy).map((block) => {
|
|
137
|
+
return {
|
|
138
|
+
bundle: block.id,
|
|
139
|
+
label: block.label
|
|
140
|
+
};
|
|
141
|
+
});
|
|
142
|
+
return {
|
|
143
|
+
name: field.name,
|
|
144
|
+
label: field.label,
|
|
145
|
+
items
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
const sections = computed(() => {
|
|
150
|
+
const result = [];
|
|
151
|
+
if (fields.value.length) {
|
|
152
|
+
result.push({
|
|
153
|
+
title: $t("allowedBlocks", "Allowed Blocks"),
|
|
154
|
+
fields: fields.value
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
if (props.type === "action" && props.id === "library" && reusableBlockTypes.value.length) {
|
|
158
|
+
result.push({
|
|
159
|
+
title: $t("availableBlocks", "Available blocks"),
|
|
160
|
+
fields: [
|
|
161
|
+
{
|
|
162
|
+
name: "reusable",
|
|
163
|
+
label: "",
|
|
164
|
+
items: reusableBlockTypes.value.map((block) => ({
|
|
165
|
+
bundle: block.id,
|
|
166
|
+
label: block.label
|
|
167
|
+
}))
|
|
168
|
+
}
|
|
169
|
+
]
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
if (props.type === "action" && props.id === "fragment" && fragments.value) {
|
|
173
|
+
result.push({
|
|
174
|
+
title: $t("availableFragments", "Available fragments"),
|
|
175
|
+
fields: [
|
|
176
|
+
{
|
|
177
|
+
name: "fragments",
|
|
178
|
+
label: "",
|
|
179
|
+
items: fragments.value
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return result;
|
|
185
|
+
});
|
|
186
|
+
</script>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AddAction } from '#blokkli/editor/types/actions';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
type: 'bundle' | 'action';
|
|
4
|
+
id: string;
|
|
5
|
+
actions: AddAction[];
|
|
6
|
+
isVisible: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {
|
|
9
|
+
height: any;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AddAction } from '#blokkli/editor/types/actions';
|
|
2
|
+
import type { BlockBundleDefinition } from '#blokkli/editor/types/definitions';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
isVisible: boolean;
|
|
5
|
+
type?: 'bundle' | 'action';
|
|
6
|
+
id?: string;
|
|
7
|
+
element?: HTMLElement;
|
|
8
|
+
actions: AddAction[];
|
|
9
|
+
bundles: BlockBundleDefinition[];
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div ref="rootEl" class="bk bk-add-list-help">
|
|
3
|
+
<div ref="innerEl" class="bk-add-list-help-inner">
|
|
4
|
+
<div class="bk-add-list-help-content">
|
|
5
|
+
<HelpItemComponent
|
|
6
|
+
v-for="item in items"
|
|
7
|
+
:id="item.id"
|
|
8
|
+
ref="itemRefs"
|
|
9
|
+
:key="item.type + ':' + item.id"
|
|
10
|
+
:is-visible="item.type === type && item.id === id"
|
|
11
|
+
:type="item.type"
|
|
12
|
+
:actions
|
|
13
|
+
/>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script setup>
|
|
20
|
+
import { useAnimationFrame } from "#blokkli/editor/composables";
|
|
21
|
+
import { computed, ref, useTemplateRef, useBlokkli, watch } from "#imports";
|
|
22
|
+
import HelpItemComponent from "./Item.vue";
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
isVisible: { type: Boolean, required: true },
|
|
25
|
+
type: { type: String, required: false },
|
|
26
|
+
id: { type: String, required: false },
|
|
27
|
+
element: { type: null, required: false },
|
|
28
|
+
actions: { type: Array, required: true },
|
|
29
|
+
bundles: { type: Array, required: true }
|
|
30
|
+
});
|
|
31
|
+
const rootEl = useTemplateRef("rootEl");
|
|
32
|
+
const innerEl = useTemplateRef("innerEl");
|
|
33
|
+
const itemRefs = useTemplateRef("itemRefs");
|
|
34
|
+
const targetHeight = ref(200);
|
|
35
|
+
const targetY = ref(0);
|
|
36
|
+
const x = ref(200);
|
|
37
|
+
const displayedHeight = ref(200);
|
|
38
|
+
const displayedY = ref(0);
|
|
39
|
+
const skipAnimation = ref(true);
|
|
40
|
+
const { ui } = useBlokkli();
|
|
41
|
+
function updatePosition() {
|
|
42
|
+
if (!props.element) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const rect = props.element.getBoundingClientRect();
|
|
46
|
+
x.value = Math.round(rect.x + rect.width + 10);
|
|
47
|
+
targetY.value = Math.round(
|
|
48
|
+
Math.max(
|
|
49
|
+
10,
|
|
50
|
+
Math.min(
|
|
51
|
+
rect.y - 55,
|
|
52
|
+
ui.visibleViewport.value.height - targetHeight.value - 10
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
watch(() => props.element, updatePosition);
|
|
58
|
+
watch(targetHeight, updatePosition);
|
|
59
|
+
watch(
|
|
60
|
+
() => props.isVisible,
|
|
61
|
+
(isVisible, wasVisible) => {
|
|
62
|
+
if (isVisible && !wasVisible) {
|
|
63
|
+
skipAnimation.value = true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
const items = computed(() => {
|
|
68
|
+
const result = [];
|
|
69
|
+
for (const bundle of props.bundles) {
|
|
70
|
+
result.push({
|
|
71
|
+
type: "bundle",
|
|
72
|
+
id: bundle.id
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
for (const action of props.actions) {
|
|
76
|
+
result.push({
|
|
77
|
+
type: "action",
|
|
78
|
+
id: action.id
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
});
|
|
83
|
+
const EASE_FACTOR = 0.22;
|
|
84
|
+
function lerp(current, target, factor) {
|
|
85
|
+
const diff = target - current;
|
|
86
|
+
if (Math.abs(diff) < 0.5) {
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
89
|
+
return current + diff * factor;
|
|
90
|
+
}
|
|
91
|
+
const visibleIndex = computed(() => {
|
|
92
|
+
if (!props.type || !props.id) return -1;
|
|
93
|
+
return items.value.findIndex(
|
|
94
|
+
(item) => item.type === props.type && item.id === props.id
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
useAnimationFrame(() => {
|
|
98
|
+
if (!props.isVisible) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const index = visibleIndex.value;
|
|
102
|
+
if (index >= 0 && itemRefs.value) {
|
|
103
|
+
const height = itemRefs.value[index]?.height;
|
|
104
|
+
if (height) {
|
|
105
|
+
targetHeight.value = height;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
if (skipAnimation.value) {
|
|
109
|
+
displayedHeight.value = targetHeight.value;
|
|
110
|
+
displayedY.value = targetY.value;
|
|
111
|
+
skipAnimation.value = false;
|
|
112
|
+
} else {
|
|
113
|
+
displayedHeight.value = lerp(
|
|
114
|
+
displayedHeight.value,
|
|
115
|
+
targetHeight.value,
|
|
116
|
+
EASE_FACTOR
|
|
117
|
+
);
|
|
118
|
+
displayedY.value = lerp(displayedY.value, targetY.value, EASE_FACTOR);
|
|
119
|
+
}
|
|
120
|
+
if (rootEl.value) {
|
|
121
|
+
rootEl.value.style.transform = `translate(${x.value}px, ${displayedY.value}px)`;
|
|
122
|
+
}
|
|
123
|
+
if (innerEl.value) {
|
|
124
|
+
innerEl.value.style.height = `${displayedHeight.value}px`;
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
</script>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AddAction } from '#blokkli/editor/types/actions';
|
|
2
|
+
import type { BlockBundleDefinition } from '#blokkli/editor/types/definitions';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
isVisible: boolean;
|
|
5
|
+
type?: 'bundle' | 'action';
|
|
6
|
+
id?: string;
|
|
7
|
+
element?: HTMLElement;
|
|
8
|
+
actions: AddAction[];
|
|
9
|
+
bundles: BlockBundleDefinition[];
|
|
10
|
+
};
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|