@blokkli/editor 2.0.0-alpha.47 → 2.0.0-alpha.49

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 (42) hide show
  1. package/dist/chunks/tailwindConfig.mjs +222 -0
  2. package/dist/global/types/definitions.d.ts +1 -1
  3. package/dist/module.d.mts +2 -2
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +164 -16
  6. package/dist/modules/agent/index.d.mts +1 -1
  7. package/dist/modules/agent/index.mjs +6 -29
  8. package/dist/modules/charts/index.d.mts +1 -1
  9. package/dist/modules/charts/index.mjs +3 -3
  10. package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +1 -0
  11. package/dist/modules/charts/runtime/features/charts/Editor/index.vue +50 -53
  12. package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +1 -0
  13. package/dist/modules/drupal/index.d.mts +1 -1
  14. package/dist/modules/drupal/index.mjs +1 -1
  15. package/dist/modules/index.d.mts +7 -0
  16. package/dist/{shared/editor.CGf7C_0M.mjs → modules/index.mjs} +1 -1
  17. package/dist/modules/table-of-contents/index.d.mts +1 -1
  18. package/dist/modules/table-of-contents/index.mjs +1 -1
  19. package/dist/modules/tailwind/index.d.mts +5 -0
  20. package/dist/modules/tailwind/index.mjs +2 -0
  21. package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +4 -4
  22. package/dist/runtime/editor/css/output.css +1 -1
  23. package/dist/runtime/editor/features/add-list/index.vue +1 -1
  24. package/dist/runtime/editor/features/anchors/Overlay/index.vue +25 -7
  25. package/dist/runtime/editor/features/changelog/changelog.json +9 -1
  26. package/dist/runtime/editor/features/complex-options/index.vue +98 -0
  27. package/dist/runtime/editor/features/dragging-overlay/index.vue +29 -13
  28. package/dist/runtime/editor/features/media-library/Library/FilterSelect/index.d.vue.ts +15 -0
  29. package/dist/runtime/editor/features/media-library/Library/FilterSelect/index.vue +168 -0
  30. package/dist/runtime/editor/features/media-library/Library/FilterSelect/index.vue.d.ts +15 -0
  31. package/dist/runtime/editor/features/media-library/Library/index.vue +21 -16
  32. package/dist/runtime/editor/providers/keyboard.js +8 -5
  33. package/dist/runtime/editor/translations/de.json +22 -14
  34. package/dist/runtime/editor/translations/fr.json +21 -13
  35. package/dist/runtime/editor/translations/gsw_CH.json +459 -451
  36. package/dist/runtime/editor/translations/it.json +21 -13
  37. package/dist/shared/{editor.BVregnEC.d.mts → editor.DsGJIlGn.d.mts} +19 -2
  38. package/dist/types.d.mts +1 -1
  39. package/package.json +36 -1
  40. package/dist/modules/charts/runtime/features/charts/index.vue +0 -72
  41. /package/dist/{modules/charts/runtime/features/charts → runtime/editor/features/complex-options}/index.d.vue.ts +0 -0
  42. /package/dist/{modules/charts/runtime/features/charts → runtime/editor/features/complex-options}/index.vue.d.ts +0 -0
@@ -11,15 +11,15 @@
11
11
  </button>
12
12
  </div>
13
13
 
14
- <ChartTypePicker v-model="data.type" />
14
+ <ChartTypePicker v-model="chartData.type" />
15
15
  </div>
16
16
 
17
17
  <ChartTypeOptions
18
18
  v-if="chartDef"
19
- v-model:title="data.title"
19
+ v-model:title="chartData.title"
20
20
  :options="chartDef.editor.options"
21
- :type-options="data.typeOptions || {}"
22
- @update:type-options="data.typeOptions = $event"
21
+ :type-options="chartData.typeOptions || {}"
22
+ @update:type-options="chartData.typeOptions = $event"
23
23
  />
