@opengis/cms 0.0.52 → 0.0.54
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-Cddv2qte.js → ArticlesPage-Cuit_90w.js} +5 -5
- package/dist/{BuilderPage-BgcBJcw7.js → BuilderPage-B79YHrmr.js} +139 -139
- package/dist/{CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-C-k8QGA-.js → CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-B6irHMzL.js} +19 -19
- package/dist/{CollectionsPage-d5MLIIAG.js → CollectionsPage-JfmrHNR_.js} +3 -3
- package/dist/{CreateForm-B0srHu5e.js → CreateForm-BMOBeP4G.js} +2 -2
- package/dist/{EditCollectionPage-NUVatLkY.js → EditCollectionPage-CAVLcvLg.js} +5 -5
- package/dist/{EmptyData-BSW20VKP.js → EmptyData-DaZt_nAm.js} +5 -5
- package/dist/{MenuAddPage-Cn3JN04F.js → MenuAddPage-CmU4kAUM.js} +3 -3
- package/dist/{MenuItemPage-B0Th9EOe.js → MenuItemPage-UV8JlJvT.js} +60 -60
- package/dist/{MenuPage-DQpD3IXx.js → MenuPage-c4TPJgIN.js} +4 -4
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js +84 -0
- package/dist/{UniversalTable.vue_vue_type_script_setup_true_lang-DW6O-xoY.js → UniversalTable.vue_vue_type_script_setup_true_lang-DR4PQwqR.js} +78 -78
- package/dist/{UniversalTablePagination.vue_vue_type_script_setup_true_lang-DBIPBmpm.js → UniversalTablePagination.vue_vue_type_script_setup_true_lang-C8P9DCeX.js} +46 -46
- package/dist/{contentForm-C4Jp-FbQ.js → contentForm-BQdeYVFh.js} +3 -3
- package/dist/{getField-CKcz_b0t.js → getField-Y5WXnRR0.js} +632 -631
- package/dist/index.js +10 -10
- package/dist/style.css +1 -1
- package/dist/{vuedraggable-mqqAYsch.js → vuedraggable-CoAPPFYd.js} +107 -107
- package/package.json +67 -67
- package/server/functions/getTags.js +30 -0
- package/server/routes/cms/controllers/listMedia.js +5 -1
- package/server/routes/cms/controllers/translate.js +3 -3
- package/server/routes/cms/utils/insertContentLocalization.js +22 -4
- package/server/routes/contentType/controllers/getContentType.js +9 -2
- package/server/routes/tags/controllers/get.tags.js +1 -1
- package/utils.js +1 -0
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-CTKNG0qR.js +0 -84
|
@@ -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, openBlock as i, createElementBlock as d, createVNode as _, createElementVNode as r, toDisplayString as h, unref as b, createTextVNode as le, createCommentVNode as f, 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-DR4PQwqR.js";
|
|
5
|
+
import { _ as fe } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-C8P9DCeX.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-DaZt_nAm.js";
|
|
11
|
+
import { _ as ye } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-B6irHMzL.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,23 +1,23 @@
|
|
|
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 { version as J, unref as i, inject as Q, ref as f, watchEffect as Y, watch as M, getCurrentInstance as Z, onBeforeUnmount as ee, onDeactivated as te, onActivated as oe, openBlock as u, createElementBlock as C, createStaticVNode as q, defineComponent as z, Fragment as se, renderList as re, createElementVNode as t, createBlock as j, toDisplayString as p, normalizeClass as E, resolveDynamicComponent as ne, createTextVNode as le, createCommentVNode as T, renderSlot as ae, withModifiers as N, createVNode as w, onMounted as ie, computed as de, withDirectives as ce, vModelText as ue, withCtx as he } from "vue";
|
|
2
|
+
import { _ as pe } from "./CreateForm-BMOBeP4G.js";
|
|
3
|
+
import { useRouter as ge } from "vue-router";
|
|
4
|
+
import { File as fe, Layers as H, Edit as G, Trash2 as me, List as K, HelpCircle as W, XCircle as be, CheckCircle as xe, Search as ve } from "lucide-vue-next";
|
|
5
|
+
import { useI18n as we } from "vue-i18n";
|
|
6
|
+
import { _ as ke } from "./UniversalTable.vue_vue_type_script_setup_true_lang-DR4PQwqR.js";
|
|
7
|
+
import { _ as ye } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-C8P9DCeX.js";
|
|
8
|
+
import { _ as X } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
let _e;
|
|
10
|
+
function $e() {
|
|
11
|
+
return _e;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
function
|
|
13
|
+
J[0];
|
|
14
|
+
function Ce(s) {
|
|
15
15
|
return typeof s == "function" ? s() : i(s);
|
|
16
16
|
}
|
|
17
17
|
function U(s) {
|
|
18
18
|
if (s instanceof Promise || s instanceof Date || s instanceof RegExp)
|
|
19
19
|
return s;
|
|
20
|
-
const e =
|
|
20
|
+
const e = Ce(s);
|
|
21
21
|
if (!s || !e)
|
|
22
22
|
return e;
|
|
23
23
|
if (Array.isArray(e))
|
|
@@ -36,36 +36,36 @@ function U(s) {
|
|
|
36
36
|
}
|
|
37
37
|
return e;
|
|
38
38
|
}
|
|
39
|
-
const
|
|
39
|
+
const Ve = "usehead", O = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, R = "__unhead_injection_handler__";
|
|
40
40
|
function je() {
|
|
41
|
-
if (
|
|
42
|
-
return
|
|
43
|
-
const s =
|
|
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 ||
|
|
41
|
+
if (R in O)
|
|
42
|
+
return O[R]();
|
|
43
|
+
const s = Q(Ve);
|
|
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 De(s, e = {}) {
|
|
47
47
|
const r = e.head || je();
|
|
48
48
|
if (r)
|
|
49
|
-
return r.ssr ? r.push(s, e) :
|
|
49
|
+
return r.ssr ? r.push(s, e) : Ee(r, s, e);
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
const n =
|
|
53
|
-
|
|
51
|
+
function Ee(s, e, r = {}) {
|
|
52
|
+
const n = f(!1), h = f({});
|
|
53
|
+
Y(() => {
|
|
54
54
|
h.value = n.value ? {} : U(e);
|
|
55
55
|
});
|
|
56
|
-
const
|
|
56
|
+
const b = s.push(h.value, r);
|
|
57
57
|
return M(h, (a) => {
|
|
58
|
-
|
|
59
|
-
}),
|
|
60
|
-
|
|
61
|
-
}), ee(() => {
|
|
62
|
-
n.value = !0;
|
|
58
|
+
b.patch(a);
|
|
59
|
+
}), Z() && (ee(() => {
|
|
60
|
+
b.dispose();
|
|
63
61
|
}), te(() => {
|
|
62
|
+
n.value = !0;
|
|
63
|
+
}), oe(() => {
|
|
64
64
|
n.value = !1;
|
|
65
|
-
})),
|
|
65
|
+
})), b;
|
|
66
66
|
}
|
|
67
|
-
function
|
|
68
|
-
const r =
|
|
67
|
+
function Me(s, e = 300) {
|
|
68
|
+
const r = f(s.value);
|
|
69
69
|
let n;
|
|
70
70
|
return M(
|
|
71
71
|
s,
|
|
@@ -77,7 +77,7 @@ function Ee(s, e = 300) {
|
|
|
77
77
|
{ immediate: !0 }
|
|
78
78
|
), r;
|
|
79
79
|
}
|
|
80
|
-
const
|
|
80
|
+
const Te = {}, Se = {
|
|
81
81
|
xmlns: "http://www.w3.org/2000/svg",
|
|
82
82
|
width: "24",
|
|
83
83
|
height: "24",
|
|
@@ -88,12 +88,12 @@ const Me = {}, Te = {
|
|
|
88
88
|
"stroke-linecap": "round",
|
|
89
89
|
"stroke-linejoin": "round"
|
|
90
90
|
};
|
|
91
|
-
function
|
|
92
|
-
return u(), C("svg",
|
|
93
|
-
|
|
91
|
+
function Ie(s, e) {
|
|
92
|
+
return u(), C("svg", Se, [...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 Ne = /* @__PURE__ */ X(Te, [["render", Ie]]), Be = {}, He = {
|
|
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 Ie = /* @__PURE__ */ W(Me, [["render", Se]]), Ne = {}, Be = {
|
|
|
102
102
|
"stroke-linecap": "round",
|
|
103
103
|
"stroke-linejoin": "round"
|
|
104
104
|
};
|
|
105
|
-
function
|
|
106
|
-
return u(), C("svg",
|
|
107
|
-
|
|
105
|
+
function Ue(s, e) {
|
|
106
|
+
return u(), C("svg", He, [...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 Ae = /* @__PURE__ */ X(Be, [["render", Ue]]), Fe = { class: "grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-6 pb-6" }, Le = { 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" }, Pe = { class: "line-clamp-1 tracking-tight text-lg font-semibold text-slate-800 dark:text-slate-100 vertical-center" }, Ge = { class: "w-full flex flex-col gap-2 p-6" }, Oe = ["title"], Re = { class: "flex items-center justify-between gap-2" }, Qe = { class: "text-sm text-slate-600 dark:text-slate-400" }, qe = { class: "font-semibold text-slate-800 dark:text-slate-100" }, ze = { class: "flex items-center justify-between gap-2" }, Ke = { class: "text-sm text-slate-500 dark:text-slate-400" }, We = { class: "font-semibold text-slate-800 dark:text-slate-100" }, Xe = { class: "flex items-center justify-between gap-2" }, Je = { class: "text-sm text-slate-500 dark:text-slate-400" }, Ye = { class: "text-sm text-slate-600 dark:text-slate-300" }, Ze = { class: "flex items-center justify-between gap-2 mt-6" }, et = ["onClick"], tt = { class: "text-slate-800 dark:text-slate-200 group-hover:text-green-600 dark:group-hover:text-blue-50" }, ot = ["onClick"], st = ["onClick"], rt = /* @__PURE__ */ z({
|
|
111
111
|
__name: "CollectionsGrid",
|
|
112
112
|
props: {
|
|
113
113
|
collections: {},
|
|
@@ -117,7 +117,7 @@ const Ue = /* @__PURE__ */ W(Ne, [["render", He]]), Ae = { class: "grid grid-col
|
|
|
117
117
|
},
|
|
118
118
|
emits: ["edit", "view", "delete"],
|
|
119
119
|
setup(s, { emit: e }) {
|
|
120
|
-
|
|
120
|
+
f(!1), f(null);
|
|
121
121
|
const r = s, n = e, h = (a, g) => {
|
|
122
122
|
switch (a) {
|
|
123
123
|
case "edit":
|
|
@@ -130,101 +130,101 @@ const Ue = /* @__PURE__ */ W(Ne, [["render", He]]), Ae = { 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(), o = new Date(a), y = g.getTime() - o.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";
|
|
133
136
|
}, 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: xe,
|
|
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: G,
|
|
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: be,
|
|
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: W,
|
|
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", Fe, [
|
|
165
|
+
(u(!0), C(se, null, re(a.collections, (o) => {
|
|
166
|
+
var y, m, d;
|
|
167
167
|
return u(), C("div", {
|
|
168
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
|
-
o.type === "single" ? (u(),
|
|
171
|
+
t("div", Le, [
|
|
172
|
+
o.type === "single" ? (u(), j(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(), j(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", Pe, p(o.title), 1),
|
|
180
|
+
x(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", (y = x(o.status)) == null ? void 0 : y.classes])
|
|
183
183
|
}, [
|
|
184
|
-
(u(),
|
|
185
|
-
|
|
184
|
+
(u(), j(ne((m = x(o.status)) == null ? void 0 : m.icon), { class: "w-3 h-3 mr-1" })),
|
|
185
|
+
le(" " + p((d = x(o.status)) == null ? void 0 : d.text), 1)
|
|
186
186
|
], 2)) : T("", !0)
|
|
187
187
|
]),
|
|
188
|
-
t("div",
|
|
188
|
+
t("div", Ge, [
|
|
189
189
|
t("p", {
|
|
190
190
|
class: "text-slate-600 dark:text-slate-300 mb-4 line-clamp-2",
|
|
191
191
|
title: o.description
|
|
192
|
-
},
|
|
193
|
-
t("div",
|
|
194
|
-
t("p",
|
|
195
|
-
t("p",
|
|
192
|
+
}, p(o.description !== null ? o.description : "No description"), 9, Oe),
|
|
193
|
+
t("div", Re, [
|
|
194
|
+
t("p", Qe, p(a.$t("cms.collections.entries")) + ":", 1),
|
|
195
|
+
t("p", qe, p(o.entries), 1)
|
|
196
196
|
]),
|
|
197
|
-
t("div",
|
|
198
|
-
t("p",
|
|
199
|
-
t("p",
|
|
197
|
+
t("div", ze, [
|
|
198
|
+
t("p", Ke, p(a.$t("cms.collections.fields")) + ":", 1),
|
|
199
|
+
t("p", We, p(o.fields), 1)
|
|
200
200
|
]),
|
|
201
|
-
t("div",
|
|
202
|
-
t("p",
|
|
203
|
-
t("p",
|
|
201
|
+
t("div", Xe, [
|
|
202
|
+
t("p", Je, p(a.$t("cms.collections.lastModified")) + ":", 1),
|
|
203
|
+
t("p", Ye, p(b(o.last_edit)), 1)
|
|
204
204
|
]),
|
|
205
|
-
t("div",
|
|
206
|
-
|
|
205
|
+
t("div", Ze, [
|
|
206
|
+
ae(a.$slots, "actions", {
|
|
207
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((k) => h("edit", o), ["stop"])
|
|
213
213
|
}, [
|
|
214
|
-
w(i(
|
|
215
|
-
t("span",
|
|
216
|
-
], 8,
|
|
214
|
+
w(i(G), { 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", tt, p(a.$t("cms.common.actions.edit")), 1)
|
|
216
|
+
], 8, et),
|
|
217
217
|
t("button", {
|
|
218
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((
|
|
219
|
+
onClick: N((k) => o.id === "pages" ? null : h("delete", o), ["stop"])
|
|
220
220
|
}, [
|
|
221
|
-
w(i(
|
|
222
|
-
], 10,
|
|
221
|
+
w(i(me), { 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, ot),
|
|
223
223
|
t("button", {
|
|
224
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((
|
|
225
|
+
onClick: N((k) => o.type === "single" ? null : h("view", o), ["stop"])
|
|
226
226
|
}, [
|
|
227
|
-
w(i(
|
|
227
|
+
w(i(K), { 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 Ue = /* @__PURE__ */ W(Ne, [["render", He]]), Ae = { class: "grid grid-col
|
|
|
233
233
|
}), 128))
|
|
234
234
|
]));
|
|
235
235
|
}
|
|
236
|
-
}), B = localStorage.getItem("collectionView"), S =
|
|
236
|
+
}), B = localStorage.getItem("collectionView"), S = f(B === "list" || B === "grid" ? B : "list");
|
|
237
237
|
M(S, (s) => {
|
|
238
238
|
localStorage.setItem("collectionView", s);
|
|
239
239
|
});
|
|
240
|
-
function
|
|
240
|
+
function nt() {
|
|
241
241
|
S.value = S.value === "grid" ? "list" : "grid";
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function lt() {
|
|
244
244
|
return {
|
|
245
245
|
collectionView: S,
|
|
246
|
-
toggleCollectionView:
|
|
246
|
+
toggleCollectionView: nt
|
|
247
247
|
};
|
|
248
248
|
}
|
|
249
|
-
const
|
|
249
|
+
const at = { class: "space-y-6 max-w-7xl mx-auto" }, it = { class: "flex items-center justify-between mb-8" }, dt = { class: "flex gap-4" }, ct = { class: "text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2" }, ut = { class: "text-slate-600 dark:text-slate-300" }, ht = ["href", "title"], pt = { class: "flex items-center gap-3" }, gt = { class: "relative" }, ft = { class: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none" }, mt = ["placeholder"], bt = { 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]" }, xt = ["onClick"], Dt = /* @__PURE__ */ z({
|
|
250
250
|
__name: "BuilderPage",
|
|
251
251
|
setup(s) {
|
|
252
|
-
const { t: e, locale: r } =
|
|
252
|
+
const { t: e, locale: r } = we(), n = ge(), 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 lt = { class: "space-y-6 max-w-7xl mx-auto" }, at = { 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
|
+
], b = f(""), x = Me(b, 300);
|
|
261
|
+
De({
|
|
262
262
|
title: () => e("cms.collections.title") + " | CMS"
|
|
263
263
|
});
|
|
264
|
-
const a =
|
|
265
|
-
async function
|
|
264
|
+
const a = f([]), g = Q("fetchContentTypes"), o = f(1), y = f(16), m = f(null), { collectionView: d, toggleCollectionView: k } = lt();
|
|
265
|
+
async function v() {
|
|
266
266
|
try {
|
|
267
|
-
const l =
|
|
267
|
+
const l = x.value ? `&search=${encodeURIComponent(String(x.value))}` : "", c = `/api/cms-type?page=${o.value}&limit=${y.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, m.value = D;
|
|
272
272
|
} catch (l) {
|
|
273
273
|
console.error("Error fetching collections:", l);
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
ie(() => {
|
|
277
|
+
v();
|
|
278
278
|
});
|
|
279
|
-
const
|
|
279
|
+
const V = de(() => [...a.value].sort((c, _) => c.id === "pages" ? -1 : _.id === "pages" ? 1 : 0)), A = 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" }), v(), g();
|
|
282
282
|
} catch (c) {
|
|
283
283
|
console.error("Error deleting collection:", c);
|
|
284
284
|
}
|
|
285
|
-
},
|
|
285
|
+
}, F = (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
290
|
return M(o, () => {
|
|
291
|
-
|
|
292
|
-
}), M(
|
|
293
|
-
console.log("Search query changed:", l), o.value = 1,
|
|
291
|
+
v();
|
|
292
|
+
}), M(x, (l) => {
|
|
293
|
+
console.log("Search query changed:", l), o.value = 1, v();
|
|
294
294
|
}), (l, c) => {
|
|
295
|
-
var _, D,
|
|
296
|
-
return u(), C("div",
|
|
297
|
-
t("div",
|
|
298
|
-
t("div",
|
|
295
|
+
var _, D, L, P;
|
|
296
|
+
return u(), C("div", at, [
|
|
297
|
+
t("div", it, [
|
|
298
|
+
t("div", dt, [
|
|
299
299
|
t("div", null, [
|
|
300
|
-
t("h1",
|
|
301
|
-
t("p",
|
|
300
|
+
t("h1", ct, p(l.$t("cms.builder.collections")), 1),
|
|
301
|
+
t("p", ut, p(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 lt = { class: "space-y-6 max-w-7xl mx-auto" }, at = { 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(W), { class: "w-5 h-5" })
|
|
310
|
+
], 8, ht)
|
|
311
311
|
]),
|
|
312
|
-
t("div",
|
|
313
|
-
t("div",
|
|
312
|
+
t("div", pt, [
|
|
313
|
+
t("div", gt, [
|
|
314
314
|
t("div", ft, [
|
|
315
|
-
w(i(
|
|
315
|
+
w(i(ve), { class: "w-5 h-5 text-gray-400" })
|
|
316
316
|
]),
|
|
317
|
-
|
|
317
|
+
ce(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] = ($) => b.value = $)
|
|
322
|
+
}, null, 8, mt), [
|
|
323
|
+
[ue, b.value]
|
|
324
324
|
])
|
|
325
325
|
]),
|
|
326
|
-
t("div",
|
|
326
|
+
t("div", bt, [
|
|
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(Ne, { 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(Ae, { class: "dark:text-blue-50 w-4 h-4" })
|
|
338
338
|
], 2)
|
|
339
339
|
]),
|
|
340
|
-
w(
|
|
340
|
+
w(pe)
|
|
341
341
|
])
|
|
342
342
|
]),
|
|
343
343
|
t("div", null, [
|
|
344
|
-
i(d) === "list" ? (u(),
|
|
344
|
+
i(d) === "list" ? (u(), j(ke, {
|
|
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: V.value,
|
|
349
|
+
onDelete: A,
|
|
350
|
+
onEdit: F,
|
|
351
351
|
onView: I
|
|
352
352
|
}, {
|
|
353
|
-
actions:
|
|
353
|
+
actions: he(({ 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: (vt) => I($)
|
|
357
357
|
}, [
|
|
358
|
-
w(i(
|
|
359
|
-
], 8,
|
|
358
|
+
w(i(K), { 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, xt)
|
|
360
360
|
]),
|
|
361
361
|
_: 1
|
|
362
362
|
}, 8, ["rows"])) : T("", !0),
|
|
363
|
-
i(d) === "grid" ? (u(),
|
|
363
|
+
i(d) === "grid" ? (u(), j(rt, {
|
|
364
364
|
key: 1,
|
|
365
|
-
collections:
|
|
366
|
-
onEdit:
|
|
365
|
+
collections: V.value,
|
|
366
|
+
onEdit: F,
|
|
367
367
|
onView: I,
|
|
368
|
-
onDelete:
|
|
368
|
+
onDelete: A,
|
|
369
369
|
class: "max-h-[calc(100vh-270px)] overflow-y-auto overflow-x-hidden"
|
|
370
370
|
}, null, 8, ["collections"])) : T("", !0),
|
|
371
|
-
((_ =
|
|
371
|
+
((_ = m.value) == null ? void 0 : _.total) > 16 ? (u(), j(ye, {
|
|
372
372
|
key: 2,
|
|
373
|
-
total: (D =
|
|
374
|
-
count: ((
|
|
373
|
+
total: (D = m.value) == null ? void 0 : D.filtered,
|
|
374
|
+
count: ((L = m.value) == null ? void 0 : L.count) || ((P = m.value) == null ? void 0 : P.total),
|
|
375
375
|
page: o.value,
|
|
376
376
|
"onUpdate:page": c[3] || (c[3] = ($) => o.value = $),
|
|
377
|
-
limit:
|
|
377
|
+
limit: y.value
|
|
378
378
|
}, null, 8, ["total", "count", "page", "limit"])) : T("", !0)
|
|
379
379
|
])
|
|
380
380
|
]);
|
|
@@ -382,5 +382,5 @@ const lt = { class: "space-y-6 max-w-7xl mx-auto" }, at = { class: "flex items-c
|
|
|
382
382
|
}
|
|
383
383
|
});
|
|
384
384
|
export {
|
|
385
|
-
|
|
385
|
+
Dt as default
|
|
386
386
|
};
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Layers as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as p, openBlock as t, createElementBlock as s, createElementVNode as l, createVNode as b, unref as a, toDisplayString as r, createBlock as m, createCommentVNode as c, Fragment as d, renderList as h } from "vue";
|
|
2
|
+
import { Layers as k, ChevronRight as u } from "lucide-vue-next";
|
|
3
|
+
const x = { class: "flex items-center space-x-1 mb-4 overflow-hidden" }, g = { class: "truncate block max-w-[12rem]" }, f = ["onClick"], w = { class: "truncate block max-w-[20rem]" }, v = {
|
|
4
4
|
key: 1,
|
|
5
5
|
class: "flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium text-slate-700 dark:text-slate-300 min-w-0 overflow-hidden whitespace-nowrap text-ellipsis"
|
|
6
|
-
}, _ = { class: "truncate block max-w-[20rem]" }, N = /* @__PURE__ */
|
|
6
|
+
}, _ = { class: "truncate block max-w-[20rem]" }, N = /* @__PURE__ */ p({
|
|
7
7
|
__name: "CollectionsBreadcrumb",
|
|
8
8
|
props: {
|
|
9
9
|
items: {}
|
|
10
10
|
},
|
|
11
11
|
emits: ["navigate"],
|
|
12
|
-
setup(
|
|
13
|
-
return (
|
|
12
|
+
setup(y) {
|
|
13
|
+
return (e, i) => (t(), s("div", x, [
|
|
14
14
|
l("button", {
|
|
15
15
|
class: "flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 min-w-0 overflow-hidden whitespace-nowrap text-ellipsis",
|
|
16
|
-
onClick:
|
|
16
|
+
onClick: i[0] || (i[0] = (n) => e.$emit("navigate", "collections"))
|
|
17
17
|
}, [
|
|
18
|
-
|
|
19
|
-
l("span",
|
|
18
|
+
b(a(k), { class: "w-3 h-3 flex-shrink-0" }),
|
|
19
|
+
l("span", g, r(e.$t("cms.navigation.collections")), 1)
|
|
20
20
|
]),
|
|
21
|
-
|
|
21
|
+
e.items.length > 0 ? (t(), m(a(u), {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "w-3 h-3 text-slate-400 dark:text-slate-500 flex-shrink-0"
|
|
24
|
-
})) :
|
|
25
|
-
(
|
|
26
|
-
o <
|
|
24
|
+
})) : c("", !0),
|
|
25
|
+
(t(!0), s(d, null, h(e.items, (n, o) => (t(), s(d, { key: o }, [
|
|
26
|
+
o < e.items.length - 1 ? (t(), s("button", {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "flex gap-x-1 items-center px-2 py-1 rounded text-sm font-medium transition-all duration-200 text-blue-700 dark:text-blue-300 bg-blue-50 dark:bg-blue-900/20 hover:bg-blue-100 dark:hover:bg-blue-900/30 min-w-0 overflow-hidden whitespace-nowrap text-ellipsis",
|
|
29
|
-
onClick: (C) =>
|
|
29
|
+
onClick: (C) => e.$emit("navigate", n.route)
|
|
30
30
|
}, [
|
|
31
|
-
l("span",
|
|
32
|
-
], 8,
|
|
33
|
-
l("span", _,
|
|
31
|
+
l("span", w, r(n.label), 1)
|
|
32
|
+
], 8, f)) : (t(), s("span", v, [
|
|
33
|
+
l("span", _, r(n.label), 1)
|
|
34
34
|
])),
|
|
35
|
-
o <
|
|
35
|
+
o < e.items.length - 1 ? (t(), m(a(u), {
|
|
36
36
|
key: 2,
|
|
37
37
|
class: "w-3 h-3 text-slate-400 dark:text-slate-500 flex-shrink-0"
|
|
38
|
-
})) :
|
|
38
|
+
})) : c("", !0)
|
|
39
39
|
], 64))), 128))
|
|
40
40
|
]));
|
|
41
41
|
}
|
|
@@ -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, openBlock as r, createElementBlock as n, 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-DaZt_nAm.js";
|
|
6
|
+
import { _ as S } from "./CreateForm-BMOBeP4G.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]"
|