@opengis/cms 0.0.57 → 0.0.58
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/AddNewItemInTree-05PSSEFi.js +76 -0
- package/dist/ArticlesPage-CFjE_cw_.js +298 -0
- package/dist/CollectionsBreadcrumb-BCxeRikP.js +4 -0
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-umRzB5mY.js +53 -0
- package/dist/CollectionsPage-DHfPNql6.js +124 -0
- package/dist/{CreateForm-BMOBeP4G.js → CreateForm-5FvT45vH.js} +1 -1
- package/dist/Dashboard-C1eGscNd.js +358 -0
- package/dist/EditCollectionPage-DIr1tdtn.js +187 -0
- package/dist/{EmptyData-DaZt_nAm.js → EmptyData-DxPrSXhV.js} +1 -1
- package/dist/{MenuAddPage-Bf48Z-ah.js → MenuAddPage-D-p3gFgm.js} +40 -35
- package/dist/MenuBody-rN5j4YBu.js +125 -0
- package/dist/MenuItemPage-BoJw885D.js +1027 -0
- package/dist/MenuList-DFEBS0NB.js +172 -0
- package/dist/MenuPage-BCZB_S8j.js +107 -0
- package/dist/MenuWrapper-AZ_8s-zd.js +12 -0
- package/dist/MonacoEditor-Db-3Jc3E.js +4 -0
- package/dist/{UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js → UniversalTable-CzqPG-tY.js} +12 -12
- package/dist/{UniversalTablePagination.vue_vue_type_script_setup_true_lang-GYZd_gkA.js → UniversalTablePagination-4gL47A7I.js} +1 -1
- package/dist/VsFormTags-CMjiu9sY.js +114 -0
- package/dist/VsPreview-DwETkOpb.js +63 -0
- package/dist/contentForm-CtMhQTG0.js +489 -0
- package/dist/getField-CpwVE28P.js +179 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.html +29 -29
- package/dist/index.js +72 -71
- package/dist/style.css +1 -1
- package/dist/vs-builder-edit-D-q1o8tF.js +604 -0
- package/dist/vs-builder-monaco-B3Jj0V31.js +33 -0
- package/dist/vs-builder-preview-BH4VAM3a.js +44 -0
- package/dist/vs-form-custom-datatable-BDZo48w3.js +317 -0
- package/dist/vs-form-integer-BZ855R3g.js +61 -0
- package/dist/vs-form-media-select-NY27EaG1.js +837 -0
- package/dist/vs-form-reference-list-Dtv8fJJU.js +1536 -0
- package/dist/vs-form-reletion-link-BhzNQszm.js +34 -0
- package/dist/vs-form-tiptap-DDFQjRjY.js +4 -0
- package/dist/vs-form-tiptap.vue_vue_type_script_setup_true_lang-DGgsqXwg.js +11 -0
- package/dist/vs-richtext-md-C098v_6Q.js +4 -0
- package/dist/vs-richtext-md.vue_vue_type_script_setup_true_lang-Ct8uTV-J.js +14 -0
- package/input-types.json +9 -9
- package/locales/en.json +815 -814
- package/locales/uk.json +813 -812
- 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 +68 -68
- 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 +129 -129
- package/server/migrations/site.sql +595 -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/insertContent.js +217 -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/translate.js +89 -89
- package/server/routes/cms/controllers/updateContent.js +266 -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 +85 -85
- package/server/routes/cms/utils/updateLocalization.js +47 -47
- package/server/routes/cmsSpace/controllers/deleteSpace.js +25 -25
- package/server/routes/cmsSpace/controllers/getSpaces.js +27 -27
- package/server/routes/cmsSpace/controllers/insertSpace.js +21 -21
- package/server/routes/cmsSpace/controllers/updateSpace.js +23 -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 +54 -54
- package/server/routes/contentType/controllers/delContentType.js +75 -75
- package/server/routes/contentType/controllers/editContentType.js +88 -88
- package/server/routes/contentType/controllers/getContentType.js +65 -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/utils.d.ts +52 -52
- package/utils.js +8 -8
- package/dist/ArticlesPage-BcR1hbds.js +0 -286
- package/dist/BuilderPage-CK_osM89.js +0 -386
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js +0 -45
- package/dist/CollectionsPage-JfmrHNR_.js +0 -110
- package/dist/EditCollectionPage-Cw3GQYRe.js +0 -809
- package/dist/MenuItemPage-CXn5HC8j.js +0 -1366
- package/dist/MenuPage-tJZtK46W.js +0 -106
- package/dist/contentForm-B6gHgGkz.js +0 -586
- package/dist/getField-Y5WXnRR0.js +0 -2948
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { openBlock as l, createElementBlock as u, createStaticVNode as D, defineComponent as E, ref as h, normalizeClass as z, createTextVNode as M, toDisplayString as f, createCommentVNode as b, createBlock as C, unref as d, withModifiers as y, createVNode as p, createElementVNode as v, withDirectives as $, withKeys as w, vModelText as I, watch as N, resolveComponent as T, withCtx as U, nextTick as V } from "vue";
|
|
2
|
+
import { d as A } from "./vuedraggable-CoAPPFYd.js";
|
|
3
|
+
import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import { Pencil as S, Trash2 as j, Check as K, X as O } from "lucide-vue-next";
|
|
5
|
+
import { confirm as P } from "@opengis/core";
|
|
6
|
+
import { useI18n as X } from "vue-i18n";
|
|
7
|
+
const q = {}, F = {
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
width: "24",
|
|
10
|
+
height: "24",
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
fill: "none",
|
|
13
|
+
stroke: "currentColor",
|
|
14
|
+
"stroke-width": "2",
|
|
15
|
+
"stroke-linecap": "round",
|
|
16
|
+
"stroke-linejoin": "round"
|
|
17
|
+
};
|
|
18
|
+
function G(r, o) {
|
|
19
|
+
return l(), u("svg", F, [...o[0] || (o[0] = [
|
|
20
|
+
D('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
|
|
21
|
+
])]);
|
|
22
|
+
}
|
|
23
|
+
const H = /* @__PURE__ */ L(q, [["render", G]]), J = {
|
|
24
|
+
key: 0,
|
|
25
|
+
class: "p-3 flex items-center gap-x-3 cursor-grab bg-gray-100 border border-gray-300 rounded-lg font-medium text-sm text-gray-800 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200"
|
|
26
|
+
}, Q = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "text-xs text-gray-500 dark:text-neutral-400 ml-2"
|
|
29
|
+
}, R = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "p-3 flex items-center gap-x-2 bg-gray-100 border border-gray-300 rounded-lg dark:bg-neutral-900 dark:border-neutral-700"
|
|
32
|
+
}, W = { class: "text-sm font-medium text-gray-800 dark:text-neutral-200 shrink-0" }, Y = /* @__PURE__ */ E({
|
|
33
|
+
__name: "MenuItem",
|
|
34
|
+
props: {
|
|
35
|
+
title: {},
|
|
36
|
+
value: {}
|
|
37
|
+
},
|
|
38
|
+
emits: ["delete", "update:value"],
|
|
39
|
+
setup(r, { emit: o }) {
|
|
40
|
+
const i = r, m = o, a = h(!1), e = h(""), g = () => {
|
|
41
|
+
typeof i.value == "string" && (e.value = i.value, a.value = !0);
|
|
42
|
+
}, c = () => {
|
|
43
|
+
typeof i.value == "string" && (m("update:value", e.value), a.value = !1);
|
|
44
|
+
}, x = () => {
|
|
45
|
+
a.value = !1, e.value = "";
|
|
46
|
+
};
|
|
47
|
+
return (_, t) => (l(), u("div", {
|
|
48
|
+
class: z([{ "space-y-1": typeof r.value != "string" }, "dark:bg-transparent"])
|
|
49
|
+
}, [
|
|
50
|
+
a.value ? (l(), u("div", R, [
|
|
51
|
+
v("span", W, f(r.title) + ":", 1),
|
|
52
|
+
$(v("input", {
|
|
53
|
+
"onUpdate:modelValue": t[1] || (t[1] = (s) => e.value = s),
|
|
54
|
+
onKeyup: [
|
|
55
|
+
w(c, ["enter"]),
|
|
56
|
+
w(x, ["esc"])
|
|
57
|
+
],
|
|
58
|
+
onBlur: c,
|
|
59
|
+
class: "flex-1 px-2 py-1 text-sm border border-gray-300 rounded dark:bg-neutral-800 dark:border-neutral-600 dark:text-neutral-200 focus:outline-none focus:ring-2 focus:ring-blue-500",
|
|
60
|
+
type: "text",
|
|
61
|
+
placeholder: "/link"
|
|
62
|
+
}, null, 544), [
|
|
63
|
+
[I, e.value]
|
|
64
|
+
]),
|
|
65
|
+
v("button", {
|
|
66
|
+
onClick: y(c, ["stop"]),
|
|
67
|
+
class: "shrink-0 p-1 text-green-600 dark:text-green-400 hover:bg-green-50 dark:hover:bg-green-900/20 rounded",
|
|
68
|
+
title: "Save"
|
|
69
|
+
}, [
|
|
70
|
+
p(d(K), { class: "size-4" })
|
|
71
|
+
]),
|
|
72
|
+
v("button", {
|
|
73
|
+
onClick: y(x, ["stop"]),
|
|
74
|
+
class: "shrink-0 p-1 text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 rounded",
|
|
75
|
+
title: "Cancel"
|
|
76
|
+
}, [
|
|
77
|
+
p(d(O), { class: "size-4" })
|
|
78
|
+
])
|
|
79
|
+
])) : (l(), u("div", J, [
|
|
80
|
+
M(f(r.title) + " ", 1),
|
|
81
|
+
typeof r.value == "string" ? (l(), u("span", Q, f(r.value), 1)) : b("", !0),
|
|
82
|
+
typeof r.value == "string" ? (l(), C(d(S), {
|
|
83
|
+
key: 1,
|
|
84
|
+
class: "shrink-0 size-4 ml-auto text-gray-500 dark:text-neutral-500 cursor-pointer hover:text-blue-600 dark:hover:text-blue-400",
|
|
85
|
+
onClick: y(g, ["stop"])
|
|
86
|
+
})) : b("", !0),
|
|
87
|
+
p(d(j), {
|
|
88
|
+
class: "shrink-0 size-4 text-gray-500 dark:text-neutral-500 cursor-pointer hover:text-red-600 dark:hover:text-red-400",
|
|
89
|
+
onClick: t[0] || (t[0] = y((s) => m("delete"), ["stop"]))
|
|
90
|
+
}),
|
|
91
|
+
p(H, { class: "shrink-0 size-4 cursor-pointer text-gray-500 dark:text-neutral-500" })
|
|
92
|
+
]))
|
|
93
|
+
], 2));
|
|
94
|
+
}
|
|
95
|
+
}), Z = { class: "space-y-1" }, ne = /* @__PURE__ */ E({
|
|
96
|
+
__name: "MenuList",
|
|
97
|
+
props: {
|
|
98
|
+
list: {
|
|
99
|
+
type: Array,
|
|
100
|
+
default: () => []
|
|
101
|
+
},
|
|
102
|
+
inside: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: !1
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
emits: ["update:list", "delete:item"],
|
|
108
|
+
setup(r, { emit: o }) {
|
|
109
|
+
const { t: i } = X(), m = r, a = o, e = h([]);
|
|
110
|
+
N(
|
|
111
|
+
() => m.list,
|
|
112
|
+
(t) => {
|
|
113
|
+
e.value = t ? [...t] : [];
|
|
114
|
+
},
|
|
115
|
+
{ immediate: !0, deep: !0 }
|
|
116
|
+
);
|
|
117
|
+
const g = () => {
|
|
118
|
+
a("update:list", e.value);
|
|
119
|
+
}, c = (t) => {
|
|
120
|
+
P({
|
|
121
|
+
title: i("cms.builder.deleteTitle"),
|
|
122
|
+
message: i("cms.builder.deleteObject"),
|
|
123
|
+
type: "error",
|
|
124
|
+
onConfirm: () => {
|
|
125
|
+
a("update:list", e.value), a("delete:item", t);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
}, x = (t, s) => {
|
|
129
|
+
t.value = s, V(() => {
|
|
130
|
+
e.value = [...e.value], a("update:list", e.value);
|
|
131
|
+
});
|
|
132
|
+
}, _ = (t, s) => {
|
|
133
|
+
t.children = s, V(() => {
|
|
134
|
+
e.value = [...e.value], a("update:list", e.value);
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
return (t, s) => {
|
|
138
|
+
const B = T("MenuList", !0);
|
|
139
|
+
return l(), C(d(A), {
|
|
140
|
+
tag: "ul",
|
|
141
|
+
list: e.value,
|
|
142
|
+
group: { name: "nested", pull: !0, put: !0 },
|
|
143
|
+
"item-key": "id",
|
|
144
|
+
class: z(["nested-sortable space-y-1", { "ps-5 dark:bg-transparent": r.inside }]),
|
|
145
|
+
onChange: g,
|
|
146
|
+
onEnd: g
|
|
147
|
+
}, {
|
|
148
|
+
item: U(({ element: n }) => [
|
|
149
|
+
v("div", Z, [
|
|
150
|
+
p(Y, {
|
|
151
|
+
title: n.title,
|
|
152
|
+
value: n.value,
|
|
153
|
+
onDelete: (k) => c(n),
|
|
154
|
+
"onUpdate:value": (k) => x(n, k)
|
|
155
|
+
}, null, 8, ["title", "value", "onDelete", "onUpdate:value"]),
|
|
156
|
+
Array.isArray(n.children) ? (l(), C(B, {
|
|
157
|
+
key: 0,
|
|
158
|
+
list: n.children,
|
|
159
|
+
inside: !0,
|
|
160
|
+
"onUpdate:list": (k) => _(n, k),
|
|
161
|
+
"onDelete:item": c
|
|
162
|
+
}, null, 8, ["list", "onUpdate:list"])) : b("", !0)
|
|
163
|
+
])
|
|
164
|
+
]),
|
|
165
|
+
_: 1
|
|
166
|
+
}, 8, ["list", "class"]);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
export {
|
|
171
|
+
ne as default
|
|
172
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { defineComponent as S, defineAsyncComponent as V, ref as a, onMounted as j, resolveComponent as F, openBlock as f, createElementBlock as _, createElementVNode as r, toDisplayString as u, unref as c, createVNode as l, withCtx as N, createTextVNode as L, createCommentVNode as T } from "vue";
|
|
2
|
+
import { useRouter as q } from "vue-router";
|
|
3
|
+
import { HelpCircle as A, Plus as B } from "lucide-vue-next";
|
|
4
|
+
import { useI18n as M } from "vue-i18n";
|
|
5
|
+
import P from "@opengis/filter";
|
|
6
|
+
import { notify as w } from "@opengis/core";
|
|
7
|
+
const H = { class: "space-y-6 max-w-7xl mx-auto" }, I = { class: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" }, O = { class: "flex items-center gap-2" }, Q = { class: "text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2" }, R = ["href", "title"], U = { class: "text-slate-600 dark:text-slate-300" }, z = { class: "overflow-hidden bg-white border border-gray-200 rounded-lg shadow-sm dark:bg-gray-800 dark:border-gray-700" }, G = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "p-4 border-b border-gray-200 sm:p-6 dark:border-gray-700"
|
|
10
|
+
}, se = /* @__PURE__ */ S({
|
|
11
|
+
__name: "MenuPage",
|
|
12
|
+
setup(J) {
|
|
13
|
+
const g = V(
|
|
14
|
+
() => import("./UniversalTable-CzqPG-tY.js")
|
|
15
|
+
), { t: o, locale: v } = M(), y = q(), x = a(""), d = a([]), i = a([]), b = a(""), h = a([
|
|
16
|
+
{ name: "name", title: o("cms.menu.form.name"), type: "text" },
|
|
17
|
+
{ name: "description", title: o("cms.menu.form.description"), type: "text" },
|
|
18
|
+
{ name: "locale", title: o("cms.menu.form.language"), type: "select", data: [{ text: "uk", id: "uk" }, { text: "en", id: "en" }] }
|
|
19
|
+
]), p = async () => {
|
|
20
|
+
const t = await (await fetch("/api/cms-menu")).json(), n = t.rows;
|
|
21
|
+
d.value = n;
|
|
22
|
+
const s = (t.filters || []).map((m) => {
|
|
23
|
+
const { extra: K, title: W, ...D } = m;
|
|
24
|
+
return D;
|
|
25
|
+
});
|
|
26
|
+
i.value = s;
|
|
27
|
+
}, k = (e) => {
|
|
28
|
+
y.push(`/menu/${e == null ? void 0 : e.menu_id}`);
|
|
29
|
+
}, C = async (e) => {
|
|
30
|
+
try {
|
|
31
|
+
await fetch(`/api/cms-menu/${e == null ? void 0 : e.menu_id}`, { method: "DELETE" }), await w({
|
|
32
|
+
title: o("cms.menu.menuDeleted"),
|
|
33
|
+
type: "success",
|
|
34
|
+
message: o("cms.menu.menuDeleted")
|
|
35
|
+
}), await p();
|
|
36
|
+
} catch {
|
|
37
|
+
w({
|
|
38
|
+
title: o("cms.menu.menuDeleteError"),
|
|
39
|
+
type: "error",
|
|
40
|
+
message: o("cms.menu.menuDeleteError")
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, E = (e, t) => {
|
|
44
|
+
if (!t)
|
|
45
|
+
return !0;
|
|
46
|
+
const n = t.toLowerCase();
|
|
47
|
+
return h.value.some((s) => {
|
|
48
|
+
const m = e[s.name];
|
|
49
|
+
return m && m.toString().toLowerCase().includes(n);
|
|
50
|
+
});
|
|
51
|
+
}, $ = (e) => {
|
|
52
|
+
const t = Object.entries(e == null ? void 0 : e.data).filter(([, n]) => n != null).map(([n, s]) => `${n}=${s}`).join("|");
|
|
53
|
+
b.value = t;
|
|
54
|
+
};
|
|
55
|
+
return j(p), (e, t) => {
|
|
56
|
+
var s;
|
|
57
|
+
const n = F("router-link");
|
|
58
|
+
return f(), _("div", H, [
|
|
59
|
+
r("div", I, [
|
|
60
|
+
r("div", null, [
|
|
61
|
+
r("div", O, [
|
|
62
|
+
r("h1", Q, u(e.$t("cms.menu.title")), 1),
|
|
63
|
+
r("a", {
|
|
64
|
+
href: `https://cms.opengis.info/${c(v)}/guides/menu/`,
|
|
65
|
+
target: "_blank",
|
|
66
|
+
title: e.$t("cms.guide.menu")
|
|
67
|
+
}, [
|
|
68
|
+
l(c(A), { class: "w-5 h-5" })
|
|
69
|
+
], 8, R)
|
|
70
|
+
]),
|
|
71
|
+
r("p", U, u(e.$t("cms.menu.description")), 1)
|
|
72
|
+
]),
|
|
73
|
+
l(n, {
|
|
74
|
+
to: "/menu/create",
|
|
75
|
+
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"
|
|
76
|
+
}, {
|
|
77
|
+
default: N(() => [
|
|
78
|
+
l(c(B), { class: "w-4 h-4 mr-2" }),
|
|
79
|
+
L(" " + u(e.$t("cms.menu.menuAdd")), 1)
|
|
80
|
+
]),
|
|
81
|
+
_: 1
|
|
82
|
+
})
|
|
83
|
+
]),
|
|
84
|
+
r("div", z, [
|
|
85
|
+
((s = i.value) == null ? void 0 : s.length) > 0 ? (f(), _("div", G, [
|
|
86
|
+
l(c(P), {
|
|
87
|
+
schema: i.value,
|
|
88
|
+
view: "inline",
|
|
89
|
+
onChange: $
|
|
90
|
+
}, null, 8, ["schema"])
|
|
91
|
+
])) : T("", !0),
|
|
92
|
+
l(c(g), {
|
|
93
|
+
rows: d.value,
|
|
94
|
+
columns: h.value,
|
|
95
|
+
query: x.value,
|
|
96
|
+
filterFn: E,
|
|
97
|
+
onEdit: k,
|
|
98
|
+
onDelete: C
|
|
99
|
+
}, null, 8, ["rows", "columns", "query"])
|
|
100
|
+
])
|
|
101
|
+
]);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
export {
|
|
106
|
+
se as default
|
|
107
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineComponent as m, defineAsyncComponent as n, computed as t, openBlock as u, createBlock as s, resolveDynamicComponent as i } from "vue";
|
|
2
|
+
import { useRoute as d } from "vue-router";
|
|
3
|
+
const C = /* @__PURE__ */ m({
|
|
4
|
+
__name: "MenuWrapper",
|
|
5
|
+
setup(f) {
|
|
6
|
+
const o = n(() => import("./MenuPage-BCZB_S8j.js")), r = n(() => import("./MenuAddPage-D-p3gFgm.js")), p = n(() => import("./MenuItemPage-BoJw885D.js")), e = d(), a = t(() => e.params.id ? e.params.id === "create" ? r : p : o), c = t(() => String(e.params.id ?? "index"));
|
|
7
|
+
return (_, l) => (u(), s(i(a.value), { key: c.value }));
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
C as default
|
|
12
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as j, ref as L, computed as $, openBlock as s, createElementBlock as n, createElementVNode as r, Fragment as v, renderList as C, normalizeClass as g, createBlock as
|
|
1
|
+
import { defineComponent as j, ref as L, computed as $, openBlock as s, createElementBlock as n, createElementVNode as r, Fragment as v, renderList as C, normalizeClass as g, createBlock as x, resolveDynamicComponent as A, createCommentVNode as M, createTextVNode as _, toDisplayString as l, createVNode as F, unref as p, withModifiers as N, renderSlot as B } from "vue";
|
|
2
2
|
import { useI18n as q } from "vue-i18n";
|
|
3
3
|
import { Eye as U, File as P, Layers as z, Pencil as H, Trash2 as W, XCircle as X, Edit as G, CheckCircle as J } from "lucide-vue-next";
|
|
4
4
|
const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm" }, O = { class: "p-0" }, Q = { class: "table-scroll overflow-x-auto" }, Y = { class: "relative w-full overflow-auto max-h-[calc(100vh-270px)]" }, Z = { class: "w-full caption-bottom text-sm" }, I = { class: "border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, ee = { class: "flex items-center gap-2" }, te = { class: "h-10 text-center px-4 font-semibold text-slate-700 dark:text-slate-300 max-w-32" }, se = ["onClick"], ne = {
|
|
@@ -88,7 +88,7 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
|
|
|
88
88
|
}, R = (a) => {
|
|
89
89
|
w("edit", a);
|
|
90
90
|
}, S = (a) => {
|
|
91
|
-
const i = /* @__PURE__ */ new Date(), e = new Date(a), t = i - e,
|
|
91
|
+
const i = /* @__PURE__ */ new Date(), e = new Date(a), t = i - e, f = Math.floor(t / 1e3), c = Math.floor(f / 60), m = Math.floor(c / 60), u = Number(Math.floor(m / 24)), h = Number(Math.floor(u / 7));
|
|
92
92
|
return h >= 2 ? o("cms.table.time.weeksAgo", { count: h }) : h === 1 ? o("cms.table.time.weekAgo") : u >= 2 ? o("cms.table.time.daysAgo", { count: u }) : u === 1 ? o("cms.table.time.dayAgo") : m >= 2 ? o("cms.table.time.hoursAgo", { count: m }) : m === 1 ? o("cms.table.time.hourAgo") : c >= 2 ? o("cms.table.time.minutesAgo", { count: c }) : o(c === 1 ? "cms.table.time.minuteAgo" : "cms.table.time.justNow");
|
|
93
93
|
};
|
|
94
94
|
return (a, i) => (s(), n("div", K, [
|
|
@@ -107,7 +107,7 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
|
|
|
107
107
|
}])
|
|
108
108
|
}, [
|
|
109
109
|
r("div", ee, [
|
|
110
|
-
e.icon ? (s(),
|
|
110
|
+
e.icon ? (s(), x(A(e.icon), {
|
|
111
111
|
key: 0,
|
|
112
112
|
class: "w-5 h-5"
|
|
113
113
|
})) : M("", !0),
|
|
@@ -122,17 +122,17 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
|
|
|
122
122
|
key: e.id || e._id || e.name,
|
|
123
123
|
class: "transition-all duration-200 hover:bg-slate-100 dark:hover:bg-slate-700/60"
|
|
124
124
|
}, [
|
|
125
|
-
(s(!0), n(v, null, C(b.columns, (t,
|
|
125
|
+
(s(!0), n(v, null, C(b.columns, (t, f) => {
|
|
126
126
|
var c, m, u, h, D;
|
|
127
127
|
return s(), n("td", {
|
|
128
128
|
key: t.name,
|
|
129
129
|
class: g(["py-2 px-4 align-middle max-w-80", {
|
|
130
|
-
"font-medium text-slate-800 dark:text-white cursor-pointer":
|
|
131
|
-
"text-slate-600 dark:text-slate-400 font-mono text-sm":
|
|
130
|
+
"font-medium text-slate-800 dark:text-white cursor-pointer": f === 0,
|
|
131
|
+
"text-slate-600 dark:text-slate-400 font-mono text-sm": f !== 0
|
|
132
132
|
}]),
|
|
133
|
-
onClick: (
|
|
133
|
+
onClick: (fe) => f === 0 ? R(e) : void 0
|
|
134
134
|
}, [
|
|
135
|
-
b.customRender && b.customRender[t.name] ? (s(),
|
|
135
|
+
b.customRender && b.customRender[t.name] ? (s(), x(A(b.customRender[t.name](e[t.name], e)), { key: 0 })) : M("", !0),
|
|
136
136
|
[
|
|
137
137
|
"published_at",
|
|
138
138
|
"publish_at",
|
|
@@ -150,10 +150,10 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
|
|
|
150
150
|
class: g(["whitespace-nowrap inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors border-transparent hover:bg-secondary/80", e[t.name] === "pages" ? "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300" : "bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-300"])
|
|
151
151
|
}, l(e[t.name] || "-"), 3)
|
|
152
152
|
])) : t.name === "name" ? (s(), n("div", de, [
|
|
153
|
-
e.type === "single" ? (s(),
|
|
153
|
+
e.type === "single" ? (s(), x(p(P), {
|
|
154
154
|
key: 0,
|
|
155
155
|
class: "shrink-0 lucide lucide-page w-5 h-5 text-blue-600"
|
|
156
|
-
})) : (s(),
|
|
156
|
+
})) : (s(), x(p(z), {
|
|
157
157
|
key: 1,
|
|
158
158
|
class: "shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"
|
|
159
159
|
})),
|
|
@@ -163,7 +163,7 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
|
|
|
163
163
|
key: 0,
|
|
164
164
|
class: g(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700", (u = y(e[t.name])) == null ? void 0 : u.classes])
|
|
165
165
|
}, [
|
|
166
|
-
(s(),
|
|
166
|
+
(s(), x(A((h = y(e[t.name])) == null ? void 0 : h.icon), { class: "w-3 h-3 mr-1" })),
|
|
167
167
|
_(" " + l((D = y(e[t.name])) == null ? void 0 : D.text), 1)
|
|
168
168
|
], 2)) : M("", !0)
|
|
169
169
|
], 64)) : t.name === "slug" ? (s(), n("div", le, l(e[t.name] ? "/" + e[t.name] : "-"), 1)) : t.name === "color" ? (s(), n("span", {
|
|
@@ -206,5 +206,5 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
|
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
export {
|
|
209
|
-
ye as
|
|
209
|
+
ye as default
|
|
210
210
|
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { defineAsyncComponent as V, useModel as h, ref as f, provide as S, onMounted as x, nextTick as n, watch as c, computed as N, openBlock as O, createBlock as T, unref as J, createCommentVNode as k } from "vue";
|
|
2
|
+
import { useI18n as z } from "vue-i18n";
|
|
3
|
+
import { notify as B } from "@opengis/core";
|
|
4
|
+
const U = {
|
|
5
|
+
__name: "VsFormTags",
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: { default: () => [] },
|
|
8
|
+
modelModifiers: {}
|
|
9
|
+
},
|
|
10
|
+
emits: ["update:modelValue"],
|
|
11
|
+
setup(g, { expose: d }) {
|
|
12
|
+
const y = V(() => import("@opengis/form")), { t: u } = z(), a = h(g, "modelValue"), i = f({}), s = f(!1);
|
|
13
|
+
S("metaParentValue", a);
|
|
14
|
+
const l = (e) => Array.isArray(e) ? e.map((t) => typeof t == "object" && t !== null && t.id ? t.id : t) : [], p = async (e) => {
|
|
15
|
+
if (!Array.isArray(e) || e.length === 0)
|
|
16
|
+
return [];
|
|
17
|
+
try {
|
|
18
|
+
const r = await (await fetch("/api/tags")).json(), A = (r == null ? void 0 : r.rows) || [];
|
|
19
|
+
return e.map((m) => {
|
|
20
|
+
const o = A.find((b) => b.tag_id === m);
|
|
21
|
+
return o ? { id: o.tag_id, text: o.value, color: o.color } : { id: m, text: "", color: "#ababab" };
|
|
22
|
+
});
|
|
23
|
+
} catch (t) {
|
|
24
|
+
return console.error("Error fetching tags:", t), e.map((r) => ({ id: r, text: "", color: "#ababab" }));
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
x(async () => {
|
|
28
|
+
await n(), await n(), setTimeout(() => {
|
|
29
|
+
var e;
|
|
30
|
+
if (Array.isArray((e = a.value) == null ? void 0 : e.tag_list)) {
|
|
31
|
+
const t = l(a.value.tag_list);
|
|
32
|
+
JSON.stringify(t) !== JSON.stringify(a.value.tag_list) && (a.value.tag_list = t);
|
|
33
|
+
}
|
|
34
|
+
}, 100);
|
|
35
|
+
}), c(
|
|
36
|
+
() => a.value.tag_list,
|
|
37
|
+
(e) => {
|
|
38
|
+
if (Array.isArray(e) && !s.value) {
|
|
39
|
+
const t = l(e);
|
|
40
|
+
JSON.stringify(t) !== JSON.stringify(e) && (a.value.tag_list = t);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{ deep: !0 }
|
|
44
|
+
), c(
|
|
45
|
+
() => a.value,
|
|
46
|
+
(e) => {
|
|
47
|
+
if (e && Array.isArray(e.tag_list) && !s.value) {
|
|
48
|
+
const t = l(e.tag_list);
|
|
49
|
+
JSON.stringify(t) !== JSON.stringify(e.tag_list) && (e.tag_list = t);
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{ deep: !0, immediate: !0 }
|
|
53
|
+
), c(
|
|
54
|
+
() => {
|
|
55
|
+
var e;
|
|
56
|
+
return (e = a.value) == null ? void 0 : e.tag_list;
|
|
57
|
+
},
|
|
58
|
+
(e) => {
|
|
59
|
+
Array.isArray(e) && i.value && n(() => {
|
|
60
|
+
i.value && i.value.setValue && i.value.setValue("tag_list", e);
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
{ deep: !0 }
|
|
64
|
+
);
|
|
65
|
+
const _ = async (e) => {
|
|
66
|
+
if (e.tag_list && (e.tag_list = l(e.tag_list), a.value.tag_list = e.tag_list), await i.value.validate()) {
|
|
67
|
+
B({
|
|
68
|
+
type: "warning",
|
|
69
|
+
title: u("cms.common.actions.warning"),
|
|
70
|
+
message: u("cms.builder.editFieldFailed")
|
|
71
|
+
});
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
d({
|
|
76
|
+
restoreTagsBeforeSubmit: async () => {
|
|
77
|
+
var e;
|
|
78
|
+
if (s.value = !0, Array.isArray((e = a.value) == null ? void 0 : e.tag_list)) {
|
|
79
|
+
const t = await p(a.value.tag_list);
|
|
80
|
+
a.value.tag_list = t;
|
|
81
|
+
}
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
s.value = !1;
|
|
84
|
+
}, 2e3);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const v = N(() => {
|
|
88
|
+
var e;
|
|
89
|
+
return [
|
|
90
|
+
{
|
|
91
|
+
key: "tag_list",
|
|
92
|
+
type: "select",
|
|
93
|
+
multiple: !0,
|
|
94
|
+
searchable: !1,
|
|
95
|
+
placeholder: u("cms.builder.tags"),
|
|
96
|
+
data: "tag_id",
|
|
97
|
+
value: ((e = a.value) == null ? void 0 : e.tag_list) || []
|
|
98
|
+
}
|
|
99
|
+
];
|
|
100
|
+
});
|
|
101
|
+
return (e, t) => a.value ? (O(), T(J(y), {
|
|
102
|
+
key: 0,
|
|
103
|
+
schema: v.value,
|
|
104
|
+
modelValue: a.value,
|
|
105
|
+
"onUpdate:modelValue": [
|
|
106
|
+
t[0] || (t[0] = (r) => a.value = r),
|
|
107
|
+
_
|
|
108
|
+
]
|
|
109
|
+
}, null, 8, ["schema", "modelValue"])) : k("", !0);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
export {
|
|
113
|
+
U as default
|
|
114
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { ref as c, onMounted as d, openBlock as l, createElementBlock as n, createElementVNode as u, createTextVNode as v, createVNode as p, unref as w } from "vue";
|
|
2
|
+
import { ExternalLink as y } from "lucide-vue-next";
|
|
3
|
+
const g = { class: "flex justify-end mb-4" }, m = ["href"], $ = ["src"], b = ["src"], k = {
|
|
4
|
+
key: 2,
|
|
5
|
+
class: "w-full h-[80vh] flex items-center justify-center text-gray-500"
|
|
6
|
+
}, j = {
|
|
7
|
+
__name: "VsPreview",
|
|
8
|
+
props: {
|
|
9
|
+
preview_path: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ""
|
|
12
|
+
},
|
|
13
|
+
slug: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: ""
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
setup(r) {
|
|
19
|
+
const t = c(""), a = c(""), f = async () => {
|
|
20
|
+
var s, e;
|
|
21
|
+
try {
|
|
22
|
+
const i = await (await fetch("/api/settings")).json();
|
|
23
|
+
t.value = ((e = (s = i == null ? void 0 : i.settings) == null ? void 0 : s.site_info) == null ? void 0 : e.previewUrl) || "http://ip.local.softpro.ua";
|
|
24
|
+
} catch (o) {
|
|
25
|
+
console.error("Failed to fetch settings:", o), t.value = "http://ip.local.softpro.ua";
|
|
26
|
+
}
|
|
27
|
+
}, h = async () => {
|
|
28
|
+
var s;
|
|
29
|
+
try {
|
|
30
|
+
const o = await (await fetch("/user")).json();
|
|
31
|
+
a.value = (s = o == null ? void 0 : o.user) == null ? void 0 : s.draftKey;
|
|
32
|
+
} catch (e) {
|
|
33
|
+
console.error("Failed to fetch user:", e);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return d(() => {
|
|
37
|
+
f(), h();
|
|
38
|
+
}), (s, e) => (l(), n("div", null, [
|
|
39
|
+
u("div", g, [
|
|
40
|
+
u("a", {
|
|
41
|
+
href: `${t.value}/uk/${r.preview_path}${r.slug}${a.value ? `?draftKey=${a.value}` : ""}`,
|
|
42
|
+
target: "_blank",
|
|
43
|
+
class: "inline-flex items-center gap-2 px-3 py-1.5 text-black-600 bg-white border border-blue-200 rounded hover:border-blue-300 hover:bg-blue-50 transition-colors duration-200 font-normal cursor-pointer"
|
|
44
|
+
}, [
|
|
45
|
+
e[0] || (e[0] = v(" Переглянути на сайті ", -1)),
|
|
46
|
+
p(w(y), { class: "w-4 h-4" })
|
|
47
|
+
], 8, m)
|
|
48
|
+
]),
|
|
49
|
+
t.value && r.preview_path ? (l(), n("iframe", {
|
|
50
|
+
key: 0,
|
|
51
|
+
src: `${t.value}/uk/${r.preview_path}${r.slug}?hideHeader=true&hideFooter=true${a.value ? `&draftKey=${a.value}` : ""}`,
|
|
52
|
+
class: "w-full h-[80vh]"
|
|
53
|
+
}, null, 8, $)) : t.value ? (l(), n("iframe", {
|
|
54
|
+
key: 1,
|
|
55
|
+
src: `${t.value}/uk/${r.slug}?hideHeader=true&hideFooter=true`,
|
|
56
|
+
class: "w-full h-[80vh]"
|
|
57
|
+
}, null, 8, b)) : (l(), n("div", k, " Loading preview... "))
|
|
58
|
+
]));
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
j as default
|
|
63
|
+
};
|