24
24
  </div>
25
25
 
@@ -55,18 +55,18 @@
55
55
  <div class="bk-chart-editor-section">
56
56
  <label class="bk-form-label">{{ $t("chartsData", "Data") }}</label>
57
57
  <DataTable
58
- :categories="data.categories"
59
- :series="data.series"
60
- :category-colors="data.categoryColors"
58
+ :categories="chartData.categories"
59
+ :series="chartData.series"
60
+ :category-colors="chartData.categoryColors"
61
61
  :has-multiple-series="caps.hasMultipleSeries"
62
62
  :has-series-colors="caps.hasSeriesColors"
63
63
  :has-category-colors="caps.hasCategoryColors"
64
64
  :colors="COLORS"
65
65
  :remove-row="removeRow"
66
66
  :remove-series="removeSeries"
67
- @update:categories="data.categories = $event"
68
- @update:series="data.series = $event"
69
- @update:category-colors="data.categoryColors = $event"
67
+ @update:categories="chartData.categories = $event"
68
+ @update:series="chartData.series = $event"
69
+ @update:category-colors="chartData.categoryColors = $event"
70
70
  />
71
71
  <div class="bk-chart-data-table-actions">
72
72
  <button type="button" class="bk-button bk-is-small" @click="addRow">
@@ -88,8 +88,8 @@
88
88
 
89
89
  <div class="bk-chart-editor-section">
90
90
  <FootnoteEditor
91
- :footnotes="data.footnotes"
92
- @update:footnotes="data.footnotes = $event"
91
+ :footnotes="chartData.footnotes"
92
+ @update:footnotes="chartData.footnotes = $event"
93
93
  />
94
94
  </div>
95
95
  </div>
@@ -111,51 +111,48 @@ import Preview from "./Preview/index.vue";
111
111
  import ChartTypeOptions from "./ChartTypeOptions/index.vue";
112
112
  import { onBlokkliEvent } from "#blokkli/editor/composables";
113
113
  const props = defineProps({
114
+ data: { type: [Object, null], required: true },
114
115
  uuid: { type: String, required: true },
115
116
  optionKey: { type: String, required: true }
116
117
  });
