@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.
Files changed (116) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +330 -93
  3. package/dist/modules/drupal/graphql/base/fragment.blokkliProps.graphql +1 -1
  4. package/dist/modules/drupal/graphql/features/comments.graphql +11 -8
  5. package/dist/modules/drupal/runtime/adapter/index.js +2 -2
  6. package/dist/runtime/blokkliPlugins/ItemAction/index.vue +1 -3
  7. package/dist/runtime/components/Blocks/FromLibrary/index.vue +4 -2
  8. package/dist/runtime/components/BlokkliEditable.vue +22 -4
  9. package/dist/runtime/components/BlokkliProvider.vue +29 -20
  10. package/dist/runtime/components/BlokkliProvider.vue.d.ts +2 -1
  11. package/dist/runtime/components/Edit/Actions/index.vue +9 -4
  12. package/dist/runtime/components/Edit/AnimationCanvas/index.vue +420 -25
  13. package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +80 -0
  14. package/dist/runtime/components/Edit/ArtboardTooltip/index.vue.d.ts +32 -0
  15. package/dist/runtime/components/Edit/Banner/index.vue +51 -0
  16. package/dist/runtime/components/Edit/Banner/index.vue.d.ts +18 -0
  17. package/dist/runtime/components/Edit/Dialog/index.vue +3 -0
  18. package/dist/runtime/components/Edit/Dialog/index.vue.d.ts +2 -0
  19. package/dist/runtime/components/Edit/EditIndicator.vue +118 -44
  20. package/dist/runtime/components/Edit/EditIndicator.vue.d.ts +3 -0
  21. package/dist/runtime/components/Edit/EditProvider.vue +79 -22
  22. package/dist/runtime/components/Edit/EditProvider.vue.d.ts +2 -0
  23. package/dist/runtime/components/Edit/Features/Analyze/Overlay/index.vue +19 -20
  24. package/dist/runtime/components/Edit/Features/BlockAddList/index.vue +1 -1
  25. package/dist/runtime/components/Edit/Features/CommandPalette/index.vue +2 -0
  26. package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue +35 -20
  27. package/dist/runtime/components/Edit/Features/Comments/AddForm/index.vue.d.ts +5 -3
  28. package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue +29 -0
  29. package/dist/runtime/components/Edit/Features/Comments/CommentInput/index.vue.d.ts +13 -0
  30. package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue +22 -16
  31. package/dist/runtime/components/Edit/Features/Comments/Overlay/Item/index.vue.d.ts +1 -0
  32. package/dist/runtime/components/Edit/Features/Comments/Overlay/index.vue +15 -6
  33. package/dist/runtime/components/Edit/Features/Comments/index.vue +20 -8
  34. package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +26 -35
  35. package/dist/runtime/components/Edit/Features/Debug/Renderer.vue +240 -0
  36. package/dist/runtime/components/Edit/Features/Debug/Renderer.vue.d.ts +6 -0
  37. package/dist/runtime/components/Edit/Features/Debug/index.vue +4 -165
  38. package/dist/runtime/components/Edit/Features/DraggingOverlay/DragItems/index.vue +1 -1
  39. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/fragment.glsl +7 -1
  40. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/index.vue +62 -39
  41. package/dist/runtime/components/Edit/Features/DraggingOverlay/DropTargets/vertex.glsl +1 -0
  42. package/dist/runtime/components/Edit/Features/Edit/index.vue +1 -1
  43. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Frame/index.vue +63 -3
  44. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +13 -9
  45. package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +17 -76
  46. package/dist/runtime/components/Edit/Features/EditableField/index.vue +1 -1
  47. package/dist/runtime/components/Edit/Features/History/index.vue +5 -2
  48. package/dist/runtime/components/Edit/Features/Hover/Overlay/fragment.glsl +139 -0
  49. package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue +270 -0
  50. package/dist/runtime/components/Edit/Features/Hover/Overlay/index.vue.d.ts +6 -0
  51. package/dist/runtime/components/Edit/Features/Hover/Overlay/vertex.glsl +117 -0
  52. package/dist/runtime/components/Edit/Features/Hover/index.vue +25 -0
  53. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +19 -27
  54. package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +27 -23
  55. package/dist/runtime/components/Edit/Features/Library/index.vue +2 -1
  56. package/dist/runtime/components/Edit/Features/MultiSelect/Overlay/index.vue +34 -27
  57. package/dist/runtime/components/Edit/Features/MultiSelect/index.vue +2 -4
  58. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue +6 -1
  59. package/dist/runtime/components/Edit/Features/Options/Form/index.vue +1 -0
  60. package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue +35 -0
  61. package/dist/runtime/components/Edit/Features/Ownership/Renderer.vue.d.ts +6 -0
  62. package/dist/runtime/components/Edit/Features/Ownership/index.vue +7 -25
  63. package/dist/runtime/components/Edit/Features/ProxyView/index.vue +5 -1
  64. package/dist/runtime/components/Edit/Features/Publish/Dialog/Summary.vue +2 -2
  65. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +17 -7
  66. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +39 -74
  67. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue.d.ts +4 -2
  68. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/fragment.glsl +106 -0
  69. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue +417 -0
  70. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/index.vue.d.ts +32 -0
  71. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Renderer/vertex.glsl +102 -0
  72. package/dist/runtime/components/Edit/Features/Selection/AddButtons/index.vue +33 -106
  73. package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue +88 -29
  74. package/dist/runtime/components/Edit/Features/Selection/Overlay/index.vue.d.ts +2 -0
  75. package/dist/runtime/components/Edit/Features/Selection/Overlay/vertex.glsl +11 -2
  76. package/dist/runtime/components/Edit/Features/Selection/index.vue +26 -19
  77. package/dist/runtime/components/Edit/Features/Translations/Banner/index.vue +17 -11
  78. package/dist/runtime/components/Edit/Features/Translations/index.vue +13 -16
  79. package/dist/runtime/components/Edit/Form/Text/index.vue +2 -1
  80. package/dist/runtime/components/Edit/Form/Text/index.vue.d.ts +1 -0
  81. package/dist/runtime/components/Edit/Indicators/index.vue +1 -1
  82. package/dist/runtime/components/Edit/Konami/Game/index.vue +5 -5
  83. package/dist/runtime/components/Edit/index.d.ts +5 -3
  84. package/dist/runtime/components/Edit/index.js +8 -4
  85. package/dist/runtime/composables/defineBlokkli.js +5 -3
  86. package/dist/runtime/css/output.css +1 -1
  87. package/dist/runtime/helpers/animationProvider.d.ts +34 -1
  88. package/dist/runtime/helpers/animationProvider.js +175 -48
  89. package/dist/runtime/helpers/composables/defineRenderer.d.ts +8 -0
  90. package/dist/runtime/helpers/composables/defineRenderer.js +8 -0
  91. package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.d.ts +1 -1
  92. package/dist/runtime/helpers/composables/useDelayedIntersectionObserver.js +3 -2
  93. package/dist/runtime/helpers/composables/useStickyToolbar.d.ts +4 -1
  94. package/dist/runtime/helpers/composables/useStickyToolbar.js +53 -35
  95. package/dist/runtime/helpers/dom/index.d.ts +1 -0
  96. package/dist/runtime/helpers/domProvider.d.ts +46 -0
  97. package/dist/runtime/helpers/domProvider.js +101 -7
  98. package/dist/runtime/helpers/editableProvider.d.ts +14 -0
  99. package/dist/runtime/helpers/editableProvider.js +144 -0
  100. package/dist/runtime/helpers/stateProvider.d.ts +6 -2
  101. package/dist/runtime/helpers/stateProvider.js +66 -3
  102. package/dist/runtime/helpers/storageProvider.d.ts +3 -2
  103. package/dist/runtime/helpers/storageProvider.js +6 -2
  104. package/dist/runtime/helpers/symbols.d.ts +1 -0
  105. package/dist/runtime/helpers/symbols.js +1 -0
  106. package/dist/runtime/helpers/uiProvider.d.ts +8 -1
  107. package/dist/runtime/helpers/uiProvider.js +34 -2
  108. package/dist/runtime/helpers/webgl/index.d.ts +11 -2
  109. package/dist/runtime/helpers/webgl/index.js +162 -7
  110. package/dist/runtime/plugins/blokkliEditable.js +74 -3
  111. package/dist/runtime/types/index.d.ts +13 -1
  112. package/package.json +1 -1
  113. package/dist/runtime/components/Edit/DragInteractions/index.vue +0 -401
  114. package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue +0 -54
  115. package/dist/runtime/components/Edit/Features/Selection/AddButtons/AddButtonsField.vue.d.ts +0 -14
  116. /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
