@blokkli/editor 2.0.0-alpha.24 → 2.0.0-alpha.26

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 (182) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +191 -27
  3. package/dist/runtime/blokkliPlugins/BlockIndicator/index.vue.d.ts +38 -0
  4. package/dist/runtime/blokkliPlugins/ContextMenu/index.vue.d.ts +15 -0
  5. package/dist/runtime/blokkliPlugins/DebugOverlay/index.vue.d.ts +6 -0
  6. package/dist/runtime/blokkliPlugins/ItemAction/index.vue.d.ts +28 -3
  7. package/dist/runtime/blokkliPlugins/Sidebar/Detached/index.vue +6 -4
  8. package/dist/runtime/blokkliPlugins/Sidebar/index.vue +11 -3
  9. package/dist/runtime/blokkliPlugins/Sidebar/index.vue.d.ts +138 -3
  10. package/dist/runtime/blokkliPlugins/ToolbarButton/index.vue.d.ts +114 -0
  11. package/dist/runtime/blokkliPlugins/TourItem/index.vue.d.ts +21 -0
  12. package/dist/runtime/blokkliPlugins/ViewOption/index.vue.d.ts +98 -0
  13. package/dist/runtime/components/Blocks/NotImplemented/index.vue +24 -0
  14. package/dist/runtime/components/Blocks/NotImplemented/index.vue.d.ts +6 -0
  15. package/dist/runtime/components/BlokkliEditable.vue.d.ts +11 -0
  16. package/dist/runtime/components/BlokkliItem.vue +16 -3
  17. package/dist/runtime/components/BlokkliItem.vue.d.ts +4 -2
  18. package/dist/runtime/components/Edit/Actions/index.vue +1 -1
  19. package/dist/runtime/components/Edit/AddListItem/index.vue +1 -6
  20. package/dist/runtime/components/Edit/AddListItem/index.vue.d.ts +5 -13
  21. package/dist/runtime/components/Edit/ArtboardTooltip/index.vue +6 -0
  22. package/dist/runtime/components/Edit/BlockProxy/index.vue +2 -2
  23. package/dist/runtime/components/Edit/BlokkliErrorBoundary.vue +3 -0
  24. package/dist/runtime/components/Edit/BlokkliRootErrorBoundary.vue +4 -1
  25. package/dist/runtime/components/Edit/Dialog/index.vue +15 -50
  26. package/dist/runtime/components/Edit/DraggableList.vue +12 -9
  27. package/dist/runtime/components/Edit/EditIndicator.vue +11 -4
  28. package/dist/runtime/components/Edit/EditProvider.vue +27 -24
  29. package/dist/runtime/components/Edit/Features/AddList/Actions/Action.vue +1 -0
  30. package/dist/runtime/components/Edit/Features/AddList/Blocks/index.vue +2 -3
  31. package/dist/runtime/components/Edit/Features/AddList/index.vue +17 -5
  32. package/dist/runtime/components/Edit/Features/Analyze/Icon.vue +85 -0
  33. package/dist/runtime/components/Edit/Features/Analyze/Icon.vue.d.ts +5 -0
  34. package/dist/runtime/components/Edit/Features/Analyze/Main.vue +288 -59
  35. package/dist/runtime/components/Edit/Features/Analyze/Main.vue.d.ts +8 -1
  36. package/dist/runtime/components/Edit/Features/Analyze/Renderer/fragment.glsl +25 -13
  37. package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue +114 -52
  38. package/dist/runtime/components/Edit/Features/Analyze/Renderer/index.vue.d.ts +16 -2
  39. package/dist/runtime/components/Edit/Features/Analyze/Renderer/vertex.glsl +31 -11
  40. package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue +2 -0
  41. package/dist/runtime/components/Edit/Features/Analyze/Results/Results.vue.d.ts +8 -1
  42. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue +4 -4
  43. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItem.vue.d.ts +20 -2
  44. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue +11 -18
  45. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodes.vue.d.ts +10 -3
  46. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue +46 -40
  47. package/dist/runtime/components/Edit/Features/Analyze/Results/ResultsItemNodesTarget.vue.d.ts +10 -4
  48. package/dist/runtime/components/Edit/Features/Analyze/Summary/Chart.vue +8 -4
  49. package/dist/runtime/components/Edit/Features/Analyze/analyzers/axe.js +1 -0
  50. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.d.ts +4 -3
  51. package/dist/runtime/components/Edit/Features/Analyze/analyzers/helpers/Context.js +2 -1
  52. package/dist/runtime/components/Edit/Features/Analyze/analyzers/readability.js +61 -20
  53. package/dist/runtime/components/Edit/Features/Analyze/analyzers/types.d.ts +15 -1
  54. package/dist/runtime/components/Edit/Features/Analyze/index.vue +23 -2
  55. package/dist/runtime/components/Edit/Features/Artboard/Overview/index.vue +22 -8
  56. package/dist/runtime/components/Edit/Features/Artboard/Renderer.vue +1 -1
  57. package/dist/runtime/components/Edit/Features/Artboard/Scrollbar/index.vue +8 -3
  58. package/dist/runtime/components/Edit/Features/BlockScheduler/Dialog/index.vue +10 -1
  59. package/dist/runtime/components/Edit/Features/Debug/Main.vue.d.ts +1 -1
  60. package/dist/runtime/components/Edit/Features/Debug/Rects/index.vue +2 -2
  61. package/dist/runtime/components/Edit/Features/Debug/Section/Logging.vue.d.ts +1 -1
  62. package/dist/runtime/components/Edit/Features/EditForm/Frame/index.vue +8 -2
  63. package/dist/runtime/components/Edit/Features/EditForm/index.vue +1 -7
  64. package/dist/runtime/components/Edit/Features/EditableField/Overlay/Plaintext/index.vue +1 -1
  65. package/dist/runtime/components/Edit/Features/EditableField/Overlay/index.vue +4 -3
  66. package/dist/runtime/components/Edit/Features/EditableMask/index.vue +1 -1
  67. package/dist/runtime/components/Edit/Features/EntityTitle/index.vue +7 -2
  68. package/dist/runtime/components/Edit/Features/Library/EditReusable/index.vue +2 -2
  69. package/dist/runtime/components/Edit/Features/Library/LibraryDialog/index.vue +9 -2
  70. package/dist/runtime/components/Edit/Features/Library/ReusableDialog/index.vue +12 -3
  71. package/dist/runtime/components/Edit/Features/MediaLibrary/Library/index.vue +3 -2
  72. package/dist/runtime/components/Edit/Features/Options/Form/Item.vue.d.ts +1 -1
  73. package/dist/runtime/components/Edit/Features/PreviewGrant/index.vue +1 -0
  74. package/dist/runtime/components/Edit/Features/Publish/Dialog/index.vue +9 -0
  75. package/dist/runtime/components/Edit/Features/ResponsivePreview/Frame/index.vue +3 -2
  76. package/dist/runtime/components/Edit/Features/ResponsivePreview/index.vue +3 -2
  77. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Content/index.vue +8 -2
  78. package/dist/runtime/components/Edit/Features/Search/Overlay/Results/Page/index.vue +12 -2
  79. package/dist/runtime/components/Edit/Features/Search/Overlay/index.vue +11 -3
  80. package/dist/runtime/components/Edit/Features/Selection/AddButtons/Overlay/index.vue +126 -33
  81. package/dist/runtime/components/Edit/Features/Selection/Renderer/index.vue +1 -1
  82. package/dist/runtime/components/Edit/Features/Settings/index.vue +1 -1
  83. package/dist/runtime/components/Edit/Features/Structure/List/Field/index.vue +3 -3
  84. package/dist/runtime/components/Edit/Features/Tour/Overlay/index.vue +2 -2
  85. package/dist/runtime/components/Edit/Features/Transform/Dialog/index.vue +7 -1
  86. package/dist/runtime/components/Edit/Form/Textarea/index.vue +1 -1
  87. package/dist/runtime/components/Edit/FormOverlay/index.vue +1 -1
  88. package/dist/runtime/components/Edit/Indicators/index.vue +1 -1
  89. package/dist/runtime/components/Edit/InfoBox/index.vue +3 -2
  90. package/dist/runtime/components/Edit/InfoBox/index.vue.d.ts +6 -1
  91. package/dist/runtime/components/Edit/Overlay/index.vue +4 -0
  92. package/dist/runtime/components/Edit/PreviewProvider.vue +3 -3
  93. package/dist/runtime/components/Edit/ScaleToFit/index.vue +4 -4
  94. package/dist/runtime/composables/defineBlokkliFeature.d.ts +1 -1
  95. package/dist/runtime/composables/useBlokkli.d.ts +6 -1
  96. package/dist/runtime/composables/useBlokkli.js +4 -1
  97. package/dist/runtime/css/output.css +1 -1
  98. package/dist/runtime/helpers/composables/defineItemDropdownAction.d.ts +1 -1
  99. package/dist/runtime/helpers/composables/defineMenuButton.d.ts +1 -1
  100. package/dist/runtime/helpers/composables/defineRenderer.d.ts +1 -1
  101. package/dist/runtime/helpers/composables/onBroadcastEvent.d.ts +1 -1
  102. package/dist/runtime/helpers/composables/useBlockRegistration.d.ts +1 -1
  103. package/dist/runtime/helpers/composables/useBlockRegistration.js +12 -1
  104. package/dist/runtime/helpers/composables/useDebugLogger.d.ts +1 -1
  105. package/dist/runtime/helpers/composables/useFocusTrap.d.ts +52 -0
  106. package/dist/runtime/helpers/composables/useFocusTrap.js +59 -0
  107. package/dist/runtime/helpers/composables/useGlobalBlokkliObject.d.ts +1 -1
  108. package/dist/runtime/helpers/{useTransitionedValue.js → composables/useTransitionedValue.js} +1 -1
  109. package/dist/runtime/helpers/imports/index.d.ts +2 -1
  110. package/dist/runtime/helpers/imports/index.js +10 -1
  111. package/dist/runtime/helpers/{animationProvider.d.ts → providers/animation.d.ts} +100 -7
  112. package/dist/runtime/helpers/{animationProvider.js → providers/animation.js} +21 -11
  113. package/dist/runtime/helpers/providers/blocks.d.ts +25 -3
  114. package/dist/runtime/helpers/providers/blocks.js +9 -0
  115. package/dist/runtime/helpers/providers/commands.d.ts +41 -0
  116. package/dist/runtime/helpers/{commandsProvider.js → providers/commands.js} +1 -1
  117. package/dist/runtime/helpers/providers/debug.d.ts +125 -0
  118. package/dist/runtime/helpers/{debugProvider.js → providers/debug.js} +2 -2
  119. package/dist/runtime/helpers/providers/definition.d.ts +87 -0
  120. package/dist/runtime/helpers/providers/directive.d.ts +88 -2
  121. package/dist/runtime/helpers/providers/directive.js +27 -3
  122. package/dist/runtime/helpers/providers/dom.d.ts +225 -0
  123. package/dist/runtime/helpers/{domProvider.js → providers/dom.js} +31 -75
  124. package/dist/runtime/helpers/providers/dropArea.d.ts +47 -0
  125. package/dist/runtime/helpers/{dropAreaProvider.js → providers/dropArea.js} +1 -1
  126. package/dist/runtime/helpers/providers/element.d.ts +58 -1
  127. package/dist/runtime/helpers/providers/features.d.ts +56 -0
  128. package/dist/runtime/helpers/{featuresProvider.js → providers/features.js} +1 -1
  129. package/dist/runtime/helpers/providers/fields.d.ts +18 -11
  130. package/dist/runtime/helpers/providers/fields.js +1 -1
  131. package/dist/runtime/helpers/providers/indicators.d.ts +44 -0
  132. package/dist/runtime/helpers/providers/keyboard.d.ts +76 -0
  133. package/dist/runtime/helpers/{keyboardProvider.js → providers/keyboard.js} +1 -8
  134. package/dist/runtime/helpers/{pluginProvider.d.ts → providers/plugin.d.ts} +36 -0
  135. package/dist/runtime/helpers/{selectionProvider.d.ts → providers/selection.d.ts} +4 -1
  136. package/dist/runtime/helpers/{selectionProvider.js → providers/selection.js} +1 -1
  137. package/dist/runtime/helpers/providers/state.d.ts +227 -0
  138. package/dist/runtime/helpers/{stateProvider.js → providers/state.js} +3 -3
  139. package/dist/runtime/helpers/providers/storage.d.ts +64 -0
  140. package/dist/runtime/helpers/{textProvider.d.ts → providers/texts.d.ts} +1 -1
  141. package/dist/runtime/helpers/providers/theme.d.ts +119 -0
  142. package/dist/runtime/helpers/{themeProvider.js → providers/theme.js} +3 -3
  143. package/dist/runtime/helpers/providers/tour.d.ts +49 -0
  144. package/dist/runtime/helpers/{tourProvider.js → providers/tour.js} +1 -1
  145. package/dist/runtime/helpers/providers/types.d.ts +170 -0
  146. package/dist/runtime/helpers/{typesProvider.js → providers/types.js} +45 -1
  147. package/dist/runtime/helpers/providers/ui.d.ts +339 -0
  148. package/dist/runtime/helpers/{uiProvider.js → providers/ui.js} +11 -5
  149. package/dist/runtime/helpers/runtimeHelpers/index.d.ts +1 -1
  150. package/dist/runtime/helpers/symbols.d.ts +1 -0
  151. package/dist/runtime/helpers/symbols.js +3 -0
  152. package/dist/runtime/types/blockOptions.d.ts +349 -0
  153. package/dist/runtime/types/index.d.ts +22 -26
  154. package/package.json +2 -2
  155. package/dist/runtime/helpers/commandsProvider.d.ts +0 -9
  156. package/dist/runtime/helpers/debugProvider.d.ts +0 -33
  157. package/dist/runtime/helpers/definitionProvider.d.ts +0 -19
  158. package/dist/runtime/helpers/domProvider.d.ts +0 -91
  159. package/dist/runtime/helpers/dropAreaProvider.d.ts +0 -9
  160. package/dist/runtime/helpers/featuresProvider.d.ts +0 -17
  161. package/dist/runtime/helpers/indicatorsProvider.d.ts +0 -10
  162. package/dist/runtime/helpers/keyboardProvider.d.ts +0 -20
  163. package/dist/runtime/helpers/stateProvider.d.ts +0 -47
  164. package/dist/runtime/helpers/storageProvider.d.ts +0 -17
  165. package/dist/runtime/helpers/themeProvider.d.ts +0 -30
  166. package/dist/runtime/helpers/tourProvider.d.ts +0 -11
  167. package/dist/runtime/helpers/typesProvider.d.ts +0 -36
  168. package/dist/runtime/helpers/uiProvider.d.ts +0 -57
  169. package/dist/runtime/types/blokkOptions.d.ts +0 -100
  170. /package/dist/runtime/helpers/{addElementClasses.d.ts → composables/addElementClasses.d.ts} +0 -0
  171. /package/dist/runtime/helpers/{addElementClasses.js → composables/addElementClasses.js} +0 -0
  172. /package/dist/runtime/helpers/{defineElementStyle.d.ts → composables/defineElementStyle.d.ts} +0 -0
  173. /package/dist/runtime/helpers/{defineElementStyle.js → composables/defineElementStyle.js} +0 -0
  174. /package/dist/runtime/helpers/{useTransitionedValue.d.ts → composables/useTransitionedValue.d.ts} +0 -0
  175. /package/dist/runtime/helpers/{broadcastProvider.d.ts → providers/broadcast.d.ts} +0 -0
  176. /package/dist/runtime/helpers/{broadcastProvider.js → providers/broadcast.js} +0 -0
  177. /package/dist/runtime/helpers/{definitionProvider.js → providers/definition.js} +0 -0
  178. /package/dist/runtime/helpers/{indicatorsProvider.js → providers/indicators.js} +0 -0
  179. /package/dist/runtime/helpers/{pluginProvider.js → providers/plugin.js} +0 -0
  180. /package/dist/runtime/helpers/{storageProvider.js → providers/storage.js} +0 -0
  181. /package/dist/runtime/helpers/{textProvider.js → providers/texts.js} +0 -0
  182. /package/dist/runtime/types/{blokkOptions.js → blockOptions.js} +0 -0
