@opengis/cms 0.0.52 → 0.0.53

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 (24) hide show
  1. package/dist/{ArticlesPage-Cddv2qte.js → ArticlesPage-dx7Se1Xo.js} +5 -5
  2. package/dist/{BuilderPage-BgcBJcw7.js → BuilderPage-ChkWE8rE.js} +6 -6
  3. package/dist/{CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-C-k8QGA-.js → CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js} +1 -1
  4. package/dist/{CollectionsPage-d5MLIIAG.js → CollectionsPage-JfmrHNR_.js} +3 -3
  5. package/dist/{CreateForm-B0srHu5e.js → CreateForm-BMOBeP4G.js} +2 -2
  6. package/dist/{EditCollectionPage-NUVatLkY.js → EditCollectionPage-H1J9pZNo.js} +5 -5
  7. package/dist/{EmptyData-BSW20VKP.js → EmptyData-DaZt_nAm.js} +5 -5
  8. package/dist/{MenuAddPage-Cn3JN04F.js → MenuAddPage-B6Qs6qV8.js} +3 -3
  9. package/dist/{MenuItemPage-B0Th9EOe.js → MenuItemPage-XN9lx5Vv.js} +3 -3
  10. package/dist/{MenuPage-DQpD3IXx.js → MenuPage-tJZtK46W.js} +4 -4
  11. package/dist/{MonacoEditor.vue_vue_type_script_setup_true_lang-CTKNG0qR.js → MonacoEditor.vue_vue_type_script_setup_true_lang-DQjDxfF8.js} +7 -7
  12. package/dist/{UniversalTable.vue_vue_type_script_setup_true_lang-DW6O-xoY.js → UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js} +6 -6
  13. package/dist/{UniversalTablePagination.vue_vue_type_script_setup_true_lang-DBIPBmpm.js → UniversalTablePagination.vue_vue_type_script_setup_true_lang-Cp1WWIf0.js} +7 -7
  14. package/dist/{contentForm-C4Jp-FbQ.js → contentForm-BgEoJcWF.js} +3 -3
  15. package/dist/{getField-CKcz_b0t.js → getField-DoisYj34.js} +2 -2
  16. package/dist/index.js +7 -7
  17. package/dist/{vuedraggable-mqqAYsch.js → vuedraggable-DTHNuRWs.js} +2 -2
  18. package/package.json +1 -1
  19. package/server/functions/getTags.js +30 -0
  20. package/server/routes/cms/controllers/translate.js +3 -3
  21. package/server/routes/cms/utils/insertContentLocalization.js +22 -4
  22. package/server/routes/contentType/controllers/getContentType.js +9 -2
  23. package/server/routes/tags/controllers/get.tags.js +1 -1
  24. package/utils.js +1 -0
@@ -1,14 +1,14 @@
1
- import { defineComponent as te, ref as n, inject as ae, computed as I, onMounted as se, watch as D, nextTick as M, createElementBlock as d, openBlock as i, createVNode as _, createElementVNode as r, toDisplayString as h, unref as b, createCommentVNode as f, createTextVNode as le, createBlock as q } from "vue";
1
+ import { defineComponent as te, ref as n, inject as ae, computed as I, onMounted as se, watch as D, nextTick as M, openBlock as i, createElementBlock as d, createVNode as _, createElementVNode as r, toDisplayString as h, unref as b, createTextVNode as le, createCommentVNode as f, createBlock as q } from "vue";
2
2
  import { useRoute as ne, useRouter as oe } from "vue-router";
3
3
  import { HelpCircle as ie, Plus as re, ChevronDown as ce, Calendar as R, User as ue, Globe as me, FileText as de } from "lucide-vue-next";
4
- import { _ as pe } from "./UniversalTable.vue_vue_type_script_setup_true_lang-DW6O-xoY.js";
5
- import { _ as fe } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-DBIPBmpm.js";
4
+ import { _ as pe } from "./UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js";
5
+ import { _ as fe } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-Cp1WWIf0.js";
6
6
  import { VsInputCheckbox as ve } from "@opengis/form";
7
7
  import he from "@opengis/filter";
8
8
  import { confirm as S } from "@opengis/core";
9
9
  import { useI18n as be } from "vue-i18n";
10
- import { _ as ge } from "./EmptyData-BSW20VKP.js";
11
- import { _ as ye } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-C-k8QGA-.js";
10
+ import { _ as ge } from "./EmptyData-DaZt_nAm.js";
11
+ import { _ as ye } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js";
12
12
  const we = { class: "space-y-6 mx-auto max-w-[90%]" }, xe = { class: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between" }, _e = { class: "flex items-center gap-2" }, ke = { class: "text-3xl font-bold text-slate-800 dark:text-white mb-2" }, Ce = ["href", "title"], $e = { class: "flex items-center gap-2" }, Ae = {
13
13
  key: 0,
14
14
  class: "text-card-foreground shadow-lg border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm"
@@ -1,10 +1,10 @@
1
- import { inject as R, unref as i, version as X, ref as m, watchEffect as J, watch as M, getCurrentInstance as Y, onBeforeUnmount as Z, onDeactivated as ee, onActivated as te, createElementBlock as C, openBlock as u, createStaticVNode as Q, defineComponent as q, Fragment as se, renderList as oe, createElementVNode as t, createBlock as V, createCommentVNode as T, toDisplayString as f, normalizeClass as E, createTextVNode as re, resolveDynamicComponent as ne, renderSlot as le, withModifiers as N, createVNode as w, onMounted as ae, computed as ie, withDirectives as de, vModelText as ce, withCtx as ue } from "vue";
2
- import { _ as he } from "./CreateForm-B0srHu5e.js";
1
+ import { inject as R, unref as i, version as X, ref as m, watchEffect as J, watch as M, getCurrentInstance as Y, onBeforeUnmount as Z, onDeactivated as ee, onActivated as te, openBlock as u, createElementBlock as C, createStaticVNode as Q, defineComponent as q, Fragment as se, renderList as oe, createElementVNode as t, createBlock as V, toDisplayString as f, normalizeClass as E, resolveDynamicComponent as re, createTextVNode as ne, createCommentVNode as T, renderSlot as le, withModifiers as N, createVNode as w, onMounted as ae, computed as ie, withDirectives as de, vModelText as ce, withCtx as ue } from "vue";
2
+ import { _ as he } from "./CreateForm-BMOBeP4G.js";
3
3
  import { useRouter as pe } from "vue-router";
4
4
  import { File as fe, Layers as H, Edit as P, Trash2 as ge, List as z, HelpCircle as K, XCircle as me, CheckCircle as be, Search as xe } from "lucide-vue-next";
5
5
  import { useI18n as ve } from "vue-i18n";
6
- import { _ as we } from "./UniversalTable.vue_vue_type_script_setup_true_lang-DW6O-xoY.js";
7
- import { _ as ke } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-DBIPBmpm.js";
6
+ import { _ as we } from "./UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js";
7
+ import { _ as ke } from "./UniversalTablePagination.vue_vue_type_script_setup_true_lang-Cp1WWIf0.js";
8
8
  import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  let ye;
10
10
  function _e() {
@@ -181,8 +181,8 @@ const Ue = /* @__PURE__ */ W(Ne, [["render", He]]), Ae = { class: "grid grid-col
181
181
  key: 2,
182
182
  class: E(["whitespace-nowrap rounded-md border ml-auto px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700", (k = v(o.status)) == null ? void 0 : k.classes])
183
183
  }, [
184
- (u(), V(ne((b = v(o.status)) == null ? void 0 : b.icon), { class: "w-3 h-3 mr-1" })),
185
- re(" " + f((d = v(o.status)) == null ? void 0 : d.text), 1)
184
+ (u(), V(re((b = v(o.status)) == null ? void 0 : b.icon), { class: "w-3 h-3 mr-1" })),
185
+ ne(" " + f((d = v(o.status)) == null ? void 0 : d.text), 1)
186
186
  ], 2)) : T("", !0)
