@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
|
@@ -3,7 +3,7 @@ import { defineBlokkliModule } from '../index.mjs';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
import * as fs from 'node:fs';
|
|
6
|
-
import { C as Collector, a as CollectedFile,
|
|
6
|
+
import { C as Collector, a as CollectedFile, b as extractFirstStringArg } from '../../shared/editor.BGemL1Oh.mjs';
|
|
7
7
|
import { d as defineCodeTemplate } from '../../shared/editor.6D5vApr0.mjs';
|
|
8
8
|
import 'typescript';
|
|
9
9
|
import 'oxc-walker';
|
|
@@ -223,6 +223,31 @@ export const chartTypeIllustrations: Partial<Record<ChartTypeId, Component>>
|
|
|
223
223
|
);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
const DEFAULT_NUMBER_FORMAT_LOCALES = [
|
|
227
|
+
"de-CH",
|
|
228
|
+
"fr-CH",
|
|
229
|
+
"it-CH",
|
|
230
|
+
"de-DE",
|
|
231
|
+
"en-US",
|
|
232
|
+
"en-GB",
|
|
233
|
+
"fr-FR"
|
|
234
|
+
];
|
|
235
|
+
function createConfigTemplate(options) {
|
|
236
|
+
const numberFormatLocales = options?.numberFormat?.locales ?? DEFAULT_NUMBER_FORMAT_LOCALES;
|
|
237
|
+
return defineCodeTemplate(
|
|
238
|
+
"charts-config",
|
|
239
|
+
() => `export const chartsConfig = {
|
|
240
|
+
numberFormatLocales: ${JSON.stringify(numberFormatLocales)},
|
|
241
|
+
}
|
|
242
|
+
`,
|
|
243
|
+
() => `export const chartsConfig: {
|
|
244
|
+
numberFormatLocales: string[]
|
|
245
|
+
}
|
|
246
|
+
`,
|
|
247
|
+
{ write: true }
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
|
|
226
251
|
const resolve = createResolver(
|
|
227
252
|
fileURLToPath(new URL("./", import.meta.url))
|
|
228
253
|
).resolve;
|
|
@@ -231,7 +256,16 @@ const index = defineBlokkliModule({
|
|
|
231
256
|
options.blokkliDirs ??= [];
|
|
232
257
|
options.blokkliDirs.push(resolve("./runtime/blokkli"));
|
|
233
258
|
},
|
|
234
|
-
setup({ context, helper, $t }) {
|
|
259
|
+
setup({ context, helper, $t }, options) {
|
|
260
|
+
helper.addPackageDependency(
|
|
261
|
+
"echarts/core",
|
|
262
|
+
"echarts/renderers",
|
|
263
|
+
"echarts/charts",
|
|
264
|
+
"echarts/components",
|
|
265
|
+
"vue-echarts",
|
|
266
|
+
"json5",
|
|
267
|
+
"zod"
|
|
268
|
+
);
|
|
235
269
|
helper.addAlias("#blokkli/charts/types", resolve("./runtime/types"));
|
|
236
270
|
helper.addAlias(
|
|
237
271
|
"#blokkli/charts/definition",
|
|
@@ -261,6 +295,7 @@ const index = defineBlokkliModule({
|
|
|
261
295
|
context.addTemplate(createDefinitionsTemplate(chartTypes));
|
|
262
296
|
context.addTemplate(createComponentsTemplate(chartTypes));
|
|
263
297
|
context.addTemplate(createIllustrationsTemplate(chartTypes));
|
|
298
|
+
context.addTemplate(createConfigTemplate(options));
|
|
264
299
|
helper.addAppTsInclude(projectChartsDir);
|
|
265
300
|
for (const dir of moduleBlokkliDirs) {
|
|
266
301
|
helper.addAppTsInclude(path.join(dir, "chart-types"));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { BlokkliChartData } from '#blokkli/charts/types';
|
|
3
3
|
import type { McpToolContext } from '#blokkli/agent/app/types';
|
|
4
|
-
import type { ColorOption } from '#blokkli/
|
|
4
|
+
import type { ColorOption } from '#blokkli/types/colors';
|
|
5
5
|
export declare const chartTypeEnum: z.ZodEnum<{
|
|
6
6
|
[x: string]: string;
|
|
7
7
|
}>;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { isColorIdValid } from "#blokkli/helpers/colors";
|
|
2
3
|
import { getColorIdAtIndex } from "../../helpers/index.js";
|
|
3
4
|
import { getChartTypeRuntime, getDefaultTypeOptions } from "../../chart-types/index.js";
|
|
4
5
|
import { colorOptions } from "#blokkli-build/editor-config";
|
|
5
6
|
import { definitionIds } from "#blokkli-build/charts-definitions";
|
|
6
7
|
const agentChartTypeIds = definitionIds.filter((id) => id !== "advanced");
|
|
7
8
|
export const chartTypeEnum = z.enum(agentChartTypeIds);
|
|
8
|
-
const colorIds = Object.
|
|
9
|
+
const colorIds = Object.entries(colorOptions).flatMap(([id, option]) => {
|
|
10
|
+
if ("shades" in option) {
|
|
11
|
+
return Object.keys(option.shades).map((shade) => `${id}.${shade}`);
|
|
12
|
+
}
|
|
13
|
+
return [id];
|
|
14
|
+
});
|
|
9
15
|
export const chartColorEnum = z.enum(colorIds);
|
|
10
16
|
export const chartSeriesSchema = z.object({
|
|
11
17
|
name: z.string().describe("Series name (shown in legend)"),
|
|
@@ -89,8 +95,9 @@ export function validateAdvancedConfig(value) {
|
|
|
89
95
|
return { value };
|
|
90
96
|
}
|
|
91
97
|
export function validateChartData(data, options) {
|
|
92
|
-
const
|
|
93
|
-
|
|
98
|
+
const availableIds = options.flatMap(
|
|
99
|
+
(c) => c.shades?.length ? c.shades.map((s) => `${c.id}.${s.id}`) : [c.id]
|
|
100
|
+
);
|
|
94
101
|
for (let i = 0; i < data.series.length; i++) {
|
|
95
102
|
const series = data.series[i];
|
|
96
103
|
if (series.data.length !== data.categories.length) {
|
|
@@ -103,7 +110,7 @@ export function validateChartData(data, options) {
|
|
|
103
110
|
const series = data.series[i];
|
|
104
111
|
if (!series.color) {
|
|
105
112
|
series.color = getColorIdAtIndex(i, options);
|
|
106
|
-
} else if (!
|
|
113
|
+
} else if (!isColorIdValid(series.color, options)) {
|
|
107
114
|
return {
|
|
108
115
|
error: `Invalid color ID "${series.color}" on series "${series.name}". Available colors: ${availableIds.join(", ")}`
|
|
109
116
|
};
|
|
@@ -118,7 +125,7 @@ export function validateChartData(data, options) {
|
|
|
118
125
|
} else {
|
|
119
126
|
for (let i = 0; i < data.categoryColors.length; i++) {
|
|
120
127
|
const id = data.categoryColors[i];
|
|
121
|
-
if (!
|
|
128
|
+
if (!isColorIdValid(id, options)) {
|
|
122
129
|
return {
|
|
123
130
|
error: `Invalid categoryColor ID "${id}" at index ${i}. Available colors: ${availableIds.join(", ")}`
|
|
124
131
|
};
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
</template>
|
|
30
30
|
|
|
31
31
|
<script setup>
|
|
32
|
-
import { computed, inject, ref,
|
|
32
|
+
import { computed, inject, ref, useBlokkliRuntimeConfig } from "#imports";
|
|
33
33
|
import { applyFootnotes, SUPERSCRIPTS } from "../../helpers";
|
|
34
34
|
import { detectDateFormat, formatDateCategory } from "../../helpers/dateFormat";
|
|
35
35
|
import { INJECT_CHART_PREVIEW_DYNAMIC_DATA } from "../../helpers/previewInjection";
|
|
@@ -55,17 +55,12 @@ const props = defineProps({
|
|
|
55
55
|
dynamicData: { type: [Object, null], required: false }
|
|
56
56
|
});
|
|
57
57
|
const isEditing = inject(INJECT_IS_EDITING, false);
|
|
58
|
-
const
|
|
58
|
+
const { resolveColorHex, colorPalette } = useBlokkliRuntimeConfig();
|
|
59
59
|
const providerEntity = inject(INJECT_PROVIDER_CONTEXT, null);
|
|
60
60
|
const previewDynamicData = inject(INJECT_CHART_PREVIEW_DYNAMIC_DATA, null);
|
|
61
61
|
const currentLanguage = computed(
|
|
62
62
|
() => props.languageOverride ?? providerEntity?.value.language ?? ""
|
|
63
63
|
);
|
|
64
|
-
const colorPalette = computed(() => {
|
|
65
|
-
const map = appConfig.blokkli?.colorOptions;
|
|
66
|
-
if (!map) return [];
|
|
67
|
-
return Object.keys(map).map((id) => ({ id, hex: map[id] }));
|
|
68
|
-
});
|
|
69
64
|
const hasDynamicSource = computed(() => !!props.dataSource);
|
|
70
65
|
const effectiveDynamicPayload = computed(() => {
|
|
71
66
|
if (props.dynamicData !== void 0 && props.dynamicData !== null) {
|
|
@@ -80,17 +75,17 @@ const effectiveData = computed(() => {
|
|
|
80
75
|
const overrides = props.dataSource?.seriesOverrides ?? {};
|
|
81
76
|
const categoryOverrides = props.dataSource?.categoryColorOverrides ?? {};
|
|
82
77
|
const palette = colorPalette.value;
|
|
83
|
-
const fallback = palette[0]
|
|
78
|
+
const fallback = palette[0] ?? "";
|
|
84
79
|
const visibleSeries = payload.series.filter(
|
|
85
80
|
(s) => overrides[s.name]?.hidden !== true
|
|
86
81
|
);
|
|
87
82
|
const series = visibleSeries.map((s, i) => ({
|
|
88
83
|
name: s.name,
|
|
89
|
-
color: overrides[s.name]?.color ?? palette[i % Math.max(palette.length, 1)]
|
|
84
|
+
color: overrides[s.name]?.color ?? palette[i % Math.max(palette.length, 1)] ?? fallback,
|
|
90
85
|
data: s.data
|
|
91
86
|
}));
|
|
92
87
|
const categoryColors = payload.categories.map((label, i) => {
|
|
93
|
-
return categoryOverrides[label] ?? palette[i % Math.max(palette.length, 1)]
|
|
88
|
+
return categoryOverrides[label] ?? palette[i % Math.max(palette.length, 1)] ?? fallback;
|
|
94
89
|
});
|
|
95
90
|
return {
|
|
96
91
|
categories: payload.categories,
|
|
@@ -159,10 +154,6 @@ function superscriptFor(n) {
|
|
|
159
154
|
}
|
|
160
155
|
return String(n).split("").map((d) => SUPERSCRIPTS[d] || d).join("");
|
|
161
156
|
}
|
|
162
|
-
function resolveHex(id) {
|
|
163
|
-
const map = appConfig.blokkli?.colorOptions;
|
|
164
|
-
return map?.[id] || "#888888";
|
|
165
|
-
}
|
|
166
157
|
const typeComponent = computed(
|
|
167
158
|
() => chartTypeComponents[props.type]
|
|
168
159
|
);
|
|
@@ -176,8 +167,8 @@ const renderProps = computed(() => {
|
|
|
176
167
|
name: applyFootnotes(s.name),
|
|
177
168
|
data: s.data
|
|
178
169
|
})),
|
|
179
|
-
seriesHexColors: data.series.map((s) =>
|
|
180
|
-
categoryHexColors: data.categoryColors.map(
|
|
170
|
+
seriesHexColors: data.series.map((s) => resolveColorHex(s.color)),
|
|
171
|
+
categoryHexColors: data.categoryColors.map(resolveColorHex),
|
|
181
172
|
typeOptions: props.typeOptions ?? {},
|
|
182
173
|
numberFormat: resolvedNumberFormat.value,
|
|
183
174
|
isEditing,
|
|
@@ -121,7 +121,7 @@ function openExamples() {
|
|
|
121
121
|
}
|
|
122
122
|
</script>
|
|
123
123
|
|
|
124
|
-
<style>/*! tailwindcss v4.
|
|
124
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
125
125
|
.bk-advanced-config-error {
|
|
126
126
|
border-radius: 4px;
|
|
127
127
|
border-style: var(--bk-tw-border-style);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FormToggle
|
|
3
3
|
v-if="option.type === 'checkbox'"
|
|
4
|
-
:label
|
|
5
|
-
:description
|
|
4
|
+
:label
|
|
5
|
+
:description
|
|
6
6
|
:model-value="!!(value ?? option.default)"
|
|
7
7
|
@update:model-value="$emit('update', $event)"
|
|
8
8
|
/>
|
|
9
9
|
<FormRadio
|
|
10
10
|
v-else-if="option.type === 'radios'"
|
|
11
11
|
:id="`chart-option-${optionKey}`"
|
|
12
|
-
:label
|
|
13
|
-
:description
|
|
12
|
+
:label
|
|
13
|
+
:description
|
|
14
14
|
inline
|
|
15
15
|
:options="radioOptions"
|
|
16
16
|
:model-value="String(value ?? option.default ?? '')"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
<FormNumber
|
|
20
20
|
v-else-if="option.type === 'number'"
|
|
21
21
|
:id="`chart-option-${optionKey}`"
|
|
22
|
-
:label
|
|
23
|
-
:description
|
|
22
|
+
:label
|
|
23
|
+
:description
|
|
24
24
|
:min="numberMin"
|
|
25
25
|
:max="numberMax"
|
|
26
26
|
:nullable="option.nullable"
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
<FormText
|
|
32
32
|
v-else-if="option.type === 'text'"
|
|
33
33
|
:id="`chart-option-${optionKey}`"
|
|
34
|
-
:label
|
|
35
|
-
:description
|
|
34
|
+
:label
|
|
35
|
+
:description
|
|
36
36
|
:model-value="String(value ?? option.default ?? '')"
|
|
37
37
|
lazy
|
|
38
38
|
@update:model-value="$emit('update', $event ?? '')"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</template>
|
|
41
41
|
|
|
42
42
|
<script setup>
|
|
43
|
-
import { computed } from "#imports";
|
|
43
|
+
import { computed, useBlokkli } from "#imports";
|
|
44
44
|
import {
|
|
45
45
|
FormToggle,
|
|
46
46
|
FormRadio,
|
|
@@ -53,6 +53,16 @@ const props = defineProps({
|
|
|
53
53
|
value: { type: null, required: true }
|
|
54
54
|
});
|
|
55
55
|
defineEmits(["update"]);
|
|
56
|
+
const { definitions } = useBlokkli();
|
|
57
|
+
const label = computed(() => {
|
|
58
|
+
return definitions.resolveDefinitionString(props.option.label);
|
|
59
|
+
});
|
|
60
|
+
const description = computed(() => {
|
|
61
|
+
if (props.option.description) {
|
|
62
|
+
return definitions.resolveDefinitionString(props.option.description);
|
|
63
|
+
}
|
|
64
|
+
return void 0;
|
|
65
|
+
});
|
|
56
66
|
const radioOptions = computed(() => {
|
|
57
67
|
if (props.option.type !== "radios") {
|
|
58
68
|
return [];
|
|
@@ -1,84 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:style="{ backgroundColor: displayColor }"
|
|
7
|
-
/>
|
|
8
|
-
</template>
|
|
9
|
-
<template #default="{ close }">
|
|
10
|
-
<DropdownItem
|
|
11
|
-
v-for="entry in colorOptions"
|
|
12
|
-
:key="entry.id"
|
|
13
|
-
:text="entry.label"
|
|
14
|
-
@click="
|
|
15
|
-
() => {
|
|
16
|
-
emit('select', entry.id);
|
|
17
|
-
close();
|
|
18
|
-
}
|
|
19
|
-
"
|
|
20
|
-
>
|
|
21
|
-
<span
|
|
22
|
-
class="bk-chart-color-swatch"
|
|
23
|
-
:style="{ backgroundColor: entry.hex }"
|
|
24
|
-
/>
|
|
25
|
-
</DropdownItem>
|
|
26
|
-
</template>
|
|
27
|
-
</Dropdown>
|
|
2
|
+
<ColorDropdown
|
|
3
|
+
:model-value="colorId"
|
|
4
|
+
@update:model-value="$emit('select', $event)"
|
|
5
|
+
/>
|
|
28
6
|
</template>
|
|
29
7
|
|
|
30
8
|
<script setup>
|
|
31
|
-
import {
|
|
32
|
-
|
|
33
|
-
const props = defineProps({
|
|
9
|
+
import { ColorDropdown } from "#blokkli/editor/components";
|
|
10
|
+
defineProps({
|
|
34
11
|
colorId: { type: String, required: true }
|
|
35
12
|
});
|
|
36
|
-
|
|
37
|
-
const { config } = useBlokkli();
|
|
38
|
-
const colorOptions = computed(() => config.colorOptions.value);
|
|
39
|
-
const displayColor = computed(() => config.getColorHex(props.colorId));
|
|
13
|
+
defineEmits(["select"]);
|
|
40
14
|
</script>
|
|
41
|
-
|
|
42
|
-
<style>/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
|
|
43
|
-
.bk .bk-chart-color-dropdown-button {
|
|
44
|
-
display: flex;
|
|
45
|
-
width: 40px;
|
|
46
|
-
height: 40px;
|
|
47
|
-
align-items: center;
|
|
48
|
-
justify-content: center;
|
|
49
|
-
}
|
|
50
|
-
:is(.bk .bk-chart-color-dropdown-button):hover .bk-chart-color-swatch {
|
|
51
|
-
outline-style: var(--bk-tw-outline-style);
|
|
52
|
-
outline-width: 2px;
|
|
53
|
-
outline-offset: calc(2px * -1);
|
|
54
|
-
outline-color: rgb(var(--bk-theme-mono-100) / 1);
|
|
55
|
-
}
|
|
56
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
57
|
-
:is(.bk .bk-chart-color-dropdown-button):hover .bk-chart-color-swatch {
|
|
58
|
-
outline-color: color-mix(in oklab, rgb(var(--bk-theme-mono-100) / 1) 40%, transparent);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
:is(:is(.bk .bk-chart-color-dropdown-button):hover .bk-chart-color-swatch):before {
|
|
62
|
-
opacity: 80%;
|
|
63
|
-
}
|
|
64
|
-
.bk .bk-chart-color-swatch {
|
|
65
|
-
position: relative;
|
|
66
|
-
display: block;
|
|
67
|
-
width: 20px;
|
|
68
|
-
height: 20px;
|
|
69
|
-
border-radius: calc(infinity * 1px);
|
|
70
|
-
}
|
|
71
|
-
:is(.bk .bk-chart-color-swatch):before {
|
|
72
|
-
content: '';
|
|
73
|
-
position: absolute;
|
|
74
|
-
top: 0px;
|
|
75
|
-
left: 0px;
|
|
76
|
-
width: 100%;
|
|
77
|
-
height: 100%;
|
|
78
|
-
border-radius: calc(infinity * 1px);
|
|
79
|
-
border-style: var(--bk-tw-border-style);
|
|
80
|
-
border-width: 1px;
|
|
81
|
-
border-color: rgb(var(--bk-theme-mono-900) / 1);
|
|
82
|
-
opacity: 40%;
|
|
83
|
-
}
|
|
84
|
-
</style>
|
package/dist/modules/charts/runtime/features/charts/Editor/CsvImport/OutputPreviewTable/index.vue
CHANGED
|
@@ -102,7 +102,7 @@ function onDragEnd() {
|
|
|
102
102
|
}
|
|
103
103
|
</script>
|
|
104
104
|
|
|
105
|
-
<style>/*! tailwindcss v4.
|
|
105
|
+
<style>/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
|
|
106
106
|
.bk-csv-preview-table th,.bk-csv-preview-table td {
|
|
107
107
|
border-right-style: var(--bk-tw-border-style);
|
|
108
108
|
border-right-width: 1px;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ColorOption } from '#blokkli/
|
|
1
|
+
import type { ColorOption } from '#blokkli/types/colors';
|
|
2
2
|
import type { ChartSeries } from '../../../../types.js';
|
|
3
3
|
export type CsvGrid = string[][];
|
|
4
4
|
export type ColumnRole = 'category' | 'series' | 'value' | 'groupBy' | 'ignore';
|
|
@@ -10,11 +10,15 @@
|
|
|
10
10
|
<th />
|
|
11
11
|
<th v-for="(s, si) in series" :key="si">
|
|
12
12
|
<div class="bk-chart-data-table-series-header">
|
|
13
|
-
<
|
|
13
|
+
<span
|
|
14
14
|
v-if="hasSeriesColors"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
class="_bk_contents"
|
|
16
|
+
>
|
|
17
|
+
<ColorDropdown
|
|
18
|
+
:color-id="s.color"
|
|
19
|
+
@select="updateSeriesColor(si, $event)"
|
|
20
|
+
/>
|
|
21
|
+
</span>
|
|
18
22
|
<input
|
|
19
23
|
type="text"
|
|
20
24
|
:value="s.name"
|
|
@@ -52,11 +56,15 @@
|
|
|
52
56
|
<tr v-for="(cat, ci) in categories" :key="ci">
|
|
53
57
|
<td>
|
|
54
58
|
<div class="bk-chart-data-table-category-cell">
|
|
55
|
-
<
|
|
59
|
+
<span
|
|
56
60
|
v-if="hasCategoryColors"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
class="_bk_contents"
|
|
62
|
+
>
|
|
63
|
+
<ColorDropdown
|
|
64
|
+
:color-id="categoryColors[ci] || ''"
|
|
65
|
+
@select="updateCategoryColor(ci, $event)"
|
|
66
|
+
/>
|
|
67
|
+
</span>
|
|
60
68
|
<input
|
|
61
69
|
type="text"
|
|
62
70
|
class="bk-chart-data-table-input _bk_font-semibold"
|
|
@@ -69,6 +69,7 @@ import { computed, useBlokkli } from "#imports";
|
|
|
69
69
|
import { createNumberFormatter } from "../../../../helpers/numberFormat";
|
|
70
70
|
import { FormSelect, FormText, FormRadio } from "#blokkli/editor/components";
|
|
71
71
|
import PanelSection from "#blokkli/editor/components/Panel/Section/index.vue";
|
|
72
|
+
import { chartsConfig } from "#blokkli-build/charts-config";
|
|
72
73
|
const { $t } = useBlokkli();
|
|
73
74
|
const props = defineProps({
|
|
74
75
|
format: { type: Object, required: true }
|
|
@@ -83,15 +84,30 @@ function update(key, value) {
|
|
|
83
84
|
}
|
|
84
85
|
emit("update:format", next);
|
|
85
86
|
}
|
|
87
|
+
function deriveLocaleLabel(id) {
|
|
88
|
+
let name = id;
|
|
89
|
+
try {
|
|
90
|
+
name = new Intl.DisplayNames([id], {
|
|
91
|
+
type: "language",
|
|
92
|
+
languageDisplay: "standard"
|
|
93
|
+
}).of(id) ?? id;
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
const example = new Intl.NumberFormat(id, {
|
|
98
|
+
minimumFractionDigits: 2
|
|
99
|
+
}).format(1234.5);
|
|
100
|
+
return `${name} \u2014 ${example}`;
|
|
101
|
+
} catch {
|
|
102
|
+
return name;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
86
105
|
const localeOptions = computed(() => [
|
|
87
106
|
{ value: "", label: $t("chartsNumberFormatLocaleAuto", "Auto (browser)") },
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{ value: "en-US", label: "English (US) \u2014 1,234.50" },
|
|
93
|
-
{ value: "en-GB", label: "English (UK) \u2014 1,234.50" },
|
|
94
|
-
{ value: "fr-FR", label: "Fran\xE7ais (France) \u2014 1 234,50" }
|
|
107
|
+
...chartsConfig.numberFormatLocales.map((id) => ({
|
|
108
|
+
value: id,
|
|
109
|
+
label: deriveLocaleLabel(id)
|
|
110
|
+
}))
|
|
95
111
|
]);
|
|
96
112
|
const decimalsOptions = computed(() => [
|
|
97
113
|
{ value: "", label: $t("auto", "Auto") },
|
|
@@ -239,9 +239,11 @@ import "#blokkli/charts/adapter";
|
|
|
239
239
|
import {
|
|
240
240
|
categoriesAreDates,
|
|
241
241
|
categoriesAreNumeric,
|
|
242
|
+
getColorIdAtIndex,
|
|
242
243
|
getDefaultChartData,
|
|
243
244
|
getFirstColorId
|
|
244
245
|
} from "../../../helpers";
|
|
246
|
+
import { isColorIdValid } from "#blokkli/helpers/colors";
|
|
245
247
|
import { getChartType, getDefaultTypeOptions } from "../../../chart-types";
|
|
246
248
|
import { useChartEditorState } from "./useChartEditorState";
|
|
247
249
|
import { useChartDataSourcePreview } from "./useChartDataSourcePreview";
|
|
@@ -283,24 +285,21 @@ function getCurrentData() {
|
|
|
283
285
|
const hasSeries = Array.isArray(parsed?.series) && parsed.series.length > 0;
|
|
284
286
|
if (parsed && (isAdvanced2 || hasSeries)) {
|
|
285
287
|
if (!isAdvanced2) {
|
|
286
|
-
const validIds = new Set(colorOptions.map((c) => c.id));
|
|
287
288
|
const fallbackId = getFirstColorId(colorOptions);
|
|
288
289
|
for (const series of parsed.series) {
|
|
289
|
-
if (!
|
|
290
|
+
if (!isColorIdValid(series.color, colorOptions)) {
|
|
290
291
|
series.color = fallbackId;
|
|
291
292
|
}
|
|
292
293
|
}
|
|
293
294
|
if (Array.isArray(parsed.categoryColors)) {
|
|
294
295
|
for (let i = 0; i < parsed.categoryColors.length; i++) {
|
|
295
|
-
if (!
|
|
296
|
+
if (!isColorIdValid(parsed.categoryColors[i], colorOptions)) {
|
|
296
297
|
parsed.categoryColors[i] = fallbackId;
|
|
297
298
|
}
|
|
298
299
|
}
|
|
299
300
|
} else {
|
|
300
301
|
parsed.categoryColors = parsed.categories.map(
|
|
301
|
-
(_, i) =>
|
|
302
|
-
return colorOptions[i % colorOptions.length]?.id || fallbackId;
|
|
303
|
-
}
|
|
302
|
+
(_, i) => getColorIdAtIndex(i, colorOptions)
|
|
304
303
|
);
|
|
305
304
|
}
|
|
306
305
|
} else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlokkliChartData, ChartSeries, ChartType } from '../../../types.js';
|
|
2
|
-
import type { ColorOption } from '#blokkli/
|
|
2
|
+
import type { ColorOption } from '#blokkli/types/colors';
|
|
3
3
|
export declare function useChartEditorState(initial: BlokkliChartData, options: ColorOption[]): {
|
|
4
4
|
data: any;
|
|
5
5
|
canUndo: any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BlokkliChartData } from '../types.js';
|
|
2
|
-
import type { ColorOption } from '#blokkli/
|
|
2
|
+
import type { ColorOption } from '#blokkli/types/colors';
|
|
3
3
|
export declare const SUPERSCRIPTS: Record<string, string>;
|
|
4
4
|
/**
|
|
5
5
|
* Replace `{1}`, `{2}`, etc. with Unicode superscript characters.
|
|
@@ -11,6 +11,7 @@ export declare function applyFootnotes(text: string): string;
|
|
|
11
11
|
export declare function getFirstColorId(options: ColorOption[]): string;
|
|
12
12
|
/**
|
|
13
13
|
* Get a color ID for the given index, cycling through available colors.
|
|
14
|
+
* Always returns the canonical form (`<base>.<mainShade>` for ramps).
|
|
14
15
|
*/
|
|
15
16
|
export declare function getColorIdAtIndex(index: number, options: ColorOption[]): string;
|
|
16
17
|
export declare function getDefaultChartData(options: ColorOption[]): BlokkliChartData;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { canonicalColorId } from "#blokkli/helpers/colors";
|
|
1
2
|
import { detectDateFormat } from "./dateFormat.js";
|
|
2
3
|
export const SUPERSCRIPTS = {
|
|
3
4
|
"1": "\xB9",
|
|
@@ -18,11 +19,12 @@ export function applyFootnotes(text) {
|
|
|
18
19
|
);
|
|
19
20
|
}
|
|
20
21
|
export function getFirstColorId(options) {
|
|
21
|
-
return options[0]
|
|
22
|
+
return options[0] ? canonicalColorId(options[0]) : "";
|
|
22
23
|
}
|
|
23
24
|
export function getColorIdAtIndex(index, options) {
|
|
24
25
|
if (options.length === 0) return "";
|
|
25
|
-
|
|
26
|
+
const option = options[index % options.length] ?? options[0];
|
|
27
|
+
return canonicalColorId(option);
|
|
26
28
|
}
|
|
27
29
|
export function getDefaultChartData(options) {
|
|
28
30
|
return {
|
|
@@ -216,6 +216,8 @@ export default defineBlokkliEditAdapter(
|
|
|
216
216
|
const mutations = (state?.mutations || []).filter(falsy);
|
|
217
217
|
const currentUserIsOwner = !!state?.currentUserIsOwner;
|
|
218
218
|
const ownerName = state?.ownerName || "";
|
|
219
|
+
const lastChangedRaw = state?.changedRawField?.first?.value;
|
|
220
|
+
const lastChanged = lastChangedRaw ? parseInt(lastChangedRaw) : void 0;
|
|
219
221
|
const fields = state?.mutatedState?.fields || [];
|
|
220
222
|
const violations = state.mutatedState?.violations || [];
|
|
221
223
|
const entity = state.entity;
|
|
@@ -255,6 +257,7 @@ export default defineBlokkliEditAdapter(
|
|
|
255
257
|
mutations,
|
|
256
258
|
currentUserIsOwner,
|
|
257
259
|
ownerName,
|
|
260
|
+
lastChanged,
|
|
258
261
|
ownerId: state.user?.id,
|
|
259
262
|
mutatedState: {
|
|
260
263
|
fields,
|
|
@@ -336,7 +339,8 @@ export default defineBlokkliEditAdapter(
|
|
|
336
339
|
return {
|
|
337
340
|
success: !!action?.success,
|
|
338
341
|
state: action?.state,
|
|
339
|
-
errors: (action?.errors ?? []).filter(falsy)
|
|
342
|
+
errors: (action?.errors ?? []).filter(falsy),
|
|
343
|
+
violations: action?.violations ?? []
|
|
340
344
|
};
|
|
341
345
|
};
|
|
342
346
|
const mapImportSummary = (summary) => {
|
package/dist/modules/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { b as Blokkli, B as BlokkliModule, d as defineBlokkliModule } from '../shared/editor.
|
|
1
|
+
export { b as Blokkli, B as BlokkliModule, d as defineBlokkliModule } from '../shared/editor.BDyiQvbV.mjs';
|
|
2
2
|
import 'nuxt/schema';
|
|
3
3
|
import 'consola';
|
|
4
4
|
import '../../dist/global/types/definitions.js';
|
|
@@ -6,7 +6,8 @@ const resolve = createResolver(
|
|
|
6
6
|
fileURLToPath(new URL("./", import.meta.url))
|
|
7
7
|
).resolve;
|
|
8
8
|
const index = defineBlokkliModule({
|
|
9
|
-
setup({ context }) {
|
|
9
|
+
setup({ context, helper }) {
|
|
10
|
+
helper.addPackageDependency("syllable");
|
|
10
11
|
context.registerAdapterExtension(
|
|
11
12
|
"@blokkli/readability",
|
|
12
13
|
resolve("./runtime/adapter-extension")
|