@@ -0,0 +1,349 @@
1
+ import type { BlokkliIcon } from '#blokkli-build/icons';
2
+ type DefinitionOptionText = {
3
+ /**
4
+ * The option type.
5
+ */
6
+ type: 'text';
7
+ /**
8
+ * The default value.
9
+ */
10
+ default: string;
11
+ /**
12
+ * The label displayed in the editor.
13
+ */
14
+ label: string;
15
+ /**
16
+ * Optional description providing additional context.
17
+ *
18
+ * Displayed below the option label in the editor.
19
+ */
20
+ description?: string;
21
+ /**
22
+ * The HTML input type.
23
+ *
24
+ * @default 'text'
25
+ */
26
+ inputType?: 'text' | 'number' | 'date';
27
+ /**
28
+ * Optional group name for organizing options.
29
+ *
30
+ * Options with the same group are displayed together in a dropdown.
31
+ */
32
+ group?: string;
33
+ };
34
+ type DefinitionOptionNumber = {
35
+ /**
36
+ * The option type.
37
+ */
38
+ type: 'number';
39
+ /**
40
+ * The default value.
41
+ */
42
+ default: number;
43
+ /**
44
+ * The label displayed in the editor.
45
+ */
46
+ label: string;
47
+ /**
48
+ * Optional description providing additional context.
49
+ *
50
+ * Displayed below the option label in the editor.
51
+ */
52
+ description?: string;
53
+ /**
54
+ * Minimum allowed value.
55
+ */
56
+ min: number;
57
+ /**
58
+ * Maximum allowed value.
59
+ */
60
+ max: number;
61
+ /**
62
+ * Optional group name for organizing options.
63
+ *
64
+ * Options with the same group are displayed together in a dropdown.
65
+ */
66
+ group?: string;
67
+ };
68
+ type DefinitionOptionRange = {
69
+ /**
70
+ * The option type.
71
+ */
72
+ type: 'range';
73
+ /**
74
+ * The default value.
75
+ */
76
+ default: number;
77
+ /**
78
+ * The label displayed in the editor.
79
+ */
80
+ label: string;
81
+ /**
82
+ * Optional description providing additional context.
83
+ *
84
+ * Displayed below the option label in the editor.
85
+ */
86
+ description?: string;
87
+ /**
88
+ * Minimum allowed value.
89
+ */
90
+ min: number;
91
+ /**
92
+ * Maximum allowed value.
93
+ */
94
+ max: number;
95
+ /**
96
+ * The step increment.
97
+ */
98
+ step: number;
99
+ /**
100
+ * Optional group name for organizing options.
101
+ *
102
+ * Options with the same group are displayed together in a dropdown.
103
+ */
104
+ group?: string;
105
+ };
106
+ type DefinitionOptionDateTimeLocal = {
107
+ /**
108
+ * The option type.
109
+ */
110
+ type: 'datetime-local';
111
+ /**
112
+ * The label displayed in the editor.
113
+ */
114
+ label: string;
115
+ /**
116
+ * Optional description providing additional context.
117
+ *
118
+ * Displayed below the option label in the editor.
119
+ */
120
+ description?: string;
121
+ /**
122
+ * The default value as an ISO 8601 datetime string.
123
+ *
124
+ * @example '2024-03-15T14:30:00'
125
+ */
126
+ default?: string;
127
+ /**
128
+ * Minimum allowed datetime as an ISO 8601 string.
129
+ */
130
+ min?: string;
131
+ /**
132
+ * Maximum allowed datetime as an ISO 8601 string.
133
+ */
134
+ max?: string;
135
+ /**
136
+ * Optional group name for organizing options.
137
+ *
138
+ * Options with the same group are displayed together in a dropdown.
139
+ */
140
+ group?: string;
141
+ };
142
+ type DefinitionOptionCheckbox = {
143
+ /**
144
+ * The option type.
145
+ */
146
+ type: 'checkbox';
147
+ /**
148
+ * The default value.
149
+ */
150
+ default: boolean;
151
+ /**
152
+ * The label displayed in the editor.
153
+ */
154
+ label: string;
155
+ /**
156
+ * Optional description providing additional context.
157
+ *
158
+ * Displayed below the option label in the editor.
159
+ */
160
+ description?: string;
161
+ /**
162
+ * Optional group name for organizing options.
163
+ *
164
+ * Options with the same group are displayed together in a dropdown.
165
+ */
166
+ group?: string;
167
+ };
168
+ type DefinitionOptionColor = {
169
+ /**
170
+ * The option type.
171
+ */
172
+ type: 'color';
173
+ /**
174
+ * The default value as a HEX color string.
175
+ *
176
+ * @example '#ff0000'
177
+ */
178
+ default: `#${string}`;
179
+ /**
180
+ * The label displayed in the editor.
181
+ */
182
+ label: string;
183
+ /**
184
+ * Optional description providing additional context.
185
+ *
186
+ * Displayed below the option label in the editor.
187
+ */
188
+ description?: string;
189
+ /**
190
+ * Optional group name for organizing options.
191
+ *
192
+ * Options with the same group are displayed together in a dropdown.
193
+ */
194
+ group?: string;
195
+ };
196
+ type DefinitionOptionCheckboxes = {
197
+ /**
198
+ * The option type.
199
+ */
200
+ type: 'checkboxes';
201
+ /**
202
+ * The label displayed in the editor.
203
+ */
204
+ label: string;
205
+ /**
206
+ * Optional description providing additional context.
207
+ *
208
+ * Displayed below the option label in the editor.
209
+ */
210
+ description?: string;
211
+ /**
212
+ * The default values.
213
+ */
214
+ default: string[];
215
+ /**
216
+ * Available options.
217
+ *
218
+ * Key is the option value, value is the display label.
219
+ */
220
+ options: Record<string, string>;
221
+ /**
222
+ * Optional group name for organizing options.
223
+ *
224
+ * Options with the same group are displayed together in a dropdown.
225
+ */
226
+ group?: string;
227
+ };
228
+ type DefinitionOptionRadiosGridOption = {
229
+ /**
230
+ * Column widths as flex-grow values.
231
+ *
232
+ * @example [1, 2] for a 1:2 ratio
233
+ */
234
+ columns: number[];
235
+ /**
236
+ * The label displayed for this option.
237
+ */
238
+ label: string;
239
+ };
240
+ type DefinitionOptionRadiosGrid = {
241
+ /**
242
+ * Display options as grid layouts.
243
+ */
244
+ displayAs: 'grid';
245
+ /**
246
+ * Available options.
247
+ *
248
+ * Key is the option value, value is the grid configuration.
249
+ */
250
+ options: Record<string, DefinitionOptionRadiosGridOption>;
251
+ };
252
+ type DefinitionOptionRadiosColorsOption = {
253
+ /**
254
+ * Optional HEX color value.
255
+ *
256
+ * @example '#ff0000'
257
+ */
258
+ hex?: `#${string}`;
259
+ /**
260
+ * Optional CSS class for the color.
261
+ *
262
+ * Used as fallback when hex is not provided.
263
+ */
264
+ class?: string;
265
+ /**
266
+ * The label displayed for this option.
267
+ */
268
+ label: string;
269
+ };
270
+ type DefinitionOptionRadiosColors = {
271
+ /**
272
+ * Display options as color swatches.
273
+ */
274
+ displayAs: 'colors';
275
+ /**
276
+ * Available color options.
277
+ *
278
+ * Key is the option value, value is the color configuration.
279
+ */
280
+ options: Record<string, DefinitionOptionRadiosColorsOption>;
281
+ };
282
+ type DefinitionOptionRadiosRadios = {
283
+ /**
284
+ * Display options as radio buttons.
285
+ *
286
+ * @default 'radios'
287
+ */
288
+ displayAs?: 'radios' | undefined;
289
+ /**
290
+ * Available options.
291
+ *
292
+ * Key is the option value, value is the display label.
293
+ */
294
+ options: Record<string, string>;
295
+ };
296
+ type DefinitionOptionRadiosIconsOption = {
297
+ /**
298
+ * The icon to display.
299
+ *
300
+ * Icon files must be in the same folder as the component and start with 'icon-blokkli-'.
301
+ */
302
+ icon: BlokkliIcon;
303
+ /**
304
+ * The label displayed for this option.
305
+ */
306
+ label: string;
307
+ };
308
+ type DefinitionOptionRadiosIcons = {
309
+ /**
310
+ * Display options as icons.
311
+ */
312
+ displayAs: 'icons';
313
+ /**
314
+ * Available icon options.
315
+ *
316
+ * Key is the option value, value is the icon configuration.
317
+ */
318
+ options: Record<string, DefinitionOptionRadiosIconsOption>;
319
+ };
320
+ type DefinitionOptionRadios = {
321
+ /**
322
+ * The option type.
323
+ */
324
+ type: 'radios';
325
+ /**
326
+ * The label displayed in the editor.
327
+ */
328
+ label: string;
329
+ /**
330
+ * Optional description providing additional context.
331
+ *
332
+ * Displayed below the option label in the editor.
333
+ */
334
+ description?: string;
335
+ /**
336
+ * The default value.
337
+ *
338
+ * Must be one of the option keys.
339
+ */
340
+ default: string;
341
+ /**
342
+ * Optional group name for organizing options.
343
+ *
344
+ * Options with the same group are displayed together in a dropdown.
345
+ */
346
+ group?: string;
347
+ } & (DefinitionOptionRadiosColors | DefinitionOptionRadiosGrid | DefinitionOptionRadiosRadios | DefinitionOptionRadiosIcons);
348
+ export type BlockOptionDefinition = DefinitionOptionColor | DefinitionOptionCheckbox | DefinitionOptionCheckboxes | DefinitionOptionRadios | DefinitionOptionText | DefinitionOptionRange | DefinitionOptionNumber | DefinitionOptionDateTimeLocal;
349
+ export {};
@@ -1,34 +1,34 @@
1
1
  import type { ComputedRef } from 'vue';
