@blokkli/editor 2.0.0-alpha.2 → 2.0.0-alpha.20
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/module.d.mts +1 -1
- package/dist/module.json +5 -5
- package/dist/module.mjs +5549 -1269
- package/dist/modules/drupal/graphql/base/fragment.ParagraphsBlokkliConfigInput.graphql +31 -0
- package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +9 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsBlokkliEditState.graphql +5 -0
- package/dist/modules/drupal/graphql/base/fragment.paragraphsFieldItem.graphql +9 -0
- package/dist/modules/drupal/graphql/base/query.pbConfig.graphql +1 -10
- package/dist/modules/drupal/graphql/base/query.pbEntityConfig.graphql +5 -0
- package/dist/modules/drupal/graphql/features/comments.graphql +11 -8
- package/dist/modules/drupal/graphql/features/publishNew.graphql +1 -4
- package/dist/modules/drupal/graphql/features/scheduler.graphql +31 -0
- package/dist/modules/drupal/graphql/features/transform.graphql +9 -1
- package/dist/modules/drupal/graphql/features/transform_host.graphql +38 -0
- package/dist/modules/drupal/graphql/mutations/set_paragraph_schedule.graphql +15 -0
- package/dist/modules/drupal/graphql/mutations/update_host_options.graphql +15 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/index.mjs +79 -9
- package/dist/modules/drupal/runtime/adapter/index.d.ts +3 -0
- package/dist/modules/drupal/{adapter/index.mjs → runtime/adapter/index.js} +166 -20
- package/dist/runtime/adapter/index.d.ts +111 -1
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +27 -3
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue +65 -0
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +26 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/Menu/index.vue +6 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +3 -2
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +2 -19
- package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +2 -7
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +3 -3
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +2 -19
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue +23 -15
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +21 -44
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +49 -11
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +29 -15
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue.d.ts +3 -3
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -7
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +2 -51
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +2 -9
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +15 -9
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +1 -1
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +10 -5
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +2 -4
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +6 -3
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +4 -3
- package/dist/runtime/blokkliPlugins/index.d.ts +8 -7
- package/dist/runtime/blokkliPlugins/index.js +15 -13
- package/dist/runtime/components/Blocks/Fragment/icon.svg +1 -1
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +4 -2
- package/dist/runtime/components/BlokkliEditable.vue +34 -16
- package/dist/runtime/components/BlokkliEditable.vue.d.ts +2 -1
- package/dist/runtime/components/BlokkliField.vue +31 -27
- package/dist/runtime/components/BlokkliField.vue.d.ts +61 -17
- package/dist/runtime/components/BlokkliItem.vue +2 -2
- package/dist/runtime/components/BlokkliItem.vue.d.ts +4 -2
- package/dist/runtime/components/BlokkliProvider.vue +51 -39
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +45 -7
- package/dist/runtime/components/Edit/Actions/index.vue +69 -78
- package/dist/runtime/components/Edit/AddListItem/index.vue +2 -5
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +19 -0
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +436 -25
- package/dist/runtime/components/Edit/AppMenu/index.vue +5 -5
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +83 -0
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Banner/index.vue +51 -0
- package/dist/runtime/components/Edit/Banner/index.vue.d.ts +18 -0
- package/dist/runtime/components/Edit/BlockProxy/index.vue +3 -1
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +2 -13
- package/dist/runtime/components/Edit/Dialog/index.vue +14 -5
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +4 -2
- package/dist/runtime/components/Edit/DiffViewer/State.vue +276 -0
- package/dist/runtime/components/Edit/DiffViewer/State.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/DraggableList.vue +20 -50
- package/dist/runtime/components/Edit/DraggableList.vue.d.ts +7 -7
- package/dist/runtime/components/Edit/EditIndicator.vue +118 -44
- package/dist/runtime/components/Edit/EditIndicator.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/EditProvider.vue +153 -64
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/AddList/index.vue +24 -36
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/fragment.glsl +58 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +170 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue.d.ts +9 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/vertex.glsl +72 -0
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue +159 -0
- package/dist/runtime/components/Edit/Features/Analyze/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +100 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +56 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +87 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +105 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +8 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue +18 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Status.vue.d.ts +8 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +92 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue.d.ts +17 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue +77 -0
- package/dist/runtime/components/Edit/Features/Analyze/Summary/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.d.ts +12 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +75 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.d.ts +4 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/defineAnalyzer.js +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +45 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/collectTextElements.js +95 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.d.ts +3 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/normalizeArray.js +13 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/index.js +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +165 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +44 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.js +0 -0
- package/dist/runtime/components/Edit/Features/Analyze/helper.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/helper.js +28 -0
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +44 -0
- package/dist/runtime/components/Edit/Features/Anchors/Renderer.vue +53 -0
- package/dist/runtime/components/Edit/Features/Anchors/index.vue +32 -0
- package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +25 -13
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +299 -0
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/Artboard/index.vue +10 -217
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +5 -3
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +33 -57
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue +154 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/ScheduleSection.vue.d.ts +27 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +222 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +96 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +177 -46
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +51 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +17 -0
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +48 -117
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +5 -2
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +35 -20
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue +29 -0
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +22 -16
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +15 -6
- package/dist/runtime/components/Edit/Features/Comments/index.vue +21 -9
- package/dist/runtime/components/Edit/Features/Conversions/index.vue +16 -21
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +26 -35
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +240 -0
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Debug/Viewport/index.vue +14 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +7 -162
- package/dist/runtime/components/Edit/Features/Delete/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Diff/DiffView/index.vue +13 -190
- package/dist/runtime/components/Edit/Features/Diff/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +18 -10
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +8 -2
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +111 -121
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue.d.ts +3 -132
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +2 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +87 -61
- package/dist/runtime/components/Edit/Features/Duplicate/index.vue +6 -8
- package/dist/runtime/components/Edit/Features/Edit/index.vue +16 -22
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +10 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +69 -4
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +13 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +45 -87
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +45 -43
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +3 -20
- package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +33 -1
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/index.vue +11 -9
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +8 -6
- package/dist/runtime/components/Edit/Features/History/index.vue +39 -13
- package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +139 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue +261 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/vertex.glsl +117 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue +25 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +6 -2
- package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +5 -7
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +19 -27
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +32 -28
- package/dist/runtime/components/Edit/Features/Library/index.vue +40 -32
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +11 -11
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +15 -12
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/fragment.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +44 -32
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/vertex.glsl +1 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +10 -18
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Options/Form/Checkbox/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Options/Form/Group.vue.d.ts +2 -11
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +14 -3
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue +37 -19
- package/dist/runtime/components/Edit/Features/Options/Form/Radios/index.vue.d.ts +8 -2
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +88 -42
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/Features/Options/index.vue +35 -11
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue +35 -0
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +7 -25
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/ProxyView/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue +41 -14
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Item.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue +47 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/PublishOption.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue +83 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue.d.ts +9 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +439 -123
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue.d.ts +3 -14
- package/dist/runtime/components/Edit/Features/Publish/index.vue +57 -24
- package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue.d.ts +2 -13
- package/dist/runtime/components/Edit/Features/Revert/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +15 -15
- package/dist/runtime/components/Edit/Features/Search/index.vue +7 -3
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +85 -0
- package/dist/runtime/components/Edit/Features/{CommandPalette/Palette/Group → Selection/AddButtons/Overlay}/index.vue.d.ts +8 -13
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +106 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +440 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +102 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +387 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Selection/Overlay/fragment.glsl +15 -10
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +105 -25
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +12 -3
- package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Selection/index.vue +135 -25
- package/dist/runtime/components/Edit/Features/Settings/Dialog/FeatureSetting/index.vue +12 -17
- package/dist/runtime/components/Edit/Features/Settings/index.vue +11 -25
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Structure/List/Item/index.vue +13 -6
- package/dist/runtime/components/Edit/Features/Theme/Color/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Theme/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +3 -0
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +198 -0
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Transform/index.vue +156 -70
- package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +17 -11
- package/dist/runtime/components/Edit/Features/Translations/index.vue +20 -23
- package/dist/runtime/components/Edit/Features/Validations/SidebarItem/index.vue +5 -5
- package/dist/runtime/components/Edit/Features/index.vue +17 -7
- package/dist/runtime/components/Edit/Form/Datepicker/index.vue +198 -0
- package/dist/runtime/components/Edit/Form/Datepicker/index.vue.d.ts +15 -0
- package/dist/runtime/components/Edit/Form/Group/index.vue.d.ts +2 -4
- package/dist/runtime/components/Edit/Form/Item/index.vue.d.ts +2 -4
- package/dist/runtime/components/Edit/Form/Radio/index.vue +33 -0
- package/dist/runtime/components/Edit/Form/Radio/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/RadioTabs/index.vue +37 -0
- package/dist/runtime/components/Edit/Form/RadioTabs/index.vue.d.ts +22 -0
- package/dist/runtime/components/Edit/Form/Select/index.vue +29 -0
- package/dist/runtime/components/Edit/Form/Select/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue +34 -0
- package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/Form/Textarea/index.vue +13 -6
- package/dist/runtime/components/Edit/Form/Textarea/index.vue.d.ts +4 -0
- package/dist/runtime/components/Edit/Form/Toggle/index.vue +4 -3
- package/dist/runtime/components/Edit/Form/Toggle/index.vue.d.ts +12 -2
- package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue.d.ts +3 -2
- package/dist/runtime/components/Edit/Indicators/index.vue +123 -0
- package/dist/runtime/components/Edit/Indicators/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/InfoBox/index.vue +6 -2
- package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +12 -2
- package/dist/runtime/components/Edit/ItemIcon/index.vue +2 -1
- package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue +66 -0
- package/dist/runtime/components/Edit/Konami/Game/PixelGrid.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Konami/Game/blokkli.png +0 -0
- package/dist/runtime/components/Edit/Konami/Game/charmap.d.ts +2 -0
- package/dist/runtime/components/Edit/Konami/Game/charmap.js +168 -0
- package/dist/runtime/components/Edit/Konami/Game/index.vue +752 -0
- package/dist/runtime/components/Edit/Konami/Game/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Konami/Game/textRendering.d.ts +8 -0
- package/dist/runtime/components/Edit/Konami/Game/textRendering.js +138 -0
- package/dist/runtime/components/Edit/Konami/Game/useIconRendering.d.ts +9 -0
- package/dist/runtime/components/Edit/Konami/Game/useIconRendering.js +130 -0
- package/dist/runtime/components/Edit/Konami/index.vue +44 -0
- package/dist/runtime/components/Edit/Konami/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Loading/index.vue +6 -2
- package/dist/runtime/components/Edit/Loading/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Messages/index.vue +8 -3
- package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue +17 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Checkbox/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue +37 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Options/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue +43 -0
- package/dist/runtime/components/Edit/PluginConfigForm/Text/index.vue.d.ts +11 -0
- package/dist/runtime/components/Edit/PluginConfigForm/index.vue +57 -0
- package/dist/runtime/components/Edit/PluginConfigForm/index.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +3 -4
- package/dist/runtime/components/Edit/RelativeTime/index.vue +3 -2
- package/dist/runtime/components/Edit/RelativeTime/index.vue.d.ts +2 -2
- package/dist/runtime/components/Edit/Resizable/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/ScaleToFit/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/ScheduleDate/index.vue +131 -0
- package/dist/runtime/components/Edit/ScheduleDate/index.vue.d.ts +23 -0
- package/dist/runtime/components/Edit/ScrollBoundary/index.vue.d.ts +2 -7
- package/dist/runtime/components/Edit/ShortcutIndicator/index.vue +11 -3
- package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +3 -3
- package/dist/runtime/components/Edit/Toolbar/index.vue +3 -2
- package/dist/runtime/components/Edit/Transition/Height.vue +95 -0
- package/dist/runtime/components/Edit/Transition/Height.vue.d.ts +36 -0
- package/dist/runtime/components/Edit/Transition/index.vue +41 -0
- package/dist/runtime/components/Edit/Transition/index.vue.d.ts +19 -0
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +2 -7
- package/dist/runtime/components/Edit/index.d.ts +28 -15
- package/dist/runtime/components/Edit/index.js +54 -28
- package/dist/runtime/composables/defineBlokkli.js +16 -3
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +4 -7
- package/dist/runtime/composables/defineBlokkliFragment.js +8 -1
- package/dist/runtime/composables/defineBlokkliProvider.d.ts +11 -0
- package/dist/runtime/composables/defineBlokkliProvider.js +46 -0
- package/dist/runtime/composables/useBlokkliHelper.d.ts +19 -0
- package/dist/runtime/composables/useBlokkliHelper.js +95 -0
- package/dist/runtime/constants/index.d.ts +3 -0
- package/dist/runtime/constants/index.js +3 -0
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/addElementClasses.d.ts +2 -0
- package/dist/runtime/helpers/addElementClasses.js +24 -0
- package/dist/runtime/helpers/animationProvider.d.ts +38 -2
- package/dist/runtime/helpers/animationProvider.js +188 -47
- package/dist/runtime/helpers/bundles/index.d.ts +1 -0
- package/dist/runtime/helpers/bundles/index.js +4 -0
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +8 -0
- package/dist/runtime/helpers/composables/defineRenderer.js +8 -0
- package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +5 -0
- package/dist/runtime/helpers/composables/useBlockRegistration.js +23 -0
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.d.ts +1 -1
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.js +3 -2
- package/dist/runtime/helpers/composables/useStateBasedCache.d.ts +4 -0
- package/dist/runtime/helpers/composables/useStateBasedCache.js +13 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +23 -0
- package/dist/runtime/helpers/composables/useStickyToolbar.js +233 -0
- package/dist/runtime/helpers/definitionProvider.d.ts +3 -2
- package/dist/runtime/helpers/definitionProvider.js +17 -0
- package/dist/runtime/helpers/dom/index.d.ts +60 -0
- package/dist/runtime/helpers/dom/index.js +48 -0
- package/dist/runtime/helpers/domProvider.d.ts +58 -17
- package/dist/runtime/helpers/domProvider.js +320 -245
- package/dist/runtime/helpers/dropTargets/index.d.ts +6 -0
- package/dist/runtime/helpers/dropTargets/index.js +49 -0
- package/dist/runtime/helpers/eventBus.d.ts +1 -1
- package/dist/runtime/helpers/eventBus.js +2 -2
- package/dist/runtime/helpers/index.d.ts +10 -14
- package/dist/runtime/helpers/index.js +58 -121
- package/dist/runtime/helpers/indicatorsProvider.d.ts +10 -0
- package/dist/runtime/helpers/indicatorsProvider.js +23 -0
- package/dist/runtime/helpers/keyboardProvider.d.ts +2 -0
- package/dist/runtime/helpers/keyboardProvider.js +17 -1
- package/dist/runtime/helpers/pluginProvider.d.ts +10 -0
- package/dist/runtime/helpers/pluginProvider.js +33 -0
- package/dist/runtime/helpers/providers/blocks.d.ts +10 -0
- package/dist/runtime/helpers/providers/blocks.js +91 -0
- package/dist/runtime/helpers/providers/directive.d.ts +25 -0
- package/dist/runtime/helpers/providers/directive.js +208 -0
- package/dist/runtime/helpers/providers/element.d.ts +6 -0
- package/dist/runtime/helpers/providers/element.js +35 -0
- package/dist/runtime/helpers/providers/fields.d.ts +8 -0
- package/dist/runtime/helpers/providers/fields.js +47 -0
- package/dist/runtime/helpers/renderCycle.d.ts +1 -0
- package/dist/runtime/helpers/renderCycle.js +10 -0
- package/dist/runtime/helpers/runtimeHelpers/index.js +15 -12
- package/dist/runtime/helpers/selectionProvider.d.ts +27 -11
- package/dist/runtime/helpers/selectionProvider.js +79 -74
- package/dist/runtime/helpers/stateProvider.d.ts +12 -2
- package/dist/runtime/helpers/stateProvider.js +164 -20
- package/dist/runtime/helpers/storageProvider.d.ts +5 -3
- package/dist/runtime/helpers/storageProvider.js +61 -4
- package/dist/runtime/helpers/symbols.d.ts +2 -0
- package/dist/runtime/helpers/symbols.js +2 -0
- package/dist/runtime/helpers/textProvider.js +6 -0
- package/dist/runtime/helpers/themeProvider.d.ts +4 -1
- package/dist/runtime/helpers/themeProvider.js +28 -15
- package/dist/runtime/helpers/transform.js +1 -3
- package/dist/runtime/helpers/typesProvider.js +10 -26
- package/dist/runtime/helpers/uiProvider.d.ts +18 -3
- package/dist/runtime/helpers/uiProvider.js +114 -61
- package/dist/runtime/helpers/useTransitionedValue.d.ts +18 -0
- package/dist/runtime/helpers/useTransitionedValue.js +57 -0
- package/dist/runtime/helpers/webgl/index.d.ts +11 -2
- package/dist/runtime/helpers/webgl/index.js +162 -7
- package/dist/runtime/icons/anchor.svg +1 -0
- package/dist/runtime/icons/arrow-left.svg +1 -1
- package/dist/runtime/icons/arrow-right.svg +1 -1
- package/dist/runtime/icons/arrow-top-right.svg +1 -0
- package/dist/runtime/icons/calendar-clock.svg +1 -0
- package/dist/runtime/icons/calendar.svg +1 -0
- package/dist/runtime/icons/chart.svg +1 -0
- package/dist/runtime/icons/clock.svg +1 -0
- package/dist/runtime/icons/comment_add.svg +1 -5
- package/dist/runtime/icons/copy.svg +1 -0
- package/dist/runtime/icons/cursor-move.svg +1 -1
- package/dist/runtime/icons/delete.svg +1 -8
- package/dist/runtime/icons/diff.svg +1 -1
- package/dist/runtime/icons/duplicate.svg +1 -12
- package/dist/runtime/icons/edit.svg +1 -8
- package/dist/runtime/icons/eye-off.svg +1 -0
- package/dist/runtime/icons/eye.svg +1 -1
- package/dist/runtime/icons/info.svg +1 -1
- package/dist/runtime/icons/link.svg +1 -0
- package/dist/runtime/icons/reusable.svg +1 -5
- package/dist/runtime/icons/speedometer.svg +1 -0
- package/dist/runtime/plugins/blokkliDirectives.js +96 -0
- package/dist/runtime/types/blokkOptions.d.ts +8 -0
- package/dist/runtime/types/index.d.ts +278 -42
- package/dist/runtime/types/theme.d.ts +2 -1
- package/dist/shared/{editor.gz_ac6uT.d.mts → editor.CKsrTpc1.d.mts} +1 -1
- package/package.json +55 -38
- package/dist/modules/drupal/adapter/index.d.mts +0 -6
- package/dist/runtime/components/Edit/DragInteractions/index.vue +0 -364
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Group/index.vue +0 -51
- package/dist/runtime/components/Edit/Features/FieldAreas/Overlay/index.vue +0 -22
- package/dist/runtime/components/Edit/Features/FieldAreas/index.vue +0 -41
- package/dist/runtime/plugins/blokkliEditable.js +0 -31
- /package/dist/runtime/components/Edit/{DragInteractions → Features/Analyze}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/{FieldAreas/Overlay/index.vue.d.ts → Anchors/Renderer.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/{FieldAreas → Anchors}/index.vue.d.ts +0 -0
- /package/dist/runtime/plugins/{blokkliEditable.d.ts → blokkliDirectives.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Ref, type ComputedRef } from 'vue';
|
|
2
2
|
import type { BlokkliAdapter, AdapterContext } from '../adapter/index.js';
|
|
3
|
-
import type { MutatedField, EditEntity, MutatedOptions, TranslationState, MutationItem, Validation, MutateWithLoadingStateFunction, EditMode, FieldListItem } from '#blokkli/types';
|
|
3
|
+
import type { MutatedField, EditEntity, MutatedOptions, TranslationState, MappedState, MutationItem, Validation, MutateWithLoadingStateFunction, EditMode, FieldListItem, PublishOptions, EditPermission } from '#blokkli/types';
|
|
4
4
|
import type { TextProvider } from './textProvider.js';
|
|
5
5
|
export type BlokkliOwner = {
|
|
6
6
|
name: string | undefined;
|
|
@@ -19,6 +19,7 @@ export type StateProvider = {
|
|
|
19
19
|
entity: Readonly<Ref<EditEntity>>;
|
|
20
20
|
mutatedOptions: MutatedOptions;
|
|
21
21
|
translation: Readonly<Ref<TranslationState>>;
|
|
22
|
+
publishOptions: Readonly<Ref<PublishOptions>>;
|
|
22
23
|
mutations: Readonly<Ref<MutationItem[]>>;
|
|
23
24
|
currentMutationIndex: Readonly<Ref<number>>;
|
|
24
25
|
violations: Readonly<Ref<Validation[]>>;
|
|
@@ -26,12 +27,21 @@ export type StateProvider = {
|
|
|
26
27
|
editMode: Readonly<Ref<EditMode>>;
|
|
27
28
|
mutatedEntity: Readonly<Ref<any>>;
|
|
28
29
|
canEdit: ComputedRef<boolean>;
|
|
30
|
+
permissions: ComputedRef<EditPermission[]>;
|
|
29
31
|
stateAvailable: ComputedRef<boolean>;
|
|
30
32
|
isLoading: Readonly<Ref<boolean>>;
|
|
33
|
+
fromLibraryUuids: Readonly<Ref<Readonly<string[]>>>;
|
|
31
34
|
getFieldBlockCount: (key: string) => number;
|
|
32
35
|
getBlockBundleCount: (bundle: string) => number;
|
|
33
36
|
getFieldListItem: (uuid: string) => FieldListItem | undefined;
|
|
34
37
|
getFieldListForBlock: (uuid: string) => MutatedField | undefined;
|
|
35
38
|
getMutatedField: (uuid: string, fieldName: string) => MutatedField | undefined;
|
|
39
|
+
getAllUuids: (bundle?: string) => string[];
|
|
40
|
+
getNestingLevel: (uuid: string) => number;
|
|
41
|
+
isChildOf: (childUuid: string, parentUuid: string) => boolean;
|
|
42
|
+
getMappedState: () => MappedState;
|
|
43
|
+
setOverrideState: (state: MappedState) => void;
|
|
44
|
+
clearOverrideState: () => void;
|
|
45
|
+
getFieldKeyForUuid: (uuid: string) => string | null;
|
|
36
46
|
};
|
|
37
|
-
export default function (adapter: BlokkliAdapter<any>, context: ComputedRef<AdapterContext>, $t: TextProvider): Promise<StateProvider>;
|
|
47
|
+
export default function (adapter: BlokkliAdapter<any>, context: ComputedRef<AdapterContext>, $t: TextProvider, providerKey: string, permissions: EditPermission[]): Promise<StateProvider>;
|
|
@@ -5,13 +5,29 @@ import {
|
|
|
5
5
|
readonly,
|
|
6
6
|
provide
|
|
7
7
|
} from "vue";
|
|
8
|
-
import { refreshNuxtData } from "nuxt/app";
|
|
8
|
+
import { refreshNuxtData, useState } from "nuxt/app";
|
|
9
9
|
import { INJECT_MUTATED_FIELDS_MAP } from "./symbols.js";
|
|
10
10
|
import onBlokkliEvent from "./composables/onBlokkliEvent.js";
|
|
11
11
|
import { falsy, getFieldKey } from "#blokkli/helpers";
|
|
12
12
|
import { eventBus, emitMessage } from "#blokkli/helpers/eventBus";
|
|
13
13
|
import { nextTick } from "#imports";
|
|
14
|
-
|
|
14
|
+
import { addElementClasses } from "./addElementClasses.js";
|
|
15
|
+
import { BUNDLE_FROM_LIBRARY } from "#blokkli/constants";
|
|
16
|
+
const HOST_OPTION_KEY = "HOST";
|
|
17
|
+
function mapPublishOptions(context) {
|
|
18
|
+
return {
|
|
19
|
+
canPublish: !!context?.publishOptions?.canPublish,
|
|
20
|
+
isRevisionable: !!context?.publishOptions?.isRevisionable,
|
|
21
|
+
hasRevisionLogMessage: !!context?.publishOptions?.hasRevisionLogMessage,
|
|
22
|
+
canSchedule: !!context?.publishOptions?.canSchedule,
|
|
23
|
+
lastChanged: context?.publishOptions?.lastChanged ?? null,
|
|
24
|
+
publishOn: context?.publishOptions?.publishOn ?? null,
|
|
25
|
+
revisionLogMessage: context?.publishOptions?.revisionLogMessage ?? null
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export default async function(adapter, context, $t, providerKey, permissions) {
|
|
29
|
+
let _mappedState = null;
|
|
30
|
+
const overrideHostOptions = useState("options:" + providerKey);
|
|
15
31
|
const stateLoaded = ref(false);
|
|
16
32
|
const stateLoadError = ref(false);
|
|
17
33
|
const owner = ref(null);
|
|
@@ -23,6 +39,15 @@ export default async function(adapter, context, $t) {
|
|
|
23
39
|
const mutations = ref([]);
|
|
24
40
|
const violations = ref([]);
|
|
25
41
|
const mutatedEntity = ref(null);
|
|
42
|
+
const publishOptions = ref({
|
|
43
|
+
canPublish: false,
|
|
44
|
+
isRevisionable: false,
|
|
45
|
+
hasRevisionLogMessage: false,
|
|
46
|
+
lastChanged: null,
|
|
47
|
+
canSchedule: false,
|
|
48
|
+
publishOn: null,
|
|
49
|
+
revisionLogMessage: null
|
|
50
|
+
});
|
|
26
51
|
const currentMutationIndex = ref(-1);
|
|
27
52
|
const isLoading = ref(false);
|
|
28
53
|
const entity = ref({
|
|
@@ -32,9 +57,12 @@ export default async function(adapter, context, $t) {
|
|
|
32
57
|
});
|
|
33
58
|
let fieldBlockCount = {};
|
|
34
59
|
const blockBundleCount = ref({});
|
|
35
|
-
const fieldListItemMap = {};
|
|
60
|
+
const fieldListItemMap = ref({});
|
|
61
|
+
let bundleToUuids = {};
|
|
62
|
+
const fromLibraryUuids = ref([]);
|
|
63
|
+
const nestingLevelMap = /* @__PURE__ */ new Map();
|
|
36
64
|
function getFieldListItem(uuid) {
|
|
37
|
-
const fieldKey = fieldListItemMap[uuid];
|
|
65
|
+
const fieldKey = fieldListItemMap.value[uuid];
|
|
38
66
|
if (!fieldKey) {
|
|
39
67
|
return;
|
|
40
68
|
}
|
|
@@ -44,8 +72,11 @@ export default async function(adapter, context, $t) {
|
|
|
44
72
|
}
|
|
45
73
|
return field.list.find((v) => v.uuid === uuid);
|
|
46
74
|
}
|
|
75
|
+
function getFieldKeyForUuid(uuid) {
|
|
76
|
+
return fieldListItemMap.value[uuid] ?? null;
|
|
77
|
+
}
|
|
47
78
|
function getFieldListForBlock(uuid) {
|
|
48
|
-
const fieldKey = fieldListItemMap[uuid];
|
|
79
|
+
const fieldKey = fieldListItemMap.value[uuid];
|
|
49
80
|
if (!fieldKey) {
|
|
50
81
|
return;
|
|
51
82
|
}
|
|
@@ -58,17 +89,35 @@ export default async function(adapter, context, $t) {
|
|
|
58
89
|
availableLanguages: [],
|
|
59
90
|
translations: []
|
|
60
91
|
});
|
|
61
|
-
function
|
|
92
|
+
function updatePublishOptions(newPublishOptions) {
|
|
93
|
+
publishOptions.value.canPublish = newPublishOptions.canPublish;
|
|
94
|
+
publishOptions.value.isRevisionable = newPublishOptions.isRevisionable;
|
|
95
|
+
publishOptions.value.hasRevisionLogMessage = newPublishOptions.hasRevisionLogMessage;
|
|
96
|
+
publishOptions.value.lastChanged = newPublishOptions.lastChanged;
|
|
97
|
+
publishOptions.value.canSchedule = newPublishOptions.canSchedule;
|
|
98
|
+
publishOptions.value.publishOn = newPublishOptions.publishOn;
|
|
99
|
+
publishOptions.value.revisionLogMessage = newPublishOptions.revisionLogMessage;
|
|
100
|
+
}
|
|
101
|
+
function setContext(context2, override) {
|
|
102
|
+
if (!override) {
|
|
103
|
+
_mappedState = context2 ?? null;
|
|
104
|
+
}
|
|
62
105
|
const options = context2?.mutatedState?.mutatedOptions || {};
|
|
63
106
|
const optionKeys = Object.keys(options);
|
|
64
107
|
for (let i = 0; i < optionKeys.length; i++) {
|
|
65
108
|
const key = optionKeys[i];
|
|
66
109
|
const newOptions = options[key];
|
|
67
|
-
const
|
|
68
|
-
if (!
|
|
110
|
+
const existing2 = mutatedOptions[key];
|
|
111
|
+
if (!existing2 || JSON.stringify(existing2) !== JSON.stringify(newOptions)) {
|
|
69
112
|
mutatedOptions[key] = newOptions;
|
|
70
113
|
}
|
|
71
114
|
}
|
|
115
|
+
const hostOptions = context2?.mutatedState?.mutatedHostOptions ?? {};
|
|
116
|
+
const existing = mutatedOptions[HOST_OPTION_KEY];
|
|
117
|
+
if (!existing || JSON.stringify(existing) !== JSON.stringify(hostOptions)) {
|
|
118
|
+
mutatedOptions[HOST_OPTION_KEY] = hostOptions ?? "";
|
|
119
|
+
overrideHostOptions.value = hostOptions;
|
|
120
|
+
}
|
|
72
121
|
mutations.value = context2?.mutations || [];
|
|
73
122
|
violations.value = context2?.mutatedState?.violations || [];
|
|
74
123
|
const currentIndex = context2?.currentIndex;
|
|
@@ -80,6 +129,7 @@ export default async function(adapter, context, $t) {
|
|
|
80
129
|
entity.value.label = context2?.entity?.label;
|
|
81
130
|
entity.value.status = context2?.entity?.status;
|
|
82
131
|
entity.value.bundleLabel = context2?.entity?.bundleLabel || "";
|
|
132
|
+
updatePublishOptions(mapPublishOptions(context2));
|
|
83
133
|
translation.value.isTranslatable = !!context2?.translationState?.isTranslatable;
|
|
84
134
|
translation.value.translations = context2?.translationState?.translations?.filter(falsy) || [];
|
|
85
135
|
translation.value.sourceLanguage = context2?.translationState?.sourceLanguage || "";
|
|
@@ -96,13 +146,17 @@ export default async function(adapter, context, $t) {
|
|
|
96
146
|
mutatedEntity.value = context2?.mutatedEntity;
|
|
97
147
|
const visitedFieldKeys = [];
|
|
98
148
|
const newBlockBundleCount = {};
|
|
149
|
+
fieldListItemMap.value = {};
|
|
150
|
+
nestingLevelMap.clear();
|
|
99
151
|
fieldBlockCount = {};
|
|
152
|
+
bundleToUuids = {};
|
|
153
|
+
const fromLibrary = [];
|
|
100
154
|
for (let i = 0; i < newMutatedFields.length; i++) {
|
|
101
155
|
const field = newMutatedFields[i];
|
|
102
156
|
const key = getFieldKey(field.entityUuid, field.name);
|
|
103
157
|
visitedFieldKeys.push(key);
|
|
104
|
-
const
|
|
105
|
-
if (!
|
|
158
|
+
const existing2 = mutatedFieldsMap[key];
|
|
159
|
+
if (!existing2 || existing2.list.length !== field.list.length || JSON.stringify(existing2.list) !== JSON.stringify(field.list)) {
|
|
106
160
|
mutatedFieldsMap[key] = field;
|
|
107
161
|
}
|
|
108
162
|
for (let j = 0; j < field.list.length; j++) {
|
|
@@ -111,7 +165,21 @@ export default async function(adapter, context, $t) {
|
|
|
111
165
|
newBlockBundleCount[item.bundle] = 0;
|
|
112
166
|
}
|
|
113
167
|
newBlockBundleCount[item.bundle]++;
|
|
114
|
-
fieldListItemMap[item.uuid] = key;
|
|
168
|
+
fieldListItemMap.value[item.uuid] = key;
|
|
169
|
+
if (!bundleToUuids[item.bundle]) {
|
|
170
|
+
bundleToUuids[item.bundle] = [];
|
|
171
|
+
}
|
|
172
|
+
bundleToUuids[item.bundle].push(item.uuid);
|
|
173
|
+
if (item.bundle === BUNDLE_FROM_LIBRARY) {
|
|
174
|
+
fromLibrary.push(item.uuid);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
for (let i = 0; i < newMutatedFields.length; i++) {
|
|
179
|
+
const field = newMutatedFields[i];
|
|
180
|
+
for (let j = 0; j < field.list.length; j++) {
|
|
181
|
+
const item = field.list[j];
|
|
182
|
+
calculateNestingLevel(item.uuid);
|
|
115
183
|
}
|
|
116
184
|
}
|
|
117
185
|
blockBundleCount.value = newBlockBundleCount;
|
|
@@ -122,6 +190,7 @@ export default async function(adapter, context, $t) {
|
|
|
122
190
|
mutatedFieldsMap[key] = void 0;
|
|
123
191
|
}
|
|
124
192
|
}
|
|
193
|
+
fromLibraryUuids.value = fromLibrary;
|
|
125
194
|
eventBus.emit("updateMutatedFields", { fields: newMutatedFields });
|
|
126
195
|
nextTick(() => {
|
|
127
196
|
refreshKey.value = Date.now().toString();
|
|
@@ -144,13 +213,61 @@ export default async function(adapter, context, $t) {
|
|
|
144
213
|
return count;
|
|
145
214
|
}
|
|
146
215
|
function lockBody() {
|
|
147
|
-
document.body.classList.add("bk-body-loading");
|
|
148
216
|
isLoading.value = true;
|
|
149
217
|
}
|
|
150
218
|
function unlockBody() {
|
|
151
|
-
document.body.classList.remove("bk-body-loading");
|
|
152
219
|
isLoading.value = false;
|
|
153
220
|
}
|
|
221
|
+
function getAllUuids(bundle) {
|
|
222
|
+
if (!bundle) {
|
|
223
|
+
return [...Object.keys(fieldListItemMap.value)];
|
|
224
|
+
}
|
|
225
|
+
return bundleToUuids[bundle] ?? [];
|
|
226
|
+
}
|
|
227
|
+
function calculateNestingLevel(uuid) {
|
|
228
|
+
const cached = nestingLevelMap.get(uuid);
|
|
229
|
+
if (cached !== void 0) {
|
|
230
|
+
return cached;
|
|
231
|
+
}
|
|
232
|
+
const fieldKey = fieldListItemMap.value[uuid];
|
|
233
|
+
if (!fieldKey) {
|
|
234
|
+
nestingLevelMap.set(uuid, 0);
|
|
235
|
+
return 0;
|
|
236
|
+
}
|
|
237
|
+
const field = mutatedFieldsMap[fieldKey];
|
|
238
|
+
if (!field) {
|
|
239
|
+
nestingLevelMap.set(uuid, 0);
|
|
240
|
+
return 0;
|
|
241
|
+
}
|
|
242
|
+
const parentEntityUuid = field.entityUuid;
|
|
243
|
+
const parentFieldKey = fieldListItemMap.value[parentEntityUuid];
|
|
244
|
+
if (!parentFieldKey) {
|
|
245
|
+
nestingLevelMap.set(uuid, 0);
|
|
246
|
+
return 0;
|
|
247
|
+
}
|
|
248
|
+
const parentLevel = calculateNestingLevel(parentEntityUuid);
|
|
249
|
+
const level = parentLevel + 1;
|
|
250
|
+
nestingLevelMap.set(uuid, level);
|
|
251
|
+
return level;
|
|
252
|
+
}
|
|
253
|
+
function getNestingLevel(uuid) {
|
|
254
|
+
return nestingLevelMap.get(uuid) ?? 0;
|
|
255
|
+
}
|
|
256
|
+
function isChildOf(childUuid, parentUuid) {
|
|
257
|
+
const fieldKey = fieldListItemMap.value[childUuid];
|
|
258
|
+
if (!fieldKey) {
|
|
259
|
+
return false;
|
|
260
|
+
}
|
|
261
|
+
const field = mutatedFieldsMap[fieldKey];
|
|
262
|
+
if (!field) {
|
|
263
|
+
return false;
|
|
264
|
+
}
|
|
265
|
+
if (field.entityUuid === parentUuid) {
|
|
266
|
+
return true;
|
|
267
|
+
}
|
|
268
|
+
return isChildOf(field.entityUuid, parentUuid);
|
|
269
|
+
}
|
|
270
|
+
addElementClasses(document.body, "bk-body-loading", isLoading);
|
|
154
271
|
const mutateWithLoadingState = async (callback, errorMessage, successMessage) => {
|
|
155
272
|
if (!callback) {
|
|
156
273
|
return true;
|
|
@@ -175,11 +292,13 @@ export default async function(adapter, context, $t) {
|
|
|
175
292
|
}
|
|
176
293
|
return true;
|
|
177
294
|
} catch (e) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
295
|
+
if (errorMessage !== false) {
|
|
296
|
+
emitMessage(
|
|
297
|
+
errorMessage || $t("unexpectedMutationError", "An unexpected error happened."),
|
|
298
|
+
"error",
|
|
299
|
+
e
|
|
300
|
+
);
|
|
301
|
+
}
|
|
183
302
|
}
|
|
184
303
|
unlockBody();
|
|
185
304
|
return false;
|
|
@@ -199,7 +318,7 @@ export default async function(adapter, context, $t) {
|
|
|
199
318
|
}
|
|
200
319
|
}
|
|
201
320
|
const canEdit = computed(
|
|
202
|
-
() => stateLoaded.value && !!owner.value?.currentUserIsOwner && !stateLoadError.value
|
|
321
|
+
() => stateLoaded.value && !!owner.value?.currentUserIsOwner && !stateLoadError.value && permissions.includes("edit")
|
|
203
322
|
);
|
|
204
323
|
const isTranslation = computed(
|
|
205
324
|
() => context.value.language !== translation.value.sourceLanguage && translation.value.isTranslatable
|
|
@@ -228,10 +347,27 @@ export default async function(adapter, context, $t) {
|
|
|
228
347
|
const stateAvailable = computed(
|
|
229
348
|
() => stateLoaded.value && !stateLoadError.value
|
|
230
349
|
);
|
|
350
|
+
function getMappedState() {
|
|
351
|
+
if (!_mappedState) {
|
|
352
|
+
throw new Error("Called getMappedState() before a state is available.");
|
|
353
|
+
}
|
|
354
|
+
return _mappedState;
|
|
355
|
+
}
|
|
356
|
+
function setOverrideState(state) {
|
|
357
|
+
setContext(state, true);
|
|
358
|
+
}
|
|
359
|
+
function clearOverrideState() {
|
|
360
|
+
if (!_mappedState) {
|
|
361
|
+
throw new Error("Missing previous state.");
|
|
362
|
+
}
|
|
363
|
+
setContext(_mappedState);
|
|
364
|
+
}
|
|
231
365
|
return {
|
|
232
366
|
stateAvailable,
|
|
367
|
+
getMappedState,
|
|
233
368
|
refreshKey,
|
|
234
369
|
owner: readonly(owner),
|
|
370
|
+
publishOptions: readonly(publishOptions),
|
|
235
371
|
mutatedFields,
|
|
236
372
|
entity,
|
|
237
373
|
mutatedOptions,
|
|
@@ -248,6 +384,14 @@ export default async function(adapter, context, $t) {
|
|
|
248
384
|
getBlockBundleCount,
|
|
249
385
|
getFieldListItem,
|
|
250
386
|
getMutatedField,
|
|
251
|
-
getFieldListForBlock
|
|
387
|
+
getFieldListForBlock,
|
|
388
|
+
getAllUuids,
|
|
389
|
+
getNestingLevel,
|
|
390
|
+
isChildOf,
|
|
391
|
+
setOverrideState,
|
|
392
|
+
clearOverrideState,
|
|
393
|
+
fromLibraryUuids: readonly(fromLibraryUuids),
|
|
394
|
+
permissions: computed(() => permissions),
|
|
395
|
+
getFieldKeyForUuid
|
|
252
396
|
};
|
|
253
397
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { type ComputedRef, type WritableComputedRef } from '
|
|
1
|
+
import { type ComputedRef, type WritableComputedRef } from '#imports';
|
|
2
|
+
import type { AdapterContext, BlokkliAdapter } from '#blokkli/adapter';
|
|
2
3
|
export type StorageProvider = {
|
|
3
|
-
use: <T>(key: string | ComputedRef<string>, defaultValue: T) => WritableComputedRef<T>;
|
|
4
|
+
use: <T>(key: string | ComputedRef<string>, defaultValue: T, persist?: boolean) => WritableComputedRef<T>;
|
|
5
|
+
useWithContextPrefix: <T>(key: string, defaultValue: T, persist?: boolean) => WritableComputedRef<T>;
|
|
4
6
|
clearAll: () => void;
|
|
5
7
|
clear: (key: string) => void;
|
|
6
8
|
};
|
|
@@ -12,4 +14,4 @@ export type StorageProvider = {
|
|
|
12
14
|
* This composable can be used to keep state across page navigations and
|
|
13
15
|
* even after a refresh.
|
|
14
16
|
*/
|
|
15
|
-
export default function (): StorageProvider
|
|
17
|
+
export default function (adapter: BlokkliAdapter<any>, context: ComputedRef<AdapterContext>): Promise<StorageProvider>;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
computed,
|
|
3
|
+
onBeforeUnmount,
|
|
4
|
+
ref,
|
|
5
|
+
watch
|
|
6
|
+
} from "#imports";
|
|
2
7
|
import { storageDefaults } from "#blokkli-build/config";
|
|
3
8
|
const PREFIX = "blokkli:";
|
|
4
9
|
const getExisting = (key) => {
|
|
@@ -10,10 +15,53 @@ const getExisting = (key) => {
|
|
|
10
15
|
} catch {
|
|
11
16
|
}
|
|
12
17
|
};
|
|
13
|
-
export default function() {
|
|
18
|
+
export default async function(adapter, context) {
|
|
14
19
|
const values = ref({});
|
|
15
20
|
const defaults = ref({});
|
|
16
|
-
|
|
21
|
+
let timeout = null;
|
|
22
|
+
const persistableKeys = ref([]);
|
|
23
|
+
onBeforeUnmount(() => {
|
|
24
|
+
if (timeout) {
|
|
25
|
+
window.clearTimeout(timeout);
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const persistedValues = adapter.userSettings ? await adapter.userSettings.load().then((v) => {
|
|
29
|
+
if (typeof v === "object" && v !== null) {
|
|
30
|
+
return JSON.stringify(v);
|
|
31
|
+
}
|
|
32
|
+
return v;
|
|
33
|
+
}) : null;
|
|
34
|
+
if (persistedValues) {
|
|
35
|
+
values.value = JSON.parse(persistedValues);
|
|
36
|
+
}
|
|
37
|
+
const persistableData = computed(() => {
|
|
38
|
+
const mapped = [...persistableKeys.value].sort().reduce((acc, key) => {
|
|
39
|
+
const value = values.value[key];
|
|
40
|
+
if (value !== void 0) {
|
|
41
|
+
acc[key] = value;
|
|
42
|
+
}
|
|
43
|
+
return acc;
|
|
44
|
+
}, {});
|
|
45
|
+
return JSON.stringify(mapped);
|
|
46
|
+
});
|
|
47
|
+
function persistUserSettings() {
|
|
48
|
+
if (timeout) {
|
|
49
|
+
window.clearTimeout(timeout);
|
|
50
|
+
}
|
|
51
|
+
timeout = window.setTimeout(async () => {
|
|
52
|
+
if (!adapter.userSettings) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (persistableData.value === persistedValues) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
await adapter.userSettings.persist(persistableData.value);
|
|
59
|
+
}, 1e3);
|
|
60
|
+
}
|
|
61
|
+
if (adapter.userSettings) {
|
|
62
|
+
watch(persistableData, persistUserSettings);
|
|
63
|
+
}
|
|
64
|
+
const use = (key, providedDefaultValue, persist) => {
|
|
17
65
|
const storageKey = computed(
|
|
18
66
|
() => PREFIX + (typeof key === "string" ? key : key.value)
|
|
19
67
|
);
|
|
@@ -30,6 +78,11 @@ export default function() {
|
|
|
30
78
|
values.value[storageKey.value] = defaultValue;
|
|
31
79
|
}
|
|
32
80
|
}
|
|
81
|
+
if (persist) {
|
|
82
|
+
if (!persistableKeys.value.includes(storageKey.value)) {
|
|
83
|
+
persistableKeys.value.push(storageKey.value);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
33
86
|
return computed({
|
|
34
87
|
get() {
|
|
35
88
|
const v = values.value[storageKey.value];
|
|
@@ -44,6 +97,10 @@ export default function() {
|
|
|
44
97
|
}
|
|
45
98
|
});
|
|
46
99
|
};
|
|
100
|
+
const useWithContextPrefix = (key, providedDefaultValue, persist) => {
|
|
101
|
+
const fullKey = key + ":" + context.value.entityType + ":" + context.value.entityUuid;
|
|
102
|
+
return use(fullKey, providedDefaultValue, persist);
|
|
103
|
+
};
|
|
47
104
|
const clearAll = () => {
|
|
48
105
|
values.value = {};
|
|
49
106
|
Object.keys(window.localStorage).forEach((key) => {
|
|
@@ -57,5 +114,5 @@ export default function() {
|
|
|
57
114
|
values.value[storageKey] = void 0;
|
|
58
115
|
window.localStorage.removeItem(storageKey);
|
|
59
116
|
};
|
|
60
|
-
return { use, clearAll, clear };
|
|
117
|
+
return { use, useWithContextPrefix, clearAll, clear };
|
|
61
118
|
}
|
|
@@ -6,6 +6,7 @@ export declare const INJECT_NESTING_LEVEL: unique symbol;
|
|
|
6
6
|
export declare const INJECT_IS_PREVIEW: unique symbol;
|
|
7
7
|
export declare const INJECT_IS_IN_REUSABLE: unique symbol;
|
|
8
8
|
export declare const INJECT_REUSABLE_OPTIONS: unique symbol;
|
|
9
|
+
export declare const INJECT_REUSABLE_UUID: unique symbol;
|
|
9
10
|
export declare const INJECT_FIELD_LIST_TYPE: unique symbol;
|
|
10
11
|
export declare const INJECT_FIELD_LIST_BLOCKS: unique symbol;
|
|
11
12
|
export declare const INJECT_FIELD_PROXY_MODE: unique symbol;
|
|
@@ -17,6 +18,7 @@ export declare const INJECT_MUTATED_FIELDS_MAP: unique symbol;
|
|
|
17
18
|
export declare const INJECT_ENTITY_CONTEXT: unique symbol;
|
|
18
19
|
export declare const INJECT_PROVIDER_CONTEXT: unique symbol;
|
|
19
20
|
export declare const INJECT_FRAGMENT_CONTEXT: unique symbol;
|
|
21
|
+
export declare const INJECT_PROVIDER_KEY: unique symbol;
|
|
20
22
|
export declare const INJECT_EDIT_FIELD_LIST_COMPONENT: unique symbol;
|
|
21
23
|
export declare const INJECT_EDIT_LOGGER: unique symbol;
|
|
22
24
|
export declare const BK_HIDDEN_GLOBALLY = "bkHiddenGlobally";
|
|
@@ -6,6 +6,7 @@ export const INJECT_NESTING_LEVEL = Symbol("blokkli_nesting_level");
|
|
|
6
6
|
export const INJECT_IS_PREVIEW = Symbol("blokkli_is_preview");
|
|
7
7
|
export const INJECT_IS_IN_REUSABLE = Symbol("blokkli_is_in_reusable");
|
|
8
8
|
export const INJECT_REUSABLE_OPTIONS = Symbol("blokkli_from_library_options");
|
|
9
|
+
export const INJECT_REUSABLE_UUID = Symbol("blokkli_from_library_uuid");
|
|
9
10
|
export const INJECT_FIELD_LIST_TYPE = Symbol("blokkli_field_list_type");
|
|
10
11
|
export const INJECT_FIELD_LIST_BLOCKS = Symbol("blokkli_field_list_blocks");
|
|
11
12
|
export const INJECT_FIELD_PROXY_MODE = Symbol("blokkli_field_proxy_mode");
|
|
@@ -17,6 +18,7 @@ export const INJECT_MUTATED_FIELDS_MAP = Symbol("blokkli_mutated_fields_map");
|
|
|
17
18
|
export const INJECT_ENTITY_CONTEXT = Symbol("blokkli_entity_context");
|
|
18
19
|
export const INJECT_PROVIDER_CONTEXT = Symbol("blokkli_provider_context");
|
|
19
20
|
export const INJECT_FRAGMENT_CONTEXT = Symbol("blokkli_fragment_context");
|
|
21
|
+
export const INJECT_PROVIDER_KEY = Symbol("blokkli_provider_key");
|
|
20
22
|
export const INJECT_EDIT_FIELD_LIST_COMPONENT = Symbol(
|
|
21
23
|
"blokkli_edit_field_list_component"
|
|
22
24
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { computed } from "vue";
|
|
2
2
|
import { translations } from "#blokkli-build/translations";
|
|
3
3
|
import { defaultLanguage, forceDefaultLanguage } from "#blokkli-build/config";
|
|
4
|
+
const DEBUG_SWISS_GERMAN = false;
|
|
4
5
|
export default function(context) {
|
|
5
6
|
const language = computed(() => {
|
|
6
7
|
if (forceDefaultLanguage) {
|
|
@@ -12,6 +13,11 @@ export default function(context) {
|
|
|
12
13
|
return defaultLanguage;
|
|
13
14
|
});
|
|
14
15
|
const currentTranslations = computed(() => {
|
|
16
|
+
const today = /* @__PURE__ */ new Date();
|
|
17
|
+
const isAprilFirst = today.getMonth() === 3 && today.getDate() === 1;
|
|
18
|
+
if (isAprilFirst && language.value === "de" || DEBUG_SWISS_GERMAN && import.meta.dev) {
|
|
19
|
+
return translations.gsw_CH || translations[language.value] || {};
|
|
20
|
+
}
|
|
15
21
|
return translations[language.value] || {};
|
|
16
22
|
});
|
|
17
23
|
return (key, defaultValue) => {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { DraggableStyle } from '#blokkli/types';
|
|
2
2
|
import type { RGB, ThemeColorGroup, ThemeColorShade, ThemeColors, ThemeContextColorGroup, ThemeContextColorShade, ThemeContextColors, ThemeName } from '#blokkli/types/theme';
|
|
3
3
|
import { type Ref } from '#imports';
|
|
4
|
+
import type { ElementProvider } from './providers/element.js';
|
|
4
5
|
type ThemeMap = {
|
|
5
6
|
accent: Ref<ThemeColors>;
|
|
6
7
|
mono: Ref<ThemeColors>;
|
|
@@ -8,6 +9,7 @@ type ThemeMap = {
|
|
|
8
9
|
yellow: Ref<ThemeContextColors>;
|
|
9
10
|
red: Ref<ThemeContextColors>;
|
|
10
11
|
lime: Ref<ThemeContextColors>;
|
|
12
|
+
orange: Ref<ThemeContextColors>;
|
|
11
13
|
};
|
|
12
14
|
export type ThemeProvider = {
|
|
13
15
|
accent: Ref<ThemeColors>;
|
|
@@ -16,6 +18,7 @@ export type ThemeProvider = {
|
|
|
16
18
|
yellow: Ref<ThemeContextColors>;
|
|
17
19
|
red: Ref<ThemeContextColors>;
|
|
18
20
|
lime: Ref<ThemeContextColors>;
|
|
21
|
+
orange: Ref<ThemeContextColors>;
|
|
19
22
|
getDraggableStyle: (el: HTMLElement | SVGElement) => DraggableStyle;
|
|
20
23
|
setColor: <Group extends ThemeColorGroup | ThemeContextColorGroup>(group: Group, shade: Group extends ThemeColorGroup ? ThemeColorShade : ThemeContextColorShade, value: RGB) => void;
|
|
21
24
|
applyTheme: (name: ThemeName | 'custom') => void;
|
|
@@ -23,5 +26,5 @@ export type ThemeProvider = {
|
|
|
23
26
|
getColor<K extends keyof ThemeMap, T extends ThemeMap[K]['value']>(color: K, key: keyof T): RGB;
|
|
24
27
|
getColorString<K extends keyof ThemeMap, T extends ThemeMap[K]['value']>(color: K, key: keyof T, alpha?: number): string;
|
|
25
28
|
};
|
|
26
|
-
export default function (): ThemeProvider;
|
|
29
|
+
export default function (element: ElementProvider): ThemeProvider;
|
|
27
30
|
export {};
|
|
@@ -3,7 +3,15 @@ import { ref, onMounted, onBeforeUnmount } from "#imports";
|
|
|
3
3
|
import { rgbaToString } from "./index.js";
|
|
4
4
|
import { DragStyle } from "./DragStyle/index.js";
|
|
5
5
|
import onBlokkliEvent from "./composables/onBlokkliEvent.js";
|
|
6
|
-
export default function() {
|
|
6
|
+
export default function(element) {
|
|
7
|
+
const rootElement = element.query(
|
|
8
|
+
document,
|
|
9
|
+
":root",
|
|
10
|
+
"Get document root element for setting theme color."
|
|
11
|
+
);
|
|
12
|
+
if (!rootElement) {
|
|
13
|
+
throw new Error("Failed to query :root - is this even possible?");
|
|
14
|
+
}
|
|
7
15
|
const originalBrowserThemeColor = ref("");
|
|
8
16
|
const THEME_COLOR = "black";
|
|
9
17
|
const accent = ref(theme.accent);
|
|
@@ -12,13 +20,15 @@ export default function() {
|
|
|
12
20
|
const yellow = ref(theme.yellow);
|
|
13
21
|
const red = ref(theme.red);
|
|
14
22
|
const lime = ref(theme.lime);
|
|
23
|
+
const orange = ref(theme.orange);
|
|
15
24
|
const themeMap = {
|
|
16
25
|
accent,
|
|
17
26
|
mono,
|
|
18
27
|
teal,
|
|
19
28
|
yellow,
|
|
20
29
|
red,
|
|
21
|
-
lime
|
|
30
|
+
lime,
|
|
31
|
+
orange
|
|
22
32
|
};
|
|
23
33
|
function getColor(color, key) {
|
|
24
34
|
return themeMap[color].value[key];
|
|
@@ -42,13 +52,10 @@ export default function() {
|
|
|
42
52
|
} else if (group === "lime") {
|
|
43
53
|
lime.value[shade] = value;
|
|
44
54
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`${value[0]} ${value[1]} ${value[2]}`
|
|
50
|
-
);
|
|
51
|
-
}
|
|
55
|
+
rootElement.style.setProperty(
|
|
56
|
+
`--bk-theme-${group}-${shade}`,
|
|
57
|
+
`${value[0]} ${value[1]} ${value[2]}`
|
|
58
|
+
);
|
|
52
59
|
};
|
|
53
60
|
const setColorsFromTheme = (v) => {
|
|
54
61
|
Object.entries(v).forEach(([group, colors]) => {
|
|
@@ -77,7 +84,11 @@ export default function() {
|
|
|
77
84
|
}
|
|
78
85
|
};
|
|
79
86
|
onMounted(() => {
|
|
80
|
-
const el =
|
|
87
|
+
const el = element.query(
|
|
88
|
+
document.head,
|
|
89
|
+
'[name="theme-color"]',
|
|
90
|
+
"Theme: theme-color"
|
|
91
|
+
);
|
|
81
92
|
if (el instanceof HTMLMetaElement) {
|
|
82
93
|
originalBrowserThemeColor.value = el.content;
|
|
83
94
|
el.content = THEME_COLOR;
|
|
@@ -85,14 +96,15 @@ export default function() {
|
|
|
85
96
|
const meta = document.createElement("meta");
|
|
86
97
|
meta.name = "theme-color";
|
|
87
98
|
meta.content = THEME_COLOR;
|
|
88
|
-
|
|
89
|
-
if (head) {
|
|
90
|
-
head.appendChild(meta);
|
|
91
|
-
}
|
|
99
|
+
document.head.appendChild(meta);
|
|
92
100
|
}
|
|
93
101
|
});
|
|
94
102
|
onBeforeUnmount(() => {
|
|
95
|
-
const el =
|
|
103
|
+
const el = element.query(
|
|
104
|
+
document.head,
|
|
105
|
+
'[name="theme-color"]',
|
|
106
|
+
"Theme: theme-color"
|
|
107
|
+
);
|
|
96
108
|
if (el instanceof HTMLMetaElement) {
|
|
97
109
|
if (originalBrowserThemeColor.value) {
|
|
98
110
|
el.content = originalBrowserThemeColor.value;
|
|
@@ -115,6 +127,7 @@ export default function() {
|
|
|
115
127
|
yellow,
|
|
116
128
|
red,
|
|
117
129
|
lime,
|
|
130
|
+
orange,
|
|
118
131
|
getDraggableStyle: function(el) {
|
|
119
132
|
return dragStyle.getStyle(el, theme.accent[700]);
|
|
120
133
|
},
|
|
@@ -6,9 +6,7 @@ export function filterTransforms(plugins, selectedItems, selectedBundles, allowe
|
|
|
6
6
|
if (plugin.max !== -1 && selectedItems.length > plugin.max) {
|
|
7
7
|
return false;
|
|
8
8
|
}
|
|
9
|
-
const allAllowedInList = plugin.targetBundles.every(
|
|
10
|
-
(bundle) => allowedBundles.includes(bundle)
|
|
11
|
-
);
|
|
9
|
+
const allAllowedInList = !plugin.targetBundles || plugin.targetBundles.every((bundle) => allowedBundles.includes(bundle));
|
|
12
10
|
if (!allAllowedInList) {
|
|
13
11
|
return false;
|
|
14
12
|
}
|