@opengis/cms 0.0.60 → 0.0.62

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-BjYzvTWM.js → ArticlesPage-CFjE_cw_.js} +3 -3
  3. package/dist/{CollectionsBreadcrumb-HePNJb-d.js → CollectionsBreadcrumb-BCxeRikP.js} +1 -1
  4. package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-umRzB5mY.js +53 -0
  5. package/dist/{Dashboard-CXkg_pk8.js → Dashboard-C1eGscNd.js} +132 -132
  6. package/dist/{EditCollectionPage-BycuD920.js → EditCollectionPage-C4uNmBJf.js} +3 -3
  7. package/dist/{MenuAddPage-QTnwCoGh.js → MenuAddPage-D-p3gFgm.js} +1 -1
  8. package/dist/{MenuBody-Bi0ONVZf.js → MenuBody-rN5j4YBu.js} +2 -2
  9. package/dist/{MenuItemPage-B7Y9KFyb.js → MenuItemPage-BoJw885D.js} +3 -3
  10. package/dist/{MenuList-BLIpeqSd.js → MenuList-DFEBS0NB.js} +53 -53
  11. package/dist/{MenuPage-3W6jZ15H.js → MenuPage-BCZB_S8j.js} +1 -1
  12. package/dist/{MenuWrapper-OrOv6sOb.js → MenuWrapper-AZ_8s-zd.js} +1 -1
  13. package/dist/{MonacoEditor-ByPT8pnv.js → MonacoEditor-Db-3Jc3E.js} +1 -1
  14. package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js +84 -0
  15. package/dist/{UniversalTable-GBd_pStq.js → UniversalTable-CzqPG-tY.js} +80 -80
  16. package/dist/{UniversalTablePagination-Dw2hc0nc.js → UniversalTablePagination-4gL47A7I.js} +46 -46
  17. package/dist/{contentForm-yMn63kza.js → contentForm-CcFbUeal.js} +146 -151
  18. package/dist/index.js +5 -5
  19. package/dist/{vs-builder-monaco-Cw-f19gc.js → vs-builder-monaco-B3Jj0V31.js} +1 -1
  20. package/dist/{vs-builder-preview-BH4VAM3a.js → vs-builder-preview-DL3RYMp7.js} +11 -12
  21. package/dist/vs-form-custom-datatable-D880w8gx.js +493 -0
  22. package/input-types.json +9 -9
  23. package/locales/en.json +815 -815
  24. package/locales/uk.json +813 -813
  25. package/module/cms/cls/content.status.json +17 -17
  26. package/module/cms/cls/user_type.json +9 -9
  27. package/module/cms/form/admin.users.form.json +77 -77
  28. package/module/cms/select/cms.page_type.sql +1 -1
  29. package/module/cms/select/news_tag_id.sql +11 -11
  30. package/module/cms/table/admin.users.table.json +53 -53
  31. package/module/cms/table/collection.default.table.json +96 -96
  32. package/module/cms/table/single.default.table.json +116 -116
  33. package/package.json +2 -2
  34. package/plugin.js +43 -43
  35. package/server/app.js +35 -35
  36. package/server/config.js +4 -4
  37. package/server/functions/getContent.js +45 -45
  38. package/server/functions/getDraftKey.js +22 -22
  39. package/server/functions/getSearchData.js +31 -31
  40. package/server/functions/getTags.js +30 -30
  41. package/server/functions/getUser.js +27 -27
  42. package/server/functions/utils/mock.reply.js +55 -55
  43. package/server/index.js +22 -22
  44. package/server/migrations/fixes.sql +132 -129
  45. package/server/migrations/site.sql +596 -595
  46. package/server/plugins/adminHook.js +78 -78
  47. package/server/plugins/hook.js +59 -59
  48. package/server/plugins/vite.js +75 -75
  49. package/server/routes/category/controllers/cms.category.delete.js +21 -21
  50. package/server/routes/category/controllers/cms.category.get.js +17 -17
  51. package/server/routes/category/controllers/cms.category.list.js +16 -16
  52. package/server/routes/category/controllers/cms.category.post.js +21 -21
  53. package/server/routes/category/controllers/cms.category.put.js +23 -23
  54. package/server/routes/category/index.mjs +22 -22
  55. package/server/routes/cms/controllers/cmsStat.js +55 -55
  56. package/server/routes/cms/controllers/cmsSuggest.js +57 -57
  57. package/server/routes/cms/controllers/deleteContent.js +113 -113
  58. package/server/routes/cms/controllers/deleteMedia.js +76 -76
  59. package/server/routes/cms/controllers/downloadMedia.js +84 -84
  60. package/server/routes/cms/controllers/getContent.js +113 -113
  61. package/server/routes/cms/controllers/getContentBySlug.js +93 -93
  62. package/server/routes/cms/controllers/getPermissions.js +15 -15
  63. package/server/routes/cms/controllers/insertContent.js +226 -217
  64. package/server/routes/cms/controllers/listMedia.js +155 -155
  65. package/server/routes/cms/controllers/metadataMedia.js +39 -39
  66. package/server/routes/cms/controllers/properties.get.js +18 -18
  67. package/server/routes/cms/controllers/properties.post.js +99 -99
  68. package/server/routes/cms/controllers/searchContent.js +214 -214
  69. package/server/routes/cms/controllers/setPermissions.js +49 -49
  70. package/server/routes/cms/controllers/translate.js +89 -89
  71. package/server/routes/cms/controllers/updateContent.js +231 -266
  72. package/server/routes/cms/controllers/uploadMedia.js +79 -79
  73. package/server/routes/cms/functions/getSettings.js +48 -48
  74. package/server/routes/cms/index.mjs +112 -112
  75. package/server/routes/cms/utils/additionalData.js +35 -35
  76. package/server/routes/cms/utils/getCollection.js +89 -89
  77. package/server/routes/cms/utils/getSingle.js +188 -188
  78. package/server/routes/cms/utils/inputTypes.js +5 -5
  79. package/server/routes/cms/utils/insertContentLocalization.js +104 -104
  80. package/server/routes/cms/utils/requestTranslation.js +135 -113
  81. package/server/routes/cms/utils/updateLocalization.js +42 -47
  82. package/server/routes/cmsSpace/controllers/deleteSpace.js +26 -25
  83. package/server/routes/cmsSpace/controllers/getSpaces.js +28 -27
  84. package/server/routes/cmsSpace/controllers/insertSpace.js +22 -21
  85. package/server/routes/cmsSpace/controllers/updateSpace.js +24 -23
  86. package/server/routes/cmsSpace/index.mjs +20 -20
  87. package/server/routes/contentType/controllers/addContentType.js +160 -160
  88. package/server/routes/contentType/controllers/contentTypeList.js +47 -54
  89. package/server/routes/contentType/controllers/delContentType.js +75 -75
  90. package/server/routes/contentType/controllers/editContentType.js +70 -88
  91. package/server/routes/contentType/controllers/getContentType.js +57 -65
  92. package/server/routes/contentType/index.mjs +35 -35
  93. package/server/routes/contentType/utils/updateContents.js +44 -44
  94. package/server/routes/contentType/utils/updateCustomContentTable.js +53 -53
  95. package/server/routes/feedback/controllers/email.list.js +24 -24
  96. package/server/routes/feedback/controllers/feedback.js +48 -48
  97. package/server/routes/feedback/controllers/feedback.list.js +37 -37
  98. package/server/routes/feedback/controllers/news.subscriptions.js +44 -44
  99. package/server/routes/feedback/index.mjs +71 -71
  100. package/server/routes/logs/controllers/export.user.logs.js +77 -77
  101. package/server/routes/logs/controllers/user.logs.js +44 -44
  102. package/server/routes/logs/index.mjs +9 -9
  103. package/server/routes/menu/controllers/addMenu.js +37 -37
  104. package/server/routes/menu/controllers/delMenu.js +31 -31
  105. package/server/routes/menu/controllers/editMenu.js +41 -41
  106. package/server/routes/menu/controllers/getMenu.js +24 -24
  107. package/server/routes/menu/functions/getMenu.js +50 -50
  108. package/server/routes/menu/index.mjs +13 -13
  109. package/server/routes/migration/controllers/collectionToCustom.js +137 -137
  110. package/server/routes/migration/index.mjs +8 -8
  111. package/server/routes/root.mjs +8 -8
  112. package/server/routes/tags/controllers/add.tags.js +24 -24
  113. package/server/routes/tags/controllers/del.tags.js +19 -19
  114. package/server/routes/tags/controllers/edit.tags.js +25 -25
  115. package/server/routes/tags/controllers/get.tags.js +15 -15
  116. package/server/routes/tags/index.mjs +14 -14
  117. package/server/templates/cls/cms.category_type.json +9 -9
  118. package/server/templates/cls/cms.content_review_status.json +9 -9
  119. package/server/templates/cls/cms.content_status.json +9 -9
  120. package/server/templates/cls/cms.content_type.json +9 -9
  121. package/server/templates/cls/cms.lang.json +9 -9
  122. package/server/templates/page/login.html +126 -126
  123. package/server/templates/select/core.user_mentioned.sql +1 -1
  124. package/utils.d.ts +52 -52
  125. package/utils.js +8 -8
  126. package/dist/CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-BJh-tjam.js +0 -53
  127. package/dist/MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js +0 -84
  128. package/dist/getField-CpwVE28P.js +0 -179
  129. package/dist/vs-form-custom-datatable-BDZo48w3.js +0 -317
