@blokkli/editor 2.0.0-alpha.23 → 2.0.0-alpha.25
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.json +1 -1
- package/dist/module.mjs +252 -92
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +38 -0
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +15 -0
- package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +6 -0
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +28 -3
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -4
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +11 -3
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +138 -3
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +5 -1
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +116 -0
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +22 -13
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +22 -0
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +98 -0
- package/dist/runtime/blokkliPlugins/index.d.ts +1 -3
- package/dist/runtime/blokkliPlugins/index.js +0 -4
- package/dist/runtime/components/Blocks/NotImplemented/index.vue +24 -0
- package/dist/runtime/components/Blocks/NotImplemented/index.vue.d.ts +6 -0
- package/dist/runtime/components/BlokkliEditable.vue.d.ts +11 -0
- package/dist/runtime/components/BlokkliItem.vue +16 -3
- package/dist/runtime/components/BlokkliItem.vue.d.ts +2 -0
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Actions/ItemDropdown.vue +1 -1
- package/dist/runtime/components/Edit/Actions/index.vue +78 -73
- package/dist/runtime/components/Edit/AddListItem/index.vue +9 -35
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +6 -15
- package/dist/runtime/components/Edit/AppMenu/MenuButton.vue +39 -0
- package/dist/runtime/{blokkliPlugins/MenuButton/index.vue.d.ts → components/Edit/AppMenu/MenuButton.vue.d.ts} +0 -4
- package/dist/runtime/components/Edit/AppMenu/index.vue +62 -40
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +6 -0
- package/dist/runtime/components/Edit/BlockProxy/index.vue +2 -2
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +3 -0
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +4 -1
- package/dist/runtime/components/Edit/Dialog/index.vue +33 -47
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/DraggableList.vue +12 -9
- package/dist/runtime/components/Edit/EditIndicator.vue +11 -4
- package/dist/runtime/components/Edit/EditProvider.vue +75 -55
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +53 -0
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue.d.ts +7 -0
- package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue +41 -0
- package/dist/runtime/components/Edit/Features/AddList/Actions/index.vue.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue +13 -50
- package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/AddList/index.vue +76 -119
- package/dist/runtime/components/Edit/Features/Analyze/Icon.vue +85 -0
- package/dist/runtime/components/Edit/Features/Analyze/Icon.vue.d.ts +5 -0
- package/dist/runtime/components/Edit/Features/Analyze/Main.vue +288 -59
- package/dist/runtime/components/Edit/Features/Analyze/Main.vue.d.ts +8 -1
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/fragment.glsl +25 -13
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue +114 -52
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue.d.ts +16 -2
- package/dist/runtime/components/Edit/Features/Analyze/Renderer/vertex.glsl +31 -11
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +8 -1
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +4 -4
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +20 -2
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +11 -18
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +10 -3
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +46 -40
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +10 -4
- package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +8 -4
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +1 -0
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +4 -3
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +2 -1
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +61 -20
- package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +15 -1
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +23 -2
- package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +22 -8
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +42 -21
- package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +10 -4
- package/dist/runtime/components/Edit/Features/Assistant/Overlay/index.vue +2 -28
- package/dist/runtime/components/Edit/Features/Assistant/index.vue +18 -14
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +11 -1
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +52 -18
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue +0 -2
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/Item/index.vue.d.ts +6 -4
- package/dist/runtime/components/Edit/Features/CommandPalette/Palette/index.vue +77 -27
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +7 -4
- package/dist/runtime/components/Edit/Features/Comments/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Debug/Main.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue +113 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/DragItem.vue.d.ts +25 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +8 -97
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/fragment.glsl +2 -5
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/index.vue +38 -5
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/vertex.glsl +10 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +1 -2
- package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +8 -2
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +3 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +4 -3
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/EditableMask/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +7 -2
- package/dist/runtime/components/Edit/Features/Exit/index.vue +12 -9
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +27 -31
- package/dist/runtime/components/Edit/Features/ImportExisting/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/ImportExisting/index.vue +25 -24
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +4 -4
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +9 -2
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +13 -3
- package/dist/runtime/components/Edit/Features/Library/index.vue +26 -24
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/MultiSelect/Renderer/index.vue +1 -3
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +3 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +10 -0
- package/dist/runtime/components/Edit/Features/Publish/index.vue +17 -15
- package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Revert/index.vue +24 -18
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +8 -2
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +12 -2
- package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue +11 -3
- package/dist/runtime/components/Edit/Features/Search/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +128 -31
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +6 -6
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +3 -6
- package/dist/runtime/components/Edit/Features/Selection/Renderer/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Settings/index.vue +26 -18
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Tour/Popup/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Tour/index.vue +12 -10
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +7 -1
- package/dist/runtime/components/Edit/Features/Transform/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Translations/index.vue +18 -17
- package/dist/runtime/components/Edit/Form/Textarea/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue +13 -4
- package/dist/runtime/components/Edit/Indicators/index.vue +1 -1
- package/dist/runtime/components/Edit/InfoBox/index.vue +3 -2
- package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +6 -1
- package/dist/runtime/components/Edit/ItemIconBox/index.vue +41 -0
- package/dist/runtime/components/Edit/{AddListItemIcon → ItemIconBox}/index.vue.d.ts +5 -5
- package/dist/runtime/components/Edit/Konami/Game/index.vue +0 -1
- package/dist/runtime/components/Edit/Konami/index.vue +3 -5
- package/dist/runtime/components/Edit/Messages/Item/index.vue +11 -2
- package/dist/runtime/components/Edit/Messages/index.vue +6 -1
- package/dist/runtime/components/Edit/Overlay/index.vue +70 -0
- package/dist/runtime/components/Edit/Overlay/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +3 -3
- package/dist/runtime/components/Edit/ScaleToFit/index.vue +4 -4
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +36 -36
- package/dist/runtime/components/Edit/Toolbar/index.vue +47 -48
- package/dist/runtime/components/Edit/index.d.ts +2 -2
- package/dist/runtime/components/Edit/index.js +2 -2
- package/dist/runtime/composables/defineBlokkliFeature.d.ts +1 -1
- package/dist/runtime/composables/useBlokkli.d.ts +6 -1
- package/dist/runtime/composables/useBlokkli.js +4 -1
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/composables/defineAddAction.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineAddAction.js +10 -0
- package/dist/runtime/helpers/composables/defineElementStyle.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineElementStyle.js +33 -0
- package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +1 -1
- package/dist/runtime/helpers/composables/defineItemDropdownAction.js +2 -2
- package/dist/runtime/helpers/composables/defineMenuButton.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineMenuButton.js +10 -0
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +1 -1
- package/dist/runtime/helpers/composables/onBroadcastEvent.d.ts +1 -1
- package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +1 -1
- package/dist/runtime/helpers/composables/useBlockRegistration.js +12 -1
- package/dist/runtime/helpers/composables/useDebugLogger.d.ts +1 -1
- package/dist/runtime/helpers/composables/useDialog.d.ts +3 -0
- package/dist/runtime/helpers/composables/useDialog.js +16 -0
- package/dist/runtime/helpers/composables/useFocusTrap.d.ts +52 -0
- package/dist/runtime/helpers/composables/useFocusTrap.js +59 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +1 -1
- package/dist/runtime/helpers/{useTransitionedValue.js → composables/useTransitionedValue.js} +1 -1
- package/dist/runtime/helpers/dropTargets/index.d.ts +1 -1
- package/dist/runtime/helpers/dropTargets/index.js +17 -3
- package/dist/runtime/helpers/imports/index.d.ts +2 -1
- package/dist/runtime/helpers/imports/index.js +10 -1
- package/dist/runtime/helpers/{animationProvider.d.ts → providers/animation.d.ts} +100 -7
- package/dist/runtime/helpers/{animationProvider.js → providers/animation.js} +21 -11
- package/dist/runtime/helpers/providers/blocks.d.ts +25 -3
- package/dist/runtime/helpers/providers/blocks.js +19 -0
- package/dist/runtime/helpers/providers/commands.d.ts +41 -0
- package/dist/runtime/helpers/{commandsProvider.js → providers/commands.js} +1 -1
- package/dist/runtime/helpers/providers/debug.d.ts +125 -0
- package/dist/runtime/helpers/{debugProvider.js → providers/debug.js} +2 -2
- package/dist/runtime/helpers/providers/definition.d.ts +87 -0
- package/dist/runtime/helpers/providers/directive.d.ts +88 -2
- package/dist/runtime/helpers/providers/directive.js +18 -2
- package/dist/runtime/helpers/providers/dom.d.ts +225 -0
- package/dist/runtime/helpers/{domProvider.js → providers/dom.js} +34 -76
- package/dist/runtime/helpers/providers/dropArea.d.ts +47 -0
- package/dist/runtime/helpers/{dropAreaProvider.js → providers/dropArea.js} +1 -1
- package/dist/runtime/helpers/providers/element.d.ts +58 -1
- package/dist/runtime/helpers/providers/features.d.ts +56 -0
- package/dist/runtime/helpers/{featuresProvider.js → providers/features.js} +1 -1
- package/dist/runtime/helpers/providers/fields.d.ts +19 -4
- package/dist/runtime/helpers/providers/fields.js +1 -1
- package/dist/runtime/helpers/providers/indicators.d.ts +44 -0
- package/dist/runtime/helpers/providers/keyboard.d.ts +76 -0
- package/dist/runtime/helpers/{keyboardProvider.js → providers/keyboard.js} +1 -8
- package/dist/runtime/helpers/providers/plugin.d.ts +81 -0
- package/dist/runtime/helpers/providers/plugin.js +64 -0
- package/dist/runtime/helpers/{selectionProvider.d.ts → providers/selection.d.ts} +4 -1
- package/dist/runtime/helpers/{selectionProvider.js → providers/selection.js} +1 -1
- package/dist/runtime/helpers/providers/state.d.ts +227 -0
- package/dist/runtime/helpers/{stateProvider.js → providers/state.js} +3 -3
- package/dist/runtime/helpers/providers/storage.d.ts +64 -0
- package/dist/runtime/helpers/{textProvider.d.ts → providers/texts.d.ts} +1 -1
- package/dist/runtime/helpers/providers/theme.d.ts +119 -0
- package/dist/runtime/helpers/{themeProvider.js → providers/theme.js} +3 -3
- package/dist/runtime/helpers/providers/tour.d.ts +49 -0
- package/dist/runtime/helpers/{tourProvider.js → providers/tour.js} +1 -1
- package/dist/runtime/helpers/providers/types.d.ts +170 -0
- package/dist/runtime/helpers/{typesProvider.js → providers/types.js} +45 -1
- package/dist/runtime/helpers/providers/ui.d.ts +339 -0
- package/dist/runtime/helpers/{uiProvider.js → providers/ui.js} +94 -86
- package/dist/runtime/helpers/runtimeHelpers/index.d.ts +1 -1
- package/dist/runtime/helpers/symbols.d.ts +1 -0
- package/dist/runtime/helpers/symbols.js +3 -0
- package/dist/runtime/icons/click.svg +1 -0
- package/dist/runtime/types/blockOptions.d.ts +349 -0
- package/dist/runtime/types/index.d.ts +34 -31
- package/package.json +2 -2
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +0 -96
- package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +0 -26
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue +0 -68
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +0 -19
- package/dist/runtime/helpers/commandsProvider.d.ts +0 -9
- package/dist/runtime/helpers/debugProvider.d.ts +0 -33
- package/dist/runtime/helpers/definitionProvider.d.ts +0 -19
- package/dist/runtime/helpers/domProvider.d.ts +0 -90
- package/dist/runtime/helpers/dropAreaProvider.d.ts +0 -9
- package/dist/runtime/helpers/featuresProvider.d.ts +0 -17
- package/dist/runtime/helpers/indicatorsProvider.d.ts +0 -10
- package/dist/runtime/helpers/keyboardProvider.d.ts +0 -20
- package/dist/runtime/helpers/pluginProvider.d.ts +0 -26
- package/dist/runtime/helpers/pluginProvider.js +0 -62
- package/dist/runtime/helpers/stateProvider.d.ts +0 -47
- package/dist/runtime/helpers/storageProvider.d.ts +0 -17
- package/dist/runtime/helpers/themeProvider.d.ts +0 -30
- package/dist/runtime/helpers/tourProvider.d.ts +0 -11
- package/dist/runtime/helpers/typesProvider.d.ts +0 -36
- package/dist/runtime/helpers/uiProvider.d.ts +0 -60
- package/dist/runtime/types/blokkOptions.d.ts +0 -100
- /package/dist/runtime/helpers/{addElementClasses.d.ts → composables/addElementClasses.d.ts} +0 -0
- /package/dist/runtime/helpers/{addElementClasses.js → composables/addElementClasses.js} +0 -0
- /package/dist/runtime/helpers/{useTransitionedValue.d.ts → composables/useTransitionedValue.d.ts} +0 -0
- /package/dist/runtime/helpers/{broadcastProvider.d.ts → providers/broadcast.d.ts} +0 -0
- /package/dist/runtime/helpers/{broadcastProvider.js → providers/broadcast.js} +0 -0
- /package/dist/runtime/helpers/{definitionProvider.js → providers/definition.js} +0 -0
- /package/dist/runtime/helpers/{indicatorsProvider.js → providers/indicators.js} +0 -0
- /package/dist/runtime/helpers/{storageProvider.js → providers/storage.js} +0 -0
- /package/dist/runtime/helpers/{textProvider.js → providers/texts.js} +0 -0
- /package/dist/runtime/types/{blokkOptions.js → blockOptions.js} +0 -0
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { type Ref, type ComputedRef } from '#imports';
|
|
2
|
+
import type { ShallowRef } from 'vue';
|
|
3
|
+
import type { StorageProvider } from './storage.js';
|
|
4
|
+
import type { Coord, GlobalUiDialog, Rectangle, SidebarRegion, Size } from '#blokkli/types';
|
|
5
|
+
import type { Viewport } from '#blokkli/constants';
|
|
6
|
+
import type { AdapterContext } from '#blokkli/adapter';
|
|
7
|
+
import type { ThemeColorName } from '#blokkli/types/theme';
|
|
8
|
+
import type { ElementProvider } from './element.js';
|
|
9
|
+
export type UiProvider = {
|
|
10
|
+
/**
|
|
11
|
+
* Get the Nuxt root element (#nuxt-root).
|
|
12
|
+
*
|
|
13
|
+
* Cached after first access for performance.
|
|
14
|
+
*
|
|
15
|
+
* @returns The root HTML element
|
|
16
|
+
* @throws Error if element cannot be found
|
|
17
|
+
*/
|
|
18
|
+
rootElement: () => HTMLElement;
|
|
19
|
+
/**
|
|
20
|
+
* Get the artboard element (.bk-main-canvas).
|
|
21
|
+
*
|
|
22
|
+
* The artboard is the scrollable container for the edited content.
|
|
23
|
+
* Cached after first access for performance.
|
|
24
|
+
*
|
|
25
|
+
* @returns The artboard HTML element
|
|
26
|
+
* @throws Error if element cannot be found
|
|
27
|
+
*/
|
|
28
|
+
artboardElement: () => HTMLElement;
|
|
29
|
+
/**
|
|
30
|
+
* The blökkli provider root element.
|
|
31
|
+
*
|
|
32
|
+
* This is the element that contains the entire editor UI.
|
|
33
|
+
*/
|
|
34
|
+
providerElement: HTMLElement;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the viewport is mobile (< 1024px width).
|
|
37
|
+
*/
|
|
38
|
+
isMobile: ComputedRef<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the viewport is desktop (>= 1024px width).
|
|
41
|
+
*/
|
|
42
|
+
isDesktop: ComputedRef<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Whether animations are currently running.
|
|
45
|
+
*
|
|
46
|
+
* When true, adds 'bk-is-animating' class to document root.
|
|
47
|
+
* Used to disable certain interactions during animations.
|
|
48
|
+
*/
|
|
49
|
+
isAnimating: Ref<boolean>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the analyzer is currently active.
|
|
52
|
+
*
|
|
53
|
+
* When true, adds 'bk-is-analyzing' class to document root.
|
|
54
|
+
*/
|
|
55
|
+
isAnalyzing: Ref<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* Whether proxy mode is active.
|
|
58
|
+
*
|
|
59
|
+
* Proxy mode shows a structured view of blocks instead of their components.
|
|
60
|
+
*/
|
|
61
|
+
isProxyMode: Ref<boolean>;
|
|
62
|
+
/**
|
|
63
|
+
* Whether any dialog is currently open.
|
|
64
|
+
*/
|
|
65
|
+
hasDialogOpen: ComputedRef<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* The currently open dialog, or null if none is open.
|
|
68
|
+
*/
|
|
69
|
+
currentDialog: Readonly<Ref<GlobalUiDialog | null>>;
|
|
70
|
+
/**
|
|
71
|
+
* Require confirmation before closing the current dialog.
|
|
72
|
+
*
|
|
73
|
+
* Sets the confirmClose flag on the current dialog, which will
|
|
74
|
+
* require double clicking the dialog background overlay to close it.
|
|
75
|
+
*/
|
|
76
|
+
requireDialogCloseConfirm: () => void;
|
|
77
|
+
/**
|
|
78
|
+
* Open a global dialog.
|
|
79
|
+
*
|
|
80
|
+
* Closes any previously open dialog and opens the new one.
|
|
81
|
+
*
|
|
82
|
+
* @param dialog - The dialog configuration to open
|
|
83
|
+
*/
|
|
84
|
+
openDialog: (dialog: GlobalUiDialog) => void;
|
|
85
|
+
/**
|
|
86
|
+
* Close a dialog.
|
|
87
|
+
*
|
|
88
|
+
* @param id - Optional dialog ID. If provided, only closes if it matches the current dialog.
|
|
89
|
+
*/
|
|
90
|
+
closeDialog: (id?: string) => void;
|
|
91
|
+
/**
|
|
92
|
+
* Whether any tooltip is currently open.
|
|
93
|
+
*/
|
|
94
|
+
hasTooltipOpen: ComputedRef<boolean>;
|
|
95
|
+
/**
|
|
96
|
+
* ID of the currently open tooltip, or empty string if none is open.
|
|
97
|
+
*/
|
|
98
|
+
openTooltip: Ref<string>;
|
|
99
|
+
/**
|
|
100
|
+
* The current selection color.
|
|
101
|
+
*
|
|
102
|
+
* Returns the most recently set color, or null if none is set.
|
|
103
|
+
* Used to colorize the selection UI (selection rect, drop target indicators, etc.).
|
|
104
|
+
*/
|
|
105
|
+
selectionColor: ComputedRef<ThemeColorName | null>;
|
|
106
|
+
/**
|
|
107
|
+
* Set a selection color.
|
|
108
|
+
*
|
|
109
|
+
* Multiple features can set colors with different IDs.
|
|
110
|
+
* The most recently set color is used.
|
|
111
|
+
*
|
|
112
|
+
* @param id - Unique identifier for this color source
|
|
113
|
+
* @param color - The theme color to use
|
|
114
|
+
*/
|
|
115
|
+
setSelectionColor: (id: string, color: ThemeColorName) => void;
|
|
116
|
+
/**
|
|
117
|
+
* Remove a selection color by ID.
|
|
118
|
+
*
|
|
119
|
+
* If this was the active color, the previous color will become active.
|
|
120
|
+
*
|
|
121
|
+
* @param id - The color source ID to remove
|
|
122
|
+
*/
|
|
123
|
+
removeSelectionColor: (id: string) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the transform overlay is open.
|
|
126
|
+
*
|
|
127
|
+
* The transform overlay is shown during drag operations, resizing, etc.
|
|
128
|
+
*/
|
|
129
|
+
hasTransformOverlayOpen: Ref<boolean>;
|
|
130
|
+
/**
|
|
131
|
+
* Whether a transform operation is active.
|
|
132
|
+
*
|
|
133
|
+
* True when transformLabel is not empty.
|
|
134
|
+
*/
|
|
135
|
+
isTransforming: ComputedRef<boolean>;
|
|
136
|
+
/**
|
|
137
|
+
* Set the active transform operation.
|
|
138
|
+
*
|
|
139
|
+
* @param label - Label describing the transform (e.g., "Moving 3 blocks"), or null/undefined to clear
|
|
140
|
+
*/
|
|
141
|
+
setTransform: (label?: string | null | undefined) => void;
|
|
142
|
+
/**
|
|
143
|
+
* The current transform operation label.
|
|
144
|
+
*/
|
|
145
|
+
transformLabel: ComputedRef<string>;
|
|
146
|
+
/**
|
|
147
|
+
* Whether animations are enabled.
|
|
148
|
+
*
|
|
149
|
+
* Can be disabled in settings for performance or accessibility.
|
|
150
|
+
* Defaults to true.
|
|
151
|
+
*/
|
|
152
|
+
useAnimations: ComputedRef<boolean>;
|
|
153
|
+
/**
|
|
154
|
+
* Whether low performance mode is enabled.
|
|
155
|
+
*
|
|
156
|
+
* When enabled, reduces visual effects and animations for better performance
|
|
157
|
+
* on slower devices.
|
|
158
|
+
*/
|
|
159
|
+
lowPerformanceMode: ComputedRef<boolean>;
|
|
160
|
+
/**
|
|
161
|
+
* The visible viewport rectangle.
|
|
162
|
+
*
|
|
163
|
+
* Represents the portion of the window where the editor is visible,
|
|
164
|
+
* excluding any overlays or sidebars.
|
|
165
|
+
*/
|
|
166
|
+
visibleViewport: ComputedRef<Rectangle>;
|
|
167
|
+
/**
|
|
168
|
+
* The visible viewport rectangle with padding applied.
|
|
169
|
+
*
|
|
170
|
+
* Used for positioning elements that should be inset from the viewport edges.
|
|
171
|
+
*/
|
|
172
|
+
visibleViewportPadded: ComputedRef<Rectangle>;
|
|
173
|
+
/**
|
|
174
|
+
* Register a rectangle that blocks part of the viewport.
|
|
175
|
+
*
|
|
176
|
+
* Blocking rectangles are used for persistent UI elements (toolbars, sidebars)
|
|
177
|
+
* that should affect element positioning and visibility calculations.
|
|
178
|
+
*
|
|
179
|
+
* @param key - Unique identifier for this blocking rectangle
|
|
180
|
+
* @param rect - The rectangle, or undefined to remove the blocking rectangle
|
|
181
|
+
*/
|
|
182
|
+
setViewportBlockingRectangle: (key: string, rect?: Rectangle) => void;
|
|
183
|
+
/**
|
|
184
|
+
* All viewport blocking rectangles with padding applied.
|
|
185
|
+
*
|
|
186
|
+
* Each rectangle is expanded by blockingPaddingX and blockingPaddingY
|
|
187
|
+
* to create a buffer zone around blocking UI elements.
|
|
188
|
+
*/
|
|
189
|
+
viewportBlockingRects: ComputedRef<Rectangle[]>;
|
|
190
|
+
/**
|
|
191
|
+
* The current viewport type.
|
|
192
|
+
*
|
|
193
|
+
* 'mobile' for viewports < 1024px width, 'desktop' otherwise.
|
|
194
|
+
* Used to adjust UI layout and behavior.
|
|
195
|
+
*/
|
|
196
|
+
appViewport: ComputedRef<Viewport>;
|
|
197
|
+
/**
|
|
198
|
+
* ID of the currently open context menu, or empty string if none is open.
|
|
199
|
+
*/
|
|
200
|
+
openContextMenu: Ref<string>;
|
|
201
|
+
/**
|
|
202
|
+
* The browser window viewport size.
|
|
203
|
+
*
|
|
204
|
+
* Updated on window resize with 400ms debounce.
|
|
205
|
+
*/
|
|
206
|
+
viewport: ComputedRef<Size>;
|
|
207
|
+
/**
|
|
208
|
+
* The artboard element size.
|
|
209
|
+
*
|
|
210
|
+
* Tracked via ResizeObserver for accurate, efficient updates.
|
|
211
|
+
*/
|
|
212
|
+
artboardSize: ComputedRef<Size>;
|
|
213
|
+
/**
|
|
214
|
+
* The artboard zoom/scale factor.
|
|
215
|
+
*
|
|
216
|
+
* 1.0 = 100%, 0.5 = 50%, 2.0 = 200%, etc.
|
|
217
|
+
* Used by artboard zoom feature.
|
|
218
|
+
*/
|
|
219
|
+
artboardScale: Ref<number>;
|
|
220
|
+
/**
|
|
221
|
+
* The artboard scroll/pan offset in pixels.
|
|
222
|
+
*
|
|
223
|
+
* Represents how far the artboard has been scrolled or panned.
|
|
224
|
+
*/
|
|
225
|
+
artboardOffset: Ref<Coord>;
|
|
226
|
+
/**
|
|
227
|
+
* Top-left coordinate of the selection rectangle.
|
|
228
|
+
*
|
|
229
|
+
* Updated during drag operations and multi-select.
|
|
230
|
+
*/
|
|
231
|
+
selectionTopLeft: Ref<Coord>;
|
|
232
|
+
/**
|
|
233
|
+
* The interface language code.
|
|
234
|
+
*
|
|
235
|
+
* Respects forceDefaultLanguage config setting.
|
|
236
|
+
* Falls back to context language otherwise.
|
|
237
|
+
*/
|
|
238
|
+
interfaceLanguage: ComputedRef<string>;
|
|
239
|
+
/**
|
|
240
|
+
* The full locale string for date/number formatting.
|
|
241
|
+
*
|
|
242
|
+
* Maps language codes to locale strings (e.g., 'de' -> 'de-CH').
|
|
243
|
+
*/
|
|
244
|
+
locale: ComputedRef<string>;
|
|
245
|
+
/**
|
|
246
|
+
* Format a date using the current locale.
|
|
247
|
+
*
|
|
248
|
+
* @param date - Date object or ISO string
|
|
249
|
+
* @param options - Intl.DateTimeFormat options. Defaults to numeric date + time.
|
|
250
|
+
* @returns Localized date string
|
|
251
|
+
*
|
|
252
|
+
* @example
|
|
253
|
+
* ```ts
|
|
254
|
+
* formatDate(new Date()) // "16.11.2025, 14:30"
|
|
255
|
+
* formatDate(isoString, { dateStyle: 'long' }) // "16. November 2025"
|
|
256
|
+
* ```
|
|
257
|
+
*/
|
|
258
|
+
formatDate: (date: string | Date, options?: Intl.DateTimeFormatOptions) => string;
|
|
259
|
+
/**
|
|
260
|
+
* Get absolute rectangle for an element or rectangle.
|
|
261
|
+
*
|
|
262
|
+
* Converts viewport-relative coordinates to artboard-absolute coordinates
|
|
263
|
+
* by accounting for artboard scale and offset. Ensures minimum size of 24x24.
|
|
264
|
+
*
|
|
265
|
+
* @param v - HTML element or rectangle
|
|
266
|
+
* @param scale - Override artboard scale (uses current scale if not provided)
|
|
267
|
+
* @param offset - Override artboard offset (uses current offset if not provided)
|
|
268
|
+
* @returns Absolute rectangle in artboard coordinates
|
|
269
|
+
*/
|
|
270
|
+
getAbsoluteElementRect: (v: HTMLElement | Rectangle, scale?: number, offset?: Coord) => Rectangle;
|
|
271
|
+
/**
|
|
272
|
+
* Convert artboard-absolute rectangle to viewport-relative coordinates.
|
|
273
|
+
*
|
|
274
|
+
* Applies artboard scale and offset to convert from artboard space
|
|
275
|
+
* to viewport/screen space.
|
|
276
|
+
*
|
|
277
|
+
* @param rect - Rectangle in artboard coordinates
|
|
278
|
+
* @param scale - Override artboard scale (uses current scale if not provided)
|
|
279
|
+
* @param offset - Override artboard offset (uses current offset if not provided)
|
|
280
|
+
* @returns Rectangle in viewport coordinates
|
|
281
|
+
*/
|
|
282
|
+
getViewportRelativeRect: (rect: Rectangle, scale?: number, offset?: Coord) => Rectangle;
|
|
283
|
+
/**
|
|
284
|
+
* Set the height of a banner by ID.
|
|
285
|
+
*
|
|
286
|
+
* Banners are persistent notification bars at the top of the interface.
|
|
287
|
+
* Height is used to adjust viewport calculations.
|
|
288
|
+
*
|
|
289
|
+
* @param id - Unique banner identifier
|
|
290
|
+
* @param height - Banner height in pixels
|
|
291
|
+
*/
|
|
292
|
+
setBannerHeight: (id: string, height: number) => void;
|
|
293
|
+
/**
|
|
294
|
+
* Remove a banner by ID.
|
|
295
|
+
*
|
|
296
|
+
* Sets the banner height to 0.
|
|
297
|
+
*
|
|
298
|
+
* @param id - The banner identifier to remove
|
|
299
|
+
*/
|
|
300
|
+
removeBanner: (id: string) => void;
|
|
301
|
+
/**
|
|
302
|
+
* Register an active sidebar.
|
|
303
|
+
*
|
|
304
|
+
* Adds the sidebar ID to the active list for the specified region.
|
|
305
|
+
* When sidebars are active, the interface adjusts layout accordingly.
|
|
306
|
+
*
|
|
307
|
+
* @param region - Which sidebar region ('left' or 'right')
|
|
308
|
+
* @param id - Unique sidebar identifier
|
|
309
|
+
*/
|
|
310
|
+
setActiveSidebar: (region: SidebarRegion, id: string) => void;
|
|
311
|
+
/**
|
|
312
|
+
* Unregister an active sidebar.
|
|
313
|
+
*
|
|
314
|
+
* Removes the sidebar ID from the active list for the specified region.
|
|
315
|
+
*
|
|
316
|
+
* @param region - Which sidebar region ('left' or 'right')
|
|
317
|
+
* @param id - The sidebar identifier to remove
|
|
318
|
+
*/
|
|
319
|
+
removeActiveSidebar: (region: SidebarRegion, id: string) => void;
|
|
320
|
+
/**
|
|
321
|
+
* Whether any sidebar is active on the left.
|
|
322
|
+
*
|
|
323
|
+
* When true, adds 'bk-has-sidebar-left' class to document root.
|
|
324
|
+
*/
|
|
325
|
+
hasSidebarLeft: ComputedRef<boolean>;
|
|
326
|
+
/**
|
|
327
|
+
* Whether any sidebar is active on the right.
|
|
328
|
+
*
|
|
329
|
+
* When true, adds 'bk-has-sidebar-right' class to document root.
|
|
330
|
+
*/
|
|
331
|
+
hasSidebarRight: ComputedRef<boolean>;
|
|
332
|
+
/**
|
|
333
|
+
* Reference to the main layout element.
|
|
334
|
+
*
|
|
335
|
+
* The container element for the primary editor interface.
|
|
336
|
+
*/
|
|
337
|
+
mainLayoutElement: Readonly<ShallowRef<HTMLDivElement | null>>;
|
|
338
|
+
};
|
|
339
|
+
export default function (providerElement: HTMLElement, storage: StorageProvider, context: ComputedRef<AdapterContext>, element: ElementProvider, mainLayoutElement: Readonly<ShallowRef<HTMLDivElement | null>>, visibleViewportElement: Readonly<ShallowRef<HTMLDivElement | null>>): UiProvider;
|
|
@@ -2,11 +2,14 @@ import {
|
|
|
2
2
|
onMounted,
|
|
3
3
|
onBeforeUnmount,
|
|
4
4
|
ref,
|
|
5
|
-
computed
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import {
|
|
5
|
+
computed,
|
|
6
|
+
watch,
|
|
7
|
+
readonly
|
|
8
|
+
} from "#imports";
|
|
9
|
+
import { eventBus } from "../eventBus.js";
|
|
10
|
+
import { falsy } from "../index.js";
|
|
11
|
+
import { addElementClasses } from "../composables/addElementClasses.js";
|
|
12
|
+
import { defineElementStyle } from "../composables/defineElementStyle.js";
|
|
10
13
|
import { defaultLanguage, forceDefaultLanguage } from "#blokkli-build/config";
|
|
11
14
|
const CLASS_PROXY_MODE = "bk-is-proxy-mode";
|
|
12
15
|
const localeMap = {
|
|
@@ -15,7 +18,7 @@ const localeMap = {
|
|
|
15
18
|
it: "it-CH",
|
|
16
19
|
en: "en-GB"
|
|
17
20
|
};
|
|
18
|
-
export default function(providerElement, storage,
|
|
21
|
+
export default function(providerElement, storage, context, element, mainLayoutElement, visibleViewportElement) {
|
|
19
22
|
let cachedRootElement = null;
|
|
20
23
|
let cachedArtboardElement = null;
|
|
21
24
|
const interfaceLanguage = computed(() => {
|
|
@@ -25,9 +28,14 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
25
28
|
const lang = interfaceLanguage.value;
|
|
26
29
|
return localeMap[lang] || lang;
|
|
27
30
|
});
|
|
31
|
+
const viewportWidth = ref(window.innerWidth);
|
|
32
|
+
const viewportHeight = ref(window.innerHeight);
|
|
33
|
+
const visibleViewportWidth = ref(0);
|
|
34
|
+
const visibleViewportHeight = ref(0);
|
|
35
|
+
const visibleViewportX = ref(0);
|
|
36
|
+
const visibleViewportY = ref(0);
|
|
28
37
|
const isProxyMode = ref(false);
|
|
29
|
-
const
|
|
30
|
-
const hasDialogOpen = ref(false);
|
|
38
|
+
const currentDialog = ref(null);
|
|
31
39
|
const openTooltip = ref("");
|
|
32
40
|
const hasTransformOverlayOpen = ref(false);
|
|
33
41
|
const isAnimating = ref(false);
|
|
@@ -35,6 +43,20 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
35
43
|
const transformLabel = ref("");
|
|
36
44
|
const openContextMenu = ref("");
|
|
37
45
|
const banners = ref({});
|
|
46
|
+
function openDialog(dialog) {
|
|
47
|
+
currentDialog.value = dialog;
|
|
48
|
+
}
|
|
49
|
+
function requireDialogCloseConfirm() {
|
|
50
|
+
if (currentDialog.value) {
|
|
51
|
+
currentDialog.value.confirmClose = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function closeDialog(id) {
|
|
55
|
+
if (!id || currentDialog.value?.id === id) {
|
|
56
|
+
currentDialog.value = null;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
const hasDialogOpen = computed(() => currentDialog.value !== null);
|
|
38
60
|
function setBannerHeight(id, height) {
|
|
39
61
|
banners.value[id] = height;
|
|
40
62
|
}
|
|
@@ -62,17 +84,42 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
62
84
|
y: 0
|
|
63
85
|
});
|
|
64
86
|
const artboardScale = ref(1);
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
87
|
+
const resizeElementMap = /* @__PURE__ */ new WeakMap();
|
|
88
|
+
let visibleViewportResizeTimeout = null;
|
|
89
|
+
function updateVisibleViewport() {
|
|
90
|
+
if (!visibleViewportElement.value) {
|
|
68
91
|
return;
|
|
69
92
|
}
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
93
|
+
const rect = visibleViewportElement.value.getBoundingClientRect();
|
|
94
|
+
visibleViewportWidth.value = rect.width;
|
|
95
|
+
visibleViewportHeight.value = rect.height;
|
|
96
|
+
visibleViewportX.value = rect.x;
|
|
97
|
+
visibleViewportY.value = rect.y;
|
|
98
|
+
}
|
|
99
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
100
|
+
for (const entry of entries) {
|
|
101
|
+
const size = entry.contentBoxSize[0];
|
|
102
|
+
if (!size) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
const key = resizeElementMap.get(entry.target);
|
|
106
|
+
if (!key) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (key === "artboard") {
|
|
110
|
+
artboardSize.value.width = size.inlineSize;
|
|
111
|
+
artboardSize.value.height = size.blockSize;
|
|
112
|
+
} else if (key === "visible-viewport") {
|
|
113
|
+
visibleViewportWidth.value = size.inlineSize;
|
|
114
|
+
visibleViewportHeight.value = size.blockSize;
|
|
115
|
+
if (visibleViewportResizeTimeout) {
|
|
116
|
+
window.clearTimeout(visibleViewportResizeTimeout);
|
|
117
|
+
}
|
|
118
|
+
visibleViewportResizeTimeout = window.setTimeout(() => {
|
|
119
|
+
updateVisibleViewport();
|
|
120
|
+
}, 50);
|
|
121
|
+
}
|
|
73
122
|
}
|
|
74
|
-
artboardSize.value.width = size.inlineSize;
|
|
75
|
-
artboardSize.value.height = size.blockSize;
|
|
76
123
|
});
|
|
77
124
|
const setViewportBlockingRectangle = (key, rect) => {
|
|
78
125
|
if (!rect) {
|
|
@@ -117,8 +164,6 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
117
164
|
}
|
|
118
165
|
return "desktop";
|
|
119
166
|
});
|
|
120
|
-
const viewportWidth = ref(window.innerWidth);
|
|
121
|
-
const viewportHeight = ref(window.innerHeight);
|
|
122
167
|
const isMobile = computed(() => appViewport.value === "mobile");
|
|
123
168
|
const isDesktop = computed(() => appViewport.value === "desktop");
|
|
124
169
|
let resizeTimeout = null;
|
|
@@ -130,12 +175,6 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
130
175
|
eventBus.emit("ui:resized");
|
|
131
176
|
}, 400);
|
|
132
177
|
};
|
|
133
|
-
const toolbarHeight = computed(() => {
|
|
134
|
-
if (isMobile.value) {
|
|
135
|
-
return 80;
|
|
136
|
-
}
|
|
137
|
-
return 50;
|
|
138
|
-
});
|
|
139
178
|
const activeSidebarsLeft = ref([]);
|
|
140
179
|
const activeSidebarsRight = ref([]);
|
|
141
180
|
function setActiveSidebar(region, id) {
|
|
@@ -168,55 +207,10 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
168
207
|
const hasSidebarRight = computed(() => {
|
|
169
208
|
return !!activeSidebarsRight.value.length;
|
|
170
209
|
});
|
|
171
|
-
const settingsStorage = storage.use("feature:add-list:settings", {
|
|
172
|
-
orientation: "vertical"
|
|
173
|
-
});
|
|
174
|
-
const addListOrientation = computed(
|
|
175
|
-
() => isMobile.value ? "horizontal" : settingsStorage.value.orientation
|
|
176
|
-
);
|
|
177
|
-
const visibleViewportX = computed(() => {
|
|
178
|
-
let x = 0;
|
|
179
|
-
if (!isMobile.value) {
|
|
180
|
-
if (addListOrientation.value === "vertical" && state.editMode.value === "editing") {
|
|
181
|
-
x += 70;
|
|
182
|
-
}
|
|
183
|
-
if (hasSidebarLeft.value) {
|
|
184
|
-
x += 400;
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
return x;
|
|
188
|
-
});
|
|
189
|
-
const visibleViewportY = computed(() => {
|
|
190
|
-
return toolbarHeight.value;
|
|
191
|
-
});
|
|
192
|
-
const visibleViewportWidth = computed(() => {
|
|
193
|
-
if (isMobile.value) {
|
|
194
|
-
return viewportWidth.value;
|
|
195
|
-
}
|
|
196
|
-
let width = viewportWidth.value - visibleViewportX.value - 50;
|
|
197
|
-
if (hasSidebarRight.value) {
|
|
198
|
-
width -= 351;
|
|
199
|
-
}
|
|
200
|
-
return width;
|
|
201
|
-
});
|
|
202
|
-
const visibleViewportHeight = computed(() => {
|
|
203
|
-
let height = viewportHeight.value - visibleViewportY.value;
|
|
204
|
-
if (addListOrientation.value === "horizontal") {
|
|
205
|
-
if (isMobile.value) {
|
|
206
|
-
height -= 50;
|
|
207
|
-
} else {
|
|
208
|
-
height -= 70;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
const bannerHeights = Object.values(banners.value).filter(Boolean);
|
|
212
|
-
bannerHeights.forEach((bannerHeight) => {
|
|
213
|
-
height -= bannerHeight;
|
|
214
|
-
});
|
|
215
|
-
height -= bannerHeights.length * 10;
|
|
216
|
-
return height;
|
|
217
|
-
});
|
|
218
210
|
const blockingPaddingX = computed(() => 15);
|
|
219
211
|
const blockingPaddingY = computed(() => 50);
|
|
212
|
+
const viewportPadding = computed(() => 10);
|
|
213
|
+
const scrollbarWidth = computed(() => 16);
|
|
220
214
|
const viewportBlockingRects = computed(() => {
|
|
221
215
|
return Object.values(viewportBlockingRectsMap.value).map((rect) => {
|
|
222
216
|
if (!rect) {
|
|
@@ -239,11 +233,12 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
239
233
|
};
|
|
240
234
|
});
|
|
241
235
|
const visibleViewportPadded = computed(() => {
|
|
236
|
+
const p = viewportPadding.value;
|
|
242
237
|
return {
|
|
243
|
-
x: visibleViewportX.value +
|
|
244
|
-
y: visibleViewportY.value +
|
|
245
|
-
width: visibleViewportWidth.value -
|
|
246
|
-
height: visibleViewportHeight.value -
|
|
238
|
+
x: visibleViewportX.value + p,
|
|
239
|
+
y: visibleViewportY.value + p,
|
|
240
|
+
width: visibleViewportWidth.value - 2 * p,
|
|
241
|
+
height: visibleViewportHeight.value - 2 * p
|
|
247
242
|
};
|
|
248
243
|
});
|
|
249
244
|
const viewport = computed(() => {
|
|
@@ -303,18 +298,31 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
303
298
|
addElementClasses(document.body, "bk-body");
|
|
304
299
|
addElementClasses(document.documentElement, CLASS_PROXY_MODE, isProxyMode);
|
|
305
300
|
addElementClasses(document.documentElement, "bk-is-analyzing", isAnalyzing);
|
|
301
|
+
function observeElement(element2, key) {
|
|
302
|
+
resizeElementMap.set(element2, key);
|
|
303
|
+
resizeObserver.observe(element2);
|
|
304
|
+
}
|
|
305
|
+
watch(
|
|
306
|
+
visibleViewportElement,
|
|
307
|
+
(el) => {
|
|
308
|
+
if (el) {
|
|
309
|
+
observeElement(el, "visible-viewport");
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
immediate: true
|
|
314
|
+
}
|
|
315
|
+
);
|
|
306
316
|
onMounted(() => {
|
|
307
317
|
viewportWidth.value = window.innerWidth;
|
|
308
318
|
viewportHeight.value = window.innerHeight;
|
|
309
319
|
window.addEventListener("resize", onResize);
|
|
310
320
|
const artboard = artboardElement();
|
|
311
|
-
|
|
321
|
+
observeElement(artboard, "artboard");
|
|
312
322
|
});
|
|
313
323
|
onBeforeUnmount(() => {
|
|
314
324
|
window.removeEventListener("resize", onResize);
|
|
315
325
|
clearTimeout(resizeTimeout);
|
|
316
|
-
const artboard = artboardElement();
|
|
317
|
-
resizeObserver.unobserve(artboard);
|
|
318
326
|
resizeObserver.disconnect();
|
|
319
327
|
});
|
|
320
328
|
const hasTooltipOpen = computed(() => !!openTooltip.value);
|
|
@@ -331,12 +339,9 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
331
339
|
const selectionColor = computed(() => {
|
|
332
340
|
return selectionColors.value[selectionColors.value.length - 1]?.color ?? null;
|
|
333
341
|
});
|
|
342
|
+
defineElementStyle("--bk-viewport-padding", viewportPadding);
|
|
343
|
+
defineElementStyle("--bk-scrollbar-width", scrollbarWidth);
|
|
334
344
|
return {
|
|
335
|
-
menu: {
|
|
336
|
-
isOpen: menuIsOpen,
|
|
337
|
-
close: () => menuIsOpen.value = false,
|
|
338
|
-
open: () => menuIsOpen.value = true
|
|
339
|
-
},
|
|
340
345
|
artboardElement,
|
|
341
346
|
rootElement,
|
|
342
347
|
providerElement,
|
|
@@ -350,8 +355,6 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
350
355
|
useAnimations,
|
|
351
356
|
visibleViewport,
|
|
352
357
|
visibleViewportPadded,
|
|
353
|
-
toolbarHeight,
|
|
354
|
-
addListOrientation,
|
|
355
358
|
setViewportBlockingRectangle,
|
|
356
359
|
viewportBlockingRects,
|
|
357
360
|
appViewport,
|
|
@@ -380,6 +383,11 @@ export default function(providerElement, storage, state, context, element) {
|
|
|
380
383
|
setActiveSidebar,
|
|
381
384
|
removeActiveSidebar,
|
|
382
385
|
hasSidebarLeft,
|
|
383
|
-
hasSidebarRight
|
|
386
|
+
hasSidebarRight,
|
|
387
|
+
mainLayoutElement,
|
|
388
|
+
openDialog,
|
|
389
|
+
closeDialog,
|
|
390
|
+
currentDialog: readonly(currentDialog),
|
|
391
|
+
requireDialogCloseConfirm
|
|
384
392
|
};
|
|
385
393
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type RuntimeBlockOptionArray, type RuntimeBlockOptions } from '#blokkli-build/runtime-options';
|
|
5
5
|
import type { FieldListItemTyped } from '#blokkli-build/generated-types';
|
|
6
|
-
import type { BlockOptionDefinition } from '#blokkli/types/
|
|
6
|
+
import type { BlockOptionDefinition } from '#blokkli/types/blockOptions';
|
|
7
7
|
import type { FieldListItem } from '#blokkli/types';
|
|
8
8
|
/**
|
|
9
9
|
* Map all kinds of truthy values for a checkbox.
|
|
@@ -21,5 +21,6 @@ export declare const INJECT_FRAGMENT_CONTEXT: unique symbol;
|
|
|
21
21
|
export declare const INJECT_PROVIDER_KEY: unique symbol;
|
|
22
22
|
export declare const INJECT_EDIT_FIELD_LIST_COMPONENT: unique symbol;
|
|
23
23
|
export declare const INJECT_EDIT_LOGGER: unique symbol;
|
|
24
|
+
export declare const INJECT_ALL_COMPONENTS_CHUNK: unique symbol;
|
|
24
25
|
export declare const BK_HIDDEN_GLOBALLY = "bkHiddenGlobally";
|
|
25
26
|
export declare const BK_VISIBLE_LANGUAGES = "bkVisibleLanguages";
|
|
@@ -23,5 +23,8 @@ export const INJECT_EDIT_FIELD_LIST_COMPONENT = Symbol(
|
|
|
23
23
|
"blokkli_edit_field_list_component"
|
|
24
24
|
);
|
|
25
25
|
export const INJECT_EDIT_LOGGER = Symbol("blokkli_edit_logger");
|
|
26
|
+
export const INJECT_ALL_COMPONENTS_CHUNK = Symbol(
|
|
27
|
+
"blokkli_all_components_chunk"
|
|
28
|
+
);
|
|
26
29
|
export const BK_HIDDEN_GLOBALLY = "bkHiddenGlobally";
|
|
27
30
|
export const BK_VISIBLE_LANGUAGES = "bkVisibleLanguages";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.76,8.69A0.76,0.76 0 0,0 10,9.45V20.9C10,21.32 10.34,21.66 10.76,21.66C10.95,21.66 11.11,21.6 11.24,21.5L13.15,19.95L14.81,23.57C14.94,23.84 15.21,24 15.5,24C15.61,24 15.72,24 15.83,23.92L18.59,22.64C18.97,22.46 19.15,22 18.95,21.63L17.28,18L19.69,17.55C19.85,17.5 20,17.43 20.12,17.29C20.39,16.97 20.35,16.5 20,16.21L11.26,8.86L11.25,8.87C11.12,8.76 10.95,8.69 10.76,8.69M15,10V8H20V10H15M13.83,4.76L16.66,1.93L18.07,3.34L15.24,6.17L13.83,4.76M10,0H12V5H10V0M3.93,14.66L6.76,11.83L8.17,13.24L5.34,16.07L3.93,14.66M3.93,3.34L5.34,1.93L8.17,4.76L6.76,6.17L3.93,3.34M7,10H2V8H7V10" /></svg>
|