@opengis/cms 0.0.66 → 0.0.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{EditCollectionPage-DnUqSUxK.js → EditCollectionPage-6deJ5ya9.js} +1 -1
- package/dist/{contentForm-1Fozy3Gb.js → contentForm-ChqdWm-t.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{vs-builder-preview-BoN8-Xd4.js → vs-builder-preview-CuW3cHQE.js} +3 -3
- package/dist/{vs-form-custom-datatable-D880w8gx.js → vs-form-custom-datatable-D40boA_T.js} +4 -1
- package/dist/{vs-form-media-select-NY27EaG1.js → vs-form-media-select-BMP7Er5B.js} +29 -25
- package/dist/{vs-form-reference-list-nkQvgmGb.js → vs-form-reference-list-Cf3B1AQM.js} +228 -229
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { _ as X } from "./CollectionsBreadcrumb.vue_vue_type_script_setup_true_l
|
|
|
6
6
|
const Z = {
|
|
7
7
|
monaco: k(() => import("./vs-builder-monaco-Cw-f19gc.js")),
|
|
8
8
|
edit: k(() => import("./vs-builder-edit-D-q1o8tF.js")),
|
|
9
|
-
preview: k(() => import("./vs-builder-preview-
|
|
9
|
+
preview: k(() => import("./vs-builder-preview-CuW3cHQE.js"))
|
|
10
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
11
|
key: 0,
|
|
12
12
|
class: "mx-auto bg-white rounded-md py-4 px-2 bg-opacity-50"
|
|
@@ -2,7 +2,7 @@ import { defineComponent as Pe, defineAsyncComponent as k, inject as le, ref as
|
|
|
2
2
|
import { useRouter as De, useRoute as Ue } from "vue-router";
|
|
3
3
|
import { ArrowLeft as Oe, HelpCircle as Je, Settings as He, Save as Ke, Loader2 as qe } from "lucide-vue-next";
|
|
4
4
|
import { useI18n as Ge } from "vue-i18n";
|
|
5
|
-
import { _ as Qe, g as We } from "./vs-form-custom-datatable-
|
|
5
|
+
import { _ as Qe, g as We } from "./vs-form-custom-datatable-D40boA_T.js";
|
|
6
6
|
import { inputs as x, VForm as ue } from "@opengis/form";
|
|
7
7
|
import { notify as B } from "@opengis/core";
|
|
8
8
|
const Xe = [
|
|
@@ -48,11 +48,11 @@ const Xe = [
|
|
|
48
48
|
__name: "contentForm",
|
|
49
49
|
setup(ht) {
|
|
50
50
|
const de = k(
|
|
51
|
-
() => import("./vs-form-reference-list-
|
|
51
|
+
() => import("./vs-form-reference-list-Cf3B1AQM.js")
|
|
52
52
|
), me = k(
|
|
53
53
|
() => import("./vs-form-tiptap-DDFQjRjY.js")
|
|
54
54
|
), I = k(
|
|
55
|
-
() => import("./vs-form-media-select-
|
|
55
|
+
() => import("./vs-form-media-select-BMP7Er5B.js")
|
|
56
56
|
), ve = k(
|
|
57
57
|
() => import("./vs-richtext-md-C098v_6Q.js")
|
|
58
58
|
), pe = k(
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ 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-
|
|
6
|
+
}, R = u(() => import("./CollectionsPage-DHfPNql6.js")), L = u(() => import("./ArticlesPage-BjYzvTWM.js")), C = u(() => import("./contentForm-ChqdWm-t.js")), N = u(() => import("./EditCollectionPage-6deJ5ya9.js")), W = u(
|
|
7
7
|
() => import("./MenuPage-3W6jZ15H.js")
|
|
8
8
|
), j = u(
|
|
9
9
|
() => import("./MenuItemPage-B7Y9KFyb.js")
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ref as c, useModel as n, computed as d, openBlock as u, createElementBlock as _, createBlock as v, unref as g, createCommentVNode as k } from "vue";
|
|
2
|
-
import { _ as V, g as $ } from "./vs-form-custom-datatable-
|
|
2
|
+
import { _ as V, g as $ } from "./vs-form-custom-datatable-D40boA_T.js";
|
|
3
3
|
import { inputs as e, VForm as h } from "@opengis/form";
|
|
4
|
-
import x from "./vs-form-reference-list-
|
|
4
|
+
import x from "./vs-form-reference-list-Cf3B1AQM.js";
|
|
5
5
|
import { _ as B } from "./vs-form-tiptap.vue_vue_type_script_setup_true_lang-DGgsqXwg.js";
|
|
6
|
-
import r from "./vs-form-media-select-
|
|
6
|
+
import r from "./vs-form-media-select-BMP7Er5B.js";
|
|
7
7
|
import { _ as M } from "./vs-richtext-md.vue_vue_type_script_setup_true_lang-Ct8uTV-J.js";
|
|
8
8
|
import b from "./vs-form-integer-BZ855R3g.js";
|
|
9
9
|
import y from "./vs-form-reletion-link-BhzNQszm.js";
|
|
@@ -94,7 +94,8 @@ const Z = (e) => {
|
|
|
94
94
|
key: e.name,
|
|
95
95
|
label: e.label || e.title,
|
|
96
96
|
type: "File",
|
|
97
|
-
|
|
97
|
+
multiple: e.multi || e.multiple,
|
|
98
|
+
multi: e.multi || e.multiple,
|
|
98
99
|
help: e == null ? void 0 : e.help,
|
|
99
100
|
validators: r,
|
|
100
101
|
api: "/api/cms-media/upload?subdir=",
|
|
@@ -167,6 +168,8 @@ const Z = (e) => {
|
|
|
167
168
|
key: e.name,
|
|
168
169
|
label: e.label || e.title,
|
|
169
170
|
type: "mediaselect",
|
|
171
|
+
multiple: e.multi || e.multiple,
|
|
172
|
+
multi: e.multi || e.multiple,
|
|
170
173
|
help: e == null ? void 0 : e.help,
|
|
171
174
|
validators: r
|
|
172
175
|
} : {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { openBlock as o, createElementBlock as p, normalizeClass as
|
|
1
|
+
import { openBlock as o, createElementBlock as p, normalizeClass as H, unref as c, toDisplayString as d, ref as y, onMounted as xe, onUpdated as Te, createVNode as b, createElementVNode as s, createCommentVNode as z, Fragment as Z, renderList as oe, withModifiers as V, createBlock as k, resolveComponent as Pe, createTextVNode as G, mergeModels as ge, useModel as Ie, computed as R, watch as X, mergeProps as Se, withCtx as He, Teleport as be, normalizeStyle as Le, withDirectives as Ne, vModelText as Ee } from "vue";
|
|
2
2
|
import { File as Oe, Trash2 as J, Folder as we, FileText as Ve, ChevronRight as ye, GripVertical as qe, Download as ae, Loader2 as le, Plus as fe, Image as Ue, Search as Re, ChevronDown as Ge, LayoutGrid as Ze, List as We } from "lucide-vue-next";
|
|
3
3
|
import { d as Ke } from "./vuedraggable-CoAPPFYd.js";
|
|
4
4
|
import { confirm as Qe } from "@opengis/core";
|
|
@@ -30,7 +30,7 @@ const et = {
|
|
|
30
30
|
["video", "bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-700"]
|
|
31
31
|
]);
|
|
32
32
|
return (_, w) => (o(), p("div", {
|
|
33
|
-
class:
|
|
33
|
+
class: H(["inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors shadow-lg backdrop-blur-sm", c(h).get(u.type)])
|
|
34
34
|
}, d(u.type), 3));
|
|
35
35
|
}
|
|
36
36
|
}, tt = { class: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 max-h-[calc(100%-130px)] overflow-y-auto px-2 pt-2 pb-5" }, st = {
|
|
@@ -78,7 +78,7 @@ const et = {
|
|
|
78
78
|
s("p", null, d(g.$t("cms.noFilesInFolder")), 1)
|
|
79
79
|
])) : z("", !0),
|
|
80
80
|
(o(!0), p(Z, null, oe(w.value, (e) => {
|
|
81
|
-
var
|
|
81
|
+
var I;
|
|
82
82
|
return o(), p(Z, {
|
|
83
83
|
key: e == null ? void 0 : e.url
|
|
84
84
|
}, [
|
|
@@ -101,8 +101,8 @@ const et = {
|
|
|
101
101
|
s("p", ot, d(e == null ? void 0 : e.count) + " " + d(g.$t("cms.media.files")), 1)
|
|
102
102
|
], 8, at)) : (e == null ? void 0 : e.type) === "file" ? (o(), p("div", {
|
|
103
103
|
key: 1,
|
|
104
|
-
class:
|
|
105
|
-
"bg-accent text-accent-foreground ring-2 ring-primary": ((
|
|
104
|
+
class: H(["h-[fit-content] rounded-xl text-card-foreground shadow-lg border-0 bg-white dark:bg-slate-800 backdrop-blur-sm hover:shadow-xl transition-all duration-200 transform hover:scale-105 group cursor-pointer", {
|
|
105
|
+
"bg-accent text-accent-foreground ring-2 ring-primary": ((I = u.selectedFile) == null ? void 0 : I.url) === (e == null ? void 0 : e.url) || u.selectedFiles && u.selectedFiles.some((D) => D.id === e.id)
|
|
106
106
|
}]),
|
|
107
107
|
onClick: (D) => g.$emit("file-click", e)
|
|
108
108
|
}, [
|
|
@@ -233,11 +233,11 @@ const At = /* @__PURE__ */ ie($t, [["render", Ft]]), jt = {
|
|
|
233
233
|
]),
|
|
234
234
|
s("tbody", St, [
|
|
235
235
|
(o(!0), p(Z, null, oe(u.files, (e) => {
|
|
236
|
-
var
|
|
236
|
+
var I, D, q, A, L;
|
|
237
237
|
return o(), p("tr", {
|
|
238
238
|
key: e.id,
|
|
239
|
-
class:
|
|
240
|
-
"bg-blue-200": ((
|
|
239
|
+
class: H(["border-b transition-colors hover:bg-blue-200/50 data-[state=selected]:bg-muted cursor-pointer", {
|
|
240
|
+
"bg-blue-200": ((I = w.value) == null ? void 0 : I.id) === e.id && ((D = w.value) == null ? void 0 : D.type) === e.type || u.selectedFiles && u.selectedFiles.some((j) => j.id === e.id && j.type === e.type)
|
|
241
241
|
}]),
|
|
242
242
|
onClick: (j) => g.$emit("file-click", e)
|
|
243
243
|
}, [
|
|
@@ -363,15 +363,19 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
363
363
|
}),
|
|
364
364
|
emits: /* @__PURE__ */ ge(["change"], ["update:modelValue"]),
|
|
365
365
|
setup(u, { emit: h }) {
|
|
366
|
-
const { t: _ } = ne(), w = Xe(), M = Je(), i = Ie(u, "modelValue"), $ = h, g = u, m = R(() => g.multiple || g.multi), v = y(null), e = R(() => i.value || v.value),
|
|
366
|
+
const { t: _ } = ne(), w = Xe(), M = Je(), i = Ie(u, "modelValue"), $ = h, g = u, m = R(() => !!(g.multiple || g.multi || Array.isArray(i.value) || Array.isArray(v.value))), v = y(null), e = R(() => i.value || v.value), I = R(() => {
|
|
367
367
|
if (!m.value)
|
|
368
368
|
return [];
|
|
369
369
|
const t = e.value;
|
|
370
370
|
return t ? Array.isArray(t) ? t : [t] : [];
|
|
371
371
|
}), D = R({
|
|
372
|
-
get: () =>
|
|
372
|
+
get: () => I.value,
|
|
373
373
|
set: (t) => {
|
|
374
|
-
if (!t || !Array.isArray(t)
|
|
374
|
+
if (!t || !Array.isArray(t))
|
|
375
|
+
return;
|
|
376
|
+
if (t.length === 0) {
|
|
377
|
+
if (I.value.length > 0)
|
|
378
|
+
return;
|
|
375
379
|
i && (i.value = null), v.value = null, $("cms.change", null);
|
|
376
380
|
return;
|
|
377
381
|
}
|
|
@@ -380,7 +384,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
380
384
|
);
|
|
381
385
|
i && (i.value = a), v.value = r, $("cms.change", a);
|
|
382
386
|
}
|
|
383
|
-
}), q = R(() => e.value ? typeof e.value == "object" ? e.value.filename || e.value.file_name || e.value.native_file_name || "File" : typeof e.value == "string" ? e.value.split("cms./").pop() || e.value : "File" : ""), A = y(!1), L = y(!1), j = y("grid"),
|
|
387
|
+
}), q = R(() => e.value ? typeof e.value == "object" ? e.value.filename || e.value.file_name || e.value.native_file_name || "File" : typeof e.value == "string" ? e.value.split("cms./").pop() || e.value : "File" : ""), A = y(!1), L = y(!1), j = y("grid"), S = y([]), T = y([]), N = y([]), f = y(), C = y([]), Y = y(null), P = y(!1), W = y(null), ee = y(null), de = y({}), E = y(""), O = y(!1), K = y("name"), _e = /* @__PURE__ */ new Map([
|
|
384
388
|
["name", _("cms.media.sortBy.name")],
|
|
385
389
|
["filesize", _("cms.media.sortBy.filesize")]
|
|
386
390
|
]), U = (t) => typeof t == "string" ? t : (t == null ? void 0 : t.filepath) || (t == null ? void 0 : t.file_path) || t, ue = (t) => t ? typeof t == "string" ? t.split("cms./").pop() || t : t.filename || t.file_name || t.native_file_name || "File" : "", $e = (t) => typeof t == "string" ? t : (t == null ? void 0 : t.preview) || `/file/resize?filepath=${U(t)}&h=137&quality=75`, Ce = () => {
|
|
@@ -401,7 +405,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
401
405
|
}, ce = (t) => {
|
|
402
406
|
var a;
|
|
403
407
|
if (t.type === "dir")
|
|
404
|
-
pe([...
|
|
408
|
+
pe([...S.value, t.name]);
|
|
405
409
|
else if (m.value) {
|
|
406
410
|
const r = C.value.findIndex((l) => l.id === t.id);
|
|
407
411
|
r >= 0 ? C.value.splice(r, 1) : C.value.push(t);
|
|
@@ -419,7 +423,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
419
423
|
});
|
|
420
424
|
}, je = async () => {
|
|
421
425
|
try {
|
|
422
|
-
const t =
|
|
426
|
+
const t = S.value.join("/"), r = await (await fetch(`/api/cms-media?subdir=${t}${E.value ? "&search=" + E.value : ""}`, {
|
|
423
427
|
method: "GET"
|
|
424
428
|
})).json();
|
|
425
429
|
r.data ? (T.value = r.data.map((l) => ({
|
|
@@ -447,12 +451,12 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
447
451
|
}, te = () => {
|
|
448
452
|
L.value = !1;
|
|
449
453
|
}, pe = (t) => {
|
|
450
|
-
|
|
454
|
+
S.value = t, N.value = [...N.value, t], f.value = null, m.value && (C.value = []), se();
|
|
451
455
|
}, ze = () => {
|
|
452
|
-
N.value.length > 1 && (N.value.pop(),
|
|
456
|
+
N.value.length > 1 && (N.value.pop(), S.value = N.value[N.value.length - 1], f.value = null, m.value && (C.value = []), se());
|
|
453
457
|
}, se = async () => {
|
|
454
458
|
try {
|
|
455
|
-
const t =
|
|
459
|
+
const t = S.value.join("/"), r = await (await fetch(`/api/cms-media?subdir=${t}${E.value ? "&search=" + E.value : ""}`, {
|
|
456
460
|
method: "GET"
|
|
457
461
|
})).json();
|
|
458
462
|
r.data ? (T.value = r.data.map((l) => ({
|
|
@@ -538,7 +542,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
538
542
|
};
|
|
539
543
|
X(L, (t) => {
|
|
540
544
|
t && se();
|
|
541
|
-
}), X(
|
|
545
|
+
}), X(S, (t) => {
|
|
542
546
|
t.length > 0 ? M.push({ query: { path: t.join("/") } }) : M.push({ query: { path: void 0 } });
|
|
543
547
|
});
|
|
544
548
|
let me;
|
|
@@ -557,7 +561,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
557
561
|
}
|
|
558
562
|
}), xe(() => {
|
|
559
563
|
var a, r;
|
|
560
|
-
|
|
564
|
+
S.value = ((r = (a = w.query) == null ? void 0 : a.path) == null ? void 0 : r.split("cms./")) || [], N.value = [[]], i.value || (f.value = null);
|
|
561
565
|
const t = (l) => {
|
|
562
566
|
var n;
|
|
563
567
|
A.value && !((n = W.value) != null && n.contains(l.target)) && (A.value = !1), O.value && ee.value && !ee.value.contains(l.target) && (O.value = !1);
|
|
@@ -571,7 +575,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
571
575
|
"onUpdate:modelValue": a[0] || (a[0] = (r) => D.value = r),
|
|
572
576
|
"item-key": (r) => U(r),
|
|
573
577
|
handle: ".drag-handle",
|
|
574
|
-
class:
|
|
578
|
+
class: H(["flex gap-4 flex-wrap", t.$attrs.class])
|
|
575
579
|
}, {
|
|
576
580
|
item: He(({ element: r, index: l }) => [
|
|
577
581
|
s("div", ts, [
|
|
@@ -648,7 +652,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
648
652
|
s("div", {
|
|
649
653
|
ref_key: "triggerButton",
|
|
650
654
|
ref: W,
|
|
651
|
-
class:
|
|
655
|
+
class: H(["relative w-32 h-32 flex items-center justify-center border border-dotted border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-500/10 hover:cursor-pointer transition-all", { "border-blue-500 bg-blue-500/10": A.value, "opacity-50 cursor-not-allowed": P.value }]),
|
|
652
656
|
onClick: Fe
|
|
653
657
|
}, [
|
|
654
658
|
P.value ? (o(), k(c(le), {
|
|
@@ -671,7 +675,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
671
675
|
style: Le(de.value)
|
|
672
676
|
}, [
|
|
673
677
|
s("div", {
|
|
674
|
-
class:
|
|
678
|
+
class: H(["relative overflow-hidden flex justify-start items-center w-full gap-2 p-4 hover:bg-blue-50 text-blue-700 border hover:border-blue-200 dark:bg-slate-700 dark:text-slate-100 hover:cursor-pointer", { "opacity-50 cursor-not-allowed": P.value }]),
|
|
675
679
|
onClick: a[4] || (a[4] = (r) => !P.value && Ce())
|
|
676
680
|
}, [
|
|
677
681
|
s("input", {
|
|
@@ -736,7 +740,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
736
740
|
]),
|
|
737
741
|
s("div", xs, [
|
|
738
742
|
b(es, {
|
|
739
|
-
"current-path":
|
|
743
|
+
"current-path": S.value,
|
|
740
744
|
onNavigate: pe,
|
|
741
745
|
onNavigateBack: ze
|
|
742
746
|
}, null, 8, ["current-path"])
|
|
@@ -780,7 +784,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
780
784
|
]),
|
|
781
785
|
s("div", zs, [
|
|
782
786
|
s("button", {
|
|
783
|
-
class:
|
|
787
|
+
class: H(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 h-8 px-3 text-xs rounded-md", {
|
|
784
788
|
"shadow bg-blue-600 hover:bg-blue-700 text-white": j.value === "grid",
|
|
785
789
|
"border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600": j.value === "list"
|
|
786
790
|
}]),
|
|
@@ -789,7 +793,7 @@ const Xt = /* @__PURE__ */ ie(Wt, [["render", Qt]]), Jt = { class: "flex items-c
|
|
|
789
793
|
b(c(Ze), { class: "w-4 h-4" })
|
|
790
794
|
], 2),
|
|
791
795
|
s("button", {
|
|
792
|
-
class:
|
|
796
|
+
class: H(["inline-flex items-center justify-center whitespace-nowrap font-medium transition-colors disabled:pointer-events-none disabled:opacity-50 h-8 px-3 text-xs rounded-md", {
|
|
793
797
|
"shadow bg-blue-600 hover:bg-blue-700 text-white": j.value === "list",
|
|
794
798
|
"border shadow-sm hover:text-accent-foreground bg-white dark:bg-slate-700 border-slate-300 dark:border-slate-600 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-600": j.value === "grid"
|
|
795
799
|
}]),
|