@@ -1,10 +1,10 @@
1
- import { defineComponent as Pe, defineAsyncComponent as h, inject as le, ref as p, getCurrentInstance as Be, toRef as Ee, computed as m, watch as De, onMounted as Ie, openBlock as w, createElementBlock as $, createElementVNode as u, createVNode as C, unref as v, toDisplayString as j, createCommentVNode as S, createTextVNode as ae, Fragment as Ne, renderList as Me, normalizeClass as ne, createBlock as ie, withDirectives as q, vModelCheckbox as Re, vShow as re, nextTick as ce } from "vue";
2
- import { useRouter as Ue, useRoute as Oe } from "vue-router";
3
- import { ArrowLeft as Je, HelpCircle as He, Settings as Ke, Save as qe, Loader2 as Ge } from "lucide-vue-next";
4
- import { useI18n as Qe } from "vue-i18n";
5
- import { g as We } from "./getField-CpwVE28P.js";
1
+ import { defineComponent as Pe, defineAsyncComponent as k, inject as le, ref as v, getCurrentInstance as Be, toRef as Ee, computed as m, watch as Fe, onMounted as Ie, openBlock as h, createElementBlock as $, createElementVNode as u, createVNode as C, unref as p, toDisplayString as j, createCommentVNode as S, createTextVNode as ne, Fragment as Ne, renderList as De, normalizeClass as ae, createBlock as ie, withDirectives as q, vModelCheckbox as Me, vShow as re, nextTick as ce } from "vue";
2
+ import { useRouter as Re, useRoute as Ue } from "vue-router";
3
+ import { ArrowLeft as Oe, HelpCircle as Je, Settings as He, Save as Ke, Loader2 as qe } from "lucide-vue-next";
4
+ import { useI18n as Ge } from "vue-i18n";
5
+ import { _ as Qe, g as We } from "./vs-form-custom-datatable-D880w8gx.js";
6
6
  import { inputs as x, VForm as ue } from "@opengis/form";
