@opengis/cms 0.0.61 → 0.0.63
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/{ArticlesPage-CFjE_cw_.js → ArticlesPage-BjYzvTWM.js} +3 -3
- package/dist/{CollectionsBreadcrumb-BCxeRikP.js → CollectionsBreadcrumb-HePNJb-d.js} +1 -1
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js +53 -0
- package/dist/{Dashboard-C1eGscNd.js → Dashboard-CXkg_pk8.js} +132 -132
- package/dist/{EditCollectionPage-3Q57ptN3.js → EditCollectionPage-BGZCMcQS.js} +3 -3
- package/dist/{MenuAddPage-D-p3gFgm.js → MenuAddPage-QTnwCoGh.js} +1 -1
- package/dist/{MenuBody-rN5j4YBu.js → MenuBody-Bi0ONVZf.js} +2 -2
- package/dist/{MenuItemPage-BoJw885D.js → MenuItemPage-B7Y9KFyb.js} +3 -3
- package/dist/{MenuList-DFEBS0NB.js → MenuList-BLIpeqSd.js} +53 -53
- package/dist/{MenuPage-BCZB_S8j.js → MenuPage-3W6jZ15H.js} +1 -1
- package/dist/{MenuWrapper-AZ_8s-zd.js → MenuWrapper-OrOv6sOb.js} +1 -1
- package/dist/{MonacoEditor-Db-3Jc3E.js → MonacoEditor-ByPT8pnv.js} +1 -1
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js +84 -0
- package/dist/{UniversalTable-CzqPG-tY.js → UniversalTable-GBd_pStq.js} +80 -80
- package/dist/{UniversalTablePagination-4gL47A7I.js → UniversalTablePagination-Dw2hc0nc.js} +46 -46
- package/dist/{contentForm-CLStrfSg.js → contentForm-NmskI6Ye.js} +146 -148
- package/dist/index.js +5 -5
- package/dist/{vs-builder-monaco-B3Jj0V31.js → vs-builder-monaco-Cw-f19gc.js} +1 -1
- package/dist/{vs-builder-preview-BH4VAM3a.js → vs-builder-preview-l5KhqlrF.js} +12 -13
- package/dist/vs-form-custom-datatable-D880w8gx.js +493 -0
- package/dist/{vs-form-reference-list-Dtv8fJJU.js → vs-form-reference-list-hZufPxfE.js} +696 -353
- package/locales/en.json +8 -0
- package/locales/uk.json +9 -1
- package/package.json +2 -2
- package/server/routes/cms/controllers/deleteMedia.js +76 -76
- package/server/routes/cms/controllers/getPermissions.js +15 -15
- package/server/routes/cms/controllers/metadataMedia.js +39 -39
- package/server/routes/cms/controllers/setPermissions.js +49 -49
- package/server/routes/cms/controllers/uploadMedia.js +79 -79
- package/server/templates/select/core.user_mentioned.sql +1 -1
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-umRzB5mY.js +0 -53
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js +0 -84
- package/dist/getField-CpwVE28P.js +0 -179
- package/dist/vs-form-custom-datatable-BDZo48w3.js +0 -317
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as Pe, defineAsyncComponent as
|
|
2
|
-
import { useRouter as
|
|
3
|
-
import { ArrowLeft as
|
|
4
|
-
import { useI18n as
|
|
5
|
-
import { g as We } from "./
|
|
1
|
+
import { defineComponent as Pe, defineAsyncComponent as k, inject as le, ref as v, getCurrentInstance as Be, toRef as Ee, computed as m, watch as Fe, onMounted as Ie, openBlock as h, createElementBlock as $, createElementVNode as u, createVNode as C, unref as p, toDisplayString as j, createCommentVNode as S, createTextVNode as ne, Fragment as Ne, renderList as De, normalizeClass as ae, createBlock as ie, withDirectives as q, vModelCheckbox as Me, vShow as re, nextTick as ce } from "vue";
|
|
2
|
+
import { useRouter as Re, useRoute as Ue } from "vue-router";
|
|
3
|
+
import { ArrowLeft as Oe, HelpCircle as Je, Settings as He, Save as Ke, Loader2 as qe } from "lucide-vue-next";
|
|
4
|
+
import { useI18n as Ge } from "vue-i18n";
|
|
5
|
+
import { _ as Qe, g as We } from "./vs-form-custom-datatable-D880w8gx.js";
|
|
6
6
|
import { inputs as x, VForm as ue } from "@opengis/form";
|
|
7
|
-
import { notify as
|
|
7
|
+
import { notify as B } from "@opengis/core";
|
|
8
8
|
const Xe = [
|
|
9
9
|
{
|
|
10
10
|
key: "title",
|
|
@@ -30,10 +30,10 @@ 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" },
|
|
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"], at = { class: "w-full mt-6 flex items-center justify-between" }, it = { 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 = {
|
|
37
37
|
key: 0,
|
|
38
38
|
class: "w-3 h-3 text-white",
|
|
39
39
|
fill: "currentColor",
|
|
@@ -47,37 +47,35 @@ const Xe = [
|
|
|
47
47
|
}, St = /* @__PURE__ */ Pe({
|
|
48
48
|
__name: "contentForm",
|
|
49
49
|
setup(ht) {
|
|
50
|
-
const de =
|
|
51
|
-
() => import("./vs-form-reference-list-
|
|
52
|
-
), me =
|
|
50
|
+
const de = k(
|
|
51
|
+
() => import("./vs-form-reference-list-hZufPxfE.js")
|
|
52
|
+
), me = k(
|
|
53
53
|
() => import("./vs-form-tiptap-DDFQjRjY.js")
|
|
54
|
-
),
|
|
54
|
+
), F = k(
|
|
55
55
|
() => import("./vs-form-media-select-NY27EaG1.js")
|
|
56
|
-
),
|
|
56
|
+
), ve = k(
|
|
57
57
|
() => import("./vs-richtext-md-C098v_6Q.js")
|
|
58
|
-
),
|
|
58
|
+
), pe = k(
|
|
59
59
|
() => import("./vs-form-integer-BZ855R3g.js")
|
|
60
|
-
), fe =
|
|
61
|
-
() => import("./vs-form-custom-datatable-BDZo48w3.js")
|
|
62
|
-
), ye = h(
|
|
60
|
+
), fe = k(
|
|
63
61
|
() => import("./vs-form-reletion-link-BhzNQszm.js")
|
|
64
|
-
),
|
|
62
|
+
), ye = k(
|
|
65
63
|
() => import("./VsFormTags-CMjiu9sY.js")
|
|
66
|
-
),
|
|
64
|
+
), ge = k(
|
|
67
65
|
() => import("./VsPreview-DwETkOpb.js")
|
|
68
|
-
),
|
|
69
|
-
() => import("./CollectionsBreadcrumb-
|
|
66
|
+
), be = k(
|
|
67
|
+
() => import("./CollectionsBreadcrumb-HePNJb-d.js")
|
|
70
68
|
);
|
|
71
|
-
x["vs-input-custom-datatable"] =
|
|
72
|
-
const { t: r, locale: G } =
|
|
69
|
+
x["vs-input-custom-datatable"] = Qe, x["vs-input-reference"] = de, x["vs-input-texteditor"] = me, x["vs-input-mediaselect"] = F, x["vs-input-file"] = F, x["vs-input-image"] = F, x["vs-input-richtext-md"] = ve, x["vs-input-integer"] = pe, x["vs-input-relation-link"] = fe;
|
|
70
|
+
const { t: r, locale: G } = Ge(), A = Re(), d = Ue(), Q = le("cms.menu", null) || le("menu", v([])), _ = v([]), I = v({}), W = v({}), N = v({}), D = v(""), M = v(!0), R = Be(), U = R == null ? void 0 : R.appContext, he = (U == null ? void 0 : U.config.globalProperties) || {}, X = Ee(he, "$settings"), E = m(() => {
|
|
73
71
|
var e;
|
|
74
72
|
return ((e = X.value) == null ? void 0 : e.cms) || {};
|
|
75
|
-
}),
|
|
76
|
-
() =>
|
|
73
|
+
}), we = m(() => Array.isArray(E.value.locales) ? E.value.locales : []), O = m(
|
|
74
|
+
() => we.value.filter(Boolean)
|
|
77
75
|
), Y = m(
|
|
78
|
-
() =>
|
|
76
|
+
() => E.value.locale || O.value[0] || "uk"
|
|
79
77
|
);
|
|
80
|
-
|
|
78
|
+
Fe(
|
|
81
79
|
X,
|
|
82
80
|
() => {
|
|
83
81
|
_.value.length && (_.value = _.value.map((e) => ({
|
|
@@ -86,27 +84,27 @@ const Xe = [
|
|
|
86
84
|
},
|
|
87
85
|
{ deep: !0 }
|
|
88
86
|
);
|
|
89
|
-
const
|
|
87
|
+
const ke = (e) => {
|
|
90
88
|
const t = [], o = O.value.filter(
|
|
91
|
-
(
|
|
89
|
+
(n) => n !== Y.value
|
|
92
90
|
);
|
|
93
|
-
return Array.isArray(e) && e.forEach((
|
|
94
|
-
t.push(
|
|
91
|
+
return Array.isArray(e) && e.forEach((n) => {
|
|
92
|
+
t.push(n), !(!n.localization || o.length === 0) && o.forEach((a) => {
|
|
95
93
|
t.push({
|
|
96
|
-
...
|
|
97
|
-
name: `${
|
|
98
|
-
label: `${
|
|
94
|
+
...n,
|
|
95
|
+
name: `${n.name}:${a}`,
|
|
96
|
+
label: `${n.label} (${a})`
|
|
99
97
|
});
|
|
100
98
|
});
|
|
101
99
|
}), t;
|
|
102
|
-
}, Z = m(() =>
|
|
100
|
+
}, Z = m(() => ke(_.value)), xe = m(
|
|
103
101
|
() => Array.isArray(_.value) && _.value.some(
|
|
104
102
|
(e) => e.localization === !0 && e.name !== "title"
|
|
105
103
|
)
|
|
106
|
-
), z =
|
|
104
|
+
), z = v(!1), _e = m(() => {
|
|
107
105
|
var e;
|
|
108
106
|
return (e = Z.value) == null ? void 0 : e.map(We);
|
|
109
|
-
}),
|
|
107
|
+
}), $e = m(() => {
|
|
110
108
|
G.value;
|
|
111
109
|
const e = O.value.filter(
|
|
112
110
|
(t) => t !== Y.value
|
|
@@ -118,82 +116,82 @@ const Xe = [
|
|
|
118
116
|
};
|
|
119
117
|
if (!t.localization || e.length === 0)
|
|
120
118
|
return [o];
|
|
121
|
-
const
|
|
119
|
+
const n = e.map((a) => ({
|
|
122
120
|
...t,
|
|
123
|
-
key: `${t.key}:${
|
|
124
|
-
label: `${r(t.label)} (${
|
|
121
|
+
key: `${t.key}:${a}`,
|
|
122
|
+
label: `${r(t.label)} (${a})`,
|
|
125
123
|
localization: !1
|
|
126
124
|
}));
|
|
127
|
-
return [o, ...
|
|
125
|
+
return [o, ...n];
|
|
128
126
|
});
|
|
129
|
-
}), g =
|
|
127
|
+
}), g = v({}), i = v({
|
|
130
128
|
title: "",
|
|
131
129
|
status: "draft"
|
|
132
|
-
}), J =
|
|
130
|
+
}), J = v(null), L = v(""), P = m(
|
|
133
131
|
() => J.value === "single"
|
|
134
|
-
),
|
|
132
|
+
), Ce = m(() => {
|
|
135
133
|
const e = [
|
|
136
134
|
{ id: "content", name: r("cms.builder.content") },
|
|
137
135
|
{ id: "seo", name: r("cms.builder.seo") },
|
|
138
136
|
{ id: "tags", name: r("cms.builder.tags") }
|
|
139
137
|
];
|
|
140
|
-
return
|
|
141
|
-
}),
|
|
142
|
-
var s, c, l,
|
|
143
|
-
const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = i.value) == null ? void 0 : l.content_type_id, o = t ? (f = (
|
|
138
|
+
return D.value && e.push({ id: "preview", name: r("cms.builder.preview") }), e;
|
|
139
|
+
}), V = v("content"), ee = m(() => {
|
|
140
|
+
var s, c, l, w, f, b, y, T, oe;
|
|
141
|
+
const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = i.value) == null ? void 0 : l.content_type_id, o = t ? (f = (w = Q.value) == null ? void 0 : w.find((K) => K.id === t)) == null ? void 0 : f.title : null;
|
|
144
142
|
if (o)
|
|
145
143
|
return o;
|
|
146
144
|
if (L.value)
|
|
147
145
|
return L.value;
|
|
148
|
-
const
|
|
146
|
+
const n = (y = (b = Q.value) == null ? void 0 : b.find(
|
|
149
147
|
(K) => K.id === e
|
|
150
148
|
)) == null ? void 0 : y.title;
|
|
151
|
-
if (
|
|
152
|
-
return
|
|
153
|
-
const
|
|
154
|
-
return
|
|
155
|
-
}),
|
|
149
|
+
if (n)
|
|
150
|
+
return n;
|
|
151
|
+
const a = (T = d.params) == null ? void 0 : T.id;
|
|
152
|
+
return P.value && a && e === a && ((oe = i.value) != null && oe.title) ? i.value.title : e === "pages" ? r("cms.articles.title") : e;
|
|
153
|
+
}), Te = m(() => {
|
|
156
154
|
var t, o;
|
|
157
|
-
const e =
|
|
155
|
+
const e = P.value ? "cms.builder.editPage" : "cms.builder.editCollection";
|
|
158
156
|
return ((t = i.value) == null ? void 0 : t.title) || ((o = d.params) != null && o.id ? r(e) : r("cms.articles.createArticle"));
|
|
159
|
-
}),
|
|
157
|
+
}), Se = m(() => {
|
|
160
158
|
var s, c, l;
|
|
161
|
-
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 =
|
|
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, a = [
|
|
162
160
|
{
|
|
163
|
-
label:
|
|
161
|
+
label: P.value ? r("cms.navigation.singletons") : ee.value,
|
|
164
162
|
route: `collections/${e}`
|
|
165
163
|
}
|
|
166
164
|
];
|
|
167
|
-
return t ?
|
|
168
|
-
label:
|
|
165
|
+
return t ? a.push({
|
|
166
|
+
label: n ? r("cms.collections.edit") : o,
|
|
169
167
|
route: `collections/${e}/${t}`
|
|
170
|
-
}) :
|
|
168
|
+
}) : a.push({
|
|
171
169
|
label: r("cms.articles.createArticle"),
|
|
172
170
|
route: `collections/${e}/create`
|
|
173
|
-
}),
|
|
171
|
+
}), a;
|
|
174
172
|
}), Ae = (e) => {
|
|
175
|
-
e === "collections" ?
|
|
173
|
+
e === "collections" ? A.push("/collections") : A.push(`/${e}`);
|
|
176
174
|
}, te = async (e, t) => {
|
|
177
|
-
var o,
|
|
175
|
+
var o, n;
|
|
178
176
|
try {
|
|
179
177
|
if (!t || !e)
|
|
180
178
|
return;
|
|
181
|
-
const
|
|
182
|
-
if (!
|
|
179
|
+
const a = await fetch(`/api/cms/${e}/${t}`);
|
|
180
|
+
if (!a.ok)
|
|
183
181
|
throw new Error("Failed to fetch article");
|
|
184
|
-
const s = await
|
|
185
|
-
if (_.value = (s == null ? void 0 : s.columns) || [], s != null && s.preview_path && (
|
|
182
|
+
const s = await a.json();
|
|
183
|
+
if (_.value = (s == null ? void 0 : s.columns) || [], s != null && s.preview_path && (D.value = s == null ? void 0 : s.preview_path), J.value = (s == null ? void 0 : s.type) || null, s.rows) {
|
|
186
184
|
let c = s.rows;
|
|
187
185
|
Array.isArray(c) || (c = [c]), i.value = c[0];
|
|
188
186
|
const l = ((o = c[0]) == null ? void 0 : o.content_type_id) || e;
|
|
189
187
|
if (l) {
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
const f = await
|
|
188
|
+
const w = await fetch(`/api/cms-type/${l}`);
|
|
189
|
+
if (w.ok) {
|
|
190
|
+
const f = await w.json();
|
|
193
191
|
L.value = (f == null ? void 0 : f.title) || (f == null ? void 0 : f.name) || L.value;
|
|
194
192
|
}
|
|
195
193
|
}
|
|
196
|
-
await ce(), (
|
|
194
|
+
await ce(), (n = c[0]) != null && n.meta ? g.value = { ...c[0].meta } : g.value = {
|
|
197
195
|
title: "",
|
|
198
196
|
description: "",
|
|
199
197
|
keywords: "",
|
|
@@ -211,22 +209,22 @@ const Xe = [
|
|
|
211
209
|
keywords: "",
|
|
212
210
|
meta: {}
|
|
213
211
|
};
|
|
214
|
-
} catch (
|
|
215
|
-
console.error("Error fetching article:",
|
|
212
|
+
} catch (a) {
|
|
213
|
+
console.error("Error fetching article:", a);
|
|
216
214
|
}
|
|
217
215
|
};
|
|
218
216
|
Ie(async () => {
|
|
219
|
-
var
|
|
217
|
+
var a, s;
|
|
220
218
|
M.value = !0, L.value = "";
|
|
221
|
-
const e = (
|
|
219
|
+
const e = (a = d.params) == null ? void 0 : a.collection, t = (s = d.params) == null ? void 0 : s.id, o = e || t, n = e && t ? t : void 0;
|
|
222
220
|
try {
|
|
223
|
-
if (!
|
|
221
|
+
if (!n) {
|
|
224
222
|
if (!o)
|
|
225
223
|
return;
|
|
226
224
|
const l = await (await fetch(`/api/cms/${o}/`)).json();
|
|
227
225
|
_.value = l.columns, J.value = (l == null ? void 0 : l.type) || null;
|
|
228
226
|
}
|
|
229
|
-
await te(o,
|
|
227
|
+
await te(o, n ?? "");
|
|
230
228
|
} finally {
|
|
231
229
|
M.value = !1;
|
|
232
230
|
}
|
|
@@ -239,34 +237,34 @@ const Xe = [
|
|
|
239
237
|
set: (e) => {
|
|
240
238
|
i.value && (i.value.is_pin = e);
|
|
241
239
|
}
|
|
242
|
-
}),
|
|
240
|
+
}), Ve = () => {
|
|
243
241
|
i.value && (i.value.is_pin = !i.value.is_pin);
|
|
244
242
|
}, H = m(() => {
|
|
245
243
|
var t;
|
|
246
244
|
const e = (t = i.value) == null ? void 0 : t.content_type_id;
|
|
247
245
|
return e ? `/collections/${e}/edit` : null;
|
|
248
|
-
}),
|
|
249
|
-
var o,
|
|
246
|
+
}), je = () => {
|
|
247
|
+
var o, n, a, s;
|
|
250
248
|
if (!H.value)
|
|
251
249
|
return;
|
|
252
|
-
const e = ((o = d.params) == null ? void 0 : o.collection) || ((
|
|
250
|
+
const e = ((o = d.params) == null ? void 0 : o.collection) || ((n = d.params) == null ? void 0 : n.id), t = (a = d.params) == null ? void 0 : a.id;
|
|
253
251
|
if (e && t) {
|
|
254
|
-
|
|
252
|
+
A.push(`/collections/${(s = i.value) == null ? void 0 : s.content_type_id}/edit`);
|
|
255
253
|
return;
|
|
256
254
|
}
|
|
257
|
-
|
|
258
|
-
},
|
|
259
|
-
var o,
|
|
260
|
-
const e = (o = d.params) == null ? void 0 : o.collection, t = (
|
|
255
|
+
A.push(H.value);
|
|
256
|
+
}, ze = async () => {
|
|
257
|
+
var o, n;
|
|
258
|
+
const e = (o = d.params) == null ? void 0 : o.collection, t = (n = d.params) == null ? void 0 : n.id;
|
|
261
259
|
z.value = !0;
|
|
262
260
|
try {
|
|
263
261
|
(await fetch(
|
|
264
262
|
`/api/cms-translate?id=${t}&collection=${e}&to=en&nocache=1`
|
|
265
|
-
)).ok ? (
|
|
263
|
+
)).ok ? (B({
|
|
266
264
|
title: r("cms.collections.translateContentSuccess"),
|
|
267
265
|
message: r("cms.collections.translateContentSuccess"),
|
|
268
266
|
type: "success"
|
|
269
|
-
}), await te(e, t)) :
|
|
267
|
+
}), await te(e, t)) : B({
|
|
270
268
|
title: r("cms.collections.translateContentError"),
|
|
271
269
|
message: r("cms.collections.translateContentError"),
|
|
272
270
|
type: "error"
|
|
@@ -274,23 +272,23 @@ const Xe = [
|
|
|
274
272
|
} finally {
|
|
275
273
|
z.value = !1;
|
|
276
274
|
}
|
|
277
|
-
},
|
|
278
|
-
var c, l,
|
|
279
|
-
const t = (c = d.params) == null ? void 0 : c.collection, o = (l = d.params) == null ? void 0 : l.id,
|
|
280
|
-
if (
|
|
281
|
-
|
|
275
|
+
}, Le = async (e) => {
|
|
276
|
+
var c, l, w, f;
|
|
277
|
+
const t = (c = d.params) == null ? void 0 : c.collection, o = (l = d.params) == null ? void 0 : l.id, n = await I.value.validate();
|
|
278
|
+
if (n) {
|
|
279
|
+
B({
|
|
282
280
|
title: r("cms.validation"),
|
|
283
|
-
message: JSON.stringify(
|
|
281
|
+
message: JSON.stringify(n),
|
|
284
282
|
type: "warning"
|
|
285
283
|
});
|
|
286
284
|
return;
|
|
287
285
|
}
|
|
288
|
-
(
|
|
289
|
-
const
|
|
286
|
+
(w = N.value) != null && w.restoreTagsBeforeSubmit && await N.value.restoreTagsBeforeSubmit();
|
|
287
|
+
const a = g.value || {}, s = {
|
|
290
288
|
...i.value,
|
|
291
289
|
meta: {
|
|
292
|
-
...
|
|
293
|
-
...
|
|
290
|
+
...a,
|
|
291
|
+
...a.meta || {}
|
|
294
292
|
}
|
|
295
293
|
};
|
|
296
294
|
console.log("Payload before submit:", s);
|
|
@@ -315,17 +313,17 @@ const Xe = [
|
|
|
315
313
|
if (!o)
|
|
316
314
|
try {
|
|
317
315
|
const y = await b.json(), T = y.id || ((f = y.data) == null ? void 0 : f.id);
|
|
318
|
-
T && d.name === "createArticle" && await
|
|
316
|
+
T && d.name === "createArticle" && await A.push(`/collections/${t}/${T}`);
|
|
319
317
|
} catch (y) {
|
|
320
318
|
console.warn("Could not parse response to get ID:", y);
|
|
321
319
|
}
|
|
322
|
-
|
|
320
|
+
B({
|
|
323
321
|
title: r("cms.common.success"),
|
|
324
322
|
message: r("cms.common.successMessage"),
|
|
325
323
|
type: "success"
|
|
326
324
|
});
|
|
327
325
|
} catch (b) {
|
|
328
|
-
console.error("Submit error:", b),
|
|
326
|
+
console.error("Submit error:", b), B({
|
|
329
327
|
title: r("cms.common.error"),
|
|
330
328
|
message: "Помилка збереження",
|
|
331
329
|
type: "error"
|
|
@@ -333,101 +331,101 @@ const Xe = [
|
|
|
333
331
|
}
|
|
334
332
|
};
|
|
335
333
|
return (e, t) => {
|
|
336
|
-
var o,
|
|
337
|
-
return
|
|
334
|
+
var o, n, a, s, c;
|
|
335
|
+
return h(), $("div", Ye, [
|
|
338
336
|
u("div", Ze, [
|
|
339
|
-
C(
|
|
340
|
-
items:
|
|
337
|
+
C(p(be), {
|
|
338
|
+
items: Se.value,
|
|
341
339
|
loading: M.value,
|
|
342
340
|
onNavigate: Ae
|
|
343
341
|
}, null, 8, ["items", "loading"]),
|
|
344
342
|
u("div", et, [
|
|
345
343
|
u("div", tt, [
|
|
346
344
|
u("button", {
|
|
347
|
-
onClick: t[0] || (t[0] = (l) =>
|
|
345
|
+
onClick: t[0] || (t[0] = (l) => p(A).back()),
|
|
348
346
|
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"
|
|
349
347
|
}, [
|
|
350
|
-
C(
|
|
348
|
+
C(p(Oe), { class: "w-5 h-5" })
|
|
351
349
|
]),
|
|
352
350
|
u("h1", st, j(e.$t(
|
|
353
|
-
|
|
351
|
+
P.value ? "cms.builder.editPage" : "cms.builder.editCollection"
|
|
354
352
|
)) + ' "' + j(i.value.title) + '" ', 1),
|
|
355
353
|
u("a", {
|
|
356
|
-
href: `https://cms.opengis.info/${
|
|
354
|
+
href: `https://cms.opengis.info/${p(G)}/guides/content/`,
|
|
357
355
|
target: "_blank",
|
|
358
356
|
title: e.$t("cms.guide.content")
|
|
359
357
|
}, [
|
|
360
|
-
C(
|
|
358
|
+
C(p(Je), { class: "w-5 h-5" })
|
|
361
359
|
], 8, ot)
|
|
362
360
|
]),
|
|
363
361
|
u("div", lt, [
|
|
364
|
-
H.value &&
|
|
362
|
+
H.value && P.value ? (h(), $("button", {
|
|
365
363
|
key: 0,
|
|
366
|
-
onClick:
|
|
364
|
+
onClick: je,
|
|
367
365
|
type: "button",
|
|
368
366
|
title: e.$t("cms.builder.editContentType"),
|
|
369
367
|
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",
|
|
370
368
|
"aria-label": "$t('cms.builder.editContentType')"
|
|
371
369
|
}, [
|
|
372
|
-
C(
|
|
373
|
-
], 8,
|
|
370
|
+
C(p(He), { class: "w-4 h-4" })
|
|
371
|
+
], 8, nt)) : S("", !0),
|
|
374
372
|
u("button", {
|
|
375
|
-
onClick:
|
|
373
|
+
onClick: Le,
|
|
376
374
|
type: "submit",
|
|
377
375
|
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"
|
|
378
376
|
}, [
|
|
379
|
-
C(
|
|
380
|
-
|
|
377
|
+
C(p(Ke), { class: "w-4 h-4 mr-2" }),
|
|
378
|
+
ne(" " + j(e.$t("cms.builder.save")), 1)
|
|
381
379
|
])
|
|
382
380
|
])
|
|
383
381
|
]),
|
|
384
|
-
u("div",
|
|
382
|
+
u("div", at, [
|
|
385
383
|
u("div", it, [
|
|
386
|
-
(
|
|
384
|
+
(h(!0), $(Ne, null, De(Ce.value, (l) => (h(), $("button", {
|
|
387
385
|
key: l.id,
|
|
388
|
-
onClick: (
|
|
389
|
-
|
|
386
|
+
onClick: (w) => {
|
|
387
|
+
V.value = l.id, console.log("cmsSettings:", E.value.value);
|
|
390
388
|
},
|
|
391
|
-
class:
|
|
389
|
+
class: ae([
|
|
392
390
|
"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",
|
|
393
|
-
l.id ===
|
|
391
|
+
l.id === V.value ? "bg-blue-50 text-blue-700 border-blue-200" : ""
|
|
394
392
|
])
|
|
395
393
|
}, j(l.name), 11, rt))), 128))
|
|
396
394
|
]),
|
|
397
395
|
u("div", ct, [
|
|
398
|
-
(o =
|
|
396
|
+
(o = p(d).params) != null && o.id && xe.value ? (h(), $("button", {
|
|
399
397
|
key: 0,
|
|
400
398
|
type: "button",
|
|
401
399
|
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",
|
|
402
400
|
disabled: z.value,
|
|
403
|
-
onClick:
|
|
401
|
+
onClick: ze
|
|
404
402
|
}, [
|
|
405
|
-
z.value ? (
|
|
403
|
+
z.value ? (h(), ie(p(qe), {
|
|
406
404
|
key: 0,
|
|
407
405
|
class: "w-4 h-4 animate-spin shrink-0",
|
|
408
406
|
"aria-hidden": "true"
|
|
409
407
|
})) : S("", !0),
|
|
410
|
-
|
|
408
|
+
ne(" " + j(z.value ? e.$t("cms.collections.translating") : e.$t("cms.collections.enLocalization")), 1)
|
|
411
409
|
], 8, ut)) : S("", !0),
|
|
412
410
|
u("div", dt, [
|
|
413
411
|
u("label", mt, j(e.$t("cms.collections.pinPublication")), 1),
|
|
414
|
-
u("div",
|
|
412
|
+
u("div", vt, [
|
|
415
413
|
q(u("input", {
|
|
416
414
|
type: "checkbox",
|
|
417
415
|
id: "is_pin",
|
|
418
416
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => se.value = l),
|
|
419
417
|
class: "sr-only"
|
|
420
418
|
}, null, 512), [
|
|
421
|
-
[
|
|
419
|
+
[Me, se.value]
|
|
422
420
|
]),
|
|
423
421
|
u("div", {
|
|
424
|
-
class:
|
|
422
|
+
class: ae([
|
|
425
423
|
"w-5 h-5 border-2 rounded transition-all duration-200 cursor-pointer flex items-center justify-center",
|
|
426
|
-
(
|
|
424
|
+
(n = i.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"
|
|
427
425
|
]),
|
|
428
|
-
onClick:
|
|
426
|
+
onClick: Ve
|
|
429
427
|
}, [
|
|
430
|
-
(
|
|
428
|
+
(a = i.value) != null && a.is_pin ? (h(), $("svg", pt, [...t[7] || (t[7] = [
|
|
431
429
|
u("path", {
|
|
432
430
|
"fill-rule": "evenodd",
|
|
433
431
|
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",
|
|
@@ -441,40 +439,40 @@ const Xe = [
|
|
|
441
439
|
])
|
|
442
440
|
]),
|
|
443
441
|
q(u("div", ft, [
|
|
444
|
-
(s = Z.value) != null && s.length ? (
|
|
442
|
+
(s = Z.value) != null && s.length ? (h(), ie(p(ue), {
|
|
445
443
|
key: 0,
|
|
446
444
|
modelValue: i.value,
|
|
447
445
|
"onUpdate:modelValue": t[2] || (t[2] = (l) => i.value = l),
|
|
448
|
-
schema:
|
|
449
|
-
form:
|
|
450
|
-
"onUpdate:form": t[3] || (t[3] = (l) =>
|
|
446
|
+
schema: _e.value,
|
|
447
|
+
form: I.value,
|
|
448
|
+
"onUpdate:form": t[3] || (t[3] = (l) => I.value = l)
|
|
451
449
|
}, null, 8, ["modelValue", "schema", "form"])) : S("", !0)
|
|
452
450
|
], 512), [
|
|
453
|
-
[re,
|
|
451
|
+
[re, V.value === "content"]
|
|
454
452
|
]),
|
|
455
453
|
q(u("div", yt, [
|
|
456
|
-
C(
|
|
457
|
-
schema:
|
|
454
|
+
C(p(ue), {
|
|
455
|
+
schema: $e.value,
|
|
458
456
|
values: g.value,
|
|
459
457
|
"onUpdate:values": t[4] || (t[4] = (l) => g.value = l),
|
|
460
458
|
form: W.value,
|
|
461
459
|
"onUpdate:form": t[5] || (t[5] = (l) => W.value = l)
|
|
462
460
|
}, null, 8, ["schema", "values", "form"])
|
|
463
461
|
], 512), [
|
|
464
|
-
[re,
|
|
462
|
+
[re, V.value === "seo"]
|
|
465
463
|
]),
|
|
466
|
-
|
|
467
|
-
C(
|
|
464
|
+
V.value === "tags" ? (h(), $("div", gt, [
|
|
465
|
+
C(p(ye), {
|
|
468
466
|
ref_key: "tagsForm",
|
|
469
|
-
ref:
|
|
467
|
+
ref: N,
|
|
470
468
|
modelValue: i.value,
|
|
471
469
|
"onUpdate:modelValue": t[6] || (t[6] = (l) => i.value = l)
|
|
472
470
|
}, null, 8, ["modelValue"])
|
|
473
471
|
])) : S("", !0),
|
|
474
|
-
|
|
475
|
-
C(
|
|
472
|
+
V.value === "preview" ? (h(), $("div", bt, [
|
|
473
|
+
C(p(ge), {
|
|
476
474
|
slug: (c = i.value) == null ? void 0 : c.slug,
|
|
477
|
-
preview_path:
|
|
475
|
+
preview_path: D.value
|
|
478
476
|
}, null, 8, ["slug", "preview_path"])
|
|
479
477
|
])) : S("", !0)
|
|
480
478
|
]);
|
package/dist/index.js
CHANGED
|
@@ -3,12 +3,12 @@ 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-
|
|
7
|
-
() => import("./MenuPage-
|
|
6
|
+
}, R = u(() => import("./CollectionsPage-DHfPNql6.js")), L = u(() => import("./ArticlesPage-BjYzvTWM.js")), C = u(() => import("./contentForm-NmskI6Ye.js")), N = u(() => import("./EditCollectionPage-BGZCMcQS.js")), W = u(
|
|
7
|
+
() => import("./MenuPage-3W6jZ15H.js")
|
|
8
8
|
), j = u(
|
|
9
|
-
() => import("./MenuItemPage-
|
|
9
|
+
() => import("./MenuItemPage-B7Y9KFyb.js")
|
|
10
10
|
), F = u(
|
|
11
|
-
() => import("./MenuAddPage-
|
|
11
|
+
() => import("./MenuAddPage-QTnwCoGh.js")
|
|
12
12
|
), S = {
|
|
13
13
|
collections: R,
|
|
14
14
|
articles: L,
|
|
@@ -96,7 +96,7 @@ const O = "menu", B = (s, c, a) => {
|
|
|
96
96
|
});
|
|
97
97
|
return M(K, b), (e, n) => v.value ? (g(), k(x(v.value), { key: w.value })) : (g(), E("div", V, D(e.$t("cms.navigation.collections")), 1));
|
|
98
98
|
}
|
|
99
|
-
}), H = u(() => import("./Dashboard-
|
|
99
|
+
}), H = u(() => import("./Dashboard-CXkg_pk8.js")), J = u(() => import("./MenuWrapper-OrOv6sOb.js")), Q = q;
|
|
100
100
|
export {
|
|
101
101
|
Q as Content,
|
|
102
102
|
H as Dashboard,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as l, useModel as m, onMounted as u, openBlock as r, createElementBlock as d, createVNode as i, createCommentVNode as s } from "vue";
|
|
2
|
-
import { _ as c } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { _ as c } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js";
|
|
3
3
|
const g = {
|
|
4
4
|
__name: "vs-builder-monaco",
|
|
5
5
|
props: {
|