@blokkli/editor 2.0.0-alpha.24 → 2.0.0-alpha.26
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 +191 -27
- package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +38 -0
- 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.d.ts +114 -0
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +21 -0
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +98 -0
- 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 +4 -2
- package/dist/runtime/components/Edit/Actions/index.vue +1 -1
- package/dist/runtime/components/Edit/AddListItem/index.vue +1 -6
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +5 -13
- 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 +15 -50
- 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 +27 -24
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +1 -0
- package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue +2 -3
- package/dist/runtime/components/Edit/Features/AddList/index.vue +17 -5
- 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 +1 -1
- package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +8 -3
- package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +10 -1
- 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/EditForm/Frame/index.vue +8 -2
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +1 -7
- 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/EditableMask/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +7 -2
- package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +9 -2
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +12 -3
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +3 -2
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +9 -0
- 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/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/Selection/AddButtons/Overlay/index.vue +126 -33
- package/dist/runtime/components/Edit/Features/Selection/Renderer/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Settings/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +3 -3
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +7 -1
- package/dist/runtime/components/Edit/Form/Textarea/index.vue +1 -1
- package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
- 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/Overlay/index.vue +4 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +3 -3
- package/dist/runtime/components/Edit/ScaleToFit/index.vue +4 -4
- 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/defineItemDropdownAction.d.ts +1 -1
- package/dist/runtime/helpers/composables/defineMenuButton.d.ts +1 -1
- 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/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/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 +9 -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 +27 -3
- package/dist/runtime/helpers/providers/dom.d.ts +225 -0
- package/dist/runtime/helpers/{domProvider.js → providers/dom.js} +31 -75
- 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 +18 -11
- 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/{pluginProvider.d.ts → providers/plugin.d.ts} +36 -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} +11 -5
- 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/types/blockOptions.d.ts +349 -0
- package/dist/runtime/types/index.d.ts +22 -26
- package/package.json +2 -2
- 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 -91
- 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/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 -57
- 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/{defineElementStyle.d.ts → composables/defineElementStyle.d.ts} +0 -0
- /package/dist/runtime/helpers/{defineElementStyle.js → composables/defineElementStyle.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/{pluginProvider.js → providers/plugin.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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRuntimeConfig, computed } from "#imports";
|
|
2
|
-
import { onlyUnique } from "
|
|
2
|
+
import { onlyUnique } from "../index.js";
|
|
3
3
|
class ConfigMap {
|
|
4
4
|
configs = [];
|
|
5
5
|
mapEntityType = {};
|
|
@@ -29,15 +29,59 @@ class ConfigMap {
|
|
|
29
29
|
this.mapEntityTypeBundleName[item.entityType][item.entityBundle][item.name] = item;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Get all configurations for a specific entity type.
|
|
34
|
+
*
|
|
35
|
+
* @param entityType - The entity type to filter by
|
|
36
|
+
* @returns Array of matching configurations
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* // Get all field configs for paragraph entities
|
|
41
|
+
* const paragraphFields = fieldConfig.forEntityType('paragraph')
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
32
44
|
forEntityType(entityType) {
|
|
33
45
|
return this.mapEntityType[entityType] || [];
|
|
34
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Get all configurations for a specific entity type and bundle combination.
|
|
49
|
+
*
|
|
50
|
+
* @param entityType - The entity type
|
|
51
|
+
* @param entityBundle - The entity bundle
|
|
52
|
+
* @returns Array of matching configurations
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```ts
|
|
56
|
+
* // Get all field configs for text paragraph bundle
|
|
57
|
+
* const textFields = fieldConfig.forEntityTypeAndBundle('paragraph', 'text')
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
35
60
|
forEntityTypeAndBundle(entityType, entityBundle) {
|
|
36
61
|
return this.mapEntityTypeBundle[entityType]?.[entityBundle] || [];
|
|
37
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Get a specific configuration by entity type, bundle, and name.
|
|
65
|
+
*
|
|
66
|
+
* @param entityType - The entity type
|
|
67
|
+
* @param entityBundle - The entity bundle
|
|
68
|
+
* @param name - The configuration name (typically field name)
|
|
69
|
+
* @returns The matching configuration, or undefined if not found
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* // Get field config for specific field on text paragraph
|
|
74
|
+
* const config = fieldConfig.forName('paragraph', 'text', 'field_items')
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
38
77
|
forName(entityType, entityBundle, name) {
|
|
39
78
|
return this.mapEntityTypeBundleName[entityType]?.[entityBundle]?.[name];
|
|
40
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Get all configurations.
|
|
82
|
+
*
|
|
83
|
+
* @returns Array of all configurations in the map
|
|
84
|
+
*/
|
|
41
85
|
all() {
|
|
42
86
|
return this.configs;
|
|
43
87
|
}
|
|
@@ -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;
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
watch,
|
|
7
7
|
readonly
|
|
8
8
|
} from "#imports";
|
|
9
|
-
import { eventBus } from "
|
|
10
|
-
import { falsy } from "
|
|
11
|
-
import { addElementClasses } from "
|
|
12
|
-
import { defineElementStyle } from "
|
|
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";
|
|
13
13
|
import { defaultLanguage, forceDefaultLanguage } from "#blokkli-build/config";
|
|
14
14
|
const CLASS_PROXY_MODE = "bk-is-proxy-mode";
|
|
15
15
|
const localeMap = {
|
|
@@ -46,6 +46,11 @@ export default function(providerElement, storage, context, element, mainLayoutEl
|
|
|
46
46
|
function openDialog(dialog) {
|
|
47
47
|
currentDialog.value = dialog;
|
|
48
48
|
}
|
|
49
|
+
function requireDialogCloseConfirm() {
|
|
50
|
+
if (currentDialog.value) {
|
|
51
|
+
currentDialog.value.confirmClose = true;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
49
54
|
function closeDialog(id) {
|
|
50
55
|
if (!id || currentDialog.value?.id === id) {
|
|
51
56
|
currentDialog.value = null;
|
|
@@ -382,6 +387,7 @@ export default function(providerElement, storage, context, element, mainLayoutEl
|
|
|
382
387
|
mainLayoutElement,
|
|
383
388
|
openDialog,
|
|
384
389
|
closeDialog,
|
|
385
|
-
currentDialog: readonly(currentDialog)
|
|
390
|
+
currentDialog: readonly(currentDialog),
|
|
391
|
+
requireDialogCloseConfirm
|
|
386
392
|
};
|
|
387
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";
|