2
2
  import type { Emitter } from 'mitt';
3
- import type { DomProvider } from '../helpers/domProvider.js';
4
- import type { StorageProvider } from '../helpers/storageProvider.js';
5
- import type { BlockDefinitionProvider } from '../helpers/typesProvider.js';
6
- import type { SelectionProvider } from '../helpers/selectionProvider.js';
7
- import type { KeyboardProvider } from '../helpers/keyboardProvider.js';
8
- import type { UiProvider } from '../helpers/uiProvider.js';
9
- import type { AnimationProvider } from '../helpers/animationProvider.js';
10
- import type { StateProvider } from '../helpers/stateProvider.js';
3
+ import type { DomProvider } from '../helpers/providers/dom.js';
4
+ import type { StorageProvider } from '../helpers/providers/storage.js';
5
+ import type { BlockDefinitionProvider } from '../helpers/providers/types.js';
6
+ import type { SelectionProvider } from '../helpers/providers/selection.js';
7
+ import type { KeyboardProvider } from '../helpers/providers/keyboard.js';
8
+ import type { UiProvider } from '../helpers/providers/ui.js';
9
+ import type { AnimationProvider } from '../helpers/providers/animation.js';
10
+ import type { StateProvider } from '../helpers/providers/state.js';
11
11
  import type { DirectiveProvider } from '../helpers/providers/directive.js';
