@blokkli/editor 2.0.0-alpha.62 → 2.0.0-alpha.64
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/types/blockOptions.d.ts +32 -27
- package/dist/global/types/colorOptions.d.ts +16 -0
- package/dist/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +275 -18
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +2 -1
- package/dist/modules/agent/runtime/app/components/Attachment/PreviewCsv/index.vue +1 -1
- package/dist/modules/agent/runtime/app/components/Conversation/Item/Assistant/index.vue +14 -5
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/ConversationsTab/Item.vue +2 -2
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/RatingsTab/Item.vue +2 -2
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/ConversationDetail.vue +2 -2
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.d.vue.ts +1 -1
- package/dist/modules/agent/runtime/app/features/agent/ConversationsAdmin/SplitView/index.vue.d.ts +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Panel/Input/Actions/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Panel/Welcome/index.vue +1 -1
- package/dist/modules/agent/runtime/app/features/agent/Transcript/MessageContent.vue +14 -1
- package/dist/modules/agent/runtime/app/features/agent/Transcript/index.vue +31 -13
- package/dist/modules/agent/runtime/app/features/agent/index.vue +1 -1
- package/dist/modules/agent/runtime/app/helpers/linkifyBlockUuids.d.ts +11 -0
- package/dist/modules/agent/runtime/app/helpers/linkifyBlockUuids.js +47 -0
- package/dist/modules/agent/runtime/app/tools/add_content_search_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_fragment/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_media_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_reusable_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/add_template/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/ask_question/Component.vue +1 -1
- package/dist/modules/agent/runtime/app/tools/ask_question/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.d.vue.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue +28 -26
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/Component.vue.d.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/auto_translate_paragraphs/index.d.ts +16 -1
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.d.vue.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue +59 -16
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/Component.vue.d.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/delegate_text_rewrite/index.d.ts +15 -0
- package/dist/modules/agent/runtime/app/tools/delete_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/detach_reusable_paragraph/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/duplicate_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.d.ts +85 -15
- package/dist/modules/agent/runtime/app/tools/fieldDiffApproval.js +136 -28
- package/dist/modules/agent/runtime/app/tools/find_paragraphs/index.d.ts +2 -2
- package/dist/modules/agent/runtime/app/tools/get_bundle_info/index.js +6 -2
- package/dist/modules/agent/runtime/app/tools/get_content_fields/index.d.ts +3 -3
- package/dist/modules/agent/runtime/app/tools/get_paragraph_context/index.d.ts +5 -5
- package/dist/modules/agent/runtime/app/tools/get_paragraphs_in_viewport/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/get_referenced_entities/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/go_to_history_index/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/move_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/rearrange_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/replace_content_search_item/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/replace_media_field/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/schemas.d.ts +17 -7
- package/dist/modules/agent/runtime/app/tools/schemas.js +29 -12
- package/dist/modules/agent/runtime/app/tools/search_text/index.js +1 -1
- package/dist/modules/agent/runtime/app/tools/set_paragraph_options/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/swap_paragraphs/index.d.ts +1 -1
- package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.d.vue.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.vue +54 -30
- package/dist/modules/agent/runtime/app/tools/update_text_fields/Component.vue.d.ts +22 -0
- package/dist/modules/agent/runtime/app/tools/update_text_fields/index.d.ts +18 -3
- package/dist/modules/agent/runtime/server/classes/FieldStreamParser/index.js +10 -15
- package/dist/modules/agent/runtime/server/default-system-prompts/architecture.js +1 -1
- package/dist/modules/agent/runtime/server/default-system-prompts/important-rules.js +1 -0
- package/dist/modules/agent/runtime/shared/toolParams.d.ts +3 -3
- package/dist/modules/agent/runtime/shared/types.d.ts +3 -3
- package/dist/modules/charts/index.d.mts +14 -1
- package/dist/modules/charts/index.mjs +37 -2
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.d.ts +1 -1
- package/dist/modules/charts/runtime/blokkli/tools/chart_schemas.js +12 -5
- package/dist/modules/charts/runtime/components/ChartRenderer/index.vue +7 -16
- package/dist/modules/charts/runtime/features/charts/Editor/AdvancedConfigPanel/index.vue +1 -1
- package/dist/modules/charts/runtime/features/charts/Editor/ChartTypeOptions/Field.vue +19 -9
- package/dist/modules/charts/runtime/features/charts/Editor/ColorDropdown/index.vue +7 -77
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/OutputPreviewTable/index.vue +1 -1
- package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/csvHelpers.d.ts +1 -1
- package/dist/modules/charts/runtime/features/charts/Editor/DataTable/index.vue +16 -8
- package/dist/modules/charts/runtime/features/charts/Editor/NumberFormatEditor/index.vue +23 -7
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +5 -6
- package/dist/modules/charts/runtime/features/charts/Editor/useChartEditorState.d.ts +1 -1
- package/dist/modules/charts/runtime/helpers/index.d.ts +2 -1
- package/dist/modules/charts/runtime/helpers/index.js +4 -2
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliMutationResult.graphql +3 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/runtime/adapter/index.js +5 -1
- package/dist/modules/iframes/index.d.mts +1 -1
- package/dist/modules/index.d.mts +1 -1
- package/dist/modules/readability/index.d.mts +1 -1
- package/dist/modules/readability/index.mjs +2 -1
- package/dist/modules/table-of-contents/index.d.mts +1 -1
- package/dist/runtime/components/Blocks/NotImplemented/index.vue +1 -1
- package/dist/runtime/composables/useBlokkliRuntimeConfig.d.ts +50 -0
- package/dist/runtime/composables/useBlokkliRuntimeConfig.js +34 -0
- package/dist/runtime/editor/adapter/index.d.ts +2 -1
- package/dist/runtime/editor/components/Actions/Title/index.vue +1 -1
- package/dist/runtime/editor/components/Actions/index.vue +1 -1
- package/dist/runtime/editor/components/ArtboardTooltip/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue +2 -2
- package/dist/runtime/editor/components/ArtboardTooltip/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/Avatar/index.vue +1 -1
- package/dist/runtime/editor/components/BlockPreviewItem/index.vue +1 -1
- package/dist/runtime/editor/components/BlockPreviewRenderer/index.vue +1 -1
- package/dist/runtime/editor/components/BlockProxy/index.vue +1 -1
- package/dist/runtime/editor/components/BlokkliRootErrorBoundary.vue +1 -1
- package/dist/runtime/editor/components/BundleSelector/index.vue +1 -1
- package/dist/runtime/editor/components/ColorDropdown/index.d.vue.ts +26 -0
- package/dist/runtime/editor/components/ColorDropdown/index.vue +116 -0
- package/dist/runtime/editor/components/ColorDropdown/index.vue.d.ts +26 -0
- package/dist/runtime/editor/components/Dialog/index.vue +1 -1
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.d.vue.ts +14 -20
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue +97 -52
- package/dist/runtime/editor/components/DiffApproval/Highlight/Item.vue.d.ts +14 -20
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.d.vue.ts +6 -6
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue +30 -21
- package/dist/runtime/editor/components/DiffApproval/Highlight/index.vue.d.ts +6 -6
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.d.vue.ts +19 -9
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue +19 -10
- package/dist/runtime/editor/components/DiffApproval/Toolbar/index.vue.d.ts +19 -9
- package/dist/runtime/editor/components/DiffApproval/index.d.vue.ts +14 -6
- package/dist/runtime/editor/components/DiffApproval/index.vue +62 -35
- package/dist/runtime/editor/components/DiffApproval/index.vue.d.ts +14 -6
- package/dist/runtime/editor/components/DiffApproval/types.d.ts +32 -0
- package/dist/runtime/editor/components/DiffApproval/types.js +20 -0
- package/dist/runtime/editor/components/DiffViewer/State.vue +1 -1
- package/dist/runtime/editor/components/DraggableList.vue +1 -1
- package/dist/runtime/editor/components/Dropdown/index.d.vue.ts +6 -4
- package/dist/runtime/editor/components/Dropdown/index.vue +91 -31
- package/dist/runtime/editor/components/Dropdown/index.vue.d.ts +6 -4
- package/dist/runtime/editor/components/DropdownItem/index.vue +1 -1
- package/dist/runtime/editor/components/EditIndicator.vue +1 -1
- package/dist/runtime/editor/components/EditProvider.vue +2 -2
- package/dist/runtime/editor/components/FileDropHandler/index.vue +1 -1
- package/dist/runtime/editor/components/FlexTextarea/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/FlexTextarea/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Form/RadioTabs/index.vue +1 -1
- package/dist/runtime/editor/components/Form/Search/index.d.vue.ts +1 -0
- package/dist/runtime/editor/components/Form/Search/index.vue +2 -2
- package/dist/runtime/editor/components/Form/Search/index.vue.d.ts +1 -0
- package/dist/runtime/editor/components/FormOverlay/index.vue +1 -1
- package/dist/runtime/editor/components/Icon/index.vue +1 -1
- package/dist/runtime/editor/components/Indicators/index.vue +31 -100
- package/dist/runtime/editor/components/Konami/Game/index.vue +1 -1
- package/dist/runtime/editor/components/Messages/index.vue +1 -1
- package/dist/runtime/editor/components/NestedEditorOverlay/index.d.vue.ts +3 -2
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +5 -4
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue.d.ts +3 -2
- package/dist/runtime/editor/components/Overlay/index.vue +1 -1
- package/dist/runtime/editor/components/Pagination/index.vue +1 -1
- package/dist/runtime/editor/components/Panel/Section/index.vue +1 -1
- package/dist/runtime/editor/components/Panel/Tabs/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Panel/Tabs/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/PluginConfigForm/index.vue +1 -1
- package/dist/runtime/editor/components/PluginConfigFormInline/FilterSelect/index.vue +1 -1
- package/dist/runtime/editor/components/PluginConfigFormInline/index.vue +1 -1
- package/dist/runtime/editor/components/Popup/index.vue +1 -1
- package/dist/runtime/editor/components/PopupHost/index.d.vue.ts +13 -0
- package/dist/runtime/editor/components/PopupHost/index.vue +12 -0
- package/dist/runtime/editor/components/PopupHost/index.vue.d.ts +13 -0
- package/dist/runtime/editor/components/PreviewProvider.vue +3 -2
- package/dist/runtime/editor/components/RelativeTime/index.vue +7 -13
- package/dist/runtime/editor/components/Resizable/index.vue +1 -1
- package/dist/runtime/editor/components/RichText/Editor/index.vue +1 -1
- package/dist/runtime/editor/components/ScaleToFit/index.vue +1 -1
- package/dist/runtime/editor/components/SearchOverlay/index.vue +1 -1
- package/dist/runtime/editor/components/SidebarFloater/index.vue +1 -1
- package/dist/runtime/editor/components/StatusIcon/index.vue +1 -1
- package/dist/runtime/editor/components/StatusIndicator/index.vue +1 -1
- package/dist/runtime/editor/components/SystemRequirements/index.vue +1 -1
- package/dist/runtime/editor/components/Tabs/index.d.vue.ts +1 -1
- package/dist/runtime/editor/components/Tabs/index.vue.d.ts +1 -1
- package/dist/runtime/editor/components/Toolbar/ViewOptions/List/Button/index.vue +2 -1
- package/dist/runtime/editor/components/Toolbar/index.vue +1 -1
- package/dist/runtime/editor/components/Transition/Collapse/index.vue +1 -1
- package/dist/runtime/editor/components/Transition/List/index.vue +1 -1
- package/dist/runtime/editor/components/index.d.ts +2 -0
- package/dist/runtime/editor/components/index.js +2 -0
- package/dist/runtime/editor/composables/defineViewOption.js +5 -1
- package/dist/runtime/editor/composables/useStickyToolbar.js +1 -4
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/features/add-list/Help/index.vue +1 -1
- package/dist/runtime/editor/features/add-list/index.vue +1 -1
- package/dist/runtime/editor/features/analyze/Main.vue +15 -2
- package/dist/runtime/editor/features/analyze/Results/ResultsItemNodes.vue +4 -1
- package/dist/runtime/editor/features/analyze/Results/ResultsItemNodesTarget.vue +25 -16
- package/dist/runtime/editor/features/analyze/analyzers/defaults/validations.d.ts +10 -0
- package/dist/runtime/editor/features/analyze/analyzers/defaults/validations.js +39 -0
- package/dist/runtime/editor/features/analyze/analyzers/helpers/Context.d.ts +5 -1
- package/dist/runtime/editor/features/analyze/analyzers/helpers/Context.js +5 -0
- package/dist/runtime/editor/features/analyze/index.vue +1 -2
- package/dist/runtime/editor/features/anchors/Overlay/index.vue +11 -5
- package/dist/runtime/editor/features/anchors/index.vue +2 -1
- package/dist/runtime/editor/features/artboard/Overview/index.vue +1 -1
- package/dist/runtime/editor/features/artboard/Renderer.vue +1 -1
- package/dist/runtime/editor/features/artboard/Scrollbar/index.vue +1 -1
- package/dist/runtime/editor/features/block-scheduler/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/block-transfer/index.vue +1 -1
- package/dist/runtime/editor/features/breadcrumbs/index.vue +1 -1
- package/dist/runtime/editor/features/changelog/changelog.json +17 -1
- package/dist/runtime/editor/features/clipboard/DropElement/index.vue +1 -1
- package/dist/runtime/editor/features/comments/AddForm/index.vue +1 -1
- package/dist/runtime/editor/features/comments/Comment/Meta/index.vue +1 -1
- package/dist/runtime/editor/features/comments/Comment/index.vue +1 -1
- package/dist/runtime/editor/features/comments/Thread/index.vue +1 -1
- package/dist/runtime/editor/features/complex-options/index.vue +1 -0
- package/dist/runtime/editor/features/debug/Main.vue +1 -1
- package/dist/runtime/editor/features/dev-mode/index.vue +1 -1
- package/dist/runtime/editor/features/dragging-overlay/DragItems/index.vue +1 -1
- package/dist/runtime/editor/features/dragging-overlay/index.vue +1 -1
- package/dist/runtime/editor/features/droppable-field-edit/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/Frame/index.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.d.vue.ts +1 -5
- package/dist/runtime/editor/features/editable-field/Overlay/Plaintext/index.vue.d.ts +1 -5
- package/dist/runtime/editor/features/editable-field/Overlay/ReadabilityIndicator/ChunkOverlay.vue +1 -1
- package/dist/runtime/editor/features/editable-field/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/editable-mask/index.vue +1 -1
- package/dist/runtime/editor/features/entity-title/index.vue +17 -7
- package/dist/runtime/editor/features/help/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/help/Shortcuts/index.vue +1 -1
- package/dist/runtime/editor/features/history/List/index.vue +1 -1
- package/dist/runtime/editor/features/import-existing/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/library/index.vue +1 -0
- package/dist/runtime/editor/features/media-library/index.vue +1 -1
- package/dist/runtime/editor/features/options/Form/Item.vue +5 -12
- package/dist/runtime/editor/features/options/Form/Radios/index.d.vue.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Radios/index.vue +8 -5
- package/dist/runtime/editor/features/options/Form/Radios/index.vue.d.ts +5 -4
- package/dist/runtime/editor/features/options/Form/Text/index.d.vue.ts +4 -0
- package/dist/runtime/editor/features/options/Form/Text/index.vue +11 -3
- package/dist/runtime/editor/features/options/Form/Text/index.vue.d.ts +4 -0
- package/dist/runtime/editor/features/options/index.vue +1 -1
- package/dist/runtime/editor/features/publish/Dialog/Item.vue +4 -7
- package/dist/runtime/editor/features/publish/Dialog/PublishOption.vue +1 -1
- package/dist/runtime/editor/features/publish/Dialog/Violations.d.vue.ts +12 -0
- package/dist/runtime/editor/features/publish/Dialog/Violations.vue +117 -0
- package/dist/runtime/editor/features/publish/Dialog/Violations.vue.d.ts +12 -0
- package/dist/runtime/editor/features/publish/Dialog/index.vue +61 -24
- package/dist/runtime/editor/features/publish/index.vue +2 -4
- package/dist/runtime/editor/features/publish/types.d.ts +0 -4
- package/dist/runtime/editor/features/referenced-entities/List/Item/index.vue +1 -0
- package/dist/runtime/editor/features/responsive-preview/Frame/index.vue +1 -1
- package/dist/runtime/editor/features/search/index.vue +1 -1
- package/dist/runtime/editor/features/selection/AddButtons/Renderer/index.vue +1 -1
- package/dist/runtime/editor/features/settings/Dialog/FeatureSetting/index.vue +1 -1
- package/dist/runtime/editor/features/settings/index.vue +1 -1
- package/dist/runtime/editor/features/structure/List/Item/index.vue +1 -1
- package/dist/runtime/editor/features/structure/index.vue +1 -1
- package/dist/runtime/editor/features/templates/DialogManageTemplates/Item.vue +1 -0
- package/dist/runtime/editor/features/templates/DialogManageTemplates/index.vue +1 -1
- package/dist/runtime/editor/features/theme/index.vue +1 -1
- package/dist/runtime/editor/features/touch-action-bar/Bar/index.vue +1 -1
- package/dist/runtime/editor/features/tour/Overlay/index.vue +1 -1
- package/dist/runtime/editor/features/transform/Dialog/index.vue +1 -1
- package/dist/runtime/editor/features/translations/SelectionTable/index.vue +1 -1
- package/dist/runtime/editor/features/workspace/index.vue +1 -1
- package/dist/runtime/editor/helpers/color/index.d.ts +7 -0
- package/dist/runtime/editor/helpers/color/index.js +14 -0
- package/dist/runtime/editor/helpers/diff/index.d.ts +98 -0
- package/dist/runtime/editor/helpers/diff/index.js +262 -0
- package/dist/runtime/editor/helpers/injections.d.ts +11 -0
- package/dist/runtime/editor/helpers/injections.js +1 -0
- package/dist/runtime/editor/helpers/options/index.d.ts +2 -0
- package/dist/runtime/editor/helpers/options/index.js +21 -0
- package/dist/runtime/editor/plugins/BlockIndicator/index.d.vue.ts +24 -1
- package/dist/runtime/editor/plugins/BlockIndicator/index.vue +17 -7
- package/dist/runtime/editor/plugins/BlockIndicator/index.vue.d.ts +24 -1
- package/dist/runtime/editor/plugins/ItemAction/index.d.vue.ts +1 -0
- package/dist/runtime/editor/plugins/ItemAction/index.vue +1 -1
- package/dist/runtime/editor/plugins/ItemAction/index.vue.d.ts +1 -0
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.d.vue.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/Detached/index.vue.d.ts +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.d.vue.ts +2 -2
- package/dist/runtime/editor/plugins/Sidebar/index.vue +1 -1
- package/dist/runtime/editor/plugins/Sidebar/index.vue.d.ts +2 -2
- package/dist/runtime/editor/plugins/ToolbarButton/index.vue +1 -1
- package/dist/runtime/editor/providers/analyze.js +5 -2
- package/dist/runtime/editor/providers/animation.d.ts +2 -0
- package/dist/runtime/editor/providers/config.d.ts +3 -1
- package/dist/runtime/editor/providers/config.js +46 -15
- package/dist/runtime/editor/providers/definition.d.ts +4 -3
- package/dist/runtime/editor/providers/definition.js +10 -2
- package/dist/runtime/editor/providers/plugin.d.ts +1 -0
- package/dist/runtime/editor/providers/state.d.ts +21 -0
- package/dist/runtime/editor/providers/state.js +10 -0
- package/dist/runtime/editor/translations/de.json +9 -4
- package/dist/runtime/editor/translations/fr.json +4 -4
- package/dist/runtime/editor/translations/gsw_CH.json +9 -4
- package/dist/runtime/editor/translations/it.json +4 -4
- package/dist/runtime/editor/types/state.d.ts +7 -0
- package/dist/runtime/editor/types/ui.d.ts +1 -0
- package/dist/runtime/helpers/colors.d.ts +39 -0
- package/dist/runtime/helpers/colors.js +28 -0
- package/dist/runtime/types/colors.d.ts +11 -0
- package/dist/shared/{editor.D28NbXr3.d.mts → editor.BDyiQvbV.d.mts} +434 -406
- package/dist/shared/{editor.Gu7mgJ5Q.mjs → editor.BGemL1Oh.mjs} +146 -146
- package/dist/types.d.mts +1 -1
- package/package.json +74 -82
- package/dist/runtime/editor/features/validations/Overlay/Item.d.vue.ts +0 -7
- package/dist/runtime/editor/features/validations/Overlay/Item.vue +0 -36
- package/dist/runtime/editor/features/validations/Overlay/Item.vue.d.ts +0 -7
- package/dist/runtime/editor/features/validations/Overlay/index.d.vue.ts +0 -7
- package/dist/runtime/editor/features/validations/Overlay/index.vue +0 -115
- package/dist/runtime/editor/features/validations/Overlay/index.vue.d.ts +0 -7
- package/dist/runtime/editor/features/validations/SidebarItem/index.d.vue.ts +0 -10
- package/dist/runtime/editor/features/validations/SidebarItem/index.vue +0 -41
- package/dist/runtime/editor/features/validations/SidebarItem/index.vue.d.ts +0 -10
- package/dist/runtime/editor/features/validations/index.d.vue.ts +0 -3
- package/dist/runtime/editor/features/validations/index.vue +0 -91
- package/dist/runtime/editor/features/validations/index.vue.d.ts +0 -3
- package/dist/runtime/editor/types/config.d.ts +0 -5
- /package/dist/runtime/{editor/types/config.js → types/colors.js} +0 -0
|
@@ -125,7 +125,7 @@ const tickmarks = computed(() => {
|
|
|
125
125
|
});
|
|
126
126
|
</script>
|
|
127
127
|
|
|
128
|
-
<style>/*! tailwindcss v4.
|
|
128
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
129
129
|
.bk .bk-input-range {
|
|
130
130
|
display: block;
|
|
131
131
|
width: 100%;
|
|
@@ -126,7 +126,7 @@ defineOptions({
|
|
|
126
126
|
});
|
|
127
127
|
</script>
|
|
128
128
|
|
|
129
|
-
<style>/*! tailwindcss v4.
|
|
129
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
130
130
|
:is(.bk-vars .bk-dragging-overlay-item) [bk-structure-uuid] {
|
|
131
131
|
background-color: rgb(var(--bk-theme-mono-100) / 1) !important;
|
|
132
132
|
}
|
|
@@ -99,7 +99,7 @@ export default {
|
|
|
99
99
|
};
|
|
100
100
|
</script>
|
|
101
101
|
|
|
102
|
-
<style>/*! tailwindcss v4.
|
|
102
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
103
103
|
.bk.bk-structure {
|
|
104
104
|
height: 100%;
|
|
105
105
|
overflow: auto;
|
|
@@ -110,7 +110,7 @@ watch(page, () => {
|
|
|
110
110
|
});
|
|
111
111
|
</script>
|
|
112
112
|
|
|
113
|
-
<style>/*! tailwindcss v4.
|
|
113
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
114
114
|
.bk .bk-templates-manage {
|
|
115
115
|
min-height: 70vh;
|
|
116
116
|
}
|
|
@@ -109,7 +109,7 @@ export default {
|
|
|
109
109
|
};
|
|
110
110
|
</script>
|
|
111
111
|
|
|
112
|
-
<style>/*! tailwindcss v4.
|
|
112
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
113
113
|
.bk.bk-theme-editor {
|
|
114
114
|
container-type: inline-size;
|
|
115
115
|
}
|
|
@@ -24,7 +24,7 @@ export default {
|
|
|
24
24
|
};
|
|
25
25
|
</script>
|
|
26
26
|
|
|
27
|
-
<style>/*! tailwindcss v4.
|
|
27
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
28
28
|
.bk.bk-touch-action-bar {
|
|
29
29
|
pointer-events: auto;
|
|
30
30
|
position: fixed;
|
|
@@ -227,7 +227,7 @@ useAnimationFrame(() => {
|
|
|
227
227
|
});
|
|
228
228
|
</script>
|
|
229
229
|
|
|
230
|
-
<style>/*! tailwindcss v4.
|
|
230
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
231
231
|
.bk.bk-tour {
|
|
232
232
|
position: fixed;
|
|
233
233
|
top: 0px;
|
|
@@ -225,7 +225,7 @@ onBeforeUnmount(() => {
|
|
|
225
225
|
});
|
|
226
226
|
</script>
|
|
227
227
|
|
|
228
|
-
<style>/*! tailwindcss v4.
|
|
228
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
229
229
|
.bk.bk-transform-overlay {
|
|
230
230
|
pointer-events: auto;
|
|
231
231
|
position: absolute;
|
|
@@ -32,7 +32,7 @@ defineProps({
|
|
|
32
32
|
defineEmits(["toggle-all"]);
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
|
-
<style>/*! tailwindcss v4.
|
|
35
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
36
36
|
.bk .bk-csv-table {
|
|
37
37
|
border-collapse: collapse;
|
|
38
38
|
}
|
|
@@ -3,4 +3,11 @@ export declare function toShaderColor(rgba: RGB): RGB;
|
|
|
3
3
|
export declare const rgbaToString: (color: RGB, alpha?: number) => string;
|
|
4
4
|
export declare function getContrastRatio(color1: RGB, color2: RGB): number;
|
|
5
5
|
export declare function findHighestContrastColor(colors: RGB[], backgroundColor?: RGB): RGB;
|
|
6
|
+
export declare const hexToRgb: (hex: string) => RGB | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Whether the given hex color is "light" — i.e. dark text on top of it would
|
|
9
|
+
* be more readable than light text. Use this to decide between black/white
|
|
10
|
+
* foreground content on a colored background. Unparseable hex → `false`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const isLightHex: (hex: string) => boolean;
|
|
6
13
|
export declare const parseColorString: (color: string) => RGB | undefined;
|
|
@@ -28,6 +28,20 @@ export function findHighestContrastColor(colors, backgroundColor = [255, 255, 25
|
|
|
28
28
|
}
|
|
29
29
|
return maxContrastColor;
|
|
30
30
|
}
|
|
31
|
+
export const hexToRgb = (hex) => {
|
|
32
|
+
const match = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
33
|
+
if (!match) return;
|
|
34
|
+
return [
|
|
35
|
+
Number.parseInt(match[1], 16),
|
|
36
|
+
Number.parseInt(match[2], 16),
|
|
37
|
+
Number.parseInt(match[3], 16)
|
|
38
|
+
];
|
|
39
|
+
};
|
|
40
|
+
export const isLightHex = (hex) => {
|
|
41
|
+
const rgb = hexToRgb(hex);
|
|
42
|
+
if (!rgb) return false;
|
|
43
|
+
return getContrastRatio(rgb, [0, 0, 0]) > getContrastRatio(rgb, [255, 255, 255]);
|
|
44
|
+
};
|
|
31
45
|
export const parseColorString = (color) => {
|
|
32
46
|
const rgbaRegex = /^rgba?\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})(?:,\s*(0|1|0?\.\d+))?\)$/;
|
|
33
47
|
const match = color.match(rgbaRegex);
|
|
@@ -21,3 +21,101 @@ export declare function computeDiff(before: string, after: string): string;
|
|
|
21
21
|
* <ins> rather than wrapping the block tags themselves.
|
|
22
22
|
*/
|
|
23
23
|
export declare function computeInsertion(after: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* One chunk of a field's diff that can be individually accepted or rejected
|
|
26
|
+
* by the user. A markup field becomes an ordered list of segments; lists
|
|
27
|
+
* (<ul>/<ol>) become a `list` segment whose children are the individual
|
|
28
|
+
* <li> atoms.
|
|
29
|
+
*
|
|
30
|
+
* Acceptance semantics (see `reassembleValue`):
|
|
31
|
+
* - matched: accepted → afterHtml, rejected → beforeHtml
|
|
32
|
+
* - inserted: accepted → keep, rejected → drop
|
|
33
|
+
* - deleted: accepted → drop (matches after), rejected → restore (matches before)
|
|
34
|
+
*/
|
|
35
|
+
export type AtomicSegment = {
|
|
36
|
+
kind: 'atomic';
|
|
37
|
+
id: string;
|
|
38
|
+
tag: string;
|
|
39
|
+
/**
|
|
40
|
+
* The open tag of the accepted (after) state. For matched segments this can
|
|
41
|
+
* differ from `beforeOpenTag` when only attributes changed — a segment
|
|
42
|
+
* counts as changed in that case even when the inner HTML is identical.
|
|
43
|
+
*/
|
|
44
|
+
openTag: string;
|
|
45
|
+
/**
|
|
46
|
+
* The open tag of the original (before) state. Rejecting a matched segment
|
|
47
|
+
* restores this alongside `beforeHtml`. Equals `openTag` for inserted
|
|
48
|
+
* segments (which have no before state).
|
|
49
|
+
*/
|
|
50
|
+
beforeOpenTag: string;
|
|
51
|
+
closeTag: string;
|
|
52
|
+
beforeHtml: string;
|
|
53
|
+
afterHtml: string;
|
|
54
|
+
changed: boolean;
|
|
55
|
+
status: 'matched' | 'inserted' | 'deleted';
|
|
56
|
+
};
|
|
57
|
+
export type ListSegment = {
|
|
58
|
+
kind: 'list';
|
|
59
|
+
id: string;
|
|
60
|
+
tag: 'ul' | 'ol';
|
|
61
|
+
openTag: string;
|
|
62
|
+
closeTag: string;
|
|
63
|
+
children: AtomicSegment[];
|
|
64
|
+
};
|
|
65
|
+
export type Segment = AtomicSegment | ListSegment;
|
|
66
|
+
/**
|
|
67
|
+
* Split a before/after value pair into chunks the user can individually
|
|
68
|
+
* accept or reject. Returns null when chunk-level approval can't apply:
|
|
69
|
+
*
|
|
70
|
+
* - non-markup fields
|
|
71
|
+
* - either side contains inline-only HTML or stray top-level text
|
|
72
|
+
* (`parseBlocks` returns null)
|
|
73
|
+
* - both sides empty
|
|
74
|
+
*
|
|
75
|
+
* Two-level structure: top-level block alignment, then a one-level recurse
|
|
76
|
+
* into matched <ul>/<ol> blocks whose innerHTML differs. <li> is the leaf.
|
|
77
|
+
*
|
|
78
|
+
* Used for both rewrites (word-diff preview) and translations
|
|
79
|
+
* (insertion-only preview). The difference is at the renderer.
|
|
80
|
+
*/
|
|
81
|
+
export declare function splitIntoSegments(before: string, after: string, fieldType: 'plain' | 'markup'): Segment[] | null;
|
|
82
|
+
/**
|
|
83
|
+
* True when at least one segment (or list child) actually changes. Use to
|
|
84
|
+
* skip the approval row for fields where the proposed value already matches
|
|
85
|
+
* the current value chunk-for-chunk.
|
|
86
|
+
*/
|
|
87
|
+
export declare function segmentsHaveChanges(segments: Segment[]): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Render segments as preview HTML with `data-chunk-index` attributes on each
|
|
90
|
+
* atomic block, so the approval UI can locate each chunk's DOM bounds. The
|
|
91
|
+
* resulting markup replaces the editable's innerHTML during preview, just
|
|
92
|
+
* like `computeDiff` / `computeInsertion`.
|
|
93
|
+
*
|
|
94
|
+
* `insertionsOnly` matches the existing prop on DiffApproval — translations
|
|
95
|
+
* render new content as a single <ins> per leaf, rewrites render word-diffs.
|
|
96
|
+
*
|
|
97
|
+
* `acceptedById` (optional) makes the preview track per-segment acceptance:
|
|
98
|
+
* rejected matched segments render their original content with no markers,
|
|
99
|
+
* rejected insertions render as deletions, rejected deletions render plain.
|
|
100
|
+
* Defaults to "all accepted" when omitted (initial render).
|
|
101
|
+
*/
|
|
102
|
+
export declare function renderSegmentDiff(segments: Segment[], opts?: {
|
|
103
|
+
insertionsOnly?: boolean;
|
|
104
|
+
acceptedById?: Record<string, boolean>;
|
|
105
|
+
}): string;
|
|
106
|
+
/**
|
|
107
|
+
* Reassemble a field value from segments using per-segment acceptance.
|
|
108
|
+
* Acceptance defaults to `true` for any unmapped segment id, mirroring the
|
|
109
|
+
* DiffApproval initial state.
|
|
110
|
+
*
|
|
111
|
+
* For `list` segments the wrapper is emitted only when at least one child
|
|
112
|
+
* survives — accepting a full deletion of every item drops the list itself.
|
|
113
|
+
*/
|
|
114
|
+
export declare function reassembleValue(segments: Segment[], acceptedById: Record<string, boolean>): string;
|
|
115
|
+
/**
|
|
116
|
+
* Walk a segment list and return every atomic segment in reading order,
|
|
117
|
+
* including those inside list wrappers. Used by the approval UI for
|
|
118
|
+
* keyboard nav, selection initialisation, and the rejected-segments
|
|
119
|
+
* feedback to the agent.
|
|
120
|
+
*/
|
|
121
|
+
export declare function flattenSegments(segments: Segment[]): AtomicSegment[];
|
|
@@ -234,3 +234,265 @@ export function computeInsertion(after) {
|
|
|
234
234
|
}
|
|
235
235
|
return `<ins>${after}</ins>`;
|
|
236
236
|
}
|
|
237
|
+
function parseListItems(html) {
|
|
238
|
+
const container = document.createElement("div");
|
|
239
|
+
container.innerHTML = html;
|
|
240
|
+
const items = [];
|
|
241
|
+
for (const child of container.childNodes) {
|
|
242
|
+
if (child.nodeType === Node.ELEMENT_NODE) {
|
|
243
|
+
const el = child;
|
|
244
|
+
const tag = el.tagName.toLowerCase();
|
|
245
|
+
if (tag !== "li") return null;
|
|
246
|
+
let openTag = `<${tag}`;
|
|
247
|
+
for (const attr of el.attributes) {
|
|
248
|
+
openTag += ` ${attr.name}="${attr.value}"`;
|
|
249
|
+
}
|
|
250
|
+
openTag += ">";
|
|
251
|
+
items.push({ tag, innerHTML: el.innerHTML, openTag });
|
|
252
|
+
} else if (child.nodeType === Node.TEXT_NODE && child.textContent?.trim()) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return items;
|
|
257
|
+
}
|
|
258
|
+
function alignListItems(before, after) {
|
|
259
|
+
const m = before.length;
|
|
260
|
+
const n = after.length;
|
|
261
|
+
const dp = Array.from(
|
|
262
|
+
{ length: m + 1 },
|
|
263
|
+
() => Array(n + 1).fill(0)
|
|
264
|
+
);
|
|
265
|
+
for (let i2 = 1; i2 <= m; i2++) {
|
|
266
|
+
for (let j2 = 1; j2 <= n; j2++) {
|
|
267
|
+
if (before[i2 - 1].innerHTML === after[j2 - 1].innerHTML) {
|
|
268
|
+
dp[i2][j2] = dp[i2 - 1][j2 - 1] + 1;
|
|
269
|
+
} else {
|
|
270
|
+
dp[i2][j2] = Math.max(dp[i2 - 1][j2], dp[i2][j2 - 1]);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
const ops = [];
|
|
275
|
+
let i = m;
|
|
276
|
+
let j = n;
|
|
277
|
+
while (i > 0 && j > 0) {
|
|
278
|
+
if (before[i - 1].innerHTML === after[j - 1].innerHTML) {
|
|
279
|
+
ops.push({
|
|
280
|
+
type: "unchanged",
|
|
281
|
+
before: before[i - 1],
|
|
282
|
+
after: after[j - 1]
|
|
283
|
+
});
|
|
284
|
+
i--;
|
|
285
|
+
j--;
|
|
286
|
+
} else if (dp[i - 1][j] >= dp[i][j - 1]) {
|
|
287
|
+
ops.push({ type: "before", block: before[i - 1] });
|
|
288
|
+
i--;
|
|
289
|
+
} else {
|
|
290
|
+
ops.push({ type: "after", block: after[j - 1] });
|
|
291
|
+
j--;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
while (i > 0) {
|
|
295
|
+
ops.push({ type: "before", block: before[i - 1] });
|
|
296
|
+
i--;
|
|
297
|
+
}
|
|
298
|
+
while (j > 0) {
|
|
299
|
+
ops.push({ type: "after", block: after[j - 1] });
|
|
300
|
+
j--;
|
|
301
|
+
}
|
|
302
|
+
ops.reverse();
|
|
303
|
+
const entries = [];
|
|
304
|
+
let k = 0;
|
|
305
|
+
while (k < ops.length) {
|
|
306
|
+
const op = ops[k];
|
|
307
|
+
if (op.type === "unchanged") {
|
|
308
|
+
entries.push({ type: "match", before: op.before, after: op.after });
|
|
309
|
+
k++;
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
const befores = [];
|
|
313
|
+
const afters = [];
|
|
314
|
+
while (k < ops.length && ops[k].type !== "unchanged") {
|
|
315
|
+
const r = ops[k];
|
|
316
|
+
if (r.type === "before") befores.push(r.block);
|
|
317
|
+
else if (r.type === "after") afters.push(r.block);
|
|
318
|
+
k++;
|
|
319
|
+
}
|
|
320
|
+
const pairCount = Math.min(befores.length, afters.length);
|
|
321
|
+
for (let p = 0; p < pairCount; p++) {
|
|
322
|
+
entries.push({ type: "match", before: befores[p], after: afters[p] });
|
|
323
|
+
}
|
|
324
|
+
for (let p = pairCount; p < befores.length; p++) {
|
|
325
|
+
entries.push({ type: "delete", before: befores[p] });
|
|
326
|
+
}
|
|
327
|
+
for (let p = pairCount; p < afters.length; p++) {
|
|
328
|
+
entries.push({ type: "insert", after: afters[p] });
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
return entries;
|
|
332
|
+
}
|
|
333
|
+
function atomicFromAlignment(entry, id) {
|
|
334
|
+
if (entry.type === "match") {
|
|
335
|
+
return {
|
|
336
|
+
kind: "atomic",
|
|
337
|
+
id,
|
|
338
|
+
tag: entry.after.tag,
|
|
339
|
+
openTag: entry.after.openTag,
|
|
340
|
+
beforeOpenTag: entry.before.openTag,
|
|
341
|
+
closeTag: `</${entry.after.tag}>`,
|
|
342
|
+
beforeHtml: entry.before.innerHTML,
|
|
343
|
+
afterHtml: entry.after.innerHTML,
|
|
344
|
+
changed: entry.before.innerHTML !== entry.after.innerHTML || entry.before.openTag !== entry.after.openTag,
|
|
345
|
+
status: "matched"
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
if (entry.type === "delete") {
|
|
349
|
+
return {
|
|
350
|
+
kind: "atomic",
|
|
351
|
+
id,
|
|
352
|
+
tag: entry.before.tag,
|
|
353
|
+
openTag: entry.before.openTag,
|
|
354
|
+
beforeOpenTag: entry.before.openTag,
|
|
355
|
+
closeTag: `</${entry.before.tag}>`,
|
|
356
|
+
beforeHtml: entry.before.innerHTML,
|
|
357
|
+
afterHtml: "",
|
|
358
|
+
changed: true,
|
|
359
|
+
status: "deleted"
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
kind: "atomic",
|
|
364
|
+
id,
|
|
365
|
+
tag: entry.after.tag,
|
|
366
|
+
openTag: entry.after.openTag,
|
|
367
|
+
beforeOpenTag: entry.after.openTag,
|
|
368
|
+
closeTag: `</${entry.after.tag}>`,
|
|
369
|
+
beforeHtml: "",
|
|
370
|
+
afterHtml: entry.after.innerHTML,
|
|
371
|
+
changed: true,
|
|
372
|
+
status: "inserted"
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
export function splitIntoSegments(before, after, fieldType) {
|
|
376
|
+
if (fieldType !== "markup") return null;
|
|
377
|
+
const beforeBlocks = parseBlocks(before);
|
|
378
|
+
const afterBlocks = parseBlocks(after);
|
|
379
|
+
if (!beforeBlocks || !afterBlocks) return null;
|
|
380
|
+
if (beforeBlocks.length === 0 && afterBlocks.length === 0) return null;
|
|
381
|
+
const alignment = alignBlocks(beforeBlocks, afterBlocks);
|
|
382
|
+
const segments = [];
|
|
383
|
+
alignment.forEach((entry, index) => {
|
|
384
|
+
const id = String(index);
|
|
385
|
+
if (entry.type === "match" && (entry.after.tag === "ul" || entry.after.tag === "ol") && entry.before.innerHTML !== entry.after.innerHTML && entry.before.openTag === entry.after.openTag) {
|
|
386
|
+
const beforeItems = parseListItems(entry.before.innerHTML);
|
|
387
|
+
const afterItems = parseListItems(entry.after.innerHTML);
|
|
388
|
+
if (beforeItems && afterItems) {
|
|
389
|
+
const childAlignment = alignListItems(beforeItems, afterItems);
|
|
390
|
+
const children = childAlignment.map(
|
|
391
|
+
(childEntry, childIndex) => atomicFromAlignment(childEntry, `${id}/${childIndex}`)
|
|
392
|
+
);
|
|
393
|
+
segments.push({
|
|
394
|
+
kind: "list",
|
|
395
|
+
id,
|
|
396
|
+
tag: entry.after.tag,
|
|
397
|
+
openTag: entry.after.openTag,
|
|
398
|
+
closeTag: `</${entry.after.tag}>`,
|
|
399
|
+
children
|
|
400
|
+
});
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
segments.push(atomicFromAlignment(entry, id));
|
|
405
|
+
});
|
|
406
|
+
return segments;
|
|
407
|
+
}
|
|
408
|
+
export function segmentsHaveChanges(segments) {
|
|
409
|
+
return segments.some(
|
|
410
|
+
(seg) => seg.kind === "list" ? seg.children.some((c) => c.changed) : seg.changed
|
|
411
|
+
);
|
|
412
|
+
}
|
|
413
|
+
function injectAttribute(openTag, name, value) {
|
|
414
|
+
return openTag.slice(0, -1) + ` ${name}="${value}">`;
|
|
415
|
+
}
|
|
416
|
+
function renderAtomicDiffMarkup(seg, opts) {
|
|
417
|
+
const open = injectAttribute(seg.openTag, "data-chunk-index", seg.id);
|
|
418
|
+
const accepted = opts.acceptedById?.[seg.id] !== false;
|
|
419
|
+
if (seg.status === "inserted") {
|
|
420
|
+
if (!accepted) {
|
|
421
|
+
return `${open}<del>${seg.afterHtml}</del>${seg.closeTag}`;
|
|
422
|
+
}
|
|
423
|
+
return `${open}<ins>${seg.afterHtml}</ins>${seg.closeTag}`;
|
|
424
|
+
}
|
|
425
|
+
if (seg.status === "deleted") {
|
|
426
|
+
if (!accepted) {
|
|
427
|
+
return `${open}${seg.beforeHtml}${seg.closeTag}`;
|
|
428
|
+
}
|
|
429
|
+
return `${open}<del>${seg.beforeHtml}</del>${seg.closeTag}`;
|
|
430
|
+
}
|
|
431
|
+
if (!accepted) {
|
|
432
|
+
const beforeOpen = injectAttribute(
|
|
433
|
+
seg.beforeOpenTag,
|
|
434
|
+
"data-chunk-index",
|
|
435
|
+
seg.id
|
|
436
|
+
);
|
|
437
|
+
return `${beforeOpen}${seg.beforeHtml}${seg.closeTag}`;
|
|
438
|
+
}
|
|
439
|
+
if (opts.insertionsOnly) {
|
|
440
|
+
return `${open}<ins>${seg.afterHtml}</ins>${seg.closeTag}`;
|
|
441
|
+
}
|
|
442
|
+
if (seg.beforeHtml === seg.afterHtml) {
|
|
443
|
+
return `${open}${seg.afterHtml}${seg.closeTag}`;
|
|
444
|
+
}
|
|
445
|
+
const innerDiff = diff(seg.beforeHtml, seg.afterHtml);
|
|
446
|
+
return `${open}${cleanupDiffMods(innerDiff)}${seg.closeTag}`;
|
|
447
|
+
}
|
|
448
|
+
export function renderSegmentDiff(segments, opts = {}) {
|
|
449
|
+
const parts = [];
|
|
450
|
+
for (const seg of segments) {
|
|
451
|
+
if (seg.kind === "list") {
|
|
452
|
+
const childParts = seg.children.map(
|
|
453
|
+
(c) => renderAtomicDiffMarkup(c, opts)
|
|
454
|
+
);
|
|
455
|
+
parts.push(`${seg.openTag}${childParts.join("")}${seg.closeTag}`);
|
|
456
|
+
} else {
|
|
457
|
+
parts.push(renderAtomicDiffMarkup(seg, opts));
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return parts.join("");
|
|
461
|
+
}
|
|
462
|
+
export function reassembleValue(segments, acceptedById) {
|
|
463
|
+
const isAccepted = (id) => acceptedById[id] !== false;
|
|
464
|
+
const renderAtomic = (seg) => {
|
|
465
|
+
const accepted = isAccepted(seg.id);
|
|
466
|
+
if (seg.status === "matched") {
|
|
467
|
+
return accepted ? seg.openTag + seg.afterHtml + seg.closeTag : seg.beforeOpenTag + seg.beforeHtml + seg.closeTag;
|
|
468
|
+
}
|
|
469
|
+
if (seg.status === "inserted") {
|
|
470
|
+
return accepted ? seg.openTag + seg.afterHtml + seg.closeTag : "";
|
|
471
|
+
}
|
|
472
|
+
return accepted ? "" : seg.openTag + seg.beforeHtml + seg.closeTag;
|
|
473
|
+
};
|
|
474
|
+
const parts = [];
|
|
475
|
+
for (const seg of segments) {
|
|
476
|
+
if (seg.kind === "list") {
|
|
477
|
+
const childParts = seg.children.map(renderAtomic).filter((p) => p);
|
|
478
|
+
if (childParts.length > 0) {
|
|
479
|
+
parts.push(`${seg.openTag}${childParts.join("")}${seg.closeTag}`);
|
|
480
|
+
}
|
|
481
|
+
} else {
|
|
482
|
+
const out = renderAtomic(seg);
|
|
483
|
+
if (out) parts.push(out);
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
return parts.join("");
|
|
487
|
+
}
|
|
488
|
+
export function flattenSegments(segments) {
|
|
489
|
+
const out = [];
|
|
490
|
+
for (const seg of segments) {
|
|
491
|
+
if (seg.kind === "list") {
|
|
492
|
+
out.push(...seg.children);
|
|
493
|
+
} else {
|
|
494
|
+
out.push(seg);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return out;
|
|
498
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { InjectionKey, Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* A ref to the nearest popup host element (provided by `<PopupHost>`).
|
|
4
|
+
*
|
|
5
|
+
* Descendants that render floating menus (e.g. the chart editor's color
|
|
6
|
+
* picker) inject this and teleport their content into the host. This lets
|
|
7
|
+
* the menu escape any `overflow: hidden`/`overflow: auto` clipping ancestor
|
|
8
|
+
* while staying inside the popup host's stacking context. When no host is
|
|
9
|
+
* provided, descendants fall back to inline rendering.
|
|
10
|
+
*/
|
|
11
|
+
export declare const INJECT_POPUP_HOST: InjectionKey<Ref<HTMLElement | null>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const INJECT_POPUP_HOST = Symbol("blokkli_popup_host");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockOptionDefinition } from '#blokkli/types/blockOptions';
|
|
2
2
|
import type { BlockDefinitionOptionsInput } from '#blokkli/types/definitions';
|
|
3
|
+
import type { DefinitionString } from '../../../../global/types/blockOptions.js';
|
|
3
4
|
export type OptionItem = {
|
|
4
5
|
property: string;
|
|
5
6
|
option: BlockOptionDefinition;
|
|
@@ -18,3 +19,4 @@ export declare function getMutatedOptionValue(mutatedOptions: Record<string, Rec
|
|
|
18
19
|
* Convert a typed option value to the string format expected by the adapter.
|
|
19
20
|
*/
|
|
20
21
|
export declare function optionValueToStorable(definition: BlockOptionDefinition, value: string | string[] | boolean | undefined | null | number): string;
|
|
22
|
+
export declare function resolveDefinitionString(definitionString: DefinitionString, langcode?: string): string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { defaultLanguage } from "#blokkli-build/editor-config";
|
|
1
2
|
export function getAvailableOptions(definitionOptions, globalOptionKeys, globalOptionsMap) {
|
|
2
3
|
const options = definitionOptions || {};
|
|
3
4
|
const global = (globalOptionKeys || []).reduce(
|
|
@@ -69,3 +70,23 @@ export function optionValueToStorable(definition, value) {
|
|
|
69
70
|
}
|
|
70
71
|
return "";
|
|
71
72
|
}
|
|
73
|
+
export function resolveDefinitionString(definitionString, langcode) {
|
|
74
|
+
if (!definitionString) {
|
|
75
|
+
return "";
|
|
76
|
+
}
|
|
77
|
+
if (typeof definitionString === "string") {
|
|
78
|
+
return definitionString;
|
|
79
|
+
}
|
|
80
|
+
if (langcode) {
|
|
81
|
+
const translation = definitionString[langcode];
|
|
82
|
+
if (translation) {
|
|
83
|
+
return translation;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
const defaultTranslation = definitionString[defaultLanguage];
|
|
87
|
+
if (defaultTranslation) {
|
|
88
|
+
return defaultTranslation;
|
|
89
|
+
}
|
|
90
|
+
const firstValue = Object.values(definitionString)[0];
|
|
91
|
+
return firstValue ?? "";
|
|
92
|
+
}
|
|
@@ -26,6 +26,15 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
26
26
|
* Optional icon to display in the indicator.
|
|
27
27
|
*/
|
|
28
28
|
icon?: BlokkliIcon;
|
|
29
|
+
/**
|
|
30
|
+
* Keep the indicator visible when the artboard edge is close to the
|
|
31
|
+
* edge of the visible viewport.
|
|
32
|
+
*
|
|
33
|
+
* Instead of moving out of view, the indicator is shifted onto the
|
|
34
|
+
* artboard so that at least the icon remains visible. Only supported
|
|
35
|
+
* for left-positioned indicators.
|
|
36
|
+
*/
|
|
37
|
+
sticky?: boolean;
|
|
29
38
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
30
39
|
click: () => any;
|
|
31
40
|
}, string, import("vue").PublicProps, Readonly<{
|
|
@@ -53,9 +62,23 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
53
62
|
* Optional icon to display in the indicator.
|
|
54
63
|
*/
|
|
55
64
|
icon?: BlokkliIcon;
|
|
65
|
+
/**
|
|
66
|
+
* Keep the indicator visible when the artboard edge is close to the
|
|
67
|
+
* edge of the visible viewport.
|
|
68
|
+
*
|
|
69
|
+
* Instead of moving out of view, the indicator is shifted onto the
|
|
70
|
+
* artboard so that at least the icon remains visible. Only supported
|
|
71
|
+
* for left-positioned indicators.
|
|
72
|
+
*/
|
|
73
|
+
sticky?: boolean;
|
|
56
74
|
}> & Readonly<{
|
|
57
75
|
onClick?: (() => any) | undefined;
|
|
58
|
-
}>, {
|
|
76
|
+
}>, {
|
|
77
|
+
label: string;
|
|
78
|
+
icon: BlokkliIcon;
|
|
79
|
+
sticky: boolean;
|
|
80
|
+
position: "left" | "right";
|
|
81
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
59
82
|
default?: (props: {}) => any;
|
|
60
83
|
}>;
|
|
61
84
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -2,16 +2,24 @@
|
|
|
2
2
|
<Teleport to="#bk-indicators-left">
|
|
3
3
|
<div
|
|
4
4
|
ref="el"
|
|
5
|
-
class="bk-indicator-item"
|
|
5
|
+
class="bk-indicator-item _bk_absolute _bk_top-0 _bk_pointer-events-auto _bk_cursor-pointer _bk_text-mono-500 _bk_h-30 _bk_flex _bk_items-center _bk_hover:text-mono-950 _bk_group"
|
|
6
|
+
:class="{
|
|
7
|
+
'_bk_right-0 _bk_pr-10': position === 'left'
|
|
8
|
+
}"
|
|
6
9
|
@click.prevent="$emit('click')"
|
|
7
10
|
@mouseenter="onMouseEnter"
|
|
8
11
|
@mouseleave="onMouseLeave"
|
|
9
12
|
>
|
|
10
13
|
<slot>
|
|
11
|
-
<div
|
|
14
|
+
<div
|
|
15
|
+
class="bk-indicator-item-inner _bk_flex _bk_gap-10 _bk_items-center _bk_text-xs _bk_font-medium"
|
|
16
|
+
>
|
|
12
17
|
<div v-if="label">{{ label }}</div>
|
|
13
18
|
<div v-if="icon">
|
|
14
|
-
<Icon
|
|
19
|
+
<Icon
|
|
20
|
+
:name="icon"
|
|
21
|
+
class="_bk_size-20 _bk_bg-red-normal _bk_text-white _bk_p-2 _bk_rounded-full _bk_group-hover:bg-red-dark"
|
|
22
|
+
/>
|
|
15
23
|
</div>
|
|
16
24
|
</div>
|
|
17
25
|
</slot>
|
|
@@ -30,9 +38,10 @@ import { Icon } from "#blokkli/editor/components";
|
|
|
30
38
|
const props = defineProps({
|
|
31
39
|
id: { type: String, required: true },
|
|
32
40
|
uuid: { type: String, required: true },
|
|
33
|
-
label: { type: String, required: false },
|
|
34
|
-
position: { type: String, required: false },
|
|
35
|
-
icon: { type: null, required: false }
|
|
41
|
+
label: { type: String, required: false, default: void 0 },
|
|
42
|
+
position: { type: String, required: false, default: "left" },
|
|
43
|
+
icon: { type: null, required: false, default: void 0 },
|
|
44
|
+
sticky: { type: Boolean, required: false, default: false }
|
|
36
45
|
});
|
|
37
46
|
defineEmits(["click"]);
|
|
38
47
|
const { indicators } = useBlokkli();
|
|
@@ -49,7 +58,8 @@ onMounted(() => {
|
|
|
49
58
|
id: props.id,
|
|
50
59
|
uuid: props.uuid,
|
|
51
60
|
position: props.position ?? "left",
|
|
52
|
-
element: el.value
|
|
61
|
+
element: el.value,
|
|
62
|
+
sticky: props.sticky
|
|
53
63
|
});
|
|
54
64
|
}
|
|
55
65
|
});
|