@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,119 @@
|
|
|
1
|
+
import type { DraggableStyle } from '#blokkli/types';
|
|
2
|
+
import type { RGB, ThemeColorGroup, ThemeColorShade, ThemeColors, ThemeContextColorGroup, ThemeContextColorShade, ThemeContextColors, ThemeName } from '#blokkli/types/theme';
|
|
3
|
+
import { type Ref } from '#imports';
|
|
4
|
+
import type { ElementProvider } from './element.js';
|
|
5
|
+
type ThemeMap = {
|
|
6
|
+
accent: Ref<ThemeColors>;
|
|
7
|
+
mono: Ref<ThemeColors>;
|
|
8
|
+
teal: Ref<ThemeContextColors>;
|
|
9
|
+
yellow: Ref<ThemeContextColors>;
|
|
10
|
+
red: Ref<ThemeContextColors>;
|
|
11
|
+
lime: Ref<ThemeContextColors>;
|
|
12
|
+
orange: Ref<ThemeContextColors>;
|
|
13
|
+
};
|
|
14
|
+
export type ThemeProvider = {
|
|
15
|
+
/**
|
|
16
|
+
* Accent color palette (primary brand color).
|
|
17
|
+
*
|
|
18
|
+
* Available shades: 50-950
|
|
19
|
+
*/
|
|
20
|
+
accent: Ref<ThemeColors>;
|
|
21
|
+
/**
|
|
22
|
+
* Monochrome color palette (grays).
|
|
23
|
+
*
|
|
24
|
+
* Available shades: 50-950
|
|
25
|
+
*/
|
|
26
|
+
mono: Ref<ThemeColors>;
|
|
27
|
+
/**
|
|
28
|
+
* Teal context color palette.
|
|
29
|
+
*
|
|
30
|
+
* Available shades: bg, fg, fgHover, bgHover
|
|
31
|
+
*/
|
|
32
|
+
teal: Ref<ThemeContextColors>;
|
|
33
|
+
/**
|
|
34
|
+
* Yellow context color palette.
|
|
35
|
+
*
|
|
36
|
+
* Available shades: bg, fg, fgHover, bgHover
|
|
37
|
+
*/
|
|
38
|
+
yellow: Ref<ThemeContextColors>;
|
|
39
|
+
/**
|
|
40
|
+
* Red context color palette.
|
|
41
|
+
*
|
|
42
|
+
* Available shades: bg, fg, fgHover, bgHover
|
|
43
|
+
*/
|
|
44
|
+
red: Ref<ThemeContextColors>;
|
|
45
|
+
/**
|
|
46
|
+
* Lime context color palette.
|
|
47
|
+
*
|
|
48
|
+
* Available shades: bg, fg, fgHover, bgHover
|
|
49
|
+
*/
|
|
50
|
+
lime: Ref<ThemeContextColors>;
|
|
51
|
+
/**
|
|
52
|
+
* Orange context color palette.
|
|
53
|
+
*
|
|
54
|
+
* Available shades: bg, fg, fgHover, bgHover
|
|
55
|
+
*/
|
|
56
|
+
orange: Ref<ThemeContextColors>;
|
|
57
|
+
/**
|
|
58
|
+
* Get the draggable style for an element.
|
|
59
|
+
*
|
|
60
|
+
* Computes and caches the visual style to use when dragging this element.
|
|
61
|
+
* Includes background color, text color, and border radius.
|
|
62
|
+
*
|
|
63
|
+
* @param el - The element to get style for
|
|
64
|
+
* @returns The draggable style configuration
|
|
65
|
+
*/
|
|
66
|
+
getDraggableStyle: (el: HTMLElement | SVGElement) => DraggableStyle;
|
|
67
|
+
/**
|
|
68
|
+
* Set a theme color value.
|
|
69
|
+
*
|
|
70
|
+
* Updates both the reactive ref and the CSS custom property on :root.
|
|
71
|
+
*
|
|
72
|
+
* @param group - The color group (accent, mono, teal, etc.)
|
|
73
|
+
* @param shade - The shade (50-950 for accent/mono, bg/fg/etc for context colors)
|
|
74
|
+
* @param value - RGB color as [r, g, b] array
|
|
75
|
+
*/
|
|
76
|
+
setColor: <Group extends ThemeColorGroup | ThemeContextColorGroup>(group: Group, shade: Group extends ThemeColorGroup ? ThemeColorShade : ThemeContextColorShade, value: RGB) => void;
|
|
77
|
+
/**
|
|
78
|
+
* Apply a theme by name.
|
|
79
|
+
*
|
|
80
|
+
* Replaces all theme colors with the selected theme.
|
|
81
|
+
* Use 'custom' to restore previously customized colors.
|
|
82
|
+
*
|
|
83
|
+
* @param name - Theme name or 'custom' for customized theme
|
|
84
|
+
*/
|
|
85
|
+
applyTheme: (name: ThemeName | 'custom') => void;
|
|
86
|
+
/**
|
|
87
|
+
* Invalidate cached style for an element.
|
|
88
|
+
*
|
|
89
|
+
* Forces recalculation of draggable style next time it's requested.
|
|
90
|
+
* Useful when element styling changes dynamically.
|
|
91
|
+
*
|
|
92
|
+
* @param el - The element to invalidate
|
|
93
|
+
*/
|
|
94
|
+
invalidateCachedStyle: (el: HTMLElement | SVGElement) => void;
|
|
95
|
+
/**
|
|
96
|
+
* Get an RGB color value from the theme.
|
|
97
|
+
*
|
|
98
|
+
* @param color - The color group
|
|
99
|
+
* @param key - The shade key
|
|
100
|
+
* @returns RGB color as [r, g, b] array
|
|
101
|
+
*/
|
|
102
|
+
getColor<K extends keyof ThemeMap, T extends ThemeMap[K]['value']>(color: K, key: keyof T): RGB;
|
|
103
|
+
/**
|
|
104
|
+
* Get a color as an rgba() CSS string.
|
|
105
|
+
*
|
|
106
|
+
* @param color - The color group
|
|
107
|
+
* @param key - The shade key
|
|
108
|
+
* @param alpha - Optional alpha value (0-1, default: 1)
|
|
109
|
+
* @returns CSS rgba() string
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* theme.getColorString('accent', 700, 0.5) // 'rgba(59, 130, 246, 0.5)'
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
getColorString<K extends keyof ThemeMap, T extends ThemeMap[K]['value']>(color: K, key: keyof T, alpha?: number): string;
|
|
117
|
+
};
|
|
118
|
+
export default function (element: ElementProvider): ThemeProvider;
|
|
119
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { theme, themes } from "#blokkli-build/config";
|
|
2
2
|
import { ref, onMounted, onBeforeUnmount } from "#imports";
|
|
3
|
-
import { rgbaToString } from "
|
|
4
|
-
import { DragStyle } from "
|
|
5
|
-
import onBlokkliEvent from "
|
|
3
|
+
import { rgbaToString } from "../index.js";
|
|
4
|
+
import { DragStyle } from "../DragStyle/index.js";
|
|
5
|
+
import onBlokkliEvent from "../composables/onBlokkliEvent.js";
|
|
6
6
|
export default function(element) {
|
|
7
7
|
const rootElement = element.query(
|
|
8
8
|
document,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { TourItem } from '#blokkli/types';
|
|
2
|
+
import { type Ref } from '#imports';
|
|
3
|
+
type TourProviderFunction = () => TourItem[] | TourItem | undefined;
|
|
4
|
+
export type TourProvider = {
|
|
5
|
+
/**
|
|
6
|
+
* Register a tour provider function.
|
|
7
|
+
*
|
|
8
|
+
* The function will be called when tour items are requested.
|
|
9
|
+
* It can return a single tour item, an array of tour items, or undefined.
|
|
10
|
+
*
|
|
11
|
+
* @param fn - Function that returns tour item(s)
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* tour.add(() => ({
|
|
16
|
+
* id: 'welcome',
|
|
17
|
+
* title: 'Welcome',
|
|
18
|
+
* text: 'Welcome to the editor!',
|
|
19
|
+
* element: '.bk-main-canvas',
|
|
20
|
+
* }))
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
add: (fn: TourProviderFunction) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Unregister a tour provider function.
|
|
26
|
+
*
|
|
27
|
+
* Removes a previously registered function so it no longer provides tour items.
|
|
28
|
+
*
|
|
29
|
+
* @param fn - The function to remove (must be the same reference used in add)
|
|
30
|
+
*/
|
|
31
|
+
remove: (fn: TourProviderFunction) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Get all tour items from all registered providers.
|
|
34
|
+
*
|
|
35
|
+
* Calls all registered provider functions, flattens the results,
|
|
36
|
+
* and filters out undefined values.
|
|
37
|
+
*
|
|
38
|
+
* @returns Array of all available tour items
|
|
39
|
+
*/
|
|
40
|
+
getTourItems: () => TourItem[];
|
|
41
|
+
/**
|
|
42
|
+
* Whether a tour is currently active.
|
|
43
|
+
*
|
|
44
|
+
* Set to true when a tour starts, false when it ends.
|
|
45
|
+
*/
|
|
46
|
+
isTouring: Ref<boolean>;
|
|
47
|
+
};
|
|
48
|
+
export default function (): TourProvider;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { ComputedRef } from 'vue';
|
|
2
|
+
import type { FieldConfig, BlockBundleDefinition, EditableFieldConfig, BlockDefinitionInput, BlockDefinitionOptionsInput, DroppableFieldConfig, DraggableExistingBlock, EntityContext } from '../../types/index.js';
|
|
3
|
+
import type { AdapterContext, BlokkliAdapter } from '../../adapter/index.js';
|
|
4
|
+
import type { SelectionProvider } from './selection.js';
|
|
5
|
+
export type BlokkliBlockType = BlockBundleDefinition & {
|
|
6
|
+
definition: BlockDefinitionInput<BlockDefinitionOptionsInput, never[]> | undefined;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Base interface for configuration objects that can be mapped by entity context.
|
|
10
|
+
*
|
|
11
|
+
* Used by ConfigMap to organize configuration data by entity type, bundle, and name
|
|
12
|
+
* for efficient lookup.
|
|
13
|
+
*/
|
|
14
|
+
interface MappableConfig {
|
|
15
|
+
/**
|
|
16
|
+
* The entity type (e.g., 'paragraph', 'node', 'block_content').
|
|
17
|
+
*/
|
|
18
|
+
entityType: string;
|
|
19
|
+
/**
|
|
20
|
+
* The entity bundle (e.g., 'text', 'image', 'article').
|
|
21
|
+
*/
|
|
22
|
+
entityBundle: string;
|
|
23
|
+
/**
|
|
24
|
+
* The configuration name (typically a field name like 'field_paragraphs').
|
|
25
|
+
*/
|
|
26
|
+
name: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Efficient lookup map for configuration objects organized by entity context.
|
|
30
|
+
*
|
|
31
|
+
* Provides O(1) lookups by entity type, entity type + bundle, and
|
|
32
|
+
* entity type + bundle + name combinations. Used for field configurations,
|
|
33
|
+
* editable field configurations, and droppable field configurations.
|
|
34
|
+
*
|
|
35
|
+
* @template T - Configuration type extending MappableConfig
|
|
36
|
+
*/
|
|
37
|
+
declare class ConfigMap<T extends MappableConfig> {
|
|
38
|
+
private configs;
|
|
39
|
+
private mapEntityType;
|
|
40
|
+
private mapEntityTypeBundle;
|
|
41
|
+
private mapEntityTypeBundleName;
|
|
42
|
+
constructor(items: T[]);
|
|
43
|
+
/**
|
|
44
|
+
* Get all configurations for a specific entity type.
|
|
45
|
+
*
|
|
46
|
+
* @param entityType - The entity type to filter by
|
|
47
|
+
* @returns Array of matching configurations
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* // Get all field configs for paragraph entities
|
|
52
|
+
* const paragraphFields = fieldConfig.forEntityType('paragraph')
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
forEntityType(entityType: string): T[];
|
|
56
|
+
/**
|
|
57
|
+
* Get all configurations for a specific entity type and bundle combination.
|
|
58
|
+
*
|
|
59
|
+
* @param entityType - The entity type
|
|
60
|
+
* @param entityBundle - The entity bundle
|
|
61
|
+
* @returns Array of matching configurations
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* // Get all field configs for text paragraph bundle
|
|
66
|
+
* const textFields = fieldConfig.forEntityTypeAndBundle('paragraph', 'text')
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
forEntityTypeAndBundle(entityType: string, entityBundle: string): T[];
|
|
70
|
+
/**
|
|
71
|
+
* Get a specific configuration by entity type, bundle, and name.
|
|
72
|
+
*
|
|
73
|
+
* @param entityType - The entity type
|
|
74
|
+
* @param entityBundle - The entity bundle
|
|
75
|
+
* @param name - The configuration name (typically field name)
|
|
76
|
+
* @returns The matching configuration, or undefined if not found
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* // Get field config for specific field on text paragraph
|
|
81
|
+
* const config = fieldConfig.forName('paragraph', 'text', 'field_items')
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
forName(entityType: string, entityBundle: string, name: string): T | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Get all configurations.
|
|
87
|
+
*
|
|
88
|
+
* @returns Array of all configurations in the map
|
|
89
|
+
*/
|
|
90
|
+
all(): T[];
|
|
91
|
+
}
|
|
92
|
+
export type BlockDefinitionProvider = {
|
|
93
|
+
/**
|
|
94
|
+
* List of block bundles that contain nested blocks.
|
|
95
|
+
*
|
|
96
|
+
* A bundle is included if it has any field configurations
|
|
97
|
+
* where it can contain other blocks.
|
|
98
|
+
*/
|
|
99
|
+
itemBundlesWithNested: string[];
|
|
100
|
+
/**
|
|
101
|
+
* Allowed block types in the currently selected list.
|
|
102
|
+
*
|
|
103
|
+
* Computed based on the parent field of selected blocks.
|
|
104
|
+
* Returns empty array if:
|
|
105
|
+
* - No blocks are selected
|
|
106
|
+
* - Selected blocks are in different fields
|
|
107
|
+
*/
|
|
108
|
+
allowedTypesInList: ComputedRef<string[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Block bundles that can be used somewhere in the current context.
|
|
111
|
+
*
|
|
112
|
+
* Includes bundles allowed:
|
|
113
|
+
* - Directly on the current entity
|
|
114
|
+
* - In nested blocks allowed on the current entity
|
|
115
|
+
*
|
|
116
|
+
* Used for add dialogs, library, and other "available blocks" UIs.
|
|
117
|
+
*/
|
|
118
|
+
generallyAvailableBundles: BlockBundleDefinition[];
|
|
119
|
+
/**
|
|
120
|
+
* Get the bundle definition for a specific block type.
|
|
121
|
+
*
|
|
122
|
+
* @param bundle - The block bundle ID (e.g., 'text', 'image')
|
|
123
|
+
* @returns The bundle definition, or undefined if not found
|
|
124
|
+
*/
|
|
125
|
+
getBlockBundleDefinition: (bundle: string) => BlockBundleDefinition | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Get the field configuration for a specific field on an entity.
|
|
128
|
+
*
|
|
129
|
+
* Field configurations define allowed bundles, cardinality, and other
|
|
130
|
+
* field-level settings.
|
|
131
|
+
*
|
|
132
|
+
* @param entityType - The entity type
|
|
133
|
+
* @param entityBundle - The entity bundle
|
|
134
|
+
* @param fieldName - The field name
|
|
135
|
+
* @returns The field configuration, or undefined if not found
|
|
136
|
+
*/
|
|
137
|
+
getFieldConfig: (entityType: string, entityBundle: string, fieldName: string) => FieldConfig | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* Map of all field configurations.
|
|
140
|
+
*
|
|
141
|
+
* Provides efficient lookups by entity type, bundle, and field name.
|
|
142
|
+
*/
|
|
143
|
+
fieldConfig: ConfigMap<FieldConfig>;
|
|
144
|
+
/**
|
|
145
|
+
* Map of editable field configurations.
|
|
146
|
+
*
|
|
147
|
+
* Defines which fields support inline editing and their configuration.
|
|
148
|
+
*/
|
|
149
|
+
editableFieldConfig: ConfigMap<EditableFieldConfig>;
|
|
150
|
+
/**
|
|
151
|
+
* Map of droppable field configurations.
|
|
152
|
+
*
|
|
153
|
+
* Defines which fields can accept dropped blocks and their behavior.
|
|
154
|
+
*/
|
|
155
|
+
droppableFieldConfig: ConfigMap<DroppableFieldConfig>;
|
|
156
|
+
/**
|
|
157
|
+
* Get droppable field configuration for a field on a host.
|
|
158
|
+
*
|
|
159
|
+
* Throws an error if configuration is not found, as droppable fields
|
|
160
|
+
* should always have configuration when accessed.
|
|
161
|
+
*
|
|
162
|
+
* @param fieldName - The field name
|
|
163
|
+
* @param host - The host block or entity context
|
|
164
|
+
* @returns The droppable field configuration
|
|
165
|
+
* @throws Error if configuration not found
|
|
166
|
+
*/
|
|
167
|
+
getDroppableFieldConfig: (fieldName: string, host: DraggableExistingBlock | EntityContext) => DroppableFieldConfig;
|
|
168
|
+
};
|
|
169
|
+
export default function (adapter: BlokkliAdapter<any>, selection: SelectionProvider, context: ComputedRef<AdapterContext>): Promise<BlockDefinitionProvider>;
|
|
170
|
+
export {};
|
|
@@ -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
|
}
|