@blokkli/editor 2.0.0-alpha.15 → 2.0.0-alpha.17
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 +330 -93
- package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +1 -1
- package/dist/modules/drupal/graphql/features/comments.graphql +11 -8
- package/dist/modules/drupal/runtime/adapter/index.js +2 -2
- package/dist/runtime/blokkliPlugins/ItemAction/index.vue +1 -3
- package/dist/runtime/components/Blocks/FromLibrary/index.vue +4 -2
- package/dist/runtime/components/BlokkliEditable.vue +22 -4
- package/dist/runtime/components/BlokkliProvider.vue +29 -20
- package/dist/runtime/components/BlokkliProvider.vue.d.ts +2 -1
- package/dist/runtime/components/Edit/Actions/index.vue +9 -4
- package/dist/runtime/components/Edit/AnimationCanvas/index.vue +420 -25
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +80 -0
- package/dist/runtime/components/Edit/ArtboardTooltip/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Banner/index.vue +51 -0
- package/dist/runtime/components/Edit/Banner/index.vue.d.ts +18 -0
- package/dist/runtime/components/Edit/Dialog/index.vue +3 -0
- package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/EditIndicator.vue +118 -44
- package/dist/runtime/components/Edit/EditIndicator.vue.d.ts +3 -0
- package/dist/runtime/components/Edit/EditProvider.vue +79 -22
- package/dist/runtime/components/Edit/EditProvider.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +19 -20
- package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +2 -0
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +35 -20
- package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue.d.ts +5 -3
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue +29 -0
- package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue.d.ts +13 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +22 -16
- package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +15 -6
- package/dist/runtime/components/Edit/Features/Comments/index.vue +20 -8
- package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +26 -35
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +240 -0
- package/dist/runtime/components/Edit/Features/Debug/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Debug/index.vue +4 -165
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +7 -1
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +62 -39
- package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +1 -0
- package/dist/runtime/components/Edit/Features/Edit/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +63 -3
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +13 -9
- package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +17 -76
- package/dist/runtime/components/Edit/Features/EditableField/index.vue +1 -1
- package/dist/runtime/components/Edit/Features/History/index.vue +5 -2
- package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +139 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue +270 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Hover/Overlay/vertex.glsl +117 -0
- package/dist/runtime/components/Edit/Features/Hover/index.vue +25 -0
- package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +19 -27
- package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +27 -23
- package/dist/runtime/components/Edit/Features/Library/index.vue +2 -1
- package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +34 -27
- package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +2 -4
- package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +6 -1
- package/dist/runtime/components/Edit/Features/Options/Form/index.vue +1 -0
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue +35 -0
- package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue.d.ts +6 -0
- package/dist/runtime/components/Edit/Features/Ownership/index.vue +7 -25
- package/dist/runtime/components/Edit/Features/ProxyView/index.vue +5 -1
- package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue +2 -2
- package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +17 -7
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +39 -74
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +4 -2
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +106 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +417 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue.d.ts +32 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +102 -0
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +33 -106
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +88 -29
- package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue.d.ts +2 -0
- package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +11 -2
- package/dist/runtime/components/Edit/Features/Selection/index.vue +26 -19
- package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +17 -11
- package/dist/runtime/components/Edit/Features/Translations/index.vue +13 -16
- package/dist/runtime/components/Edit/Form/Text/index.vue +2 -1
- package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +1 -0
- package/dist/runtime/components/Edit/Indicators/index.vue +1 -1
- package/dist/runtime/components/Edit/Konami/Game/index.vue +5 -5
- package/dist/runtime/components/Edit/index.d.ts +5 -3
- package/dist/runtime/components/Edit/index.js +8 -4
- package/dist/runtime/composables/defineBlokkli.js +5 -3
- package/dist/runtime/css/output.css +1 -1
- package/dist/runtime/helpers/animationProvider.d.ts +34 -1
- package/dist/runtime/helpers/animationProvider.js +175 -48
- package/dist/runtime/helpers/composables/defineRenderer.d.ts +8 -0
- package/dist/runtime/helpers/composables/defineRenderer.js +8 -0
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.d.ts +1 -1
- package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.js +3 -2
- package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +4 -1
- package/dist/runtime/helpers/composables/useStickyToolbar.js +53 -35
- package/dist/runtime/helpers/dom/index.d.ts +1 -0
- package/dist/runtime/helpers/domProvider.d.ts +46 -0
- package/dist/runtime/helpers/domProvider.js +101 -7
- package/dist/runtime/helpers/editableProvider.d.ts +14 -0
- package/dist/runtime/helpers/editableProvider.js +144 -0
- package/dist/runtime/helpers/stateProvider.d.ts +6 -2
- package/dist/runtime/helpers/stateProvider.js +66 -3
- package/dist/runtime/helpers/storageProvider.d.ts +3 -2
- package/dist/runtime/helpers/storageProvider.js +6 -2
- package/dist/runtime/helpers/symbols.d.ts +1 -0
- package/dist/runtime/helpers/symbols.js +1 -0
- package/dist/runtime/helpers/uiProvider.d.ts +8 -1
- package/dist/runtime/helpers/uiProvider.js +34 -2
- package/dist/runtime/helpers/webgl/index.d.ts +11 -2
- package/dist/runtime/helpers/webgl/index.js +162 -7
- package/dist/runtime/plugins/blokkliEditable.js +74 -3
- package/dist/runtime/types/index.d.ts +13 -1
- package/package.json +1 -1
- package/dist/runtime/components/Edit/DragInteractions/index.vue +0 -401
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue +0 -54
- package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue.d.ts +0 -14
- /package/dist/runtime/components/Edit/{DragInteractions → Features/Hover}/index.vue.d.ts +0 -0
|
@@ -14,12 +14,18 @@ export class RectangleBufferCollector {
|
|
|
14
14
|
index = 0;
|
|
15
15
|
bufferInfo = null;
|
|
16
16
|
placedRects = [];
|
|
17
|
-
|
|
17
|
+
deferredMode = false;
|
|
18
|
+
pendingRects = [];
|
|
19
|
+
constructor(gl, options) {
|
|
18
20
|
this.gl = gl;
|
|
21
|
+
this.deferredMode = options?.deferredMode || false;
|
|
19
22
|
}
|
|
20
23
|
reset() {
|
|
21
24
|
this.added = /* @__PURE__ */ new Set();
|
|
22
|
-
this.
|
|
25
|
+
if (!this.deferredMode) {
|
|
26
|
+
this.rects = {};
|
|
27
|
+
}
|
|
28
|
+
this.placedRects = [];
|
|
23
29
|
this.positions = [];
|
|
24
30
|
this.indices = [];
|
|
25
31
|
this.rectId = [];
|
|
@@ -29,8 +35,10 @@ export class RectangleBufferCollector {
|
|
|
29
35
|
this.radius = [];
|
|
30
36
|
this.index = 0;
|
|
31
37
|
this.bufferInfo = null;
|
|
38
|
+
this.pendingRects = [];
|
|
32
39
|
}
|
|
33
|
-
getIdealPosition(x, y, width, height) {
|
|
40
|
+
getIdealPosition(x, y, width, height, isEmptyField = false) {
|
|
41
|
+
const MIN_HEIGHT = 5;
|
|
34
42
|
const rect = {
|
|
35
43
|
x,
|
|
36
44
|
y,
|
|
@@ -40,19 +48,63 @@ export class RectangleBufferCollector {
|
|
|
40
48
|
};
|
|
41
49
|
const intersections = [];
|
|
42
50
|
for (let i = 0; i < this.placedRects.length; i++) {
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
const placed = this.placedRects[i];
|
|
52
|
+
const testRect = { ...rect, height: Math.max(height, MIN_HEIGHT) };
|
|
53
|
+
const testPlaced = {
|
|
54
|
+
...placed,
|
|
55
|
+
height: Math.max(placed.height, MIN_HEIGHT)
|
|
56
|
+
};
|
|
57
|
+
if (intersects(testRect, testPlaced)) {
|
|
58
|
+
intersections.push(placed);
|
|
45
59
|
}
|
|
46
60
|
}
|
|
47
61
|
if (intersections.length === 0) {
|
|
48
62
|
this.placedRects.push(rect);
|
|
49
63
|
return rect;
|
|
50
64
|
}
|
|
51
|
-
intersections.sort((a, b) =>
|
|
65
|
+
intersections.sort((a, b) => a.originalY - b.originalY);
|
|
66
|
+
if (isEmptyField) {
|
|
67
|
+
for (let i = 0; i < intersections.length; i++) {
|
|
68
|
+
const existingRect = intersections[i];
|
|
69
|
+
const rectsAbove = this.placedRects.filter(
|
|
70
|
+
(r) => r.y + r.height <= existingRect.y && r.x < x + width && r.x + r.width > x
|
|
71
|
+
);
|
|
72
|
+
let prevBottom = 0;
|
|
73
|
+
if (rectsAbove.length > 0) {
|
|
74
|
+
prevBottom = Math.max(...rectsAbove.map((r) => r.y + r.height));
|
|
75
|
+
}
|
|
76
|
+
const nextTop = existingRect.y;
|
|
77
|
+
const availableSpace = nextTop - prevBottom;
|
|
78
|
+
if (availableSpace >= height) {
|
|
79
|
+
const centeredY = prevBottom + (availableSpace - height) / 2;
|
|
80
|
+
const centeredRect = { ...rect, y: centeredY };
|
|
81
|
+
let hasIntersection = false;
|
|
82
|
+
for (const placed of this.placedRects) {
|
|
83
|
+
const testCentered = {
|
|
84
|
+
...centeredRect,
|
|
85
|
+
height: Math.max(height, MIN_HEIGHT)
|
|
86
|
+
};
|
|
87
|
+
const testPlaced = {
|
|
88
|
+
...placed,
|
|
89
|
+
height: Math.max(placed.height, MIN_HEIGHT)
|
|
90
|
+
};
|
|
91
|
+
if (intersects(testCentered, testPlaced)) {
|
|
92
|
+
hasIntersection = true;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (!hasIntersection) {
|
|
97
|
+
rect.y = centeredY;
|
|
98
|
+
this.placedRects.push(rect);
|
|
99
|
+
return rect;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
52
104
|
for (let i = 0; i < intersections.length; i++) {
|
|
53
105
|
const existingRect = intersections[i];
|
|
54
106
|
let iterations = 0;
|
|
55
|
-
const direction = y
|
|
107
|
+
const direction = y < existingRect.originalY ? -1 : 1;
|
|
56
108
|
while (intersects(rect, existingRect) && iterations < 10) {
|
|
57
109
|
rect.y = y + direction * (10 * (iterations + 1));
|
|
58
110
|
iterations++;
|
|
@@ -65,6 +117,10 @@ export class RectangleBufferCollector {
|
|
|
65
117
|
return rect;
|
|
66
118
|
}
|
|
67
119
|
addRectangle(rect, type, checkOverlap = false) {
|
|
120
|
+
if (this.deferredMode) {
|
|
121
|
+
this.pendingRects.push({ rect, type, checkOverlap });
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
68
124
|
const { x, y, width, height } = checkOverlap ? this.getIdealPosition(rect.x, rect.y, rect.width, rect.height) : rect;
|
|
69
125
|
this.positions.push(
|
|
70
126
|
x,
|
|
@@ -119,6 +175,105 @@ export class RectangleBufferCollector {
|
|
|
119
175
|
this.added.add(rect.id);
|
|
120
176
|
this.index++;
|
|
121
177
|
}
|
|
178
|
+
processPendingRects() {
|
|
179
|
+
if (!this.deferredMode) {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
if (!this.pendingRects.length) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const sortedPending = [...this.pendingRects].sort(
|
|
186
|
+
(a, b) => a.rect.y - b.rect.y
|
|
187
|
+
);
|
|
188
|
+
const passes = [
|
|
189
|
+
sortedPending.filter((p) => !p.rect.id.includes(":empty:")),
|
|
190
|
+
// Non-empty rects
|
|
191
|
+
sortedPending.filter((p) => p.rect.id.includes(":empty:"))
|
|
192
|
+
// Empty rects
|
|
193
|
+
];
|
|
194
|
+
for (const pass of passes) {
|
|
195
|
+
for (const { rect, type, checkOverlap } of pass) {
|
|
196
|
+
if (this.added.has(rect.id)) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
let finalPosition;
|
|
200
|
+
const existing = this.rects[rect.id];
|
|
201
|
+
if (existing) {
|
|
202
|
+
finalPosition = {
|
|
203
|
+
x: existing.x,
|
|
204
|
+
y: existing.y,
|
|
205
|
+
width: existing.width,
|
|
206
|
+
height: existing.height
|
|
207
|
+
};
|
|
208
|
+
} else if (checkOverlap) {
|
|
209
|
+
const isEmptyField = rect.id.includes(":empty:");
|
|
210
|
+
finalPosition = this.getIdealPosition(
|
|
211
|
+
rect.x,
|
|
212
|
+
rect.y,
|
|
213
|
+
rect.width,
|
|
214
|
+
rect.height,
|
|
215
|
+
isEmptyField
|
|
216
|
+
);
|
|
217
|
+
} else {
|
|
218
|
+
finalPosition = {
|
|
219
|
+
x: rect.x,
|
|
220
|
+
y: rect.y,
|
|
221
|
+
width: rect.width,
|
|
222
|
+
height: rect.height
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
const { x, y, width, height } = finalPosition;
|
|
226
|
+
this.positions.push(
|
|
227
|
+
x,
|
|
228
|
+
y,
|
|
229
|
+
// Lower left corner
|
|
230
|
+
0,
|
|
231
|
+
x + width,
|
|
232
|
+
y,
|
|
233
|
+
// Lower right corner
|
|
234
|
+
1,
|
|
235
|
+
x + width,
|
|
236
|
+
y + height,
|
|
237
|
+
// Upper right corner
|
|
238
|
+
2,
|
|
239
|
+
x,
|
|
240
|
+
y + height,
|
|
241
|
+
// Upper left corner
|
|
242
|
+
3
|
|
243
|
+
);
|
|
244
|
+
const baseIndex = 4 * this.index;
|
|
245
|
+
this.indices.push(
|
|
246
|
+
baseIndex,
|
|
247
|
+
baseIndex + 1,
|
|
248
|
+
baseIndex + 2,
|
|
249
|
+
baseIndex,
|
|
250
|
+
baseIndex + 2,
|
|
251
|
+
baseIndex + 3
|
|
252
|
+
);
|
|
253
|
+
const r = rect.radius || [4, 4, 4, 4];
|
|
254
|
+
this.radius.push(...r, ...r, ...r, ...r);
|
|
255
|
+
this.rectId.push(this.index, this.index, this.index, this.index);
|
|
256
|
+
this.types.push(type, type, type, type);
|
|
257
|
+
this.quad.push(x, y, width, height);
|
|
258
|
+
this.quad.push(x, y, width, height);
|
|
259
|
+
this.quad.push(x, y, width, height);
|
|
260
|
+
this.quad.push(x, y, width, height);
|
|
261
|
+
const state = rect.state || 0;
|
|
262
|
+
this.state.push(state, state, state, state);
|
|
263
|
+
this.rects[rect.id] = {
|
|
264
|
+
...rect,
|
|
265
|
+
index: this.index,
|
|
266
|
+
x,
|
|
267
|
+
y,
|
|
268
|
+
width,
|
|
269
|
+
height
|
|
270
|
+
};
|
|
271
|
+
this.added.add(rect.id);
|
|
272
|
+
this.index++;
|
|
273
|
+
}
|
|
274
|
+
this.pendingRects = [];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
122
277
|
getIndex(id) {
|
|
123
278
|
return this.rects[id]?.index;
|
|
124
279
|
}
|
|
@@ -1,17 +1,88 @@
|
|
|
1
|
+
import {
|
|
2
|
+
INJECT_APP,
|
|
3
|
+
INJECT_ENTITY_CONTEXT,
|
|
4
|
+
INJECT_IS_IN_REUSABLE
|
|
5
|
+
} from "#blokkli/helpers/symbols";
|
|
1
6
|
import { defineNuxtPlugin } from "#imports";
|
|
7
|
+
function getInjection(vnode, symbol) {
|
|
8
|
+
return vnode.ctx?.provides?.[symbol];
|
|
9
|
+
}
|
|
10
|
+
function getBlokkliApp(vnode) {
|
|
11
|
+
return getInjection(vnode, INJECT_APP);
|
|
12
|
+
}
|
|
13
|
+
function getEntityContext(vnode) {
|
|
14
|
+
return getInjection(vnode, INJECT_ENTITY_CONTEXT);
|
|
15
|
+
}
|
|
16
|
+
function isInReusable(vnode) {
|
|
17
|
+
return !!getInjection(vnode, INJECT_IS_IN_REUSABLE);
|
|
18
|
+
}
|
|
19
|
+
function getFieldName(binding) {
|
|
20
|
+
const fieldName = binding.value?.name || binding.arg;
|
|
21
|
+
if (fieldName && typeof fieldName === "string") {
|
|
22
|
+
return fieldName;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function isEditing() {
|
|
26
|
+
if (import.meta.client) {
|
|
27
|
+
return window.location.search.includes("blokkliEditing");
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
2
31
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
3
32
|
nuxtApp.vueApp.directive("blokkli-editable", {
|
|
4
|
-
created(el, binding) {
|
|
33
|
+
created(el, binding, vnode) {
|
|
5
34
|
if (import.meta.client) {
|
|
6
|
-
if (!
|
|
35
|
+
if (!isEditing()) {
|
|
7
36
|
return;
|
|
8
37
|
}
|
|
9
|
-
|
|
38
|
+
if (isInReusable(vnode)) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const fieldName = getFieldName(binding);
|
|
10
42
|
if (!fieldName) {
|
|
11
43
|
return;
|
|
12
44
|
}
|
|
13
45
|
el.dataset.blokkliEditableField = fieldName;
|
|
14
46
|
}
|
|
47
|
+
},
|
|
48
|
+
mounted(el, binding, vnode) {
|
|
49
|
+
if (!isEditing()) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (isInReusable(vnode)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const app = getBlokkliApp(vnode);
|
|
56
|
+
if (!app) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const entity = getEntityContext(vnode);
|
|
60
|
+
if (!entity) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const fieldName = getFieldName(binding);
|
|
64
|
+
if (!fieldName) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
app.editable.registerEditableField(el, fieldName, entity);
|
|
68
|
+
},
|
|
69
|
+
beforeUnmount(el, binding, vnode) {
|
|
70
|
+
if (!isEditing()) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const app = getBlokkliApp(vnode);
|
|
74
|
+
if (!app) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
const entity = getEntityContext(vnode);
|
|
78
|
+
if (!entity) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const fieldName = getFieldName(binding);
|
|
82
|
+
if (!fieldName) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
app.editable.unregisterEditableField(el, fieldName, entity);
|
|
15
86
|
}
|
|
16
87
|
});
|
|
17
88
|
nuxtApp.vueApp.directive("blokkli-droppable", {
|
|
@@ -8,6 +8,7 @@ import type { KeyboardProvider } from '../helpers/keyboardProvider.js';
|
|
|
8
8
|
import type { UiProvider } from '../helpers/uiProvider.js';
|
|
9
9
|
import type { AnimationProvider } from '../helpers/animationProvider.js';
|
|
10
10
|
import type { StateProvider } from '../helpers/stateProvider.js';
|
|
11
|
+
import type { EditableProvider } from '../helpers/editableProvider.js';
|
|
11
12
|
import type { TextProvider } from '../helpers/textProvider.js';
|
|
12
13
|
import type { PluginProvider } from '../helpers/pluginProvider.js';
|
|
13
14
|
import type { eventBus } from './../helpers/eventBus.js';
|
|
@@ -381,6 +382,7 @@ export type BlokkliProviderEntityContext = {
|
|
|
381
382
|
bundle: string;
|
|
382
383
|
language?: string;
|
|
383
384
|
};
|
|
385
|
+
export type EditPermission = 'view' | 'edit' | 'review';
|
|
384
386
|
export type EditEntity = {
|
|
385
387
|
label?: string;
|
|
386
388
|
status?: boolean;
|
|
@@ -569,7 +571,7 @@ export interface BlockBundleDefinition {
|
|
|
569
571
|
allowReusable?: boolean;
|
|
570
572
|
isTranslatable?: boolean;
|
|
571
573
|
}
|
|
572
|
-
export type EditMode = 'readonly' | 'editing' | 'translating';
|
|
574
|
+
export type EditMode = 'readonly' | 'editing' | 'translating' | 'review';
|
|
573
575
|
export type MutatedOptions = {
|
|
574
576
|
[uuid: string]: {
|
|
575
577
|
[key: string]: string;
|
|
@@ -848,11 +850,15 @@ export type Coord = {
|
|
|
848
850
|
};
|
|
849
851
|
export type Rectangle = Size & Coord;
|
|
850
852
|
export type CanvasDrawEvent = {
|
|
853
|
+
gl: WebGLRenderingContext;
|
|
851
854
|
mouseX: number;
|
|
852
855
|
mouseY: number;
|
|
856
|
+
mouseArtboard: Coord;
|
|
853
857
|
artboardOffset: Coord;
|
|
854
858
|
artboardScale: number;
|
|
859
|
+
artboardSize: Size;
|
|
855
860
|
time: number;
|
|
861
|
+
selectedUuids: string[];
|
|
856
862
|
};
|
|
857
863
|
export type MakeReusableEvent = {
|
|
858
864
|
label: string;
|
|
@@ -1043,10 +1049,15 @@ export type EventbusEvents = {
|
|
|
1043
1049
|
'item:doubleClick': DraggableExistingBlock;
|
|
1044
1050
|
scrollIntoView: ScrollIntoViewEvent;
|
|
1045
1051
|
'animationFrame:before': AnimationFrameBeforeEvent;
|
|
1052
|
+
'animationFrame:after': undefined;
|
|
1046
1053
|
'canvas:draw': CanvasDrawEvent;
|
|
1047
1054
|
'state:reloaded': undefined;
|
|
1048
1055
|
addContentSearchItem: AddContentSearchItemEvent;
|
|
1049
1056
|
'option:update': UpdateBlockOptionEvent;
|
|
1057
|
+
/**
|
|
1058
|
+
* Emitted after finishing changing options.
|
|
1059
|
+
*/
|
|
1060
|
+
'option:finish-change': undefined;
|
|
1050
1061
|
'plugin:mount': PluginMountEvent;
|
|
1051
1062
|
'plugin:unmount': PluginUnmountEvent;
|
|
1052
1063
|
'editable:focus': EditableFieldFocusEvent;
|
|
@@ -1129,6 +1140,7 @@ export interface BlokkliApp {
|
|
|
1129
1140
|
debug: DebugProvider;
|
|
1130
1141
|
indicators: IndicatorsProvider;
|
|
1131
1142
|
plugins: PluginProvider;
|
|
1143
|
+
editable: EditableProvider;
|
|
1132
1144
|
}
|
|
1133
1145
|
export type PasteExistingBlocksEvent = {
|
|
1134
1146
|
uuids: string[];
|