@blokkli/editor 2.0.0-alpha.31 → 2.0.0-alpha.33
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/blockOptions.d.ts +16 -0
- package/dist/global/types/features.d.ts +4 -0
- package/dist/module.d.mts +1 -24
- package/dist/module.json +1 -1
- package/dist/module.mjs +453 -10828
- 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/defineBlokkli.js +1 -3
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +5 -3
- package/dist/runtime/composables/defineBlokkliFeature.js +2 -1
- package/dist/runtime/composables/defineBlokkliProvider.js +1 -3
- 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/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 +30 -10
- 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/DragItem.d.vue.ts +1 -0
- package/dist/runtime/editor/features/dragging-overlay/DragItems/DragItem.vue +6 -31
- package/dist/runtime/editor/features/dragging-overlay/DragItems/DragItem.vue.d.ts +1 -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 +42 -18
- 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 +8 -1
- package/dist/runtime/editor/providers/definition.js +7 -3
- 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/helpers/runtimeHelpers/index.d.ts +2 -1
- package/dist/runtime/helpers/runtimeHelpers/index.js +44 -6
- 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 +7 -1
- package/package.json +29 -7
- package/dist/runtime/css/output.css +0 -1
- package/dist/runtime/material-icons/index.d.ts +0 -12
- package/dist/runtime/material-icons/index.js +0 -1
|
@@ -4,14 +4,22 @@ precision highp float;
|
|
|
4
4
|
|
|
5
5
|
in float v_intersecting;
|
|
6
6
|
in float v_is_hover_area;
|
|
7
|
+
in float v_is_field;
|
|
8
|
+
in float v_is_drop_area;
|
|
9
|
+
in float v_is_vertical;
|
|
7
10
|
in vec4 v_quad;
|
|
8
11
|
in vec3 v_color;
|
|
12
|
+
in vec3 v_grad_start;
|
|
13
|
+
in vec3 v_grad_end;
|
|
14
|
+
in vec3 v_border_outer;
|
|
15
|
+
in vec3 v_border_inner;
|
|
9
16
|
|
|
10
17
|
// Optimized varyings - values computed once per vertex instead of per pixel
|
|
11
18
|
in vec2 v_size;
|
|
12
19
|
in vec2 v_location;
|
|
13
20
|
in vec2 v_size_inner;
|
|
14
21
|
in float v_thickness;
|
|
22
|
+
in float v_border_width;
|
|
15
23
|
in float v_edge_softness;
|
|
16
24
|
in float v_radius_outer;
|
|
17
25
|
in float v_radius_inner;
|
|
@@ -24,12 +32,19 @@ uniform float u_dpi;
|
|
|
24
32
|
uniform vec2 u_resolution;
|
|
25
33
|
uniform float u_active_hover_nesting_level;
|
|
26
34
|
|
|
35
|
+
const float OUTER_BORDER_PX = 2.5;
|
|
36
|
+
const float INNER_BORDER_PX = 2.0;
|
|
37
|
+
const float INNER_BORDER_SOFTNESS_PX = 0.5;
|
|
38
|
+
const float OUTER_BORDER_SOFTNESS_PX = 0.3;
|
|
39
|
+
|
|
27
40
|
float roundedBoxSDF(vec2 CenterPosition, vec2 Size, float Radius) {
|
|
28
41
|
return length(max(abs(CenterPosition) - Size + Radius, 0.0)) - Radius;
|
|
29
42
|
}
|
|
30
43
|
|
|
31
44
|
void main() {
|
|
32
45
|
bool isHoverArea = v_is_hover_area >= 1.0;
|
|
46
|
+
bool isField = v_is_field >= 0.5;
|
|
47
|
+
bool isDropArea = v_is_drop_area >= 0.5;
|
|
33
48
|
|
|
34
49
|
// Compute different distance for inside and outside using pre-computed values
|
|
35
50
|
float distanceOuter = roundedBoxSDF(
|
|
@@ -60,16 +75,76 @@ void main() {
|
|
|
60
75
|
if (u_active_hover_nesting_level < 0.5) {
|
|
61
76
|
adjustedAlphaFill = 0.0;
|
|
62
77
|
} else {
|
|
63
|
-
adjustedAlphaFill *= 0.
|
|
78
|
+
adjustedAlphaFill *= 0.1;
|
|
64
79
|
}
|
|
65
80
|
}
|
|
66
81
|
|
|
82
|
+
vec3 fillColor = v_color;
|
|
83
|
+
vec3 borderOuter = v_color;
|
|
84
|
+
vec3 borderInner = v_color;
|
|
85
|
+
if (isField || isDropArea) {
|
|
86
|
+
vec2 minCorner = v_location - v_size * 0.5;
|
|
87
|
+
vec2 uv = (gl_FragCoord.xy - minCorner) / v_size;
|
|
88
|
+
float t = uv.y;
|
|
89
|
+
t = clamp(t, 0.0, 1.0);
|
|
90
|
+
fillColor = mix(v_grad_start, v_grad_end, t);
|
|
91
|
+
borderOuter = v_border_outer;
|
|
92
|
+
borderInner = v_border_inner;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (isField || isDropArea) {
|
|
96
|
+
vec2 pos = gl_FragCoord.xy - v_location;
|
|
97
|
+
float soft = v_edge_softness;
|
|
98
|
+
float outerBorderWidth = OUTER_BORDER_PX;
|
|
99
|
+
float innerBorderWidth = INNER_BORDER_PX;
|
|
100
|
+
|
|
101
|
+
float distOuter = roundedBoxSDF(pos, v_size / 2.0, v_radius_outer);
|
|
102
|
+
float inside = 1.0 - smoothstep(-soft, soft, distOuter);
|
|
103
|
+
float distFromOuter = -distOuter; // distance inside from outer edge in px
|
|
104
|
+
|
|
105
|
+
float outerBand = 0.0;
|
|
106
|
+
if (OUTER_BORDER_SOFTNESS_PX <= 0.0) {
|
|
107
|
+
outerBand = inside * step(0.0, distFromOuter) * step(distFromOuter, outerBorderWidth);
|
|
108
|
+
} else {
|
|
109
|
+
float s = OUTER_BORDER_SOFTNESS_PX;
|
|
110
|
+
outerBand = inside *
|
|
111
|
+
smoothstep(0.0, s, distFromOuter) *
|
|
112
|
+
(1.0 - smoothstep(outerBorderWidth - s, outerBorderWidth + s, distFromOuter));
|
|
113
|
+
}
|
|
114
|
+
float innerBand = 0.0;
|
|
115
|
+
if (INNER_BORDER_SOFTNESS_PX <= 0.0) {
|
|
116
|
+
innerBand = inside *
|
|
117
|
+
step(outerBorderWidth, distFromOuter) *
|
|
118
|
+
step(distFromOuter, outerBorderWidth + innerBorderWidth);
|
|
119
|
+
} else {
|
|
120
|
+
float s = INNER_BORDER_SOFTNESS_PX;
|
|
121
|
+
innerBand = inside *
|
|
122
|
+
smoothstep(outerBorderWidth - s, outerBorderWidth + s, distFromOuter) *
|
|
123
|
+
(1.0 - smoothstep(outerBorderWidth + innerBorderWidth - s, outerBorderWidth + innerBorderWidth + s, distFromOuter));
|
|
124
|
+
}
|
|
125
|
+
float fillMask = inside * step(outerBorderWidth + innerBorderWidth, distFromOuter);
|
|
126
|
+
|
|
127
|
+
vec3 color = fillColor;
|
|
128
|
+
color = mix(color, borderOuter, outerBand);
|
|
129
|
+
color = mix(color, borderInner, innerBand);
|
|
130
|
+
|
|
131
|
+
float a = isDropArea
|
|
132
|
+
? (v_intersecting >= 0.5 ? 0.6 : 0.3)
|
|
133
|
+
: (v_intersecting >= 0.5 ? 1.0 : 0.7);
|
|
134
|
+
float alpha = max(fillMask, max(outerBand, innerBand)) * a;
|
|
135
|
+
if (alpha <= 0.0) {
|
|
136
|
+
discard;
|
|
137
|
+
}
|
|
138
|
+
fragColor = vec4(color, alpha);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
67
142
|
if (alphaBorder > 0.0) {
|
|
68
143
|
float a = isHoverArea ? 0.6 : 1.0;
|
|
69
144
|
fragColor = vec4(v_color, a);
|
|
70
145
|
return;
|
|
71
146
|
} else if (adjustedAlphaFill > 0.0) {
|
|
72
|
-
fragColor = vec4(
|
|
147
|
+
fragColor = vec4(fillColor, adjustedAlphaFill);
|
|
73
148
|
return;
|
|
74
149
|
}
|
|
75
150
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Teleport :to="ui.mainLayoutElement.value">
|
|
3
|
-
<slot
|
|
3
|
+
<slot
|
|
4
|
+
:background-color="activeBackgroundColorHex"
|
|
5
|
+
:color="activeColor"
|
|
6
|
+
:label="active?.label"
|
|
7
|
+
/>
|
|
4
8
|
</Teleport>
|
|
5
9
|
</template>
|
|
6
10
|
|
|
7
11
|
<script setup>
|
|
8
|
-
import {
|
|
9
|
-
falsy,
|
|
10
|
-
onlyUnique
|
|
11
|
-
} from "#blokkli/helpers";
|
|
12
|
+
import { falsy, onlyUnique } from "#blokkli/helpers";
|
|
12
13
|
import {
|
|
13
14
|
findClosestRectangle,
|
|
14
15
|
intersects,
|
|
@@ -30,7 +31,11 @@ import {
|
|
|
30
31
|
getGapSize,
|
|
31
32
|
MIN_GAP
|
|
32
33
|
} from "#blokkli/editor/helpers/dropTargets";
|
|
33
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
fragmentBlockBundle,
|
|
36
|
+
fromLibraryBlockBundle,
|
|
37
|
+
itemEntityType
|
|
38
|
+
} from "#blokkli-build/config";
|
|
34
39
|
import { defineRenderer, onBlokkliEvent } from "#blokkli/editor/composables";
|
|
35
40
|
const props = defineProps({
|
|
36
41
|
items: { type: Array, required: true },
|
|
@@ -39,6 +44,25 @@ const props = defineProps({
|
|
|
39
44
|
mouseY: { type: Number, required: true },
|
|
40
45
|
isTouch: { type: Boolean, required: true }
|
|
41
46
|
});
|
|
47
|
+
const {
|
|
48
|
+
dom,
|
|
49
|
+
ui,
|
|
50
|
+
theme,
|
|
51
|
+
dropAreas,
|
|
52
|
+
eventBus,
|
|
53
|
+
animation,
|
|
54
|
+
state,
|
|
55
|
+
types,
|
|
56
|
+
fields,
|
|
57
|
+
definitions,
|
|
58
|
+
context
|
|
59
|
+
} = useBlokkli();
|
|
60
|
+
const FIELD_MIN_DRAW_SIZE = 6;
|
|
61
|
+
const alphaBase = 0.7;
|
|
62
|
+
const colorTeal = rgbaToString(theme.teal.value.normal);
|
|
63
|
+
const colorTealAlpha = rgbaToString(theme.teal.value.normal, alphaBase);
|
|
64
|
+
const colorAccent = rgbaToString(theme.accent.value[800]);
|
|
65
|
+
const colorAccentAlpha = rgbaToString(theme.accent.value[800], alphaBase);
|
|
42
66
|
var RectRenderType = /* @__PURE__ */ ((RectRenderType2) => {
|
|
43
67
|
RectRenderType2[RectRenderType2["DROP_AREA"] = 0] = "DROP_AREA";
|
|
44
68
|
RectRenderType2[RectRenderType2["FIELD_1"] = 1] = "FIELD_1";
|
|
@@ -54,19 +78,6 @@ const cursorIsInsideClipped = () => isInsideRect(props.mouseX, props.mouseY, ui.
|
|
|
54
78
|
);
|
|
55
79
|
const active = ref(null);
|
|
56
80
|
defineEmits(["drop"]);
|
|
57
|
-
const {
|
|
58
|
-
dom,
|
|
59
|
-
ui,
|
|
60
|
-
theme,
|
|
61
|
-
dropAreas,
|
|
62
|
-
eventBus,
|
|
63
|
-
animation,
|
|
64
|
-
state,
|
|
65
|
-
types,
|
|
66
|
-
fields,
|
|
67
|
-
definitions,
|
|
68
|
-
context
|
|
69
|
-
} = useBlokkli();
|
|
70
81
|
const areas = dropAreas.getDropAreas(props.items).reduce((acc, v) => {
|
|
71
82
|
acc[v.id] = v;
|
|
72
83
|
return acc;
|
|
@@ -469,11 +480,6 @@ const buildDropAreaRect = (area) => {
|
|
|
469
480
|
cachedDropAreaRects[area.id] = dropAreaRect;
|
|
470
481
|
return dropAreaRect;
|
|
471
482
|
};
|
|
472
|
-
const alphaBase = 0.7;
|
|
473
|
-
const colorTeal = rgbaToString(theme.teal.value.normal);
|
|
474
|
-
const colorTealAlpha = rgbaToString(theme.teal.value.normal, alphaBase);
|
|
475
|
-
const colorAccent = rgbaToString(theme.accent.value[800]);
|
|
476
|
-
const colorAccentAlpha = rgbaToString(theme.accent.value[800], alphaBase);
|
|
477
483
|
function getRectType(field) {
|
|
478
484
|
if (field.nestingLevel >= 3) {
|
|
479
485
|
return 4 /* FIELD_4 */;
|
|
@@ -513,7 +519,9 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
513
519
|
y: fieldRect.y + child.y,
|
|
514
520
|
width: child.width,
|
|
515
521
|
height: child.height,
|
|
516
|
-
field: fieldRect
|
|
522
|
+
field: fieldRect,
|
|
523
|
+
nestingLevel: fieldRect.field.nestingLevel,
|
|
524
|
+
state: child.id.includes(":empty:") ? 2 : fieldRect.orientation === "vertical" ? 1 : 0
|
|
517
525
|
},
|
|
518
526
|
type,
|
|
519
527
|
true
|
|
@@ -540,7 +548,8 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
540
548
|
x: areaRect.x,
|
|
541
549
|
y: areaRect.y,
|
|
542
550
|
width: areaRect.width,
|
|
543
|
-
height: areaRect.height
|
|
551
|
+
height: areaRect.height,
|
|
552
|
+
state: 0
|
|
544
553
|
},
|
|
545
554
|
0 /* DROP_AREA */,
|
|
546
555
|
false
|
|
@@ -586,26 +595,52 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
586
595
|
return null;
|
|
587
596
|
}
|
|
588
597
|
}
|
|
589
|
-
const
|
|
598
|
+
const fieldRenderPalette = computed(() => {
|
|
599
|
+
const accent = theme.accent.value;
|
|
600
|
+
const mono = theme.mono.value;
|
|
590
601
|
return {
|
|
591
|
-
"0":
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
602
|
+
"0": {
|
|
603
|
+
gradStart: accent[800],
|
|
604
|
+
gradEnd: accent[900],
|
|
605
|
+
borderOuter: [0, 0, 0],
|
|
606
|
+
borderInner: accent[600],
|
|
607
|
+
color: [255, 255, 255]
|
|
608
|
+
},
|
|
609
|
+
"1": {
|
|
610
|
+
gradStart: accent[400],
|
|
611
|
+
gradEnd: accent[500],
|
|
612
|
+
borderOuter: accent[400],
|
|
613
|
+
borderInner: accent[300],
|
|
614
|
+
color: accent[950]
|
|
615
|
+
},
|
|
616
|
+
"2": {
|
|
617
|
+
gradStart: mono[700],
|
|
618
|
+
gradEnd: mono[800],
|
|
619
|
+
borderOuter: [0, 0, 0],
|
|
620
|
+
borderInner: mono[600],
|
|
621
|
+
color: mono[100]
|
|
622
|
+
},
|
|
623
|
+
"3": {
|
|
624
|
+
gradStart: mono[300],
|
|
625
|
+
gradEnd: mono[400],
|
|
626
|
+
borderOuter: mono[600],
|
|
627
|
+
borderInner: mono[300],
|
|
628
|
+
color: mono[100]
|
|
629
|
+
}
|
|
595
630
|
};
|
|
596
631
|
});
|
|
597
|
-
function getColorForField(field) {
|
|
632
|
+
function getColorForField(field, property = "gradStart") {
|
|
598
633
|
const nestingLevel = field?.field.nestingLevel || 0;
|
|
599
634
|
if (nestingLevel >= 3) {
|
|
600
|
-
return
|
|
635
|
+
return fieldRenderPalette.value[3][property];
|
|
601
636
|
} else if (nestingLevel >= 2) {
|
|
602
|
-
return
|
|
637
|
+
return fieldRenderPalette.value[2][property];
|
|
603
638
|
} else if (nestingLevel >= 1) {
|
|
604
|
-
return
|
|
639
|
+
return fieldRenderPalette.value[1][property];
|
|
605
640
|
}
|
|
606
|
-
return
|
|
641
|
+
return fieldRenderPalette.value[0][property];
|
|
607
642
|
}
|
|
608
|
-
const
|
|
643
|
+
const activeBackgroundColorRgb = computed(() => {
|
|
609
644
|
if (active.value?.type === "drop-area") {
|
|
610
645
|
return theme.teal.value.normal;
|
|
611
646
|
}
|
|
@@ -614,9 +649,21 @@ const activeColorRgb = computed(() => {
|
|
|
614
649
|
}
|
|
615
650
|
return getColorForField(active.value?.field);
|
|
616
651
|
});
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
652
|
+
function joinRgb(rgb) {
|
|
653
|
+
return rgb.join(" ");
|
|
654
|
+
}
|
|
655
|
+
const activeColor = computed(() => {
|
|
656
|
+
if (active.value?.type === "drop-area") {
|
|
657
|
+
return joinRgb(theme.teal.value.light);
|
|
658
|
+
}
|
|
659
|
+
if (!active.value) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
662
|
+
return joinRgb(getColorForField(active.value?.field, "color"));
|
|
663
|
+
});
|
|
664
|
+
const activeBackgroundColorHex = computed(() => {
|
|
665
|
+
if (activeBackgroundColorRgb.value) {
|
|
666
|
+
return joinRgb(activeBackgroundColorRgb.value);
|
|
620
667
|
}
|
|
621
668
|
return "";
|
|
622
669
|
});
|
|
@@ -654,15 +701,42 @@ const activeHoverFieldNestingLevel = computed(() => {
|
|
|
654
701
|
const uniforms = computed(() => {
|
|
655
702
|
const index = active.value?.index;
|
|
656
703
|
return {
|
|
657
|
-
u_color_field_0: toShaderColor(fieldColors.value[0]),
|
|
658
|
-
u_color_field_1: toShaderColor(fieldColors.value[1]),
|
|
659
|
-
u_color_field_2: toShaderColor(fieldColors.value[2]),
|
|
660
|
-
u_color_field_3: toShaderColor(fieldColors.value[3]),
|
|
661
704
|
u_color_hover_area: toShaderColor(activeHoverColor.value),
|
|
662
705
|
u_color_area: toShaderColor(theme.teal.value.normal),
|
|
706
|
+
u_drop_area: [
|
|
707
|
+
...toShaderColor(theme.teal.value.light),
|
|
708
|
+
...toShaderColor(theme.teal.value.normal),
|
|
709
|
+
...toShaderColor(theme.teal.value.dark),
|
|
710
|
+
...toShaderColor(theme.teal.value.light)
|
|
711
|
+
],
|
|
712
|
+
u_field_0: [
|
|
713
|
+
...toShaderColor(fieldRenderPalette.value[0].gradStart),
|
|
714
|
+
...toShaderColor(fieldRenderPalette.value[0].gradEnd),
|
|
715
|
+
...toShaderColor(fieldRenderPalette.value[0].borderOuter),
|
|
716
|
+
...toShaderColor(fieldRenderPalette.value[0].borderInner)
|
|
717
|
+
],
|
|
718
|
+
u_field_1: [
|
|
719
|
+
...toShaderColor(fieldRenderPalette.value[1].gradStart),
|
|
720
|
+
...toShaderColor(fieldRenderPalette.value[1].gradEnd),
|
|
721
|
+
...toShaderColor(fieldRenderPalette.value[1].borderOuter),
|
|
722
|
+
...toShaderColor(fieldRenderPalette.value[1].borderInner)
|
|
723
|
+
],
|
|
724
|
+
u_field_2: [
|
|
725
|
+
...toShaderColor(fieldRenderPalette.value[2].gradStart),
|
|
726
|
+
...toShaderColor(fieldRenderPalette.value[2].gradEnd),
|
|
727
|
+
...toShaderColor(fieldRenderPalette.value[2].borderOuter),
|
|
728
|
+
...toShaderColor(fieldRenderPalette.value[2].borderInner)
|
|
729
|
+
],
|
|
730
|
+
u_field_3: [
|
|
731
|
+
...toShaderColor(fieldRenderPalette.value[3].gradStart),
|
|
732
|
+
...toShaderColor(fieldRenderPalette.value[3].gradEnd),
|
|
733
|
+
...toShaderColor(fieldRenderPalette.value[3].borderOuter),
|
|
734
|
+
...toShaderColor(fieldRenderPalette.value[3].borderInner)
|
|
735
|
+
],
|
|
663
736
|
u_active_rect_id: index === void 0 ? -1 : index,
|
|
664
737
|
u_active_hover_rect: activeHoverRect.value,
|
|
665
|
-
u_active_hover_nesting_level: activeHoverFieldNestingLevel.value
|
|
738
|
+
u_active_hover_nesting_level: activeHoverFieldNestingLevel.value,
|
|
739
|
+
u_field_min_size: FIELD_MIN_DRAW_SIZE
|
|
666
740
|
};
|
|
667
741
|
});
|
|
668
742
|
const dragBox = ref({
|
|
@@ -725,7 +799,8 @@ const { collector } = defineRenderer("drop-targets", {
|
|
|
725
799
|
x: 0,
|
|
726
800
|
y: 0,
|
|
727
801
|
width: ui.artboardSize.value.width,
|
|
728
|
-
height: ui.artboardSize.value.height
|
|
802
|
+
height: ui.artboardSize.value.height,
|
|
803
|
+
state: 0
|
|
729
804
|
},
|
|
730
805
|
5 /* ACTIVE_AREA */,
|
|
731
806
|
false
|
|
@@ -801,16 +876,32 @@ const { collector } = defineRenderer("drop-targets", {
|
|
|
801
876
|
if (rect.id === "active-hover-rect") {
|
|
802
877
|
continue;
|
|
803
878
|
}
|
|
879
|
+
const isActive = active.value?.id === rect.id;
|
|
880
|
+
let drawX = rect.x;
|
|
881
|
+
let drawY = rect.y;
|
|
882
|
+
let drawWidth = rect.width;
|
|
883
|
+
let drawHeight = rect.height;
|
|
884
|
+
if (!isActive && rect.type === "field") {
|
|
885
|
+
const isVertical = rect.id.includes(":empty:") || rect.field?.orientation === "vertical";
|
|
886
|
+
if (isVertical) {
|
|
887
|
+
drawHeight = Math.min(FIELD_MIN_DRAW_SIZE, rect.height);
|
|
888
|
+
drawY = rect.y + (rect.height - drawHeight) / 2;
|
|
889
|
+
} else {
|
|
890
|
+
drawWidth = Math.min(FIELD_MIN_DRAW_SIZE, rect.width);
|
|
891
|
+
drawX = rect.x + (rect.width - drawWidth) / 2;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
const isField = rect.type === "field";
|
|
804
895
|
if (active.value?.id === rect.id) {
|
|
805
|
-
ctx2d.fillStyle = rect.color;
|
|
896
|
+
ctx2d.fillStyle = isField ? rgbaToString(getColorForField(rect.field)) : rect.color;
|
|
806
897
|
} else {
|
|
807
|
-
ctx2d.fillStyle = rect.colorAlpha;
|
|
898
|
+
ctx2d.fillStyle = isField ? rgbaToString(getColorForField(rect.field), 0.7) : rect.colorAlpha;
|
|
808
899
|
}
|
|
809
900
|
ctx2d.fillRect(
|
|
810
|
-
(
|
|
811
|
-
(
|
|
812
|
-
|
|
813
|
-
|
|
901
|
+
(drawX * scale + offset.x) * ctx.dpi,
|
|
902
|
+
(drawY * scale + offset.y) * ctx.dpi,
|
|
903
|
+
drawWidth * ctx.dpi * scale,
|
|
904
|
+
drawHeight * ctx.dpi * scale
|
|
814
905
|
);
|
|
815
906
|
}
|
|
816
907
|
}
|
|
@@ -6,32 +6,43 @@ in vec2 a_position;
|
|
|
6
6
|
in vec4 a_quad;
|
|
7
7
|
in float a_rect_id;
|
|
8
8
|
in float a_rect_type;
|
|
9
|
+
in float a_state;
|
|
9
10
|
|
|
10
11
|
uniform float u_scale;
|
|
11
12
|
uniform float u_offset_x;
|
|
12
13
|
uniform float u_offset_y;
|
|
13
14
|
uniform vec2 u_resolution;
|
|
14
15
|
uniform float u_active_rect_id;
|
|
15
|
-
uniform vec3 u_color_field_0;
|
|
16
|
-
uniform vec3 u_color_field_1;
|
|
17
|
-
uniform vec3 u_color_field_2;
|
|
18
|
-
uniform vec3 u_color_field_3;
|
|
19
16
|
uniform vec3 u_color_area;
|
|
20
17
|
uniform vec3 u_color_hover_area;
|
|
21
18
|
uniform vec4 u_active_hover_rect;
|
|
22
19
|
uniform float u_active_hover_nesting_level;
|
|
20
|
+
uniform float u_field_min_size;
|
|
23
21
|
uniform float u_dpi;
|
|
22
|
+
uniform vec3 u_field_0[4];
|
|
23
|
+
uniform vec3 u_field_1[4];
|
|
24
|
+
uniform vec3 u_field_2[4];
|
|
25
|
+
uniform vec3 u_field_3[4];
|
|
26
|
+
uniform vec3 u_drop_area[4];
|
|
24
27
|
|
|
25
28
|
out vec4 v_quad;
|
|
26
29
|
out float v_intersecting;
|
|
27
30
|
out float v_is_hover_area;
|
|
31
|
+
out float v_is_field;
|
|
32
|
+
out float v_is_drop_area;
|
|
33
|
+
out float v_is_vertical;
|
|
28
34
|
out vec3 v_color;
|
|
35
|
+
out vec3 v_grad_start;
|
|
36
|
+
out vec3 v_grad_end;
|
|
37
|
+
out vec3 v_border_outer;
|
|
38
|
+
out vec3 v_border_inner;
|
|
29
39
|
|
|
30
40
|
// Optimized varyings - values computed once per vertex instead of per pixel
|
|
31
41
|
out vec2 v_size;
|
|
32
42
|
out vec2 v_location;
|
|
33
43
|
out vec2 v_size_inner;
|
|
34
44
|
out float v_thickness;
|
|
45
|
+
out float v_border_width;
|
|
35
46
|
out float v_edge_softness;
|
|
36
47
|
out float v_radius_outer;
|
|
37
48
|
out float v_radius_inner;
|
|
@@ -46,8 +57,38 @@ vec4 getQuad() {
|
|
|
46
57
|
return a_quad;
|
|
47
58
|
}
|
|
48
59
|
|
|
60
|
+
vec3 getFieldColor(int idx, int kind) {
|
|
61
|
+
// kind: 0=gradStart, 1=gradEnd, 2=borderOuter, 3=borderInner
|
|
62
|
+
if (idx == 1) {
|
|
63
|
+
return u_field_1[kind];
|
|
64
|
+
} else if (idx == 2) {
|
|
65
|
+
return u_field_2[kind];
|
|
66
|
+
} else if (idx == 3) {
|
|
67
|
+
return u_field_3[kind];
|
|
68
|
+
}
|
|
69
|
+
return u_field_0[kind];
|
|
70
|
+
}
|
|
71
|
+
|
|
49
72
|
void main() {
|
|
50
73
|
vec4 quad = getQuad();
|
|
74
|
+
|
|
75
|
+
bool is_field = a_rect_type >= 1.0 && a_rect_type < 5.0;
|
|
76
|
+
bool is_active = a_rect_id == u_active_rect_id;
|
|
77
|
+
bool is_empty = a_state > 1.5;
|
|
78
|
+
bool is_vertical_shrink = a_state > 0.5;
|
|
79
|
+
|
|
80
|
+
if (is_field && !is_active) {
|
|
81
|
+
float minSize = u_field_min_size;
|
|
82
|
+
if (is_vertical_shrink) {
|
|
83
|
+
float newHeight = min(minSize, quad.w);
|
|
84
|
+
quad.y += (quad.w - newHeight) * 0.5;
|
|
85
|
+
quad.w = newHeight;
|
|
86
|
+
} else {
|
|
87
|
+
float newWidth = min(minSize, quad.z);
|
|
88
|
+
quad.x += (quad.z - newWidth) * 0.5;
|
|
89
|
+
quad.z = newWidth;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
51
92
|
vec2 offsetPosition = a_position * u_scale;
|
|
52
93
|
offsetPosition.x += u_offset_x;
|
|
53
94
|
offsetPosition.y += u_offset_y;
|
|
@@ -72,6 +113,9 @@ void main() {
|
|
|
72
113
|
v_quad = transformed_quad;
|
|
73
114
|
|
|
74
115
|
v_is_hover_area = a_rect_type >= 5.0 ? 1.0 : 0.0;
|
|
116
|
+
v_is_field = a_rect_type >= 1.0 && a_rect_type < 5.0 ? 1.0 : 0.0;
|
|
117
|
+
v_is_drop_area = a_rect_type < 1.0 ? 1.0 : 0.0;
|
|
118
|
+
v_is_vertical = is_empty ? 0.0 : (is_vertical_shrink ? 1.0 : 0.0);
|
|
75
119
|
|
|
76
120
|
bool is_drop_target = a_rect_type <= 0.5;
|
|
77
121
|
|
|
@@ -79,52 +123,61 @@ void main() {
|
|
|
79
123
|
if (a_rect_type < 1.0) {
|
|
80
124
|
v_color = u_color_area;
|
|
81
125
|
} else if (a_rect_type < 2.0) {
|
|
82
|
-
v_color =
|
|
126
|
+
v_color = u_color_area;
|
|
83
127
|
} else if (a_rect_type < 3.0) {
|
|
84
|
-
v_color =
|
|
128
|
+
v_color = u_color_area;
|
|
85
129
|
} else if (a_rect_type < 4.0) {
|
|
86
|
-
v_color =
|
|
130
|
+
v_color = u_color_area;
|
|
87
131
|
} else if (a_rect_type < 5.0) {
|
|
88
|
-
v_color =
|
|
132
|
+
v_color = u_color_area;
|
|
89
133
|
} else {
|
|
90
134
|
v_color = u_color_hover_area;
|
|
91
135
|
}
|
|
92
136
|
|
|
137
|
+
if (v_is_field >= 0.5) {
|
|
138
|
+
int idx = int(floor(a_rect_type - 1.0));
|
|
139
|
+
idx = int(clamp(float(idx), 0.0, 3.0));
|
|
140
|
+
v_grad_start = getFieldColor(idx, 0);
|
|
141
|
+
v_grad_end = getFieldColor(idx, 1);
|
|
142
|
+
v_border_outer = getFieldColor(idx, 2);
|
|
143
|
+
v_border_inner = getFieldColor(idx, 3);
|
|
144
|
+
} else if (v_is_drop_area >= 0.5) {
|
|
145
|
+
v_grad_start = u_drop_area[0];
|
|
146
|
+
v_grad_end = u_drop_area[1];
|
|
147
|
+
v_border_outer = u_drop_area[2];
|
|
148
|
+
v_border_inner = u_drop_area[3];
|
|
149
|
+
} else {
|
|
150
|
+
v_grad_start = v_color;
|
|
151
|
+
v_grad_end = v_color;
|
|
152
|
+
v_border_outer = v_color;
|
|
153
|
+
v_border_inner = v_color;
|
|
154
|
+
}
|
|
155
|
+
|
|
93
156
|
// Compute values that are constant per quad (optimization)
|
|
94
157
|
bool isHoverArea = v_is_hover_area >= 1.0;
|
|
95
158
|
float stroke = isHoverArea ? 0.5 : 1.0;
|
|
96
|
-
float radiusBase =
|
|
159
|
+
float radiusBase = 4.0;
|
|
97
160
|
|
|
98
161
|
v_thickness = max(min(1.0 * u_scale, 3.0), 0.5);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
float u_rect_x = transformed_quad.x + inset;
|
|
105
|
-
float u_rect_y = transformed_quad.y + inset;
|
|
106
|
-
float u_rectWidth = transformed_quad.z - 2.0 * inset;
|
|
107
|
-
float u_rectHeight = transformed_quad.w - 2.0 * inset;
|
|
108
|
-
|
|
109
|
-
v_size = vec2(u_rectWidth, u_rectHeight);
|
|
110
|
-
|
|
111
|
-
// Center position of the rectangle
|
|
112
|
-
v_location = vec2(u_rect_x + v_size.x / 2.0, u_rect_y + v_size.y / 2.0);
|
|
162
|
+
v_size = vec2(transformed_quad.z, transformed_quad.w);
|
|
163
|
+
v_location = vec2(
|
|
164
|
+
transformed_quad.x + v_size.x / 2.0,
|
|
165
|
+
transformed_quad.y + v_size.y / 2.0
|
|
166
|
+
);
|
|
113
167
|
|
|
114
168
|
v_edge_softness = 0.5 * u_dpi;
|
|
115
169
|
|
|
116
170
|
float borderWidth = stroke * u_scale * u_dpi;
|
|
171
|
+
float maxBorder = min(v_size.x, v_size.y) * 0.25;
|
|
172
|
+
borderWidth = min(borderWidth, maxBorder);
|
|
173
|
+
v_border_width = borderWidth;
|
|
117
174
|
|
|
118
|
-
// Different radius for inner and outer
|
|
175
|
+
// Different radius for inner and outer (based on full quad size)
|
|
119
176
|
v_radius_outer =
|
|
120
|
-
min(radiusBase * u_dpi, min(v_size.x, v_size.y)
|
|
121
|
-
v_radius_inner = v_radius_outer - borderWidth;
|
|
177
|
+
min(radiusBase * u_dpi, min(v_size.x, v_size.y) / 2.0);
|
|
178
|
+
v_radius_inner = max(v_radius_outer - borderWidth, 0.0);
|
|
122
179
|
|
|
123
180
|
v_size_inner = v_size - 2.0 * borderWidth;
|
|
124
181
|
|
|
125
|
-
|
|
126
|
-
v_fill_alpha = v_intersecting >= 0.5 ? 0.5 : 0.2;
|
|
127
|
-
} else {
|
|
128
|
-
v_fill_alpha = v_intersecting >= 0.5 ? 1.0 : 0.2;
|
|
129
|
-
}
|
|
182
|
+
v_fill_alpha = v_is_hover_area >= 1.0 ? 0.5 : 1.0;
|
|
130
183
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Renderer
|
|
3
3
|
v-if="dragItems.length && isVisible"
|
|
4
|
-
v-slot="{ color, label }"
|
|
4
|
+
v-slot="{ backgroundColor, color, label }"
|
|
5
5
|
:items="dragItems"
|
|
6
6
|
:box="box"
|
|
7
7
|
:mouse-x="mouseX"
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
:start-coords="startCoords"
|
|
16
16
|
:items="dragItems"
|
|
17
17
|
:is-touch="isTouching"
|
|
18
|
-
:
|
|
18
|
+
:background-color
|
|
19
|
+
:color
|
|
19
20
|
:active-label="label"
|
|
20
21
|
/>
|
|
21
22
|
</Renderer>
|
|
@@ -23,7 +23,10 @@ defineBlokkliFeature({
|
|
|
23
23
|
description: "Provides an action to edit a block.",
|
|
24
24
|
requiredAdapterMethods: ["formFrameBuilder"]
|
|
25
25
|
});
|
|
26
|
-
const { eventBus, selection, state, $t, adapter, definitions } = useBlokkli();
|
|
26
|
+
const { eventBus, selection, state, $t, adapter, definitions, permissions } = useBlokkli();
|
|
27
|
+
const userCanEditLibraryItems = computed(
|
|
28
|
+
() => permissions.hasPermission("edit_library_item")
|
|
29
|
+
);
|
|
27
30
|
const canEdit = computed(() => {
|
|
28
31
|
const item = selection.item.value;
|
|
29
32
|
if (!item) {
|
|
@@ -38,6 +41,9 @@ const canEdit = computed(() => {
|
|
|
38
41
|
return false;
|
|
39
42
|
}
|
|
40
43
|
if (item.library?.libraryItemUuid) {
|
|
44
|
+
if (!userCanEditLibraryItems.value) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
41
47
|
return !!adapter.getLibraryItemEditUrl && (state.editMode.value === "editing" || state.editMode.value === "translating") && !item.isNew;
|
|
42
48
|
}
|
|
43
49
|
return state.editMode.value === "editing";
|