@opengis/cms 0.0.58 → 0.0.60

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.
Files changed (129) hide show
  1. package/README.md +131 -131
  2. package/dist/{ArticlesPage-CFjE_cw_.js → ArticlesPage-BjYzvTWM.js} +3 -3
  3. package/dist/{CollectionsBreadcrumb-BCxeRikP.js → CollectionsBreadcrumb-HePNJb-d.js} +1 -1
  4. package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js +53 -0
  5. package/dist/{Dashboard-C1eGscNd.js → Dashboard-CXkg_pk8.js} +132 -132
  6. package/dist/EditCollectionPage-BycuD920.js +188 -0
  7. package/dist/{MenuAddPage-D-p3gFgm.js → MenuAddPage-QTnwCoGh.js} +1 -1
  8. package/dist/{MenuBody-rN5j4YBu.js → MenuBody-Bi0ONVZf.js} +2 -2
  9. package/dist/{MenuItemPage-BoJw885D.js → MenuItemPage-B7Y9KFyb.js} +3 -3
  10. package/dist/{MenuList-DFEBS0NB.js → MenuList-BLIpeqSd.js} +53 -53
  11. package/dist/{MenuPage-BCZB_S8j.js → MenuPage-3W6jZ15H.js} +1 -1
  12. package/dist/{MenuWrapper-AZ_8s-zd.js → MenuWrapper-OrOv6sOb.js} +1 -1
  13. package/dist/{MonacoEditor-Db-3Jc3E.js → MonacoEditor-ByPT8pnv.js} +1 -1
  14. package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js +84 -0
  15. package/dist/{UniversalTable-CzqPG-tY.js → UniversalTable-GBd_pStq.js} +80 -80
  16. package/dist/{UniversalTablePagination-4gL47A7I.js → UniversalTablePagination-Dw2hc0nc.js} +46 -46
  17. package/dist/{contentForm-CtMhQTG0.js → contentForm-yMn63kza.js} +48 -48
  18. package/dist/index.js +5 -5
  19. package/dist/{vs-builder-monaco-B3Jj0V31.js → vs-builder-monaco-Cw-f19gc.js} +1 -1
  20. package/input-types.json +9 -9
  21. package/locales/en.json +815 -815
  22. package/locales/uk.json +813 -813
  23. package/module/cms/cls/content.status.json +17 -17
  24. package/module/cms/cls/user_type.json +9 -9
  25. package/module/cms/form/admin.users.form.json +77 -77
  26. package/module/cms/select/cms.page_type.sql +1 -1
  27. package/module/cms/select/news_tag_id.sql +11 -11
  28. package/module/cms/table/admin.users.table.json +53 -53
  29. package/module/cms/table/collection.default.table.json +96 -96
  30. package/module/cms/table/single.default.table.json +116 -116
  31. package/package.json +2 -1
  32. package/plugin.js +43 -43
  33. package/server/app.js +35 -35
  34. package/server/config.js +4 -4
  35. package/server/functions/getContent.js +45 -45
  36. package/server/functions/getDraftKey.js +22 -22
  37. package/server/functions/getSearchData.js +31 -31
  38. package/server/functions/getTags.js +30 -30
  39. package/server/functions/getUser.js +27 -27
  40. package/server/functions/utils/mock.reply.js +55 -55
  41. package/server/index.js +22 -22
  42. package/server/migrations/fixes.sql +129 -129
  43. package/server/migrations/site.sql +595 -595
  44. package/server/plugins/adminHook.js +78 -78
  45. package/server/plugins/hook.js +59 -59
  46. package/server/plugins/vite.js +75 -75
  47. package/server/routes/category/controllers/cms.category.delete.js +21 -21
  48. package/server/routes/category/controllers/cms.category.get.js +17 -17
  49. package/server/routes/category/controllers/cms.category.list.js +16 -16
  50. package/server/routes/category/controllers/cms.category.post.js +21 -21
  51. package/server/routes/category/controllers/cms.category.put.js +23 -23
  52. package/server/routes/category/index.mjs +22 -22
  53. package/server/routes/cms/controllers/cmsStat.js +55 -55
  54. package/server/routes/cms/controllers/cmsSuggest.js +57 -57
  55. package/server/routes/cms/controllers/deleteContent.js +113 -113
  56. package/server/routes/cms/controllers/deleteMedia.js +76 -76
  57. package/server/routes/cms/controllers/downloadMedia.js +84 -84
  58. package/server/routes/cms/controllers/getContent.js +113 -113
  59. package/server/routes/cms/controllers/getContentBySlug.js +93 -93
  60. package/server/routes/cms/controllers/getPermissions.js +15 -15
  61. package/server/routes/cms/controllers/insertContent.js +217 -217
  62. package/server/routes/cms/controllers/listMedia.js +155 -155
  63. package/server/routes/cms/controllers/metadataMedia.js +39 -39
  64. package/server/routes/cms/controllers/properties.get.js +18 -18
  65. package/server/routes/cms/controllers/properties.post.js +99 -99
  66. package/server/routes/cms/controllers/searchContent.js +214 -214
  67. package/server/routes/cms/controllers/setPermissions.js +49 -49
  68. package/server/routes/cms/controllers/translate.js +89 -89
  69. package/server/routes/cms/controllers/updateContent.js +266 -266
  70. package/server/routes/cms/controllers/uploadMedia.js +79 -79
  71. package/server/routes/cms/functions/getSettings.js +48 -48
  72. package/server/routes/cms/index.mjs +112 -112
  73. package/server/routes/cms/utils/additionalData.js +35 -35
  74. package/server/routes/cms/utils/getCollection.js +89 -89
  75. package/server/routes/cms/utils/getSingle.js +188 -188
  76. package/server/routes/cms/utils/inputTypes.js +5 -5
  77. package/server/routes/cms/utils/insertContentLocalization.js +104 -104
  78. package/server/routes/cms/utils/requestTranslation.js +113 -85
  79. package/server/routes/cms/utils/updateLocalization.js +47 -47
  80. package/server/routes/cmsSpace/controllers/deleteSpace.js +25 -25
  81. package/server/routes/cmsSpace/controllers/getSpaces.js +27 -27
  82. package/server/routes/cmsSpace/controllers/insertSpace.js +21 -21
  83. package/server/routes/cmsSpace/controllers/updateSpace.js +23 -23
  84. package/server/routes/cmsSpace/index.mjs +20 -20
  85. package/server/routes/contentType/controllers/addContentType.js +160 -160
  86. package/server/routes/contentType/controllers/contentTypeList.js +54 -54
  87. package/server/routes/contentType/controllers/delContentType.js +75 -75
  88. package/server/routes/contentType/controllers/editContentType.js +88 -88
  89. package/server/routes/contentType/controllers/getContentType.js +65 -65
  90. package/server/routes/contentType/index.mjs +35 -35
  91. package/server/routes/contentType/utils/updateContents.js +44 -44
  92. package/server/routes/contentType/utils/updateCustomContentTable.js +53 -53
  93. package/server/routes/feedback/controllers/email.list.js +24 -24
  94. package/server/routes/feedback/controllers/feedback.js +48 -48
  95. package/server/routes/feedback/controllers/feedback.list.js +37 -37
  96. package/server/routes/feedback/controllers/news.subscriptions.js +44 -44
  97. package/server/routes/feedback/index.mjs +71 -71
  98. package/server/routes/logs/controllers/export.user.logs.js +77 -77
  99. package/server/routes/logs/controllers/user.logs.js +44 -44
  100. package/server/routes/logs/index.mjs +9 -9
  101. package/server/routes/menu/controllers/addMenu.js +37 -37
  102. package/server/routes/menu/controllers/delMenu.js +31 -31
  103. package/server/routes/menu/controllers/editMenu.js +41 -41
  104. package/server/routes/menu/controllers/getMenu.js +24 -24
  105. package/server/routes/menu/functions/getMenu.js +50 -50
  106. package/server/routes/menu/index.mjs +13 -13
  107. package/server/routes/migration/controllers/collectionToCustom.js +137 -137
  108. package/server/routes/migration/index.mjs +8 -8
  109. package/server/routes/root.mjs +8 -8
  110. package/server/routes/tags/controllers/add.tags.js +24 -24
  111. package/server/routes/tags/controllers/del.tags.js +19 -19
  112. package/server/routes/tags/controllers/edit.tags.js +25 -25
  113. package/server/routes/tags/controllers/get.tags.js +15 -15
  114. package/server/routes/tags/index.mjs +14 -14
  115. package/server/templates/cls/cms.category_type.json +9 -9
  116. package/server/templates/cls/cms.content_review_status.json +9 -9
  117. package/server/templates/cls/cms.content_status.json +9 -9
  118. package/server/templates/cls/cms.content_type.json +9 -9
  119. package/server/templates/cls/cms.lang.json +9 -9
  120. package/server/templates/page/login.html +126 -126
  121. package/server/templates/select/core.user_mentioned.sql +1 -1
  122. package/utils.d.ts +52 -52
  123. package/utils.js +8 -8
  124. package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-umRzB5mY.js +0 -53
  125. package/dist/EditCollectionPage-DIr1tdtn.js +0 -187
  126. package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js +0 -84
  127. package/dist/images/logo.png +0 -0
  128. package/dist/index.html +0 -29
  129. 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-BJh-tjam.js";
