@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,349 @@
|
|
|
1
|
+
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
+
type DefinitionOptionText = {
|
|
3
|
+
/**
|
|
4
|
+
* The option type.
|
|
5
|
+
*/
|
|
6
|
+
type: 'text';
|
|
7
|
+
/**
|
|
8
|
+
* The default value.
|
|
9
|
+
*/
|
|
10
|
+
default: string;
|
|
11
|
+
/**
|
|
12
|
+
* The label displayed in the editor.
|
|
13
|
+
*/
|
|
14
|
+
label: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional description providing additional context.
|
|
17
|
+
*
|
|
18
|
+
* Displayed below the option label in the editor.
|
|
19
|
+
*/
|
|
20
|
+
description?: string;
|
|
21
|
+
/**
|
|
22
|
+
* The HTML input type.
|
|
23
|
+
*
|
|
24
|
+
* @default 'text'
|
|
25
|
+
*/
|
|
26
|
+
inputType?: 'text' | 'number' | 'date';
|
|
27
|
+
/**
|
|
28
|
+
* Optional group name for organizing options.
|
|
29
|
+
*
|
|
30
|
+
* Options with the same group are displayed together in a dropdown.
|
|
31
|
+
*/
|
|
32
|
+
group?: string;
|
|
33
|
+
};
|
|
34
|
+
type DefinitionOptionNumber = {
|
|
35
|
+
/**
|
|
36
|
+
* The option type.
|
|
37
|
+
*/
|
|
38
|
+
type: 'number';
|
|
39
|
+
/**
|
|
40
|
+
* The default value.
|
|
41
|
+
*/
|
|
42
|
+
default: number;
|
|
43
|
+
/**
|
|
44
|
+
* The label displayed in the editor.
|
|
45
|
+
*/
|
|
46
|
+
label: string;
|
|
47
|
+
/**
|
|
48
|
+
* Optional description providing additional context.
|
|
49
|
+
*
|
|
50
|
+
* Displayed below the option label in the editor.
|
|
51
|
+
*/
|
|
52
|
+
description?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Minimum allowed value.
|
|
55
|
+
*/
|
|
56
|
+
min: number;
|
|
57
|
+
/**
|
|
58
|
+
* Maximum allowed value.
|
|
59
|
+
*/
|
|
60
|
+
max: number;
|
|
61
|
+
/**
|
|
62
|
+
* Optional group name for organizing options.
|
|
63
|
+
*
|
|
64
|
+
* Options with the same group are displayed together in a dropdown.
|
|
65
|
+
*/
|
|
66
|
+
group?: string;
|
|
67
|
+
};
|
|
68
|
+
type DefinitionOptionRange = {
|
|
69
|
+
/**
|
|
70
|
+
* The option type.
|
|
71
|
+
*/
|
|
72
|
+
type: 'range';
|
|
73
|
+
/**
|
|
74
|
+
* The default value.
|
|
75
|
+
*/
|
|
76
|
+
default: number;
|
|
77
|
+
/**
|
|
78
|
+
* The label displayed in the editor.
|
|
79
|
+
*/
|
|
80
|
+
label: string;
|
|
81
|
+
/**
|
|
82
|
+
* Optional description providing additional context.
|
|
83
|
+
*
|
|
84
|
+
* Displayed below the option label in the editor.
|
|
85
|
+
*/
|
|
86
|
+
description?: string;
|
|
87
|
+
/**
|
|
88
|
+
* Minimum allowed value.
|
|
89
|
+
*/
|
|
90
|
+
min: number;
|
|
91
|
+
/**
|
|
92
|
+
* Maximum allowed value.
|
|
93
|
+
*/
|
|
94
|
+
max: number;
|
|
95
|
+
/**
|
|
96
|
+
* The step increment.
|
|
97
|
+
*/
|
|
98
|
+
step: number;
|
|
99
|
+
/**
|
|
100
|
+
* Optional group name for organizing options.
|
|
101
|
+
*
|
|
102
|
+
* Options with the same group are displayed together in a dropdown.
|
|
103
|
+
*/
|
|
104
|
+
group?: string;
|
|
105
|
+
};
|
|
106
|
+
type DefinitionOptionDateTimeLocal = {
|
|
107
|
+
/**
|
|
108
|
+
* The option type.
|
|
109
|
+
*/
|
|
110
|
+
type: 'datetime-local';
|
|
111
|
+
/**
|
|
112
|
+
* The label displayed in the editor.
|
|
113
|
+
*/
|
|
114
|
+
label: string;
|
|
115
|
+
/**
|
|
116
|
+
* Optional description providing additional context.
|
|
117
|
+
*
|
|
118
|
+
* Displayed below the option label in the editor.
|
|
119
|
+
*/
|
|
120
|
+
description?: string;
|
|
121
|
+
/**
|
|
122
|
+
* The default value as an ISO 8601 datetime string.
|
|
123
|
+
*
|
|
124
|
+
* @example '2024-03-15T14:30:00'
|
|
125
|
+
*/
|
|
126
|
+
default?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Minimum allowed datetime as an ISO 8601 string.
|
|
129
|
+
*/
|
|
130
|
+
min?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Maximum allowed datetime as an ISO 8601 string.
|
|
133
|
+
*/
|
|
134
|
+
max?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Optional group name for organizing options.
|
|
137
|
+
*
|
|
138
|
+
* Options with the same group are displayed together in a dropdown.
|
|
139
|
+
*/
|
|
140
|
+
group?: string;
|
|
141
|
+
};
|
|
142
|
+
type DefinitionOptionCheckbox = {
|
|
143
|
+
/**
|
|
144
|
+
* The option type.
|
|
145
|
+
*/
|
|
146
|
+
type: 'checkbox';
|
|
147
|
+
/**
|
|
148
|
+
* The default value.
|
|
149
|
+
*/
|
|
150
|
+
default: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* The label displayed in the editor.
|
|
153
|
+
*/
|
|
154
|
+
label: string;
|
|
155
|
+
/**
|
|
156
|
+
* Optional description providing additional context.
|
|
157
|
+
*
|
|
158
|
+
* Displayed below the option label in the editor.
|
|
159
|
+
*/
|
|
160
|
+
description?: string;
|
|
161
|
+
/**
|
|
162
|
+
* Optional group name for organizing options.
|
|
163
|
+
*
|
|
164
|
+
* Options with the same group are displayed together in a dropdown.
|
|
165
|
+
*/
|
|
166
|
+
group?: string;
|
|
167
|
+
};
|
|
168
|
+
type DefinitionOptionColor = {
|
|
169
|
+
/**
|
|
170
|
+
* The option type.
|
|
171
|
+
*/
|
|
172
|
+
type: 'color';
|
|
173
|
+
/**
|
|
174
|
+
* The default value as a HEX color string.
|
|
175
|
+
*
|
|
176
|
+
* @example '#ff0000'
|
|
177
|
+
*/
|
|
178
|
+
default: `#${string}`;
|
|
179
|
+
/**
|
|
180
|
+
* The label displayed in the editor.
|
|
181
|
+
*/
|
|
182
|
+
label: string;
|
|
183
|
+
/**
|
|
184
|
+
* Optional description providing additional context.
|
|
185
|
+
*
|
|
186
|
+
* Displayed below the option label in the editor.
|
|
187
|
+
*/
|
|
188
|
+
description?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Optional group name for organizing options.
|
|
191
|
+
*
|
|
192
|
+
* Options with the same group are displayed together in a dropdown.
|
|
193
|
+
*/
|
|
194
|
+
group?: string;
|
|
195
|
+
};
|
|
196
|
+
type DefinitionOptionCheckboxes = {
|
|
197
|
+
/**
|
|
198
|
+
* The option type.
|
|
199
|
+
*/
|
|
200
|
+
type: 'checkboxes';
|
|
201
|
+
/**
|
|
202
|
+
* The label displayed in the editor.
|
|
203
|
+
*/
|
|
204
|
+
label: string;
|
|
205
|
+
/**
|
|
206
|
+
* Optional description providing additional context.
|
|
207
|
+
*
|
|
208
|
+
* Displayed below the option label in the editor.
|
|
209
|
+
*/
|
|
210
|
+
description?: string;
|
|
211
|
+
/**
|
|
212
|
+
* The default values.
|
|
213
|
+
*/
|
|
214
|
+
default: string[];
|
|
215
|
+
/**
|
|
216
|
+
* Available options.
|
|
217
|
+
*
|
|
218
|
+
* Key is the option value, value is the display label.
|
|
219
|
+
*/
|
|
220
|
+
options: Record<string, string>;
|
|
221
|
+
/**
|
|
222
|
+
* Optional group name for organizing options.
|
|
223
|
+
*
|
|
224
|
+
* Options with the same group are displayed together in a dropdown.
|
|
225
|
+
*/
|
|
226
|
+
group?: string;
|
|
227
|
+
};
|
|
228
|
+
type DefinitionOptionRadiosGridOption = {
|
|
229
|
+
/**
|
|
230
|
+
* Column widths as flex-grow values.
|
|
231
|
+
*
|
|
232
|
+
* @example [1, 2] for a 1:2 ratio
|
|
233
|
+
*/
|
|
234
|
+
columns: number[];
|
|
235
|
+
/**
|
|
236
|
+
* The label displayed for this option.
|
|
237
|
+
*/
|
|
238
|
+
label: string;
|
|
239
|
+
};
|
|
240
|
+
type DefinitionOptionRadiosGrid = {
|
|
241
|
+
/**
|
|
242
|
+
* Display options as grid layouts.
|
|
243
|
+
*/
|
|
244
|
+
displayAs: 'grid';
|
|
245
|
+
/**
|
|
246
|
+
* Available options.
|
|
247
|
+
*
|
|
248
|
+
* Key is the option value, value is the grid configuration.
|
|
249
|
+
*/
|
|
250
|
+
options: Record<string, DefinitionOptionRadiosGridOption>;
|
|
251
|
+
};
|
|
252
|
+
type DefinitionOptionRadiosColorsOption = {
|
|
253
|
+
/**
|
|
254
|
+
* Optional HEX color value.
|
|
255
|
+
*
|
|
256
|
+
* @example '#ff0000'
|
|
257
|
+
*/
|
|
258
|
+
hex?: `#${string}`;
|
|
259
|
+
/**
|
|
260
|
+
* Optional CSS class for the color.
|
|
261
|
+
*
|
|
262
|
+
* Used as fallback when hex is not provided.
|
|
263
|
+
*/
|
|
264
|
+
class?: string;
|
|
265
|
+
/**
|
|
266
|
+
* The label displayed for this option.
|
|
267
|
+
*/
|
|
268
|
+
label: string;
|
|
269
|
+
};
|
|
270
|
+
type DefinitionOptionRadiosColors = {
|
|
271
|
+
/**
|
|
272
|
+
* Display options as color swatches.
|
|
273
|
+
*/
|
|
274
|
+
displayAs: 'colors';
|
|
275
|
+
/**
|
|
276
|
+
* Available color options.
|
|
277
|
+
*
|
|
278
|
+
* Key is the option value, value is the color configuration.
|
|
279
|
+
*/
|
|
280
|
+
options: Record<string, DefinitionOptionRadiosColorsOption>;
|
|
281
|
+
};
|
|
282
|
+
type DefinitionOptionRadiosRadios = {
|
|
283
|
+
/**
|
|
284
|
+
* Display options as radio buttons.
|
|
285
|
+
*
|
|
286
|
+
* @default 'radios'
|
|
287
|
+
*/
|
|
288
|
+
displayAs?: 'radios' | undefined;
|
|
289
|
+
/**
|
|
290
|
+
* Available options.
|
|
291
|
+
*
|
|
292
|
+
* Key is the option value, value is the display label.
|
|
293
|
+
*/
|
|
294
|
+
options: Record<string, string>;
|
|
295
|
+
};
|
|
296
|
+
type DefinitionOptionRadiosIconsOption = {
|
|
297
|
+
/**
|
|
298
|
+
* The icon to display.
|
|
299
|
+
*
|
|
300
|
+
* Icon files must be in the same folder as the component and start with 'icon-blokkli-'.
|
|
301
|
+
*/
|
|
302
|
+
icon: BlokkliIcon;
|
|
303
|
+
/**
|
|
304
|
+
* The label displayed for this option.
|
|
305
|
+
*/
|
|
306
|
+
label: string;
|
|
307
|
+
};
|
|
308
|
+
type DefinitionOptionRadiosIcons = {
|
|
309
|
+
/**
|
|
310
|
+
* Display options as icons.
|
|
311
|
+
*/
|
|
312
|
+
displayAs: 'icons';
|
|
313
|
+
/**
|
|
314
|
+
* Available icon options.
|
|
315
|
+
*
|
|
316
|
+
* Key is the option value, value is the icon configuration.
|
|
317
|
+
*/
|
|
318
|
+
options: Record<string, DefinitionOptionRadiosIconsOption>;
|
|
319
|
+
};
|
|
320
|
+
type DefinitionOptionRadios = {
|
|
321
|
+
/**
|
|
322
|
+
* The option type.
|
|
323
|
+
*/
|
|
324
|
+
type: 'radios';
|
|
325
|
+
/**
|
|
326
|
+
* The label displayed in the editor.
|
|
327
|
+
*/
|
|
328
|
+
label: string;
|
|
329
|
+
/**
|
|
330
|
+
* Optional description providing additional context.
|
|
331
|
+
*
|
|
332
|
+
* Displayed below the option label in the editor.
|
|
333
|
+
*/
|
|
334
|
+
description?: string;
|
|
335
|
+
/**
|
|
336
|
+
* The default value.
|
|
337
|
+
*
|
|
338
|
+
* Must be one of the option keys.
|
|
339
|
+
*/
|
|
340
|
+
default: string;
|
|
341
|
+
/**
|
|
342
|
+
* Optional group name for organizing options.
|
|
343
|
+
*
|
|
344
|
+
* Options with the same group are displayed together in a dropdown.
|
|
345
|
+
*/
|
|
346
|
+
group?: string;
|
|
347
|
+
} & (DefinitionOptionRadiosColors | DefinitionOptionRadiosGrid | DefinitionOptionRadiosRadios | DefinitionOptionRadiosIcons);
|
|
348
|
+
export type BlockOptionDefinition = DefinitionOptionColor | DefinitionOptionCheckbox | DefinitionOptionCheckboxes | DefinitionOptionRadios | DefinitionOptionText | DefinitionOptionRange | DefinitionOptionNumber | DefinitionOptionDateTimeLocal;
|
|
349
|
+
export {};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import type { ComputedRef } from 'vue';
|
|
2
2
|
import type { Emitter } from 'mitt';
|
|
3
|
-
import type { DomProvider } from '../helpers/
|
|
4
|
-
import type { StorageProvider } from '../helpers/
|
|
5
|
-
import type { BlockDefinitionProvider } from '../helpers/
|
|
6
|
-
import type { SelectionProvider } from '../helpers/
|
|
7
|
-
import type { KeyboardProvider } from '../helpers/
|
|
8
|
-
import type { UiProvider } from '../helpers/
|
|
9
|
-
import type { AnimationProvider } from '../helpers/
|
|
10
|
-
import type { StateProvider } from '../helpers/
|
|
3
|
+
import type { DomProvider } from '../helpers/providers/dom.js';
|
|
4
|
+
import type { StorageProvider } from '../helpers/providers/storage.js';
|
|
5
|
+
import type { BlockDefinitionProvider } from '../helpers/providers/types.js';
|
|
6
|
+
import type { SelectionProvider } from '../helpers/providers/selection.js';
|
|
7
|
+
import type { KeyboardProvider } from '../helpers/providers/keyboard.js';
|
|
8
|
+
import type { UiProvider } from '../helpers/providers/ui.js';
|
|
9
|
+
import type { AnimationProvider } from '../helpers/providers/animation.js';
|
|
10
|
+
import type { StateProvider } from '../helpers/providers/state.js';
|
|
11
11
|
import type { DirectiveProvider } from '../helpers/providers/directive.js';
|
|
12
|
-
import type { TextProvider } from '../helpers/
|
|
13
|
-
import type { PluginProvider } from '../helpers/
|
|
12
|
+
import type { TextProvider } from '../helpers/providers/texts.js';
|
|
13
|
+
import type { PluginProvider } from '../helpers/providers/plugin.js';
|
|
14
14
|
import type { eventBus } from './../helpers/eventBus.js';
|
|
15
|
-
import type { BlockOptionDefinition } from './
|
|
15
|
+
import type { BlockOptionDefinition } from './blockOptions.js';
|
|
16
16
|
import type { BlokkliAdapter, AdapterContext, MutationResponseLike } from './../adapter/index.js';
|
|
17
|
-
import type { BroadcastProvider } from '
|
|
18
|
-
import type { FeaturesProvider } from '
|
|
17
|
+
import type { BroadcastProvider } from '../helpers/providers/broadcast.js';
|
|
18
|
+
import type { FeaturesProvider } from '../helpers/providers/features.js';
|
|
19
19
|
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
20
20
|
import type { SettingsGroup, Viewport } from '#blokkli/constants';
|
|
21
21
|
import type { BlockBundleWithNested, FieldListItemTyped, GlobalOptionsKey, ValidChunkNames, ValidFieldListTypes, ValidGlobalConfigKeys, BundleProps } from '#blokkli-build/generated-types';
|
|
22
|
-
import type { ThemeProvider } from '
|
|
22
|
+
import type { ThemeProvider } from '../helpers/providers/theme.js';
|
|
23
23
|
import type { BlokkliFragmentName, GlobalOptionsType } from '#blokkli-build/definitions';
|
|
24
|
-
import type { CommandsProvider } from '
|
|
25
|
-
import type { TourProvider } from '
|
|
26
|
-
import type { DropAreaProvider } from '
|
|
24
|
+
import type { CommandsProvider } from '../helpers/providers/commands.js';
|
|
25
|
+
import type { TourProvider } from '../helpers/providers/tour.js';
|
|
26
|
+
import type { DropAreaProvider } from '../helpers/providers/dropArea.js';
|
|
27
27
|
import type { RGB } from './theme.js';
|
|
28
|
-
import type { DebugProvider } from '
|
|
28
|
+
import type { DebugProvider } from '../helpers/providers/debug.js';
|
|
29
29
|
import type getVideoId from 'get-video-id';
|
|
30
|
-
import type { DefinitionProvider } from '../helpers/
|
|
31
|
-
import type { IndicatorsProvider } from '
|
|
30
|
+
import type { DefinitionProvider } from '../helpers/providers/definition.js';
|
|
31
|
+
import type { IndicatorsProvider } from '../helpers/providers/indicators.js';
|
|
32
32
|
import type { BlocksProvider } from '#blokkli/helpers/providers/blocks';
|
|
33
33
|
import type { FieldsProvider } from '#blokkli/helpers/providers/fields';
|
|
34
34
|
import type { ElementProvider } from '#blokkli/helpers/providers/element';
|
|
@@ -204,12 +204,7 @@ export type BlokkliDefinitionInputEditor<Options extends BlockDefinitionOptionsI
|
|
|
204
204
|
/**
|
|
205
205
|
* Get the drag element for the editor.
|
|
206
206
|
*
|
|
207
|
-
*
|
|
208
|
-
* Sometimes this might not be desirable however. For example, a button
|
|
209
|
-
* block might render a container as the root element and have the button
|
|
210
|
-
* as the child. In this case the whole container would be clickable and
|
|
211
|
-
* selectable. By providing the button as the drag element, only the button
|
|
212
|
-
* appears to be selectable/draggable.
|
|
207
|
+
* @deprecated Use a ref in the template to designate the draggable element (e.g. <div ref="blokkliDraggable">).
|
|
213
208
|
*/
|
|
214
209
|
getDraggableElement?: (el: HTMLElement) => Element | undefined | null;
|
|
215
210
|
/**
|
|
@@ -707,6 +702,7 @@ export interface DraggableNewItem {
|
|
|
707
702
|
export interface DraggableActionItem {
|
|
708
703
|
itemType: 'action';
|
|
709
704
|
actionType: string;
|
|
705
|
+
action: AddAction;
|
|
710
706
|
itemBundle?: string;
|
|
711
707
|
element: () => HTMLElement;
|
|
712
708
|
}
|
|
@@ -909,8 +905,7 @@ export type BlokkliFieldElement = {
|
|
|
909
905
|
dropAlignment: FieldDropAlignment | null;
|
|
910
906
|
};
|
|
911
907
|
export type FieldDropAlignment = 'vertical' | 'horizontal';
|
|
912
|
-
export type
|
|
913
|
-
id: string;
|
|
908
|
+
export type ActionPlacedData = {
|
|
914
909
|
preceedingUuid?: string;
|
|
915
910
|
host: DraggableHostData;
|
|
916
911
|
field: BlokkliFieldElement;
|
|
@@ -1006,6 +1001,7 @@ export type EventbusEvents = {
|
|
|
1006
1001
|
'select:toggle': string;
|
|
1007
1002
|
'select:shiftToggle': string;
|
|
1008
1003
|
'select:end': string[] | undefined;
|
|
1004
|
+
'overlay:close': undefined;
|
|
1009
1005
|
'item:dropped': undefined;
|
|
1010
1006
|
'block:append': BlockAppendEvent;
|
|
1011
1007
|
'item:doubleClick': RenderedFieldListItem;
|
|
@@ -1029,7 +1025,6 @@ export type EventbusEvents = {
|
|
|
1029
1025
|
'drop:clipboardItem': DropClipboardItemEvent;
|
|
1030
1026
|
'sidebar:close': undefined;
|
|
1031
1027
|
'sidebar:open': string;
|
|
1032
|
-
'action:placed': ActionPlacedEvent;
|
|
1033
1028
|
'action:selected': undefined;
|
|
1034
1029
|
'animator:add': AnimatorAddEvent;
|
|
1035
1030
|
'ui:resized': undefined;
|
|
@@ -1126,7 +1121,6 @@ export type AssistantResultMarkup = {
|
|
|
1126
1121
|
content: string;
|
|
1127
1122
|
};
|
|
1128
1123
|
export type AssistantResult = AssistantResultMarkup;
|
|
1129
|
-
export type AddListOrientation = 'horizontal' | 'vertical' | 'sidebar';
|
|
1130
1124
|
export type AdapterMethods = keyof BlokkliAdapter<any>;
|
|
1131
1125
|
export type FeatureDefinitionSettingRadiosOption = {
|
|
1132
1126
|
label: string;
|
|
@@ -1359,7 +1353,8 @@ export type AddAction = {
|
|
|
1359
1353
|
itemBundle?: string;
|
|
1360
1354
|
title: string;
|
|
1361
1355
|
description?: string;
|
|
1362
|
-
|
|
1356
|
+
callback: (action: ActionPlacedData) => void;
|
|
1357
|
+
enabled?: (item: RenderedFieldListItem) => boolean;
|
|
1363
1358
|
};
|
|
1364
1359
|
export type BlockEditContext = {
|
|
1365
1360
|
isPublished: boolean;
|
|
@@ -1382,6 +1377,9 @@ export type RenderedFieldListItem = {
|
|
|
1382
1377
|
libraryItemUuid: string;
|
|
1383
1378
|
reusableBundle: string;
|
|
1384
1379
|
} | null;
|
|
1380
|
+
fragment: {
|
|
1381
|
+
name: BlokkliFragmentName;
|
|
1382
|
+
} | null;
|
|
1385
1383
|
isNested: boolean;
|
|
1386
1384
|
publishOn?: string | null;
|
|
1387
1385
|
unpublishOn?: string | null;
|
|
@@ -1400,5 +1398,10 @@ export type RegisteredField = {
|
|
|
1400
1398
|
export type RegisterFieldData = Pick<RegisteredField, 'fieldListType' | 'allowedFragments' | 'isNested' | 'nestingLevel' | 'dropAlignment'>;
|
|
1401
1399
|
export type VueClassProp = string | Record<string, boolean> | VueClassProp[];
|
|
1402
1400
|
export type SidebarRegion = 'left' | 'right';
|
|
1401
|
+
export type GlobalUiDialog = {
|
|
1402
|
+
id: string;
|
|
1403
|
+
alignment: 'left' | 'right' | 'center';
|
|
1404
|
+
confirmClose?: boolean;
|
|
1405
|
+
};
|
|
1403
1406
|
declare const _default: {};
|
|
1404
1407
|
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blokkli/editor",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.25",
|
|
4
4
|
"description": "Interactive page building experience for Nuxt",
|
|
5
5
|
"repository": "blokkli/editor",
|
|
6
6
|
"type": "module",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"license": "MIT",
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@types/micromatch": "^4.0.9",
|
|
60
|
-
"artboard-deluxe": "
|
|
60
|
+
"artboard-deluxe": "0.1.3",
|
|
61
61
|
"estree-walker-ts": "^1.1.0",
|
|
62
62
|
"flesch": "^2.0.1",
|
|
63
63
|
"fzf": "^0.5.2",
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Teleport v-if="shouldRender" :key="renderKey" to="#blokkli-add-list-actions">
|
|
3
|
-
<AddListItem
|
|
4
|
-
:id="type"
|
|
5
|
-
ref="item"
|
|
6
|
-
:label="title"
|
|
7
|
-
:icon="icon"
|
|
8
|
-
:orientation="ui.addListOrientation.value"
|
|
9
|
-
:color="color"
|
|
10
|
-
:disabled="disabled"
|
|
11
|
-
data-element-type="action"
|
|
12
|
-
:data-action-type="type"
|
|
13
|
-
:data-item-bundle="itemBundle"
|
|
14
|
-
no-context-menu
|
|
15
|
-
/>
|
|
16
|
-
</Teleport>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<script setup>
|
|
20
|
-
import {
|
|
21
|
-
computed,
|
|
22
|
-
useBlokkli,
|
|
23
|
-
nextTick,
|
|
24
|
-
ref,
|
|
25
|
-
onMounted,
|
|
26
|
-
onBeforeUnmount
|
|
27
|
-
} from "#imports";
|
|
28
|
-
import { AddListItem } from "#blokkli/components";
|
|
29
|
-
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
30
|
-
import defineTourItem from "#blokkli/helpers/composables/defineTourItem";
|
|
31
|
-
const props = defineProps({
|
|
32
|
-
type: { type: String, required: true },
|
|
33
|
-
title: { type: String, required: true },
|
|
34
|
-
icon: { type: null, required: true },
|
|
35
|
-
itemBundle: { type: String, required: false },
|
|
36
|
-
color: { type: String, required: true },
|
|
37
|
-
description: { type: String, required: false },
|
|
38
|
-
disabled: { type: Boolean, required: false },
|
|
39
|
-
weight: { type: Number, required: false }
|
|
40
|
-
});
|
|
41
|
-
const item = ref(null);
|
|
42
|
-
const emit = defineEmits(["placed"]);
|
|
43
|
-
const { ui, state, features, plugins } = useBlokkli();
|
|
44
|
-
const addListAvailable = computed(
|
|
45
|
-
() => !!features.mountedFeatures.value.find((v) => v.id === "add-list")
|
|
46
|
-
);
|
|
47
|
-
const shouldRender = computed(
|
|
48
|
-
() => addListAvailable.value && state.editMode.value === "editing"
|
|
49
|
-
);
|
|
50
|
-
const renderKey = ref("");
|
|
51
|
-
onBlokkliEvent("add-list:change", () => {
|
|
52
|
-
nextTick(() => {
|
|
53
|
-
renderKey.value = Math.round(Math.random() * 1e9).toString();
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
onBlokkliEvent("action:placed", (e) => {
|
|
57
|
-
if (e.id !== props.type) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
emit("placed", e);
|
|
61
|
-
});
|
|
62
|
-
defineTourItem(() => {
|
|
63
|
-
if (!props.description) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
return {
|
|
67
|
-
id: "plugin:add_action:" + props.type,
|
|
68
|
-
title: props.title,
|
|
69
|
-
text: props.description,
|
|
70
|
-
element: () => item.value?.getElement()
|
|
71
|
-
};
|
|
72
|
-
});
|
|
73
|
-
function addActionFunction() {
|
|
74
|
-
return {
|
|
75
|
-
id: props.type,
|
|
76
|
-
icon: props.icon,
|
|
77
|
-
color: props.color,
|
|
78
|
-
itemBundle: props.itemBundle,
|
|
79
|
-
title: props.title,
|
|
80
|
-
description: props.description,
|
|
81
|
-
enabled: !props.disabled
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
onMounted(() => {
|
|
85
|
-
plugins.addAddAction(addActionFunction);
|
|
86
|
-
});
|
|
87
|
-
onBeforeUnmount(() => {
|
|
88
|
-
plugins.removeAddAction(addActionFunction);
|
|
89
|
-
});
|
|
90
|
-
</script>
|
|
91
|
-
|
|
92
|
-
<script>
|
|
93
|
-
export default {
|
|
94
|
-
name: "PluginAddAction"
|
|
95
|
-
};
|
|
96
|
-
</script>
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
-
import type { ActionPlacedEvent } from '#blokkli/types';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<{
|
|
4
|
-
type: string;
|
|
5
|
-
title: string;
|
|
6
|
-
icon: BlokkliIcon;
|
|
7
|
-
itemBundle?: string;
|
|
8
|
-
color: "rose" | "lime" | "accent";
|
|
9
|
-
description?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
weight?: number;
|
|
12
|
-
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
13
|
-
placed: (data: ActionPlacedEvent) => any;
|
|
14
|
-
}, string, import("vue").PublicProps, Readonly<{
|
|
15
|
-
type: string;
|
|
16
|
-
title: string;
|
|
17
|
-
icon: BlokkliIcon;
|
|
18
|
-
itemBundle?: string;
|
|
19
|
-
color: "rose" | "lime" | "accent";
|
|
20
|
-
description?: string;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
weight?: number;
|
|
23
|
-
}> & Readonly<{
|
|
24
|
-
onPlaced?: ((data: ActionPlacedEvent) => any) | undefined;
|
|
25
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
26
|
-
export default _default;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<Teleport :to="to">
|
|
3
|
-
<button
|
|
4
|
-
:id="'bk-menu-list-button-' + id"
|
|
5
|
-
class="bk-menu-list-button"
|
|
6
|
-
:disabled="disabled"
|
|
7
|
-
:class="type ? 'bk-is-' + type : ''"
|
|
8
|
-
:style="{ order: weight || 0 }"
|
|
9
|
-
@click.prevent.stop="onClick"
|
|
10
|
-
>
|
|
11
|
-
<div class="bk-menu-list-icon">
|
|
12
|
-
<slot>
|
|
13
|
-
<Icon v-if="icon" :name="icon" />
|
|
14
|
-
</slot>
|
|
15
|
-
</div>
|
|
16
|
-
<strong>{{ title }}</strong>
|
|
17
|
-
<span>{{ description }}</span>
|
|
18
|
-
</button>
|
|
19
|
-
</Teleport>
|
|
20
|
-
</template>
|
|
21
|
-
|
|
22
|
-
<script setup>
|
|
23
|
-
import { computed, useBlokkli } from "#imports";
|
|
24
|
-
import { Icon } from "#blokkli/components";
|
|
25
|
-
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
26
|
-
const props = defineProps({
|
|
27
|
-
id: { type: String, required: true },
|
|
28
|
-
title: { type: String, required: true },
|
|
29
|
-
description: { type: String, required: true },
|
|
30
|
-
disabled: { type: Boolean, required: false },
|
|
31
|
-
icon: { type: null, required: false },
|
|
32
|
-
type: { type: String, required: false },
|
|
33
|
-
weight: { type: Number, required: false },
|
|
34
|
-
secondary: { type: Boolean, required: false }
|
|
35
|
-
});
|
|
36
|
-
const emit = defineEmits(["click"]);
|
|
37
|
-
const { ui, debug } = useBlokkli();
|
|
38
|
-
const logger = debug.createLogger("PluginMenuButton");
|
|
39
|
-
const to = computed(
|
|
40
|
-
() => `#bk-menu-${props.secondary ? "secondary" : "primary"}`
|
|
41
|
-
);
|
|
42
|
-
function onClick() {
|
|
43
|
-
ui.menu.close();
|
|
44
|
-
logger.log("Click " + props.id);
|
|
45
|
-
emit("click");
|
|
46
|
-
}
|
|
47
|
-
const commandCallback = () => {
|
|
48
|
-
if (!props.disabled) {
|
|
49
|
-
emit("click");
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
defineCommands(() => {
|
|
53
|
-
return {
|
|
54
|
-
id: "plugin:menu_button:" + props.id,
|
|
55
|
-
group: "action",
|
|
56
|
-
label: props.title,
|
|
57
|
-
icon: props.icon,
|
|
58
|
-
disabled: props.disabled,
|
|
59
|
-
callback: commandCallback
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<script>
|
|
65
|
-
export default {
|
|
66
|
-
name: "PluginMenuButton"
|
|
67
|
-
};
|
|
68
|
-
</script>
|