@opengis/cms 0.0.59 → 0.0.61
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 +4 -4
- package/dist/{ArticlesPage-BjYzvTWM.js → ArticlesPage-CFjE_cw_.js} +3 -3
- package/dist/{CollectionsBreadcrumb-HePNJb-d.js → CollectionsBreadcrumb-BCxeRikP.js} +1 -1
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-umRzB5mY.js +53 -0
- package/dist/{Dashboard-CXkg_pk8.js → Dashboard-C1eGscNd.js} +132 -132
- package/dist/EditCollectionPage-3Q57ptN3.js +188 -0
- package/dist/{MenuAddPage-QTnwCoGh.js → MenuAddPage-D-p3gFgm.js} +1 -1
- package/dist/{MenuBody-Bi0ONVZf.js → MenuBody-rN5j4YBu.js} +2 -2
- package/dist/{MenuItemPage-B7Y9KFyb.js → MenuItemPage-BoJw885D.js} +3 -3
- package/dist/{MenuList-BLIpeqSd.js → MenuList-DFEBS0NB.js} +53 -53
- package/dist/{MenuPage-3W6jZ15H.js → MenuPage-BCZB_S8j.js} +1 -1
- package/dist/{MenuWrapper-OrOv6sOb.js → MenuWrapper-AZ_8s-zd.js} +1 -1
- package/dist/{MonacoEditor-ByPT8pnv.js → MonacoEditor-Db-3Jc3E.js} +1 -1
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js +84 -0
- package/dist/{UniversalTable-GBd_pStq.js → UniversalTable-CzqPG-tY.js} +80 -80
- package/dist/{UniversalTablePagination-Dw2hc0nc.js → UniversalTablePagination-4gL47A7I.js} +46 -46
- package/dist/{contentForm-Buku-lel.js → contentForm-CLStrfSg.js} +49 -52
- package/dist/index.js +5 -5
- package/dist/{vs-builder-monaco-Cw-f19gc.js → vs-builder-monaco-B3Jj0V31.js} +1 -1
- package/package.json +69 -69
- package/server/migrations/fixes.sql +5 -2
- package/server/migrations/site.sql +4 -3
- package/server/routes/cms/controllers/deleteContent.js +7 -7
- package/server/routes/cms/controllers/getContent.js +6 -6
- package/server/routes/cms/controllers/getContentBySlug.js +13 -13
- package/server/routes/cms/controllers/getPermissions.js +15 -15
- package/server/routes/cms/controllers/insertContent.js +28 -19
- package/server/routes/cms/controllers/setPermissions.js +49 -49
- package/server/routes/cms/controllers/updateContent.js +12 -47
- package/server/routes/cms/utils/getCollection.js +1 -1
- package/server/routes/cms/utils/getSingle.js +1 -1
- package/server/routes/cms/utils/insertContentLocalization.js +1 -1
- package/server/routes/cms/utils/requestTranslation.js +73 -23
- package/server/routes/cms/utils/updateLocalization.js +1 -6
- package/server/routes/cmsSpace/controllers/deleteSpace.js +1 -0
- package/server/routes/cmsSpace/controllers/getSpaces.js +1 -0
- package/server/routes/cmsSpace/controllers/insertSpace.js +1 -0
- package/server/routes/cmsSpace/controllers/updateSpace.js +1 -0
- package/server/routes/contentType/controllers/contentTypeList.js +4 -11
- package/server/routes/contentType/controllers/editContentType.js +7 -25
- package/server/routes/contentType/controllers/getContentType.js +5 -13
- package/server/templates/select/core.user_mentioned.sql +1 -1
- package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js +0 -53
- package/dist/EditCollectionPage-CqYHpEON.js +0 -187
- package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js +0 -84
- package/dist/images/logo.png +0 -0
- package/dist/index.html +0 -29
- package/dist/vite.svg +0 -1
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { defineAsyncComponent as k, defineComponent as S, inject as q, ref as m, computed as v, onMounted as D, openBlock as p, createElementBlock as h, createVNode as O, createElementVNode as r, createTextVNode as R, toDisplayString as f, unref as A, Fragment as W, renderList as J, normalizeClass as M, createBlock as Y, resolveDynamicComponent as G, createCommentVNode as H } from "vue";
|
|
2
|
+
import { useRoute as K, useRouter as P } from "vue-router";
|
|
3
|
+
import { useI18n as Q } from "vue-i18n";
|
|
4
|
+
import { notify as $ } from "@opengis/core";
|
|
5
|
+
import { _ as X } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-umRzB5mY.js";
|
|
6
|
+
const Z = {
|
|
7
|
+
monaco: k(() => import("./vs-builder-monaco-B3Jj0V31.js")),
|
|
8
|
+
edit: k(() => import("./vs-builder-edit-D-q1o8tF.js")),
|
|
9
|
+
preview: k(() => import("./vs-builder-preview-BH4VAM3a.js"))
|
|
10
|
+
}, ee = { class: "mx-auto max-w-[90%]" }, te = { class: "flex items-center justify-between mb-6" }, oe = { class: "mb-2 text-2xl font-semibold text-gray-900" }, ne = { class: "lowercase" }, se = { class: "text-gray-600" }, ie = { class: "flex items-center gap-2" }, ae = { class: "w-full" }, re = { class: "flex items-center w-full h-10 max-w-md grid-cols-3 p-1 mb-6 bg-white border border-gray-200 rounded-md text-muted-foreground" }, le = ["onClick"], ce = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "mx-auto bg-white rounded-md py-4 px-2 bg-opacity-50"
|
|
13
|
+
}, ge = /* @__PURE__ */ S({
|
|
14
|
+
__name: "EditCollectionPage",
|
|
15
|
+
setup(ue) {
|
|
16
|
+
const { t: s } = Q(), j = q("cms.fetchContentTypes"), g = m("edit"), n = m({ yaml: "", data: { columns: [], type: "collection" } }), w = m({}), x = m(""), l = K(), b = P(), I = m(!1), _ = m(!0), C = m(""), F = v(() => [
|
|
17
|
+
// {
|
|
18
|
+
// name: "YAML",
|
|
19
|
+
// id: "monaco",
|
|
20
|
+
// },
|
|
21
|
+
{
|
|
22
|
+
name: s("cms.builder.edit"),
|
|
23
|
+
id: "edit"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: s("cms.builder.preview"),
|
|
27
|
+
id: "preview"
|
|
28
|
+
}
|
|
29
|
+
]), c = v(() => {
|
|
30
|
+
if (typeof l.params.collection == "string" && typeof l.params.contentId == "string")
|
|
31
|
+
return l.params.collection;
|
|
32
|
+
const e = l.params.id;
|
|
33
|
+
return e === "edit" ? l.params.collection : e;
|
|
34
|
+
}), y = v(() => typeof l.params.contentId == "string" ? l.params.contentId : null), L = v(() => {
|
|
35
|
+
if (c.value && y.value)
|
|
36
|
+
return `/collections/${c.value}/${y.value}`;
|
|
37
|
+
const e = l.query.from;
|
|
38
|
+
return typeof e == "string" && e.startsWith("/") ? e : null;
|
|
39
|
+
}), N = v(() => {
|
|
40
|
+
if (C.value)
|
|
41
|
+
return C.value;
|
|
42
|
+
const e = l.query.fromLabel;
|
|
43
|
+
return typeof e == "string" && e.trim() ? e.trim() : null;
|
|
44
|
+
}), B = v(() => {
|
|
45
|
+
var t, i, u, a, d, T;
|
|
46
|
+
const e = x.value || c.value, o = [
|
|
47
|
+
{
|
|
48
|
+
label: ((i = (t = n.value) == null ? void 0 : t.data) == null ? void 0 : i.type) == "single" ? s("cms.navigation.singletons") : e,
|
|
49
|
+
route: `collections/${((a = (u = n.value) == null ? void 0 : u.data) == null ? void 0 : a.type) == "single" ? "pages" : c.value}`
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: (((T = (d = n.value) == null ? void 0 : d.data) == null ? void 0 : T.type) == "single" ? e + " - " : "") + s("cms.collections.edit")
|
|
53
|
+
}
|
|
54
|
+
].filter((E) => E);
|
|
55
|
+
return L.value && N.value && o.splice(1, 0, {
|
|
56
|
+
label: N.value,
|
|
57
|
+
route: L.value
|
|
58
|
+
}), o;
|
|
59
|
+
}), U = (e) => {
|
|
60
|
+
if (e) {
|
|
61
|
+
if (e.startsWith("/")) {
|
|
62
|
+
b.push(e);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
b.push(`/${e}`);
|
|
66
|
+
}
|
|
67
|
+
}, V = async () => {
|
|
68
|
+
var e;
|
|
69
|
+
try {
|
|
70
|
+
if (_.value = !0, !c.value)
|
|
71
|
+
return;
|
|
72
|
+
if (y.value) {
|
|
73
|
+
const u = await fetch(
|
|
74
|
+
`/api/cms/${c.value}/${y.value}`
|
|
75
|
+
);
|
|
76
|
+
if (u.ok) {
|
|
77
|
+
const a = await u.json(), d = Array.isArray(a == null ? void 0 : a.rows) ? a.rows[0] : a;
|
|
78
|
+
d != null && d.title && (C.value = d.title);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const t = await (await fetch(`/api/cms-type/${c.value}`)).json(), i = {
|
|
82
|
+
...t,
|
|
83
|
+
columns: Array.isArray(t.columns) ? t.columns : (e = Object.entries((t == null ? void 0 : t.columns) || {})) == null ? void 0 : e.map(([u, a]) => ({
|
|
84
|
+
...a,
|
|
85
|
+
name: u
|
|
86
|
+
}))
|
|
87
|
+
};
|
|
88
|
+
n.value = {
|
|
89
|
+
...n.value,
|
|
90
|
+
data: i
|
|
91
|
+
}, x.value = i.title || i.name;
|
|
92
|
+
} catch (o) {
|
|
93
|
+
console.error(o);
|
|
94
|
+
} finally {
|
|
95
|
+
_.value = !1, I.value = !0;
|
|
96
|
+
}
|
|
97
|
+
}, z = async () => {
|
|
98
|
+
var e, o;
|
|
99
|
+
try {
|
|
100
|
+
if (await w.value.validate()) {
|
|
101
|
+
$({
|
|
102
|
+
type: "warning",
|
|
103
|
+
title: s("cms.common.actions.warning"),
|
|
104
|
+
message: s("cms.builder.editFieldFailed")
|
|
105
|
+
});
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const i = c.value;
|
|
109
|
+
if (!i)
|
|
110
|
+
return;
|
|
111
|
+
const u = await fetch(
|
|
112
|
+
`/api/cms-type/${i}`,
|
|
113
|
+
{
|
|
114
|
+
method: "PUT",
|
|
115
|
+
headers: {
|
|
116
|
+
"Content-Type": "application/json"
|
|
117
|
+
},
|
|
118
|
+
body: JSON.stringify(g.value === "monaco" ? (e = n.value) == null ? void 0 : e.yaml : (o = n.value) == null ? void 0 : o.data)
|
|
119
|
+
}
|
|
120
|
+
);
|
|
121
|
+
b.back(), j && j(), $({
|
|
122
|
+
type: "success",
|
|
123
|
+
title: s("cms.common.actions.success"),
|
|
124
|
+
message: s("cms.collections.collectionCreated")
|
|
125
|
+
});
|
|
126
|
+
} catch (t) {
|
|
127
|
+
console.error(t), $({
|
|
128
|
+
type: "error",
|
|
129
|
+
title: s("cms.common.actions.error"),
|
|
130
|
+
message: s("cms.collections.collectionCreationFailed")
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return D(() => {
|
|
135
|
+
V();
|
|
136
|
+
}), (e, o) => (p(), h("div", ee, [
|
|
137
|
+
O(X, {
|
|
138
|
+
items: B.value,
|
|
139
|
+
loading: _.value,
|
|
140
|
+
onNavigate: U
|
|
141
|
+
}, null, 8, ["items", "loading"]),
|
|
142
|
+
r("div", te, [
|
|
143
|
+
r("div", null, [
|
|
144
|
+
r("h1", oe, [
|
|
145
|
+
R(f(e.$t("cms.builder.editCollection")) + ": ", 1),
|
|
146
|
+
r("span", ne, ' "' + f(x.value) + '" ', 1)
|
|
147
|
+
]),
|
|
148
|
+
r("p", se, f(e.$t("cms.builder.editContentForYourSite")), 1)
|
|
149
|
+
]),
|
|
150
|
+
r("div", ie, [
|
|
151
|
+
r("a", {
|
|
152
|
+
onClick: o[0] || (o[0] = (t) => A(b).back()),
|
|
153
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border bg-background hover:text-accent-foreground h-10 px-4 py-2 border-gray-300 text-gray-700 hover:bg-gray-50"
|
|
154
|
+
}, f(e.$t("cms.common.actions.back")), 1),
|
|
155
|
+
r("button", {
|
|
156
|
+
onClick: z,
|
|
157
|
+
class: "inline-flex items-center justify-center gap-2 whitespace-nowrap text-white rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-primary-foreground h-10 px-4 py-2 bg-blue-600 hover:bg-blue-700"
|
|
158
|
+
}, f(e.$t("cms.common.actions.save")), 1)
|
|
159
|
+
])
|
|
160
|
+
]),
|
|
161
|
+
r("div", ae, [
|
|
162
|
+
r("div", re, [
|
|
163
|
+
(p(!0), h(W, null, J(F.value, (t) => (p(), h("button", {
|
|
164
|
+
key: t.id,
|
|
165
|
+
onClick: (i) => g.value = t.id,
|
|
166
|
+
class: M([
|
|
167
|
+
"inline-flex flex-1 items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm data-[state=active]:bg-blue-50 data-[state=active]:text-blue-700 data-[state=active]:border-blue-200",
|
|
168
|
+
t.id === g.value ? "bg-blue-50 text-blue-700 border-blue-200" : ""
|
|
169
|
+
])
|
|
170
|
+
}, f(t.name), 11, le))), 128))
|
|
171
|
+
])
|
|
172
|
+
]),
|
|
173
|
+
I.value ? (p(), h("div", ce, [
|
|
174
|
+
(p(), Y(G(A(Z)[g.value]), {
|
|
175
|
+
yaml: n.value.yaml,
|
|
176
|
+
"onUpdate:yaml": o[1] || (o[1] = (t) => n.value.yaml = t),
|
|
177
|
+
data: n.value.data,
|
|
178
|
+
"onUpdate:data": o[2] || (o[2] = (t) => n.value.data = t),
|
|
179
|
+
form: w.value,
|
|
180
|
+
"onUpdate:form": o[3] || (o[3] = (t) => w.value = t)
|
|
181
|
+
}, null, 40, ["yaml", "data", "form"]))
|
|
182
|
+
])) : H("", !0)
|
|
183
|
+
]));
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
export {
|
|
187
|
+
ge as default
|
|
188
|
+
};
|
|
@@ -8,7 +8,7 @@ const M = { class: "space-y-6 max-w-7xl mx-auto" }, S = { class: "flex items-cen
|
|
|
8
8
|
__name: "MenuAddPage",
|
|
9
9
|
setup(F) {
|
|
10
10
|
const p = v(
|
|
11
|
-
() => import("./MonacoEditor-
|
|
11
|
+
() => import("./MonacoEditor-Db-3Jc3E.js")
|
|
12
12
|
);
|
|
13
13
|
C["vs-input-monaco-editor"] = p;
|
|
14
14
|
const { t: e } = q(), u = b();
|
|
@@ -11,8 +11,8 @@ const R = /* @__PURE__ */ x({
|
|
|
11
11
|
},
|
|
12
12
|
emits: ["update:modelValue"],
|
|
13
13
|
setup(f) {
|
|
14
|
-
const v = m(() => import("./MenuList-
|
|
15
|
-
() => import("./MonacoEditor-
|
|
14
|
+
const v = m(() => import("./MenuList-DFEBS0NB.js")), y = m(() => import("./AddNewItemInTree-05PSSEFi.js")), g = m(
|
|
15
|
+
() => import("./MonacoEditor-Db-3Jc3E.js")
|
|
16
16
|
);
|
|
17
17
|
O["vs-input-monaco-editor"] = g;
|
|
18
18
|
const { t: r } = F(), l = i(!1), d = i(null), n = V(f, "modelValue"), u = i({}), h = async (t) => {
|
|
@@ -4,7 +4,7 @@ import { ArrowLeft as Ie, HelpCircle as Re, Save as Le } from "lucide-vue-next";
|
|
|
4
4
|
import { useI18n as Ye } from "vue-i18n";
|
|
5
5
|
import { notify as B } from "@opengis/core";
|
|
6
6
|
import { inputs as z, VForm as Me } from "@opengis/form";
|
|
7
|
-
/*! js-yaml 4.1.
|
|
7
|
+
/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */
|
|
8
8
|
function se(e) {
|
|
9
9
|
return typeof e > "u" || e === null;
|
|
10
10
|
}
|
|
@@ -874,9 +874,9 @@ const Bn = { class: "space-y-6 max-w-7xl mx-auto" }, Pn = { class: "flex items-c
|
|
|
874
874
|
__name: "MenuItemPage",
|
|
875
875
|
setup(e) {
|
|
876
876
|
const r = Q(
|
|
877
|
-
() => import("./MenuBody-
|
|
877
|
+
() => import("./MenuBody-rN5j4YBu.js")
|
|
878
878
|
), n = Q(
|
|
879
|
-
() => import("./MonacoEditor-
|
|
879
|
+
() => import("./MonacoEditor-Db-3Jc3E.js")
|
|
880
880
|
);
|
|
881
881
|
z["vs-input-monaco-editor"] = n, console.log("[MenuItemPage] vs-input-monaco-editor registered:", !!z["vs-input-monaco-editor"]);
|
|
882
882
|
const { t, locale: i } = Ye(), a = Ce(), l = be(), u = Ne(() => [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock as
|
|
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
2
|
import { d as A } from "./vuedraggable-CoAPPFYd.js";
|
|
3
3
|
import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
import { Pencil as S, Trash2 as j, Check as K, X as O } from "lucide-vue-next";
|
|
@@ -15,8 +15,8 @@ const q = {}, F = {
|
|
|
15
15
|
"stroke-linecap": "round",
|
|
16
16
|
"stroke-linejoin": "round"
|
|
17
17
|
};
|
|
18
|
-
function G(
|
|
19
|
-
return
|
|
18
|
+
function G(r, o) {
|
|
19
|
+
return l(), u("svg", F, [...o[0] || (o[0] = [
|
|
20
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
21
|
])]);
|
|
22
22
|
}
|
|
@@ -36,21 +36,21 @@ const H = /* @__PURE__ */ L(q, [["render", G]]), J = {
|
|
|
36
36
|
value: {}
|
|
37
37
|
},
|
|
38
38
|
emits: ["delete", "update:value"],
|
|
39
|
-
setup(
|
|
40
|
-
const i =
|
|
41
|
-
typeof i.value == "string" && (e.value = i.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
42
|
}, c = () => {
|
|
43
|
-
typeof i.value == "string" && (
|
|
43
|
+
typeof i.value == "string" && (m("update:value", e.value), a.value = !1);
|
|
44
44
|
}, x = () => {
|
|
45
|
-
|
|
45
|
+
a.value = !1, e.value = "";
|
|
46
46
|
};
|
|
47
|
-
return (
|
|
48
|
-
class: z([{ "space-y-1": typeof
|
|
47
|
+
return (_, t) => (l(), u("div", {
|
|
48
|
+
class: z([{ "space-y-1": typeof r.value != "string" }, "dark:bg-transparent"])
|
|
49
49
|
}, [
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
$(
|
|
53
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
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
54
|
onKeyup: [
|
|
55
55
|
w(c, ["enter"]),
|
|
56
56
|
w(x, ["esc"])
|
|
@@ -62,33 +62,33 @@ const H = /* @__PURE__ */ L(q, [["render", G]]), J = {
|
|
|
62
62
|
}, null, 544), [
|
|
63
63
|
[I, e.value]
|
|
64
64
|
]),
|
|
65
|
-
|
|
66
|
-
onClick:
|
|
65
|
+
v("button", {
|
|
66
|
+
onClick: y(c, ["stop"]),
|
|
67
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
68
|
title: "Save"
|
|
69
69
|
}, [
|
|
70
|
-
|
|
70
|
+
p(d(K), { class: "size-4" })
|
|
71
71
|
]),
|
|
72
|
-
|
|
73
|
-
onClick:
|
|
72
|
+
v("button", {
|
|
73
|
+
onClick: y(x, ["stop"]),
|
|
74
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
75
|
title: "Cancel"
|
|
76
76
|
}, [
|
|
77
|
-
|
|
77
|
+
p(d(O), { class: "size-4" })
|
|
78
78
|
])
|
|
79
|
-
])) : (
|
|
80
|
-
M(
|
|
81
|
-
typeof
|
|
82
|
-
typeof
|
|
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
83
|
key: 1,
|
|
84
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:
|
|
86
|
-
})) :
|
|
87
|
-
|
|
85
|
+
onClick: y(g, ["stop"])
|
|
86
|
+
})) : b("", !0),
|
|
87
|
+
p(d(j), {
|
|
88
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] =
|
|
89
|
+
onClick: t[0] || (t[0] = y((s) => m("delete"), ["stop"]))
|
|
90
90
|
}),
|
|
91
|
-
|
|
91
|
+
p(H, { class: "shrink-0 size-4 cursor-pointer text-gray-500 dark:text-neutral-500" })
|
|
92
92
|
]))
|
|
93
93
|
], 2));
|
|
94
94
|
}
|
|
@@ -105,61 +105,61 @@ const H = /* @__PURE__ */ L(q, [["render", G]]), J = {
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
emits: ["update:list", "delete:item"],
|
|
108
|
-
setup(
|
|
109
|
-
const { t: i } = X(),
|
|
108
|
+
setup(r, { emit: o }) {
|
|
109
|
+
const { t: i } = X(), m = r, a = o, e = h([]);
|
|
110
110
|
N(
|
|
111
|
-
() =>
|
|
111
|
+
() => m.list,
|
|
112
112
|
(t) => {
|
|
113
113
|
e.value = t ? [...t] : [];
|
|
114
114
|
},
|
|
115
115
|
{ immediate: !0, deep: !0 }
|
|
116
116
|
);
|
|
117
|
-
const
|
|
118
|
-
|
|
117
|
+
const g = () => {
|
|
118
|
+
a("update:list", e.value);
|
|
119
119
|
}, c = (t) => {
|
|
120
120
|
P({
|
|
121
121
|
title: i("cms.builder.deleteTitle"),
|
|
122
122
|
message: i("cms.builder.deleteObject"),
|
|
123
123
|
type: "error",
|
|
124
124
|
onConfirm: () => {
|
|
125
|
-
|
|
125
|
+
a("update:list", e.value), a("delete:item", t);
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
|
-
}, x = (t,
|
|
129
|
-
t.value =
|
|
130
|
-
e.value = [...e.value],
|
|
128
|
+
}, x = (t, s) => {
|
|
129
|
+
t.value = s, V(() => {
|
|
130
|
+
e.value = [...e.value], a("update:list", e.value);
|
|
131
131
|
});
|
|
132
|
-
},
|
|
133
|
-
t.children =
|
|
134
|
-
e.value = [...e.value],
|
|
132
|
+
}, _ = (t, s) => {
|
|
133
|
+
t.children = s, V(() => {
|
|
134
|
+
e.value = [...e.value], a("update:list", e.value);
|
|
135
135
|
});
|
|
136
136
|
};
|
|
137
|
-
return (t,
|
|
137
|
+
return (t, s) => {
|
|
138
138
|
const B = T("MenuList", !0);
|
|
139
|
-
return
|
|
139
|
+
return l(), C(d(A), {
|
|
140
140
|
tag: "ul",
|
|
141
141
|
list: e.value,
|
|
142
142
|
group: { name: "nested", pull: !0, put: !0 },
|
|
143
143
|
"item-key": "id",
|
|
144
|
-
class: z(["nested-sortable space-y-1", { "ps-5 dark:bg-transparent":
|
|
145
|
-
onChange:
|
|
146
|
-
onEnd:
|
|
144
|
+
class: z(["nested-sortable space-y-1", { "ps-5 dark:bg-transparent": r.inside }]),
|
|
145
|
+
onChange: g,
|
|
146
|
+
onEnd: g
|
|
147
147
|
}, {
|
|
148
148
|
item: U(({ element: n }) => [
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
v("div", Z, [
|
|
150
|
+
p(Y, {
|
|
151
151
|
title: n.title,
|
|
152
152
|
value: n.value,
|
|
153
|
-
onDelete: (
|
|
154
|
-
"onUpdate:value": (
|
|
153
|
+
onDelete: (k) => c(n),
|
|
154
|
+
"onUpdate:value": (k) => x(n, k)
|
|
155
155
|
}, null, 8, ["title", "value", "onDelete", "onUpdate:value"]),
|
|
156
|
-
Array.isArray(n.children) ? (
|
|
156
|
+
Array.isArray(n.children) ? (l(), C(B, {
|
|
157
157
|
key: 0,
|
|
158
158
|
list: n.children,
|
|
159
159
|
inside: !0,
|
|
160
|
-
"onUpdate:list": (
|
|
160
|
+
"onUpdate:list": (k) => _(n, k),
|
|
161
161
|
"onDelete:item": c
|
|
162
|
-
}, null, 8, ["list", "onUpdate:list"])) :
|
|
162
|
+
}, null, 8, ["list", "onUpdate:list"])) : b("", !0)
|
|
163
163
|
])
|
|
164
164
|
]),
|
|
165
165
|
_: 1
|
|
@@ -11,7 +11,7 @@ const H = { class: "space-y-6 max-w-7xl mx-auto" }, I = { class: "flex flex-col
|
|
|
11
11
|
__name: "MenuPage",
|
|
12
12
|
setup(J) {
|
|
13
13
|
const g = V(
|
|
14
|
-
() => import("./UniversalTable-
|
|
14
|
+
() => import("./UniversalTable-CzqPG-tY.js")
|
|
15
15
|
), { t: o, locale: v } = M(), y = q(), x = a(""), d = a([]), i = a([]), b = a(""), h = a([
|
|
16
16
|
{ name: "name", title: o("cms.menu.form.name"), type: "text" },
|
|
17
17
|
{ name: "description", title: o("cms.menu.form.description"), type: "text" },
|
|
@@ -3,7 +3,7 @@ import { useRoute as d } from "vue-router";
|
|
|
3
3
|
const C = /* @__PURE__ */ m({
|
|
4
4
|
__name: "MenuWrapper",
|
|
5
5
|
setup(f) {
|
|
6
|
-
const o = n(() => import("./MenuPage-
|
|
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
7
|
return (_, l) => (u(), s(i(a.value), { key: c.value }));
|
|
8
8
|
}
|
|
9
9
|
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { defineComponent as s, mergeModels as c, useModel as m, ref as f, onMounted as h, watch as d, onBeforeUnmount as g, openBlock as p, createElementBlock as v, normalizeStyle as w } from "vue";
|
|
2
|
+
async function M() {
|
|
3
|
+
if (window.monaco)
|
|
4
|
+
return window.monaco;
|
|
5
|
+
const a = "https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min";
|
|
6
|
+
return window.require || (window.require = { paths: { vs: `${a}/vs` } }, await new Promise((o, l) => {
|
|
7
|
+
const n = document.createElement("script");
|
|
8
|
+
n.src = `${a}/vs/loader.min.js`, n.onload = () => o(), n.onerror = l, document.head.appendChild(n);
|
|
9
|
+
})), new Promise((o) => {
|
|
10
|
+
window.require(["vs/editor/editor.main"], () => o(window.monaco));
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
const C = /* @__PURE__ */ s({
|
|
14
|
+
__name: "MonacoEditor",
|
|
15
|
+
props: /* @__PURE__ */ c({
|
|
16
|
+
language: { default: "javascript" },
|
|
17
|
+
theme: { default: "vs-dark" },
|
|
18
|
+
width: { default: "100%" },
|
|
19
|
+
height: { default: "100%" },
|
|
20
|
+
options: { default: () => ({
|
|
21
|
+
minimap: { enabled: !1 }
|
|
22
|
+
}) }
|
|
23
|
+
}, {
|
|
24
|
+
modelValue: {
|
|
25
|
+
required: !0
|
|
26
|
+
},
|
|
27
|
+
modelModifiers: {}
|
|
28
|
+
}),
|
|
29
|
+
emits: ["update:modelValue"],
|
|
30
|
+
setup(a) {
|
|
31
|
+
const o = a, l = m(a, "modelValue"), n = f(null);
|
|
32
|
+
let e = null, i = null;
|
|
33
|
+
return h(async () => {
|
|
34
|
+
var t;
|
|
35
|
+
if (n.value)
|
|
36
|
+
try {
|
|
37
|
+
i = await M();
|
|
38
|
+
const r = ((t = l.value) == null ? void 0 : t.replace(/\\n/g, `
|
|
39
|
+
`)) || "";
|
|
40
|
+
e = i.editor.create(n.value, {
|
|
41
|
+
value: r,
|
|
42
|
+
language: o.language,
|
|
43
|
+
theme: o.theme,
|
|
44
|
+
automaticLayout: !0,
|
|
45
|
+
...o.options
|
|
46
|
+
}), e.onDidChangeModelContent(() => {
|
|
47
|
+
const u = (e == null ? void 0 : e.getValue()) || "";
|
|
48
|
+
l.value = u;
|
|
49
|
+
});
|
|
50
|
+
} catch (r) {
|
|
51
|
+
console.error("Failed to load Monaco Editor:", r);
|
|
52
|
+
}
|
|
53
|
+
}), d(
|
|
54
|
+
() => l.value,
|
|
55
|
+
(t) => {
|
|
56
|
+
if (e) {
|
|
57
|
+
const r = (t == null ? void 0 : t.replace(/\\n/g, `
|
|
58
|
+
`)) || "";
|
|
59
|
+
r !== e.getValue() && e.setValue(r);
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{ immediate: !0 }
|
|
63
|
+
), d(
|
|
64
|
+
() => o.language,
|
|
65
|
+
(t) => {
|
|
66
|
+
e && t && i && i.editor.setModelLanguage(e.getModel(), t);
|
|
67
|
+
}
|
|
68
|
+
), d(
|
|
69
|
+
() => o.theme,
|
|
70
|
+
(t) => {
|
|
71
|
+
e && t && i && i.editor.setTheme(t);
|
|
72
|
+
}
|
|
73
|
+
), g(() => {
|
|
74
|
+
e && (e.dispose(), e = null);
|
|
75
|
+
}), (t, r) => (p(), v("div", {
|
|
76
|
+
ref_key: "editorContainer",
|
|
77
|
+
ref: n,
|
|
78
|
+
style: w({ width: a.width, height: a.height })
|
|
79
|
+
}, null, 4));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
export {
|
|
83
|
+
C as _
|
|
84
|
+
};
|