@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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type DefinitionString = string | Record<string, string>;
|
|
1
2
|
type DefinitionOptionText = {
|
|
2
3
|
/**
|
|
3
4
|
* The option type.
|
|
@@ -10,13 +11,17 @@ type DefinitionOptionText = {
|
|
|
10
11
|
/**
|
|
11
12
|
* The label displayed in the editor.
|
|
12
13
|
*/
|
|
13
|
-
label:
|
|
14
|
+
label: DefinitionString;
|
|
14
15
|
/**
|
|
15
16
|
* Optional description providing additional context.
|
|
16
17
|
*
|
|
17
18
|
* Displayed below the option label in the editor.
|
|
18
19
|
*/
|
|
19
|
-
description?:
|
|
20
|
+
description?: DefinitionString;
|
|
21
|
+
/**
|
|
22
|
+
* The placeholder.
|
|
23
|
+
*/
|
|
24
|
+
placeholder?: DefinitionString;
|
|
20
25
|
/**
|
|
21
26
|
* The HTML input type.
|
|
22
27
|
*
|
|
@@ -38,13 +43,13 @@ type DefinitionOptionNumberBase = {
|
|
|
38
43
|
/**
|
|
39
44
|
* The label displayed in the editor.
|
|
40
45
|
*/
|
|
41
|
-
label:
|
|
46
|
+
label: DefinitionString;
|
|
42
47
|
/**
|
|
43
48
|
* Optional description providing additional context.
|
|
44
49
|
*
|
|
45
50
|
* Displayed below the option label in the editor.
|
|
46
51
|
*/
|
|
47
|
-
description?:
|
|
52
|
+
description?: DefinitionString;
|
|
48
53
|
/**
|
|
49
54
|
* Minimum allowed value.
|
|
50
55
|
*
|
|
@@ -93,13 +98,13 @@ type DefinitionOptionRange = {
|
|
|
93
98
|
/**
|
|
94
99
|
* The label displayed in the editor.
|
|
95
100
|
*/
|
|
96
|
-
label:
|
|
101
|
+
label: DefinitionString;
|
|
97
102
|
/**
|
|
98
103
|
* Optional description providing additional context.
|
|
99
104
|
*
|
|
100
105
|
* Displayed below the option label in the editor.
|
|
101
106
|
*/
|
|
102
|
-
description?:
|
|
107
|
+
description?: DefinitionString;
|
|
103
108
|
/**
|
|
104
109
|
* Minimum allowed value.
|
|
105
110
|
*/
|
|
@@ -127,13 +132,13 @@ type DefinitionOptionDateTimeLocal = {
|
|
|
127
132
|
/**
|
|
128
133
|
* The label displayed in the editor.
|
|
129
134
|
*/
|
|
130
|
-
label:
|
|
135
|
+
label: DefinitionString;
|
|
131
136
|
/**
|
|
132
137
|
* Optional description providing additional context.
|
|
133
138
|
*
|
|
134
139
|
* Displayed below the option label in the editor.
|
|
135
140
|
*/
|
|
136
|
-
description?:
|
|
141
|
+
description?: DefinitionString;
|
|
137
142
|
/**
|
|
138
143
|
* The default value as an ISO 8601 datetime string.
|
|
139
144
|
*
|
|
@@ -167,13 +172,13 @@ type DefinitionOptionCheckbox = {
|
|
|
167
172
|
/**
|
|
168
173
|
* The label displayed in the editor.
|
|
169
174
|
*/
|
|
170
|
-
label:
|
|
175
|
+
label: DefinitionString;
|
|
171
176
|
/**
|
|
172
177
|
* Optional description providing additional context.
|
|
173
178
|
*
|
|
174
179
|
* Displayed below the option label in the editor.
|
|
175
180
|
*/
|
|
176
|
-
description?:
|
|
181
|
+
description?: DefinitionString;
|
|
177
182
|
/**
|
|
178
183
|
* Optional group name for organizing options.
|
|
179
184
|
*
|
|
@@ -195,13 +200,13 @@ type DefinitionOptionColor = {
|
|
|
195
200
|
/**
|
|
196
201
|
* The label displayed in the editor.
|
|
197
202
|
*/
|
|
198
|
-
label:
|
|
203
|
+
label: DefinitionString;
|
|
199
204
|
/**
|
|
200
205
|
* Optional description providing additional context.
|
|
201
206
|
*
|
|
202
207
|
* Displayed below the option label in the editor.
|
|
203
208
|
*/
|
|
204
|
-
description?:
|
|
209
|
+
description?: DefinitionString;
|
|
205
210
|
/**
|
|
206
211
|
* Optional group name for organizing options.
|
|
207
212
|
*
|
|
@@ -217,13 +222,13 @@ type DefinitionOptionCheckboxes = {
|
|
|
217
222
|
/**
|
|
218
223
|
* The label displayed in the editor.
|
|
219
224
|
*/
|
|
220
|
-
label:
|
|
225
|
+
label: DefinitionString;
|
|
221
226
|
/**
|
|
222
227
|
* Optional description providing additional context.
|
|
223
228
|
*
|
|
224
229
|
* Displayed below the option label in the editor.
|
|
225
230
|
*/
|
|
226
|
-
description?:
|
|
231
|
+
description?: DefinitionString;
|
|
227
232
|
/**
|
|
228
233
|
* The default values.
|
|
229
234
|
*/
|
|
@@ -233,7 +238,7 @@ type DefinitionOptionCheckboxes = {
|
|
|
233
238
|
*
|
|
234
239
|
* Key is the option value, value is the display label.
|
|
235
240
|
*/
|
|
236
|
-
options: Record<string,
|
|
241
|
+
options: Record<string, DefinitionString>;
|
|
237
242
|
/**
|
|
238
243
|
* Optional group name for organizing options.
|
|
239
244
|
*
|
|
@@ -251,11 +256,11 @@ type DefinitionOptionRadiosGridOption = {
|
|
|
251
256
|
/**
|
|
252
257
|
* The label displayed for this option.
|
|
253
258
|
*/
|
|
254
|
-
label:
|
|
259
|
+
label: DefinitionString;
|
|
255
260
|
/**
|
|
256
261
|
* Optional description providing additional context for this option.
|
|
257
262
|
*/
|
|
258
|
-
description?:
|
|
263
|
+
description?: DefinitionString;
|
|
259
264
|
};
|
|
260
265
|
type DefinitionOptionRadiosGrid = {
|
|
261
266
|
/**
|
|
@@ -285,11 +290,11 @@ type DefinitionOptionRadiosColorsOption = {
|
|
|
285
290
|
/**
|
|
286
291
|
* The label displayed for this option.
|
|
287
292
|
*/
|
|
288
|
-
label:
|
|
293
|
+
label: DefinitionString;
|
|
289
294
|
/**
|
|
290
295
|
* Optional description providing additional context for this option.
|
|
291
296
|
*/
|
|
292
|
-
description?:
|
|
297
|
+
description?: DefinitionString;
|
|
293
298
|
};
|
|
294
299
|
type DefinitionOptionRadiosColors = {
|
|
295
300
|
/**
|
|
@@ -317,8 +322,8 @@ type DefinitionOptionRadiosRadios = {
|
|
|
317
322
|
* label and optional description.
|
|
318
323
|
*/
|
|
319
324
|
options: Record<string, string | {
|
|
320
|
-
label:
|
|
321
|
-
description?:
|
|
325
|
+
label: DefinitionString;
|
|
326
|
+
description?: DefinitionString;
|
|
322
327
|
}>;
|
|
323
328
|
};
|
|
324
329
|
type DefinitionOptionRadiosIconsOptionBase<Icon extends string = string> = {
|
|
@@ -331,11 +336,11 @@ type DefinitionOptionRadiosIconsOptionBase<Icon extends string = string> = {
|
|
|
331
336
|
/**
|
|
332
337
|
* The label displayed for this option.
|
|
333
338
|
*/
|
|
334
|
-
label:
|
|
339
|
+
label: DefinitionString;
|
|
335
340
|
/**
|
|
336
341
|
* Optional description providing additional context for this option.
|
|
337
342
|
*/
|
|
338
|
-
description?:
|
|
343
|
+
description?: DefinitionString;
|
|
339
344
|
};
|
|
340
345
|
type DefinitionOptionRadiosIconsBase<Icon extends string = string> = {
|
|
341
346
|
/**
|
|
@@ -357,13 +362,13 @@ type DefinitionOptionRadiosBase<Icon extends string = string> = {
|
|
|
357
362
|
/**
|
|
358
363
|
* The label displayed in the editor.
|
|
359
364
|
*/
|
|
360
|
-
label:
|
|
365
|
+
label: DefinitionString;
|
|
361
366
|
/**
|
|
362
367
|
* Optional description providing additional context.
|
|
363
368
|
*
|
|
364
369
|
* Displayed below the option label in the editor.
|
|
365
370
|
*/
|
|
366
|
-
description?:
|
|
371
|
+
description?: DefinitionString;
|
|
367
372
|
/**
|
|
368
373
|
* The default value.
|
|
369
374
|
*
|
|
@@ -379,10 +384,10 @@ type DefinitionOptionRadiosBase<Icon extends string = string> = {
|
|
|
379
384
|
} & (DefinitionOptionRadiosColors | DefinitionOptionRadiosGrid | DefinitionOptionRadiosRadios | DefinitionOptionRadiosIconsBase<Icon>);
|
|
380
385
|
type DefinitionOptionJsonBase<DataType extends string = string> = {
|
|
381
386
|
type: 'json';
|
|
382
|
-
label:
|
|
387
|
+
label: DefinitionString;
|
|
383
388
|
default: string;
|
|
384
389
|
dataType?: DataType;
|
|
385
|
-
description?:
|
|
390
|
+
description?: DefinitionString;
|
|
386
391
|
group?: string;
|
|
387
392
|
};
|
|
388
393
|
export type BlockOptionDefinitionBase<Icon extends string = string, DataType extends string = string> = DefinitionOptionJsonBase<DataType> | DefinitionOptionColor | DefinitionOptionCheckbox | DefinitionOptionCheckboxes | DefinitionOptionRadiosBase<Icon> | DefinitionOptionText | DefinitionOptionRange | DefinitionOptionNumber | DefinitionOptionDateTimeLocal;
|
|
@@ -1,4 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A color option declared at build time.
|
|
3
|
+
*
|
|
4
|
+
* Two shapes:
|
|
5
|
+
* - A flat color with a single hex value.
|
|
6
|
+
* - A ramped color with a map of shades and an explicit `mainShade` that
|
|
7
|
+
* identifies which shade is the canonical/base swatch.
|
|
8
|
+
*
|
|
9
|
+
* For ramped colors, a chart can reference the base via the bare color id
|
|
10
|
+
* (e.g. `red`) or any specific shade via the compound id `red.<shade>` (e.g.
|
|
11
|
+
* `red.300`).
|
|
12
|
+
*/
|
|
1
13
|
export type ColorOption = {
|
|
14
|
+
label: string;
|
|
2
15
|
hex: string;
|
|
16
|
+
} | {
|
|
3
17
|
label: string;
|
|
18
|
+
shades: Record<string, string>;
|
|
19
|
+
mainShade: string;
|
|
4
20
|
};
|
package/dist/module.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NuxtModule } from 'nuxt/schema';
|
|
2
|
-
import { M as ModuleOptions } from './shared/editor.
|
|
3
|
-
export { a as ModuleHooks } from './shared/editor.
|
|
2
|
+
import { M as ModuleOptions } from './shared/editor.BDyiQvbV.mjs';
|
|
3
|
+
export { a as ModuleHooks } from './shared/editor.BDyiQvbV.mjs';
|
|
4
4
|
import 'consola';
|
|
5
5
|
import '../dist/global/types/definitions.js';
|
|
6
6
|
import '../dist/global/types/theme.js';
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import MagicString from 'magic-string';
|
|
|
5
5
|
import { walk } from 'estree-walker-ts';
|
|
6
6
|
import { pathToFileURL } from 'node:url';
|
|
7
7
|
import { parseURL, parseQuery } from 'ufo';
|
|
8
|
-
import { C as Collector, a as CollectedFile, c as extractObjectLiteral, p as parseTsObject, t as toValidVariableName, o as onlyUnique, f as falsy, s as sortObjectKeys } from './shared/editor.
|
|
8
|
+
import { C as Collector, a as CollectedFile, c as extractObjectLiteral, p as parseTsObject, t as toValidVariableName, o as onlyUnique, f as falsy, s as sortObjectKeys } from './shared/editor.BGemL1Oh.mjs';
|
|
9
9
|
import { dirname, resolve, relative } from 'pathe';
|
|
10
10
|
import micromatch from 'micromatch';
|
|
11
11
|
import { hash } from 'ohash';
|
|
@@ -19,7 +19,7 @@ import 'typescript';
|
|
|
19
19
|
import 'oxc-walker';
|
|
20
20
|
|
|
21
21
|
const name = "@blokkli/editor";
|
|
22
|
-
const version = "2.0.0-alpha.
|
|
22
|
+
const version = "2.0.0-alpha.64";
|
|
23
23
|
|
|
24
24
|
function validateOption(optionKey, option, icons) {
|
|
25
25
|
const errors = [];
|
|
@@ -1008,6 +1008,95 @@ class FileCache {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
1011
|
+
const HEX_COLOR_REGEX = /^#(?:[\da-f]{3}|[\da-f]{6})$/i;
|
|
1012
|
+
const VALID_ID_REGEX = /^[a-z_$][\w$]*$/i;
|
|
1013
|
+
function isHex(value) {
|
|
1014
|
+
return typeof value === "string" && HEX_COLOR_REGEX.test(value);
|
|
1015
|
+
}
|
|
1016
|
+
function isNonEmptyString(value) {
|
|
1017
|
+
return typeof value === "string" && value.length > 0;
|
|
1018
|
+
}
|
|
1019
|
+
function hasShades(option) {
|
|
1020
|
+
return "shades" in option && !!option.shades && typeof option.shades === "object";
|
|
1021
|
+
}
|
|
1022
|
+
function validateColorOption(colorId, option) {
|
|
1023
|
+
const errors = [];
|
|
1024
|
+
if (!VALID_ID_REGEX.test(colorId)) {
|
|
1025
|
+
errors.push({
|
|
1026
|
+
message: `Color id "${colorId}" is not a valid JavaScript identifier (must start with a letter, underscore or $, followed by letters, digits, underscores or $). Color ids may not contain "." \u2014 that character is reserved for shade-qualified ids (e.g. "red.300").`,
|
|
1027
|
+
optionKey: colorId
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
if (!isNonEmptyString(option.label)) {
|
|
1031
|
+
errors.push({
|
|
1032
|
+
message: `Option "${colorId}" is missing a non-empty "label".`,
|
|
1033
|
+
optionKey: colorId
|
|
1034
|
+
});
|
|
1035
|
+
}
|
|
1036
|
+
if (hasShades(option)) {
|
|
1037
|
+
const shadeKeys = Object.keys(option.shades);
|
|
1038
|
+
if (shadeKeys.length === 0) {
|
|
1039
|
+
errors.push({
|
|
1040
|
+
message: `Option "${colorId}" declares an empty "shades" object. Either omit "shades" or declare at least one shade.`,
|
|
1041
|
+
optionKey: colorId
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
for (const shadeKey of shadeKeys) {
|
|
1045
|
+
const shadeValue = option.shades[shadeKey];
|
|
1046
|
+
if (!isHex(shadeValue)) {
|
|
1047
|
+
errors.push({
|
|
1048
|
+
message: `Option "${colorId}" shade "${shadeKey}" has value "${shadeValue}" which is not a valid hex color (expected format: #RRGGBB or #RGB)`,
|
|
1049
|
+
optionKey: colorId
|
|
1050
|
+
});
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
if (!isNonEmptyString(option.mainShade)) {
|
|
1054
|
+
errors.push({
|
|
1055
|
+
message: `Option "${colorId}" declares "shades" but is missing "mainShade".`,
|
|
1056
|
+
optionKey: colorId
|
|
1057
|
+
});
|
|
1058
|
+
} else if (!shadeKeys.includes(option.mainShade)) {
|
|
1059
|
+
errors.push({
|
|
1060
|
+
message: `Option "${colorId}" mainShade "${option.mainShade}" is not a key of shades (available: ${shadeKeys.map((k) => `"${k}"`).join(", ")})`,
|
|
1061
|
+
optionKey: colorId
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
if ("hex" in option) {
|
|
1065
|
+
errors.push({
|
|
1066
|
+
message: `Option "${colorId}" declares both "hex" and "shades". Use one or the other: shaded colors derive their base hex from "shades[mainShade]".`,
|
|
1067
|
+
optionKey: colorId
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
} else {
|
|
1071
|
+
const hex = option.hex;
|
|
1072
|
+
if (hex === void 0) {
|
|
1073
|
+
errors.push({
|
|
1074
|
+
message: `Option "${colorId}": "hex" is required when "shades" is not provided.`,
|
|
1075
|
+
optionKey: colorId
|
|
1076
|
+
});
|
|
1077
|
+
} else if (!isHex(hex)) {
|
|
1078
|
+
errors.push({
|
|
1079
|
+
message: `Option "${colorId}" has hex value "${hex}" which is not a valid hex color (expected format: #RRGGBB or #RGB)`,
|
|
1080
|
+
optionKey: colorId
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
return errors;
|
|
1085
|
+
}
|
|
1086
|
+
function validateColorOptions(colorOptions) {
|
|
1087
|
+
if (!colorOptions) {
|
|
1088
|
+
return [];
|
|
1089
|
+
}
|
|
1090
|
+
const errors = [];
|
|
1091
|
+
for (const [colorId, option] of Object.entries(colorOptions)) {
|
|
1092
|
+
if (!option || typeof option !== "object") {
|
|
1093
|
+
continue;
|
|
1094
|
+
}
|
|
1095
|
+
errors.push(...validateColorOption(colorId, option));
|
|
1096
|
+
}
|
|
1097
|
+
return errors;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1011
1100
|
const defaultColorOptions = {
|
|
1012
1101
|
blue: { hex: "#3b82f6", label: "Blue" },
|
|
1013
1102
|
red: { hex: "#ef4444", label: "Red" },
|
|
@@ -1109,6 +1198,11 @@ class ModuleHelper {
|
|
|
1109
1198
|
resolvers;
|
|
1110
1199
|
fileCache;
|
|
1111
1200
|
options;
|
|
1201
|
+
/**
|
|
1202
|
+
* npm packages to pre-bundle via Vite's optimizeDeps, collected from the core
|
|
1203
|
+
* module and enabled sub-modules. Flushed by {@link applyBuildConfig}.
|
|
1204
|
+
*/
|
|
1205
|
+
packageDependencies = /* @__PURE__ */ new Set();
|
|
1112
1206
|
isDev;
|
|
1113
1207
|
isModuleBuild;
|
|
1114
1208
|
isPrepare;
|
|
@@ -1165,6 +1259,43 @@ class ModuleHelper {
|
|
|
1165
1259
|
from: this.resolvers.module.resolve("./runtime/composables/" + name)
|
|
1166
1260
|
});
|
|
1167
1261
|
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Register npm packages that the editor imports at runtime so Vite
|
|
1264
|
+
* pre-bundles them.
|
|
1265
|
+
*
|
|
1266
|
+
* Without this, Vite discovers a dependency lazily on first import (often via
|
|
1267
|
+
* a dynamic `import()`) and triggers a full page reload to re-optimize. The
|
|
1268
|
+
* core module declares its own dependencies; optional modules (agent, charts,
|
|
1269
|
+
* …) declare theirs only when enabled, so projects that don't use a module
|
|
1270
|
+
* don't pre-bundle its dependencies.
|
|
1271
|
+
*
|
|
1272
|
+
* Collected here and flushed to the Vite config by {@link applyBuildConfig},
|
|
1273
|
+
* which the core module calls once all modules have run their setup.
|
|
1274
|
+
*
|
|
1275
|
+
* @param names - Bare package specifiers (e.g. 'echarts', '@tiptap/core').
|
|
1276
|
+
*/
|
|
1277
|
+
addPackageDependency(...names) {
|
|
1278
|
+
for (const name of names) {
|
|
1279
|
+
this.packageDependencies.add(name);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
/**
|
|
1283
|
+
* Apply collected build configuration to the Nuxt/Vite config.
|
|
1284
|
+
*
|
|
1285
|
+
* Called once by the core module after every module's setup has run, so it
|
|
1286
|
+
* sees the full set of {@link addPackageDependency} registrations.
|
|
1287
|
+
*/
|
|
1288
|
+
applyBuildConfig() {
|
|
1289
|
+
this.nuxt.options.vite.optimizeDeps ??= {};
|
|
1290
|
+
const include = this.nuxt.options.vite.optimizeDeps.include ??= [];
|
|
1291
|
+
const exclude = this.nuxt.options.vite.optimizeDeps.exclude ?? [];
|
|
1292
|
+
for (const name of this.packageDependencies) {
|
|
1293
|
+
if (include.includes(name) || exclude.includes(name)) {
|
|
1294
|
+
continue;
|
|
1295
|
+
}
|
|
1296
|
+
include.push(name);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1168
1299
|
addAlias(name, path) {
|
|
1169
1300
|
this.nuxt.options.alias[name] = path;
|
|
1170
1301
|
this.nuxt.options.nitro.typescript ||= {};
|
|
@@ -1221,9 +1352,10 @@ class ModuleHelper {
|
|
|
1221
1352
|
return bundle;
|
|
1222
1353
|
}
|
|
1223
1354
|
validate(icons) {
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1355
|
+
let hasErrors = false;
|
|
1356
|
+
const optionErrors = validateOptions(this.options.globalOptions, icons);
|
|
1357
|
+
if (optionErrors.length > 0) {
|
|
1358
|
+
const lines = optionErrors.map((error) => {
|
|
1227
1359
|
const prefix = error.optionKey ? ` Option "${error.optionKey}": ` : " ";
|
|
1228
1360
|
return prefix + error.message;
|
|
1229
1361
|
});
|
|
@@ -1231,9 +1363,21 @@ class ModuleHelper {
|
|
|
1231
1363
|
`bl\xF6kkli global options validation errors:
|
|
1232
1364
|
${lines.join("\n")}`
|
|
1233
1365
|
);
|
|
1234
|
-
|
|
1366
|
+
hasErrors = true;
|
|
1235
1367
|
}
|
|
1236
|
-
|
|
1368
|
+
const colorErrors = validateColorOptions(this.options.colorOptions);
|
|
1369
|
+
if (colorErrors.length > 0) {
|
|
1370
|
+
const lines = colorErrors.map((error) => {
|
|
1371
|
+
const prefix = error.optionKey ? ` Option "${error.optionKey}": ` : " ";
|
|
1372
|
+
return prefix + error.message;
|
|
1373
|
+
});
|
|
1374
|
+
this.logger.error(
|
|
1375
|
+
`bl\xF6kkli colorOptions validation errors:
|
|
1376
|
+
${lines.join("\n")}`
|
|
1377
|
+
);
|
|
1378
|
+
hasErrors = true;
|
|
1379
|
+
}
|
|
1380
|
+
return hasErrors;
|
|
1237
1381
|
}
|
|
1238
1382
|
}
|
|
1239
1383
|
|
|
@@ -2121,12 +2265,20 @@ function mangleClassExpression(expr) {
|
|
|
2121
2265
|
}
|
|
2122
2266
|
return result;
|
|
2123
2267
|
}
|
|
2268
|
+
const CLASS_BEARING_PROPS = ["button-class", "background-class"];
|
|
2124
2269
|
function mangleTemplateAndScript(code) {
|
|
2125
2270
|
let result = code;
|
|
2126
2271
|
result = result.replace(
|
|
2127
2272
|
/(?<![-:.])\bclass="([^"]*)"/g,
|
|
2128
2273
|
(_match, value) => `class="${mangleClassString(value)}"`
|
|
2129
2274
|
);
|
|
2275
|
+
for (const prop of CLASS_BEARING_PROPS) {
|
|
2276
|
+
const staticAttr = new RegExp(`(?<![:.])\\b${prop}="([^"]*)"`, "g");
|
|
2277
|
+
result = result.replace(
|
|
2278
|
+
staticAttr,
|
|
2279
|
+
(_match, value) => `${prop}="${mangleClassString(value)}"`
|
|
2280
|
+
);
|
|
2281
|
+
}
|
|
2130
2282
|
result = result.replace(
|
|
2131
2283
|
/\btw\(\s*(['"])([\s\S]*?)\1\s*\)/g,
|
|
2132
2284
|
(_match, quote, value) => `tw(${quote}${mangleClassString(value)}${quote})`
|
|
@@ -2135,6 +2287,13 @@ function mangleTemplateAndScript(code) {
|
|
|
2135
2287
|
/(?::|v-bind:)class="([^"]*)"/g,
|
|
2136
2288
|
(_match, expr) => `:class="${mangleClassExpression(expr)}"`
|
|
2137
2289
|
);
|
|
2290
|
+
for (const prop of CLASS_BEARING_PROPS) {
|
|
2291
|
+
const boundAttr = new RegExp(`(:|v-bind:)${prop}="([^"]*)"`, "g");
|
|
2292
|
+
result = result.replace(
|
|
2293
|
+
boundAttr,
|
|
2294
|
+
(_match, prefix, expr) => `${prefix}${prop}="${mangleClassExpression(expr)}"`
|
|
2295
|
+
);
|
|
2296
|
+
}
|
|
2138
2297
|
return result;
|
|
2139
2298
|
}
|
|
2140
2299
|
function withTailwindConfig(cssContent, tailwindConfigPath) {
|
|
@@ -2279,6 +2438,19 @@ ${moduleCSS}
|
|
|
2279
2438
|
{ dependencies: ["module-css"] }
|
|
2280
2439
|
);
|
|
2281
2440
|
|
|
2441
|
+
function buildColorPalette(ctx) {
|
|
2442
|
+
const palette = [];
|
|
2443
|
+
for (const [id, option] of Object.entries(
|
|
2444
|
+
ctx.helper.options.colorOptions || {}
|
|
2445
|
+
)) {
|
|
2446
|
+
if ("shades" in option) {
|
|
2447
|
+
palette.push(`${id}.${option.mainShade}`);
|
|
2448
|
+
} else {
|
|
2449
|
+
palette.push(id);
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
return palette;
|
|
2453
|
+
}
|
|
2282
2454
|
function mapVars(ctx) {
|
|
2283
2455
|
return {
|
|
2284
2456
|
itemEntityType: JSON.stringify(
|
|
@@ -2289,7 +2461,8 @@ function mapVars(ctx) {
|
|
|
2289
2461
|
),
|
|
2290
2462
|
fragmentBlockBundle: JSON.stringify(
|
|
2291
2463
|
ctx.helper.options.fragmentBlockBundle ?? "blokkli_fragment"
|
|
2292
|
-
)
|
|
2464
|
+
),
|
|
2465
|
+
colorPalette: JSON.stringify(buildColorPalette(ctx))
|
|
2293
2466
|
};
|
|
2294
2467
|
}
|
|
2295
2468
|
const config = defineCodeTemplate(
|
|
@@ -2302,6 +2475,8 @@ export const itemEntityType = ${vars.itemEntityType}
|
|
|
2302
2475
|
export const fromLibraryBlockBundle = ${vars.fromLibraryBlockBundle}
|
|
2303
2476
|
|
|
2304
2477
|
export const fragmentBlockBundle = ${vars.fragmentBlockBundle}
|
|
2478
|
+
|
|
2479
|
+
export const colorPalette = ${vars.colorPalette}
|
|
2305
2480
|
`;
|
|
2306
2481
|
},
|
|
2307
2482
|
(ctx) => {
|
|
@@ -2314,6 +2489,15 @@ export declare const itemEntityType: ${vars.itemEntityType}
|
|
|
2314
2489
|
|
|
2315
2490
|
export declare const fromLibraryBlockBundle: ${vars.fromLibraryBlockBundle}
|
|
2316
2491
|
export declare const fragmentBlockBundle: ${vars.fragmentBlockBundle}
|
|
2492
|
+
|
|
2493
|
+
/**
|
|
2494
|
+
* Ordered list of canonical default color ids \u2014 one per declared family,
|
|
2495
|
+
* in declaration order. Flat colors appear as bare ids, ramped colors as
|
|
2496
|
+
* \`<id>.<mainShade>\`. Runtime consumers cycle through this to assign
|
|
2497
|
+
* default colors (e.g. dynamic chart series); the runtime composable also
|
|
2498
|
+
* walks it as a fallback cascade when a requested id can't be resolved.
|
|
2499
|
+
*/
|
|
2500
|
+
export declare const colorPalette: string[]
|
|
2317
2501
|
`;
|
|
2318
2502
|
}
|
|
2319
2503
|
);
|
|
@@ -3176,6 +3360,10 @@ import type { InterfaceLanguage } from '#blokkli-build/translations'
|
|
|
3176
3360
|
|
|
3177
3361
|
export type ValidColorOption = ${validColorOptions}
|
|
3178
3362
|
|
|
3363
|
+
export type GeneratedColorOption =
|
|
3364
|
+
| { label: string; hex: string }
|
|
3365
|
+
| { label: string; shades: Record<string, string>; mainShade: string }
|
|
3366
|
+
|
|
3179
3367
|
/**
|
|
3180
3368
|
* Whether the app uses a custom theme.
|
|
3181
3369
|
*/
|
|
@@ -3189,7 +3377,7 @@ export declare const themes: Record<string, Theme>
|
|
|
3189
3377
|
/**
|
|
3190
3378
|
* The available color options.
|
|
3191
3379
|
*/
|
|
3192
|
-
export declare const colorOptions: Record<ValidColorOption,
|
|
3380
|
+
export declare const colorOptions: Record<ValidColorOption, GeneratedColorOption>
|
|
3193
3381
|
|
|
3194
3382
|
/**
|
|
3195
3383
|
* The default theme.
|
|
@@ -3913,6 +4101,39 @@ const optionsSchema = withHelper((helper) => {
|
|
|
3913
4101
|
}
|
|
3914
4102
|
return defineFileTemplate(fileName, (ctx) => {
|
|
3915
4103
|
const globalOptions = ctx.helper.options.globalOptions || {};
|
|
4104
|
+
const defaultLanguage = ctx.helper.options.defaultLanguage || "en";
|
|
4105
|
+
const normalizeDefinitionString = (value) => {
|
|
4106
|
+
if (typeof value === "string") {
|
|
4107
|
+
return { [defaultLanguage]: value };
|
|
4108
|
+
}
|
|
4109
|
+
return value;
|
|
4110
|
+
};
|
|
4111
|
+
const normalizeOption = (option) => {
|
|
4112
|
+
if (!option || typeof option !== "object") {
|
|
4113
|
+
return option;
|
|
4114
|
+
}
|
|
4115
|
+
const result = { ...option };
|
|
4116
|
+
if ("label" in result) {
|
|
4117
|
+
result.label = normalizeDefinitionString(result.label);
|
|
4118
|
+
}
|
|
4119
|
+
if ("description" in result) {
|
|
4120
|
+
result.description = normalizeDefinitionString(result.description);
|
|
4121
|
+
}
|
|
4122
|
+
if (result.options && typeof result.options === "object") {
|
|
4123
|
+
const normalizedOptions = {};
|
|
4124
|
+
for (const [key, value] of Object.entries(result.options)) {
|
|
4125
|
+
if (result.type === "checkboxes") {
|
|
4126
|
+
normalizedOptions[key] = normalizeDefinitionString(value);
|
|
4127
|
+
} else if (typeof value === "string") {
|
|
4128
|
+
normalizedOptions[key] = { label: { [defaultLanguage]: value } };
|
|
4129
|
+
} else {
|
|
4130
|
+
normalizedOptions[key] = normalizeOption(value);
|
|
4131
|
+
}
|
|
4132
|
+
}
|
|
4133
|
+
result.options = normalizedOptions;
|
|
4134
|
+
}
|
|
4135
|
+
return result;
|
|
4136
|
+
};
|
|
3916
4137
|
const blocks = [...ctx.blocks.files.values()];
|
|
3917
4138
|
const schema = blocks.reduce((acc, v) => {
|
|
3918
4139
|
if (v.definition && isBlock(v.definition)) {
|
|
@@ -3928,6 +4149,12 @@ const optionsSchema = withHelper((helper) => {
|
|
|
3928
4149
|
}
|
|
3929
4150
|
return acc;
|
|
3930
4151
|
}, {});
|
|
4152
|
+
for (const bundle of Object.keys(schema)) {
|
|
4153
|
+
const options = schema[bundle];
|
|
4154
|
+
for (const key of Object.keys(options)) {
|
|
4155
|
+
options[key] = normalizeOption(options[key]);
|
|
4156
|
+
}
|
|
4157
|
+
}
|
|
3931
4158
|
const sorted = sortObjectKeys(schema);
|
|
3932
4159
|
return JSON.stringify(sorted, null, 2);
|
|
3933
4160
|
});
|
|
@@ -4366,14 +4593,21 @@ const module$1 = defineNuxtModule({
|
|
|
4366
4593
|
import.meta.url,
|
|
4367
4594
|
moduleOptions
|
|
4368
4595
|
);
|
|
4369
|
-
const colorOptions =
|
|
4596
|
+
const colorOptions = {};
|
|
4597
|
+
for (const [id, option] of Object.entries(
|
|
4370
4598
|
helper.options.colorOptions || {}
|
|
4371
|
-
)
|
|
4372
|
-
|
|
4373
|
-
|
|
4374
|
-
|
|
4599
|
+
)) {
|
|
4600
|
+
if ("shades" in option) {
|
|
4601
|
+
colorOptions[id] = option.shades[option.mainShade];
|
|
4602
|
+
for (const [shadeId, hex] of Object.entries(option.shades)) {
|
|
4603
|
+
colorOptions[`${id}.${shadeId}`] = hex;
|
|
4604
|
+
}
|
|
4605
|
+
} else {
|
|
4606
|
+
colorOptions[id] = option.hex;
|
|
4607
|
+
}
|
|
4608
|
+
}
|
|
4375
4609
|
nuxt.options.appConfig.blokkli = {
|
|
4376
|
-
// @ts-expect-error
|
|
4610
|
+
// @ts-expect-error generic type vs runtime derived type.
|
|
4377
4611
|
colorOptions
|
|
4378
4612
|
};
|
|
4379
4613
|
const theme = new ThemeData(helper);
|
|
@@ -4437,9 +4671,31 @@ const module$1 = defineNuxtModule({
|
|
|
4437
4671
|
const moduleDir = import.meta.url;
|
|
4438
4672
|
const resolver = createResolver(moduleDir);
|
|
4439
4673
|
nuxt.options.build.transpile.push(resolver.resolve("runtime"));
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4674
|
+
helper.addPackageDependency(
|
|
4675
|
+
"@floating-ui/dom",
|
|
4676
|
+
"@tiptap/core",
|
|
4677
|
+
"@tiptap/extension-emoji",
|
|
4678
|
+
"@tiptap/extension-mention",
|
|
4679
|
+
"@tiptap/extension-task-item",
|
|
4680
|
+
"@tiptap/extension-task-list",
|
|
4681
|
+
"@tiptap/starter-kit",
|
|
4682
|
+
"@tiptap/vue-3",
|
|
4683
|
+
"@vue/devtools-core",
|
|
4684
|
+
"@vue/devtools-kit",
|
|
4685
|
+
"axe-core",
|
|
4686
|
+
// CJS
|
|
4687
|
+
"fzf",
|
|
4688
|
+
"get-video-id",
|
|
4689
|
+
"html-diff-ts",
|
|
4690
|
+
"mitt",
|
|
4691
|
+
"papaparse",
|
|
4692
|
+
// CJS
|
|
4693
|
+
"pofile",
|
|
4694
|
+
// CJS
|
|
4695
|
+
"qrcode.vue",
|
|
4696
|
+
"twgl.js"
|
|
4697
|
+
);
|
|
4698
|
+
helper.applyBuildConfig();
|
|
4443
4699
|
helper.addComponent("BlokkliField");
|
|
4444
4700
|
helper.addComponent("BlokkliEditable");
|
|
4445
4701
|
helper.addComponent("BlokkliProvider");
|
|
@@ -4450,6 +4706,7 @@ const module$1 = defineNuxtModule({
|
|
|
4450
4706
|
helper.addComposable("defineBlokkliProvider");
|
|
4451
4707
|
helper.addComposable("useBlokkli");
|
|
4452
4708
|
helper.addComposable("useBlokkliHelper");
|
|
4709
|
+
helper.addComposable("useBlokkliRuntimeConfig");
|
|
4453
4710
|
helper.addAlias(
|
|
4454
4711
|
"#blokkli/analyzer",
|
|
4455
4712
|
resolver.resolve("runtime/editor/features/analyze/analyzers")
|