12
- import type { TextProvider } from '../helpers/textProvider.js';
13
- import type { PluginProvider } from '../helpers/pluginProvider.js';
12
+ import type { TextProvider } from '../helpers/providers/texts.js';
13
+ import type { PluginProvider } from '../helpers/providers/plugin.js';
14
14
  import type { eventBus } from './../helpers/eventBus.js';
15
- import type { BlockOptionDefinition } from './blokkOptions.js';
15
+ import type { BlockOptionDefinition } from './blockOptions.js';
16
16
  import type { BlokkliAdapter, AdapterContext, MutationResponseLike } from './../adapter/index.js';
17
- import type { BroadcastProvider } from '#blokkli/helpers/broadcastProvider';
18
- import type { FeaturesProvider } from '#blokkli/helpers/featuresProvider';
17
+ import type { BroadcastProvider } from '../helpers/providers/broadcast.js';
18
+ import type { FeaturesProvider } from '../helpers/providers/features.js';
19
19
  import type { BlokkliIcon } from '#blokkli-build/icons';
20
20
  import type { SettingsGroup, Viewport } from '#blokkli/constants';
21
21
  import type { BlockBundleWithNested, FieldListItemTyped, GlobalOptionsKey, ValidChunkNames, ValidFieldListTypes, ValidGlobalConfigKeys, BundleProps } from '#blokkli-build/generated-types';