6
+ const Z = {
7
+ monaco: k(() => import("./vs-builder-monaco-Cw-f19gc.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-Db-3Jc3E.js")
11
+ () => import("./MonacoEditor-ByPT8pnv.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-DFEBS0NB.js")), y = m(() => import("./AddNewItemInTree-05PSSEFi.js")), g = m(
15
- () => import("./MonacoEditor-Db-3Jc3E.js")
14
+ const v = m(() => import("./MenuList-BLIpeqSd.js")), y = m(() => import("./AddNewItemInTree-05PSSEFi.js")), g = m(
15
+ () => import("./MonacoEditor-ByPT8pnv.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.1 https://github.com/nodeca/js-yaml @license MIT */
7
+ /*! js-yaml 4.1.0 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-rN5j4YBu.js")
877
+ () => import("./MenuBody-Bi0ONVZf.js")
878
878
  ), n = Q(
879
- () => import("./MonacoEditor-Db-3Jc3E.js")
879
+ () => import("./MonacoEditor-ByPT8pnv.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 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";
1
+ import { openBlock as a, createElementBlock as d, createStaticVNode as D, defineComponent as E, ref as b, normalizeClass as z, createTextVNode as M, toDisplayString as h, createCommentVNode as _, createBlock as C, unref as p, withModifiers as f, createVNode as v, createElementVNode as m, 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(r, o) {
19
- return l(), u("svg", F, [...o[0] || (o[0] = [
18
+ function G(u, o) {
19
+ return a(), d("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(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);
39
+ setup(u, { emit: o }) {
40
+ const i = u, g = o, r = b(!1), e = b(""), k = () => {
41
+ typeof i.value == "string" && (e.value = i.value, r.value = !0);
42
42
  }, c = () => {
43
- typeof i.value == "string" && (m("update:value", e.value), a.value = !1);
43
+ typeof i.value == "string" && (g("update:value", e.value), r.value = !1);
44
44
  }, x = () => {
45
- a.value = !1, e.value = "";
45
+ r.value = !1, e.value = "";
46
46
  };
47
- return (_, t) => (l(), u("div", {
48
- class: z([{ "space-y-1": typeof r.value != "string" }, "dark:bg-transparent"])
47
+ return (s, t) => (a(), d("div", {
48
+ class: z([{ "space-y-1": typeof s.value != "string" }, "dark:bg-transparent"])
49
49
  }, [
50
- a.value ? (l(), u("div", R, [
51
- v("span", W, f(r.title) + ":", 1),
52
- $(v("input", {
53
- "onUpdate:modelValue": t[1] || (t[1] = (s) => e.value = s),
50
+ r.value ? (a(), d("div", R, [
51
+ m("span", W, h(s.title) + ":", 1),
52
+ $(m("input", {
53
+ "onUpdate:modelValue": t[1] || (t[1] = (l) => e.value = l),
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
- v("button", {
66
- onClick: y(c, ["stop"]),
65
+ m("button", {
66
+ onClick: f(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
- p(d(K), { class: "size-4" })
70
+ v(p(K), { class: "size-4" })
71
71
  ]),
72
- v("button", {
73
- onClick: y(x, ["stop"]),
72
+ m("button", {
73
+ onClick: f(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
- p(d(O), { class: "size-4" })
77
+ v(p(O), { class: "size-4" })
78
78
  ])
79
- ])) : (l(), u("div", J, [
80
- M(f(r.title) + " ", 1),
81
- typeof r.value == "string" ? (l(), u("span", Q, f(r.value), 1)) : b("", !0),
82
- typeof r.value == "string" ? (l(), C(d(S), {
79
+ ])) : (a(), d("div", J, [
80
+ M(h(s.title) + " ", 1),
81
+ typeof s.value == "string" ? (a(), d("span", Q, h(s.value), 1)) : _("", !0),
82
+ typeof s.value == "string" ? (a(), C(p(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: y(g, ["stop"])
86
- })) : b("", !0),
87
- p(d(j), {
85
+ onClick: f(k, ["stop"])
86
+ })) : _("", !0),
87
+ v(p(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] = y((s) => m("delete"), ["stop"]))
89
+ onClick: t[0] || (t[0] = f((l) => g("delete"), ["stop"]))
90
90
  }),
91
- p(H, { class: "shrink-0 size-4 cursor-pointer text-gray-500 dark:text-neutral-500" })
91
+ v(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(r, { emit: o }) {
109
- const { t: i } = X(), m = r, a = o, e = h([]);
108
+ setup(u, { emit: o }) {
109
+ const { t: i } = X(), g = u, r = o, e = b([]);
110
110
  N(
111
- () => m.list,
111
+ () => g.list,
112
112
  (t) => {
113
113
  e.value = t ? [...t] : [];
114
114
  },
115
115
  { immediate: !0, deep: !0 }
116
116
  );
117
- const g = () => {
118
- a("update:list", e.value);
117
+ const k = () => {
118
+ r("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
- a("update:list", e.value), a("delete:item", t);
125
+ r("update:list", e.value), r("delete:item", t);
126
126
  }
127
127
  });
128
- }, x = (t, s) => {
129
- t.value = s, V(() => {
130
- e.value = [...e.value], a("update:list", e.value);
128
+ }, x = (t, l) => {
129
+ t.value = l, V(() => {
130
+ e.value = [...e.value], r("update:list", e.value);
131
131
  });
132
- }, _ = (t, s) => {
133
- t.children = s, V(() => {
134
- e.value = [...e.value], a("update:list", e.value);
132
+ }, s = (t, l) => {
133
+ t.children = l, V(() => {
134
+ e.value = [...e.value], r("update:list", e.value);
135
135
  });
136
136
  };
137
- return (t, s) => {
137
+ return (t, l) => {
138
138
  const B = T("MenuList", !0);
139
- return l(), C(d(A), {
139
+ return a(), C(p(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": r.inside }]),
145
- onChange: g,
146
- onEnd: g
144
+ class: z(["nested-sortable space-y-1", { "ps-5 dark:bg-transparent": u.inside }]),
145
+ onChange: k,
146
+ onEnd: k
147
147
  }, {
148
148
  item: U(({ element: n }) => [
149
- v("div", Z, [
150
- p(Y, {
149
+ m("div", Z, [
150
+ v(Y, {
151
151
  title: n.title,
152
152
  value: n.value,
153
- onDelete: (k) => c(n),
154
- "onUpdate:value": (k) => x(n, k)
153
+ onDelete: (y) => c(n),
154
+ "onUpdate:value": (y) => x(n, y)
155
155
  }, null, 8, ["title", "value", "onDelete", "onUpdate:value"]),
156
- Array.isArray(n.children) ? (l(), C(B, {
156
+ Array.isArray(n.children) ? (a(), C(B, {
157
157
  key: 0,
158
158
  list: n.children,
159
159
  inside: !0,
160
- "onUpdate:list": (k) => _(n, k),
160
+ "onUpdate:list": (y) => s(n, y),
161
161
  "onDelete:item": c
162
- }, null, 8, ["list", "onUpdate:list"])) : b("", !0)
162
+ }, null, 8, ["list", "onUpdate:list"])) : _("", !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-CzqPG-tY.js")
14
+ () => import("./UniversalTable-GBd_pStq.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-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"));
6
+ const o = n(() => import("./MenuPage-3W6jZ15H.js")), r = n(() => import("./MenuAddPage-QTnwCoGh.js")), p = n(() => import("./MenuItemPage-B7Y9KFyb.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
  });
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js";
1
+ import { _ as f } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -0,0 +1,84 @@
1
+ import { defineComponent as s, mergeModels as m, useModel as c, ref as f, onMounted as h, watch as d, onBeforeUnmount as p, openBlock as g, createElementBlock as v, normalizeStyle as w } from "vue";
2
+ async function M() {
3
+ if (window.monaco)
4
+ return window.monaco;
5
+ const i = "https://cdn.jsdelivr.net/npm/monaco-editor@0.45.0/min";
6
+ return window.require || (window.require = { paths: { vs: `${i}/vs` } }, await new Promise((t, l) => {
7
+ const n = document.createElement("script");
8
+ n.src = `${i}/vs/loader.min.js`, n.onload = () => t(), n.onerror = l, document.head.appendChild(n);
9
+ })), new Promise((t) => {
10
+ window.require(["vs/editor/editor.main"], () => t(window.monaco));
11
+ });
12
+ }
13
+ const C = /* @__PURE__ */ s({
14
+ __name: "MonacoEditor",
15
+ props: /* @__PURE__ */ m({
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(i) {
31
+ const t = i, l = c(i, "modelValue"), n = f(null);
32
+ let o = null, r = null;
33
+ return h(async () => {
34
+ var e;
35
+ if (n.value)
36
+ try {
37
+ r = await M();
38
+ const a = ((e = l.value) == null ? void 0 : e.replace(/\\n/g, `
39
+ `)) || "";
40
+ o = r.editor.create(n.value, {
41
+ value: a,
42
+ language: t.language,
43
+ theme: t.theme,
44
+ automaticLayout: !0,
45
+ ...t.options
46
+ }), o.onDidChangeModelContent(() => {
47
+ const u = (o == null ? void 0 : o.getValue()) || "";
48
+ l.value = u;
49
+ });
50
+ } catch (a) {
51
+ console.error("Failed to load Monaco Editor:", a);
52
+ }
53
+ }), d(
54
+ () => l.value,
55
+ (e) => {
56
+ if (o) {
57
+ const a = (e == null ? void 0 : e.replace(/\\n/g, `
58
+ `)) || "";
59
+ a !== o.getValue() && o.setValue(a);
60
+ }
61
+ },
62
+ { immediate: !0 }
63
+ ), d(
64
+ () => t.language,
65
+ (e) => {
66
+ o && e && r && r.editor.setModelLanguage(o.getModel(), e);
67
+ }
68
+ ), d(
69
+ () => t.theme,
70
+ (e) => {
71
+ o && e && r && r.editor.setTheme(e);
72
+ }
73
+ ), p(() => {
74
+ o && (o.dispose(), o = null);
75
+ }), (e, a) => (g(), v("div", {
76
+ ref_key: "editorContainer",
77
+ ref: n,
78
+ style: w({ width: e.width, height: e.height })
79
+ }, null, 4));
80
+ }
81
+ });
82
+ export {
83
+ C as _
84
+ };