117
- const { $t, state } = useBlokkli();
118
+ const { $t } = useBlokkli();
118
119
  function getCurrentData() {
119
- const rawData = state.mutatedOptions[props.uuid]?.data || state.getFieldListItem(props.uuid)?.options?.data;
120
- if (rawData) {
121
- try {
122
- const parsed = JSON.parse(rawData);
123
- if (parsed && Array.isArray(parsed.series) && parsed.series.length > 0) {
124
- const fallbackId = getFirstColorId(COLORS);
125
- for (const series of parsed.series) {
126
- if (!COLORS[series.color]) {
127
- series.color = fallbackId;
128
- }
120
+ if (props.data) {
121
+ const parsed = JSON.parse(JSON.stringify(props.data));
122
+ if (parsed && Array.isArray(parsed.series) && parsed.series.length > 0) {
123
+ const fallbackId = getFirstColorId(COLORS);
124
+ for (const series of parsed.series) {
125
+ if (!COLORS[series.color]) {
126
+ series.color = fallbackId;
129
127
  }
130
- if (Array.isArray(parsed.categoryColors)) {
131
- for (let i = 0; i < parsed.categoryColors.length; i++) {
132
- if (!COLORS[parsed.categoryColors[i]]) {
133
- parsed.categoryColors[i] = fallbackId;
134
- }
128
+ }
129
+ if (Array.isArray(parsed.categoryColors)) {
130
+ for (let i = 0; i < parsed.categoryColors.length; i++) {
131
+ if (!COLORS[parsed.categoryColors[i]]) {
132
+ parsed.categoryColors[i] = fallbackId;
135
133
  }
136
- } else {
137
- parsed.categoryColors = parsed.categories.map(
138
- (_, i) => {
139
- const ids = Object.keys(COLORS);
140
- return ids[i % ids.length] || fallbackId;
141
- }
142
- );
143
- }
144
- if (!Array.isArray(parsed.footnotes)) {
145
- parsed.footnotes = [];
146
- }
147
- if (!parsed.typeOptions || typeof parsed.typeOptions !== "object") {
148
- parsed.typeOptions = getDefaultTypeOptions(parsed.type);
149
134
  }
150
- return parsed;
135
+ } else {
136
+ parsed.categoryColors = parsed.categories.map(
137
+ (_, i) => {
138
+ const ids = Object.keys(COLORS);
139
+ return ids[i % ids.length] || fallbackId;
140
+ }
141
+ );
142
+ }
143
+ if (!Array.isArray(parsed.footnotes)) {
144
+ parsed.footnotes = [];
145
+ }
146
+ if (!parsed.typeOptions || typeof parsed.typeOptions !== "object") {
147
+ parsed.typeOptions = getDefaultTypeOptions(parsed.type);
151
148
  }
152
- } catch {
149
+ return parsed;
153
150
  }
154
151
  }
155
152
  return getDefaultChartData(COLORS);
156
153
  }
157
154
  const {
158
- data,
155
+ data: chartData,
159
156
  canUndo,
160
157
  canRedo,
161
158
  undo,
@@ -168,16 +165,16 @@ const {
168
165
  } = useChartEditorState(getCurrentData(), COLORS);
169
166
  const autoUpdate = ref(true);
170
167
  const previewData = ref(
171
- JSON.parse(JSON.stringify(data.value))
168
+ JSON.parse(JSON.stringify(chartData.value))
172
169
  );
173
170
  const isStale = ref(false);
174
171
  let debounceTimer = null;
175
172
  function refreshPreview() {
176
- previewData.value = JSON.parse(JSON.stringify(data.value));
173
+ previewData.value = JSON.parse(JSON.stringify(chartData.value));
177
174
  isStale.value = false;
178
175
  }
179
176
  watch(
180
- data,
177
+ chartData,
181
178
  () => {
182
179
  if (autoUpdate.value) {
183
180
  if (debounceTimer) clearTimeout(debounceTimer);
@@ -197,7 +194,7 @@ watch(autoUpdate, (enabled) => {
197
194
  onBeforeUnmount(() => {
198
195
  if (debounceTimer) clearTimeout(debounceTimer);
199
196
  });
200
- const chartDef = computed(() => getChartType(data.value.type, $t));
197
+ const chartDef = computed(() => getChartType(chartData.value.type, $t));
201
198
  const caps = computed(() => {
202
199
  const def = chartDef.value;
203
200
  return {
@@ -207,21 +204,21 @@ const caps = computed(() => {
207
204
  };
208
205
  });
209
206
  const typeOptionsCache = {
210
- ...data.value.typeOptions
207
+ ...chartData.value.typeOptions
211
208
  };
212
209
  watch(
213
- () => data.value.type,
210
+ () => chartData.value.type,
214
211
  (type) => {
215
212
  const defaults = getDefaultTypeOptions(type);
216
213
  const merged = {};
217
214
  for (const key of Object.keys(defaults)) {
218
215
  merged[key] = key in typeOptionsCache ? typeOptionsCache[key] : defaults[key];
219
216
  }
220
- data.value.typeOptions = merged;
217
+ chartData.value.typeOptions = merged;
221
218
  }
222
219
  );
223
220
  watch(
224
- () => data.value.typeOptions,
221
+ () => chartData.value.typeOptions,
225
222
  (opts) => {
226
223
  if (opts) {
227
224
  Object.assign(typeOptionsCache, opts);
@@ -230,7 +227,7 @@ watch(
230
227
  { deep: true }
231
228
  );
232
229
  function getData() {
233
- return data.value;
230
+ return chartData.value;
234
231
  }
235
232
  onBlokkliEvent("keyPressed", (e) => {
236
233
  if (e.code === "z" && e.meta) {
@@ -1,5 +1,6 @@
1
1
  import type { BlokkliChartData } from '../../../types.js';
2
2
  type __VLS_Props = {
3
+ data: BlokkliChartData | null;
3
4
  uuid: string;
4
5
  optionKey: string;
5
6
  };
@@ -1,4 +1,4 @@
1
- import { B as BlokkliModule } from '../../shared/editor.BVregnEC.mjs';
1
+ import { B as BlokkliModule } from '../../shared/editor.DsGJIlGn.mjs';
2
2
  import 'nuxt/schema';
3
3
  import 'consola';
4
4
  import '../../../dist/global/types/definitions.js';
@@ -2,7 +2,7 @@ import { createResolver } from '@nuxt/kit';
2
2
  import { fileURLToPath } from 'node:url';
3
3
  import { join } from 'pathe';
4
4
  import { isObjectType, isInterfaceType } from 'graphql';
5
- import { d as defineBlokkliModule } from '../../shared/editor.CGf7C_0M.mjs';
5
+ import { defineBlokkliModule } from '../index.mjs';
6
6
  import { useGraphqlModuleContext } from 'nuxt-graphql-middleware/utils';
7
7
 
8
8
  function toPascalCase(text) {
@@ -0,0 +1,7 @@
1
+ export { b as Blokkli, B as BlokkliModule, d as defineBlokkliModule } from '../shared/editor.DsGJIlGn.mjs';
2
+ import 'nuxt/schema';
3
+ import 'consola';
4
+ import '../../dist/global/types/definitions.js';
5
+ import '../../dist/global/types/theme.js';
6
+ import '@nuxt/kit';
7
+ import '../../dist/global/types/features.js';
@@ -7,4 +7,4 @@ function defineBlokkliModule(init) {
7
7
  };
8
8
  }
9
9
 
10
- export { defineBlokkliModule as d };
10
+ export { defineBlokkliModule };
@@ -1,4 +1,4 @@
1
- import { B as BlokkliModule } from '../../shared/editor.BVregnEC.mjs';
1
+ import { B as BlokkliModule } from '../../shared/editor.DsGJIlGn.mjs';
2
2
  import 'nuxt/schema';
3
3
  import 'consola';
4
4
  import '../../../dist/global/types/definitions.js';
@@ -1,5 +1,5 @@
1
1
  import { createResolver, addComponent } from '@nuxt/kit';
2
- import { d as defineBlokkliModule } from '../../shared/editor.CGf7C_0M.mjs';
2
+ import { defineBlokkliModule } from '../index.mjs';
3
3
  import { fileURLToPath } from 'node:url';
4
4
 
5
5
  const index = defineBlokkliModule({
@@ -0,0 +1,5 @@
1
+ import { Config } from 'tailwindcss';
2
+
3
+ declare const tailwindConfig: Config;
4
+
5
+ export { tailwindConfig };
@@ -0,0 +1,2 @@
1
+ export { default as tailwindConfig } from '../../chunks/tailwindConfig.mjs';
2
+ import 'tailwindcss/plugin';
@@ -90,10 +90,10 @@ const backLabel = computed(() => {
90
90
  if (!entityLabel) {
91
91
  return $t("libraryItemEditOverlayBack", "Back to page");
92
92
  }
93
- return $t("libraryItemEditOverlayBackWithPage", 'Back to "@label"').replace(
94
- "@label",
95
- entityLabel
96
- );
93
+ return $t(
94
+ "libraryItemEditOverlayBackWithPage",
95
+ 'Save and go back to "@label"'
96
+ ).replace("@label", entityLabel);
97
97
  });
98
98
  const FADE_DURATION = 150;
99
99
  const EASING = "cubic-bezier(0.56, 0.04, 0.25, 1)";