@opengis/cms 0.0.64 → 0.0.66
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/{EditCollectionPage-CzFBw3wE.js → EditCollectionPage-DnUqSUxK.js} +1 -1
- package/dist/{contentForm-CELj2rGf.js → contentForm-1Fozy3Gb.js} +139 -135
- package/dist/index.js +1 -1
- package/dist/{vs-builder-preview-BLfKnxhd.js → vs-builder-preview-BoN8-Xd4.js} +1 -1
- package/dist/{vs-form-reference-list-DukrxeuH.js → vs-form-reference-list-nkQvgmGb.js} +476 -430
- package/locales/en.json +13 -1
- package/locales/uk.json +15 -3
- package/package.json +3 -3
- package/server/functions/preUploadMultiPart.js +61 -0
- package/server/plugins/hook.js +2 -1
|
@@ -6,7 +6,7 @@ import { _ as X } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_l
|
|
|
6
6
|
const Z = {
|
|
7
7
|
monaco: k(() => import("./vs-builder-monaco-Cw-f19gc.js")),
|
|
8
8
|
edit: k(() => import("./vs-builder-edit-D-q1o8tF.js")),
|
|
9
|
-
preview: k(() => import("./vs-builder-preview-
|
|
9
|
+
preview: k(() => import("./vs-builder-preview-BoN8-Xd4.js"))
|
|
10
10
|
}, ee = { class: "mx-auto max-w-[90%]" }, te = { class: "flex items-center justify-between mb-6" }, oe = { class: "mb-2 text-2xl font-semibold text-gray-900" }, ne = { class: "lowercase" }, se = { class: "text-gray-600" }, ie = { class: "flex items-center gap-2" }, ae = { class: "w-full" }, re = { class: "flex items-center w-full h-10 max-w-md grid-cols-3 p-1 mb-6 bg-white border border-gray-200 rounded-md text-muted-foreground" }, le = ["onClick"], ce = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "mx-auto bg-white rounded-md py-4 px-2 bg-opacity-50"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as Pe, defineAsyncComponent as k, inject as le, ref as
|
|
2
|
-
import { useRouter as
|
|
1
|
+
import { defineComponent as Pe, defineAsyncComponent as k, inject as le, ref as p, getCurrentInstance as Be, toRef as Ee, computed as v, watch as Fe, onMounted as Ie, openBlock as h, createElementBlock as $, createElementVNode as u, createVNode as C, unref as f, toDisplayString as j, createCommentVNode as A, createTextVNode as ne, Fragment as Ne, renderList as Me, normalizeClass as ie, createBlock as ae, withDirectives as q, vModelCheckbox as Re, vShow as re, nextTick as ce } from "vue";
|
|
2
|
+
import { useRouter as De, useRoute as Ue } from "vue-router";
|
|
3
3
|
import { ArrowLeft as Oe, HelpCircle as Je, Settings as He, Save as Ke, Loader2 as qe } from "lucide-vue-next";
|
|
4
4
|
import { useI18n as Ge } from "vue-i18n";
|
|
5
5
|
import { _ as Qe, g as We } from "./vs-form-custom-datatable-D880w8gx.js";
|
|
@@ -30,7 +30,7 @@ const Xe = [
|
|
|
30
30
|
type: "key-value",
|
|
31
31
|
ignore: ["title", "description", "keywords"]
|
|
32
32
|
}
|
|
33
|
-
], Ye = { class: "space-y-6 mx-auto relativ max-w-[90%]" }, Ze = { class: "" }, et = { class: "flex items-center justify-between" }, tt = { class: "flex items-center gap-4" }, st = { class: "text-2xl font-semibold text-gray-900 dark:text-white line-clamp-1" }, ot = ["href", "title"], lt = { class: "flex items-center space-x-3" }, nt = ["title"],
|
|
33
|
+
], Ye = { class: "space-y-6 mx-auto relativ max-w-[90%]" }, Ze = { class: "" }, et = { class: "flex items-center justify-between" }, tt = { class: "flex items-center gap-4" }, st = { class: "text-2xl font-semibold text-gray-900 dark:text-white line-clamp-1" }, ot = ["href", "title"], lt = { class: "flex items-center space-x-3" }, nt = ["title"], it = { class: "w-full mt-6 flex items-center justify-between" }, at = { class: "flex items-center w-full h-10 max-w-md grid-cols-3 p-1 bg-white border border-gray-200 rounded-md text-muted-foreground" }, rt = ["onClick"], ct = { class: "flex items-center gap-4" }, ut = ["disabled"], dt = { class: "flex items-center gap-2" }, mt = {
|
|
34
34
|
for: "is_pin",
|
|
35
35
|
class: "text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer"
|
|
36
36
|
}, vt = { class: "relative" }, pt = {
|
|
@@ -38,7 +38,7 @@ const Xe = [
|
|
|
38
38
|
class: "w-3 h-3 text-white",
|
|
39
39
|
fill: "currentColor",
|
|
40
40
|
viewBox: "0 0 20 20"
|
|
41
|
-
}, ft = { class: "mx-auto bg-white rounded-md p-5" },
|
|
41
|
+
}, ft = { class: "mx-auto bg-white rounded-md p-5" }, gt = { class: "mx-auto bg-white rounded-md p-5" }, yt = {
|
|
42
42
|
key: 0,
|
|
43
43
|
class: "mx-auto bg-white rounded-md p-5"
|
|
44
44
|
}, bt = {
|
|
@@ -48,10 +48,10 @@ const Xe = [
|
|
|
48
48
|
__name: "contentForm",
|
|
49
49
|
setup(ht) {
|
|
50
50
|
const de = k(
|
|
51
|
-
() => import("./vs-form-reference-list-
|
|
51
|
+
() => import("./vs-form-reference-list-nkQvgmGb.js")
|
|
52
52
|
), me = k(
|
|
53
53
|
() => import("./vs-form-tiptap-DDFQjRjY.js")
|
|
54
|
-
),
|
|
54
|
+
), I = k(
|
|
55
55
|
() => import("./vs-form-media-select-NY27EaG1.js")
|
|
56
56
|
), ve = k(
|
|
57
57
|
() => import("./vs-richtext-md-C098v_6Q.js")
|
|
@@ -59,21 +59,21 @@ const Xe = [
|
|
|
59
59
|
() => import("./vs-form-integer-BZ855R3g.js")
|
|
60
60
|
), fe = k(
|
|
61
61
|
() => import("./vs-form-reletion-link-BhzNQszm.js")
|
|
62
|
-
), ye = k(
|
|
63
|
-
() => import("./VsFormTags-CMjiu9sY.js")
|
|
64
62
|
), ge = k(
|
|
63
|
+
() => import("./VsFormTags-CMjiu9sY.js")
|
|
64
|
+
), ye = k(
|
|
65
65
|
() => import("./VsPreview-DwETkOpb.js")
|
|
66
66
|
), be = k(
|
|
67
67
|
() => import("./CollectionsBreadcrumb-HePNJb-d.js")
|
|
68
68
|
);
|
|
69
|
-
x["vs-input-custom-datatable"] = Qe, x["vs-input-reference"] = de, x["vs-input-texteditor"] = me, x["vs-input-mediaselect"] =
|
|
70
|
-
const { t: r, locale: G } = Ge(),
|
|
69
|
+
x["vs-input-custom-datatable"] = Qe, x["vs-input-reference"] = de, x["vs-input-texteditor"] = me, x["vs-input-mediaselect"] = I, x["vs-input-file"] = I, x["vs-input-image"] = I, x["vs-input-richtext-md"] = ve, x["vs-input-integer"] = pe, x["vs-input-relation-link"] = fe;
|
|
70
|
+
const { t: r, locale: G } = Ge(), T = De(), d = Ue(), Q = le("cms.menu", null) || le("menu", p([])), _ = p([]), N = p({}), W = p({}), M = p({}), R = p(""), D = p(!0), U = Be(), O = U == null ? void 0 : U.appContext, he = (O == null ? void 0 : O.config.globalProperties) || {}, X = Ee(he, "$settings"), E = v(() => {
|
|
71
71
|
var e;
|
|
72
72
|
return ((e = X.value) == null ? void 0 : e.cms) || {};
|
|
73
|
-
}), we =
|
|
73
|
+
}), we = v(() => Array.isArray(E.value.locales) ? E.value.locales : []), J = v(
|
|
74
74
|
() => we.value.filter(Boolean)
|
|
75
|
-
), Y =
|
|
76
|
-
() => E.value.locale ||
|
|
75
|
+
), Y = v(
|
|
76
|
+
() => E.value.locale || J.value[0] || "uk"
|
|
77
77
|
);
|
|
78
78
|
Fe(
|
|
79
79
|
X,
|
|
@@ -85,28 +85,28 @@ const Xe = [
|
|
|
85
85
|
{ deep: !0 }
|
|
86
86
|
);
|
|
87
87
|
const ke = (e) => {
|
|
88
|
-
const t = [], o =
|
|
88
|
+
const t = [], o = J.value.filter(
|
|
89
89
|
(n) => n !== Y.value
|
|
90
90
|
);
|
|
91
91
|
return Array.isArray(e) && e.forEach((n) => {
|
|
92
|
-
t.push(n), !(!n.localization || o.length === 0) && o.forEach((
|
|
92
|
+
t.push(n), !(!n.localization || o.length === 0) && o.forEach((i) => {
|
|
93
93
|
t.push({
|
|
94
94
|
...n,
|
|
95
|
-
name: `${n.name}:${
|
|
96
|
-
label: `${n.label} (${
|
|
95
|
+
name: `${n.name}:${i}`,
|
|
96
|
+
label: `${n.label} (${i})`
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
99
|
}), t;
|
|
100
|
-
}, Z =
|
|
100
|
+
}, Z = v(() => ke(_.value)), xe = v(
|
|
101
101
|
() => Array.isArray(_.value) && _.value.some(
|
|
102
102
|
(e) => e.localization === !0 && e.name !== "title"
|
|
103
103
|
)
|
|
104
|
-
), z =
|
|
104
|
+
), z = p(!1), _e = v(() => {
|
|
105
105
|
var e;
|
|
106
106
|
return (e = Z.value) == null ? void 0 : e.map(We);
|
|
107
|
-
}), $e =
|
|
107
|
+
}), $e = v(() => {
|
|
108
108
|
G.value;
|
|
109
|
-
const e =
|
|
109
|
+
const e = J.value.filter(
|
|
110
110
|
(t) => t !== Y.value
|
|
111
111
|
);
|
|
112
112
|
return Xe.flatMap((t) => {
|
|
@@ -116,143 +116,143 @@ const Xe = [
|
|
|
116
116
|
};
|
|
117
117
|
if (!t.localization || e.length === 0)
|
|
118
118
|
return [o];
|
|
119
|
-
const n = e.map((
|
|
119
|
+
const n = e.map((i) => ({
|
|
120
120
|
...t,
|
|
121
|
-
key: `${t.key}:${
|
|
122
|
-
label: `${r(t.label)} (${
|
|
121
|
+
key: `${t.key}:${i}`,
|
|
122
|
+
label: `${r(t.label)} (${i})`,
|
|
123
123
|
localization: !1
|
|
124
124
|
}));
|
|
125
125
|
return [o, ...n];
|
|
126
126
|
});
|
|
127
|
-
}),
|
|
127
|
+
}), b = p({}), a = p({
|
|
128
128
|
title: "",
|
|
129
129
|
status: "draft"
|
|
130
|
-
}),
|
|
131
|
-
() =>
|
|
132
|
-
), Ce =
|
|
130
|
+
}), F = p(null), L = p(""), P = v(
|
|
131
|
+
() => F.value === "single"
|
|
132
|
+
), Ce = v(() => {
|
|
133
133
|
const e = [
|
|
134
134
|
{ id: "content", name: r("cms.builder.content") },
|
|
135
135
|
{ id: "seo", name: r("cms.builder.seo") },
|
|
136
136
|
{ id: "tags", name: r("cms.builder.tags") }
|
|
137
137
|
];
|
|
138
|
-
return
|
|
139
|
-
}), V =
|
|
140
|
-
var s, c, l, w,
|
|
141
|
-
const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l =
|
|
138
|
+
return (R.value || F.value === "single") && e.push({ id: "preview", name: r("cms.builder.preview") }), e;
|
|
139
|
+
}), V = p("content"), ee = v(() => {
|
|
140
|
+
var s, c, l, w, g, y, m, S, oe;
|
|
141
|
+
const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = a.value) == null ? void 0 : l.content_type_id, o = t ? (g = (w = Q.value) == null ? void 0 : w.find((K) => K.id === t)) == null ? void 0 : g.title : null;
|
|
142
142
|
if (o)
|
|
143
143
|
return o;
|
|
144
144
|
if (L.value)
|
|
145
145
|
return L.value;
|
|
146
|
-
const n = (
|
|
146
|
+
const n = (m = (y = Q.value) == null ? void 0 : y.find(
|
|
147
147
|
(K) => K.id === e
|
|
148
|
-
)) == null ? void 0 :
|
|
148
|
+
)) == null ? void 0 : m.title;
|
|
149
149
|
if (n)
|
|
150
150
|
return n;
|
|
151
|
-
const
|
|
152
|
-
return P.value &&
|
|
153
|
-
}), Te =
|
|
151
|
+
const i = (S = d.params) == null ? void 0 : S.id;
|
|
152
|
+
return P.value && i && e === i && ((oe = a.value) != null && oe.title) ? a.value.title : e === "pages" ? r("cms.articles.title") : e;
|
|
153
|
+
}), Te = v(() => {
|
|
154
154
|
var t, o;
|
|
155
155
|
const e = P.value ? "cms.builder.editPage" : "cms.builder.editCollection";
|
|
156
|
-
return ((t =
|
|
157
|
-
}), Se =
|
|
156
|
+
return ((t = a.value) == null ? void 0 : t.title) || ((o = d.params) != null && o.id ? r(e) : r("cms.articles.createArticle"));
|
|
157
|
+
}), Se = v(() => {
|
|
158
158
|
var s, c, l;
|
|
159
|
-
const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = d.params) == null ? void 0 : l.id, o = Te.value, n = o === ee.value,
|
|
159
|
+
const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = d.params) == null ? void 0 : l.id, o = Te.value, n = o === ee.value, i = [
|
|
160
160
|
{
|
|
161
161
|
label: P.value ? r("cms.navigation.singletons") : ee.value,
|
|
162
162
|
route: `collections/${e}`
|
|
163
163
|
}
|
|
164
164
|
];
|
|
165
|
-
return t ?
|
|
165
|
+
return t ? i.push({
|
|
166
166
|
label: n ? r("cms.collections.edit") : o,
|
|
167
167
|
route: `collections/${e}/${t}`
|
|
168
|
-
}) :
|
|
168
|
+
}) : i.push({
|
|
169
169
|
label: r("cms.articles.createArticle"),
|
|
170
170
|
route: `collections/${e}/create`
|
|
171
|
-
}),
|
|
171
|
+
}), i;
|
|
172
172
|
}), Ae = (e) => {
|
|
173
|
-
e === "collections" ?
|
|
173
|
+
e === "collections" ? T.push("/collections") : T.push(`/${e}`);
|
|
174
174
|
}, te = async (e, t) => {
|
|
175
175
|
var o, n;
|
|
176
176
|
try {
|
|
177
177
|
if (!t || !e)
|
|
178
178
|
return;
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
179
|
+
const i = await fetch(`/api/cms/${e}/${t}`);
|
|
180
|
+
if (!i.ok)
|
|
181
181
|
throw new Error("Failed to fetch article");
|
|
182
|
-
const s = await
|
|
183
|
-
if (_.value = (s == null ? void 0 : s.columns) || [], s != null && s.preview_path && (
|
|
182
|
+
const s = await i.json();
|
|
183
|
+
if (_.value = (s == null ? void 0 : s.columns) || [], s != null && s.preview_path && (s == null ? void 0 : s.type) !== "single" && (R.value = s == null ? void 0 : s.preview_path), F.value = (s == null ? void 0 : s.type) || null, s.rows) {
|
|
184
184
|
let c = s.rows;
|
|
185
|
-
Array.isArray(c) || (c = [c]),
|
|
185
|
+
Array.isArray(c) || (c = [c]), a.value = c[0];
|
|
186
186
|
const l = ((o = c[0]) == null ? void 0 : o.content_type_id) || e;
|
|
187
187
|
if (l) {
|
|
188
188
|
const w = await fetch(`/api/cms-type/${l}`);
|
|
189
189
|
if (w.ok) {
|
|
190
|
-
const
|
|
191
|
-
L.value = (
|
|
190
|
+
const g = await w.json();
|
|
191
|
+
L.value = (g == null ? void 0 : g.title) || (g == null ? void 0 : g.name) || L.value;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
await ce(), (n = c[0]) != null && n.meta ?
|
|
194
|
+
await ce(), (n = c[0]) != null && n.meta ? b.value = { ...c[0].meta } : b.value = {
|
|
195
195
|
title: "",
|
|
196
196
|
description: "",
|
|
197
197
|
keywords: "",
|
|
198
198
|
meta: {}
|
|
199
199
|
};
|
|
200
200
|
} else
|
|
201
|
-
|
|
201
|
+
a.value = s, await ce(), s != null && s.meta ? (b.value = {
|
|
202
202
|
title: s.meta.title || "",
|
|
203
203
|
description: s.meta.description || "",
|
|
204
204
|
keywords: s.meta.keywords || "",
|
|
205
205
|
meta: { ...s.meta }
|
|
206
|
-
}, delete
|
|
206
|
+
}, delete b.value.meta.title, delete b.value.meta.description, delete b.value.meta.keywords) : b.value = {
|
|
207
207
|
title: "",
|
|
208
208
|
description: "",
|
|
209
209
|
keywords: "",
|
|
210
210
|
meta: {}
|
|
211
211
|
};
|
|
212
|
-
} catch (
|
|
213
|
-
console.error("Error fetching article:",
|
|
212
|
+
} catch (i) {
|
|
213
|
+
console.error("Error fetching article:", i);
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
216
|
Ie(async () => {
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
const e = (
|
|
217
|
+
var i, s;
|
|
218
|
+
D.value = !0, L.value = "";
|
|
219
|
+
const e = (i = d.params) == null ? void 0 : i.collection, t = (s = d.params) == null ? void 0 : s.id, o = e || t, n = e && t ? t : void 0;
|
|
220
220
|
try {
|
|
221
221
|
if (!n) {
|
|
222
222
|
if (!o)
|
|
223
223
|
return;
|
|
224
224
|
const l = await (await fetch(`/api/cms/${o}/`)).json();
|
|
225
|
-
_.value = l.columns,
|
|
225
|
+
_.value = l.columns, F.value = (l == null ? void 0 : l.type) || null;
|
|
226
226
|
}
|
|
227
227
|
await te(o, n ?? "");
|
|
228
228
|
} finally {
|
|
229
|
-
|
|
229
|
+
D.value = !1;
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
|
-
const se =
|
|
232
|
+
const se = v({
|
|
233
233
|
get: () => {
|
|
234
234
|
var e;
|
|
235
|
-
return ((e =
|
|
235
|
+
return ((e = a.value) == null ? void 0 : e.is_pin) || !1;
|
|
236
236
|
},
|
|
237
237
|
set: (e) => {
|
|
238
|
-
|
|
238
|
+
a.value && (a.value.is_pin = e);
|
|
239
239
|
}
|
|
240
240
|
}), Ve = () => {
|
|
241
|
-
|
|
242
|
-
}, H =
|
|
241
|
+
a.value && (a.value.is_pin = !a.value.is_pin);
|
|
242
|
+
}, H = v(() => {
|
|
243
243
|
var t;
|
|
244
|
-
const e = (t =
|
|
244
|
+
const e = (t = a.value) == null ? void 0 : t.content_type_id;
|
|
245
245
|
return e ? `/collections/${e}/edit` : null;
|
|
246
246
|
}), je = () => {
|
|
247
|
-
var o, n,
|
|
247
|
+
var o, n, i, s;
|
|
248
248
|
if (!H.value)
|
|
249
249
|
return;
|
|
250
|
-
const e = ((o = d.params) == null ? void 0 : o.collection) || ((n = d.params) == null ? void 0 : n.id), t = (
|
|
250
|
+
const e = ((o = d.params) == null ? void 0 : o.collection) || ((n = d.params) == null ? void 0 : n.id), t = (i = d.params) == null ? void 0 : i.id;
|
|
251
251
|
if (e && t) {
|
|
252
|
-
|
|
252
|
+
T.push(`/collections/${(s = a.value) == null ? void 0 : s.content_type_id}/edit`);
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
|
-
|
|
255
|
+
T.push(H.value);
|
|
256
256
|
}, ze = async () => {
|
|
257
257
|
var o, n;
|
|
258
258
|
const e = (o = d.params) == null ? void 0 : o.collection, t = (n = d.params) == null ? void 0 : n.id;
|
|
@@ -273,8 +273,8 @@ const Xe = [
|
|
|
273
273
|
z.value = !1;
|
|
274
274
|
}
|
|
275
275
|
}, Le = async (e) => {
|
|
276
|
-
var c, l, w,
|
|
277
|
-
const t = (c = d.params) == null ? void 0 : c.collection, o = (l = d.params) == null ? void 0 : l.id, n = await
|
|
276
|
+
var c, l, w, g;
|
|
277
|
+
const t = (c = d.params) == null ? void 0 : c.collection, o = (l = d.params) == null ? void 0 : l.id, n = await N.value.validate();
|
|
278
278
|
if (n) {
|
|
279
279
|
B({
|
|
280
280
|
title: r("cms.validation"),
|
|
@@ -283,47 +283,51 @@ const Xe = [
|
|
|
283
283
|
});
|
|
284
284
|
return;
|
|
285
285
|
}
|
|
286
|
-
(w =
|
|
287
|
-
const
|
|
288
|
-
...
|
|
286
|
+
(w = M.value) != null && w.restoreTagsBeforeSubmit && await M.value.restoreTagsBeforeSubmit();
|
|
287
|
+
const i = b.value || {}, s = {
|
|
288
|
+
...a.value,
|
|
289
289
|
meta: {
|
|
290
|
-
...
|
|
291
|
-
...
|
|
290
|
+
...i,
|
|
291
|
+
...i.meta || {}
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
294
|
console.log("Payload before submit:", s);
|
|
295
295
|
try {
|
|
296
|
-
const
|
|
296
|
+
const y = await fetch(`/api/cms/${t}/${o || ""}`, {
|
|
297
297
|
method: o ? "PUT" : "POST",
|
|
298
298
|
headers: {
|
|
299
299
|
"Content-Type": "application/json"
|
|
300
300
|
},
|
|
301
301
|
body: JSON.stringify(s)
|
|
302
302
|
});
|
|
303
|
-
if (!
|
|
304
|
-
|
|
303
|
+
if (!o && y.ok) {
|
|
304
|
+
const m = await y.json();
|
|
305
|
+
T.push(`/collections/${t}/${m == null ? void 0 : m.id}`);
|
|
306
|
+
}
|
|
307
|
+
if (!y.ok) {
|
|
308
|
+
let m;
|
|
305
309
|
try {
|
|
306
|
-
const
|
|
307
|
-
|
|
310
|
+
const S = await y.json();
|
|
311
|
+
m = JSON.stringify(S, null, 2);
|
|
308
312
|
} catch {
|
|
309
|
-
|
|
313
|
+
m = await y.text();
|
|
310
314
|
}
|
|
311
|
-
throw new Error(`HTTP ${
|
|
315
|
+
throw new Error(`HTTP ${y.status}: ${m}`);
|
|
312
316
|
}
|
|
313
317
|
if (!o)
|
|
314
318
|
try {
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
} catch (
|
|
318
|
-
console.warn("Could not parse response to get ID:",
|
|
319
|
+
const m = await y.json(), S = m.id || ((g = m.data) == null ? void 0 : g.id);
|
|
320
|
+
S && d.name === "createArticle" && await T.push(`/collections/${t}/${S}`);
|
|
321
|
+
} catch (m) {
|
|
322
|
+
console.warn("Could not parse response to get ID:", m);
|
|
319
323
|
}
|
|
320
324
|
B({
|
|
321
325
|
title: r("cms.common.success"),
|
|
322
326
|
message: r("cms.common.successMessage"),
|
|
323
327
|
type: "success"
|
|
324
328
|
});
|
|
325
|
-
} catch (
|
|
326
|
-
console.error("Submit error:",
|
|
329
|
+
} catch (y) {
|
|
330
|
+
console.error("Submit error:", y), B({
|
|
327
331
|
title: r("cms.common.error"),
|
|
328
332
|
message: "Помилка збереження",
|
|
329
333
|
type: "error"
|
|
@@ -331,31 +335,31 @@ const Xe = [
|
|
|
331
335
|
}
|
|
332
336
|
};
|
|
333
337
|
return (e, t) => {
|
|
334
|
-
var o, n,
|
|
338
|
+
var o, n, i, s, c;
|
|
335
339
|
return h(), $("div", Ye, [
|
|
336
340
|
u("div", Ze, [
|
|
337
|
-
C(
|
|
341
|
+
C(f(be), {
|
|
338
342
|
items: Se.value,
|
|
339
|
-
loading:
|
|
343
|
+
loading: D.value,
|
|
340
344
|
onNavigate: Ae
|
|
341
345
|
}, null, 8, ["items", "loading"]),
|
|
342
346
|
u("div", et, [
|
|
343
347
|
u("div", tt, [
|
|
344
348
|
u("button", {
|
|
345
|
-
onClick: t[0] || (t[0] = (l) =>
|
|
349
|
+
onClick: t[0] || (t[0] = (l) => f(T).back()),
|
|
346
350
|
class: "p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
|
|
347
351
|
}, [
|
|
348
|
-
C(
|
|
352
|
+
C(f(Oe), { class: "w-5 h-5" })
|
|
349
353
|
]),
|
|
350
354
|
u("h1", st, j(e.$t(
|
|
351
355
|
P.value ? "cms.builder.editPage" : "cms.builder.editCollection"
|
|
352
|
-
)) + ' "' + j(
|
|
356
|
+
)) + ' "' + j(a.value.title) + '" ', 1),
|
|
353
357
|
u("a", {
|
|
354
|
-
href: `https://cms.opengis.info/${
|
|
358
|
+
href: `https://cms.opengis.info/${f(G)}/guides/content/`,
|
|
355
359
|
target: "_blank",
|
|
356
360
|
title: e.$t("cms.guide.content")
|
|
357
361
|
}, [
|
|
358
|
-
C(
|
|
362
|
+
C(f(Je), { class: "w-5 h-5" })
|
|
359
363
|
], 8, ot)
|
|
360
364
|
]),
|
|
361
365
|
u("div", lt, [
|
|
@@ -367,46 +371,46 @@ const Xe = [
|
|
|
367
371
|
class: "inline-flex items-center justify-center rounded-md h-9 w-9 border border-gray-200 bg-white text-gray-700 shadow-sm transition-all duration-200 transform hover:text-gray-900 hover:shadow-md focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
368
372
|
"aria-label": "$t('cms.builder.editContentType')"
|
|
369
373
|
}, [
|
|
370
|
-
C(
|
|
371
|
-
], 8, nt)) :
|
|
374
|
+
C(f(He), { class: "w-4 h-4" })
|
|
375
|
+
], 8, nt)) : A("", !0),
|
|
372
376
|
u("button", {
|
|
373
377
|
onClick: Le,
|
|
374
378
|
type: "submit",
|
|
375
379
|
class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
|
|
376
380
|
}, [
|
|
377
|
-
C(
|
|
381
|
+
C(f(Ke), { class: "w-4 h-4 mr-2" }),
|
|
378
382
|
ne(" " + j(e.$t("cms.builder.save")), 1)
|
|
379
383
|
])
|
|
380
384
|
])
|
|
381
385
|
]),
|
|
382
|
-
u("div",
|
|
383
|
-
u("div",
|
|
384
|
-
(h(!0), $(Ne, null,
|
|
386
|
+
u("div", it, [
|
|
387
|
+
u("div", at, [
|
|
388
|
+
(h(!0), $(Ne, null, Me(Ce.value, (l) => (h(), $("button", {
|
|
385
389
|
key: l.id,
|
|
386
390
|
onClick: (w) => {
|
|
387
391
|
V.value = l.id, console.log("cmsSettings:", E.value.value);
|
|
388
392
|
},
|
|
389
|
-
class:
|
|
393
|
+
class: ie([
|
|
390
394
|
"inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700 data-[state=active]:border-blue-200",
|
|
391
395
|
l.id === V.value ? "bg-blue-50 text-blue-700 border-blue-200" : ""
|
|
392
396
|
])
|
|
393
397
|
}, j(l.name), 11, rt))), 128))
|
|
394
398
|
]),
|
|
395
399
|
u("div", ct, [
|
|
396
|
-
(o =
|
|
400
|
+
(o = f(d).params) != null && o.id && xe.value ? (h(), $("button", {
|
|
397
401
|
key: 0,
|
|
398
402
|
type: "button",
|
|
399
403
|
class: "inline-flex items-center justify-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer bg-white border border-gray-200 rounded-md text-muted-foreground px-4 py-2 disabled:opacity-50 disabled:cursor-not-allowed",
|
|
400
404
|
disabled: z.value,
|
|
401
405
|
onClick: ze
|
|
402
406
|
}, [
|
|
403
|
-
z.value ? (h(),
|
|
407
|
+
z.value ? (h(), ae(f(qe), {
|
|
404
408
|
key: 0,
|
|
405
409
|
class: "w-4 h-4 animate-spin shrink-0",
|
|
406
410
|
"aria-hidden": "true"
|
|
407
|
-
})) :
|
|
411
|
+
})) : A("", !0),
|
|
408
412
|
ne(" " + j(z.value ? e.$t("cms.collections.translating") : e.$t("cms.collections.enLocalization")), 1)
|
|
409
|
-
], 8, ut)) :
|
|
413
|
+
], 8, ut)) : A("", !0),
|
|
410
414
|
u("div", dt, [
|
|
411
415
|
u("label", mt, j(e.$t("cms.collections.pinPublication")), 1),
|
|
412
416
|
u("div", vt, [
|
|
@@ -416,22 +420,22 @@ const Xe = [
|
|
|
416
420
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => se.value = l),
|
|
417
421
|
class: "sr-only"
|
|
418
422
|
}, null, 512), [
|
|
419
|
-
[
|
|
423
|
+
[Re, se.value]
|
|
420
424
|
]),
|
|
421
425
|
u("div", {
|
|
422
|
-
class:
|
|
426
|
+
class: ie([
|
|
423
427
|
"w-5 h-5 border-2 rounded transition-all duration-200 cursor-pointer flex items-center justify-center",
|
|
424
|
-
(n =
|
|
428
|
+
(n = a.value) != null && n.is_pin ? "bg-sky-600 border-sky-600" : "bg-white border-gray-300 hover:border-sky-400 dark:bg-gray-700 dark:border-gray-600 dark:hover:border-sky-400"
|
|
425
429
|
]),
|
|
426
430
|
onClick: Ve
|
|
427
431
|
}, [
|
|
428
|
-
(
|
|
432
|
+
(i = a.value) != null && i.is_pin ? (h(), $("svg", pt, [...t[7] || (t[7] = [
|
|
429
433
|
u("path", {
|
|
430
434
|
"fill-rule": "evenodd",
|
|
431
435
|
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
432
436
|
"clip-rule": "evenodd"
|
|
433
437
|
}, null, -1)
|
|
434
|
-
])])) :
|
|
438
|
+
])])) : A("", !0)
|
|
435
439
|
], 2)
|
|
436
440
|
])
|
|
437
441
|
])
|
|
@@ -439,42 +443,42 @@ const Xe = [
|
|
|
439
443
|
])
|
|
440
444
|
]),
|
|
441
445
|
q(u("div", ft, [
|
|
442
|
-
(s = Z.value) != null && s.length ? (h(),
|
|
446
|
+
(s = Z.value) != null && s.length ? (h(), ae(f(ue), {
|
|
443
447
|
key: 0,
|
|
444
|
-
modelValue:
|
|
445
|
-
"onUpdate:modelValue": t[2] || (t[2] = (l) =>
|
|
448
|
+
modelValue: a.value,
|
|
449
|
+
"onUpdate:modelValue": t[2] || (t[2] = (l) => a.value = l),
|
|
446
450
|
schema: _e.value,
|
|
447
|
-
form:
|
|
448
|
-
"onUpdate:form": t[3] || (t[3] = (l) =>
|
|
449
|
-
}, null, 8, ["modelValue", "schema", "form"])) :
|
|
451
|
+
form: N.value,
|
|
452
|
+
"onUpdate:form": t[3] || (t[3] = (l) => N.value = l)
|
|
453
|
+
}, null, 8, ["modelValue", "schema", "form"])) : A("", !0)
|
|
450
454
|
], 512), [
|
|
451
455
|
[re, V.value === "content"]
|
|
452
456
|
]),
|
|
453
|
-
q(u("div",
|
|
454
|
-
C(
|
|
457
|
+
q(u("div", gt, [
|
|
458
|
+
C(f(ue), {
|
|
455
459
|
schema: $e.value,
|
|
456
|
-
values:
|
|
457
|
-
"onUpdate:values": t[4] || (t[4] = (l) =>
|
|
460
|
+
values: b.value,
|
|
461
|
+
"onUpdate:values": t[4] || (t[4] = (l) => b.value = l),
|
|
458
462
|
form: W.value,
|
|
459
463
|
"onUpdate:form": t[5] || (t[5] = (l) => W.value = l)
|
|
460
464
|
}, null, 8, ["schema", "values", "form"])
|
|
461
465
|
], 512), [
|
|
462
466
|
[re, V.value === "seo"]
|
|
463
467
|
]),
|
|
464
|
-
V.value === "tags" ? (h(), $("div",
|
|
465
|
-
C(
|
|
468
|
+
V.value === "tags" ? (h(), $("div", yt, [
|
|
469
|
+
C(f(ge), {
|
|
466
470
|
ref_key: "tagsForm",
|
|
467
|
-
ref:
|
|
468
|
-
modelValue:
|
|
469
|
-
"onUpdate:modelValue": t[6] || (t[6] = (l) =>
|
|
471
|
+
ref: M,
|
|
472
|
+
modelValue: a.value,
|
|
473
|
+
"onUpdate:modelValue": t[6] || (t[6] = (l) => a.value = l)
|
|
470
474
|
}, null, 8, ["modelValue"])
|
|
471
|
-
])) :
|
|
475
|
+
])) : A("", !0),
|
|
472
476
|
V.value === "preview" ? (h(), $("div", bt, [
|
|
473
|
-
C(
|
|
474
|
-
slug: (c =
|
|
475
|
-
preview_path:
|
|
477
|
+
C(f(ye), {
|
|
478
|
+
slug: (c = a.value) == null ? void 0 : c.slug,
|
|
479
|
+
preview_path: R.value
|
|
476
480
|
}, null, 8, ["slug", "preview_path"])
|
|
477
|
-
])) :
|
|
481
|
+
])) : A("", !0)
|
|
478
482
|
]);
|
|
479
483
|
};
|
|
480
484
|
}
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { useRoute as $, routeLocationKey as K } from "vue-router";
|
|
|
3
3
|
const O = "menu", B = (s, c, a) => {
|
|
4
4
|
const o = s == null ? void 0 : s.trim(), l = a == null ? void 0 : a.trim();
|
|
5
5
|
return o ? o === O ? c ? c === "create" ? { type: "createMenu", collection: o } : { type: "editMenu", collection: o, id: c } : { type: "menu", collection: o } : l === "edit" && c ? { type: "editCollection", collection: o, id: c } : c === "edit" ? { type: "editCollection", collection: o } : c ? c === "create" ? { type: "createArticle", collection: o } : { type: "editArticle", collection: o, id: c } : { type: "articles", collection: o } : { type: "collections" };
|
|
6
|
-
}, R = u(() => import("./CollectionsPage-DHfPNql6.js")), L = u(() => import("./ArticlesPage-BjYzvTWM.js")), C = u(() => import("./contentForm-
|
|
6
|
+
}, R = u(() => import("./CollectionsPage-DHfPNql6.js")), L = u(() => import("./ArticlesPage-BjYzvTWM.js")), C = u(() => import("./contentForm-1Fozy3Gb.js")), N = u(() => import("./EditCollectionPage-DnUqSUxK.js")), W = u(
|
|
7
7
|
() => import("./MenuPage-3W6jZ15H.js")
|
|
8
8
|
), j = u(
|
|
9
9
|
() => import("./MenuItemPage-B7Y9KFyb.js")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ref as c, useModel as n, computed as d, openBlock as u, createElementBlock as _, createBlock as v, unref as g, createCommentVNode as k } from "vue";
|
|
2
2
|
import { _ as V, g as $ } from "./vs-form-custom-datatable-D880w8gx.js";
|
|
3
3
|
import { inputs as e, VForm as h } from "@opengis/form";
|
|
4
|
-
import x from "./vs-form-reference-list-
|
|
4
|
+
import x from "./vs-form-reference-list-nkQvgmGb.js";
|
|
5
5
|
import { _ as B } from "./vs-form-tiptap.vue_vue_type_script_setup_true_lang-DGgsqXwg.js";
|
|
6
6
|
import r from "./vs-form-media-select-NY27EaG1.js";
|
|
7
7
|
import { _ as M } from "./vs-richtext-md.vue_vue_type_script_setup_true_lang-Ct8uTV-J.js";
|