@blokkli/editor 2.0.0-alpha.22 → 2.0.0-alpha.24
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 +150 -226
- package/dist/runtime/blokkliPlugins/ContextMenu/index.vue +1 -1
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +20 -14
- package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue.d.ts +8 -4
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue +55 -25
- package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +5 -4
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue +9 -2
- package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +2 -0
- package/dist/runtime/blokkliPlugins/TourItem/index.vue +22 -13
- package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +1 -0
- package/dist/runtime/blokkliPlugins/ViewOption/index.vue +3 -1
- package/dist/runtime/blokkliPlugins/index.d.ts +1 -5
- package/dist/runtime/blokkliPlugins/index.js +0 -8
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +0 -5
- package/dist/runtime/components/BlokkliEditable.vue +6 -1
- package/dist/runtime/components/BlokkliField.vue +1 -1
- package/dist/runtime/components/BlokkliProvider.vue +4 -4
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Actions/ItemDropdown.vue +66 -0
- package/dist/runtime/components/Edit/Actions/ItemDropdown.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Actions/index.vue +80 -117
- package/dist/runtime/components/Edit/AddListItem/index.vue +8 -29
- package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +2 -3
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +23 -68
- 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/BlockProxy/index.vue +2 -8
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +33 -49
- package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue.d.ts +14 -1
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +93 -0
- package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue.d.ts +12 -0
- package/dist/runtime/components/Edit/Dialog/index.vue +26 -5
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/DraggableList.vue +5 -25
- package/dist/runtime/components/Edit/EditProvider.vue +71 -41
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +52 -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/{Selection/OverlayFallback → AddList/Actions}/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Features/{BlockAddList → AddList/Blocks}/index.vue +36 -108
- package/dist/runtime/components/Edit/Features/{Hover/Overlay → AddList/Blocks}/index.vue.d.ts +7 -2
- package/dist/runtime/components/Edit/Features/AddList/index.vue +76 -110
- package/dist/runtime/components/Edit/Features/Analyze/{Renderer.vue → Main.vue} +4 -8
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/fragment.glsl +10 -6
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/index.vue +43 -15
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/index.vue.d.ts +0 -2
- package/dist/runtime/components/Edit/Features/Analyze/{Overlay → Renderer}/vertex.glsl +11 -9
- package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +15 -3
- package/dist/runtime/components/Edit/Features/Analyze/index.vue +7 -3
- package/dist/runtime/components/Edit/Features/Anchors/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +41 -20
- package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +3 -2
- 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 +1 -0
- package/dist/runtime/components/Edit/Features/BlockScheduler/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Clipboard/List/index.vue +22 -11
- package/dist/runtime/components/Edit/Features/Clipboard/index.vue +70 -29
- 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/Conversions/index.vue +16 -9
- package/dist/runtime/components/Edit/Features/Debug/DebugSection.vue +24 -0
- package/dist/runtime/components/Edit/Features/Debug/DebugSection.vue.d.ts +16 -0
- package/dist/runtime/components/Edit/Features/Debug/Main.vue +80 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Features.vue +34 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Icons.vue +15 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Icons.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Keyboard.vue +17 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Keyboard.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue +66 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Rendering.vue +96 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Rendering.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Selection.vue +25 -0
- package/dist/runtime/components/Edit/Features/Debug/Section/Selection.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +2 -2
- 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 +23 -119
- package/dist/runtime/components/Edit/Features/DraggingOverlay/Renderer/fragment.glsl +77 -0
- package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue +138 -92
- package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/vertex.glsl +60 -8
- package/dist/runtime/components/Edit/Features/DraggingOverlay/index.vue +4 -5
- package/dist/runtime/components/Edit/Features/EditForm/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +0 -6
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +8 -4
- package/dist/runtime/components/Edit/Features/Exit/index.vue +12 -9
- package/dist/runtime/components/Edit/Features/Fragments/Dialog/Item/index.vue +1 -5
- package/dist/runtime/components/Edit/Features/Fragments/index.vue +27 -31
- package/dist/runtime/components/Edit/Features/Hover/Renderer/fragment.glsl +141 -0
- package/dist/runtime/components/Edit/Features/Hover/{Overlay → Renderer}/index.vue +225 -38
- package/dist/runtime/components/Edit/Features/Hover/Renderer/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Hover/{Overlay → Renderer}/vertex.glsl +49 -11
- package/dist/runtime/components/Edit/Features/Hover/index.vue +9 -6
- 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 +2 -2
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/Item/index.vue +1 -5
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Library/index.vue +50 -36
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/Item.vue +1 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +26 -13
- package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/MediaLibrary/index.vue +3 -47
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/fragment.glsl +13 -26
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/index.vue +131 -75
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/index.vue.d.ts +0 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/{Overlay → Renderer}/vertex.glsl +27 -2
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +25 -12
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Publish/index.vue +17 -15
- package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Revert/index.vue +24 -18
- package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +23 -6
- package/dist/runtime/components/Edit/Features/Search/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +21 -17
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +6 -6
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +19 -17
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +242 -131
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +29 -12
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +15 -10
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/fragment.glsl +23 -14
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/index.vue +121 -28
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/index.vue.d.ts +0 -2
- package/dist/runtime/components/Edit/Features/Selection/{Overlay → Renderer}/vertex.glsl +23 -14
- package/dist/runtime/components/Edit/Features/Selection/index.vue +46 -59
- package/dist/runtime/components/Edit/Features/Settings/Dialog/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Settings/index.vue +25 -17
- package/dist/runtime/components/Edit/Features/TouchActionBar/index.vue +2 -2
- package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +1 -1
- 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 +5 -5
- package/dist/runtime/components/Edit/Features/Transform/index.vue +30 -23
- package/dist/runtime/components/Edit/Features/Translations/index.vue +18 -17
- package/dist/runtime/components/Edit/Form/Checkboxes/index.vue +43 -0
- package/dist/runtime/components/Edit/Form/Checkboxes/index.vue.d.ts +20 -0
- package/dist/runtime/components/Edit/FormOverlay/index.vue +13 -4
- 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/Item/index.vue.d.ts +1 -1
- package/dist/runtime/components/Edit/Messages/index.vue +6 -1
- package/dist/runtime/components/Edit/Overlay/index.vue +66 -0
- package/dist/runtime/components/Edit/Overlay/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/PreviewProvider.vue +1 -1
- package/dist/runtime/components/Edit/Sortli/index.vue +5 -8
- package/dist/runtime/components/Edit/Sortli/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/SystemRequirements/index.vue +36 -36
- package/dist/runtime/components/Edit/Toolbar/index.vue +47 -51
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue +9 -2
- package/dist/runtime/components/Edit/ViewportBlockingRect/index.vue.d.ts +4 -1
- package/dist/runtime/components/Edit/index.d.ts +7 -5
- package/dist/runtime/components/Edit/index.js +13 -9
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/animationProvider.d.ts +58 -9
- package/dist/runtime/helpers/animationProvider.js +318 -75
- package/dist/runtime/helpers/composables/defineAddAction.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineAddAction.js +10 -0
- package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +2 -0
- package/dist/runtime/helpers/composables/defineItemDropdownAction.js +10 -0
- 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 +5 -2
- package/dist/runtime/helpers/composables/defineRenderer.js +3 -2
- package/dist/runtime/helpers/composables/useDialog.d.ts +3 -0
- package/dist/runtime/helpers/composables/useDialog.js +16 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +16 -0
- package/dist/runtime/helpers/composables/useGlobalBlokkliObject.js +36 -0
- package/dist/runtime/helpers/debugProvider.d.ts +13 -3
- package/dist/runtime/helpers/debugProvider.js +80 -12
- package/dist/runtime/helpers/defineElementStyle.d.ts +2 -0
- package/dist/runtime/helpers/defineElementStyle.js +33 -0
- package/dist/runtime/helpers/domProvider.d.ts +1 -0
- package/dist/runtime/helpers/domProvider.js +51 -32
- package/dist/runtime/helpers/dropTargets/index.d.ts +1 -1
- package/dist/runtime/helpers/dropTargets/index.js +18 -4
- package/dist/runtime/helpers/eventBus.d.ts +1 -1
- package/dist/runtime/helpers/index.d.ts +1 -6
- package/dist/runtime/helpers/index.js +0 -81
- package/dist/runtime/helpers/pluginProvider.d.ts +38 -3
- package/dist/runtime/helpers/pluginProvider.js +49 -18
- package/dist/runtime/helpers/providers/blocks.js +10 -0
- package/dist/runtime/helpers/providers/directive.d.ts +4 -1
- package/dist/runtime/helpers/providers/directive.js +9 -2
- package/dist/runtime/helpers/providers/fields.d.ts +9 -1
- package/dist/runtime/helpers/stateProvider.js +1 -0
- package/dist/runtime/helpers/uiProvider.d.ts +13 -12
- package/dist/runtime/helpers/uiProvider.js +117 -81
- package/dist/runtime/helpers/webgl/index.d.ts +2 -3
- package/dist/runtime/helpers/webgl/index.js +9 -14
- package/dist/runtime/icons/click.svg +1 -0
- package/dist/runtime/icons/dock-left.svg +1 -0
- package/dist/runtime/icons/dock-right.svg +1 -0
- package/dist/runtime/icons/dock-window.svg +1 -0
- package/dist/runtime/plugins/blokkliDirectives.js +1 -1
- package/dist/runtime/types/index.d.ts +16 -26
- package/package.json +1 -1
- package/dist/runtime/blokkliPlugins/AddAction/index.vue +0 -96
- package/dist/runtime/blokkliPlugins/AddAction/index.vue.d.ts +0 -26
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue +0 -56
- package/dist/runtime/blokkliPlugins/DroppableEdit/index.vue.d.ts +0 -24
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue +0 -76
- package/dist/runtime/blokkliPlugins/ItemDropdown/index.vue.d.ts +0 -31
- package/dist/runtime/blokkliPlugins/MenuButton/index.vue +0 -66
- package/dist/runtime/components/Edit/AddListItemIcon/index.vue +0 -19
- package/dist/runtime/components/Edit/Features/BlockAddList/docs.md +0 -15
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +0 -240
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +0 -96
- package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +0 -139
- package/dist/runtime/components/Edit/Features/Selection/OverlayFallback/index.vue +0 -42
- /package/dist/runtime/components/Edit/Features/Analyze/{Renderer.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/Anchors/{Renderer.vue → Overlay/index.vue} +0 -0
- /package/dist/runtime/components/Edit/Features/{BlockAddList → Anchors/Overlay}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/Debug/{Renderer.vue.d.ts → Main.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/{Anchors/Renderer.vue.d.ts → Debug/Section/Features.vue.d.ts} +0 -0
- /package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue.d.ts +0 -0
- /package/dist/runtime/components/Edit/Features/Ownership/{Renderer.vue → Banner/index.vue} +0 -0
- /package/dist/runtime/components/Edit/Features/Ownership/{Renderer.vue.d.ts → Banner/index.vue.d.ts} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ViewportBlockingRect
|
|
3
3
|
:id="storageKey"
|
|
4
|
-
ref="
|
|
5
|
-
class="bk-sidebar-detached"
|
|
4
|
+
ref="root"
|
|
5
|
+
class="bk-sidebar-detached bk-sidebar-inner"
|
|
6
6
|
:class="{ 'bk-is-focused': focusedSidebar === id }"
|
|
7
7
|
:style="style"
|
|
8
8
|
tabindex="10"
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
<Icon :name="isMinimized ? 'window-maximize' : 'window-minimize'" />
|
|
27
27
|
</button>
|
|
28
28
|
<button
|
|
29
|
-
@click.prevent.stop.capture="$emit('
|
|
29
|
+
@click.prevent.stop.capture="$emit('attach')"
|
|
30
30
|
@mousedown.capture.stop
|
|
31
31
|
>
|
|
32
|
-
<Icon name="
|
|
32
|
+
<Icon :name="region === 'left' ? 'dock-left' : 'dock-right'" />
|
|
33
33
|
</button>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
@@ -65,7 +65,8 @@ import {
|
|
|
65
65
|
onBeforeUnmount,
|
|
66
66
|
computed,
|
|
67
67
|
watch,
|
|
68
|
-
useState
|
|
68
|
+
useState,
|
|
69
|
+
useTemplateRef
|
|
69
70
|
} from "#imports";
|
|
70
71
|
import { Icon, ViewportBlockingRect, ScrollBoundary } from "#blokkli/components";
|
|
71
72
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
@@ -76,10 +77,15 @@ const props = defineProps({
|
|
|
76
77
|
icon: { type: null, required: true },
|
|
77
78
|
minWidth: { type: Number, required: false, default: 300 },
|
|
78
79
|
minHeight: { type: Number, required: false, default: 300 },
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
region: { type: String, required: true },
|
|
81
|
+
size: { type: Object, required: false, default: void 0 }
|
|
81
82
|
});
|
|
82
|
-
defineEmits(["
|
|
83
|
+
defineEmits(["attach"]);
|
|
84
|
+
const root = useTemplateRef("root");
|
|
85
|
+
function getRootElement() {
|
|
86
|
+
return root.value?.getRootElement() ?? null;
|
|
87
|
+
}
|
|
88
|
+
const isLeft = computed(() => props.region === "left");
|
|
83
89
|
const { storage, ui, keyboard, selection } = useBlokkli();
|
|
84
90
|
function onPointerMove(e) {
|
|
85
91
|
if (keyboard.isPressingSpace.value || selection.isDragging.value) {
|
|
@@ -109,7 +115,7 @@ const offsetX = computed(() => {
|
|
|
109
115
|
return 0;
|
|
110
116
|
});
|
|
111
117
|
const storedData = storage.use(storageKey, {
|
|
112
|
-
x:
|
|
118
|
+
x: isLeft.value ? 0 : window.innerWidth - 360,
|
|
113
119
|
y: 50,
|
|
114
120
|
width: 360,
|
|
115
121
|
height: 520,
|
|
@@ -205,10 +211,8 @@ const setCoordinates = (newX, newY) => {
|
|
|
205
211
|
};
|
|
206
212
|
const setSizes = (newWidth, newHeight) => {
|
|
207
213
|
if (newWidth !== void 0) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
window.innerWidth - 300
|
|
211
|
-
);
|
|
214
|
+
const maxWidth = ui.visibleViewport.value.x + ui.visibleViewport.value.width - x.value;
|
|
215
|
+
userWidth.value = Math.min(Math.max(newWidth, props.minWidth), maxWidth);
|
|
212
216
|
}
|
|
213
217
|
if (newHeight !== void 0) {
|
|
214
218
|
userHeight.value = Math.min(
|
|
@@ -241,7 +245,6 @@ const onMouseUp = () => {
|
|
|
241
245
|
window.removeEventListener("pointerup", onMouseUp, { capture: true });
|
|
242
246
|
updateStored();
|
|
243
247
|
};
|
|
244
|
-
const el = ref(null);
|
|
245
248
|
const recalculatePositions = () => {
|
|
246
249
|
const storedViewportWidth = storedData.value.viewportWidth || window.innerWidth;
|
|
247
250
|
const storedViewportHeight = storedData.value.viewportHeight || window.innerHeight;
|
|
@@ -267,4 +270,7 @@ onBeforeUnmount(() => {
|
|
|
267
270
|
window.removeEventListener("pointermove", onMouseMove, { capture: true });
|
|
268
271
|
window.removeEventListener("pointerup", onMouseUp, { capture: true });
|
|
269
272
|
});
|
|
273
|
+
defineExpose({
|
|
274
|
+
getRootElement
|
|
275
|
+
});
|
|
270
276
|
</script>
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
+
import type { SidebarRegion } from '#blokkli/types';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
id: string;
|
|
4
5
|
title: string;
|
|
5
6
|
icon: BlokkliIcon;
|
|
6
7
|
minWidth?: number;
|
|
7
8
|
minHeight?: number;
|
|
9
|
+
region: SidebarRegion;
|
|
8
10
|
size?: {
|
|
9
11
|
width: number;
|
|
10
12
|
height: number;
|
|
11
13
|
};
|
|
12
|
-
isLeft?: boolean;
|
|
13
14
|
};
|
|
15
|
+
declare function getRootElement(): HTMLElement | null;
|
|
14
16
|
declare var __VLS_16: {}, __VLS_30: {
|
|
15
17
|
width: number;
|
|
16
18
|
height: number;
|
|
@@ -21,10 +23,12 @@ type __VLS_Slots = {} & {
|
|
|
21
23
|
} & {
|
|
22
24
|
default?: (props: typeof __VLS_30) => any;
|
|
23
25
|
};
|
|
24
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
25
|
-
|
|
26
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {
|
|
27
|
+
getRootElement: typeof getRootElement;
|
|
28
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
29
|
+
attach: () => any;
|
|
26
30
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
-
|
|
31
|
+
onAttach?: (() => any) | undefined;
|
|
28
32
|
}>, {
|
|
29
33
|
size: {
|
|
30
34
|
width: number;
|
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
:id="'bk-sidebar-button-' + id"
|
|
5
5
|
ref="tourElement"
|
|
6
6
|
class="bk-toolbar-button"
|
|
7
|
-
:class="[
|
|
7
|
+
:class="[
|
|
8
|
+
{ 'bk-is-active': activeSidebar === id && !isDisabled },
|
|
9
|
+
'bk-is-' + region
|
|
10
|
+
]"
|
|
8
11
|
:disabled="isDisabled"
|
|
9
12
|
:style="{ order: weight }"
|
|
10
13
|
@click.prevent.stop="toggleSidebar"
|
|
@@ -17,9 +20,9 @@
|
|
|
17
20
|
<span>{{ title }}</span>
|
|
18
21
|
<ShortcutIndicator
|
|
19
22
|
v-if="keyCode"
|
|
20
|
-
:meta
|
|
21
|
-
:shift
|
|
22
|
-
:key-code
|
|
23
|
+
:meta
|
|
24
|
+
:shift
|
|
25
|
+
:key-code
|
|
23
26
|
:label="title"
|
|
24
27
|
@pressed="toggleSidebar"
|
|
25
28
|
/>
|
|
@@ -35,16 +38,15 @@
|
|
|
35
38
|
>
|
|
36
39
|
<SidebarDetached
|
|
37
40
|
v-if="isRenderedDetached"
|
|
38
|
-
:id
|
|
39
|
-
ref="
|
|
40
|
-
:title
|
|
41
|
-
:icon
|
|
42
|
-
:min-width
|
|
43
|
-
:min-height
|
|
44
|
-
:size
|
|
45
|
-
:
|
|
46
|
-
|
|
47
|
-
@close="onAttach"
|
|
41
|
+
:id
|
|
42
|
+
ref="sidebarDetached"
|
|
43
|
+
:title
|
|
44
|
+
:icon
|
|
45
|
+
:min-width
|
|
46
|
+
:min-height
|
|
47
|
+
:size
|
|
48
|
+
:region
|
|
49
|
+
@attach="onAttachDetached"
|
|
48
50
|
>
|
|
49
51
|
<template #icon>
|
|
50
52
|
<slot name="icon" />
|
|
@@ -54,12 +56,12 @@
|
|
|
54
56
|
<div ref="sidebarContent" class="bk-sidebar-content">
|
|
55
57
|
<slot
|
|
56
58
|
:key="isRenderedDetached ? 'detached' : 'attached'"
|
|
57
|
-
:scrolled-to-end
|
|
59
|
+
:scrolled-to-end
|
|
58
60
|
:is-detached="isRenderedDetached"
|
|
59
|
-
:width
|
|
60
|
-
:height
|
|
61
|
-
:toggle-sidebar
|
|
62
|
-
:is-resizing
|
|
61
|
+
:width
|
|
62
|
+
:height
|
|
63
|
+
:toggle-sidebar
|
|
64
|
+
:is-resizing
|
|
63
65
|
/>
|
|
64
66
|
</div>
|
|
65
67
|
</div>
|
|
@@ -75,7 +77,7 @@
|
|
|
75
77
|
<span>{{ title }}</span>
|
|
76
78
|
<div v-if="beta" class="bk-beta-indicator">BETA</div>
|
|
77
79
|
<button v-if="!ui.isMobile.value" @click.prevent.stop="onDetach">
|
|
78
|
-
<Icon name="
|
|
80
|
+
<Icon name="dock-window" />
|
|
79
81
|
</button>
|
|
80
82
|
<button @click.prevent.stop="toggleSidebar">
|
|
81
83
|
<Icon name="close" />
|
|
@@ -100,7 +102,14 @@
|
|
|
100
102
|
</template>
|
|
101
103
|
|
|
102
104
|
<script setup>
|
|
103
|
-
import {
|
|
105
|
+
import {
|
|
106
|
+
computed,
|
|
107
|
+
watch,
|
|
108
|
+
ref,
|
|
109
|
+
useBlokkli,
|
|
110
|
+
onBeforeUnmount,
|
|
111
|
+
useTemplateRef
|
|
112
|
+
} from "#imports";
|
|
104
113
|
import { Icon, ShortcutIndicator, ScrollBoundary } from "#blokkli/components";
|
|
105
114
|
import SidebarDetached from "./Detached/index.vue";
|
|
106
115
|
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
@@ -127,14 +136,31 @@ const props = defineProps({
|
|
|
127
136
|
});
|
|
128
137
|
const emit = defineEmits(["updated"]);
|
|
129
138
|
const { storage, state, ui, $t } = useBlokkli();
|
|
130
|
-
const tourElement =
|
|
139
|
+
const tourElement = useTemplateRef("tourElement");
|
|
140
|
+
const sidebarDetached = useTemplateRef("sidebarDetached");
|
|
131
141
|
const detachedKey = computed(() => "sidebar:detached:" + props.id);
|
|
132
142
|
const storageKey = computed(() => "sidebar:active:" + props.region);
|
|
133
143
|
const isDetached = storage.use(detachedKey, false, true);
|
|
134
144
|
const isDisabled = computed(
|
|
135
|
-
() => props.editOnly && state.editMode.value !== "editing"
|
|
145
|
+
() => props.editOnly && state.editMode.value !== "editing" || props.disabled
|
|
136
146
|
);
|
|
137
147
|
const activeSidebar = storage.use(storageKey, "", true);
|
|
148
|
+
const isRendered = computed(
|
|
149
|
+
() => activeSidebar.value === props.id && !isDisabled.value
|
|
150
|
+
);
|
|
151
|
+
watch(
|
|
152
|
+
isRendered,
|
|
153
|
+
(isRendered2) => {
|
|
154
|
+
if (isRendered2) {
|
|
155
|
+
ui.setActiveSidebar(props.region, props.id);
|
|
156
|
+
} else {
|
|
157
|
+
ui.removeActiveSidebar(props.region, props.id);
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
immediate: true
|
|
162
|
+
}
|
|
163
|
+
);
|
|
138
164
|
const isRenderedDetached = computed(
|
|
139
165
|
() => isDetached.value && !ui.isMobile.value
|
|
140
166
|
);
|
|
@@ -148,8 +174,9 @@ const onDetach = () => {
|
|
|
148
174
|
activeSidebar.value = "";
|
|
149
175
|
emit("updated");
|
|
150
176
|
};
|
|
151
|
-
const
|
|
177
|
+
const onAttachDetached = () => {
|
|
152
178
|
isDetached.value = false;
|
|
179
|
+
activeSidebar.value = props.id;
|
|
153
180
|
emit("updated");
|
|
154
181
|
};
|
|
155
182
|
const toggleSidebar = () => {
|
|
@@ -220,9 +247,12 @@ defineTourItem(() => {
|
|
|
220
247
|
id: "plugin:sidebar:" + props.id,
|
|
221
248
|
title: props.title,
|
|
222
249
|
text: props.tourText,
|
|
223
|
-
element: () => tourElement.value
|
|
250
|
+
element: () => tourElement.value ?? sidebarDetached.value?.getRootElement()
|
|
224
251
|
};
|
|
225
252
|
});
|
|
253
|
+
onBeforeUnmount(() => {
|
|
254
|
+
ui.removeActiveSidebar(props.region, props.id);
|
|
255
|
+
});
|
|
226
256
|
</script>
|
|
227
257
|
|
|
228
258
|
<script>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BlokkliIcon } from '#blokkli-build/icons';
|
|
2
|
+
import type { SidebarRegion } from '#blokkli/types';
|
|
2
3
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
3
4
|
id: string;
|
|
4
5
|
title: string;
|
|
@@ -8,7 +9,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
8
9
|
weight?: string | number;
|
|
9
10
|
renderAlways?: boolean;
|
|
10
11
|
disabled?: boolean;
|
|
11
|
-
region?:
|
|
12
|
+
region?: SidebarRegion;
|
|
12
13
|
minWidth?: number;
|
|
13
14
|
minHeight?: number;
|
|
14
15
|
size?: {
|
|
@@ -32,7 +33,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
32
33
|
weight?: string | number;
|
|
33
34
|
renderAlways?: boolean;
|
|
34
35
|
disabled?: boolean;
|
|
35
|
-
region?:
|
|
36
|
+
region?: SidebarRegion;
|
|
36
37
|
minWidth?: number;
|
|
37
38
|
minHeight?: number;
|
|
38
39
|
size?: {
|
|
@@ -50,12 +51,12 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
50
51
|
width: number;
|
|
51
52
|
height: number;
|
|
52
53
|
};
|
|
53
|
-
weight: string | number;
|
|
54
54
|
keyCode: string;
|
|
55
|
+
weight: string | number;
|
|
55
56
|
tourText: string;
|
|
56
57
|
minWidth: number;
|
|
57
58
|
minHeight: number;
|
|
58
|
-
region:
|
|
59
|
+
region: SidebarRegion;
|
|
59
60
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
60
61
|
icon?: (props: {}) => any;
|
|
61
62
|
} & {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
<script setup>
|
|
31
31
|
import { ShortcutIndicator, Icon } from "#blokkli/components";
|
|
32
|
-
import { ref } from "#imports";
|
|
32
|
+
import { ref, useBlokkli } from "#imports";
|
|
33
33
|
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
34
34
|
import defineTourItem from "#blokkli/helpers/composables/defineTourItem";
|
|
35
35
|
const props = defineProps({
|
|
@@ -45,17 +45,24 @@ const props = defineProps({
|
|
|
45
45
|
icon: { type: null, required: false },
|
|
46
46
|
shortcutGroup: { type: String, required: false },
|
|
47
47
|
tourText: { type: String, required: false },
|
|
48
|
-
weight: { type: [Number, String], required: false }
|
|
48
|
+
weight: { type: [Number, String], required: false },
|
|
49
|
+
noCommand: { type: Boolean, required: false }
|
|
49
50
|
});
|
|
51
|
+
const { debug } = useBlokkli();
|
|
52
|
+
const logger = debug.createLogger("PluginToolbar");
|
|
50
53
|
const emit = defineEmits(["click"]);
|
|
51
54
|
const el = ref(null);
|
|
52
55
|
function onClick() {
|
|
53
56
|
if (props.disabled) {
|
|
54
57
|
return;
|
|
55
58
|
}
|
|
59
|
+
logger.log(`Click ${props.id}`);
|
|
56
60
|
emit("click");
|
|
57
61
|
}
|
|
58
62
|
defineCommands(() => {
|
|
63
|
+
if (props.noCommand) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
59
66
|
return {
|
|
60
67
|
id: "plugin:toolbar_button:" + props.id,
|
|
61
68
|
label: props.title,
|
|
@@ -16,6 +16,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
16
16
|
* The weight, used for positioning the button.
|
|
17
17
|
*/
|
|
18
18
|
weight?: number | string;
|
|
19
|
+
noCommand?: boolean;
|
|
19
20
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
21
|
click: (...args: any[]) => void;
|
|
21
22
|
}, string, import("vue").PublicProps, Readonly<{
|
|
@@ -35,6 +36,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
|
35
36
|
* The weight, used for positioning the button.
|
|
36
37
|
*/
|
|
37
38
|
weight?: number | string;
|
|
39
|
+
noCommand?: boolean;
|
|
38
40
|
}> & Readonly<{
|
|
39
41
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
40
42
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
@@ -9,32 +9,41 @@ const props = defineProps({
|
|
|
9
9
|
id: { type: String, required: true },
|
|
10
10
|
title: { type: String, required: true },
|
|
11
11
|
text: { type: String, required: true },
|
|
12
|
-
selector: { type: String, required: false }
|
|
12
|
+
selector: { type: String, required: false },
|
|
13
|
+
element: { type: null, required: false }
|
|
13
14
|
});
|
|
14
|
-
const { element } = useBlokkli();
|
|
15
|
-
const
|
|
15
|
+
const { element: elementProvider } = useBlokkli();
|
|
16
|
+
const findInstanceElement = (el) => {
|
|
16
17
|
if (el instanceof Text) {
|
|
17
|
-
return
|
|
18
|
+
return findInstanceElement(el.nextElementSibling);
|
|
18
19
|
} else if (el instanceof HTMLElement) {
|
|
19
20
|
return el;
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
const instance = getCurrentInstance();
|
|
24
|
+
function getElement() {
|
|
25
|
+
if (props.element) {
|
|
26
|
+
return props.element;
|
|
27
|
+
}
|
|
28
|
+
if (props.selector) {
|
|
29
|
+
const match = elementProvider.query(
|
|
30
|
+
document.documentElement,
|
|
31
|
+
props.selector,
|
|
32
|
+
`TourItem Plugin: ${props.id}`
|
|
33
|
+
);
|
|
34
|
+
if (match) {
|
|
35
|
+
return match;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return findInstanceElement(instance?.vnode.el);
|
|
39
|
+
}
|
|
23
40
|
defineTourItem(() => {
|
|
24
41
|
return {
|
|
25
42
|
id: props.id,
|
|
26
43
|
title: props.title,
|
|
27
44
|
text: props.text,
|
|
28
45
|
element: () => {
|
|
29
|
-
|
|
30
|
-
document.documentElement,
|
|
31
|
-
props.selector,
|
|
32
|
-
`TourItem Plugin: ${props.id}`
|
|
33
|
-
) : void 0;
|
|
34
|
-
const el = provided || findElement(instance?.vnode.el);
|
|
35
|
-
if (el instanceof HTMLElement) {
|
|
36
|
-
return el;
|
|
37
|
-
}
|
|
46
|
+
return getElement();
|
|
38
47
|
}
|
|
39
48
|
};
|
|
40
49
|
});
|
|
@@ -34,7 +34,7 @@ import { useBlokkli, computed, ref, watch } from "#imports";
|
|
|
34
34
|
import { ShortcutIndicator, Icon } from "#blokkli/components";
|
|
35
35
|
import defineCommands from "#blokkli/helpers/composables/defineCommands";
|
|
36
36
|
import defineTourItem from "#blokkli/helpers/composables/defineTourItem";
|
|
37
|
-
const { storage, ui, eventBus } = useBlokkli();
|
|
37
|
+
const { storage, ui, eventBus, debug } = useBlokkli();
|
|
38
38
|
const props = defineProps({
|
|
39
39
|
id: { type: String, required: true },
|
|
40
40
|
label: { type: String, required: true },
|
|
@@ -48,6 +48,7 @@ const props = defineProps({
|
|
|
48
48
|
weight: { type: [Number, String], required: false }
|
|
49
49
|
});
|
|
50
50
|
const emit = defineEmits(["update:modelValue"]);
|
|
51
|
+
const logger = debug.createLogger("PluginViewOption");
|
|
51
52
|
const storageKey = "view_option_" + props.id;
|
|
52
53
|
const button = ref(null);
|
|
53
54
|
const isActiveStorage = storage.use(storageKey, false, true);
|
|
@@ -67,6 +68,7 @@ emit("update:modelValue", isActiveStorage.value);
|
|
|
67
68
|
const title = computed(() => isActive.value ? props.titleOff : props.titleOn);
|
|
68
69
|
const onClick = () => {
|
|
69
70
|
isActive.value = !isActive.value;
|
|
71
|
+
logger.log("Toggle " + props.id, isActive.value);
|
|
70
72
|
};
|
|
71
73
|
defineCommands(() => {
|
|
72
74
|
return {
|
|
@@ -1,13 +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
|
-
import PluginDroppableEdit from './DroppableEdit/index.vue.js';
|
|
6
4
|
import PluginItemAction from './ItemAction/index.vue.js';
|
|
7
|
-
import PluginItemDropdown from './ItemDropdown/index.vue.js';
|
|
8
|
-
import PluginMenuButton from './MenuButton/index.vue.js';
|
|
9
5
|
import PluginSidebar from './Sidebar/index.vue.js';
|
|
10
6
|
import PluginToolbarButton from './ToolbarButton/index.vue.js';
|
|
11
7
|
import PluginTourItem from './TourItem/index.vue.js';
|
|
12
8
|
import PluginViewOption from './ViewOption/index.vue.js';
|
|
13
|
-
export {
|
|
9
|
+
export { PluginBlockIndicator, PluginContextMenu, PluginDebugOverlay, PluginItemAction, PluginSidebar, PluginToolbarButton, PluginTourItem, PluginViewOption, };
|
|
@@ -1,24 +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
|
-
import PluginDroppableEdit from "./DroppableEdit/index.vue";
|
|
6
4
|
import PluginItemAction from "./ItemAction/index.vue";
|
|
7
|
-
import PluginItemDropdown from "./ItemDropdown/index.vue";
|
|
8
|
-
import PluginMenuButton from "./MenuButton/index.vue";
|
|
9
5
|
import PluginSidebar from "./Sidebar/index.vue";
|
|
10
6
|
import PluginToolbarButton from "./ToolbarButton/index.vue";
|
|
11
7
|
import PluginTourItem from "./TourItem/index.vue";
|
|
12
8
|
import PluginViewOption from "./ViewOption/index.vue";
|
|
13
9
|
export {
|
|
14
|
-
PluginAddAction,
|
|
15
10
|
PluginBlockIndicator,
|
|
16
11
|
PluginContextMenu,
|
|
17
12
|
PluginDebugOverlay,
|
|
18
|
-
PluginDroppableEdit,
|
|
19
13
|
PluginItemAction,
|
|
20
|
-
PluginItemDropdown,
|
|
21
|
-
PluginMenuButton,
|
|
22
14
|
PluginSidebar,
|
|
23
15
|
PluginToolbarButton,
|
|
24
16
|
PluginTourItem,
|
|
@@ -4,11 +4,6 @@
|
|
|
4
4
|
:key="item.uuid"
|
|
5
5
|
v-bind="item"
|
|
6
6
|
:index
|
|
7
|
-
:data-reusable-bundle="item.bundle"
|
|
8
|
-
:data-reusable-uuid="item.uuid"
|
|
9
|
-
:data-bk-library-label="libraryItem?.label"
|
|
10
|
-
:data-bk-library-item-uuid="libraryItem?.uuid"
|
|
11
|
-
data-blokkli-is-reusable="true"
|
|
12
7
|
:parent-type
|
|
13
8
|
:is-editing
|
|
14
9
|
/>
|
|
@@ -36,6 +36,9 @@ const isInReusable = inject(INJECT_IS_IN_REUSABLE, false);
|
|
|
36
36
|
if (!entity) {
|
|
37
37
|
throw new Error("Missing entity context.");
|
|
38
38
|
}
|
|
39
|
+
function getValueCallback() {
|
|
40
|
+
return props.value;
|
|
41
|
+
}
|
|
39
42
|
const renderedValue = computed(() => valueOverride.value || props.value || "");
|
|
40
43
|
const onEditableUpdateValue = (e) => {
|
|
41
44
|
if (e.name === props.name && e.entityUuid === entity.uuid) {
|
|
@@ -52,7 +55,9 @@ onMounted(() => {
|
|
|
52
55
|
root.value,
|
|
53
56
|
props.name,
|
|
54
57
|
entity,
|
|
55
|
-
"editable"
|
|
58
|
+
"editable",
|
|
59
|
+
true,
|
|
60
|
+
getValueCallback
|
|
56
61
|
);
|
|
57
62
|
}
|
|
58
63
|
});
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
:data-provider-entity-bundle="entityBundle"
|
|
7
7
|
:data-blokkli-provider-active="isInEditor ? 'true' : 'false'"
|
|
8
8
|
>
|
|
9
|
-
<
|
|
9
|
+
<BlokkliRootErrorBoundary v-if="isInEditor">
|
|
10
10
|
<PreviewProvider
|
|
11
11
|
v-if="isPreviewing"
|
|
12
12
|
v-slot="{ mutatedEntity }"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
:entity="mutatedEntity"
|
|
43
43
|
/>
|
|
44
44
|
</EditProvider>
|
|
45
|
-
</
|
|
45
|
+
</BlokkliRootErrorBoundary>
|
|
46
46
|
|
|
47
47
|
<slot
|
|
48
48
|
v-else
|
|
@@ -101,8 +101,8 @@ const PreviewProvider = defineAsyncComponent(
|
|
|
101
101
|
const EditProvider = defineAsyncComponent(
|
|
102
102
|
() => import("./Edit/EditProvider.vue")
|
|
103
103
|
);
|
|
104
|
-
const
|
|
105
|
-
() => import("./Edit/
|
|
104
|
+
const BlokkliRootErrorBoundary = defineAsyncComponent(
|
|
105
|
+
() => import("./Edit/BlokkliRootErrorBoundary.vue")
|
|
106
106
|
);
|
|
107
107
|
const EditIndicator = defineAsyncComponent(
|
|
108
108
|
() => import("./Edit/EditIndicator.vue")
|
|
@@ -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
|
*/
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
id="bk-blokkli-item-actions-dropdown"
|
|
4
|
+
class="bk-blokkli-item-actions-type-dropdown"
|
|
5
|
+
>
|
|
6
|
+
<div v-for="group in groups" :key="group.name">
|
|
7
|
+
<ol>
|
|
8
|
+
<li v-for="action in group.actions" :key="action.id">
|
|
9
|
+
<button
|
|
10
|
+
class="bk-blokkli-item-actions-type-dropdown-button"
|
|
11
|
+
:disabled="action.enabled === false"
|
|
12
|
+
@click.prevent="onActionClick(action)"
|
|
13
|
+
>
|
|
14
|
+
<div class="bk-blokkli-item-actions-type-dropdown-icon">
|
|
15
|
+
<Icon v-if="action.icon" :name="action.icon" />
|
|
16
|
+
<ItemIcon v-else-if="action.bundle" :bundle="action.bundle" />
|
|
17
|
+
</div>
|
|
18
|
+
<div>
|
|
19
|
+
<div>{{ action.label }}</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div v-if="action.description" class="bk-tooltip">
|
|
22
|
+
{{ action.description }}
|
|
23
|
+
</div>
|
|
24
|
+
</button>
|
|
25
|
+
</li>
|
|
26
|
+
</ol>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script setup>
|
|
32
|
+
import { useBlokkli } from "#imports";
|
|
33
|
+
import { ItemIcon, Icon } from "#blokkli/components";
|
|
34
|
+
const emit = defineEmits(["close"]);
|
|
35
|
+
const { plugins } = useBlokkli();
|
|
36
|
+
function getGroupedActions() {
|
|
37
|
+
const actions = plugins.get("itemDropdownAction");
|
|
38
|
+
const groups2 = /* @__PURE__ */ new Map();
|
|
39
|
+
for (const action of actions) {
|
|
40
|
+
const groupName = action.group;
|
|
41
|
+
if (!groups2.has(groupName)) {
|
|
42
|
+
groups2.set(groupName, {
|
|
43
|
+
name: groupName,
|
|
44
|
+
weight: action.weight ?? 100,
|
|
45
|
+
actions: []
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
groups2.get(groupName).actions.push(action);
|
|
49
|
+
}
|
|
50
|
+
return Array.from(groups2.values()).sort((a, b) => a.weight - b.weight);
|
|
51
|
+
}
|
|
52
|
+
const groups = getGroupedActions();
|
|
53
|
+
function onActionClick(action) {
|
|
54
|
+
if (action.enabled === false) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
action.callback();
|
|
58
|
+
emit("close");
|
|
59
|
+
}
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<script>
|
|
63
|
+
export default {
|
|
64
|
+
name: "EditActionsItemDropdown"
|
|
65
|
+
};
|
|
66
|
+
</script>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
2
|
+
close: () => any;
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
onClose?: (() => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
export default _default;
|