- <div>
21
- <label class="bk-form-label" for="library_search">
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
- type="text"
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
- </div>
38
- <div>
39
- <label class="bk-form-label" for="library_bundle">
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
- class="bk-form-input"
46
- >
47
- <option
48
- v-for="v in bundleOptions"
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 { FormOverlay, Pagination } from "#blokkli/components";
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 [{ bundle: "all", label: $t("all", "All") }, ...bundles];
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
- <label for="reusable_label" class="bk-form-label">{{
27
- $t("libraryDialogDescriptionLabel", "Description")
28
- }}</label>
29
- <input
30
- id="reusable_label"
31
- v-model="label"
32
- type="text"
33
- class="bk-form-input"
34
- :placeholder="
35
- $t('libraryDialogTitleInputPlaceholder', 'e.g. Teaser Campaign 2024')
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
- required
38
- />
39
- </div>
40
- <div class="bk-form-label">
41
- {{ $t("libraryPreviewLabel", "Preview") }}
42
- </div>
43
- <div
44
- class="bk-dialog-content-element"
45
- :class="[backgroundClass, { 'bk-default-bg': !backgroundClass }]"
46
- :style="backgroundClass ? {} : { backgroundColor }"
47
- >
48
- <div ref="previewEl" />
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 onBlokkliEvent from "#blokkli/helpers/composables/onBlokkliEvent";
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
- onBlokkliEvent("canvas:draw", (e) => {
185
- mouseX = e.mouseX;
186
- mouseY = e.mouseY;
187
- const { shader, check } = getSelectRect(e.artboardOffset, e.artboardScale);
188
- const { nested } = collector.getSelectedUuids(check);
189
- const shouldSelectAll = props.isPressingControl || !nested.length;
190
- props.gl.useProgram(programInfo.program);
191
- const time = (Date.now() - startTimestamp) / 1e3;
192
- setUniforms(programInfo, uniforms);
193
- setUniforms(programInfo, {
194
- u_select_all: shouldSelectAll ? 1 : 0,
195
- u_select_rect: [shader.x, shader.y, shader.width, shader.height],
196
- u_time: time
197
- });
198
- animation.setSharedUniforms(props.gl, programInfo);
199
- const { info, hasChanged } = collector.getBufferInfo(
200
- e.artboardOffset,
201
- e.artboardScale
202
- );
203
- if (!info) {
204
- return;
205
- }
206
- if (hasChanged) {
207
- setBuffersAndAttributes(props.gl, programInfo, info);
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, state, animation } = useBlokkli();
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(() => props.option.description);
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 [];
@@ -146,6 +146,7 @@ function stopChangingOptions() {
146
146
  });
147
147
  }
148
148
  selection.isChangingOptions.value = false;
149
+ eventBus.emit("option:finish-change");
149
150
  }
150
151
  class OptionCollector {
151
152
  options;
@@ -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="body">
3
- <div
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 { computed, useBlokkli, defineBlokkliFeature } from "#imports";
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 class="bk-publish-summary-state-icon" :class="resultStateClass">
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', 'Revision log message')"
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
- <FormItem class="bk-is-summary">
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
- </FormItem>
158
- </div>
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
- "publishResultScheduledChanges",
405
- "Changes will be published on @date"
414
+ "publishResultScheduledPage",
415
+ "Page will be published on @date"
406
416
  ).replace("@date", formattedDate);
407
417
  }
408
418
  if (isCurrentlyPublished.value) {