7
- import { notify as P } from "@opengis/core";
7
+ import { notify as B } from "@opengis/core";
8
8
  const Xe = [
9
9
  {
10
10
  key: "title",
@@ -30,10 +30,10 @@ const Xe = [
30
30
  type: "key-value",
31
31
  ignore: ["title", "description", "keywords"]
32
32
  }
33
- ], Ye = { class: "space-y-6 mx-auto relativ max-w-[90%]" }, Ze = { class: "" }, et = { class: "flex items-center justify-between" }, tt = { class: "flex items-center gap-4" }, st = { class: "text-2xl font-semibold text-gray-900 dark:text-white line-clamp-1" }, ot = ["href", "title"], lt = { class: "flex items-center space-x-3" }, at = ["title"], nt = { class: "w-full mt-6 flex items-center justify-between" }, it = { class: "flex items-center w-full h-10 max-w-md grid-cols-3 p-1 bg-white border border-gray-200 rounded-md text-muted-foreground" }, rt = ["onClick"], ct = { class: "flex items-center gap-4" }, ut = ["disabled"], dt = { class: "flex items-center gap-2" }, mt = {
33
+ ], Ye = { class: "space-y-6 mx-auto relativ max-w-[90%]" }, Ze = { class: "" }, et = { class: "flex items-center justify-between" }, tt = { class: "flex items-center gap-4" }, st = { class: "text-2xl font-semibold text-gray-900 dark:text-white line-clamp-1" }, ot = ["href", "title"], lt = { class: "flex items-center space-x-3" }, nt = ["title"], at = { class: "w-full mt-6 flex items-center justify-between" }, it = { class: "flex items-center w-full h-10 max-w-md grid-cols-3 p-1 bg-white border border-gray-200 rounded-md text-muted-foreground" }, rt = ["onClick"], ct = { class: "flex items-center gap-4" }, ut = ["disabled"], dt = { class: "flex items-center gap-2" }, mt = {
34
34
  for: "is_pin",
35
35
  class: "text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer"
36
- }, pt = { class: "relative" }, vt = {
36
+ }, vt = { class: "relative" }, pt = {
37
37
  key: 0,
38
38
  class: "w-3 h-3 text-white",
39
39
  fill: "currentColor",
@@ -47,37 +47,35 @@ const Xe = [
47
47
  }, St = /* @__PURE__ */ Pe({
48
48
  __name: "contentForm",
49
49
  setup(ht) {
50
- const de = h(
50
+ const de = k(
51
51
  () => import("./vs-form-reference-list-Dtv8fJJU.js")
52
- ), me = h(
52
+ ), me = k(
53
53
  () => import("./vs-form-tiptap-DDFQjRjY.js")
54
- ), E = h(
54
+ ), F = k(
55
55
  () => import("./vs-form-media-select-NY27EaG1.js")
56
- ), pe = h(
56
+ ), ve = k(
57
57
  () => import("./vs-richtext-md-C098v_6Q.js")
58
- ), ve = h(
58
+ ), pe = k(
59
59
  () => import("./vs-form-integer-BZ855R3g.js")
60
- ), fe = h(
61
- () => import("./vs-form-custom-datatable-BDZo48w3.js")
62
- ), ye = h(
60
+ ), fe = k(
63
61
  () => import("./vs-form-reletion-link-BhzNQszm.js")
64
- ), ge = h(
62
+ ), ye = k(
65
63
  () => import("./VsFormTags-CMjiu9sY.js")
66
- ), be = h(
64
+ ), ge = k(
67
65
  () => import("./VsPreview-DwETkOpb.js")
68
- ), he = h(
69
- () => import("./CollectionsBreadcrumb-HePNJb-d.js")
66
+ ), be = k(
67
+ () => import("./CollectionsBreadcrumb-BCxeRikP.js")
70
68
  );
71
- x["vs-input-custom-datatable"] = fe, x["vs-input-reference"] = de, x["vs-input-texteditor"] = me, x["vs-input-mediaselect"] = E, x["vs-input-file"] = E, x["vs-input-image"] = E, x["vs-input-richtext-md"] = pe, x["vs-input-integer"] = ve, x["vs-input-relation-link"] = ye;
72
- const { t: r, locale: G } = Qe(), V = Ue(), d = Oe(), Q = le("cms.menu", null) || le("menu", p([])), _ = p([]), D = p({}), W = p({}), I = p({}), N = p(""), M = p(!0), R = Be(), U = R == null ? void 0 : R.appContext, we = (U == null ? void 0 : U.config.globalProperties) || {}, X = Ee(we, "$settings"), B = m(() => {
69
+ x["vs-input-custom-datatable"] = Qe, x["vs-input-reference"] = de, x["vs-input-texteditor"] = me, x["vs-input-mediaselect"] = F, x["vs-input-file"] = F, x["vs-input-image"] = F, x["vs-input-richtext-md"] = ve, x["vs-input-integer"] = pe, x["vs-input-relation-link"] = fe;
70
+ const { t: r, locale: G } = Ge(), A = Re(), d = Ue(), Q = le("cms.menu", null) || le("menu", v([])), _ = v([]), I = v({}), W = v({}), N = v({}), D = v(""), M = v(!0), R = Be(), U = R == null ? void 0 : R.appContext, he = (U == null ? void 0 : U.config.globalProperties) || {}, X = Ee(he, "$settings"), E = m(() => {
73
71
  var e;
74
72
  return ((e = X.value) == null ? void 0 : e.cms) || {};
75
- }), ke = m(() => Array.isArray(B.value.locales) ? B.value.locales : []), O = m(
76
- () => ke.value.filter(Boolean)
73
+ }), we = m(() => Array.isArray(E.value.locales) ? E.value.locales : []), O = m(
74
+ () => we.value.filter(Boolean)
77
75
  ), Y = m(
78
- () => B.value.locale || O.value[0] || "uk"
76
+ () => E.value.locale || O.value[0] || "uk"
79
77
  );
80
- De(
78
+ Fe(
81
79
  X,
82
80
  () => {
83
81
  _.value.length && (_.value = _.value.map((e) => ({
@@ -86,27 +84,27 @@ const Xe = [
86
84
  },
87
85
  { deep: !0 }
88
86
  );
89
- const xe = (e) => {
87
+ const ke = (e) => {
90
88
  const t = [], o = O.value.filter(
91
- (a) => a !== Y.value
89
+ (n) => n !== Y.value
92
90
  );
93
- return Array.isArray(e) && e.forEach((a) => {
94
- t.push(a), !(!a.localization || o.length === 0) && o.forEach((n) => {
91
+ return Array.isArray(e) && e.forEach((n) => {
92
+ t.push(n), !(!n.localization || o.length === 0) && o.forEach((a) => {
95
93
  t.push({
96
- ...a,
97
- name: `${a.name}:${n}`,
98
- label: `${a.label} (${n})`
94
+ ...n,
95
+ name: `${n.name}:${a}`,
96
+ label: `${n.label} (${a})`
99
97
  });
100
98
  });
101
99
  }), t;
102
- }, Z = m(() => xe(_.value)), _e = m(
100
+ }, Z = m(() => ke(_.value)), xe = m(
103
101
  () => Array.isArray(_.value) && _.value.some(
104
102
  (e) => e.localization === !0 && e.name !== "title"
105
103
  )
106
- ), z = p(!1), $e = m(() => {
104
+ ), z = v(!1), _e = m(() => {
107
105
  var e;
108
106
  return (e = Z.value) == null ? void 0 : e.map(We);
109
- }), Ce = m(() => {
107
+ }), $e = m(() => {
110
108
  G.value;
111
109
  const e = O.value.filter(
112
110
  (t) => t !== Y.value
@@ -118,85 +116,82 @@ const Xe = [
118
116
  };
119
117
  if (!t.localization || e.length === 0)
120
118
  return [o];
121
- const a = e.map((n) => ({
119
+ const n = e.map((a) => ({
122
120
  ...t,
123
- key: `${t.key}:${n}`,
124
- label: `${r(t.label)} (${n})`,
121
+ key: `${t.key}:${a}`,
122
+ label: `${r(t.label)} (${a})`,
125
123
  localization: !1
126
124
  }));
127
- return [o, ...a];
125
+ return [o, ...n];
128
126
  });
129
- }), g = p({}), i = p({
127
+ }), g = v({}), i = v({
130
128
  title: "",
131
129
  status: "draft"
132
- }), J = p(null), L = p(""), F = m(
133
- () => {
134
- var e;
135
- return (((e = i.value) == null ? void 0 : e.type) || J.value) === "single";
136
- }
137
- ), Te = m(() => {
130
+ }), J = v(null), L = v(""), P = m(
131
+ () => J.value === "single"
132
+ ), Ce = m(() => {
138
133
  const e = [
139
134
  { id: "content", name: r("cms.builder.content") },
140
135
  { id: "seo", name: r("cms.builder.seo") },
141
136
  { id: "tags", name: r("cms.builder.tags") }
142
137
  ];
143
- return N.value && e.push({ id: "preview", name: r("cms.builder.preview") }), e;
144
- }), A = p("content"), ee = m(() => {
145
- var s, c, l, k, f, b, y, T, oe;
146
- const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = i.value) == null ? void 0 : l.content_type_id, o = t ? (f = (k = Q.value) == null ? void 0 : k.find((K) => K.id === t)) == null ? void 0 : f.title : null;
138
+ return D.value && e.push({ id: "preview", name: r("cms.builder.preview") }), e;
139
+ }), V = v("content"), ee = m(() => {
140
+ var s, c, l, w, f, b, y, T, oe;
141
+ const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = i.value) == null ? void 0 : l.content_type_id, o = t ? (f = (w = Q.value) == null ? void 0 : w.find((K) => K.id === t)) == null ? void 0 : f.title : null;
147
142
  if (o)
148
143
  return o;
149
144
  if (L.value)
150
145
  return L.value;
151
- const a = (y = (b = Q.value) == null ? void 0 : b.find(
146
+ const n = (y = (b = Q.value) == null ? void 0 : b.find(
152
147
  (K) => K.id === e
153
148
  )) == null ? void 0 : y.title;
154
- if (a)
155
- return a;
156
- const n = (T = d.params) == null ? void 0 : T.id;
157
- return F.value && n && e === n && ((oe = i.value) != null && oe.title) ? i.value.title : e === "pages" ? r("cms.articles.title") : e;
158
- }), Se = m(() => {
149
+ if (n)
150
+ return n;
151
+ const a = (T = d.params) == null ? void 0 : T.id;
152
+ return P.value && a && e === a && ((oe = i.value) != null && oe.title) ? i.value.title : e === "pages" ? r("cms.articles.title") : e;
153
+ }), Te = m(() => {
159
154
  var t, o;
160
- const e = F.value ? "cms.builder.editPage" : "cms.builder.editCollection";
155
+ const e = P.value ? "cms.builder.editPage" : "cms.builder.editCollection";
161
156
  return ((t = i.value) == null ? void 0 : t.title) || ((o = d.params) != null && o.id ? r(e) : r("cms.articles.createArticle"));
162
- }), Ve = m(() => {
157
+ }), Se = m(() => {
163
158
  var s, c, l;
164
- const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = d.params) == null ? void 0 : l.id, o = Se.value, a = o === ee.value, n = [
159
+ const e = ((s = d.params) == null ? void 0 : s.collection) || ((c = d.params) == null ? void 0 : c.id), t = (l = d.params) == null ? void 0 : l.id, o = Te.value, n = o === ee.value, a = [
165
160
  {
166
- label: F ? r("cms.navigation.singletons") : ee.value,
161
+ label: P.value ? r("cms.navigation.singletons") : ee.value,
167
162
  route: `collections/${e}`
168
163
  }
169
164
  ];
170
- return t ? n.push({
171
- label: a ? r("cms.collections.edit") : o,
165
+ return t ? a.push({
166
+ label: n ? r("cms.collections.edit") : o,
172
167
  route: `collections/${e}/${t}`
173
- }) : n.push({
168
+ }) : a.push({
174
169
  label: r("cms.articles.createArticle"),
175
170
  route: `collections/${e}/create`
176
- }), n;
171
+ }), a;
177
172
  }), Ae = (e) => {
178
- e === "collections" ? V.push("/collections") : V.push(`/${e}`);
173
+ e === "collections" ? A.push("/collections") : A.push(`/${e}`);
179
174
  }, te = async (e, t) => {
180
- var o, a;
175
+ var o, n;
181
176
  try {
182
177
  if (!t || !e)
183
178
  return;
184
- const n = await fetch(`/api/cms/${e}/${t}`);
185
- if (!n.ok)
179
+ const a = await fetch(`/api/cms/${e}/${t}`);
180
+ if (!a.ok)
186
181
  throw new Error("Failed to fetch article");
187
- const s = await n.json();
188
- if (_.value = (s == null ? void 0 : s.columns) || [], s != null && s.preview_path && (N.value = s == null ? void 0 : s.preview_path), J.value = (s == null ? void 0 : s.type) || null, s.rows) {
182
+ const s = await a.json();
183
+ if (_.value = (s == null ? void 0 : s.columns) || [], s != null && s.preview_path && (D.value = s == null ? void 0 : s.preview_path), J.value = (s == null ? void 0 : s.type) || null, s.rows) {
189
184
  let c = s.rows;
190
185
  Array.isArray(c) || (c = [c]), i.value = c[0];
191
186
  const l = ((o = c[0]) == null ? void 0 : o.content_type_id) || e;
192
187
  if (l) {
193
- const k = await fetch(`/api/cms-type/${l}`);
194
- if (k.ok) {
195
- const f = await k.json();
188
+ const w = await fetch(`/api/cms-type/${l}`);
189
+ if (w.ok) {
190
+ const f = await w.json();
196
191
  L.value = (f == null ? void 0 : f.title) || (f == null ? void 0 : f.name) || L.value;
197
192
  }
198
193
  }
199
- await ce(), (a = c[0]) != null && a.meta ? g.value = { ...c[0].meta } : g.value = {
194
+ await ce(), (n = c[0]) != null && n.meta ? g.value = { ...c[0].meta } : g.value = {
200
195
  title: "",
201
196
  description: "",
202
197
  keywords: "",
@@ -214,22 +209,22 @@ const Xe = [
214
209
  keywords: "",
215
210
  meta: {}
216
211
  };
217
- } catch (n) {
218
- console.error("Error fetching article:", n);
212
+ } catch (a) {
213
+ console.error("Error fetching article:", a);
219
214
  }
220
215
  };
221
216
  Ie(async () => {
222
- var n, s;
217
+ var a, s;
223
218
  M.value = !0, L.value = "";
224
- const e = (n = d.params) == null ? void 0 : n.collection, t = (s = d.params) == null ? void 0 : s.id, o = e || t, a = e && t ? t : void 0;
219
+ const e = (a = d.params) == null ? void 0 : a.collection, t = (s = d.params) == null ? void 0 : s.id, o = e || t, n = e && t ? t : void 0;
225
220
  try {
226
- if (!a) {
221
+ if (!n) {
227
222
  if (!o)
228
223
  return;
229
224
  const l = await (await fetch(`/api/cms/${o}/`)).json();
230
225
  _.value = l.columns, J.value = (l == null ? void 0 : l.type) || null;
231
226
  }
232
- await te(o, a ?? "");
227
+ await te(o, n ?? "");
233
228
  } finally {
234
229
  M.value = !1;
235
230
  }
@@ -242,34 +237,34 @@ const Xe = [
242
237
  set: (e) => {
243
238
  i.value && (i.value.is_pin = e);
244
239
  }
245
- }), je = () => {
240
+ }), Ve = () => {
246
241
  i.value && (i.value.is_pin = !i.value.is_pin);
247
242
  }, H = m(() => {
248
243
  var t;
249
244
  const e = (t = i.value) == null ? void 0 : t.content_type_id;
250
245
  return e ? `/collections/${e}/edit` : null;
251
- }), ze = () => {
252
- var o, a, n, s;
246
+ }), je = () => {
247
+ var o, n, a, s;
253
248
  if (!H.value)
254
249
  return;
255
- const e = ((o = d.params) == null ? void 0 : o.collection) || ((a = d.params) == null ? void 0 : a.id), t = (n = d.params) == null ? void 0 : n.id;
250
+ const e = ((o = d.params) == null ? void 0 : o.collection) || ((n = d.params) == null ? void 0 : n.id), t = (a = d.params) == null ? void 0 : a.id;
256
251
  if (e && t) {
257
- V.push(`/collections/${(s = i.value) == null ? void 0 : s.content_type_id}/edit`);
252
+ A.push(`/collections/${(s = i.value) == null ? void 0 : s.content_type_id}/edit`);
258
253
  return;
259
254
  }
260
- V.push(H.value);
261
- }, Le = async () => {
262
- var o, a;
263
- const e = (o = d.params) == null ? void 0 : o.collection, t = (a = d.params) == null ? void 0 : a.id;
255
+ A.push(H.value);
256
+ }, ze = async () => {
257
+ var o, n;
258
+ const e = (o = d.params) == null ? void 0 : o.collection, t = (n = d.params) == null ? void 0 : n.id;
264
259
  z.value = !0;
265
260
  try {
266
261
  (await fetch(
267
262
  `/api/cms-translate?id=${t}&collection=${e}&to=en&nocache=1`
268
- )).ok ? (P({
263
+ )).ok ? (B({
269
264
  title: r("cms.collections.translateContentSuccess"),
270
265
  message: r("cms.collections.translateContentSuccess"),
271
266
  type: "success"
272
- }), await te(e, t)) : P({
267
+ }), await te(e, t)) : B({
273
268
  title: r("cms.collections.translateContentError"),
274
269
  message: r("cms.collections.translateContentError"),
275
270
  type: "error"
@@ -277,23 +272,23 @@ const Xe = [
277
272
  } finally {
278
273
  z.value = !1;
279
274
  }
280
- }, Fe = async (e) => {
281
- var c, l, k, f;
282
- const t = (c = d.params) == null ? void 0 : c.collection, o = (l = d.params) == null ? void 0 : l.id, a = await D.value.validate();
283
- if (a) {
284
- P({
275
+ }, Le = async (e) => {
276
+ var c, l, w, f;
277
+ const t = (c = d.params) == null ? void 0 : c.collection, o = (l = d.params) == null ? void 0 : l.id, n = await I.value.validate();
278
+ if (n) {
279
+ B({
285
280
  title: r("cms.validation"),
286
- message: JSON.stringify(a),
281
+ message: JSON.stringify(n),
287
282
  type: "warning"
288
283
  });
289
284
  return;
290
285
  }
291
- (k = I.value) != null && k.restoreTagsBeforeSubmit && await I.value.restoreTagsBeforeSubmit();
292
- const n = g.value || {}, s = {
286
+ (w = N.value) != null && w.restoreTagsBeforeSubmit && await N.value.restoreTagsBeforeSubmit();
287
+ const a = g.value || {}, s = {
293
288
  ...i.value,
294
289
  meta: {
295
- ...n,
296
- ...n.meta || {}
290
+ ...a,
291
+ ...a.meta || {}
297
292
  }
298
293
  };
299
294
  console.log("Payload before submit:", s);
@@ -318,17 +313,17 @@ const Xe = [
318
313
  if (!o)
319
314
  try {
320
315
  const y = await b.json(), T = y.id || ((f = y.data) == null ? void 0 : f.id);
321
- T && d.name === "createArticle" && await V.push(`/collections/${t}/${T}`);
316
+ T && d.name === "createArticle" && await A.push(`/collections/${t}/${T}`);
322
317
  } catch (y) {
323
318
  console.warn("Could not parse response to get ID:", y);
324
319
  }
325
- P({
320
+ B({
326
321
  title: r("cms.common.success"),
327
322
  message: r("cms.common.successMessage"),
328
323
  type: "success"
329
324
  });
330
325
  } catch (b) {
331
- console.error("Submit error:", b), P({
326
+ console.error("Submit error:", b), B({
332
327
  title: r("cms.common.error"),
333
328
  message: "Помилка збереження",
334
329
  type: "error"
@@ -336,101 +331,101 @@ const Xe = [
336
331
  }
337
332
  };
338
333
  return (e, t) => {
339
- var o, a, n, s, c;
340
- return w(), $("div", Ye, [
334
+ var o, n, a, s, c;
335
+ return h(), $("div", Ye, [
341
336
  u("div", Ze, [
342
- C(v(he), {
343
- items: Ve.value,
337
+ C(p(be), {
338
+ items: Se.value,
344
339
  loading: M.value,
345
340
  onNavigate: Ae
346
341
  }, null, 8, ["items", "loading"]),
347
342
  u("div", et, [
348
343
  u("div", tt, [
349
344
  u("button", {
350
- onClick: t[0] || (t[0] = (l) => v(V).back()),
345
+ onClick: t[0] || (t[0] = (l) => p(A).back()),
351
346
  class: "p-2 text-gray-500 rounded-full hover:text-gray-900 dark:text-gray-400 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
352
347
  }, [
353
- C(v(Je), { class: "w-5 h-5" })
348
+ C(p(Oe), { class: "w-5 h-5" })
354
349
  ]),
355
350
  u("h1", st, j(e.$t(
356
- F.value ? "cms.builder.editPage" : "cms.builder.editCollection"
351
+ P.value ? "cms.builder.editPage" : "cms.builder.editCollection"
357
352
  )) + ' "' + j(i.value.title) + '" ', 1),
358
353
  u("a", {
359
- href: `https://cms.opengis.info/${v(G)}/guides/content/`,
354
+ href: `https://cms.opengis.info/${p(G)}/guides/content/`,
360
355
  target: "_blank",
361
356
  title: e.$t("cms.guide.content")
362
357
  }, [
363
- C(v(He), { class: "w-5 h-5" })
358
+ C(p(Je), { class: "w-5 h-5" })
364
359
  ], 8, ot)
365
360
  ]),
366
361
  u("div", lt, [
367
- H.value && F.value ? (w(), $("button", {
362
+ H.value && P.value ? (h(), $("button", {
368
363
  key: 0,
369
- onClick: ze,
364
+ onClick: je,
370
365
  type: "button",
371
366
  title: e.$t("cms.builder.editContentType"),
372
367
  class: "inline-flex items-center justify-center rounded-md h-9 w-9 border border-gray-200 bg-white text-gray-700 shadow-sm transition-all duration-200 transform hover:text-gray-900 hover:shadow-md focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
373
368
  "aria-label": "$t('cms.builder.editContentType')"
374
369
  }, [
375
- C(v(Ke), { class: "w-4 h-4" })
376
- ], 8, at)) : S("", !0),
370
+ C(p(He), { class: "w-4 h-4" })
371
+ ], 8, nt)) : S("", !0),
377
372
  u("button", {
378
- onClick: Fe,
373
+ onClick: Le,
379
374
  type: "submit",
380
375
  class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium h-9 px-4 py-2 bg-blue-600 text-white shadow-md transition-all duration-200 transform hover:bg-blue-700 hover:shadow-lg hover:scale-105 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
381
376
  }, [
382
- C(v(qe), { class: "w-4 h-4 mr-2" }),
383
- ae(" " + j(e.$t("cms.builder.save")), 1)
377
+ C(p(Ke), { class: "w-4 h-4 mr-2" }),
378
+ ne(" " + j(e.$t("cms.builder.save")), 1)
384
379
  ])
385
380
  ])
386
381
  ]),
387
- u("div", nt, [
382
+ u("div", at, [
388
383
  u("div", it, [
389
- (w(!0), $(Ne, null, Me(Te.value, (l) => (w(), $("button", {
384
+ (h(!0), $(Ne, null, De(Ce.value, (l) => (h(), $("button", {
390
385
  key: l.id,
391
- onClick: (k) => {
392
- A.value = l.id, console.log("cmsSettings:", B.value.value);
386
+ onClick: (w) => {
387
+ V.value = l.id, console.log("cmsSettings:", E.value.value);
393
388
  },
394
- class: ne([
389
+ class: ae([
395
390
  "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",
396
- l.id === A.value ? "bg-blue-50 text-blue-700 border-blue-200" : ""
391
+ l.id === V.value ? "bg-blue-50 text-blue-700 border-blue-200" : ""
397
392
  ])
398
393
  }, j(l.name), 11, rt))), 128))
399
394
  ]),
400
395
  u("div", ct, [
401
- (o = v(d).params) != null && o.id && _e.value ? (w(), $("button", {
396
+ (o = p(d).params) != null && o.id && xe.value ? (h(), $("button", {
402
397
  key: 0,
403
398
  type: "button",
404
399
  class: "inline-flex items-center justify-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer bg-white border border-gray-200 rounded-md text-muted-foreground px-4 py-2 disabled:opacity-50 disabled:cursor-not-allowed",
405
400
  disabled: z.value,
406
- onClick: Le
401
+ onClick: ze
407
402
  }, [
408
- z.value ? (w(), ie(v(Ge), {
403
+ z.value ? (h(), ie(p(qe), {
409
404
  key: 0,
410
405
  class: "w-4 h-4 animate-spin shrink-0",
411
406
  "aria-hidden": "true"
412
407
  })) : S("", !0),
413
- ae(" " + j(z.value ? e.$t("cms.collections.translating") : e.$t("cms.collections.enLocalization")), 1)
408
+ ne(" " + j(z.value ? e.$t("cms.collections.translating") : e.$t("cms.collections.enLocalization")), 1)
414
409
  ], 8, ut)) : S("", !0),
415
410
  u("div", dt, [
416
411
  u("label", mt, j(e.$t("cms.collections.pinPublication")), 1),
417
- u("div", pt, [
412
+ u("div", vt, [
418
413
  q(u("input", {
419
414
  type: "checkbox",
420
415
  id: "is_pin",
421
416
  "onUpdate:modelValue": t[1] || (t[1] = (l) => se.value = l),
422
417
  class: "sr-only"
423
418
  }, null, 512), [
424
- [Re, se.value]
419
+ [Me, se.value]
425
420
  ]),
426
421
  u("div", {
427
- class: ne([
422
+ class: ae([
428
423
  "w-5 h-5 border-2 rounded transition-all duration-200 cursor-pointer flex items-center justify-center",
429
- (a = i.value) != null && a.is_pin ? "bg-sky-600 border-sky-600" : "bg-white border-gray-300 hover:border-sky-400 dark:bg-gray-700 dark:border-gray-600 dark:hover:border-sky-400"
424
+ (n = i.value) != null && n.is_pin ? "bg-sky-600 border-sky-600" : "bg-white border-gray-300 hover:border-sky-400 dark:bg-gray-700 dark:border-gray-600 dark:hover:border-sky-400"
430
425
  ]),
431
- onClick: je
426
+ onClick: Ve
432
427
  }, [
433
- (n = i.value) != null && n.is_pin ? (w(), $("svg", vt, [...t[7] || (t[7] = [
428
+ (a = i.value) != null && a.is_pin ? (h(), $("svg", pt, [...t[7] || (t[7] = [
434
429
  u("path", {
435
430
  "fill-rule": "evenodd",
436
431
  d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
@@ -444,40 +439,40 @@ const Xe = [
444
439
  ])
445
440
  ]),
446
441
  q(u("div", ft, [
447
- (s = Z.value) != null && s.length ? (w(), ie(v(ue), {
442
+ (s = Z.value) != null && s.length ? (h(), ie(p(ue), {
448
443
  key: 0,
449
444
  modelValue: i.value,
450
445
  "onUpdate:modelValue": t[2] || (t[2] = (l) => i.value = l),
451
- schema: $e.value,
452
- form: D.value,
453
- "onUpdate:form": t[3] || (t[3] = (l) => D.value = l)
446
+ schema: _e.value,
447
+ form: I.value,
448
+ "onUpdate:form": t[3] || (t[3] = (l) => I.value = l)
454
449
  }, null, 8, ["modelValue", "schema", "form"])) : S("", !0)
455
450
  ], 512), [
456
- [re, A.value === "content"]
451
+ [re, V.value === "content"]
457
452
  ]),
458
453
  q(u("div", yt, [
459
- C(v(ue), {
460
- schema: Ce.value,
454
+ C(p(ue), {
455
+ schema: $e.value,
461
456
  values: g.value,
462
457
  "onUpdate:values": t[4] || (t[4] = (l) => g.value = l),
463
458
  form: W.value,
464
459
  "onUpdate:form": t[5] || (t[5] = (l) => W.value = l)
465
460
  }, null, 8, ["schema", "values", "form"])
466
461
  ], 512), [
467
- [re, A.value === "seo"]
462
+ [re, V.value === "seo"]
468
463
  ]),
469
- A.value === "tags" ? (w(), $("div", gt, [
470
- C(v(ge), {
464
+ V.value === "tags" ? (h(), $("div", gt, [
465
+ C(p(ye), {
471
466
  ref_key: "tagsForm",
472
- ref: I,
467
+ ref: N,
473
468
  modelValue: i.value,
474
469
  "onUpdate:modelValue": t[6] || (t[6] = (l) => i.value = l)
475
470
  }, null, 8, ["modelValue"])
476
471
  ])) : S("", !0),
477
- A.value === "preview" ? (w(), $("div", bt, [
478
- C(v(be), {
472
+ V.value === "preview" ? (h(), $("div", bt, [
473
+ C(p(ge), {
479
474
  slug: (c = i.value) == null ? void 0 : c.slug,
480
- preview_path: N.value
475
+ preview_path: D.value
481
476
  }, null, 8, ["slug", "preview_path"])
482
477
  ])) : S("", !0)
483
478
  ]);
package/dist/index.js CHANGED
@@ -3,12 +3,12 @@ import { useRoute as $, routeLocationKey as K } from "vue-router";
3
3
  const O = "menu", B = (s, c, a) => {
4
4
  const o = s == null ? void 0 : s.trim(), l = a == null ? void 0 : a.trim();
5
5
  return o ? o === O ? c ? c === "create" ? { type: "createMenu", collection: o } : { type: "editMenu", collection: o, id: c } : { type: "menu", collection: o } : l === "edit" && c ? { type: "editCollection", collection: o, id: c } : c === "edit" ? { type: "editCollection", collection: o } : c ? c === "create" ? { type: "createArticle", collection: o } : { type: "editArticle", collection: o, id: c } : { type: "articles", collection: o } : { type: "collections" };
6
- }, R = u(() => import("./CollectionsPage-DHfPNql6.js")), L = u(() => import("./ArticlesPage-BjYzvTWM.js")), C = u(() => import("./contentForm-yMn63kza.js")), N = u(() => import("./EditCollectionPage-BycuD920.js")), W = u(
7
- () => import("./MenuPage-3W6jZ15H.js")
6
+ }, R = u(() => import("./CollectionsPage-DHfPNql6.js")), L = u(() => import("./ArticlesPage-CFjE_cw_.js")), C = u(() => import("./contentForm-CcFbUeal.js")), N = u(() => import("./EditCollectionPage-C4uNmBJf.js")), W = u(
7
+ () => import("./MenuPage-BCZB_S8j.js")
8
8
  ), j = u(
9
- () => import("./MenuItemPage-B7Y9KFyb.js")
9
+ () => import("./MenuItemPage-BoJw885D.js")
10
10
  ), F = u(
11
- () => import("./MenuAddPage-QTnwCoGh.js")
11
+ () => import("./MenuAddPage-D-p3gFgm.js")
12
12
  ), S = {
13
13
  collections: R,
14
14
  articles: L,
@@ -96,7 +96,7 @@ const O = "menu", B = (s, c, a) => {
96
96
  });
97
97
  return M(K, b), (e, n) => v.value ? (g(), k(x(v.value), { key: w.value })) : (g(), E("div", V, D(e.$t("cms.navigation.collections")), 1));
98
98
  }
99
- }), H = u(() => import("./Dashboard-CXkg_pk8.js")), J = u(() => import("./MenuWrapper-OrOv6sOb.js")), Q = q;
99
+ }), H = u(() => import("./Dashboard-C1eGscNd.js")), J = u(() => import("./MenuWrapper-AZ_8s-zd.js")), Q = q;
100
100
  export {
101
101
  Q as Content,
102
102
  H as Dashboard,
@@ -1,5 +1,5 @@
1
1
  import { ref as l, useModel as m, onMounted as u, openBlock as r, createElementBlock as d, createVNode as i, createCommentVNode as s } from "vue";
2
- import { _ as c } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-C8cip9Ci.js";
2
+ import { _ as c } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-B1DrxmQX.js";
3
3
  const g = {
4
4
  __name: "vs-builder-monaco",
5
5
  props: {