187
187
  ]),
188
188
  t("div", Pe, [
@@ -1,4 +1,4 @@
1
- import { defineComponent as b, createElementBlock as t, openBlock as e, createElementVNode as l, createBlock as m, createCommentVNode as d, createVNode as h, unref as r, toDisplayString as i, Fragment as u, renderList as k } from "vue";
1
+ import { defineComponent as b, openBlock as e, createElementBlock as t, createElementVNode as l, createVNode as h, unref as r, toDisplayString as i, createBlock as m, createCommentVNode as d, Fragment as u, renderList as k } from "vue";
2
2
  import { Layers as p, ChevronRight as x } from "lucide-vue-next";
3
3
  const g = { class: "flex items-center space-x-1 mb-4 overflow-hidden" }, f = { class: "truncate block max-w-[12rem]" }, w = ["onClick"], v = { class: "truncate block max-w-[20rem]" }, y = {
4
4
  key: 1,
@@ -1,9 +1,9 @@
1
- import { defineComponent as w, inject as b, ref as p, computed as k, onMounted as C, createElementBlock as n, openBlock as r, createElementVNode as e, toDisplayString as a, unref as i, createVNode as c, withDirectives as $, vModelText as j, Fragment as B, renderList as E, createBlock as m } from "vue";
1
+ import { defineComponent as w, inject as b, ref as p, computed as k, onMounted as C, openBlock as r, createElementBlock as n, createElementVNode as e, toDisplayString as a, unref as i, createVNode as c, withDirectives as $, vModelText as j, Fragment as B, renderList as E, createBlock as m } from "vue";
2
2
  import { useRouter as L } from "vue-router";
3
3
  import { HelpCircle as V, Search as F, File as A, Layers as D, ChevronRight as M } from "lucide-vue-next";
4
4
  import { useI18n as N } from "vue-i18n";
5
- import { _ as R } from "./EmptyData-BSW20VKP.js";
6
- import { _ as S } from "./CreateForm-B0srHu5e.js";
5
+ import { _ as R } from "./EmptyData-DaZt_nAm.js";
6
+ import { _ as S } from "./CreateForm-BMOBeP4G.js";
7
7
  const T = { class: "space-y-6 mx-auto max-w-[90%]" }, q = { class: "flex items-center justify-between mb-8" }, H = { class: "flex gap-4" }, I = { class: "text-3xl font-bold text-slate-800 dark:text-slate-100 mb-2" }, P = { class: "text-slate-600 dark:text-slate-300" }, Q = ["href", "title"], U = { class: "flex items-center gap-3" }, z = { class: "relative w-full max-w-sm" }, G = { class: "absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none" }, J = ["placeholder"], K = { key: 0 }, O = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-6" }, W = ["onClick"], X = { class: "flex items-start justify-between" }, Y = { class: "flex items-start gap-3" }, Z = { class: "text-sm font-semibold text-gray-800 mb-1" }, ee = { class: "flex items-center gap-2" }, te = { class: "text-xs text-gray-500 whitespace-nowrap" }, se = { class: "pl-8 text-xs text-gray-600 line-clamp-2" }, oe = {
8
8
  key: 1,
9
9
  class: "flex items-center justify-center min-h-[400px]"
@@ -1,4 +1,4 @@
1
- import { inject as T, defineAsyncComponent as V, ref as a, createElementBlock as $, openBlock as k, createElementVNode as n, createVNode as m, createTextVNode as q, unref as d, toDisplayString as u, withCtx as f } from "vue";
1
+ import { inject as T, defineAsyncComponent as V, ref as a, openBlock as $, createElementBlock as k, createElementVNode as n, createVNode as m, unref as d, createTextVNode as q, toDisplayString as u, withCtx as f } from "vue";
2
2
  import { Plus as j } from "lucide-vue-next";
3
3
  import { useRouter as F } from "vue-router";
4
4
  import { useI18n as N } from "vue-i18n";
@@ -80,7 +80,7 @@ const O = { class: "flex justify-end p-[20px] gap-[10px] border-t w-full" }, D =
80
80
  }), console.error(o);
81
81
  }
82
82
  };
