@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
package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/index.vue
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Teleport to="
|
|
2
|
+
<Teleport :to="ui.mainLayoutElement.value">
|
|
3
3
|
<slot :color="activeColorHex" :label="active?.label" />
|
|
4
4
|
</Teleport>
|
|
5
5
|
</template>
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "#blokkli/helpers";
|
|
16
16
|
import onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
|
|
17
17
|
import defineRenderer from "#blokkli/helpers/composables/defineRenderer";
|
|
18
|
-
import { ref, computed, useBlokkli
|
|
18
|
+
import { ref, computed, useBlokkli } from "#imports";
|
|
19
19
|
import {
|
|
20
20
|
setBuffersAndAttributes,
|
|
21
21
|
drawBufferInfo,
|
|
@@ -64,10 +64,6 @@ const {
|
|
|
64
64
|
types,
|
|
65
65
|
fields
|
|
66
66
|
} = useBlokkli();
|
|
67
|
-
const gl = animation.gl();
|
|
68
|
-
const canvas = animation.getCanvasElement();
|
|
69
|
-
const ctx = !gl && canvas ? canvas.getContext("2d") : null;
|
|
70
|
-
const programInfo = gl ? animation.registerProgram("drop_targets", gl, [vs, fs]) : null;
|
|
71
67
|
const areas = dropAreas.getDropAreas(props.items).reduce((acc, v) => {
|
|
72
68
|
acc[v.id] = v;
|
|
73
69
|
return acc;
|
|
@@ -157,10 +153,20 @@ const draggingBundles = computed(
|
|
|
157
153
|
}
|
|
158
154
|
} else if (item.itemBundle) {
|
|
159
155
|
bundles.push(item.itemBundle);
|
|
156
|
+
} else if (item.itemType === "action" && item.action.itemBundle) {
|
|
157
|
+
bundles.push(item.action.itemBundle);
|
|
160
158
|
}
|
|
161
159
|
return bundles;
|
|
162
160
|
}).filter(falsy)
|
|
163
161
|
);
|
|
162
|
+
const draggingFragments = computed(
|
|
163
|
+
() => props.items.flatMap((item) => {
|
|
164
|
+
if ((item.itemType === "existing" || item.itemType === "existing_structure") && item.block.bundle === "blokkli_fragment" && item.block.fragment?.name) {
|
|
165
|
+
return [item.block.fragment.name];
|
|
166
|
+
}
|
|
167
|
+
return [];
|
|
168
|
+
}).filter(falsy)
|
|
169
|
+
);
|
|
164
170
|
const selectionUuids = computed(
|
|
165
171
|
() => props.items.map((item) => {
|
|
166
172
|
if (item.itemType === "existing") {
|
|
@@ -182,6 +188,8 @@ const buildChildren = (field, visible) => {
|
|
|
182
188
|
const children = [];
|
|
183
189
|
let prevWasInSelection = false;
|
|
184
190
|
let prevUuid = "";
|
|
191
|
+
let prevElOffsetTop = 0;
|
|
192
|
+
let prevElHeight = 0;
|
|
185
193
|
for (let i = 0; i < field.childrenElements.length; i++) {
|
|
186
194
|
const childrenForUuid = [];
|
|
187
195
|
const isLast = i === field.childrenElements.length - 1;
|
|
@@ -189,16 +197,22 @@ const buildChildren = (field, visible) => {
|
|
|
189
197
|
if (!(el instanceof HTMLElement)) {
|
|
190
198
|
continue;
|
|
191
199
|
}
|
|
192
|
-
const uuid = el.dataset.
|
|
200
|
+
const uuid = el.dataset.bkUuid;
|
|
193
201
|
if (!uuid) {
|
|
194
202
|
continue;
|
|
195
203
|
}
|
|
196
204
|
if (!visible.includes(uuid)) {
|
|
205
|
+
const elRect2 = dom.getBlockRect(uuid) || ui.getAbsoluteElementRect(dom.getBoundingClientRect(el));
|
|
206
|
+
prevElOffsetTop = elRect2.y - field.y;
|
|
207
|
+
prevElHeight = el.scrollHeight;
|
|
197
208
|
prevUuid = uuid;
|
|
198
209
|
continue;
|
|
199
210
|
}
|
|
200
211
|
const cached = fieldChildCache[uuid];
|
|
201
212
|
if (cached) {
|
|
213
|
+
const elRect2 = dom.getBlockRect(uuid) || ui.getAbsoluteElementRect(dom.getBoundingClientRect(el));
|
|
214
|
+
prevElOffsetTop = elRect2.y - field.y;
|
|
215
|
+
prevElHeight = el.scrollHeight;
|
|
202
216
|
children.push(...cached);
|
|
203
217
|
prevUuid = uuid;
|
|
204
218
|
continue;
|
|
@@ -208,9 +222,10 @@ const buildChildren = (field, visible) => {
|
|
|
208
222
|
prevUuid = uuid;
|
|
209
223
|
continue;
|
|
210
224
|
}
|
|
211
|
-
const elRect = dom.getBlockRect(uuid) || ui.getAbsoluteElementRect(
|
|
225
|
+
const elRect = dom.getBlockRect(uuid) || ui.getAbsoluteElementRect(dom.getBoundingClientRect(el));
|
|
212
226
|
const elOffsetTop = elRect.y - field.y;
|
|
213
227
|
const elOffsetLeft = elRect.x - field.x;
|
|
228
|
+
const elHeight = el.scrollHeight;
|
|
214
229
|
if (isLast) {
|
|
215
230
|
const id2 = buildChildId(field.field, uuid, "last", uuid);
|
|
216
231
|
if (field.orientation === "vertical") {
|
|
@@ -219,7 +234,7 @@ const buildChildren = (field, visible) => {
|
|
|
219
234
|
width: field.width,
|
|
220
235
|
height: MIN_GAP,
|
|
221
236
|
x: 0,
|
|
222
|
-
y: elOffsetTop +
|
|
237
|
+
y: elOffsetTop + elHeight,
|
|
223
238
|
label: field.label
|
|
224
239
|
});
|
|
225
240
|
} else {
|
|
@@ -236,17 +251,28 @@ const buildChildren = (field, visible) => {
|
|
|
236
251
|
if (prevWasInSelection) {
|
|
237
252
|
prevWasInSelection = false;
|
|
238
253
|
prevUuid = uuid;
|
|
254
|
+
prevElOffsetTop = elOffsetTop;
|
|
255
|
+
prevElHeight = elHeight;
|
|
239
256
|
children.push(...childrenForUuid);
|
|
240
257
|
continue;
|
|
241
258
|
}
|
|
242
259
|
const id = buildChildId(field.field, prevUuid, "between", uuid);
|
|
243
260
|
if (field.orientation === "vertical") {
|
|
261
|
+
let dropTargetY;
|
|
262
|
+
if (prevElHeight > 0) {
|
|
263
|
+
const prevBlockBottom = prevElOffsetTop + prevElHeight;
|
|
264
|
+
const gapMiddle = (prevBlockBottom + elOffsetTop) / 2;
|
|
265
|
+
dropTargetY = gapMiddle - MIN_GAP / 2;
|
|
266
|
+
} else {
|
|
267
|
+
const gapMiddle = elOffsetTop / 2;
|
|
268
|
+
dropTargetY = gapMiddle - MIN_GAP / 2;
|
|
269
|
+
}
|
|
244
270
|
childrenForUuid.push({
|
|
245
271
|
id,
|
|
246
272
|
width: field.width,
|
|
247
273
|
height: MIN_GAP,
|
|
248
274
|
x: 0,
|
|
249
|
-
y:
|
|
275
|
+
y: dropTargetY,
|
|
250
276
|
label: field.label
|
|
251
277
|
});
|
|
252
278
|
} else {
|
|
@@ -261,6 +287,8 @@ const buildChildren = (field, visible) => {
|
|
|
261
287
|
}
|
|
262
288
|
fieldChildCache[uuid] = childrenForUuid;
|
|
263
289
|
children.push(...childrenForUuid);
|
|
290
|
+
prevElOffsetTop = elOffsetTop;
|
|
291
|
+
prevElHeight = elHeight;
|
|
264
292
|
prevUuid = uuid;
|
|
265
293
|
}
|
|
266
294
|
return children;
|
|
@@ -320,7 +348,8 @@ const buildFieldRect = (key) => {
|
|
|
320
348
|
selectionUuids.value,
|
|
321
349
|
currentCount,
|
|
322
350
|
props.items.length,
|
|
323
|
-
draggingBundles.value
|
|
351
|
+
draggingBundles.value,
|
|
352
|
+
draggingFragments.value
|
|
324
353
|
);
|
|
325
354
|
const orientation = field.dropAlignment || getChildrenOrientation(field.element);
|
|
326
355
|
const rect = dom.getFieldRect(field.key);
|
|
@@ -371,7 +400,7 @@ const buildDropAreaRect = (area) => {
|
|
|
371
400
|
cachedDropAreaRects[area.id] = dropAreaRect;
|
|
372
401
|
return dropAreaRect;
|
|
373
402
|
};
|
|
374
|
-
const alphaBase =
|
|
403
|
+
const alphaBase = 0.7;
|
|
375
404
|
const colorTeal = rgbaToString(theme.teal.value.normal);
|
|
376
405
|
const colorTealAlpha = rgbaToString(theme.teal.value.normal, alphaBase);
|
|
377
406
|
const colorAccent = rgbaToString(theme.accent.value[800]);
|
|
@@ -387,7 +416,7 @@ function getRectType(field) {
|
|
|
387
416
|
return 1 /* FIELD_1 */;
|
|
388
417
|
}
|
|
389
418
|
class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
|
|
390
|
-
getBufferInfo() {
|
|
419
|
+
getBufferInfo(gl) {
|
|
391
420
|
const visibleFields = dom.getVisibleFields();
|
|
392
421
|
const visibleBlocks = dom.getVisibleBlocks();
|
|
393
422
|
const lengthBefore = this.positions.length;
|
|
@@ -450,8 +479,8 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
450
479
|
}
|
|
451
480
|
this.processPendingRects();
|
|
452
481
|
const hasChanged = lengthBefore !== this.positions.length;
|
|
453
|
-
if (hasChanged) {
|
|
454
|
-
this.bufferInfo = this.createBufferInfo();
|
|
482
|
+
if (hasChanged && gl) {
|
|
483
|
+
this.bufferInfo = this.createBufferInfo(gl);
|
|
455
484
|
}
|
|
456
485
|
return { info: this.bufferInfo, hasChanged };
|
|
457
486
|
}
|
|
@@ -488,26 +517,6 @@ class DropTargetRectangleBufferCollector extends RectangleBufferCollector {
|
|
|
488
517
|
return null;
|
|
489
518
|
}
|
|
490
519
|
}
|
|
491
|
-
const collector = new DropTargetRectangleBufferCollector(gl, {
|
|
492
|
-
deferredMode: true
|
|
493
|
-
});
|
|
494
|
-
if (gl) {
|
|
495
|
-
collector.addRectangle(
|
|
496
|
-
{
|
|
497
|
-
id: "active-hover-rect",
|
|
498
|
-
type: "active-area",
|
|
499
|
-
label: "Field Area",
|
|
500
|
-
color: "red",
|
|
501
|
-
colorAlpha: "red",
|
|
502
|
-
x: 0,
|
|
503
|
-
y: 0,
|
|
504
|
-
width: ui.artboardSize.value.width,
|
|
505
|
-
height: ui.artboardSize.value.height
|
|
506
|
-
},
|
|
507
|
-
5 /* ACTIVE_AREA */,
|
|
508
|
-
false
|
|
509
|
-
);
|
|
510
|
-
}
|
|
511
520
|
const fieldColors = computed(() => {
|
|
512
521
|
return {
|
|
513
522
|
"0": theme.accent.value[900],
|
|
@@ -632,72 +641,109 @@ function setHoveredFieldArea(box, mouse) {
|
|
|
632
641
|
}
|
|
633
642
|
let bufferInfo = null;
|
|
634
643
|
let bufferChanged = false;
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
644
|
+
const { collector } = defineRenderer("drop-targets", {
|
|
645
|
+
zIndex: 400,
|
|
646
|
+
only: true,
|
|
647
|
+
collector: () => {
|
|
648
|
+
const c = new DropTargetRectangleBufferCollector({ deferredMode: true });
|
|
649
|
+
c.addRectangle(
|
|
650
|
+
{
|
|
651
|
+
id: "active-hover-rect",
|
|
652
|
+
type: "active-area",
|
|
653
|
+
label: "Field Area",
|
|
654
|
+
color: "red",
|
|
655
|
+
colorAlpha: "red",
|
|
656
|
+
x: 0,
|
|
657
|
+
y: 0,
|
|
658
|
+
width: ui.artboardSize.value.width,
|
|
659
|
+
height: ui.artboardSize.value.height
|
|
660
|
+
},
|
|
661
|
+
5 /* ACTIVE_AREA */,
|
|
662
|
+
false
|
|
663
|
+
);
|
|
664
|
+
return c;
|
|
665
|
+
},
|
|
666
|
+
program: () => ({ shaders: [vs, fs] }),
|
|
667
|
+
cursor: () => "grabbing",
|
|
668
|
+
render: (_ctx, gl, program) => {
|
|
669
|
+
const scale = ui.artboardScale.value;
|
|
670
|
+
const offset = { ...ui.artboardOffset.value };
|
|
671
|
+
dragBox.value = {
|
|
672
|
+
x: (props.box.x - offset.x) / scale,
|
|
673
|
+
y: (props.box.y - offset.y) / scale,
|
|
674
|
+
width: props.box.width / scale,
|
|
675
|
+
height: props.box.height / scale
|
|
676
|
+
};
|
|
677
|
+
const mouseAbsolute = toCanvasSpaceCoordinates(props.mouseX, props.mouseY);
|
|
678
|
+
const result = collector.getBufferInfo(gl);
|
|
679
|
+
bufferInfo = result.info;
|
|
680
|
+
bufferChanged = result.hasChanged;
|
|
681
|
+
if (!props.isTouch) {
|
|
682
|
+
if (cursorIsInsideClipped()) {
|
|
683
|
+
const closest = collector.getClosestIntersectingRect(
|
|
684
|
+
dragBox.value,
|
|
685
|
+
mouseAbsolute
|
|
686
|
+
);
|
|
687
|
+
active.value = closest || null;
|
|
688
|
+
} else {
|
|
689
|
+
active.value = null;
|
|
690
|
+
}
|
|
657
691
|
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
692
|
+
setHoveredFieldArea(dragBox.value, mouseAbsolute);
|
|
693
|
+
gl.useProgram(program.program);
|
|
694
|
+
animation.setSharedUniforms(gl, program);
|
|
695
|
+
setUniforms(program, uniforms.value);
|
|
696
|
+
if (!bufferInfo) {
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
if (bufferChanged) {
|
|
700
|
+
setBuffersAndAttributes(gl, program, bufferInfo);
|
|
701
|
+
}
|
|
702
|
+
drawBufferInfo(gl, bufferInfo, gl.TRIANGLES);
|
|
703
|
+
},
|
|
704
|
+
renderFallback: (ctx, ctx2d) => {
|
|
705
|
+
const scale = ui.artboardScale.value;
|
|
706
|
+
const offset = { ...ui.artboardOffset.value };
|
|
707
|
+
dragBox.value = {
|
|
708
|
+
x: (props.box.x - offset.x) / scale,
|
|
709
|
+
y: (props.box.y - offset.y) / scale,
|
|
710
|
+
width: props.box.width / scale,
|
|
711
|
+
height: props.box.height / scale
|
|
712
|
+
};
|
|
713
|
+
const mouseAbsolute = toCanvasSpaceCoordinates(props.mouseX, props.mouseY);
|
|
714
|
+
const result = collector.getBufferInfo(void 0);
|
|
715
|
+
bufferInfo = result.info;
|
|
716
|
+
bufferChanged = result.hasChanged;
|
|
717
|
+
if (!props.isTouch) {
|
|
718
|
+
if (cursorIsInsideClipped()) {
|
|
719
|
+
const closest = collector.getClosestIntersectingRect(
|
|
720
|
+
dragBox.value,
|
|
721
|
+
mouseAbsolute
|
|
722
|
+
);
|
|
723
|
+
active.value = closest || null;
|
|
724
|
+
} else {
|
|
725
|
+
active.value = null;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
setHoveredFieldArea(dragBox.value, mouseAbsolute);
|
|
662
729
|
const rects = Object.values(collector.rects);
|
|
663
730
|
for (let i = 0; i < rects.length; i++) {
|
|
664
731
|
const rect = rects[i];
|
|
732
|
+
if (rect.id === "active-hover-rect") {
|
|
733
|
+
continue;
|
|
734
|
+
}
|
|
665
735
|
if (active.value?.id === rect.id) {
|
|
666
|
-
|
|
736
|
+
ctx2d.fillStyle = rect.color;
|
|
667
737
|
} else {
|
|
668
|
-
|
|
738
|
+
ctx2d.fillStyle = rect.colorAlpha;
|
|
669
739
|
}
|
|
670
|
-
|
|
671
|
-
(rect.x * scale + offset.x) *
|
|
672
|
-
(rect.y * scale + offset.y) *
|
|
673
|
-
rect.width *
|
|
674
|
-
rect.height *
|
|
740
|
+
ctx2d.fillRect(
|
|
741
|
+
(rect.x * scale + offset.x) * ctx.dpi,
|
|
742
|
+
(rect.y * scale + offset.y) * ctx.dpi,
|
|
743
|
+
rect.width * ctx.dpi * scale,
|
|
744
|
+
rect.height * ctx.dpi * scale
|
|
675
745
|
);
|
|
676
746
|
}
|
|
677
747
|
}
|
|
678
748
|
});
|
|
679
|
-
if (gl && programInfo) {
|
|
680
|
-
defineRenderer("drop-targets", {
|
|
681
|
-
zIndex: 400,
|
|
682
|
-
only: true,
|
|
683
|
-
cursor: () => "grabbing",
|
|
684
|
-
render: () => {
|
|
685
|
-
gl.useProgram(programInfo.program);
|
|
686
|
-
animation.setSharedUniforms(gl, programInfo);
|
|
687
|
-
setUniforms(programInfo, uniforms.value);
|
|
688
|
-
if (!bufferInfo) {
|
|
689
|
-
return;
|
|
690
|
-
}
|
|
691
|
-
if (bufferChanged) {
|
|
692
|
-
setBuffersAndAttributes(gl, programInfo, bufferInfo);
|
|
693
|
-
}
|
|
694
|
-
drawBufferInfo(gl, bufferInfo, gl.TRIANGLES);
|
|
695
|
-
}
|
|
696
|
-
});
|
|
697
|
-
}
|
|
698
|
-
onBeforeUnmount(() => {
|
|
699
|
-
if (ctx) {
|
|
700
|
-
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
701
|
-
}
|
|
702
|
-
});
|
|
703
749
|
</script>
|
package/dist/runtime/components/Edit/Features/DraggingOverlay/{DropTargets → Renderer}/vertex.glsl
RENAMED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
#version 300 es
|
|
2
|
+
|
|
1
3
|
precision highp float;
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
in vec2 a_position;
|
|
6
|
+
in vec4 a_quad;
|
|
7
|
+
in float a_rect_id;
|
|
8
|
+
in float a_rect_type;
|
|
7
9
|
|
|
8
10
|
uniform float u_scale;
|
|
9
11
|
uniform float u_offset_x;
|
|
@@ -20,10 +22,20 @@ uniform vec4 u_active_hover_rect;
|
|
|
20
22
|
uniform float u_active_hover_nesting_level;
|
|
21
23
|
uniform float u_dpi;
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
out vec4 v_quad;
|
|
26
|
+
out float v_intersecting;
|
|
27
|
+
out float v_is_hover_area;
|
|
28
|
+
out vec3 v_color;
|
|
29
|
+
|
|
30
|
+
// Optimized varyings - values computed once per vertex instead of per pixel
|
|
31
|
+
out vec2 v_size;
|
|
32
|
+
out vec2 v_location;
|
|
33
|
+
out vec2 v_size_inner;
|
|
34
|
+
out float v_thickness;
|
|
35
|
+
out float v_edge_softness;
|
|
36
|
+
out float v_radius_outer;
|
|
37
|
+
out float v_radius_inner;
|
|
38
|
+
out float v_fill_alpha;
|
|
27
39
|
|
|
28
40
|
vec4 getQuad() {
|
|
29
41
|
if (a_rect_type >= 5.0) {
|
|
@@ -61,6 +73,8 @@ void main() {
|
|
|
61
73
|
|
|
62
74
|
v_is_hover_area = a_rect_type >= 5.0 ? 1.0 : 0.0;
|
|
63
75
|
|
|
76
|
+
bool is_drop_target = a_rect_type <= 0.5;
|
|
77
|
+
|
|
64
78
|
// Set correct colors based on type.
|
|
65
79
|
if (a_rect_type < 1.0) {
|
|
66
80
|
v_color = u_color_area;
|
|
@@ -75,4 +89,42 @@ void main() {
|
|
|
75
89
|
} else {
|
|
76
90
|
v_color = u_color_hover_area;
|
|
77
91
|
}
|
|
92
|
+
|
|
93
|
+
// Compute values that are constant per quad (optimization)
|
|
94
|
+
bool isHoverArea = v_is_hover_area >= 1.0;
|
|
95
|
+
float stroke = isHoverArea ? 0.5 : 1.0;
|
|
96
|
+
float radiusBase = stroke * u_scale;
|
|
97
|
+
|
|
98
|
+
v_thickness = max(min(1.0 * u_scale, 3.0), 0.5);
|
|
99
|
+
|
|
100
|
+
// Calculate inset to draw border inside the quad
|
|
101
|
+
float inset = max(min(2.0 * u_scale, 1.0), 3.0) * v_thickness + stroke;
|
|
102
|
+
|
|
103
|
+
// Rectangle dimensions with inset
|
|
104
|
+
float u_rect_x = transformed_quad.x + inset;
|
|
105
|
+
float u_rect_y = transformed_quad.y + inset;
|
|
106
|
+
float u_rectWidth = transformed_quad.z - 2.0 * inset;
|
|
107
|
+
float u_rectHeight = transformed_quad.w - 2.0 * inset;
|
|
108
|
+
|
|
109
|
+
v_size = vec2(u_rectWidth, u_rectHeight);
|
|
110
|
+
|
|
111
|
+
// Center position of the rectangle
|
|
112
|
+
v_location = vec2(u_rect_x + v_size.x / 2.0, u_rect_y + v_size.y / 2.0);
|
|
113
|
+
|
|
114
|
+
v_edge_softness = 0.5 * u_dpi;
|
|
115
|
+
|
|
116
|
+
float borderWidth = stroke * u_scale * u_dpi;
|
|
117
|
+
|
|
118
|
+
// Different radius for inner and outer
|
|
119
|
+
v_radius_outer =
|
|
120
|
+
min(radiusBase * u_dpi, min(v_size.x, v_size.y)) + v_thickness;
|
|
121
|
+
v_radius_inner = v_radius_outer - borderWidth;
|
|
122
|
+
|
|
123
|
+
v_size_inner = v_size - 2.0 * borderWidth;
|
|
124
|
+
|
|
125
|
+
if (is_drop_target) {
|
|
126
|
+
v_fill_alpha = v_intersecting >= 0.5 ? 0.5 : 0.2;
|
|
127
|
+
} else {
|
|
128
|
+
v_fill_alpha = v_intersecting >= 0.5 ? 1.0 : 0.2;
|
|
129
|
+
}
|
|
78
130
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<Renderer
|
|
3
3
|
v-if="dragItems.length && isVisible"
|
|
4
4
|
v-slot="{ color, label }"
|
|
5
5
|
:items="dragItems"
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
:active-color="color"
|
|
19
19
|
:active-label="label"
|
|
20
20
|
/>
|
|
21
|
-
</
|
|
21
|
+
</Renderer>
|
|
22
22
|
</template>
|
|
23
23
|
|
|
24
24
|
<script setup>
|
|
25
25
|
import DragItems from "./DragItems/index.vue";
|
|
26
|
-
import
|
|
26
|
+
import Renderer from "./Renderer/index.vue";
|
|
27
27
|
import {
|
|
28
28
|
ref,
|
|
29
29
|
useBlokkli,
|
|
@@ -188,8 +188,7 @@ const onDropSearchContentItem = async (item, host, afterUuid) => {
|
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
const onDropAction = (action, host, field, afterUuid) => {
|
|
191
|
-
|
|
192
|
-
id: action.actionType,
|
|
191
|
+
action.action.callback({
|
|
193
192
|
preceedingUuid: afterUuid,
|
|
194
193
|
host,
|
|
195
194
|
field
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Teleport to="
|
|
2
|
+
<Teleport :to="ui.mainLayoutElement.value">
|
|
3
3
|
<BlokkliTransition name="slide-in">
|
|
4
4
|
<FormOverlay
|
|
5
5
|
v-if="form"
|
|
@@ -32,7 +32,7 @@ const { adapter } = defineBlokkliFeature({
|
|
|
32
32
|
description: "Listens to edit events and renders an iframe containing the edit form.",
|
|
33
33
|
requiredAdapterMethods: ["formFrameBuilder"]
|
|
34
34
|
});
|
|
35
|
-
const { types, state, context, $t, dom, definitions, blocks } = useBlokkli();
|
|
35
|
+
const { types, state, context, $t, dom, definitions, blocks, ui } = useBlokkli();
|
|
36
36
|
const form = ref(null);
|
|
37
37
|
const formUrl = computed(() => {
|
|
38
38
|
if (form.value) {
|
|
@@ -166,9 +166,6 @@ const close = async () => {
|
|
|
166
166
|
el.textContent = originalText.value;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
if (el) {
|
|
170
|
-
el.dataset.blokkliEditableActive = void 0;
|
|
171
|
-
}
|
|
172
169
|
};
|
|
173
170
|
watch(modelValue, (newText) => {
|
|
174
171
|
if (props.element && selection.editableActive.value && !props.isComponent) {
|
|
@@ -232,7 +229,6 @@ onMounted(() => {
|
|
|
232
229
|
}
|
|
233
230
|
originalText.value = modelValue.value;
|
|
234
231
|
selection.editableActive.value = true;
|
|
235
|
-
el.dataset.blokkliEditableActive = "true";
|
|
236
232
|
const computedStyle = window.getComputedStyle(el);
|
|
237
233
|
inputStyle.value = {
|
|
238
234
|
textAlign: computedStyle.textAlign
|
|
@@ -246,8 +242,6 @@ onMounted(() => {
|
|
|
246
242
|
});
|
|
247
243
|
});
|
|
248
244
|
onBeforeUnmount(async () => {
|
|
249
|
-
const el = getElement();
|
|
250
245
|
await close();
|
|
251
|
-
el.dataset.blokkliEditableActive = void 0;
|
|
252
246
|
});
|
|
253
247
|
</script>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Teleport to="
|
|
2
|
+
<Teleport :to="ui.mainLayoutElement.value">
|
|
3
3
|
<BlokkliTransition name="caret-tooltip" :enabled="hasTransition">
|
|
4
4
|
<Overlay
|
|
5
5
|
v-if="selectedEditable"
|
|
@@ -32,7 +32,7 @@ defineBlokkliFeature({
|
|
|
32
32
|
requiredAdapterMethods: ["updateFieldValue", "getEditableFieldConfig"],
|
|
33
33
|
description: "Implements a form overlay to edit a single field of a block."
|
|
34
34
|
});
|
|
35
|
-
const { selection, adapter, types, $t, state, directive, blocks, context } = useBlokkli();
|
|
35
|
+
const { selection, adapter, types, $t, state, directive, blocks, context, ui } = useBlokkli();
|
|
36
36
|
const selectedEditable = ref(null);
|
|
37
37
|
const hasTransition = ref(false);
|
|
38
38
|
const key = computed(() => {
|
|
@@ -85,12 +85,16 @@ const buildEditable = (fieldName, uuid) => {
|
|
|
85
85
|
if (!(element instanceof HTMLElement)) {
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
|
+
const editable = directive.findEditable(fieldName, host);
|
|
89
|
+
if (!editable) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
88
92
|
return {
|
|
89
93
|
fieldName,
|
|
90
94
|
host,
|
|
91
95
|
element,
|
|
92
|
-
isComponent:
|
|
93
|
-
value:
|
|
96
|
+
isComponent: editable.isComponent,
|
|
97
|
+
value: editable.getValue ? editable.getValue() : "",
|
|
94
98
|
config
|
|
95
99
|
};
|
|
96
100
|
};
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
id="exit"
|
|
4
|
-
:title="$t('exitTitle', 'Close')"
|
|
5
|
-
:description="$t('exitDescription', 'Close editor without publishing')"
|
|
6
|
-
:weight="100"
|
|
7
|
-
icon="exit"
|
|
8
|
-
@click="onClick"
|
|
9
|
-
/>
|
|
2
|
+
<div />
|
|
10
3
|
</template>
|
|
11
4
|
|
|
12
5
|
<script setup>
|
|
13
6
|
import { useBlokkli, useRoute, nextTick, defineBlokkliFeature } from "#imports";
|
|
14
|
-
import
|
|
7
|
+
import defineMenuButton from "#blokkli/helpers/composables/defineMenuButton";
|
|
15
8
|
defineBlokkliFeature({
|
|
16
9
|
id: "exit",
|
|
17
10
|
label: "Exit",
|
|
@@ -26,6 +19,16 @@ function onClick() {
|
|
|
26
19
|
window.location.href = route.path;
|
|
27
20
|
});
|
|
28
21
|
}
|
|
22
|
+
defineMenuButton(() => {
|
|
23
|
+
return {
|
|
24
|
+
id: "exit",
|
|
25
|
+
title: $t("exitTitle", "Close"),
|
|
26
|
+
description: $t("exitDescription", "Close editor without publishing"),
|
|
27
|
+
icon: "exit",
|
|
28
|
+
weight: 100,
|
|
29
|
+
callback: onClick
|
|
30
|
+
};
|
|
31
|
+
});
|
|
29
32
|
</script>
|
|
30
33
|
|
|
31
34
|
<script>
|
|
@@ -10,11 +10,7 @@
|
|
|
10
10
|
:class="backgroundClass"
|
|
11
11
|
>
|
|
12
12
|
<ScaleToFit :width="previewWidth" :max-height="500">
|
|
13
|
-
<BlokkliItem
|
|
14
|
-
v-bind="item"
|
|
15
|
-
parent-type="nested"
|
|
16
|
-
class="bk-drop-element"
|
|
17
|
-
/>
|
|
13
|
+
<BlokkliItem v-bind="item" parent-type="nested" />
|
|
18
14
|
</ScaleToFit>
|
|
19
15
|
</div>
|
|
20
16
|
</div>
|