22
- import type { ThemeProvider } from '#blokkli/helpers/themeProvider';
22
+ import type { ThemeProvider } from '../helpers/providers/theme.js';
23
23
  import type { BlokkliFragmentName, GlobalOptionsType } from '#blokkli-build/definitions';
24
- import type { CommandsProvider } from '#blokkli/helpers/commandsProvider';
25
- import type { TourProvider } from '#blokkli/helpers/tourProvider';
26
- import type { DropAreaProvider } from '#blokkli/helpers/dropAreaProvider';
24
+ import type { CommandsProvider } from '../helpers/providers/commands.js';
25
+ import type { TourProvider } from '../helpers/providers/tour.js';
26
+ import type { DropAreaProvider } from '../helpers/providers/dropArea.js';
27
27
  import type { RGB } from './theme.js';
28
- import type { DebugProvider } from '#blokkli/helpers/debugProvider';
28
+ import type { DebugProvider } from '../helpers/providers/debug.js';
29
29
  import type getVideoId from 'get-video-id';
30
- import type { DefinitionProvider } from '../helpers/definitionProvider.js';
31
- import type { IndicatorsProvider } from '#blokkli/helpers/indicatorsProvider';
30
+ import type { DefinitionProvider } from '../helpers/providers/definition.js';
31
+ import type { IndicatorsProvider } from '../helpers/providers/indicators.js';
32
32
  import type { BlocksProvider } from '#blokkli/helpers/providers/blocks';
