@opengis/cms 0.0.51 → 0.0.52
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-BcR1hbds.js → ArticlesPage-Cddv2qte.js} +5 -5
- package/dist/{BuilderPage-CK_osM89.js → BuilderPage-BgcBJcw7.js} +158 -158
- package/dist/{CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js → CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-C-k8QGA-.js} +1 -1
- package/dist/{CollectionsPage-JfmrHNR_.js → CollectionsPage-d5MLIIAG.js} +3 -3
- package/dist/{CreateForm-BMOBeP4G.js → CreateForm-B0srHu5e.js} +2 -2
- package/dist/{EditCollectionPage-DtgvKGm-.js → EditCollectionPage-NUVatLkY.js} +65 -59
- package/dist/{EmptyData-DaZt_nAm.js → EmptyData-BSW20VKP.js} +5 -5
- package/dist/{MenuAddPage-Bf48Z-ah.js → MenuAddPage-Cn3JN04F.js} +3 -3
- package/dist/{MenuItemPage-BSwUW8tv.js → MenuItemPage-B0Th9EOe.js} +3 -3
- package/dist/{MenuPage-tJZtK46W.js → MenuPage-DQpD3IXx.js} +4 -4
- package/dist/{MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js → MonacoEditor.vue_vue_type_script_setup_true_lang-CTKNG0qR.js} +2 -2
- package/dist/{UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js → UniversalTable.vue_vue_type_script_setup_true_lang-DW6O-xoY.js} +6 -6
- package/dist/{UniversalTablePagination.vue_vue_type_script_setup_true_lang-GYZd_gkA.js → UniversalTablePagination.vue_vue_type_script_setup_true_lang-DBIPBmpm.js} +4 -4
- package/dist/contentForm-C4Jp-FbQ.js +586 -0
- package/dist/{getField-C7EZs-YQ.js → getField-CKcz_b0t.js} +960 -933
- package/dist/index.js +10 -10
- package/dist/style.css +1 -1
- package/dist/{vuedraggable-CoAPPFYd.js → vuedraggable-mqqAYsch.js} +107 -107
- package/locales/en.json +6 -1
- package/locales/uk.json +4 -1
- package/package.json +4 -4
- package/server/functions/getContent.js +6 -15
- package/server/functions/getSearchData.js +2 -12
- package/server/functions/utils/mock.reply.js +56 -0
- package/server/routes/cms/controllers/getPermissions.js +15 -15
- package/server/routes/cms/controllers/listMedia.js +30 -3
- package/server/routes/cms/controllers/searchContent.js +2 -2
- package/server/routes/cms/controllers/setPermissions.js +49 -49
- package/server/templates/select/core.user_mentioned.sql +1 -1
- package/dist/contentForm-NcG15_5z.js +0 -553
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as te, ref as n, inject as ae, computed as I, onMounted as se, watch as D, nextTick as M,
|
|
1
|
+
import { defineComponent as te, ref as n, inject as ae, computed as I, onMounted as se, watch as D, nextTick as M, createElementBlock as d, openBlock as i, createVNode as _, createElementVNode as r, toDisplayString as h, unref as b, createCommentVNode as f, createTextVNode as le, createBlock as q } from "vue";
|
|
2
2
|
import { useRoute as ne, useRouter as oe } from "vue-router";
|
|
3
3
|
import { HelpCircle as ie, Plus as re, ChevronDown as ce, Calendar as R, User as ue, Globe as me, FileText as de } from "lucide-vue-next";
|
|
4
|
-
import { _ as pe } from "./UniversalTable.vue_vue_type_script_setup_true_lang-
|
|
5
|
-
import { _ as fe } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-
|
|
4
|
+
import { _ as pe } from "./UniversalTable.vue_vue_type_script_setup_true_lang-DW6O-xoY.js";
|
|
5
|
+
import { _ as fe } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-DBIPBmpm.js";
|
|
6
6
|
import { VsInputCheckbox as ve } from "@opengis/form";
|
|
7
7
|
import he from "@opengis/filter";
|
|
8
8
|
import { confirm as S } from "@opengis/core";
|
|
9
9
|
import { useI18n as be } from "vue-i18n";
|
|
10
|
-
import { _ as ge } from "./EmptyData-
|
|
11
|
-
import { _ as ye } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import { _ as ge } from "./EmptyData-BSW20VKP.js";
|
|
11
|
+
import { _ as ye } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-C-k8QGA-.js";
|
|
12
12
|
const we = { class: "space-y-6 mx-auto max-w-[90%]" }, xe = { class: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" }, _e = { class: "flex items-center gap-2" }, ke = { class: "text-3xl font-bold text-slate-800 dark:text-white mb-2" }, Ce = ["href", "title"], $e = { class: "flex items-center gap-2" }, Ae = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "text-card-foreground shadow-lg border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { _ as
|
|
3
|
-
import { useRouter as
|
|
4
|
-
import { File as fe, Layers as H, Edit as
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
9
|
-
let
|
|
10
|
-
function
|
|
11
|
-
return
|
|
1
|
+
import { inject as R, unref as i, version as X, ref as m, watchEffect as J, watch as M, getCurrentInstance as Y, onBeforeUnmount as Z, onDeactivated as ee, onActivated as te, createElementBlock as C, openBlock as u, createStaticVNode as Q, defineComponent as q, Fragment as se, renderList as oe, createElementVNode as t, createBlock as V, createCommentVNode as T, toDisplayString as f, normalizeClass as E, createTextVNode as re, resolveDynamicComponent as ne, renderSlot as le, withModifiers as N, createVNode as w, onMounted as ae, computed as ie, withDirectives as de, vModelText as ce, withCtx as ue } from "vue";
|
|
2
|
+
import { _ as he } from "./CreateForm-B0srHu5e.js";
|
|
3
|
+
import { useRouter as pe } from "vue-router";
|
|
4
|
+
import { File as fe, Layers as H, Edit as P, Trash2 as ge, List as z, HelpCircle as K, XCircle as me, CheckCircle as be, Search as xe } from "lucide-vue-next";
|
|
5
|
+
import { useI18n as ve } from "vue-i18n";
|
|
6
|
+
import { _ as we } from "./UniversalTable.vue_vue_type_script_setup_true_lang-DW6O-xoY.js";
|
|
7
|
+
import { _ as ke } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-DBIPBmpm.js";
|
|
8
|
+
import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
let ye;
|
|
10
|
+
function _e() {
|
|
11
|
+
return ye;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
return typeof
|
|
13
|
+
X[0];
|
|
14
|
+
function $e(s) {
|
|
15
|
+
return typeof s == "function" ? s() : i(s);
|
|
16
16
|
}
|
|
17
|
-
function U(
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
20
|
-
const e =
|
|
21
|
-
if (!
|
|
17
|
+
function U(s) {
|
|
18
|
+
if (s instanceof Promise || s instanceof Date || s instanceof RegExp)
|
|
19
|
+
return s;
|
|
20
|
+
const e = $e(s);
|
|
21
|
+
if (!s || !e)
|
|
22
22
|
return e;
|
|
23
23
|
if (Array.isArray(e))
|
|
24
24
|
return e.map((r) => U(r));
|
|
@@ -36,39 +36,39 @@ function U(o) {
|
|
|
36
36
|
}
|
|
37
37
|
return e;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const Ce = "usehead", G = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, O = "__unhead_injection_handler__";
|
|
40
40
|
function je() {
|
|
41
|
-
if (
|
|
42
|
-
return O
|
|
43
|
-
const
|
|
44
|
-
return !
|
|
41
|
+
if (O in G)
|
|
42
|
+
return G[O]();
|
|
43
|
+
const s = R(Ce);
|
|
44
|
+
return !s && process.env.NODE_ENV !== "production" && console.warn("Unhead is missing Vue context, falling back to shared context. This may have unexpected results."), s || _e();
|
|
45
45
|
}
|
|
46
|
-
function
|
|
46
|
+
function Ve(s, e = {}) {
|
|
47
47
|
const r = e.head || je();
|
|
48
48
|
if (r)
|
|
49
|
-
return r.ssr ? r.push(
|
|
49
|
+
return r.ssr ? r.push(s, e) : De(r, s, e);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const n =
|
|
53
|
-
|
|
51
|
+
function De(s, e, r = {}) {
|
|
52
|
+
const n = m(!1), h = m({});
|
|
53
|
+
J(() => {
|
|
54
54
|
h.value = n.value ? {} : U(e);
|
|
55
55
|
});
|
|
56
|
-
const
|
|
56
|
+
const x = s.push(h.value, r);
|
|
57
57
|
return M(h, (a) => {
|
|
58
|
-
|
|
59
|
-
}),
|
|
60
|
-
|
|
61
|
-
}),
|
|
58
|
+
x.patch(a);
|
|
59
|
+
}), Y() && (Z(() => {
|
|
60
|
+
x.dispose();
|
|
61
|
+
}), ee(() => {
|
|
62
62
|
n.value = !0;
|
|
63
|
-
}),
|
|
63
|
+
}), te(() => {
|
|
64
64
|
n.value = !1;
|
|
65
|
-
})),
|
|
65
|
+
})), x;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const r =
|
|
67
|
+
function Ee(s, e = 300) {
|
|
68
|
+
const r = m(s.value);
|
|
69
69
|
let n;
|
|
70
70
|
return M(
|
|
71
|
-
|
|
71
|
+
s,
|
|
72
72
|
(h) => {
|
|
73
73
|
clearTimeout(n), n = setTimeout(() => {
|
|
74
74
|
r.value = h;
|
|
@@ -77,7 +77,7 @@ function Me(o, e = 300) {
|
|
|
77
77
|
{ immediate: !0 }
|
|
78
78
|
), r;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const Me = {}, Te = {
|
|
81
81
|
xmlns: "http://www.w3.org/2000/svg",
|
|
82
82
|
width: "24",
|
|
83
83
|
height: "24",
|
|
@@ -88,12 +88,12 @@ const Te = {}, Se = {
|
|
|
88
88
|
"stroke-linecap": "round",
|
|
89
89
|
"stroke-linejoin": "round"
|
|
90
90
|
};
|
|
91
|
-
function
|
|
92
|
-
return u(), C("svg",
|
|
93
|
-
|
|
91
|
+
function Se(s, e) {
|
|
92
|
+
return u(), C("svg", Te, [...e[0] || (e[0] = [
|
|
93
|
+
Q('<line x1="8" x2="21" y1="6" y2="6"></line><line x1="8" x2="21" y1="12" y2="12"></line><line x1="8" x2="21" y1="18" y2="18"></line><line x1="3" x2="3.01" y1="6" y2="6"></line><line x1="3" x2="3.01" y1="12" y2="12"></line><line x1="3" x2="3.01" y1="18" y2="18"></line>', 6)
|
|
94
94
|
])]);
|
|
95
95
|
}
|
|
96
|
-
const
|
|
96
|
+
const Ie = /* @__PURE__ */ W(Me, [["render", Se]]), Ne = {}, Be = {
|
|
97
97
|
xmlns: "http://www.w3.org/2000/svg",
|
|
98
98
|
viewBox: "0 0 24 24",
|
|
99
99
|
fill: "none",
|
|
@@ -102,12 +102,12 @@ const Ne = /* @__PURE__ */ X(Te, [["render", Ie]]), Be = {}, He = {
|
|
|
102
102
|
"stroke-linecap": "round",
|
|
103
103
|
"stroke-linejoin": "round"
|
|
104
104
|
};
|
|
105
|
-
function
|
|
106
|
-
return u(), C("svg",
|
|
107
|
-
|
|
105
|
+
function He(s, e) {
|
|
106
|
+
return u(), C("svg", Be, [...e[0] || (e[0] = [
|
|
107
|
+
Q('<rect width="18" height="18" x="3" y="3" rx="2"></rect><path d="M3 9h18"></path><path d="M3 15h18"></path><path d="M9 3v18"></path><path d="M15 3v18"></path>', 5)
|
|
108
108
|
])]);
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const Ue = /* @__PURE__ */ W(Ne, [["render", He]]), Ae = { class: "grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6 pb-6" }, Fe = { class: "flex items-center gap-2 space-y-1.5 p-6 border-b border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 dark:from-slate-800 to-white dark:to-slate-800" }, Le = { class: "line-clamp-1 tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 vertical-center" }, Pe = { class: "w-full flex flex-col gap-2 p-6" }, Ge = ["title"], Oe = { class: "flex items-center justify-between gap-2" }, Re = { class: "text-sm text-slate-600 dark:text-slate-400" }, Qe = { class: "font-semibold text-slate-800 dark:text-slate-100" }, qe = { class: "flex items-center justify-between gap-2" }, ze = { class: "text-sm text-slate-500 dark:text-slate-400" }, Ke = { class: "font-semibold text-slate-800 dark:text-slate-100" }, We = { class: "flex items-center justify-between gap-2" }, Xe = { class: "text-sm text-slate-500 dark:text-slate-400" }, Je = { class: "text-sm text-slate-600 dark:text-slate-300" }, Ye = { class: "flex items-center justify-between gap-2 mt-6" }, Ze = ["onClick"], et = { class: "text-slate-800 dark:text-slate-200 group-hover:text-green-600 dark:group-hover:text-blue-50" }, tt = ["onClick"], st = ["onClick"], ot = /* @__PURE__ */ q({
|
|
111
111
|
__name: "CollectionsGrid",
|
|
112
112
|
props: {
|
|
113
113
|
collections: {},
|
|
@@ -116,9 +116,9 @@ const Ae = /* @__PURE__ */ X(Be, [["render", Ue]]), Fe = { class: "grid grid-col
|
|
|
116
116
|
onDelete: { type: Function }
|
|
117
117
|
},
|
|
118
118
|
emits: ["edit", "view", "delete"],
|
|
119
|
-
setup(
|
|
120
|
-
|
|
121
|
-
const r =
|
|
119
|
+
setup(s, { emit: e }) {
|
|
120
|
+
m(!1), m(null);
|
|
121
|
+
const r = s, n = e, h = (a, g) => {
|
|
122
122
|
switch (a) {
|
|
123
123
|
case "edit":
|
|
124
124
|
n("edit", g), r.onEdit && r.onEdit(g);
|
|
@@ -130,101 +130,101 @@ const Ae = /* @__PURE__ */ X(Be, [["render", Ue]]), Fe = { class: "grid grid-col
|
|
|
130
130
|
n("delete", g), r.onDelete && r.onDelete(g);
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
133
|
-
}, b = (a) => {
|
|
134
|
-
const g = /* @__PURE__ */ new Date(), s = new Date(a), y = g.getTime() - s.getTime(), m = Math.floor(y / 1e3), d = Math.floor(m / 60), k = Math.floor(d / 60), v = Math.floor(k / 24), V = Math.floor(v / 7);
|
|
135
|
-
return V >= 2 ? `${V} weeks ago` : V === 1 ? "1 week ago" : v >= 2 ? `${v} days ago` : v === 1 ? "1 day ago" : k >= 2 ? `${k} hours ago` : k === 1 ? "1 hour ago" : d >= 2 ? `${d} minutes ago` : d === 1 ? "1 minute ago" : "just now";
|
|
136
133
|
}, x = (a) => {
|
|
134
|
+
const g = /* @__PURE__ */ new Date(), o = new Date(a), k = g.getTime() - o.getTime(), b = Math.floor(k / 1e3), d = Math.floor(b / 60), p = Math.floor(d / 60), y = Math.floor(p / 24), j = Math.floor(y / 7);
|
|
135
|
+
return j >= 2 ? `${j} weeks ago` : j === 1 ? "1 week ago" : y >= 2 ? `${y} days ago` : y === 1 ? "1 day ago" : p >= 2 ? `${p} hours ago` : p === 1 ? "1 hour ago" : d >= 2 ? `${d} minutes ago` : d === 1 ? "1 minute ago" : "just now";
|
|
136
|
+
}, v = (a) => {
|
|
137
137
|
switch (a) {
|
|
138
138
|
case "published":
|
|
139
139
|
return {
|
|
140
|
-
icon:
|
|
140
|
+
icon: be,
|
|
141
141
|
text: "Published",
|
|
142
142
|
classes: "bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-200 border-green-200 dark:border-green-700"
|
|
143
143
|
};
|
|
144
144
|
case "draft":
|
|
145
145
|
return {
|
|
146
|
-
icon:
|
|
146
|
+
icon: P,
|
|
147
147
|
text: "Draft",
|
|
148
148
|
classes: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"
|
|
149
149
|
};
|
|
150
150
|
case "archived":
|
|
151
151
|
return {
|
|
152
|
-
icon:
|
|
152
|
+
icon: me,
|
|
153
153
|
text: "Archived",
|
|
154
154
|
classes: "bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300 border-gray-200 dark:border-gray-700"
|
|
155
155
|
};
|
|
156
156
|
default:
|
|
157
157
|
return {
|
|
158
|
-
icon:
|
|
158
|
+
icon: K,
|
|
159
159
|
text: "--",
|
|
160
160
|
classes: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-200 border-yellow-200 dark:border-yellow-700"
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
|
-
return (a, g) => (u(), C("div",
|
|
165
|
-
(u(!0), C(se, null,
|
|
166
|
-
var
|
|
164
|
+
return (a, g) => (u(), C("div", Ae, [
|
|
165
|
+
(u(!0), C(se, null, oe(s.collections, (o) => {
|
|
166
|
+
var k, b, d;
|
|
167
167
|
return u(), C("div", {
|
|
168
|
-
key:
|
|
168
|
+
key: o.id,
|
|
169
169
|
class: "rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:bg-slate-50"
|
|
170
170
|
}, [
|
|
171
|
-
t("div",
|
|
172
|
-
|
|
171
|
+
t("div", Fe, [
|
|
172
|
+
o.type === "single" ? (u(), V(i(fe), {
|
|
173
173
|
key: 0,
|
|
174
174
|
class: "shrink-0 lucide lucide-page w-5 h-5 text-blue-600"
|
|
175
|
-
})) : (u(),
|
|
175
|
+
})) : (u(), V(i(H), {
|
|
176
176
|
key: 1,
|
|
177
177
|
class: "shrink-0 lucide lucide-layers w-5 h-5 text-blue-600"
|
|
178
178
|
})),
|
|
179
|
-
t("p",
|
|
180
|
-
|
|
179
|
+
t("p", Le, f(o.title), 1),
|
|
180
|
+
v(o.status) ? (u(), C("div", {
|
|
181
181
|
key: 2,
|
|
182
|
-
class: E(["whitespace-nowrap rounded-md border ml-auto 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", (
|
|
182
|
+
class: E(["whitespace-nowrap rounded-md border ml-auto 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", (k = v(o.status)) == null ? void 0 : k.classes])
|
|
183
183
|
}, [
|
|
184
|
-
(u(),
|
|
185
|
-
|
|
184
|
+
(u(), V(ne((b = v(o.status)) == null ? void 0 : b.icon), { class: "w-3 h-3 mr-1" })),
|
|
185
|
+
re(" " + f((d = v(o.status)) == null ? void 0 : d.text), 1)
|
|
186
186
|
], 2)) : T("", !0)
|
|
187
187
|
]),
|
|
188
|
-
t("div",
|
|
188
|
+
t("div", Pe, [
|
|
189
189
|
t("p", {
|
|
190
190
|
class: "text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",
|
|
191
|
-
title:
|
|
192
|
-
},
|
|
193
|
-
t("div",
|
|
194
|
-
t("p",
|
|
195
|
-
t("p",
|
|
191
|
+
title: o.description
|
|
192
|
+
}, f(o.description !== null ? o.description : "No description"), 9, Ge),
|
|
193
|
+
t("div", Oe, [
|
|
194
|
+
t("p", Re, f(a.$t("cms.collections.entries")) + ":", 1),
|
|
195
|
+
t("p", Qe, f(o.entries), 1)
|
|
196
196
|
]),
|
|
197
|
-
t("div",
|
|
198
|
-
t("p",
|
|
199
|
-
t("p",
|
|
197
|
+
t("div", qe, [
|
|
198
|
+
t("p", ze, f(a.$t("cms.collections.fields")) + ":", 1),
|
|
199
|
+
t("p", Ke, f(o.fields), 1)
|
|
200
200
|
]),
|
|
201
|
-
t("div",
|
|
202
|
-
t("p",
|
|
203
|
-
t("p",
|
|
201
|
+
t("div", We, [
|
|
202
|
+
t("p", Xe, f(a.$t("cms.collections.lastModified")) + ":", 1),
|
|
203
|
+
t("p", Je, f(x(o.last_edit)), 1)
|
|
204
204
|
]),
|
|
205
|
-
t("div",
|
|
206
|
-
|
|
207
|
-
collection:
|
|
205
|
+
t("div", Ye, [
|
|
206
|
+
le(a.$slots, "actions", {
|
|
207
|
+
collection: o,
|
|
208
208
|
handleAction: h
|
|
209
209
|
}, () => [
|
|
210
210
|
t("button", {
|
|
211
211
|
class: "inline-flex gap-1 items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-4/5 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-green-50 hover:border-green-300",
|
|
212
|
-
onClick: N((
|
|
212
|
+
onClick: N((p) => h("edit", o), ["stop"])
|
|
213
213
|
}, [
|
|
214
|
-
w(i(
|
|
215
|
-
t("span",
|
|
216
|
-
], 8,
|
|
214
|
+
w(i(P), { class: "text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-green-600 dark:group-hover:text-blue-50" }),
|
|
215
|
+
t("span", et, f(a.$t("cms.common.actions.edit")), 1)
|
|
216
|
+
], 8, Ze),
|
|
217
217
|
t("button", {
|
|
218
|
-
class: E([
|
|
219
|
-
onClick: N((
|
|
218
|
+
class: E([o.id === "pages" ? "disabled" : "", "inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-red-50 hover:border-red-300"]),
|
|
219
|
+
onClick: N((p) => o.id === "pages" ? null : h("delete", o), ["stop"])
|
|
220
220
|
}, [
|
|
221
|
-
w(i(
|
|
222
|
-
], 10,
|
|
221
|
+
w(i(ge), { class: "text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-red-600 dark:group-hover:text-blue-50" })
|
|
222
|
+
], 10, tt),
|
|
223
223
|
t("button", {
|
|
224
|
-
class: E([
|
|
225
|
-
onClick: N((
|
|
224
|
+
class: E([o.type === "single" ? "disabled cursor-not-allowed" : "", "inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300"]),
|
|
225
|
+
onClick: N((p) => o.type === "single" ? null : h("view", o), ["stop"])
|
|
226
226
|
}, [
|
|
227
|
-
w(i(
|
|
227
|
+
w(i(z), { class: "text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50" })
|
|
228
228
|
], 10, st)
|
|
229
229
|
])
|
|
230
230
|
])
|
|
@@ -233,23 +233,23 @@ const Ae = /* @__PURE__ */ X(Be, [["render", Ue]]), Fe = { class: "grid grid-col
|
|
|
233
233
|
}), 128))
|
|
234
234
|
]));
|
|
235
235
|
}
|
|
236
|
-
}), B = localStorage.getItem("collectionView"), S =
|
|
237
|
-
M(S, (
|
|
238
|
-
localStorage.setItem("collectionView",
|
|
236
|
+
}), B = localStorage.getItem("collectionView"), S = m(B === "list" || B === "grid" ? B : "list");
|
|
237
|
+
M(S, (s) => {
|
|
238
|
+
localStorage.setItem("collectionView", s);
|
|
239
239
|
});
|
|
240
|
-
function
|
|
240
|
+
function rt() {
|
|
241
241
|
S.value = S.value === "grid" ? "list" : "grid";
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function nt() {
|
|
244
244
|
return {
|
|
245
245
|
collectionView: S,
|
|
246
|
-
toggleCollectionView:
|
|
246
|
+
toggleCollectionView: rt
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
const
|
|
249
|
+
const lt = { class: "space-y-6 max-w-7xl mx-auto" }, at = { class: "flex items-center justify-between mb-8" }, it = { class: "flex gap-4" }, dt = { class: "text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2" }, ct = { class: "text-slate-600 dark:text-slate-300" }, ut = ["href", "title"], ht = { class: "flex items-center gap-3" }, pt = { class: "relative" }, ft = { class: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none" }, gt = ["placeholder"], mt = { class: "flex items-center bg-white dark:bg-slate-700 border border-slate-200 dark:border-slate-600 rounded-lg p-1 max-w-[fit-content]" }, bt = ["onClick"], Vt = /* @__PURE__ */ q({
|
|
250
250
|
__name: "BuilderPage",
|
|
251
|
-
setup(
|
|
252
|
-
const { t: e, locale: r } =
|
|
251
|
+
setup(s) {
|
|
252
|
+
const { t: e, locale: r } = ve(), n = pe(), h = [
|
|
253
253
|
{ name: "name", title: e("cms.builder.collectionName"), type: "text", icon: H },
|
|
254
254
|
{ name: "title", title: e("cms.builder.title"), type: "text", icon: H },
|
|
255
255
|
{ name: "description", title: e("cms.common.description"), type: "text" },
|
|
@@ -257,48 +257,48 @@ const at = { class: "space-y-6 max-w-7xl mx-auto" }, it = { class: "flex items-c
|
|
|
257
257
|
{ name: "fields", title: e("cms.builder.fields"), type: "number" },
|
|
258
258
|
{ name: "status", title: e("cms.builder.status"), type: "text" },
|
|
259
259
|
{ name: "last_edit", title: e("cms.builder.lastModified"), type: "date" }
|
|
260
|
-
],
|
|
261
|
-
|
|
260
|
+
], x = m(""), v = Ee(x, 300);
|
|
261
|
+
Ve({
|
|
262
262
|
title: () => e("cms.collections.title") + " | CMS"
|
|
263
263
|
});
|
|
264
|
-
const a =
|
|
265
|
-
async function
|
|
264
|
+
const a = m([]), g = R("fetchContentTypes"), o = m(1), k = m(16), b = m(null), { collectionView: d } = nt();
|
|
265
|
+
async function p() {
|
|
266
266
|
try {
|
|
267
|
-
const l =
|
|
267
|
+
const l = v.value ? `&search=${encodeURIComponent(String(v.value))}` : "", c = `/api/cms-type?page=${o.value}&limit=${k.value}${l}`, _ = await fetch(c);
|
|
268
268
|
if (!_.ok)
|
|
269
269
|
throw new Error("Failed to fetch collections");
|
|
270
270
|
const D = await _.json();
|
|
271
|
-
a.value = D.rows,
|
|
271
|
+
a.value = D.rows, b.value = D;
|
|
272
272
|
} catch (l) {
|
|
273
273
|
console.error("Error fetching collections:", l);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
ae(() => {
|
|
277
|
+
p();
|
|
278
278
|
});
|
|
279
|
-
const
|
|
279
|
+
const y = ie(() => [...a.value].sort((c, _) => c.id === "pages" ? -1 : _.id === "pages" ? 1 : 0)), j = async (l) => {
|
|
280
280
|
try {
|
|
281
|
-
await fetch(`/api/cms-type/${l.id}`, { method: "DELETE" }),
|
|
281
|
+
await fetch(`/api/cms-type/${l.id}`, { method: "DELETE" }), p(), g();
|
|
282
282
|
} catch (c) {
|
|
283
283
|
console.error("Error deleting collection:", c);
|
|
284
284
|
}
|
|
285
|
-
},
|
|
285
|
+
}, A = (l) => {
|
|
286
286
|
n.push(`/settings/collections/edit/${l.id || l.name}`);
|
|
287
287
|
}, I = (l) => {
|
|
288
288
|
l.type === "single" ? n.push(`/collections/single/${l.name}`) : n.push(`/collections/${l.name}`);
|
|
289
289
|
};
|
|
290
|
-
return M(
|
|
291
|
-
|
|
292
|
-
}), M(
|
|
293
|
-
console.log("Search query changed:", l),
|
|
290
|
+
return M(o, () => {
|
|
291
|
+
p();
|
|
292
|
+
}), M(v, (l) => {
|
|
293
|
+
console.log("Search query changed:", l), o.value = 1, p();
|
|
294
294
|
}), (l, c) => {
|
|
295
|
-
var _, D,
|
|
296
|
-
return u(), C("div",
|
|
297
|
-
t("div",
|
|
298
|
-
t("div",
|
|
295
|
+
var _, D, F, L;
|
|
296
|
+
return u(), C("div", lt, [
|
|
297
|
+
t("div", at, [
|
|
298
|
+
t("div", it, [
|
|
299
299
|
t("div", null, [
|
|
300
|
-
t("h1",
|
|
301
|
-
t("p",
|
|
300
|
+
t("h1", dt, f(l.$t("cms.builder.collections")), 1),
|
|
301
|
+
t("p", ct, f(l.$t("cms.builder.manageContentCollections")), 1)
|
|
302
302
|
]),
|
|
303
303
|
t("a", {
|
|
304
304
|
href: `https://cms.opengis.info/${i(r)}/guides/collections/`,
|
|
@@ -306,75 +306,75 @@ const at = { class: "space-y-6 max-w-7xl mx-auto" }, it = { class: "flex items-c
|
|
|
306
306
|
title: l.$t("cms.guide.collections"),
|
|
307
307
|
class: "mt-2"
|
|
308
308
|
}, [
|
|
309
|
-
w(i(
|
|
310
|
-
], 8,
|
|
309
|
+
w(i(K), { class: "w-5 h-5" })
|
|
310
|
+
], 8, ut)
|
|
311
311
|
]),
|
|
312
|
-
t("div",
|
|
313
|
-
t("div",
|
|
312
|
+
t("div", ht, [
|
|
313
|
+
t("div", pt, [
|
|
314
314
|
t("div", ft, [
|
|
315
|
-
w(i(
|
|
315
|
+
w(i(xe), { class: "w-5 h-5 text-gray-400" })
|
|
316
316
|
]),
|
|
317
|
-
|
|
317
|
+
de(t("input", {
|
|
318
318
|
type: "text",
|
|
319
319
|
class: "block w-full py-2 pl-10 pr-3 leading-5 text-gray-900 placeholder-gray-500 transition-colors bg-white border border-gray-300 rounded-md dark:border-gray-600 dark:bg-gray-700 dark:placeholder-gray-400 focus:outline-none focus:ring-sky-500 focus:border-sky-500 dark:text-white sm:text-sm",
|
|
320
320
|
placeholder: l.$t("cms.builder.searchCollections"),
|
|
321
|
-
"onUpdate:modelValue": c[0] || (c[0] = ($) =>
|
|
322
|
-
}, null, 8,
|
|
323
|
-
[
|
|
321
|
+
"onUpdate:modelValue": c[0] || (c[0] = ($) => x.value = $)
|
|
322
|
+
}, null, 8, gt), [
|
|
323
|
+
[ce, x.value]
|
|
324
324
|
])
|
|
325
325
|
]),
|
|
326
|
-
t("div",
|
|
326
|
+
t("div", mt, [
|
|
327
327
|
t("button", {
|
|
328
328
|
class: E(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer", { "bg-blue-600 text-white": i(d) === "list" }]),
|
|
329
329
|
onClick: c[1] || (c[1] = ($) => d.value = "list")
|
|
330
330
|
}, [
|
|
331
|
-
w(
|
|
331
|
+
w(Ie, { class: "dark:text-blue-50 w-4 h-4" })
|
|
332
332
|
], 2),
|
|
333
333
|
t("button", {
|
|
334
334
|
class: E(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors rounded-md text-xs h-8 w-8 p-0 hover:bg-blue-700 hover:text-white cursor-pointer", { "bg-blue-600 text-white": i(d) === "grid" }]),
|
|
335
335
|
onClick: c[2] || (c[2] = ($) => d.value = "grid")
|
|
336
336
|
}, [
|
|
337
|
-
w(
|
|
337
|
+
w(Ue, { class: "dark:text-blue-50 w-4 h-4" })
|
|
338
338
|
], 2)
|
|
339
339
|
]),
|
|
340
|
-
w(
|
|
340
|
+
w(he)
|
|
341
341
|
])
|
|
342
342
|
]),
|
|
343
343
|
t("div", null, [
|
|
344
|
-
i(d) === "list" ? (u(),
|
|
344
|
+
i(d) === "list" ? (u(), V(we, {
|
|
345
345
|
key: 0,
|
|
346
346
|
class: "max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden",
|
|
347
347
|
columns: h,
|
|
348
|
-
rows:
|
|
349
|
-
onDelete:
|
|
350
|
-
onEdit:
|
|
348
|
+
rows: y.value,
|
|
349
|
+
onDelete: j,
|
|
350
|
+
onEdit: A,
|
|
351
351
|
onView: I
|
|
352
352
|
}, {
|
|
353
|
-
actions:
|
|
353
|
+
actions: ue(({ row: $ }) => [
|
|
354
354
|
t("button", {
|
|
355
355
|
class: "inline-flex items-center justify-center whitespace-nowrap font-medium border rounded-md text-xs h-8 w-8 p-0 border-slate-300 bg-white transition-all duration-200 shadow-sm group dark:border-slate-600 dark:bg-slate-700 dark:hover:bg-slate-600 dark:hover:border-slate-500 dark:hover:text-slate-200 hover:bg-blue-50 hover:border-blue-300 hover:text-blue-600",
|
|
356
|
-
onClick: (
|
|
356
|
+
onClick: (xt) => I($)
|
|
357
357
|
}, [
|
|
358
|
-
w(i(
|
|
359
|
-
], 8,
|
|
358
|
+
w(i(z), { class: "text-slate-800 dark:text-slate-200 w-4 h-4 group-hover:text-blue-600 dark:group-hover:text-blue-50" })
|
|
359
|
+
], 8, bt)
|
|
360
360
|
]),
|
|
361
361
|
_: 1
|
|
362
362
|
}, 8, ["rows"])) : T("", !0),
|
|
363
|
-
i(d) === "grid" ? (u(),
|
|
363
|
+
i(d) === "grid" ? (u(), V(ot, {
|
|
364
364
|
key: 1,
|
|
365
|
-
collections:
|
|
366
|
-
onEdit:
|
|
365
|
+
collections: y.value,
|
|
366
|
+
onEdit: A,
|
|
367
367
|
onView: I,
|
|
368
|
-
onDelete:
|
|
368
|
+
onDelete: j,
|
|
369
369
|
class: "max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden"
|
|
370
370
|
}, null, 8, ["collections"])) : T("", !0),
|
|
371
|
-
((_ =
|
|
371
|
+
((_ = b.value) == null ? void 0 : _.total) > 16 ? (u(), V(ke, {
|
|
372
372
|
key: 2,
|
|
373
|
-
total: (D =
|
|
374
|
-
count: ((
|
|
375
|
-
page:
|
|
376
|
-
"onUpdate:page": c[3] || (c[3] = ($) =>
|
|
377
|
-
limit:
|
|
373
|
+
total: (D = b.value) == null ? void 0 : D.filtered,
|
|
374
|
+
count: ((F = b.value) == null ? void 0 : F.count) || ((L = b.value) == null ? void 0 : L.total),
|
|
375
|
+
page: o.value,
|
|
376
|
+
"onUpdate:page": c[3] || (c[3] = ($) => o.value = $),
|
|
377
|
+
limit: k.value
|
|
378
378
|
}, null, 8, ["total", "count", "page", "limit"])) : T("", !0)
|
|
379
379
|
])
|
|
380
380
|
]);
|
|
@@ -382,5 +382,5 @@ const at = { class: "space-y-6 max-w-7xl mx-auto" }, it = { class: "flex items-c
|
|
|
382
382
|
}
|
|
383
383
|
});
|
|
384
384
|
export {
|
|
385
|
-
|
|
385
|
+
Vt as default
|
|
386
386
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as b,
|
|
1
|
+
import { defineComponent as b, createElementBlock as t, openBlock as e, createElementVNode as l, createBlock as m, createCommentVNode as d, createVNode as h, unref as r, toDisplayString as i, Fragment as u, renderList as k } from "vue";
|
|
2
2
|
import { Layers as p, ChevronRight as x } from "lucide-vue-next";
|
|
3
3
|
const g = { class: "flex items-center space-x-1 mb-4 overflow-hidden" }, f = { class: "truncate block max-w-[12rem]" }, w = ["onClick"], v = { class: "truncate block max-w-[20rem]" }, y = {
|
|
4
4
|
key: 1,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as w, inject as b, ref as p, computed as k, onMounted as C,
|
|
1
|
+
import { defineComponent as w, inject as b, ref as p, computed as k, onMounted as C, createElementBlock as n, openBlock as r, createElementVNode as e, toDisplayString as a, unref as i, createVNode as c, withDirectives as $, vModelText as j, Fragment as B, renderList as E, createBlock as m } from "vue";
|
|
2
2
|
import { useRouter as L } from "vue-router";
|
|
3
3
|
import { HelpCircle as V, Search as F, File as A, Layers as D, ChevronRight as M } from "lucide-vue-next";
|
|
4
4
|
import { useI18n as N } from "vue-i18n";
|
|
5
|
-
import { _ as R } from "./EmptyData-
|
|
6
|
-
import { _ as S } from "./CreateForm-
|
|
5
|
+
import { _ as R } from "./EmptyData-BSW20VKP.js";
|
|
6
|
+
import { _ as S } from "./CreateForm-B0srHu5e.js";
|
|
7
7
|
const T = { class: "space-y-6 mx-auto max-w-[90%]" }, q = { class: "flex items-center justify-between mb-8" }, H = { class: "flex gap-4" }, I = { class: "text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2" }, P = { class: "text-slate-600 dark:text-slate-300" }, Q = ["href", "title"], U = { class: "flex items-center gap-3" }, z = { class: "relative w-full max-w-sm" }, G = { class: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none" }, J = ["placeholder"], K = { key: 0 }, O = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6" }, W = ["onClick"], X = { class: "flex items-start justify-between" }, Y = { class: "flex items-start gap-3" }, Z = { class: "text-sm font-semibold text-gray-800 mb-1" }, ee = { class: "flex items-center gap-2" }, te = { class: "text-xs text-gray-500 whitespace-nowrap" }, se = { class: "pl-8 text-xs text-gray-600 line-clamp-2" }, oe = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "flex items-center justify-center min-h-[400px]"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { inject as T, defineAsyncComponent as V, ref as a,
|
|
1
|
+
import { inject as T, defineAsyncComponent as V, ref as a, createElementBlock as $, openBlock as k, createElementVNode as n, createVNode as m, createTextVNode as q, unref as d, toDisplayString as u, withCtx as f } from "vue";
|
|
2
2
|
import { Plus as j } from "lucide-vue-next";
|
|
3
3
|
import { useRouter as F } from "vue-router";
|
|
4
4
|
import { useI18n as N } from "vue-i18n";
|
|
@@ -80,7 +80,7 @@ const O = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, D =
|
|
|
80
80
|
}), console.error(o);
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
|
-
return (l, t) => (
|
|
83
|
+
return (l, t) => (k(), $("div", null, [
|
|
84
84
|
n("button", {
|
|
85
85
|
onClick: t[0] || (t[0] = (o) => s.value = !0),
|
|
86
86
|
class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"
|