@opengis/cms 0.0.60 → 0.0.62
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/README.md +131 -131
- package/dist/{ArticlesPage-BjYzvTWM.js → ArticlesPage-CFjE_cw_.js} +3 -3
- package/dist/{CollectionsBreadcrumb-HePNJb-d.js → CollectionsBreadcrumb-BCxeRikP.js} +1 -1
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-umRzB5mY.js +53 -0
- package/dist/{Dashboard-CXkg_pk8.js → Dashboard-C1eGscNd.js} +132 -132
- package/dist/{EditCollectionPage-BycuD920.js → EditCollectionPage-C4uNmBJf.js} +3 -3
- package/dist/{MenuAddPage-QTnwCoGh.js → MenuAddPage-D-p3gFgm.js} +1 -1
- package/dist/{MenuBody-Bi0ONVZf.js → MenuBody-rN5j4YBu.js} +2 -2
- package/dist/{MenuItemPage-B7Y9KFyb.js → MenuItemPage-BoJw885D.js} +3 -3
- package/dist/{MenuList-BLIpeqSd.js → MenuList-DFEBS0NB.js} +53 -53
- package/dist/{MenuPage-3W6jZ15H.js → MenuPage-BCZB_S8j.js} +1 -1
- package/dist/{MenuWrapper-OrOv6sOb.js → MenuWrapper-AZ_8s-zd.js} +1 -1
- package/dist/{MonacoEditor-ByPT8pnv.js → MonacoEditor-Db-3Jc3E.js} +1 -1
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js +84 -0
- package/dist/{UniversalTable-GBd_pStq.js → UniversalTable-CzqPG-tY.js} +80 -80
- package/dist/{UniversalTablePagination-Dw2hc0nc.js → UniversalTablePagination-4gL47A7I.js} +46 -46
- package/dist/{contentForm-yMn63kza.js → contentForm-CcFbUeal.js} +146 -151
- package/dist/index.js +5 -5
- package/dist/{vs-builder-monaco-Cw-f19gc.js → vs-builder-monaco-B3Jj0V31.js} +1 -1
- package/dist/{vs-builder-preview-BH4VAM3a.js → vs-builder-preview-DL3RYMp7.js} +11 -12
- package/dist/vs-form-custom-datatable-D880w8gx.js +493 -0
- package/input-types.json +9 -9
- package/locales/en.json +815 -815
- package/locales/uk.json +813 -813
- package/module/cms/cls/content.status.json +17 -17
- package/module/cms/cls/user_type.json +9 -9
- package/module/cms/form/admin.users.form.json +77 -77
- package/module/cms/select/cms.page_type.sql +1 -1
- package/module/cms/select/news_tag_id.sql +11 -11
- package/module/cms/table/admin.users.table.json +53 -53
- package/module/cms/table/collection.default.table.json +96 -96
- package/module/cms/table/single.default.table.json +116 -116
- package/package.json +2 -2
- package/plugin.js +43 -43
- package/server/app.js +35 -35
- package/server/config.js +4 -4
- package/server/functions/getContent.js +45 -45
- package/server/functions/getDraftKey.js +22 -22
- package/server/functions/getSearchData.js +31 -31
- package/server/functions/getTags.js +30 -30
- package/server/functions/getUser.js +27 -27
- package/server/functions/utils/mock.reply.js +55 -55
- package/server/index.js +22 -22
- package/server/migrations/fixes.sql +132 -129
- package/server/migrations/site.sql +596 -595
- package/server/plugins/adminHook.js +78 -78
- package/server/plugins/hook.js +59 -59
- package/server/plugins/vite.js +75 -75
- package/server/routes/category/controllers/cms.category.delete.js +21 -21
- package/server/routes/category/controllers/cms.category.get.js +17 -17
- package/server/routes/category/controllers/cms.category.list.js +16 -16
- package/server/routes/category/controllers/cms.category.post.js +21 -21
- package/server/routes/category/controllers/cms.category.put.js +23 -23
- package/server/routes/category/index.mjs +22 -22
- package/server/routes/cms/controllers/cmsStat.js +55 -55
- package/server/routes/cms/controllers/cmsSuggest.js +57 -57
- package/server/routes/cms/controllers/deleteContent.js +113 -113
- package/server/routes/cms/controllers/deleteMedia.js +76 -76
- package/server/routes/cms/controllers/downloadMedia.js +84 -84
- package/server/routes/cms/controllers/getContent.js +113 -113
- package/server/routes/cms/controllers/getContentBySlug.js +93 -93
- package/server/routes/cms/controllers/getPermissions.js +15 -15
- package/server/routes/cms/controllers/insertContent.js +226 -217
- package/server/routes/cms/controllers/listMedia.js +155 -155
- package/server/routes/cms/controllers/metadataMedia.js +39 -39
- package/server/routes/cms/controllers/properties.get.js +18 -18
- package/server/routes/cms/controllers/properties.post.js +99 -99
- package/server/routes/cms/controllers/searchContent.js +214 -214
- package/server/routes/cms/controllers/setPermissions.js +49 -49
- package/server/routes/cms/controllers/translate.js +89 -89
- package/server/routes/cms/controllers/updateContent.js +231 -266
- package/server/routes/cms/controllers/uploadMedia.js +79 -79
- package/server/routes/cms/functions/getSettings.js +48 -48
- package/server/routes/cms/index.mjs +112 -112
- package/server/routes/cms/utils/additionalData.js +35 -35
- package/server/routes/cms/utils/getCollection.js +89 -89
- package/server/routes/cms/utils/getSingle.js +188 -188
- package/server/routes/cms/utils/inputTypes.js +5 -5
- package/server/routes/cms/utils/insertContentLocalization.js +104 -104
- package/server/routes/cms/utils/requestTranslation.js +135 -113
- package/server/routes/cms/utils/updateLocalization.js +42 -47
- package/server/routes/cmsSpace/controllers/deleteSpace.js +26 -25
- package/server/routes/cmsSpace/controllers/getSpaces.js +28 -27
- package/server/routes/cmsSpace/controllers/insertSpace.js +22 -21
- package/server/routes/cmsSpace/controllers/updateSpace.js +24 -23
- package/server/routes/cmsSpace/index.mjs +20 -20
- package/server/routes/contentType/controllers/addContentType.js +160 -160
- package/server/routes/contentType/controllers/contentTypeList.js +47 -54
- package/server/routes/contentType/controllers/delContentType.js +75 -75
- package/server/routes/contentType/controllers/editContentType.js +70 -88
- package/server/routes/contentType/controllers/getContentType.js +57 -65
- package/server/routes/contentType/index.mjs +35 -35
- package/server/routes/contentType/utils/updateContents.js +44 -44
- package/server/routes/contentType/utils/updateCustomContentTable.js +53 -53
- package/server/routes/feedback/controllers/email.list.js +24 -24
- package/server/routes/feedback/controllers/feedback.js +48 -48
- package/server/routes/feedback/controllers/feedback.list.js +37 -37
- package/server/routes/feedback/controllers/news.subscriptions.js +44 -44
- package/server/routes/feedback/index.mjs +71 -71
- package/server/routes/logs/controllers/export.user.logs.js +77 -77
- package/server/routes/logs/controllers/user.logs.js +44 -44
- package/server/routes/logs/index.mjs +9 -9
- package/server/routes/menu/controllers/addMenu.js +37 -37
- package/server/routes/menu/controllers/delMenu.js +31 -31
- package/server/routes/menu/controllers/editMenu.js +41 -41
- package/server/routes/menu/controllers/getMenu.js +24 -24
- package/server/routes/menu/functions/getMenu.js +50 -50
- package/server/routes/menu/index.mjs +13 -13
- package/server/routes/migration/controllers/collectionToCustom.js +137 -137
- package/server/routes/migration/index.mjs +8 -8
- package/server/routes/root.mjs +8 -8
- package/server/routes/tags/controllers/add.tags.js +24 -24
- package/server/routes/tags/controllers/del.tags.js +19 -19
- package/server/routes/tags/controllers/edit.tags.js +25 -25
- package/server/routes/tags/controllers/get.tags.js +15 -15
- package/server/routes/tags/index.mjs +14 -14
- package/server/templates/cls/cms.category_type.json +9 -9
- package/server/templates/cls/cms.content_review_status.json +9 -9
- package/server/templates/cls/cms.content_status.json +9 -9
- package/server/templates/cls/cms.content_type.json +9 -9
- package/server/templates/cls/cms.lang.json +9 -9
- package/server/templates/page/login.html +126 -126
- package/server/templates/select/core.user_mentioned.sql +1 -1
- package/utils.d.ts +52 -52
- package/utils.js +8 -8
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js +0 -53
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.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 =
|
|
50
|
+
const de = k(
|
|
51
51
|
() => import("./vs-form-reference-list-Dtv8fJJU.js")
|
|
52
|
-
), me =
|
|
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-BCxeRikP.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,85 +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 =
|
|
133
|
-
() =>
|
|
134
|
-
|
|
135
|
-
return (((e = i.value) == null ? void 0 : e.type) || J.value) === "single";
|
|
136
|
-
}
|
|
137
|
-
), Te = m(() => {
|
|
130
|
+
}), J = v(null), L = v(""), P = m(
|
|
131
|
+
() => J.value === "single"
|
|
132
|
+
), Ce = m(() => {
|
|
138
133
|
const e = [
|
|
139
134
|
{ id: "content", name: r("cms.builder.content") },
|
|
140
135
|
{ id: "seo", name: r("cms.builder.seo") },
|
|
141
136
|
{ id: "tags", name: r("cms.builder.tags") }
|
|
142
137
|
];
|
|
143
|
-
return
|
|
144
|
-
}),
|
|
145
|
-
var s, c, l,
|
|
146
|
-
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;
|
|
147
142
|
if (o)
|
|
148
143
|
return o;
|
|
149
144
|
if (L.value)
|
|
150
145
|
return L.value;
|
|
151
|
-
const
|
|
146
|
+
const n = (y = (b = Q.value) == null ? void 0 : b.find(
|
|
152
147
|
(K) => K.id === e
|
|
153
148
|
)) == null ? void 0 : y.title;
|
|
154
|
-
if (
|
|
155
|
-
return
|
|
156
|
-
const
|
|
157
|
-
return
|
|
158
|
-
}),
|
|
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(() => {
|
|
159
154
|
var t, o;
|
|
160
|
-
const e =
|
|
155
|
+
const e = P.value ? "cms.builder.editPage" : "cms.builder.editCollection";
|
|
161
156
|
return ((t = i.value) == null ? void 0 : t.title) || ((o = d.params) != null && o.id ? r(e) : r("cms.articles.createArticle"));
|
|
162
|
-
}),
|
|
157
|
+
}), Se = m(() => {
|
|
163
158
|
var s, c, l;
|
|
164
|
-
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 = [
|
|
165
160
|
{
|
|
166
|
-
label:
|
|
161
|
+
label: P.value ? r("cms.navigation.singletons") : ee.value,
|
|
167
162
|
route: `collections/${e}`
|
|
168
163
|
}
|
|
169
164
|
];
|
|
170
|
-
return t ?
|
|
171
|
-
label:
|
|
165
|
+
return t ? a.push({
|
|
166
|
+
label: n ? r("cms.collections.edit") : o,
|
|
172
167
|
route: `collections/${e}/${t}`
|
|
173
|
-
}) :
|
|
168
|
+
}) : a.push({
|
|
174
169
|
label: r("cms.articles.createArticle"),
|
|
175
170
|
route: `collections/${e}/create`
|
|
176
|
-
}),
|
|
171
|
+
}), a;
|
|
177
172
|
}), Ae = (e) => {
|
|
178
|
-
e === "collections" ?
|
|
173
|
+
e === "collections" ? A.push("/collections") : A.push(`/${e}`);
|
|
179
174
|
}, te = async (e, t) => {
|
|
180
|
-
var o,
|
|
175
|
+
var o, n;
|
|
181
176
|
try {
|
|
182
177
|
if (!t || !e)
|
|
183
178
|
return;
|
|
184
|
-
const
|
|
185
|
-
if (!
|
|
179
|
+
const a = await fetch(`/api/cms/${e}/${t}`);
|
|
180
|
+
if (!a.ok)
|
|
186
181
|
throw new Error("Failed to fetch article");
|
|
187
|
-
const s = await
|
|
188
|
-
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) {
|
|
189
184
|
let c = s.rows;
|
|
190
185
|
Array.isArray(c) || (c = [c]), i.value = c[0];
|
|
191
186
|
const l = ((o = c[0]) == null ? void 0 : o.content_type_id) || e;
|
|
192
187
|
if (l) {
|
|
193
|
-
const
|
|
194
|
-
if (
|
|
195
|
-
const f = await
|
|
188
|
+
const w = await fetch(`/api/cms-type/${l}`);
|
|
189
|
+
if (w.ok) {
|
|
190
|
+
const f = await w.json();
|
|
196
191
|
L.value = (f == null ? void 0 : f.title) || (f == null ? void 0 : f.name) || L.value;
|
|
197
192
|
}
|
|
198
193
|
}
|
|
199
|
-
await ce(), (
|
|
194
|
+
await ce(), (n = c[0]) != null && n.meta ? g.value = { ...c[0].meta } : g.value = {
|
|
200
195
|
title: "",
|
|
201
196
|
description: "",
|
|
202
197
|
keywords: "",
|
|
@@ -214,22 +209,22 @@ const Xe = [
|
|
|
214
209
|
keywords: "",
|
|
215
210
|
meta: {}
|
|
216
211
|
};
|
|
217
|
-
} catch (
|
|
218
|
-
console.error("Error fetching article:",
|
|
212
|
+
} catch (a) {
|
|
213
|
+
console.error("Error fetching article:", a);
|
|
219
214
|
}
|
|
220
215
|
};
|
|
221
216
|
Ie(async () => {
|
|
222
|
-
var
|
|
217
|
+
var a, s;
|
|
223
218
|
M.value = !0, L.value = "";
|
|
224
|
-
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;
|
|
225
220
|
try {
|
|
226
|
-
if (!
|
|
221
|
+
if (!n) {
|
|
227
222
|
if (!o)
|
|
228
223
|
return;
|
|
229
224
|
const l = await (await fetch(`/api/cms/${o}/`)).json();
|
|
230
225
|
_.value = l.columns, J.value = (l == null ? void 0 : l.type) || null;
|
|
231
226
|
}
|
|
232
|
-
await te(o,
|
|
227
|
+
await te(o, n ?? "");
|
|
233
228
|
} finally {
|
|
234
229
|
M.value = !1;
|
|
235
230
|
}
|
|
@@ -242,34 +237,34 @@ const Xe = [
|
|
|
242
237
|
set: (e) => {
|
|
243
238
|
i.value && (i.value.is_pin = e);
|
|
244
239
|
}
|
|
245
|
-
}),
|
|
240
|
+
}), Ve = () => {
|
|
246
241
|
i.value && (i.value.is_pin = !i.value.is_pin);
|
|
247
242
|
}, H = m(() => {
|
|
248
243
|
var t;
|
|
249
244
|
const e = (t = i.value) == null ? void 0 : t.content_type_id;
|
|
250
245
|
return e ? `/collections/${e}/edit` : null;
|
|
251
|
-
}),
|
|
252
|
-
var o,
|
|
246
|
+
}), je = () => {
|
|
247
|
+
var o, n, a, s;
|
|
253
248
|
if (!H.value)
|
|
254
249
|
return;
|
|
255
|
-
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;
|
|
256
251
|
if (e && t) {
|
|
257
|
-
|
|
252
|
+
A.push(`/collections/${(s = i.value) == null ? void 0 : s.content_type_id}/edit`);
|
|
258
253
|
return;
|
|
259
254
|
}
|
|
260
|
-
|
|
261
|
-
},
|
|
262
|
-
var o,
|
|
263
|
-
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;
|
|
264
259
|
z.value = !0;
|
|
265
260
|
try {
|
|
266
261
|
(await fetch(
|
|
267
262
|
`/api/cms-translate?id=${t}&collection=${e}&to=en&nocache=1`
|
|
268
|
-
)).ok ? (
|
|
263
|
+
)).ok ? (B({
|
|
269
264
|
title: r("cms.collections.translateContentSuccess"),
|
|
270
265
|
message: r("cms.collections.translateContentSuccess"),
|
|
271
266
|
type: "success"
|
|
272
|
-
}), await te(e, t)) :
|
|
267
|
+
}), await te(e, t)) : B({
|
|
273
268
|
title: r("cms.collections.translateContentError"),
|
|
274
269
|
message: r("cms.collections.translateContentError"),
|
|
275
270
|
type: "error"
|
|
@@ -277,23 +272,23 @@ const Xe = [
|
|
|
277
272
|
} finally {
|
|
278
273
|
z.value = !1;
|
|
279
274
|
}
|
|
280
|
-
},
|
|
281
|
-
var c, l,
|
|
282
|
-
const t = (c = d.params) == null ? void 0 : c.collection, o = (l = d.params) == null ? void 0 : l.id,
|
|
283
|
-
if (
|
|
284
|
-
|
|
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({
|
|
285
280
|
title: r("cms.validation"),
|
|
286
|
-
message: JSON.stringify(
|
|
281
|
+
message: JSON.stringify(n),
|
|
287
282
|
type: "warning"
|
|
288
283
|
});
|
|
289
284
|
return;
|
|
290
285
|
}
|
|
291
|
-
(
|
|
292
|
-
const
|
|
286
|
+
(w = N.value) != null && w.restoreTagsBeforeSubmit && await N.value.restoreTagsBeforeSubmit();
|
|
287
|
+
const a = g.value || {}, s = {
|
|
293
288
|
...i.value,
|
|
294
289
|
meta: {
|
|
295
|
-
...
|
|
296
|
-
...
|
|
290
|
+
...a,
|
|
291
|
+
...a.meta || {}
|
|
297
292
|
}
|
|
298
293
|
};
|
|
299
294
|
console.log("Payload before submit:", s);
|
|
@@ -318,17 +313,17 @@ const Xe = [
|
|
|
318
313
|
if (!o)
|
|
319
314
|
try {
|
|
320
315
|
const y = await b.json(), T = y.id || ((f = y.data) == null ? void 0 : f.id);
|
|
321
|
-
T && d.name === "createArticle" && await
|
|
316
|
+
T && d.name === "createArticle" && await A.push(`/collections/${t}/${T}`);
|
|
322
317
|
} catch (y) {
|
|
323
318
|
console.warn("Could not parse response to get ID:", y);
|
|
324
319
|
}
|
|
325
|
-
|
|
320
|
+
B({
|
|
326
321
|
title: r("cms.common.success"),
|
|
327
322
|
message: r("cms.common.successMessage"),
|
|
328
323
|
type: "success"
|
|
329
324
|
});
|
|
330
325
|
} catch (b) {
|
|
331
|
-
console.error("Submit error:", b),
|
|
326
|
+
console.error("Submit error:", b), B({
|
|
332
327
|
title: r("cms.common.error"),
|
|
333
328
|
message: "Помилка збереження",
|
|
334
329
|
type: "error"
|
|
@@ -336,101 +331,101 @@ const Xe = [
|
|
|
336
331
|
}
|
|
337
332
|
};
|
|
338
333
|
return (e, t) => {
|
|
339
|
-
var o,
|
|
340
|
-
return
|
|
334
|
+
var o, n, a, s, c;
|
|
335
|
+
return h(), $("div", Ye, [
|
|
341
336
|
u("div", Ze, [
|
|
342
|
-
C(
|
|
343
|
-
items:
|
|
337
|
+
C(p(be), {
|
|
338
|
+
items: Se.value,
|
|
344
339
|
loading: M.value,
|
|
345
340
|
onNavigate: Ae
|
|
346
341
|
}, null, 8, ["items", "loading"]),
|
|
347
342
|
u("div", et, [
|
|
348
343
|
u("div", tt, [
|
|
349
344
|
u("button", {
|
|
350
|
-
onClick: t[0] || (t[0] = (l) =>
|
|
345
|
+
onClick: t[0] || (t[0] = (l) => p(A).back()),
|
|
351
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"
|
|
352
347
|
}, [
|
|
353
|
-
C(
|
|
348
|
+
C(p(Oe), { class: "w-5 h-5" })
|
|
354
349
|
]),
|
|
355
350
|
u("h1", st, j(e.$t(
|
|
356
|
-
|
|
351
|
+
P.value ? "cms.builder.editPage" : "cms.builder.editCollection"
|
|
357
352
|
)) + ' "' + j(i.value.title) + '" ', 1),
|
|
358
353
|
u("a", {
|
|
359
|
-
href: `https://cms.opengis.info/${
|
|
354
|
+
href: `https://cms.opengis.info/${p(G)}/guides/content/`,
|
|
360
355
|
target: "_blank",
|
|
361
356
|
title: e.$t("cms.guide.content")
|
|
362
357
|
}, [
|
|
363
|
-
C(
|
|
358
|
+
C(p(Je), { class: "w-5 h-5" })
|
|
364
359
|
], 8, ot)
|
|
365
360
|
]),
|
|
366
361
|
u("div", lt, [
|
|
367
|
-
H.value &&
|
|
362
|
+
H.value && P.value ? (h(), $("button", {
|
|
368
363
|
key: 0,
|
|
369
|
-
onClick:
|
|
364
|
+
onClick: je,
|
|
370
365
|
type: "button",
|
|
371
366
|
title: e.$t("cms.builder.editContentType"),
|
|
372
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",
|
|
373
368
|
"aria-label": "$t('cms.builder.editContentType')"
|
|
374
369
|
}, [
|
|
375
|
-
C(
|
|
376
|
-
], 8,
|
|
370
|
+
C(p(He), { class: "w-4 h-4" })
|
|
371
|
+
], 8, nt)) : S("", !0),
|
|
377
372
|
u("button", {
|
|
378
|
-
onClick:
|
|
373
|
+
onClick: Le,
|
|
379
374
|
type: "submit",
|
|
380
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"
|
|
381
376
|
}, [
|
|
382
|
-
C(
|
|
383
|
-
|
|
377
|
+
C(p(Ke), { class: "w-4 h-4 mr-2" }),
|
|
378
|
+
ne(" " + j(e.$t("cms.builder.save")), 1)
|
|
384
379
|
])
|
|
385
380
|
])
|
|
386
381
|
]),
|
|
387
|
-
u("div",
|
|
382
|
+
u("div", at, [
|
|
388
383
|
u("div", it, [
|
|
389
|
-
(
|
|
384
|
+
(h(!0), $(Ne, null, De(Ce.value, (l) => (h(), $("button", {
|
|
390
385
|
key: l.id,
|
|
391
|
-
onClick: (
|
|
392
|
-
|
|
386
|
+
onClick: (w) => {
|
|
387
|
+
V.value = l.id, console.log("cmsSettings:", E.value.value);
|
|
393
388
|
},
|
|
394
|
-
class:
|
|
389
|
+
class: ae([
|
|
395
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",
|
|
396
|
-
l.id ===
|
|
391
|
+
l.id === V.value ? "bg-blue-50 text-blue-700 border-blue-200" : ""
|
|
397
392
|
])
|
|
398
393
|
}, j(l.name), 11, rt))), 128))
|
|
399
394
|
]),
|
|
400
395
|
u("div", ct, [
|
|
401
|
-
(o =
|
|
396
|
+
(o = p(d).params) != null && o.id && xe.value ? (h(), $("button", {
|
|
402
397
|
key: 0,
|
|
403
398
|
type: "button",
|
|
404
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",
|
|
405
400
|
disabled: z.value,
|
|
406
|
-
onClick:
|
|
401
|
+
onClick: ze
|
|
407
402
|
}, [
|
|
408
|
-
z.value ? (
|
|
403
|
+
z.value ? (h(), ie(p(qe), {
|
|
409
404
|
key: 0,
|
|
410
405
|
class: "w-4 h-4 animate-spin shrink-0",
|
|
411
406
|
"aria-hidden": "true"
|
|
412
407
|
})) : S("", !0),
|
|
413
|
-
|
|
408
|
+
ne(" " + j(z.value ? e.$t("cms.collections.translating") : e.$t("cms.collections.enLocalization")), 1)
|
|
414
409
|
], 8, ut)) : S("", !0),
|
|
415
410
|
u("div", dt, [
|
|
416
411
|
u("label", mt, j(e.$t("cms.collections.pinPublication")), 1),
|
|
417
|
-
u("div",
|
|
412
|
+
u("div", vt, [
|
|
418
413
|
q(u("input", {
|
|
419
414
|
type: "checkbox",
|
|
420
415
|
id: "is_pin",
|
|
421
416
|
"onUpdate:modelValue": t[1] || (t[1] = (l) => se.value = l),
|
|
422
417
|
class: "sr-only"
|
|
423
418
|
}, null, 512), [
|
|
424
|
-
[
|
|
419
|
+
[Me, se.value]
|
|
425
420
|
]),
|
|
426
421
|
u("div", {
|
|
427
|
-
class:
|
|
422
|
+
class: ae([
|
|
428
423
|
"w-5 h-5 border-2 rounded transition-all duration-200 cursor-pointer flex items-center justify-center",
|
|
429
|
-
(
|
|
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"
|
|
430
425
|
]),
|
|
431
|
-
onClick:
|
|
426
|
+
onClick: Ve
|
|
432
427
|
}, [
|
|
433
|
-
(
|
|
428
|
+
(a = i.value) != null && a.is_pin ? (h(), $("svg", pt, [...t[7] || (t[7] = [
|
|
434
429
|
u("path", {
|
|
435
430
|
"fill-rule": "evenodd",
|
|
436
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",
|
|
@@ -444,40 +439,40 @@ const Xe = [
|
|
|
444
439
|
])
|
|
445
440
|
]),
|
|
446
441
|
q(u("div", ft, [
|
|
447
|
-
(s = Z.value) != null && s.length ? (
|
|
442
|
+
(s = Z.value) != null && s.length ? (h(), ie(p(ue), {
|
|
448
443
|
key: 0,
|
|
449
444
|
modelValue: i.value,
|
|
450
445
|
"onUpdate:modelValue": t[2] || (t[2] = (l) => i.value = l),
|
|
451
|
-
schema:
|
|
452
|
-
form:
|
|
453
|
-
"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)
|
|
454
449
|
}, null, 8, ["modelValue", "schema", "form"])) : S("", !0)
|
|
455
450
|
], 512), [
|
|
456
|
-
[re,
|
|
451
|
+
[re, V.value === "content"]
|
|
457
452
|
]),
|
|
458
453
|
q(u("div", yt, [
|
|
459
|
-
C(
|
|
460
|
-
schema:
|
|
454
|
+
C(p(ue), {
|
|
455
|
+
schema: $e.value,
|
|
461
456
|
values: g.value,
|
|
462
457
|
"onUpdate:values": t[4] || (t[4] = (l) => g.value = l),
|
|
463
458
|
form: W.value,
|
|
464
459
|
"onUpdate:form": t[5] || (t[5] = (l) => W.value = l)
|
|
465
460
|
}, null, 8, ["schema", "values", "form"])
|
|
466
461
|
], 512), [
|
|
467
|
-
[re,
|
|
462
|
+
[re, V.value === "seo"]
|
|
468
463
|
]),
|
|
469
|
-
|
|
470
|
-
C(
|
|
464
|
+
V.value === "tags" ? (h(), $("div", gt, [
|
|
465
|
+
C(p(ye), {
|
|
471
466
|
ref_key: "tagsForm",
|
|
472
|
-
ref:
|
|
467
|
+
ref: N,
|
|
473
468
|
modelValue: i.value,
|
|
474
469
|
"onUpdate:modelValue": t[6] || (t[6] = (l) => i.value = l)
|
|
475
470
|
}, null, 8, ["modelValue"])
|
|
476
471
|
])) : S("", !0),
|
|
477
|
-
|
|
478
|
-
C(
|
|
472
|
+
V.value === "preview" ? (h(), $("div", bt, [
|
|
473
|
+
C(p(ge), {
|
|
479
474
|
slug: (c = i.value) == null ? void 0 : c.slug,
|
|
480
|
-
preview_path:
|
|
475
|
+
preview_path: D.value
|
|
481
476
|
}, null, 8, ["slug", "preview_path"])
|
|
482
477
|
])) : S("", !0)
|
|
483
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-CFjE_cw_.js")), C = u(() => import("./contentForm-CcFbUeal.js")), N = u(() => import("./EditCollectionPage-C4uNmBJf.js")), W = u(
|
|
7
|
+
() => import("./MenuPage-BCZB_S8j.js")
|
|
8
8
|
), j = u(
|
|
9
|
-
() => import("./MenuItemPage-
|
|
9
|
+
() => import("./MenuItemPage-BoJw885D.js")
|
|
10
10
|
), F = u(
|
|
11
|
-
() => import("./MenuAddPage-
|
|
11
|
+
() => import("./MenuAddPage-D-p3gFgm.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-C1eGscNd.js")), J = u(() => import("./MenuWrapper-AZ_8s-zd.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-B1DrxmQX.js";
|
|
3
3
|
const g = {
|
|
4
4
|
__name: "vs-builder-monaco",
|
|
5
5
|
props: {
|