33
33
  import type { FieldsProvider } from '#blokkli/helpers/providers/fields';
34
34
  import type { ElementProvider } from '#blokkli/helpers/providers/element';
@@ -204,12 +204,7 @@ export type BlokkliDefinitionInputEditor<Options extends BlockDefinitionOptionsI
204
204
  /**
205
205
  * Get the drag element for the editor.
206
206
  *
207
- * By default, the root element of the component is used for drag actions.
208
- * Sometimes this might not be desirable however. For example, a button
209
- * block might render a container as the root element and have the button
210
- * as the child. In this case the whole container would be clickable and
211
- * selectable. By providing the button as the drag element, only the button
212
- * appears to be selectable/draggable.
207
+ * @deprecated Use a ref in the template to designate the draggable element (e.g. <div ref="blokkliDraggable">).
213
208
  */
214
209
  getDraggableElement?: (el: HTMLElement) => Element | undefined | null;
215
210
  /**
@@ -1406,6 +1401,7 @@ export type SidebarRegion = 'left' | 'right';
1406
1401
  export type GlobalUiDialog = {
1407
1402
  id: string;
1408
1403
  alignment: 'left' | 'right' | 'center';
1404
+ confirmClose?: boolean;
1409
1405
  };
1410
1406
  declare const _default: {};
1411
1407
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blokkli/editor",
3
- "version": "2.0.0-alpha.24",
3
+ "version": "2.0.0-alpha.26",
4
4
  "description": "Interactive page building experience for Nuxt",
5
5
  "repository": "blokkli/editor",
6
6
  "type": "module",
@@ -57,7 +57,7 @@
57
57
  "license": "MIT",
58
58
  "dependencies": {
59
59
  "@types/micromatch": "^4.0.9",
60
- "artboard-deluxe": "^0.1.2",
60
+ "artboard-deluxe": "0.1.3",
61
61
  "estree-walker-ts": "^1.1.0",
62
62
  "flesch": "^2.0.1",
63
63
  "fzf": "^0.5.2",
@@ -1,9 +0,0 @@
1
- import type { Command } from '#blokkli/types';
2
- type CommandsProviderFunction = () => Command[] | Command | undefined;
3
- export type CommandsProvider = {
4
- add: (fn: CommandsProviderFunction) => void;
5
- remove: (fn: CommandsProviderFunction) => void;
6
- getCommands: () => Command[];
7
- };
8
- export default function (): CommandsProvider;
9
- export {};
@@ -1,33 +0,0 @@
1
- import type { StorageProvider } from './storageProvider.js';
2
- import { type ComputedRef } from '#imports';
3
- export type DebugLogger = {
4
- log: (message: string, ...v: any) => void;
5
- error: (message: string, ...v: any) => void;
6
- };
7
- export type LogMessage = {
8
- type: 'log' | 'error' | 'event';
9
- name: string;
10
- date: string;
11
- message: string;
12
- context?: string;
13
- };
14
- type RegisteredDebugOverlay = {
15
- id: string;
16
- label: string;
17
- active: boolean;
18
- };
19
- export type DebugProvider = {
20
- isEnabled: ComputedRef<boolean>;
21
- toggle: () => void;
22
- createLogger: (name: string) => DebugLogger;
23
- registerOverlay: (id: string, label: string) => void;
24
- unregisterOverlay: (id: string) => void;
25
- overlays: ComputedRef<RegisteredDebugOverlay[]>;
26
- toggleOverlay: (id: string) => void;
27
- registeredLoggers: ComputedRef<string[]>;
28
- enabledLoggers: ComputedRef<string[]>;
29
- toggleLogger: (name: string) => void;
30
- getMessages: () => LogMessage[];
31
- };
32
- export default function (storage: StorageProvider): DebugProvider;
33
- export {};
@@ -1,19 +0,0 @@
1
- import { type Ref, type ComputedRef } from '#imports';
2
- import type { BlockDefinition, FragmentDefinition, ProviderDefinition } from '#blokkli-build/definitions';
3
- import type { ValidFieldListTypes, BlockBundleWithNested } from '#blokkli-build/generated-types';
4
- import type { DeepReadonly } from 'vue';
5
- import type { BlockDefinitionOptionsInput } from '../types/index.js';
6
- import { type RuntimeBlockOptionArray } from '#blokkli-build/runtime-options';
7
- export type DefinitionProvider = {
8
- getBlockDefinition: (bundle: string, fieldListType: ValidFieldListTypes, parentBundle?: BlockBundleWithNested | null) => BlockDefinition | undefined;
9
- getDefaultDefinition: (bundle: string) => BlockDefinition | undefined;
10
- getFragmentDefinition: (name: string) => FragmentDefinition | undefined;
11
- getProviderDefinition: (entityType: string, entityBundle: string) => ProviderDefinition | undefined;
12
- getBlockIcon: (bundle: string) => string | undefined;
13
- fragmentDefinitions: ComputedRef<FragmentDefinition[]>;
14
- blockDefinitions: ComputedRef<BlockDefinition[]>;
15
- globalOptions: DeepReadonly<Ref<BlockDefinitionOptionsInput>>;
16
- runtimeOptions: DeepReadonly<Ref<Record<string, Record<string, RuntimeBlockOptionArray>>>>;
17
- renderKey: DeepReadonly<Ref<string>>;
18
- };
19
- export default function (): DefinitionProvider;
@@ -1,91 +0,0 @@
1
- import { type ComputedRef } from '#imports';
2
- import type { DraggableExistingBlock, DraggableItem, EntityContext, Rectangle, RenderedFieldListItem, RegisteredField, RegisterFieldData } from '#blokkli/types';
3
- import type { UiProvider } from './uiProvider.js';
4
- import type { DebugProvider } from './debugProvider.js';
5
- import type { DefinitionProvider } from './definitionProvider.js';
6
- import type { StateProvider } from './stateProvider.js';
7
- import type { ElementProvider } from './providers/element.js';
8
- type RegisteredFieldType = {
9
- entityType: string;
10
- entityBundle: string;
11
- fieldName: string;
12
- };
13
- type MeasuredBlockRect = Rectangle & {
14
- time: number;
15
- };
16
- export type DomProvider = {
17
- getBoundingClientRect: (element: HTMLElement) => DOMRect;
18
- /**
19
- * Return the droppable markup for a draggable item.
20
- */
21
- getDropElementMarkup(item: DraggableItem | RenderedFieldListItem, checkSize?: boolean): string;
22
- registerBlock: (key: string, uuid: string, el: HTMLElement | null) => void;
23
- unregisterBlock: (key: string, uuid: string) => void;
24
- registerField: (entity: EntityContext, fieldName: string, instance: HTMLElement, data: RegisterFieldData) => void;
25
- updateFieldElement: (entity: EntityContext, fieldName: string, element: HTMLElement, data: RegisterFieldData) => void;
26
- unregisterField: (entity: EntityContext, fieldName: string) => void;
27
- getRegisteredField: (uuid: string, fieldName: string) => RegisteredField | undefined;
28
- registeredFieldTypes: ComputedRef<RegisteredFieldType[]>;
29
- registeredBlockUuids: ComputedRef<string[]>;
30
- getVisibleBlocks(): string[];
31
- getVisibleFields(): string[];
32
- isBlockVisible(uuid: string): boolean;
33
- getBlockRects: () => Record<string, MeasuredBlockRect>;
34
- getBlockRect: (uuid: string, refresh?: boolean) => MeasuredBlockRect | undefined;
35
- refreshBlockRect: (uuid: string) => void;
36
- getFieldRect: (key: string) => Rectangle | undefined;
37
- registeredBlocks: ComputedRef<Record<string, HTMLElement | undefined>>;
38
- updateVisibleRects: () => void;
39
- isReady: ComputedRef<boolean>;
40
- init: () => void;
41
- /**
42
- * Get the drag element for a block.
43
- */
44
- getDragElement: (block: DraggableExistingBlock | RenderedFieldListItem) => HTMLElement | undefined;
45
- /**
46
- * Get debug data for troubleshooting.
47
- */
48
- getDebugData: () => {
49
- registeredBlocks: Array<{
50
- uuid: string;
51
- hasElement: boolean;
52
- hasObservedElement: boolean;
53
- hasRect: boolean;
54
- hasCurrentKey: boolean;
55
- isVisible: boolean;
56
- elementInfo?: {
57
- tagName: string;
58
- bundle?: string;
59
- hostBundle?: string;
60
- fieldListType?: string;
61
- };
62
- }>;
63
- fields: Array<{
64
- key: string;
65
- isVisible: boolean;
66
- hasRect: boolean;
67
- entityType: string;
68
- entityBundle: string;
69
- fieldName: string;
70
- }>;
71
- summary: {
72
- totalRegisteredBlocks: number;
73
- totalBlocksWithElements: number;
74
- totalObservedElements: number;
75
- totalBlockRects: number;
76
- totalVisibleBlocks: number;
77
- totalRegisteredFields: number;
78
- totalVisibleFields: number;
79
- totalFieldRects: number;
80
- isInitializing: boolean;
81
- isReady: boolean;
82
- };
83
- orphanedData: {
84
- rectsWithoutRegistration: string[];
85
- observedElementsWithoutRegistration: string[];
86
- keysWithoutRegistration: string[];
87
- };
88
- };
89
- };
90
- export default function (ui: UiProvider, debug: DebugProvider, definitions: DefinitionProvider, state: StateProvider, element: ElementProvider): DomProvider;
91
- export {};
@@ -1,9 +0,0 @@
1
- import type { DraggableItem, DropArea } from '#blokkli/types';
2
- type DropAreaProviderFunction = (items: DraggableItem[]) => DropArea[] | DropArea | undefined;
3
- export type DropAreaProvider = {
4
- add: (fn: DropAreaProviderFunction) => void;
5
- remove: (fn: DropAreaProviderFunction) => void;
6
- getDropAreas: (items: DraggableItem[]) => DropArea[];
7
- };
8
- export default function (): DropAreaProvider;
9
- export {};
@@ -1,17 +0,0 @@
1
- import type { FeatureDefinition, AdapterMethods } from '#blokkli/types';
2
- import { type ValidFeatureKey } from '#blokkli-build/features';
3
- import { type ComputedRef } from '#imports';
4
- import type { StorageProvider } from './storageProvider.js';
5
- export type FeaturesProvider = {
6
- features: ComputedRef<FeatureDefinition[]>;
7
- mountedFeatures: ComputedRef<FeatureDefinition<AdapterMethods[], ValidFeatureKey>[]>;
8
- betaFeatures: ComputedRef<{
9
- id: ValidFeatureKey;
10
- label: string;
11
- description?: string;
12
- }[]>;
13
- enabledBetaFeatures: ComputedRef<ValidFeatureKey[]>;
14
- mount: (feature: FeatureDefinition<AdapterMethods[], ValidFeatureKey>) => void;
15
- unmount: (id: string) => void;
16
- };
17
- export default function (storage: StorageProvider): FeaturesProvider;
@@ -1,10 +0,0 @@
1
- import { type Ref } from 'vue';
2
- import type { BlockIndicator } from '../types/index.js';
3
- export type IndicatorsProvider = {
4
- indicators: Ref<BlockIndicator[]>;
5
- hovered: Ref<string>;
6
- addIndicator: (indicator: BlockIndicator) => void;
7
- removeIndicator: (id: string, uuid: string) => void;
8
- setHovered: (uuid?: string | null) => void;
9
- };
10
- export default function (): IndicatorsProvider;
@@ -1,20 +0,0 @@
1
- import { type Ref, type ComputedRef } from 'vue';
2
- import type { AnimationProvider } from './animationProvider.js';
3
- import type { KeyboardShortcut } from '#blokkli/types';
4
- type RegisteredShortcut = {
5
- key: string;
6
- shortcut: KeyboardShortcut;
7
- };
8
- export type KeyboardProvider = {
9
- isPressingSpace: Readonly<Ref<boolean>>;
10
- isPressingControl: Readonly<Ref<boolean>>;
11
- isPressingShift: Readonly<Ref<boolean>>;
12
- setShortcutStateFromEvent: (e: MouseEvent | PointerEvent) => void;
13
- shortcuts: ComputedRef<RegisteredShortcut[]>;
14
- registerShortcut: (shortcut: KeyboardShortcut) => void;
15
- unregisterShortcut: (shortcut: KeyboardShortcut) => void;
16
- lockKeyboardEvents: (id: string) => void;
17
- unlockKeyboardEvents: (id: string) => void;
18
- };
19
- export default function (animationProvider: AnimationProvider): KeyboardProvider;
20
- export {};