@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.
- package/dist/chunks/tailwindConfig.mjs +222 -0
- package/dist/global/types/definitions.d.ts +1 -1
- package/dist/module.d.mts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +164 -16
- package/dist/modules/agent/index.d.mts +1 -1
- package/dist/modules/agent/index.mjs +6 -29
- package/dist/modules/charts/index.d.mts +1 -1
- package/dist/modules/charts/index.mjs +3 -3
- package/dist/modules/charts/runtime/features/charts/Editor/index.d.vue.ts +1 -0
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue +50 -53
- package/dist/modules/charts/runtime/features/charts/Editor/index.vue.d.ts +1 -0
- package/dist/modules/drupal/index.d.mts +1 -1
- package/dist/modules/drupal/index.mjs +1 -1
- package/dist/modules/index.d.mts +7 -0
- package/dist/{shared/editor.CGf7C_0M.mjs → modules/index.mjs} +1 -1
- package/dist/modules/table-of-contents/index.d.mts +1 -1
- package/dist/modules/table-of-contents/index.mjs +1 -1
- package/dist/modules/tailwind/index.d.mts +5 -0
- package/dist/modules/tailwind/index.mjs +2 -0
- package/dist/runtime/editor/components/NestedEditorOverlay/index.vue +4 -4
- package/dist/runtime/editor/css/output.css +1 -1
- package/dist/runtime/editor/features/add-list/index.vue +1 -1
- package/dist/runtime/editor/features/anchors/Overlay/index.vue +25 -7
- package/dist/runtime/editor/features/changelog/changelog.json +9 -1
- package/dist/runtime/editor/features/complex-options/index.vue +98 -0
- package/dist/runtime/editor/features/dragging-overlay/index.vue +29 -13
- package/dist/runtime/editor/features/media-library/Library/FilterSelect/index.d.vue.ts +15 -0
- package/dist/runtime/editor/features/media-library/Library/FilterSelect/index.vue +168 -0
- package/dist/runtime/editor/features/media-library/Library/FilterSelect/index.vue.d.ts +15 -0
- package/dist/runtime/editor/features/media-library/Library/index.vue +21 -16
- package/dist/runtime/editor/providers/keyboard.js +8 -5
- package/dist/runtime/editor/translations/de.json +22 -14
- package/dist/runtime/editor/translations/fr.json +21 -13
- package/dist/runtime/editor/translations/gsw_CH.json +459 -451
- package/dist/runtime/editor/translations/it.json +21 -13
- package/dist/shared/{editor.BVregnEC.d.mts → editor.DsGJIlGn.d.mts} +19 -2
- package/dist/types.d.mts +1 -1
- package/package.json +36 -1
- package/dist/modules/charts/runtime/features/charts/index.vue +0 -72
- /package/dist/{modules/charts/runtime/features/charts → runtime/editor/features/complex-options}/index.d.vue.ts +0 -0
- /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="
|
|
14
|
+
<ChartTypePicker v-model="chartData.type" />
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
17
|
<ChartTypeOptions
|
|
18
18
|
v-if="chartDef"
|
|
19
|
-
v-model:title="
|
|
19
|
+
v-model:title="chartData.title"
|
|
20
20
|
:options="chartDef.editor.options"
|
|
21
|
-
:type-options="
|
|
22
|
-
@update:type-options="
|
|
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="
|
|
59
|
-
:series="
|
|
60
|
-
:category-colors="
|
|
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="
|
|
68
|
-
@update:series="
|
|
69
|
-
@update:category-colors="
|
|
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="
|
|
92
|
-
@update:footnotes="
|
|
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
|
|
118
|
+
const { $t } = useBlokkli();
|
|
118
119
|
function getCurrentData() {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
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
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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(
|
|
173
|
+
previewData.value = JSON.parse(JSON.stringify(chartData.value));
|
|
177
174
|
isStale.value = false;
|
|
178
175
|
}
|
|
179
176
|
watch(
|
|
180
|
-
|
|
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(
|
|
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
|
-
...
|
|
207
|
+
...chartData.value.typeOptions
|
|
211
208
|
};
|
|
212
209
|
watch(
|
|
213
|
-
() =>
|
|
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
|
-
|
|
217
|
+
chartData.value.typeOptions = merged;
|
|
221
218
|
}
|
|
222
219
|
);
|
|
223
220
|
watch(
|
|
224
|
-
() =>
|
|
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
|
|
230
|
+
return chartData.value;
|
|
234
231
|
}
|
|
235
232
|
onBlokkliEvent("keyPressed", (e) => {
|
|
236
233
|
if (e.code === "z" && e.meta) {
|
|
@@ -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 {
|
|
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';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createResolver, addComponent } from '@nuxt/kit';
|
|
2
|
-
import {
|
|
2
|
+
import { defineBlokkliModule } from '../index.mjs';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
|
|
5
5
|
const index = defineBlokkliModule({
|
|
@@ -90,10 +90,10 @@ const backLabel = computed(() => {
|
|
|
90
90
|
if (!entityLabel) {
|
|
91
91
|
return $t("libraryItemEditOverlayBack", "Back to page");
|
|
92
92
|
}
|
|
93
|
-
return $t(
|
|
94
|
-
"
|
|
95
|
-
|
|
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)";
|