83
- return (l, t) => (k(), $("div", null, [
83
+ return (l, t) => ($(), k("div", null, [
84
84
  n("button", {
85
85
  onClick: t[0] || (t[0] = (o) => s.value = !0),
86
86
  class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white shadow-md hover:shadow-lg transition-all duration-200 transform hover:scale-105"
@@ -1,13 +1,13 @@
1
- import { ref as v, useModel as V, onMounted as P, createElementBlock as g, createCommentVNode as O, openBlock as m, createVNode as x, computed as F, createElementVNode as l, createTextVNode as H, unref as w, toDisplayString as a, withCtx as j, mergeModels as ee, defineAsyncComponent as G, Fragment as J, createBlock as U, normalizeClass as Y, resolveDynamicComponent as K, onBeforeUnmount as te, defineComponent as le, inject as ie, renderList as se } from "vue";
1
+ import { ref as v, useModel as V, onMounted as P, openBlock as m, createElementBlock as g, createVNode as x, createCommentVNode as O, computed as F, createElementVNode as l, unref as w, createTextVNode as H, toDisplayString as a, withCtx as j, defineAsyncComponent as G, mergeModels as ee, Fragment as J, createBlock as U, normalizeClass as Y, resolveDynamicComponent as K, onBeforeUnmount as te, defineComponent as le, inject as ie, renderList as se } from "vue";
2
2
  import { useRoute as oe, useRouter as re } from "vue-router";
3
- import { _ as ae } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-CTKNG0qR.js";
3
+ import { _ as ae } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-DQjDxfF8.js";
4
4
  import { Plus as ne, Edit as de, Trash as ce, Type as M, File as S, Link as B, LayoutTemplate as ue, Image as A, ListTree as D, CheckSquare as E, List as me, Clock as pe, Calendar as be, Hash as R } from "lucide-vue-next";
5
5
  import { VForm as Q, inputs as $ } from "@opengis/form";
6
6
  import { VsModal as W, notify as T, confirm as fe } from "@opengis/core";
7
7
  import { useI18n as I } from "vue-i18n";
8
- import { d as ve } from "./vuedraggable-mqqAYsch.js";
9
- import { _ as ge, a as ye, V as he, b as z, c as xe, d as we, e as _e, g as ke } from "./getField-CKcz_b0t.js";
10
- import { _ as $e } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-C-k8QGA-.js";
8
+ import { d as ve } from "./vuedraggable-DTHNuRWs.js";
9
+ import { _ as ge, a as ye, V as he, b as z, c as xe, d as we, e as _e, g as ke } from "./getField-DoisYj34.js";
10
+ import { _ as $e } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js";
11
11
  const Ce = {
12
12
  __name: "vs-builder-monaco",
13
13
  props: {
@@ -1,4 +1,4 @@
1
- import { createElementBlock as n, openBlock as r, createElementVNode as t, createCommentVNode as a, toDisplayString as i, createTextVNode as l } from "vue";
1
+ import { openBlock as n, createElementBlock as r, createElementVNode as t, toDisplayString as i, createTextVNode as a, createCommentVNode as l } from "vue";
2
2
  const d = { class: "rounded-xl text-card-foreground shadow-lg bg-white dark:bg-slate-800 backdrop-blur-sm border-2 border-dashed border-slate-300 dark:border-slate-600" }, u = { class: "p-12 text-center" }, m = { class: "text-lg font-medium text-slate-600 dark:text-slate-300 mb-2" }, c = { class: "text-slate-500 dark:text-slate-400 mb-6" }, b = {
3
3
  __name: "EmptyData",
4
4
  props: {
@@ -21,7 +21,7 @@ const d = { class: "rounded-xl text-card-foreground shadow-lg bg-white dark:bg-s
21
21
  },
22
22
  emits: ["action"],
23
23
  setup(o) {
24
- return (s, e) => (r(), n("div", d, [
24
+ return (s, e) => (n(), r("div", d, [
25
25
  t("div", u, [
26
26
  e[2] || (e[2] = t("svg", {
27
27
  xmlns: "http://www.w3.org/2000/svg",
@@ -41,7 +41,7 @@ const d = { class: "rounded-xl text-card-foreground shadow-lg bg-white dark:bg-s
41
41
  ], -1)),
42
42
  t("h3", m, i(s.$t(o.title)), 1),
43
43
  t("p", c, i(s.$t(o.description)), 1),
44
- o.showButton ? (r(), n("button", {
44
+ o.showButton ? (n(), r("button", {
45
45
  key: 0,
46
46
  onClick: e[0] || (e[0] = (p) => s.$emit("action")),
47
47
  class: "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 shadow h-9 px-4 py-2 bg-blue-600 hover:bg-blue-700 text-white"
@@ -61,8 +61,8 @@ const d = { class: "rounded-xl text-card-foreground shadow-lg bg-white dark:bg-s
61
61
  t("path", { d: "M5 12h14" }),
62
62
  t("path", { d: "M12 5v14" })
63
63
  ], -1)),
64
- l(" " + i(s.$t(o.buttonText)), 1)
65
- ])) : a("", !0)
64
+ a(" " + i(s.$t(o.buttonText)), 1)
65
+ ])) : l("", !0)
66
66
  ])
67
67
  ]));
68
68
  }
@@ -1,6 +1,6 @@
1
- import { defineComponent as g, ref as m, createElementBlock as h, openBlock as v, createElementVNode as t, unref as a, createVNode as l, toDisplayString as d, createTextVNode as y } from "vue";
1
+ import { defineComponent as g, ref as m, openBlock as h, createElementBlock as v, createElementVNode as t, unref as a, createVNode as l, toDisplayString as d, createTextVNode as y } from "vue";
2
2
  import { useRouter as x, useRoute as b } from "vue-router";
3
- import { _ as w } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-CTKNG0qR.js";
3
+ import { _ as w } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-DQjDxfF8.js";
4
4
  import { ArrowLeft as k, Save as _ } from "lucide-vue-next";
5
5
  import { useI18n as V } from "vue-i18n";
6
6
  import { notify as c } from "@opengis/core";
@@ -77,7 +77,7 @@ const C = { class: "space-y-6 max-w-7xl mx-auto" }, M = { class: "flex items-cen
77
77
  });
78
78
  }
79
79
  };
80
- return (s, o) => (v(), h("div", C, [
80
+ return (s, o) => (h(), v("div", C, [
81
81
  t("div", M, [
82
82
  t("div", N, [
83
83
  t("button", {
@@ -1,11 +1,11 @@
1
- import { createElementBlock as F, openBlock as w, createStaticVNode as Re, defineComponent as D, ref as k, normalizeClass as B, createTextVNode as Z, createCommentVNode as $, createBlock as O, createVNode as A, toDisplayString as _, unref as y, withModifiers as Y, createElementVNode as v, withDirectives as Le, withKeys as re, vModelText as Me, watch as Ue, resolveComponent as De, withCtx as j, nextTick as te, mergeModels as Ye, useModel as de, onBeforeMount as Be, Fragment as $e, computed as Pe, onMounted as Ve } from "vue";
2
- import { d as He } from "./vuedraggable-mqqAYsch.js";
1
+ import { openBlock as w, createElementBlock as F, createStaticVNode as Re, defineComponent as D, ref as k, normalizeClass as B, createTextVNode as Z, toDisplayString as _, createCommentVNode as $, createBlock as O, unref as y, withModifiers as Y, createVNode as A, createElementVNode as v, withDirectives as Le, withKeys as re, vModelText as Me, watch as Ue, resolveComponent as De, withCtx as j, nextTick as te, useModel as de, mergeModels as Ye, onBeforeMount as Be, Fragment as $e, computed as Pe, onMounted as Ve } from "vue";
2
+ import { d as He } from "./vuedraggable-DTHNuRWs.js";
3
3
  import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import { Pencil as je, Trash2 as Ke, Check as Ge, X as Qe, Plus as We, ArrowLeft as ze, HelpCircle as Ze, Save as Xe } from "lucide-vue-next";
5
5
  import { confirm as Je, VsModal as er, notify as I } from "@opengis/core";
6
6
  import { useI18n as H } from "vue-i18n";
7
7
  import rr, { inputs as pe, VForm as ve } from "@opengis/form";
8
- import { _ as he } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-CTKNG0qR.js";
8
+ import { _ as he } from "./MonacoEditor.vue_vue_type_script_setup_true_lang-DQjDxfF8.js";
9
9
  import { useRouter as tr, useRoute as nr } from "vue-router";
10
10
  const ir = {}, lr = {
11
11
  xmlns: "http://www.w3.org/2000/svg",
@@ -1,7 +1,7 @@
1
- import { defineComponent as D, ref as a, onMounted as S, resolveComponent as V, createElementBlock as f, openBlock as _, createElementVNode as r, createVNode as m, toDisplayString as u, unref as l, withCtx as j, createTextVNode as F, createCommentVNode as N } from "vue";
1
+ import { defineComponent as D, ref as a, onMounted as S, resolveComponent as V, openBlock as f, createElementBlock as _, createElementVNode as r, toDisplayString as u, unref as l, createVNode as m, withCtx as j, createTextVNode as F, createCommentVNode as N } from "vue";
2
2
  import { useRouter as L } from "vue-router";
3
3
  import { HelpCircle as q, Plus as B } from "lucide-vue-next";
4
- import { _ as M } from "./UniversalTable.vue_vue_type_script_setup_true_lang-DW6O-xoY.js";
4
+ import { _ as M } from "./UniversalTable.vue_vue_type_script_setup_true_lang-CJGTsd1V.js";
5
5
  import { useI18n as P } from "vue-i18n";
6
6
  import T from "@opengis/filter";
7
7
  import { notify as w } from "@opengis/core";
@@ -54,7 +54,7 @@ const A = { class: "space-y-6 max-w-7xl mx-auto" }, H = { class: "flex flex-col
54
54
  return S(p), (e, t) => {
55
55
  var n;
56
56
  const s = V("router-link");
57
- return _(), f("div", A, [
57
+ return f(), _("div", A, [
58
58
  r("div", H, [
59
59
  r("div", null, [
60
60
  r("div", I, [
@@ -81,7 +81,7 @@ const A = { class: "space-y-6 max-w-7xl mx-auto" }, H = { class: "flex flex-col
81
81
  })
82
82
  ]),
83
83
  r("div", z, [
84
- ((n = i.value) == null ? void 0 : n.length) > 0 ? (_(), f("div", G, [
84
+ ((n = i.value) == null ? void 0 : n.length) > 0 ? (f(), _("div", G, [
85
85
  m(l(T), {
86
86
  schema: i.value,
87
87
  view: "inline",
@@ -1,4 +1,4 @@
1
- import { defineComponent as s, mergeModels as c, useModel as m, ref as f, onMounted as h, watch as d, onBeforeUnmount as g, createElementBlock as p, openBlock as v, normalizeStyle as w } from "vue";
1
+ import { defineComponent as s, useModel as c, ref as m, onMounted as f, watch as d, onBeforeUnmount as h, openBlock as g, createElementBlock as p, normalizeStyle as v, mergeModels as w } from "vue";
2
2
  async function M() {
3
3
  if (window.monaco)
4
4
  return window.monaco;
@@ -12,7 +12,7 @@ async function M() {
12
12
  }
13
13
  const C = /* @__PURE__ */ s({
14
14
  __name: "MonacoEditor",
15
- props: /* @__PURE__ */ c({
15
+ props: /* @__PURE__ */ w({
16
16
  language: { default: "javascript" },
17
17
  theme: { default: "vs-dark" },
18
18
  width: { default: "100%" },
@@ -28,9 +28,9 @@ const C = /* @__PURE__ */ s({
28
28
  }),
29
29
  emits: ["update:modelValue"],
30
30
  setup(a) {
31
- const o = a, l = m(a, "modelValue"), n = f(null);
31
+ const o = a, l = c(a, "modelValue"), n = m(null);
32
32
  let e = null, i = null;
33
- return h(async () => {
33
+ return f(async () => {
34
34
  var t;
35
35
  if (n.value)
36
36
  try {
@@ -70,12 +70,12 @@ const C = /* @__PURE__ */ s({
70
70
  (t) => {
71
71
  e && t && i && i.editor.setTheme(t);
72
72
  }
73
- ), g(() => {
73
+ ), h(() => {
74
74
  e && (e.dispose(), e = null);
75
- }), (t, r) => (v(), p("div", {
75
+ }), (t, r) => (g(), p("div", {
76
76
  ref_key: "editorContainer",
77
77
  ref: n,
78
- style: w({ width: a.width, height: a.height })
78
+ style: v({ width: a.width, height: a.height })
79
79
  }, null, 4));
80
80
  }
81
81
  });
@@ -1,4 +1,4 @@
1
- import { defineComponent as j, ref as L, computed as $, createElementBlock as n, openBlock as s, createElementVNode as r, Fragment as v, renderList as C, normalizeClass as g, createBlock as f, createCommentVNode as A, createTextVNode as _, resolveDynamicComponent as M, toDisplayString as l, createVNode as F, unref as p, renderSlot as B, withModifiers as N } from "vue";
1
+ import { defineComponent as j, ref as L, computed as $, openBlock as s, createElementBlock as n, createElementVNode as r, Fragment as v, renderList as C, normalizeClass as g, createBlock as f, resolveDynamicComponent as A, createCommentVNode as M, createTextVNode as _, toDisplayString as l, createVNode as F, unref as p, withModifiers as N, renderSlot as B } from "vue";
2
2
  import { useI18n as q } from "vue-i18n";
3
3
  import { Eye as U, File as P, Layers as z, Pencil as H, Trash2 as W, XCircle as X, Edit as G, CheckCircle as J } from "lucide-vue-next";
4
4
  const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/80 backdrop-blur-sm" }, O = { class: "p-0" }, Q = { class: "table-scroll overflow-x-auto" }, Y = { class: "relative w-full overflow-auto max-h-[calc(100vh-270px)]" }, Z = { class: "w-full caption-bottom text-sm" }, I = { class: "border-b border-slate-200 dark:border-slate-700 bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, ee = { class: "flex items-center gap-2" }, te = { class: "h-10 text-center px-4 font-semibold text-slate-700 dark:text-slate-300 max-w-32" }, se = ["onClick"], ne = {
@@ -107,10 +107,10 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
107
107
  }])
108
108
  }, [
109
109
  r("div", ee, [
110
- e.icon ? (s(), f(M(e.icon), {
110
+ e.icon ? (s(), f(A(e.icon), {
111
111
  key: 0,
112
112
  class: "w-5 h-5"
113
- })) : A("", !0),
113
+ })) : M("", !0),
114
114
  _(" " + l(e.label || e.title || e.ua || e.name), 1)
115
115
  ])
116
116
  ], 2))), 128)),
@@ -132,7 +132,7 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
132
132
  }]),
133
133
  onClick: (xe) => x === 0 ? R(e) : void 0
134
134
  }, [
135
- b.customRender && b.customRender[t.name] ? (s(), f(M(b.customRender[t.name](e[t.name], e)), { key: 0 })) : A("", !0),
135
+ b.customRender && b.customRender[t.name] ? (s(), f(A(b.customRender[t.name](e[t.name], e)), { key: 0 })) : M("", !0),
136
136
  [
137
137
  "published_at",
138
138
  "publish_at",
@@ -163,9 +163,9 @@ const K = { class: "text-card-foreground border-0 bg-white/80 dark:bg-slate-800/
163
163
  key: 0,
164
164
  class: g(["whitespace-nowrap rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors hover:bg-secondary/80 flex items-center w-fit bg-green-100 text-green-800 border-green-200 dark:bg-green-900/30 dark:text-green-300 dark:border-green-700", (u = y(e[t.name])) == null ? void 0 : u.classes])
165
165
  }, [
166
- (s(), f(M((h = y(e[t.name])) == null ? void 0 : h.icon), { class: "w-3 h-3 mr-1" })),
166
+ (s(), f(A((h = y(e[t.name])) == null ? void 0 : h.icon), { class: "w-3 h-3 mr-1" })),
167
167
  _(" " + l((D = y(e[t.name])) == null ? void 0 : D.text), 1)
168
- ], 2)) : A("", !0)
168
+ ], 2)) : M("", !0)
169
169
  ], 64)) : t.name === "slug" ? (s(), n("div", le, l(e[t.name] ? "/" + e[t.name] : "-"), 1)) : t.name === "color" ? (s(), n("span", {
170
170
  key: 9,
171
171
  class: g(["w-4 h-4 rounded-full block ml-2", "bg-[" + e[t.name] + "]"])
@@ -1,4 +1,4 @@
1
- import { defineComponent as f, mergeModels as p, useModel as w, computed as h, createElementBlock as d, openBlock as c, createElementVNode as e, toDisplayString as n, createTextVNode as u, createVNode as b, unref as g, Fragment as v, renderList as k, normalizeClass as y } from "vue";
1
+ import { defineComponent as f, useModel as p, computed as h, openBlock as d, createElementBlock as c, createElementVNode as e, toDisplayString as n, createTextVNode as u, createVNode as b, unref as g, Fragment as v, renderList as w, normalizeClass as k, mergeModels as y } from "vue";
2
2
  import { ChevronLeft as $, ChevronRight as M } from "lucide-vue-next";
3
3
  const C = { class: "flex items-center justify-between px-6 py-4 border-t border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800" }, _ = { class: "flex justify-between flex-1 sm:hidden" }, j = { class: "relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50" }, P = { class: "relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50" }, N = { class: "hidden sm:flex-1 sm:flex sm:items-center sm:justify-between" }, T = { class: "text-sm text-slate-600 dark:text-slate-400" }, V = { class: "font-medium text-slate-800 dark:text-slate-100" }, z = { class: "font-medium text-slate-800 dark:text-slate-100" }, B = {
4
4
  class: "relative z-0 inline-flex space-x-2 rounded-md shadow-sm",
@@ -8,7 +8,7 @@ const C = { class: "flex items-center justify-between px-6 py-4 border-t border-
8
8
  class: "px-2 py-2 text-gray-400"
9
9
  }, F = ["onClick"], R = ["disabled"], U = { class: "sr-only" }, G = /* @__PURE__ */ f({
10
10
  __name: "UniversalTablePagination",
11
- props: /* @__PURE__ */ p({
11
+ props: /* @__PURE__ */ y({
12
12
  total: {},
13
13
  count: {},
14
14
  limit: {}
@@ -18,7 +18,7 @@ const C = { class: "flex items-center justify-between px-6 py-4 border-t border-
18
18
  }),
19
19
  emits: ["update:page"],
20
20
  setup(a) {
21
- const t = w(a, "page"), r = h(() => Math.ceil(a.total / a.limit)), x = h(() => {
21
+ const t = p(a, "page"), r = h(() => Math.ceil(a.total / a.limit)), x = h(() => {
22
22
  const s = [];
23
23
  if (r.value <= 4) {
24
24
  for (let i = 1; i <= r.value; i++)
@@ -31,7 +31,7 @@ const C = { class: "flex items-center justify-between px-6 py-4 border-t border-
31
31
  s.push(i);
32
32
  return m < r.value - 1 && s.push("ellipsis"), s.push(r.value), s;
33
33
  });
34
- return (l, s) => (c(), d("div", C, [
34
+ return (l, s) => (d(), c("div", C, [
35
35
  e("div", _, [
36
36
  e("button", j, n(l.$t("cms.common.pagination.previous")), 1),
37
37
  e("button", P, n(l.$t("cms.common.pagination.next")), 1)
@@ -57,13 +57,13 @@ const C = { class: "flex items-center justify-between px-6 py-4 border-t border-
57
57
  b(g($), { class: "w-5 h-5" })
58
58
  ], 8, E),
59
59
  e("div", S, [
60
- (c(!0), d(v, null, k(x.value, (o, m) => (c(), d(v, {
60
+ (d(!0), c(v, null, w(x.value, (o, m) => (d(), c(v, {
61
61
  key: o + "-" + m
62
62
  }, [
63
- o === "ellipsis" ? (c(), d("span", D, "...")) : (c(), d("button", {
63
+ o === "ellipsis" ? (d(), c("span", D, "...")) : (d(), c("button", {
64
64
  key: 1,
65
65
  onClick: (i) => t.value = o,
66
- class: y(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors h-8 w-8 p-0 text-sm rounded-md", {
66
+ class: k(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors h-8 w-8 p-0 text-sm rounded-md", {
67
67
  "border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-600 dark:text-slate-300 hover:border-blue-600 hover:bg-slate-50 dark:hover:bg-slate-600": o !== t.value,
68
68
  "shadow bg-blue-600 hover:bg-blue-700 text-white border-blue-600": o === t.value
69
69
  }])
@@ -1,11 +1,11 @@
1
- import { defineAsyncComponent as xe, useModel as ke, ref as y, provide as $e, onMounted as Y, nextTick as D, watch as K, computed as p, createBlock as re, createCommentVNode as z, openBlock as h, unref as _, createElementBlock as b, createElementVNode as d, createTextVNode as ie, createVNode as A, defineComponent as Se, inject as Ae, getCurrentInstance as Ce, toRef as Te, withDirectives as W, toDisplayString as L, Fragment as Ve, renderList as je, normalizeClass as ae, vModelCheckbox as Fe, vShow as oe } from "vue";
1
+ import { defineAsyncComponent as xe, useModel as ke, ref as y, provide as $e, onMounted as Y, nextTick as D, watch as K, computed as p, openBlock as h, createBlock as re, unref as _, createCommentVNode as z, createElementBlock as b, createElementVNode as d, createTextVNode as ie, createVNode as A, defineComponent as Se, inject as Ae, getCurrentInstance as Ce, toRef as Te, toDisplayString as L, Fragment as Ve, renderList as je, normalizeClass as ae, withDirectives as W, vModelCheckbox as Fe, vShow as oe } from "vue";
2
2
  import { useRouter as ze, useRoute as Ne } from "vue-router";
3
3
  import { ExternalLink as Ee, ArrowLeft as Pe, HelpCircle as Le, Settings as Ue, Save as Be } from "lucide-vue-next";
4
- import { _ as Oe, a as De, V as Je, b as X, c as Me, d as Re, e as He, g as Ke } from "./getField-CKcz_b0t.js";
4
+ import { _ as Oe, a as De, V as Je, b as X, c as Me, d as Re, e as He, g as Ke } from "./getField-DoisYj34.js";
5
5
  import { useI18n as ne } from "vue-i18n";
6
6
  import { inputs as S, VForm as le } from "@opengis/form";
7
7
  import { notify as U } from "@opengis/core";
8
- import { _ as Ie } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-C-k8QGA-.js";
8
+ import { _ as Ie } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_lang-CnOe9ORD.js";
9
9
  const qe = [
10
10
  {
11
11
  key: "title",
@@ -1,6 +1,6 @@
1
- import { createElementBlock as n, openBlock as o, createStaticVNode as z, createElementVNode as t, createCommentVNode as j, toDisplayString as c, useModel as Z, Fragment as L, renderList as P, unref as y, createBlock as F, resolveDynamicComponent as Ie, resolveComponent as me, mergeModels as W, ref as A, computed as R, watch as H, createVNode as $, withCtx as U, normalizeClass as Q, onMounted as de, onUpdated as at, withModifiers as J, createTextVNode as X, mergeProps as ot, Teleport as Me, normalizeStyle as nt, withDirectives as De, vModelText as Te, renderSlot as dt, normalizeProps as it, guardReactiveProps as ut, defineAsyncComponent as Le } from "vue";
1
+ import { openBlock as o, createElementBlock as n, createStaticVNode as z, createElementVNode as t, toDisplayString as c, createCommentVNode as j, useModel as Z, Fragment as L, renderList as P, unref as y, createBlock as F, resolveDynamicComponent as Ie, resolveComponent as me, ref as A, computed as R, watch as H, createVNode as $, withCtx as U, mergeModels as W, normalizeClass as Q, onMounted as de, onUpdated as at, withModifiers as J, createTextVNode as X, mergeProps as ot, Teleport as Me, normalizeStyle as nt, withDirectives as De, vModelText as Te, renderSlot as dt, normalizeProps as it, guardReactiveProps as ut, defineAsyncComponent as Le } from "vue";
2
2
  import { Edit as ct, Trash2 as ee, GripVertical as xe, File as vt, Folder as Ne, FileText as pt, ChevronRight as je, Download as ge, Loader2 as he, Plus as ye, Image as gt, Search as ht, ChevronDown as bt, LayoutGrid as yt, List as mt, Pencil as xt } from "lucide-vue-next";
3
- import { d as Ge } from "./vuedraggable-mqqAYsch.js";
3
+ import { d as Ge } from "./vuedraggable-DTHNuRWs.js";
4
4
  import { VsDrawer as Qe, notify as ie, confirm as Ze, VsModal as Ue } from "@opengis/core";
5
5
  import { _ as te } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  import { inputs as Ve, VForm as We, VsInputSelect as ft } from "@opengis/form";
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { defineAsyncComponent as o, defineComponent as P, getCurrentInstance as $, computed as s, provide as w, createBlock as b, createElementBlock as h, openBlock as g, resolveDynamicComponent as k, toDisplayString as x } from "vue";
1
+ import { defineAsyncComponent as o, defineComponent as P, getCurrentInstance as $, computed as s, provide as w, openBlock as g, createBlock as b, resolveDynamicComponent as h, createElementBlock as k, toDisplayString as x } from "vue";
2
2
  import { useRoute as E, routeLocationKey as I } from "vue-router";
3
3
  const B = "menu", D = (u, i) => {
4
4
  const r = u == null ? void 0 : u.trim();
5
5
  return r ? r === B ? i ? i === "create" ? { type: "createMenu", collection: r } : { type: "editMenu", collection: r, id: i } : { type: "menu", collection: r } : i === "edit" ? { type: "editCollection", collection: r } : i ? i === "create" ? { type: "createArticle", collection: r } : { type: "editArticle", collection: r, id: i } : { type: "articles", collection: r } : { type: "collections" };
6
- }, C = o(() => import("./CollectionsPage-d5MLIIAG.js")), K = o(() => import("./ArticlesPage-Cddv2qte.js")), y = o(() => import("./contentForm-C4Jp-FbQ.js")), O = o(() => import("./EditCollectionPage-NUVatLkY.js")), L = o(
7
- () => import("./MenuPage-DQpD3IXx.js")
6
+ }, C = o(() => import("./CollectionsPage-JfmrHNR_.js")), K = o(() => import("./ArticlesPage-dx7Se1Xo.js")), y = o(() => import("./contentForm-BgEoJcWF.js")), O = o(() => import("./EditCollectionPage-H1J9pZNo.js")), L = o(
7
+ () => import("./MenuPage-tJZtK46W.js")
8
8
  ), W = o(
9
- () => import("./MenuItemPage-B0Th9EOe.js")
9
+ () => import("./MenuItemPage-XN9lx5Vv.js")
10
10
  ), N = o(
11
- () => import("./MenuAddPage-Cn3JN04F.js")
11
+ () => import("./MenuAddPage-B6Qs6qV8.js")
12
12
  ), j = {
13
13
  collections: C,
14
14
  articles: K,
@@ -88,9 +88,9 @@ const B = "menu", D = (u, i) => {
88
88
  return { ...n, configurable: !0 };
89
89
  }
90
90
  });
91
- return w(I, M), (e, t) => f.value ? (g(), b(k(f.value), { key: A.value })) : (g(), h("div", T, x(e.$t("cms.navigation.collections")), 1));
91
+ return w(I, M), (e, t) => f.value ? (g(), b(h(f.value), { key: A.value })) : (g(), k("div", T, x(e.$t("cms.navigation.collections")), 1));
92
92
  }
93
- }), z = o(() => import("./CollectionsPage-d5MLIIAG.js")), G = o(() => import("./ArticlesPage-Cddv2qte.js")), H = o(() => import("./BuilderPage-BgcBJcw7.js")), J = o(() => import("./EditCollectionPage-NUVatLkY.js")), Q = o(() => import("./MenuPage-DQpD3IXx.js")), X = o(() => import("./MenuAddPage-Cn3JN04F.js")), Y = o(() => import("./MenuItemPage-B0Th9EOe.js"));
93
+ }), z = o(() => import("./CollectionsPage-JfmrHNR_.js")), G = o(() => import("./ArticlesPage-dx7Se1Xo.js")), H = o(() => import("./BuilderPage-ChkWE8rE.js")), J = o(() => import("./EditCollectionPage-H1J9pZNo.js")), Q = o(() => import("./MenuPage-tJZtK46W.js")), X = o(() => import("./MenuAddPage-B6Qs6qV8.js")), Y = o(() => import("./MenuItemPage-XN9lx5Vv.js"));
94
94
  export {
95
95
  G as ArticlesPage,
96
96
  H as BuilderPage,
@@ -1,4 +1,4 @@
1
- import { resolveComponent as $e, TransitionGroup as ze, defineComponent as Ue, nextTick as De, h as ce } from "vue";
1
+ import { TransitionGroup as $e, resolveComponent as ze, defineComponent as Ue, nextTick as De, h as ce } from "vue";
2
2
  /**!
3
3
  * Sortable 1.14.0
4
4
  * @author RubaXa <trash@rubaxa.org>
@@ -1507,7 +1507,7 @@ function Yn(e) {
1507
1507
  return {
1508
1508
  transition: t,
1509
1509
  externalComponent: n,
1510
- tag: n ? $e(e) : t ? ze : e
1510
+ tag: n ? ze(e) : t ? $e : e
1511
1511
  };
1512
1512
  }
1513
1513
  function Bn({ $slots: e, tag: t, realList: n, getKey: o }) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/cms",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "description": "cms",
5
5
  "type": "module",
6
6
  "author": "Softpro",
@@ -0,0 +1,30 @@
1
+ import { createHash } from 'node:crypto';
2
+
3
+ import { config, getRedis, pgClients } from '@opengis/fastify-table/utils.js';
4
+ import { createMockReply } from './utils/mock.reply.js';
5
+
6
+ import getTagsApi from '../routes/tags/controllers/get.tags.js';
7
+
8
+ const pg = pgClients.client;
9
+ const rclient = getRedis();
10
+
11
+ export default async function getTags({ page = 1, limit = 16, search, ttl = 3600 } = {}) {
12
+
13
+ const crudInc = await rclient.get(`pg:site.contents:tags`) || 0;
14
+
15
+ const cacheKey = createHash('md5').update([config.pg?.database, 'cms:tags', crudInc, page, limit, search].join(':')).digest('hex');
16
+ const cacheData = ttl === 0 ? null : JSON.parse(await rclient.get(cacheKey));
17
+
18
+ if (cacheData) {
19
+ return { cache: true, ...cacheData };
20
+ }
21
+
22
+ const mockReply = createMockReply();
23
+ const result = await getTagsApi({ pg, query: { page, limit, search } }, mockReply);
24
+
25
+ if (ttl) {
26
+ await rclient.set(cacheKey, JSON.stringify(result), 'EX', ttl);
27
+ }
28
+
29
+ return result;
30
+ }
@@ -21,7 +21,7 @@ export async function translateContent({
21
21
  return reply.status(400).send({ error: 'not enough query params: to', code: 400 });
22
22
  }
23
23
 
24
- const { id, collection = 'pages', from = 'uk', to, nocache } = query;
24
+ const { id, collection = 'pages', from = 'uk', to, nocache, skip } = query;
25
25
  const { id: collectionId, table, columns = [] } = await getCollectionId(collection, pg);
26
26
 
27
27
  if (!collectionId) {
@@ -34,7 +34,7 @@ export async function translateContent({
34
34
  return reply.status(400).send({ error: 'collection does not contain any fields with localization enabled', code: 400 });
35
35
  }
36
36
 
37
- const result = await insertContentLocalization({ table, id, from, to, nocache, schemaKeys, user }, pg);
37
+ const result = await insertContentLocalization({ table, id, from, to, nocache, skip, schemaKeys, user }, pg);
38
38
 
39
39
  if (result?.error) {
40
40
  return reply.status(result.code).send(result);
@@ -80,7 +80,7 @@ export async function translateCollection({
80
80
 
81
81
  send(`target localization already exists for ${ids.length - filteredIds.length}/${ids.length} rows`);
82
82
 
83
- await sequence(debug ? filteredIds.slice(0, 1) : filteredIds, { send, pg, from, to, table, nocache: true, schemaKeys, user }, insertContentLocalization);
83
+ await sequence(debug ? filteredIds.slice(0, 1) : filteredIds, { send, pg, from, to, table, nocache: true, skip, schemaKeys, user }, insertContentLocalization);
84
84
  return send('translation complete', true);
85
85
  } catch (err) {
86
86
  return send(err.toString(), true);
@@ -2,7 +2,7 @@ import { dataInsert, pgClients } from "@opengis/fastify-table/utils.js";
2
2
 
3
3
  import requestTranslation from "./requestTranslation.js";
4
4
 
5
- export default async function insertContentLocalization({ send = () => { }, table, id, from, to, nocache, schemaKeys, user }, pg = pgClients.client) {
5
+ export default async function insertContentLocalization({ send = () => { }, table, id, from, to, nocache, skip, schemaKeys, user }, pg = pgClients.client) {
6
6
  if (!to) {
7
7
  const resp = { error: 'not enough query params: to', code: 400 };
8
8
  send(resp.error + ': ' + id);
@@ -17,10 +17,13 @@ export default async function insertContentLocalization({ send = () => { }, tabl
17
17
  return resp;
18
18
  }
19
19
 
20
+ const targetLocalization = await pg.query('select json_object_agg(split_part(field_key,\':\',1),field_value) from site.localization where object_id=$1 and field_key is not null and split_part(field_key,\':\',2)=$2', [row.id, to])
21
+ .then(el => el.rows?.[0]?.json_object_agg);
22
+
20
23
  const localizationExists = await pg.query('select 1 from site.localization where object_id=$1 and field_key is not null and split_part(field_key,\':\',2)=$2', [row.id, to])
21
24
  .then(el => el.rowCount);
22
25
 
23
- if (localizationExists && !nocache) {
26
+ if (localizationExists && !nocache && !skip) {
24
27
  const resp = { error: 'target localization already exists', code: 400 };
25
28
  send(resp.error + ': ' + id);
26
29
  return resp;
@@ -38,9 +41,18 @@ export default async function insertContentLocalization({ send = () => { }, tabl
38
41
  const obj = { ...row, ...localization };
39
42
 
40
43
  const entries = Object.entries(obj).filter(([key, value]) => value && schemaKeys.includes(key) && (typeof value === 'string' || (Array.isArray(value) && value?.[0] && typeof value?.[0] === 'object' && Object.keys(value).length)));
41
- const skipped = schemaKeys.filter(key => !entries.map(([el]) => el).includes(key));
44
+ // do not old localization overwrite by default
45
+ const filteredEntries = skip && targetLocalization ? entries.filter(([key]) => !Object.keys(targetLocalization).includes(key)) : entries;
46
+
47
+ if (skip && targetLocalization && !filteredEntries.length) {
48
+ const resp = { error: 'nothing to localize after skipping of fields with existing localization', code: 400 };
49
+ send(resp.error + ': ' + id);
50
+ return resp;
51
+ }
52
+
53
+ const skipped = schemaKeys.filter(key => !filteredEntries.map(([el]) => el).includes(key));
42
54
 
43
- const { result, error, code = 200 } = await requestTranslation(entries, from, to);
55
+ const { result, error, code = 200 } = await requestTranslation(filteredEntries, from, to);
44
56
 
45
57
  if (error && code) {
46
58
  send(error + ': ' + id);
@@ -67,6 +79,12 @@ export default async function insertContentLocalization({ send = () => { }, tabl
67
79
  console.log('deleted existing localizations: ', deleted, id);
68
80
  }
69
81
 
82
+ if (skip) {
83
+ const deleted = await client.query('delete from site.localization where object_id=$1 and not split_part(field_key,\':\',1)<>any($2)', [id, Object.keys(targetLocalization)]).then(el => el.rowCount || 0);
84
+ send(`deleted existing localizations1: ${deleted}, ${id}`);
85
+ console.log('deleted existing localizations1: ', deleted, id);
86
+ }
87
+
70
88
  await Promise.all(arr.map(async row => dataInsert({
71
89
  pg: client,
72
90
  table: 'site.localization',
@@ -23,9 +23,16 @@ export default async function builderGet({ pg = pgClients.client, params = {} },
23
23
  ).then(el => el.rows?.[0] || {});
24
24
  Object.assign(row, { space });
25
25
 
26
- const loadTable = params.id === 'pages' ? await getTemplate('table', 'single.default.table') : {};
26
+ // const loadTable = params.id === 'pages' ? await getTemplate('table', 'single.default.table') : {};
27
+ // const columns = params.id === 'pages' ? loadTable?.columns : row.columns;
28
+
29
+ const loadTable = params.id === 'pages'
30
+ ? await getTemplate('table', 'single.default.table')
31
+ : await getTemplate('table', 'collection.default.table');
32
+ const { columns: defaultColumns = [] } = loadTable || {};
33
+ defaultColumns.forEach(col => Object.assign(col, { default: true }));
34
+ const columns = (defaultColumns || []).concat(row.columns.filter(col => !defaultColumns.map(el => el.name).includes(col.name)));
27
35
 
28
- const columns = params.id === 'pages' ? loadTable?.columns : row.columns;
29
36
  Object.assign(row, { columns });
30
37
 
31
38
  // filter system / hidden
@@ -11,6 +11,6 @@ export default async function getTags(req, reply) {
11
11
 
12
12
  const { rows } = await pg.query(selectSql);
13
13
 
14
- return reply.code(200).send({ message: { total, filtered, rows }, status: 200 })
14
+ return reply.status(200).send({ message: { total, filtered, rows }, status: 200 })
15
15
 
16
16
  }
package/utils.js CHANGED
@@ -3,5 +3,6 @@ export { default as getContent } from "./server/functions/getContent.js";
3
3
  export { default as getSettings } from "./server/routes/cms/functions/getSettings.js";
4
4
  export { default as getUser } from "./server/functions/getUser.js";
5
5
  export { default as getSearchData } from "./server/functions/getSearchData.js";
6
+ export { default as getTags } from "./server/functions/getTags.js";
6
7
 
7
8
  export default null;