@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
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
+
/**
|
|
3
|
+
* Unique identifier for this tour item.
|
|
4
|
+
*/
|
|
2
5
|
id: string;
|
|
6
|
+
/**
|
|
7
|
+
* The title of the tour step.
|
|
8
|
+
*/
|
|
3
9
|
title: string;
|
|
10
|
+
/**
|
|
11
|
+
* The description text explaining this feature.
|
|
12
|
+
*
|
|
13
|
+
* Supports markdown.
|
|
14
|
+
*/
|
|
4
15
|
text: string;
|
|
16
|
+
/**
|
|
17
|
+
* Optional CSS selector to find the target element.
|
|
18
|
+
*
|
|
19
|
+
* If provided, the tour will highlight this element.
|
|
20
|
+
*/
|
|
5
21
|
selector?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Optional direct reference to the target element.
|
|
24
|
+
*
|
|
25
|
+
* Takes precedence over selector.
|
|
26
|
+
*/
|
|
27
|
+
element?: HTMLElement | null;
|
|
6
28
|
};
|
|
7
29
|
declare var __VLS_1: {};
|
|
8
30
|
type __VLS_Slots = {} & {
|
|
@@ -1,27 +1,125 @@
|
|
|
1
1
|
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
2
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
3
|
+
/**
|
|
4
|
+
* Unique identifier for this view option.
|
|
5
|
+
*
|
|
6
|
+
* Used for storage key and event tracking.
|
|
7
|
+
*/
|
|
3
8
|
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* The label used in commands and tour.
|
|
11
|
+
*/
|
|
4
12
|
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* The tooltip text when the option is OFF.
|
|
15
|
+
*
|
|
16
|
+
* Should describe what happens when turned on.
|
|
17
|
+
* @example 'Show grid'
|
|
18
|
+
*/
|
|
5
19
|
titleOn: string;
|
|
20
|
+
/**
|
|
21
|
+
* The tooltip text when the option is ON.
|
|
22
|
+
*
|
|
23
|
+
* Should describe what happens when turned off.
|
|
24
|
+
* @example 'Hide grid'
|
|
25
|
+
*/
|
|
6
26
|
titleOff: string;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the view option is only available in edit mode.
|
|
29
|
+
*
|
|
30
|
+
* If true, the option is hidden in preview mode.
|
|
31
|
+
*/
|
|
7
32
|
editOnly?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* The key code to use for the keyboard shortcut.
|
|
35
|
+
*
|
|
36
|
+
* Automatically includes Meta modifier.
|
|
37
|
+
* @example 'g' for Cmd+G / Ctrl+G
|
|
38
|
+
*/
|
|
8
39
|
keyCode?: string;
|
|
40
|
+
/**
|
|
41
|
+
* The icon displayed in the button.
|
|
42
|
+
*/
|
|
9
43
|
icon?: BlokkliIcon;
|
|
44
|
+
/**
|
|
45
|
+
* Optional text for the interactive tour.
|
|
46
|
+
*
|
|
47
|
+
* If provided, this option will be included in the editor tour.
|
|
48
|
+
*/
|
|
10
49
|
tourText?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Two-way binding for the active state.
|
|
52
|
+
*
|
|
53
|
+
* Can be used with v-model to track the option state.
|
|
54
|
+
*/
|
|
11
55
|
modelValue?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* The weight, used for positioning the button.
|
|
58
|
+
*
|
|
59
|
+
* Lower weights appear first.
|
|
60
|
+
*/
|
|
12
61
|
weight?: number | string;
|
|
13
62
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
14
63
|
"update:modelValue": (data: boolean) => any;
|
|
15
64
|
}, string, import("vue").PublicProps, Readonly<{
|
|
65
|
+
/**
|
|
66
|
+
* Unique identifier for this view option.
|
|
67
|
+
*
|
|
68
|
+
* Used for storage key and event tracking.
|
|
69
|
+
*/
|
|
16
70
|
id: string;
|
|
71
|
+
/**
|
|
72
|
+
* The label used in commands and tour.
|
|
73
|
+
*/
|
|
17
74
|
label: string;
|
|
75
|
+
/**
|
|
76
|
+
* The tooltip text when the option is OFF.
|
|
77
|
+
*
|
|
78
|
+
* Should describe what happens when turned on.
|
|
79
|
+
* @example 'Show grid'
|
|
80
|
+
*/
|
|
18
81
|
titleOn: string;
|
|
82
|
+
/**
|
|
83
|
+
* The tooltip text when the option is ON.
|
|
84
|
+
*
|
|
85
|
+
* Should describe what happens when turned off.
|
|
86
|
+
* @example 'Hide grid'
|
|
87
|
+
*/
|
|
19
88
|
titleOff: string;
|
|
89
|
+
/**
|
|
90
|
+
* Whether the view option is only available in edit mode.
|
|
91
|
+
*
|
|
92
|
+
* If true, the option is hidden in preview mode.
|
|
93
|
+
*/
|
|
20
94
|
editOnly?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* The key code to use for the keyboard shortcut.
|
|
97
|
+
*
|
|
98
|
+
* Automatically includes Meta modifier.
|
|
99
|
+
* @example 'g' for Cmd+G / Ctrl+G
|
|
100
|
+
*/
|
|
21
101
|
keyCode?: string;
|
|
102
|
+
/**
|
|
103
|
+
* The icon displayed in the button.
|
|
104
|
+
*/
|
|
22
105
|
icon?: BlokkliIcon;
|
|
106
|
+
/**
|
|
107
|
+
* Optional text for the interactive tour.
|
|
108
|
+
*
|
|
109
|
+
* If provided, this option will be included in the editor tour.
|
|
110
|
+
*/
|
|
23
111
|
tourText?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Two-way binding for the active state.
|
|
114
|
+
*
|
|
115
|
+
* Can be used with v-model to track the option state.
|
|
116
|
+
*/
|
|
24
117
|
modelValue?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The weight, used for positioning the button.
|
|
120
|
+
*
|
|
121
|
+
* Lower weights appear first.
|
|
122
|
+
*/
|
|
25
123
|
weight?: number | string;
|
|
26
124
|
}> & Readonly<{
|
|
27
125
|
"onUpdate:modelValue"?: ((data: boolean) => any) | undefined;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import PluginAddAction from './AddAction/index.vue.js';
|
|
2
1
|
import PluginBlockIndicator from './BlockIndicator/index.vue.js';
|
|
3
2
|
import PluginContextMenu from './ContextMenu/index.vue.js';
|
|
4
3
|
import PluginDebugOverlay from './DebugOverlay/index.vue.js';
|
|
5
4
|
import PluginItemAction from './ItemAction/index.vue.js';
|
|
6
|
-
import PluginMenuButton from './MenuButton/index.vue.js';
|
|
7
5
|
import PluginSidebar from './Sidebar/index.vue.js';
|
|
8
6
|
import PluginToolbarButton from './ToolbarButton/index.vue.js';
|
|
9
7
|
import PluginTourItem from './TourItem/index.vue.js';
|
|
10
8
|
import PluginViewOption from './ViewOption/index.vue.js';
|
|
11
|
-
export {
|
|
9
|
+
export { PluginBlockIndicator, PluginContextMenu, PluginDebugOverlay, PluginItemAction, PluginSidebar, PluginToolbarButton, PluginTourItem, PluginViewOption, };
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import PluginAddAction from "./AddAction/index.vue";
|
|
2
1
|
import PluginBlockIndicator from "./BlockIndicator/index.vue";
|
|
3
2
|
import PluginContextMenu from "./ContextMenu/index.vue";
|
|
4
3
|
import PluginDebugOverlay from "./DebugOverlay/index.vue";
|
|
5
4
|
import PluginItemAction from "./ItemAction/index.vue";
|
|
6
|
-
import PluginMenuButton from "./MenuButton/index.vue";
|
|
7
5
|
import PluginSidebar from "./Sidebar/index.vue";
|
|
8
6
|
import PluginToolbarButton from "./ToolbarButton/index.vue";
|
|
9
7
|
import PluginTourItem from "./TourItem/index.vue";
|
|
10
8
|
import PluginViewOption from "./ViewOption/index.vue";
|
|
11
9
|
export {
|
|
12
|
-
PluginAddAction,
|
|
13
10
|
PluginBlockIndicator,
|
|
14
11
|
PluginContextMenu,
|
|
15
12
|
PluginDebugOverlay,
|
|
16
13
|
PluginItemAction,
|
|
17
|
-
PluginMenuButton,
|
|
18
14
|
PluginSidebar,
|
|
19
15
|
PluginToolbarButton,
|
|
20
16
|
PluginTourItem,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="bk bk-block-not-implemented">
|
|
3
|
+
<Icon name="alert" />
|
|
4
|
+
<div v-html="text" />
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script setup>
|
|
9
|
+
import { useBlockRegistration } from "#blokkli/helpers/composables/useBlockRegistration";
|
|
10
|
+
import { computed, useBlokkli } from "#imports";
|
|
11
|
+
import { Icon } from "#blokkli/components";
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
uuid: { type: String, required: true },
|
|
14
|
+
bundle: { type: String, required: true }
|
|
15
|
+
});
|
|
16
|
+
const { dom, $t } = useBlokkli();
|
|
17
|
+
const text = computed(() => {
|
|
18
|
+
return $t(
|
|
19
|
+
"blockNotImplemented",
|
|
20
|
+
"Missing component for block bundle <strong>@bundle</strong>."
|
|
21
|
+
).replace("@bundle", props.bundle);
|
|
22
|
+
});
|
|
23
|
+
useBlockRegistration(dom, props.uuid);
|
|
24
|
+
</script>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
uuid: string;
|
|
3
|
+
bundle: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
|
+
/**
|
|
3
|
+
* The (machine) name of the field that is editable.
|
|
4
|
+
*/
|
|
2
5
|
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* The text value.
|
|
8
|
+
*/
|
|
3
9
|
value?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The tag to use for rendering the wrapper.
|
|
12
|
+
*
|
|
13
|
+
* @default "div"
|
|
14
|
+
*/
|
|
4
15
|
tag?: string;
|
|
5
16
|
};
|
|
6
17
|
type __VLS_Slots = {
|
|
@@ -14,7 +14,12 @@
|
|
|
14
14
|
v-bind="props"
|
|
15
15
|
:data-bk-in-proxy="fieldUsesProxy || (isEditing ? 'false' : void 0)"
|
|
16
16
|
/>
|
|
17
|
-
<
|
|
17
|
+
<Component
|
|
18
|
+
:is="blockNotImplemented"
|
|
19
|
+
v-else-if="blockNotImplemented"
|
|
20
|
+
:uuid
|
|
21
|
+
:bundle
|
|
22
|
+
/>
|
|
18
23
|
</template>
|
|
19
24
|
|
|
20
25
|
<script setup>
|
|
@@ -27,6 +32,7 @@ import {
|
|
|
27
32
|
} from "#imports";
|
|
28
33
|
import { getComponent } from "#blokkli/helpers/imports";
|
|
29
34
|
import {
|
|
35
|
+
INJECT_ALL_COMPONENTS_CHUNK,
|
|
30
36
|
INJECT_BLOCK_ITEM,
|
|
31
37
|
INJECT_ENTITY_CONTEXT,
|
|
32
38
|
INJECT_FIELD_LIST_TYPE,
|
|
@@ -43,9 +49,14 @@ const componentProps = defineProps({
|
|
|
43
49
|
index: { type: Number, required: false, default: 0 },
|
|
44
50
|
editContext: { type: Object, required: false, default: void 0 },
|
|
45
51
|
parentType: { type: String, required: false, default: "" },
|
|
46
|
-
isEditing: { type: Boolean, required: false, default: false }
|
|
52
|
+
isEditing: { type: Boolean, required: false, default: false },
|
|
53
|
+
isNew: { type: Boolean, required: false }
|
|
47
54
|
});
|
|
48
55
|
const isProxyMode = inject(INJECT_FIELD_PROXY_MODE, false);
|
|
56
|
+
const allComponentsChunk = inject(
|
|
57
|
+
INJECT_ALL_COMPONENTS_CHUNK,
|
|
58
|
+
null
|
|
59
|
+
);
|
|
49
60
|
const fieldUsesProxy = inject(INJECT_FIELD_USES_PROXY, false);
|
|
50
61
|
const isGlobalProxyMode = inject(
|
|
51
62
|
INJECT_GLOBAL_PROXY_MODE,
|
|
@@ -59,8 +70,10 @@ const component = isProxyMode || isGlobalProxyMode?.value ? defineAsyncComponent
|
|
|
59
70
|
"block",
|
|
60
71
|
componentProps.bundle,
|
|
61
72
|
fieldListType?.value || "default",
|
|
62
|
-
componentProps.parentType
|
|
73
|
+
componentProps.parentType,
|
|
74
|
+
allComponentsChunk
|
|
63
75
|
);
|
|
76
|
+
const blockNotImplemented = componentProps.isEditing ? defineAsyncComponent(() => import("./Blocks/NotImplemented/index.vue")) : null;
|
|
64
77
|
const index = computed(() => componentProps.index);
|
|
65
78
|
const item = computed(() => ({
|
|
66
79
|
index,
|
|
@@ -8,6 +8,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
8
8
|
editContext?: BlockEditContext;
|
|
9
9
|
parentType?: string;
|
|
10
10
|
isEditing?: boolean;
|
|
11
|
+
isNew?: boolean;
|
|
11
12
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
12
13
|
uuid: string;
|
|
13
14
|
bundle: string;
|
|
@@ -17,6 +18,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
17
18
|
editContext?: BlockEditContext;
|
|
18
19
|
parentType?: string;
|
|
19
20
|
isEditing?: boolean;
|
|
21
|
+
isNew?: boolean;
|
|
20
22
|
}> & Readonly<{}>, {
|
|
21
23
|
index: number;
|
|
22
24
|
options: any;
|
|
@@ -36,7 +36,7 @@ declare const _default: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>
|
|
|
36
36
|
/**
|
|
37
37
|
* The edit permissions.
|
|
38
38
|
*/
|
|
39
|
-
permissions?: EditPermission
|
|
39
|
+
permissions?: Array<EditPermission | null>;
|
|
40
40
|
/**
|
|
41
41
|
* Whether to isolate the provider element during editing.
|
|
42
42
|
*/
|
|
@@ -34,7 +34,7 @@ import { ItemIcon, Icon } from "#blokkli/components";
|
|
|
34
34
|
const emit = defineEmits(["close"]);
|
|
35
35
|
const { plugins } = useBlokkli();
|
|
36
36
|
function getGroupedActions() {
|
|
37
|
-
const actions = plugins.
|
|
37
|
+
const actions = plugins.get("itemDropdownAction");
|
|
38
38
|
const groups2 = /* @__PURE__ */ new Map();
|
|
39
39
|
for (const action of actions) {
|
|
40
40
|
const groupName = action.group;
|
|
@@ -1,108 +1,110 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
:class="{
|
|
2
|
+
<div
|
|
3
|
+
ref="el"
|
|
4
|
+
:style="{
|
|
5
|
+
visibility: isVisible ? 'visible' : 'hidden'
|
|
6
|
+
}"
|
|
7
|
+
class="bk bk-blokkli-item-actions-inner"
|
|
8
|
+
@click.stop
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
id="bk-blokkli-item-actions-controls"
|
|
12
|
+
ref="controlsEl"
|
|
13
|
+
class="bk-blokkli-item-actions-controls"
|
|
14
|
+
:class="{
|
|
16
15
|
'bk-is-locked': ui.isTransforming.value
|
|
17
16
|
}"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
>
|
|
18
|
+
<div id="bk-blokkli-item-actions-title">
|
|
19
|
+
<button
|
|
20
|
+
class="bk-blokkli-item-actions-type-button bk-item-icon-hover-parent"
|
|
21
|
+
tabindex="-1"
|
|
22
|
+
:disabled="!shouldRenderButton"
|
|
23
|
+
:class="{
|
|
25
24
|
'is-open': showDropdown,
|
|
26
|
-
'is-interactive': shouldRenderButton
|
|
27
|
-
'bk-is-reusable': itemBundle?.id === 'from_library',
|
|
28
|
-
'bk-is-fragment': itemBundle?.id === 'blokkli_fragment'
|
|
25
|
+
'is-interactive': shouldRenderButton
|
|
29
26
|
}"
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
-
<div
|
|
36
|
-
v-show="!hasSelectedHost"
|
|
37
|
-
class="bk-blokkli-item-actions-title-icon"
|
|
38
|
-
>
|
|
39
|
-
<Icon v-if="ui.isTransforming.value" name="loader" />
|
|
40
|
-
<ItemIcon v-else-if="bundleIcon" :bundle="bundleIcon" />
|
|
41
|
-
<Icon v-else name="selection" />
|
|
42
|
-
<div
|
|
43
|
-
v-if="itemBundle?.id === 'from_library'"
|
|
44
|
-
class="bk-blokkli-item-actions-title-icon-reusable"
|
|
45
|
-
>
|
|
46
|
-
<Icon name="reusable" />
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
<span class="bk-blokkli-item-actions-title-label">{{
|
|
50
|
-
title
|
|
51
|
-
}}</span>
|
|
52
|
-
<span
|
|
53
|
-
v-if="selection.items.value.length > 1"
|
|
54
|
-
class="bk-blokkli-item-actions-title-count"
|
|
55
|
-
>{{ selection.items.value.length }}</span
|
|
56
|
-
>
|
|
57
|
-
<span
|
|
58
|
-
v-show="selectedIsNew"
|
|
59
|
-
class="bk-blokkli-item-actions-title-pill"
|
|
60
|
-
>{{ $t("selectedIsNew", "New") }}</span
|
|
61
|
-
>
|
|
62
|
-
<Icon v-if="shouldRenderButton" name="caret" class="bk-caret" />
|
|
63
|
-
</button>
|
|
64
|
-
<EditActionsItemDropdown
|
|
65
|
-
v-if="showDropdown && editingEnabled"
|
|
66
|
-
@close="showDropdown = false"
|
|
67
|
-
/>
|
|
27
|
+
@click.prevent="showDropdown = !showDropdown"
|
|
28
|
+
>
|
|
29
|
+
<div v-if="shouldRenderButton" class="bk-tooltip">
|
|
30
|
+
{{ $t("actionsDropdownToolip", "Further actions") }}
|
|
68
31
|
</div>
|
|
69
|
-
|
|
70
32
|
<div
|
|
71
|
-
v-show="!
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
33
|
+
v-show="!hasSelectedHost"
|
|
34
|
+
class="bk-blokkli-item-actions-title-icon"
|
|
35
|
+
>
|
|
36
|
+
<Icon v-if="ui.isTransforming.value" name="loader" />
|
|
37
|
+
<ItemIconBox
|
|
38
|
+
v-else-if="bundleIcon"
|
|
39
|
+
:bundle="bundleIcon"
|
|
40
|
+
:color="isReusable ? 'lime' : void 0"
|
|
41
|
+
is-small
|
|
42
|
+
/>
|
|
43
|
+
<Icon v-else name="selection" />
|
|
44
|
+
<div
|
|
45
|
+
v-if="itemBundle?.id === 'from_library'"
|
|
46
|
+
class="bk-blokkli-item-actions-title-icon-reusable"
|
|
47
|
+
>
|
|
48
|
+
<Icon name="reusable" />
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
<span class="bk-blokkli-item-actions-title-label">{{ title }}</span>
|
|
52
|
+
<span
|
|
53
|
+
v-if="selection.items.value.length > 1"
|
|
54
|
+
class="bk-blokkli-item-actions-title-count"
|
|
55
|
+
>{{ selection.items.value.length }}</span
|
|
56
|
+
>
|
|
57
|
+
<span
|
|
58
|
+
v-show="selectedIsNew"
|
|
59
|
+
class="bk-blokkli-item-actions-title-pill"
|
|
60
|
+
>{{ $t("selectedIsNew", "New") }}</span
|
|
61
|
+
>
|
|
62
|
+
<Icon v-if="shouldRenderButton" name="caret" class="bk-caret" />
|
|
63
|
+
</button>
|
|
64
|
+
<EditActionsItemDropdown
|
|
65
|
+
v-if="showDropdown && editingEnabled"
|
|
66
|
+
@close="showDropdown = false"
|
|
67
|
+
/>
|
|
76
68
|
</div>
|
|
69
|
+
|
|
70
|
+
<div
|
|
71
|
+
v-show="!selection.hasHostSelected.value"
|
|
72
|
+
id="bk-blokkli-item-actions"
|
|
73
|
+
class="bk-blokkli-item-actions-buttons"
|
|
74
|
+
/>
|
|
77
75
|
</div>
|
|
78
|
-
</
|
|
76
|
+
</div>
|
|
79
77
|
</template>
|
|
80
78
|
|
|
81
79
|
<script setup>
|
|
82
80
|
import { watch, ref, computed, useBlokkli, useTemplateRef } from "#imports";
|
|
83
81
|
import { falsy } from "#blokkli/helpers";
|
|
84
|
-
import {
|
|
82
|
+
import { Icon, ItemIconBox } from "#blokkli/components";
|
|
85
83
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
86
84
|
import useStickyToolbar from "#blokkli/helpers/composables/useStickyToolbar";
|
|
87
85
|
import EditActionsItemDropdown from "./ItemDropdown.vue";
|
|
86
|
+
import { BUNDLE_FROM_LIBRARY } from "#blokkli/constants";
|
|
88
87
|
const { selection, $t, types, state, ui, definitions, debug } = useBlokkli();
|
|
89
88
|
const editingEnabled = computed(
|
|
90
89
|
() => state.editMode.value === "editing" || state.editMode.value === "translating"
|
|
91
90
|
);
|
|
92
91
|
const ACTIONS_HEIGHT = 52;
|
|
93
92
|
const el = useTemplateRef("el");
|
|
94
|
-
|
|
93
|
+
useStickyToolbar(el, {
|
|
95
94
|
getPlacementY: () => "top",
|
|
96
|
-
shouldUpdate: () => !selection.isChangingOptions.value,
|
|
95
|
+
shouldUpdate: () => !selection.isChangingOptions.value && isVisible.value,
|
|
97
96
|
getHeight: () => ACTIONS_HEIGHT,
|
|
98
97
|
getMargin: () => 20,
|
|
99
98
|
allowHorizontalOverflow: true
|
|
100
99
|
});
|
|
101
|
-
const controlsEl =
|
|
100
|
+
const controlsEl = useTemplateRef("controlsEl");
|
|
102
101
|
const showDropdown = ref(false);
|
|
103
102
|
const hasAnythingSelected = computed(
|
|
104
103
|
() => selection.hasHostSelected.value || !!selection.items.value.length
|
|
105
104
|
);
|
|
105
|
+
const isVisible = computed(() => {
|
|
106
|
+
return !selection.isDragging.value && !selection.editableActive.value && !ui.isAnimating.value && !ui.hasTransformOverlayOpen.value && hasAnythingSelected.value && !ui.hasTooltipOpen.value;
|
|
107
|
+
});
|
|
106
108
|
watch(selection.items, () => {
|
|
107
109
|
showDropdown.value = false;
|
|
108
110
|
});
|
|
@@ -118,6 +120,9 @@ const bundleIcon = computed(() => {
|
|
|
118
120
|
}
|
|
119
121
|
return itemBundle.value?.id;
|
|
120
122
|
});
|
|
123
|
+
const isReusable = computed(() => {
|
|
124
|
+
return itemBundle.value?.id === BUNDLE_FROM_LIBRARY;
|
|
125
|
+
});
|
|
121
126
|
const hasSelectedHost = computed(() => {
|
|
122
127
|
return selection.items.value.length === 0;
|
|
123
128
|
});
|
|
@@ -1,40 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<PluginContextMenu
|
|
3
|
-
:id="'add_list_item_' + id"
|
|
3
|
+
:id="'add_list_item_' + context + id"
|
|
4
4
|
ref="el"
|
|
5
5
|
tag="button"
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
type="button"
|
|
7
|
+
class="bk-add-item"
|
|
8
8
|
:menu="menu"
|
|
9
9
|
:data-sortli-id="id"
|
|
10
10
|
:class="[
|
|
11
11
|
{
|
|
12
12
|
'bk-is-disabled': disabled
|
|
13
13
|
},
|
|
14
|
-
'bk-is-' + orientation,
|
|
15
14
|
'bk-is-' + color
|
|
16
15
|
]"
|
|
17
16
|
>
|
|
18
|
-
<div class="bk-
|
|
19
|
-
<
|
|
20
|
-
<div
|
|
21
|
-
class="bk-list-item-label"
|
|
22
|
-
:class="{
|
|
23
|
-
'bk-tooltip': orientation === 'horizontal' && !ui.isMobile.value
|
|
24
|
-
}"
|
|
25
|
-
>
|
|
26
|
-
<span>{{ label }}</span>
|
|
27
|
-
</div>
|
|
17
|
+
<div class="bk-add-item-icon">
|
|
18
|
+
<ItemIconBox :color :bundle :icon />
|
|
28
19
|
</div>
|
|
29
|
-
|
|
30
|
-
<div
|
|
31
|
-
class="bk-add-list-drop bk-drop-element"
|
|
32
|
-
:class="['bk-is-' + color, { 'bk-is-dark': isDark }]"
|
|
33
|
-
>
|
|
34
|
-
<div class="bk-add-list-drop-icon">
|
|
35
|
-
<ItemIcon v-if="bundle" :bundle="bundle" />
|
|
36
|
-
<Icon v-else-if="icon" :name="icon" />
|
|
37
|
-
</div>
|
|
20
|
+
<div class="bk-add-item-label">
|
|
38
21
|
<span>{{ label }}</span>
|
|
39
22
|
</div>
|
|
40
23
|
</PluginContextMenu>
|
|
@@ -42,13 +25,13 @@
|
|
|
42
25
|
|
|
43
26
|
<script setup>
|
|
44
27
|
import { useBlokkli, computed, ref } from "#imports";
|
|
45
|
-
import {
|
|
28
|
+
import { ItemIconBox } from "#blokkli/components";
|
|
46
29
|
import { PluginContextMenu } from "#blokkli/plugins";
|
|
47
|
-
const {
|
|
30
|
+
const { storage, $t } = useBlokkli();
|
|
48
31
|
const props = defineProps({
|
|
49
32
|
id: { type: String, required: true },
|
|
33
|
+
context: { type: String, required: true },
|
|
50
34
|
label: { type: String, required: true },
|
|
51
|
-
orientation: { type: String, required: true },
|
|
52
35
|
color: { type: String, required: false, default: "default" },
|
|
53
36
|
bundle: { type: String, required: false, default: "" },
|
|
54
37
|
icon: { type: null, required: false, default: void 0 },
|
|
@@ -58,9 +41,6 @@ const props = defineProps({
|
|
|
58
41
|
const el = ref(null);
|
|
59
42
|
const favorites = storage.use("blockFavorites", []);
|
|
60
43
|
const isFavorite = computed(() => favorites.value.includes(props.id));
|
|
61
|
-
const isDark = computed(
|
|
62
|
-
() => props.orientation !== "sidebar" && props.color === "default"
|
|
63
|
-
);
|
|
64
44
|
const toggleFavorite = () => {
|
|
65
45
|
if (favorites.value.includes(props.id)) {
|
|
66
46
|
favorites.value = favorites.value.filter((v) => v !== props.id);
|
|
@@ -84,9 +64,3 @@ const menu = computed(() => {
|
|
|
84
64
|
const getElement = () => el.value?.$el;
|
|
85
65
|
defineExpose({ getElement });
|
|
86
66
|
</script>
|
|
87
|
-
|
|
88
|
-
<script>
|
|
89
|
-
export default {
|
|
90
|
-
name: "AddListItem"
|
|
91
|
-
};
|
|
92
|
-
</script>
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
-
|
|
3
|
-
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
export type AddListItemProps = {
|
|
4
3
|
id: string;
|
|
4
|
+
context: string;
|
|
5
5
|
label: string;
|
|
6
|
-
|
|
7
|
-
color?: "rose" | "lime" | "default" | "yellow" | "accent";
|
|
6
|
+
color?: 'rose' | 'lime' | 'default' | 'yellow' | 'accent';
|
|
8
7
|
bundle?: string;
|
|
9
8
|
icon?: BlokkliIcon;
|
|
10
9
|
disabled?: boolean;
|
|
11
10
|
noContextMenu?: boolean;
|
|
12
|
-
}
|
|
11
|
+
};
|
|
12
|
+
declare const _default: import("vue").DefineComponent<AddListItemProps, {
|
|
13
13
|
getElement: () => HTMLElement | null;
|
|
14
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
|
-
id: string;
|
|
16
|
-
label: string;
|
|
17
|
-
orientation: AddListOrientation;
|
|
18
|
-
color?: "rose" | "lime" | "default" | "yellow" | "accent";
|
|
19
|
-
bundle?: string;
|
|
20
|
-
icon?: BlokkliIcon;
|
|
21
|
-
disabled?: boolean;
|
|
22
|
-
noContextMenu?: boolean;
|
|
23
|
-
}> & Readonly<{}>, {
|
|
14
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AddListItemProps> & Readonly<{}>, {
|
|
24
15
|
bundle: string;
|
|
25
16
|
icon: BlokkliIcon;
|
|
26
17
|
color: "rose" | "lime" | "default" | "yellow" | "accent";
|