@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
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
precision highp float;
|
|
2
|
+
|
|
3
|
+
// [x, y] position.
|
|
4
|
+
attribute vec2 a_position;
|
|
5
|
+
// The [x,y,width, height] of the quad the vertex belongs to.
|
|
6
|
+
attribute vec4 a_quad;
|
|
7
|
+
attribute float a_rect_id;
|
|
8
|
+
attribute float a_rect_type;
|
|
9
|
+
attribute vec4 a_rect_radius;
|
|
10
|
+
|
|
11
|
+
// The global scaling applied to all quads.
|
|
12
|
+
uniform float u_scale;
|
|
13
|
+
uniform float u_dpi;
|
|
14
|
+
// The amount of pixels to offset on the x axis.
|
|
15
|
+
uniform float u_offset_x;
|
|
16
|
+
// The amount of pixels to offset on the y axis.
|
|
17
|
+
uniform float u_offset_y;
|
|
18
|
+
uniform vec2 u_resolution;
|
|
19
|
+
|
|
20
|
+
// Hover state uniforms (11 rectangles)
|
|
21
|
+
uniform vec4 u_hover_positions[11]; // x, y, width, height
|
|
22
|
+
uniform vec4 u_hover_radii[11]; // topLeft, topRight, bottomRight, bottomLeft
|
|
23
|
+
uniform float u_hover_types[11]; // 0=mono, 1=accent, 2=teal fill
|
|
24
|
+
uniform float u_hover_visible[11]; // 0=hidden, 1=visible
|
|
25
|
+
|
|
26
|
+
// The transformed quad for the fragment shader.
|
|
27
|
+
varying vec4 v_quad;
|
|
28
|
+
varying vec4 v_rect_radius;
|
|
29
|
+
varying vec2 v_rect_size;
|
|
30
|
+
varying vec2 v_rect_center;
|
|
31
|
+
varying float v_rect_type;
|
|
32
|
+
varying vec2 v_quad_artboard_pos;
|
|
33
|
+
|
|
34
|
+
void main() {
|
|
35
|
+
int rectIndex = int(a_rect_id);
|
|
36
|
+
|
|
37
|
+
// If not visible, move off-screen
|
|
38
|
+
if (u_hover_visible[rectIndex] < 0.5) {
|
|
39
|
+
gl_Position = vec4(-2.0, -2.0, 0.0, 1.0);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Get rect data from uniforms
|
|
44
|
+
vec4 hoverPos = u_hover_positions[rectIndex]; // x, y, width, height
|
|
45
|
+
vec4 hoverRadius = u_hover_radii[rectIndex];
|
|
46
|
+
float hoverType = u_hover_types[rectIndex];
|
|
47
|
+
|
|
48
|
+
// Define the increase size to prevent border clipping
|
|
49
|
+
float borderThickness = 2.0 * u_dpi;
|
|
50
|
+
float increaseSize = max(borderThickness, 10.0) + 4.0;
|
|
51
|
+
|
|
52
|
+
// Calculate the new dimensions of the quad
|
|
53
|
+
vec4 adjusted_quad = hoverPos;
|
|
54
|
+
adjusted_quad.z += 2.0 * increaseSize; // increase width
|
|
55
|
+
adjusted_quad.w += 2.0 * increaseSize; // increase height
|
|
56
|
+
|
|
57
|
+
// Adjust vertex positions to scale from the center of the rectangle
|
|
58
|
+
// Calculate the center of the original quad
|
|
59
|
+
vec2 center = vec2(
|
|
60
|
+
hoverPos.x + hoverPos.z / 2.0,
|
|
61
|
+
hoverPos.y + hoverPos.w / 2.0
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// Calculate vertex offset relative to dummy quad center
|
|
65
|
+
vec2 dummyCenter = vec2(a_quad.x + a_quad.z / 2.0, a_quad.y + a_quad.w / 2.0);
|
|
66
|
+
vec2 vertexOffset = a_position - dummyCenter;
|
|
67
|
+
|
|
68
|
+
// Map vertex offset to new rect
|
|
69
|
+
vec2 newOffset =
|
|
70
|
+
vertexOffset *
|
|
71
|
+
(vec2(adjusted_quad.z, adjusted_quad.w) / vec2(a_quad.z, a_quad.w));
|
|
72
|
+
|
|
73
|
+
// New position is center plus the new offset
|
|
74
|
+
vec2 newPosition = center + newOffset;
|
|
75
|
+
|
|
76
|
+
// Apply global scale and offsets
|
|
77
|
+
vec2 offsetPosition = newPosition * u_scale;
|
|
78
|
+
offsetPosition.x += u_offset_x;
|
|
79
|
+
offsetPosition.y += u_offset_y;
|
|
80
|
+
|
|
81
|
+
// Normalize position for rendering
|
|
82
|
+
vec2 normalizedPosition = offsetPosition / u_resolution;
|
|
83
|
+
|
|
84
|
+
// Transform to screen space (-1 to 1)
|
|
85
|
+
vec2 screenSpacePosition = normalizedPosition * 2.0 - vec2(1.0, 1.0);
|
|
86
|
+
screenSpacePosition.y = -screenSpacePosition.y;
|
|
87
|
+
|
|
88
|
+
// Output final position in clip space
|
|
89
|
+
gl_Position = vec4(screenSpacePosition, 0.0, 1.0) * u_dpi;
|
|
90
|
+
|
|
91
|
+
// Pass the dimensions to fragment shader for SDF calculations
|
|
92
|
+
vec4 transformed_quad = vec4(
|
|
93
|
+
(hoverPos.x * u_scale + u_offset_x) * u_dpi,
|
|
94
|
+
(u_resolution.y -
|
|
95
|
+
hoverPos.y * u_scale -
|
|
96
|
+
hoverPos.w * u_scale -
|
|
97
|
+
u_offset_y) *
|
|
98
|
+
u_dpi,
|
|
99
|
+
hoverPos.z * u_scale * u_dpi,
|
|
100
|
+
hoverPos.w * u_scale * u_dpi
|
|
101
|
+
);
|
|
102
|
+
v_quad = transformed_quad;
|
|
103
|
+
|
|
104
|
+
// Expand the rect by 2px for border rendering
|
|
105
|
+
float borderExpansion = 2.0 * u_dpi;
|
|
106
|
+
|
|
107
|
+
// Set varying variables
|
|
108
|
+
v_rect_radius = hoverRadius * u_dpi;
|
|
109
|
+
v_rect_size = vec2(
|
|
110
|
+
v_quad.z + 2.0 * borderExpansion,
|
|
111
|
+
v_quad.w + 2.0 * borderExpansion
|
|
112
|
+
);
|
|
113
|
+
v_rect_center = vec2(v_quad.x + v_quad.z / 2.0, v_quad.y + v_quad.w / 2.0);
|
|
114
|
+
v_rect_type = hoverType;
|
|
115
|
+
// Pass the original artboard-space quad position for stable dash pattern
|
|
116
|
+
v_quad_artboard_pos = vec2(hoverPos.x, hoverPos.y);
|
|
117
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Overlay v-if="isVisible && gl && animation.webglEnabled.value" :gl="gl" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script setup>
|
|
6
|
+
import Overlay from "./Overlay/index.vue";
|
|
7
|
+
import { computed, useBlokkli, defineBlokkliFeature } from "#imports";
|
|
8
|
+
defineBlokkliFeature({
|
|
9
|
+
id: "hover",
|
|
10
|
+
icon: "selection",
|
|
11
|
+
label: "Hover",
|
|
12
|
+
description: "Renders a border around blocks that are currently being hovered."
|
|
13
|
+
});
|
|
14
|
+
const { selection, ui, animation, dom } = useBlokkli();
|
|
15
|
+
const gl = animation.gl();
|
|
16
|
+
const isVisible = computed(
|
|
17
|
+
() => dom.isReady.value && !selection.isMultiSelecting.value && !selection.editableActive.value && !selection.isDragging.value && !ui.hasTransformOverlayOpen.value && !ui.hasDialogOpen.value && !ui.isAnimating.value
|
|
18
|
+
);
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
name: "Hover"
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
@@ -17,15 +17,11 @@
|
|
|
17
17
|
</p>
|
|
18
18
|
<div class="bk">
|
|
19
19
|
<div class="bk-form-group">
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
{{ $t("libraryPlaceSearchLabel", "Filter library items") }}
|
|
23
|
-
</label>
|
|
24
|
-
<input
|
|
20
|
+
<FormItem>
|
|
21
|
+
<FormText
|
|
25
22
|
id="library_search"
|
|
26
23
|
v-model.lazy="searchText"
|
|
27
|
-
|
|
28
|
-
class="bk-form-input"
|
|
24
|
+
:label="$t('libraryPlaceSearchLabel', 'Filter library items')"
|
|
29
25
|
:placeholder="
|
|
30
26
|
$t(
|
|
31
27
|
'libraryPlaceSearchInputPlaceholder',
|
|
@@ -34,25 +30,15 @@
|
|
|
34
30
|
"
|
|
35
31
|
required
|
|
36
32
|
/>
|
|
37
|
-
</
|
|
38
|
-
<
|
|
39
|
-
<
|
|
40
|
-
{{ $t("libraryPlaceBundleSelectLabel", "Bundle") }}
|
|
41
|
-
</label>
|
|
42
|
-
<select
|
|
33
|
+
</FormItem>
|
|
34
|
+
<FormItem>
|
|
35
|
+
<FormSelect
|
|
43
36
|
id="library_bundle"
|
|
44
37
|
v-model="selectedBundle"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
:key="v.bundle"
|
|
50
|
-
:value="v.bundle"
|
|
51
|
-
>
|
|
52
|
-
{{ v.label }}
|
|
53
|
-
</option>
|
|
54
|
-
</select>
|
|
55
|
-
</div>
|
|
38
|
+
:label="$t('libraryPlaceBundleSelectLabel', 'Bundle')"
|
|
39
|
+
:options="bundleOptions"
|
|
40
|
+
/>
|
|
41
|
+
</FormItem>
|
|
56
42
|
</div>
|
|
57
43
|
</div>
|
|
58
44
|
<div class="bk-library-dialog-content">
|
|
@@ -85,7 +71,13 @@
|
|
|
85
71
|
</template>
|
|
86
72
|
|
|
87
73
|
<script setup>
|
|
88
|
-
import {
|
|
74
|
+
import {
|
|
75
|
+
FormOverlay,
|
|
76
|
+
Pagination,
|
|
77
|
+
FormText,
|
|
78
|
+
FormItem,
|
|
79
|
+
FormSelect
|
|
80
|
+
} from "#blokkli/components";
|
|
89
81
|
import Loading from "./../../../Loading/index.vue";
|
|
90
82
|
import { ref, useBlokkli, useAsyncData, computed, watch } from "#imports";
|
|
91
83
|
import LibraryListItem from "./Item/index.vue";
|
|
@@ -147,10 +139,10 @@ const bundleOptions = computed(() => {
|
|
|
147
139
|
const bundles = allowedBundles.value.map((bundle) => {
|
|
148
140
|
const definition = types.getBlockBundleDefinition(bundle);
|
|
149
141
|
return {
|
|
150
|
-
bundle,
|
|
142
|
+
value: bundle,
|
|
151
143
|
label: definition?.label || bundle
|
|
152
144
|
};
|
|
153
145
|
});
|
|
154
|
-
return [{
|
|
146
|
+
return [{ value: "all", label: $t("all", "All") }, ...bundles];
|
|
155
147
|
});
|
|
156
148
|
</script>
|
|
@@ -23,36 +23,40 @@
|
|
|
23
23
|
)
|
|
24
24
|
"
|
|
25
25
|
/>
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
<FormItem>
|
|
27
|
+
<FormText
|
|
28
|
+
id="reusable_label"
|
|
29
|
+
v-model="label"
|
|
30
|
+
:label="$t('libraryDialogDescriptionLabel', 'Description')"
|
|
31
|
+
type="text"
|
|
32
|
+
:placeholder="
|
|
33
|
+
$t(
|
|
34
|
+
'libraryDialogTitleInputPlaceholder',
|
|
35
|
+
'e.g. Teaser Campaign 2024'
|
|
36
|
+
)
|
|
36
37
|
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
38
|
+
required
|
|
39
|
+
/>
|
|
40
|
+
</FormItem>
|
|
41
|
+
<FormItem>
|
|
42
|
+
<div class="bk-form-label">
|
|
43
|
+
{{ $t("libraryPreviewLabel", "Preview") }}
|
|
44
|
+
</div>
|
|
45
|
+
<div
|
|
46
|
+
class="bk-dialog-content-element"
|
|
47
|
+
:class="[backgroundClass, { 'bk-default-bg': !backgroundClass }]"
|
|
48
|
+
:style="backgroundClass ? {} : { backgroundColor }"
|
|
49
|
+
>
|
|
50
|
+
<div ref="previewEl" />
|
|
51
|
+
</div>
|
|
52
|
+
</FormItem>
|
|
49
53
|
</div>
|
|
50
54
|
</DialogModal>
|
|
51
55
|
</template>
|
|
52
56
|
|
|
53
57
|
<script setup>
|
|
54
58
|
import { ref, useBlokkli, onMounted } from "#imports";
|
|
55
|
-
import { DialogModal, InfoBox } from "#blokkli/components";
|
|
59
|
+
import { DialogModal, InfoBox, FormText, FormItem } from "#blokkli/components";
|
|
56
60
|
import { realBackgroundColor } from "#blokkli/helpers";
|
|
57
61
|
defineEmits(["confirm", "cancel"]);
|
|
58
62
|
const { dom, $t } = useBlokkli();
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
id="library_detach"
|
|
5
5
|
:title="$t('libraryDetach', 'Detach from library')"
|
|
6
6
|
icon="detach"
|
|
7
|
+
:disabled="state.editMode.value !== 'editing'"
|
|
7
8
|
multiple
|
|
8
9
|
:weight="-70"
|
|
9
10
|
@click="onDetach"
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
<PluginItemAction
|
|
12
13
|
v-else-if="!isReusable"
|
|
13
14
|
id="library_make_reusable"
|
|
14
|
-
:title="$t('libraryAdd', 'Add to library')"
|
|
15
|
+
:title="$t('libraryAdd', 'Add to library...')"
|
|
15
16
|
:disabled="!canMakeReusable || state.editMode.value !== 'editing'"
|
|
16
17
|
icon="reusable"
|
|
17
18
|
:weight="-70"
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<script setup>
|
|
8
8
|
import { useBlokkli, onBeforeUnmount } from "#imports";
|
|
9
9
|
import { intersects, toShaderColor } from "#blokkli/helpers";
|
|
10
|
-
import
|
|
10
|
+
import defineRenderer from "#blokkli/helpers/composables/defineRenderer";
|
|
11
11
|
import vs from "./vertex.glsl?raw";
|
|
12
12
|
import fs from "./fragment.glsl?raw";
|
|
13
13
|
import {
|
|
@@ -181,32 +181,40 @@ function getSelectRect(offset, scale) {
|
|
|
181
181
|
};
|
|
182
182
|
return { shader, check };
|
|
183
183
|
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
184
|
+
defineRenderer("multiselect-overlay", {
|
|
185
|
+
zIndex: 450,
|
|
186
|
+
only: true,
|
|
187
|
+
cursor: () => "crosshair",
|
|
188
|
+
render: (ctx) => {
|
|
189
|
+
mouseX = ctx.mouseX;
|
|
190
|
+
mouseY = ctx.mouseY;
|
|
191
|
+
const { shader, check } = getSelectRect(
|
|
192
|
+
ctx.artboardOffset,
|
|
193
|
+
ctx.artboardScale
|
|
194
|
+
);
|
|
195
|
+
const { nested } = collector.getSelectedUuids(check);
|
|
196
|
+
const shouldSelectAll = props.isPressingControl || !nested.length;
|
|
197
|
+
ctx.gl.useProgram(programInfo.program);
|
|
198
|
+
const time = (Date.now() - startTimestamp) / 1e3;
|
|
199
|
+
setUniforms(programInfo, uniforms);
|
|
200
|
+
setUniforms(programInfo, {
|
|
201
|
+
u_select_all: shouldSelectAll ? 1 : 0,
|
|
202
|
+
u_select_rect: [shader.x, shader.y, shader.width, shader.height],
|
|
203
|
+
u_time: time
|
|
204
|
+
});
|
|
205
|
+
animation.setSharedUniforms(ctx.gl, programInfo);
|
|
206
|
+
const { info, hasChanged } = collector.getBufferInfo(
|
|
207
|
+
ctx.artboardOffset,
|
|
208
|
+
ctx.artboardScale
|
|
209
|
+
);
|
|
210
|
+
if (!info) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
if (hasChanged) {
|
|
214
|
+
setBuffersAndAttributes(ctx.gl, programInfo, info);
|
|
215
|
+
}
|
|
216
|
+
drawBufferInfo(ctx.gl, info, ctx.gl.TRIANGLES);
|
|
208
217
|
}
|
|
209
|
-
drawBufferInfo(props.gl, info, props.gl.TRIANGLES);
|
|
210
218
|
});
|
|
211
219
|
function getUuidsToSelect() {
|
|
212
220
|
const { check } = getSelectRect(
|
|
@@ -222,7 +230,6 @@ function getUuidsToSelect() {
|
|
|
222
230
|
return nested;
|
|
223
231
|
}
|
|
224
232
|
onBeforeUnmount(() => {
|
|
225
|
-
props.gl.clear(props.gl.COLOR_BUFFER_BIT);
|
|
226
233
|
const diff = Date.now() - startTimestamp;
|
|
227
234
|
if (diff > 175) {
|
|
228
235
|
eventBus.emit("select:end", getUuidsToSelect());
|
|
@@ -20,11 +20,9 @@ defineBlokkliFeature({
|
|
|
20
20
|
description: "Implements support for selecting multiple blocks using a select rectangle.",
|
|
21
21
|
viewports: ["desktop"]
|
|
22
22
|
});
|
|
23
|
-
const { keyboard, eventBus, selection,
|
|
23
|
+
const { keyboard, eventBus, selection, animation } = useBlokkli();
|
|
24
24
|
const gl = animation.gl();
|
|
25
|
-
const enabled = computed(
|
|
26
|
-
() => !selection.editableActive.value && (state.editMode.value === "editing" || state.editMode.value === "translating") && gl
|
|
27
|
-
);
|
|
25
|
+
const enabled = computed(() => !selection.editableActive.value && gl);
|
|
28
26
|
const shouldRender = ref(false);
|
|
29
27
|
const downX = ref(0);
|
|
30
28
|
const downY = ref(0);
|
|
@@ -113,7 +113,12 @@ const showLabel = computed(() => {
|
|
|
113
113
|
const label = computed(
|
|
114
114
|
() => $blokkliText(`blockOption_${props.property}_label`, props.option.label)
|
|
115
115
|
);
|
|
116
|
-
const description = computed(
|
|
116
|
+
const description = computed(
|
|
117
|
+
() => $blokkliText(
|
|
118
|
+
`blockOption_${props.property}_description`,
|
|
119
|
+
props.option.description
|
|
120
|
+
)
|
|
121
|
+
);
|
|
117
122
|
const checkboxOptions = computed(() => {
|
|
118
123
|
if (props.option.type !== "checkboxes") {
|
|
119
124
|
return [];
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Banner
|
|
3
|
+
id="ownership"
|
|
4
|
+
icon="user"
|
|
5
|
+
:text
|
|
6
|
+
:button="$t('ownershipTakeOwnership', 'Assign to me')"
|
|
7
|
+
@click="$emit('submit')"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { computed, useBlokkli, onMounted, onBeforeUnmount } from "#imports";
|
|
13
|
+
import { Banner } from "#blokkli/components";
|
|
14
|
+
defineEmits(["submit"]);
|
|
15
|
+
const { state, $t, ui } = useBlokkli();
|
|
16
|
+
const name = computed(() => {
|
|
17
|
+
const v = state.owner.value?.name;
|
|
18
|
+
if (v) {
|
|
19
|
+
return `<strong>${v}</strong>`;
|
|
20
|
+
}
|
|
21
|
+
return "";
|
|
22
|
+
});
|
|
23
|
+
const text = computed(() => {
|
|
24
|
+
return $t(
|
|
25
|
+
"ownershipNote",
|
|
26
|
+
"This page is currently being edited by @name. Changes can only be made by one person at a time."
|
|
27
|
+
).replace("@name", name.value);
|
|
28
|
+
});
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
ui.setSelectionColor("ownership", "mono");
|
|
31
|
+
});
|
|
32
|
+
onBeforeUnmount(() => {
|
|
33
|
+
ui.removeSelectionColor("ownership");
|
|
34
|
+
});
|
|
35
|
+
</script>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
2
|
+
submit: () => any;
|
|
3
|
+
}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{
|
|
4
|
+
onSubmit?: (() => any) | undefined;
|
|
5
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
6
|
+
export default _default;
|
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Teleport to="
|
|
3
|
-
<
|
|
4
|
-
v-if="!state.owner.value?.currentUserIsOwner"
|
|
5
|
-
class="bk-owner-indicator"
|
|
6
|
-
>
|
|
7
|
-
<p
|
|
8
|
-
v-html="
|
|
9
|
-
$t(
|
|
10
|
-
'ownershipNote',
|
|
11
|
-
'This page is currently being edited by @name. Changes can only be made by one person at a time.'
|
|
12
|
-
).replace('@name', name)
|
|
13
|
-
"
|
|
14
|
-
/>
|
|
15
|
-
<button class="bk-button bk-is-danger" @click="takeOwnership">
|
|
16
|
-
{{ $t("ownershipTakeOwnership", "Assign to me") }}
|
|
17
|
-
</button>
|
|
18
|
-
</div>
|
|
2
|
+
<Teleport to="#bk-banner-list">
|
|
3
|
+
<Renderer v-if="shouldRender" @submit="takeOwnership" />
|
|
19
4
|
</Teleport>
|
|
20
5
|
</template>
|
|
21
6
|
|
|
22
7
|
<script setup>
|
|
23
|
-
import {
|
|
8
|
+
import { useBlokkli, defineBlokkliFeature, computed } from "#imports";
|
|
9
|
+
import Renderer from "./Renderer.vue";
|
|
24
10
|
const { adapter } = defineBlokkliFeature({
|
|
25
11
|
id: "ownership",
|
|
26
12
|
icon: "user",
|
|
@@ -29,18 +15,14 @@ const { adapter } = defineBlokkliFeature({
|
|
|
29
15
|
description: "Renders a large button to take ownership of the current edit state."
|
|
30
16
|
});
|
|
31
17
|
const { state, $t } = useBlokkli();
|
|
18
|
+
const shouldRender = computed(
|
|
19
|
+
() => !state.owner.value?.currentUserIsOwner && state.permissions.value.includes("edit")
|
|
20
|
+
);
|
|
32
21
|
const takeOwnership = () => state.mutateWithLoadingState(
|
|
33
22
|
() => adapter.takeOwnership(),
|
|
34
23
|
$t("ownershipError", "Error in assigning"),
|
|
35
24
|
$t("ownershipSuccess", "You are now the owner.")
|
|
36
25
|
);
|
|
37
|
-
const name = computed(() => {
|
|
38
|
-
const v = state.owner.value?.name;
|
|
39
|
-
if (v) {
|
|
40
|
-
return `<strong>${v}</strong>`;
|
|
41
|
-
}
|
|
42
|
-
return "";
|
|
43
|
-
});
|
|
44
26
|
</script>
|
|
45
27
|
|
|
46
28
|
<script>
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"
|
|
14
14
|
key-code="P"
|
|
15
15
|
icon="tree"
|
|
16
|
+
@update:model-value="onToggleProxyMode"
|
|
16
17
|
/>
|
|
17
18
|
</template>
|
|
18
19
|
|
|
@@ -26,7 +27,10 @@ defineBlokkliFeature({
|
|
|
26
27
|
description: "Displays the blocks as a structure in the preview.",
|
|
27
28
|
viewports: ["desktop"]
|
|
28
29
|
});
|
|
29
|
-
const { $t, ui } = useBlokkli();
|
|
30
|
+
const { $t, ui, eventBus } = useBlokkli();
|
|
31
|
+
function onToggleProxyMode() {
|
|
32
|
+
eventBus.emit("state:reloaded");
|
|
33
|
+
}
|
|
30
34
|
</script>
|
|
31
35
|
|
|
32
36
|
<script>
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
33
|
<!-- Result State -->
|
|
34
|
-
<div class="bk-publish-summary-state">
|
|
35
|
-
<div
|
|
34
|
+
<div class="bk-publish-summary-state" :class="resultStateClass">
|
|
35
|
+
<div>
|
|
36
36
|
<Icon :name="resultStateIcon" />
|
|
37
37
|
</div>
|
|
38
38
|
<div class="bk-publish-summary-state-label">
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
<FormTextarea
|
|
79
79
|
id="revision-message"
|
|
80
80
|
v-model="revisionMessage"
|
|
81
|
-
:label="$t('publishRevisionLogMessage', '
|
|
81
|
+
:label="$t('publishRevisionLogMessage', 'Change description')"
|
|
82
82
|
:description="
|
|
83
83
|
$t(
|
|
84
84
|
'publishRevisionLogMessageDescription',
|
|
@@ -143,7 +143,9 @@
|
|
|
143
143
|
</tbody>
|
|
144
144
|
</table>
|
|
145
145
|
</FormItem>
|
|
146
|
-
|
|
146
|
+
</div>
|
|
147
|
+
<template #pre-footer>
|
|
148
|
+
<div>
|
|
147
149
|
<h3 class="bk-form-label">
|
|
148
150
|
{{ $t("publishSummary", "Summary") }}
|
|
149
151
|
</h3>
|
|
@@ -154,8 +156,8 @@
|
|
|
154
156
|
:action-label="actionLabel"
|
|
155
157
|
:result-state-label="resultStateLabel"
|
|
156
158
|
/>
|
|
157
|
-
</
|
|
158
|
-
</
|
|
159
|
+
</div>
|
|
160
|
+
</template>
|
|
159
161
|
</DialogModal>
|
|
160
162
|
</template>
|
|
161
163
|
|
|
@@ -250,10 +252,12 @@ const publishModeOptions = computed(() => {
|
|
|
250
252
|
return options;
|
|
251
253
|
});
|
|
252
254
|
const scheduleDate = ref(publishOn.value || "");
|
|
253
|
-
console.log("SET REIVISON LOG MESSAGE");
|
|
254
255
|
if (publishOptions.value?.revisionLogMessage) {
|
|
255
256
|
revisionMessage.value = publishOptions.value.revisionLogMessage;
|
|
256
257
|
}
|
|
258
|
+
if (!isCurrentlyPublished.value) {
|
|
259
|
+
publishMode.value = "save";
|
|
260
|
+
}
|
|
257
261
|
if (publishOn.value) {
|
|
258
262
|
publishMode.value = "scheduled";
|
|
259
263
|
}
|
|
@@ -400,9 +404,15 @@ const resultStateLabel = computed(() => {
|
|
|
400
404
|
}
|
|
401
405
|
if (publishMode.value === "scheduled" && scheduleDate.value) {
|
|
402
406
|
const formattedDate = ui.formatDate(scheduleDate.value);
|
|
407
|
+
if (isCurrentlyPublished.value) {
|
|
408
|
+
return $t(
|
|
409
|
+
"publishResultScheduledChanges",
|
|
410
|
+
"Changes will be published on @date"
|
|
411
|
+
).replace("@date", formattedDate);
|
|
412
|
+
}
|
|
403
413
|
return $t(
|
|
404
|
-
"
|
|
405
|
-
"
|
|
414
|
+
"publishResultScheduledPage",
|
|
415
|
+
"Page will be published on @date"
|
|
406
416
|
).replace("@date", formattedDate);
|
|
407
417
|
}
|
|
408
418
|
if (isCurrentlyPublished.value) {
|