@oneclick.dev/cms-core-modules 0.0.119 → 0.0.121
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/{ContentEditor-BnOVpmsQ.js → ContentEditor-Dl41qaCh.js} +42 -41
- package/dist/{ContentEditor-Cm28u_14.mjs → ContentEditor-u3k-uTny.mjs} +4785 -4492
- package/dist/{Detail-C8wQiDcv.js → Detail-BCUUNWvp.js} +1 -1
- package/dist/{Detail-CtItxMX4.mjs → Detail-B_scnidb.mjs} +1 -1
- package/dist/Detail-Cn9Bk0u0.mjs +852 -0
- package/dist/Detail-DGg_xXZc.js +1 -0
- package/dist/Detail-Dk8E6_uF.mjs +3731 -0
- package/dist/Detail-Sc2qZdxj.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-4_t0PPqM.mjs +78 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D1b9_iiN.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BdZbcubW.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-bZidw6RT.mjs +1500 -0
- package/dist/Overview-CVgViW3c.mjs +852 -0
- package/dist/Overview-DEF-z7Yb.js +1 -0
- package/dist/Overview-Tf_ApkWh.js +1 -0
- package/dist/{Overview-CVQ1pkuD.mjs → Overview-usm5gPD1.mjs} +131 -131
- package/dist/{agenda-BtmnpFmi.js → agenda-B54F8cEr.js} +1 -1
- package/dist/{agenda-D0QBOJUy.mjs → agenda-BCKDYOeF.mjs} +7 -7
- package/dist/{availability-ClBGVgE9.js → availability-C4v46rha.js} +1 -1
- package/dist/{availability-D8JdA4rP.mjs → availability-DVT1Mdxq.mjs} +1 -1
- package/dist/{booking-data-aMS1p_3g.js → booking-data-A5JrLY4j.js} +1 -1
- package/dist/{booking-data-Px7XCIfU.mjs → booking-data-lZvSYna2.mjs} +1 -1
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-Dgj54ULn.mjs → exceptions-DJHfvADv.mjs} +1 -1
- package/dist/{exceptions-DXqc0Nza.js → exceptions-DKc8fO1S.js} +1 -1
- package/dist/index-Bk3yLv_G.js +35 -0
- package/dist/{index-Dnn2SCSl.js → index-CZau1wR8.js} +1 -1
- package/dist/{index-DRqJOqUR.mjs → index-DE8rdSjd.mjs} +0 -22
- package/dist/index-DU3Ib10Z.mjs +1256 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +35 -33
- package/dist/orders-BMosTk6r.js +1 -0
- package/dist/{orders-C5NT99Fy.mjs → orders-CElKNc1v.mjs} +229 -234
- package/dist/{payment-D5j-68Ig.mjs → payment-DSQ_2FIT.mjs} +1 -1
- package/dist/{payment-BJHgpaeT.js → payment-DlgYuea2.js} +1 -1
- package/dist/{refunds-oVB2Opib.js → refunds-Cvw9N--u.js} +1 -1
- package/dist/{refunds-D9nTeD2d.mjs → refunds-xR936Ted.mjs} +1 -1
- package/dist/reports-BQT_GZzU.js +158 -0
- package/dist/reports-DksZCTOw.mjs +837 -0
- package/dist/{resources-CK0oWssj.mjs → resources-C-5BU9Ux.mjs} +1 -1
- package/dist/{resources-8WouFvJe.js → resources-D04yKKVN.js} +1 -1
- package/dist/src/appointments/components/edit/NewReservationDialog/QuickReservationAdder.vue.d.ts +2 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +1 -0
- package/dist/src/productCollections/components/detail/Subcollections.vue.d.ts +2 -0
- package/dist/src/productCollections/types.d.ts +1 -4
- package/dist/src/products/components/detail/variants/VariantList.vue.d.ts +48 -6
- package/dist/src/products/components/detail/variants/dialogs/VariantDialog.vue.d.ts +4 -0
- package/dist/{vee-validate-zod-CcOwoF6y.mjs → vee-validate-zod-SjDT8X35.mjs} +92 -90
- package/dist/{vee-validate-zod-ByykgYKJ.js → vee-validate-zod-VCmLnrtQ.js} +1 -1
- package/package.json +2 -2
- package/dist/Detail-C1Blq61w.mjs +0 -585
- package/dist/Detail-CPqug27l.js +0 -1
- package/dist/Detail-CjuhjPby.js +0 -1
- package/dist/Detail-Dnpnmy4-.mjs +0 -3477
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-gozJKXvM.js +0 -1
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-pDO9b4Pv.mjs +0 -77
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-CcMEKZzd.mjs +0 -1476
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-CkFsdcvP.js +0 -1
- package/dist/Overview-BWLxUksJ.mjs +0 -860
- package/dist/Overview-CBahJviK.js +0 -1
- package/dist/Overview-DAxCu9XC.js +0 -1
- package/dist/index-BnFWz40Q.mjs +0 -1261
- package/dist/index-DcGPR_vt.js +0 -35
- package/dist/orders-lO3dZ5un.js +0 -1
- /package/dist/src/{productCollections/components/detail/SEO.vue.d.ts → appointments/pages/edit/reports.vue.d.ts} +0 -0
package/dist/Detail-C1Blq61w.mjs
DELETED
|
@@ -1,585 +0,0 @@
|
|
|
1
|
-
import { defineComponent as B, inject as G, resolveComponent as c, openBlock as r, createBlock as h, withCtx as l, createVNode as t, createElementVNode as s, createTextVNode as d, isRef as j, unref as e, createElementBlock as C, toDisplayString as y, createCommentVNode as g, withModifiers as Y, watch as Z, provide as R, computed as ee, ref as te, onMounted as le } from "vue";
|
|
2
|
-
import { u as E, a as N, t as oe, o as q, s as M, f as se } from "./vee-validate-zod-CcOwoF6y.mjs";
|
|
3
|
-
import { X as ne, ImagePlus as ie, Tag as ae, ChevronRight as re, Trash as ce, Loader2 as W } from "lucide-vue-next";
|
|
4
|
-
import { g as ue } from "./google-CvtuJwgk.mjs";
|
|
5
|
-
import { useModulePermissions as de, useModuleRoute as pe, useConfirmation as me, useFirebaseIntegration as fe, useModuleBreadcrumbs as _e } from "@oneclick.dev/cms-kit";
|
|
6
|
-
import { t as P } from "./index-RLz1QPrf.mjs";
|
|
7
|
-
const xe = { class: "flex flex-col gap-4" }, ge = { class: "flex flex-col gap-2" }, be = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "text-red-500 text-sm mt-1"
|
|
10
|
-
}, ve = { class: "flex flex-col gap-4" }, Ce = { class: "flex flex-col gap-2" }, we = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "text-red-500 text-sm mt-1"
|
|
13
|
-
}, ye = { class: "flex flex-col gap-4" }, he = { class: "flex flex-col gap-2" }, Se = { class: "flex items-center gap-2 mb-2" }, ke = { class: "flex items-center gap-2" }, $e = ["src"], Me = {
|
|
14
|
-
key: 0,
|
|
15
|
-
class: "text-red-500 text-sm mt-1"
|
|
16
|
-
}, Ve = /* @__PURE__ */ B({
|
|
17
|
-
__name: "Main",
|
|
18
|
-
setup(U) {
|
|
19
|
-
const p = G("sources");
|
|
20
|
-
G("defaultSource");
|
|
21
|
-
const { errors: m } = E(), { value: b } = N("title"), { value: n } = N("description"), { value: f } = N("thumbnail"), S = (i) => {
|
|
22
|
-
f.value = i;
|
|
23
|
-
};
|
|
24
|
-
return (i, a) => {
|
|
25
|
-
const _ = c("Label"), V = c("Input"), T = c("Textarea"), I = c("Button"), v = c("MediaPickerDialog"), L = c("CardContent"), F = c("Card");
|
|
26
|
-
return r(), h(F, null, {
|
|
27
|
-
default: l(() => [
|
|
28
|
-
t(L, { class: "flex flex-col gap-4" }, {
|
|
29
|
-
default: l(() => [
|
|
30
|
-
s("div", xe, [
|
|
31
|
-
s("div", ge, [
|
|
32
|
-
t(_, {
|
|
33
|
-
for: "title",
|
|
34
|
-
class: "text-sm mb-2"
|
|
35
|
-
}, {
|
|
36
|
-
default: l(() => [...a[5] || (a[5] = [
|
|
37
|
-
d("Title", -1)
|
|
38
|
-
])]),
|
|
39
|
-
_: 1
|
|
40
|
-
}),
|
|
41
|
-
t(V, {
|
|
42
|
-
type: "text",
|
|
43
|
-
id: "title",
|
|
44
|
-
placeholder: "Summer collection",
|
|
45
|
-
modelValue: e(b),
|
|
46
|
-
"onUpdate:modelValue": a[0] || (a[0] = (k) => j(b) ? b.value = k : null)
|
|
47
|
-
}, null, 8, ["modelValue"]),
|
|
48
|
-
e(m).title ? (r(), C("p", be, y(e(m).title), 1)) : g("", !0)
|
|
49
|
-
])
|
|
50
|
-
]),
|
|
51
|
-
s("div", ve, [
|
|
52
|
-
s("div", Ce, [
|
|
53
|
-
t(_, {
|
|
54
|
-
for: "description",
|
|
55
|
-
class: "text-sm mb-2"
|
|
56
|
-
}, {
|
|
57
|
-
default: l(() => [...a[6] || (a[6] = [
|
|
58
|
-
d("Description", -1)
|
|
59
|
-
])]),
|
|
60
|
-
_: 1
|
|
61
|
-
}),
|
|
62
|
-
t(T, {
|
|
63
|
-
id: "description",
|
|
64
|
-
placeholder: "Fresh, vibrant, and bold. The perfect collection for the summer season.",
|
|
65
|
-
modelValue: e(n),
|
|
66
|
-
"onUpdate:modelValue": a[1] || (a[1] = (k) => j(n) ? n.value = k : null)
|
|
67
|
-
}, null, 8, ["modelValue"]),
|
|
68
|
-
e(m).description ? (r(), C("p", we, y(e(m).description), 1)) : g("", !0)
|
|
69
|
-
])
|
|
70
|
-
]),
|
|
71
|
-
s("div", ye, [
|
|
72
|
-
s("div", he, [
|
|
73
|
-
s("div", Se, [
|
|
74
|
-
t(_, {
|
|
75
|
-
for: "media",
|
|
76
|
-
class: "text-sm"
|
|
77
|
-
}, {
|
|
78
|
-
default: l(() => [...a[7] || (a[7] = [
|
|
79
|
-
d("Thumbnail", -1)
|
|
80
|
-
])]),
|
|
81
|
-
_: 1
|
|
82
|
-
}),
|
|
83
|
-
e(f) ? (r(), h(I, {
|
|
84
|
-
key: 0,
|
|
85
|
-
variant: "ghost",
|
|
86
|
-
size: "icon",
|
|
87
|
-
onClick: a[2] || (a[2] = (k) => f.value = "")
|
|
88
|
-
}, {
|
|
89
|
-
default: l(() => [
|
|
90
|
-
t(e(ne), { class: "size-4" })
|
|
91
|
-
]),
|
|
92
|
-
_: 1
|
|
93
|
-
})) : g("", !0)
|
|
94
|
-
]),
|
|
95
|
-
s("div", ke, [
|
|
96
|
-
t(v, {
|
|
97
|
-
sources: e(p),
|
|
98
|
-
maxFiles: 1,
|
|
99
|
-
"initial-value": e(f) ? [e(f)] : [],
|
|
100
|
-
onSubmit: a[4] || (a[4] = (k) => S(k))
|
|
101
|
-
}, {
|
|
102
|
-
default: l(() => [
|
|
103
|
-
s("button", {
|
|
104
|
-
onClick: a[3] || (a[3] = Y(() => {
|
|
105
|
-
}, ["stop"])),
|
|
106
|
-
tabindex: "-1",
|
|
107
|
-
class: "cursor-pointer block"
|
|
108
|
-
}, [
|
|
109
|
-
e(f) ? (r(), C("img", {
|
|
110
|
-
key: 1,
|
|
111
|
-
src: e(f),
|
|
112
|
-
class: "size-42 rounded-md object-cover",
|
|
113
|
-
draggable: "false"
|
|
114
|
-
}, null, 8, $e)) : (r(), h(I, {
|
|
115
|
-
key: 0,
|
|
116
|
-
variant: "outline",
|
|
117
|
-
class: "size-42 border-dashed cursor-pointer"
|
|
118
|
-
}, {
|
|
119
|
-
default: l(() => [
|
|
120
|
-
t(e(ie))
|
|
121
|
-
]),
|
|
122
|
-
_: 1
|
|
123
|
-
}))
|
|
124
|
-
])
|
|
125
|
-
]),
|
|
126
|
-
_: 1
|
|
127
|
-
}, 8, ["sources", "initial-value"]),
|
|
128
|
-
e(m).thumbnail ? (r(), C("p", Me, y(e(m).thumbnail), 1)) : g("", !0)
|
|
129
|
-
])
|
|
130
|
-
])
|
|
131
|
-
])
|
|
132
|
-
]),
|
|
133
|
-
_: 1
|
|
134
|
-
})
|
|
135
|
-
]),
|
|
136
|
-
_: 1
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
}), Te = { class: "bg-white dark:bg-gray-50 border-4 dark:border-gray-600 p-4 rounded-lg mb-4" }, Ie = { class: "flex items-center gap-2 mb-2" }, ze = ["src"], Pe = { class: "text-[#1a0dab] text-lg" }, Ne = { class: "text-[#006621] text-[13px]" }, De = { class: "text-[#545454] text-[13px]" }, Ue = { class: "flex flex-col gap-4 mb-4" }, Fe = { class: "flex flex-col" }, je = {
|
|
141
|
-
key: 0,
|
|
142
|
-
class: "text-red-500 text-sm mt-1"
|
|
143
|
-
}, Be = { class: "flex flex-col gap-4 mb-4" }, Le = { class: "flex flex-col" }, Ee = {
|
|
144
|
-
key: 0,
|
|
145
|
-
class: "text-red-500 text-sm mt-1"
|
|
146
|
-
}, Oe = { class: "flex flex-col gap-4" }, Je = { class: "flex flex-col" }, Ae = {
|
|
147
|
-
key: 0,
|
|
148
|
-
class: "text-red-500 text-sm mt-1"
|
|
149
|
-
}, Ge = {
|
|
150
|
-
key: 1,
|
|
151
|
-
class: "text-[#545454] text-[13px]"
|
|
152
|
-
}, Re = {
|
|
153
|
-
key: 2,
|
|
154
|
-
class: "text-orange-500 text-[13px]"
|
|
155
|
-
}, qe = /* @__PURE__ */ B({
|
|
156
|
-
__name: "SEO",
|
|
157
|
-
setup(U) {
|
|
158
|
-
const { errors: p } = E(), { value: m } = N("title"), { value: b } = N("slug"), { value: n } = N("seo");
|
|
159
|
-
function f(S) {
|
|
160
|
-
return S ? S.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^\w\s-]/g, "").trim().replace(/[-\s]+/g, "-") : "";
|
|
161
|
-
}
|
|
162
|
-
return Z(m, (S, i) => {
|
|
163
|
-
(!b.value || f(i) === b.value) && (b.value = f(S)), (!n.value.title || i === n.value.title) && (n.value.title = S);
|
|
164
|
-
}), (S, i) => {
|
|
165
|
-
const a = c("Label"), _ = c("Input"), V = c("Textarea"), T = c("CardContent"), I = c("Card");
|
|
166
|
-
return r(), h(I, null, {
|
|
167
|
-
default: l(() => [
|
|
168
|
-
t(T, null, {
|
|
169
|
-
default: l(() => [
|
|
170
|
-
i[7] || (i[7] = s("h3", { class: "text-lg font-semibold mb-4" }, "Search engine listing", -1)),
|
|
171
|
-
s("div", Te, [
|
|
172
|
-
s("div", Ie, [
|
|
173
|
-
s("img", {
|
|
174
|
-
src: e(ue),
|
|
175
|
-
alt: "Google",
|
|
176
|
-
class: "w-16 pointer-events-none",
|
|
177
|
-
draggable: "false"
|
|
178
|
-
}, null, 8, ze),
|
|
179
|
-
i[3] || (i[3] = s("span", { class: "text-[#4186f5] font-medium text-xs" }, "Preview", -1))
|
|
180
|
-
]),
|
|
181
|
-
s("p", Pe, y(e(n).title), 1),
|
|
182
|
-
s("p", Ne, y(e(b)), 1),
|
|
183
|
-
s("p", De, y(e(n).description?.slice(0, 155)) + y(e(n).description?.length > 155 ? " ..." : ""), 1)
|
|
184
|
-
]),
|
|
185
|
-
s("div", Ue, [
|
|
186
|
-
s("div", Fe, [
|
|
187
|
-
t(a, {
|
|
188
|
-
for: "slug",
|
|
189
|
-
class: "text-sm mb-2"
|
|
190
|
-
}, {
|
|
191
|
-
default: l(() => [...i[4] || (i[4] = [
|
|
192
|
-
d("Slug", -1)
|
|
193
|
-
])]),
|
|
194
|
-
_: 1
|
|
195
|
-
}),
|
|
196
|
-
t(_, {
|
|
197
|
-
id: "slug",
|
|
198
|
-
placeholder: "t-shirt-with-red-heart",
|
|
199
|
-
modelValue: e(b),
|
|
200
|
-
"onUpdate:modelValue": i[0] || (i[0] = (v) => j(b) ? b.value = v : null)
|
|
201
|
-
}, null, 8, ["modelValue"]),
|
|
202
|
-
e(p).slug ? (r(), C("p", je, y(e(p).slug), 1)) : g("", !0)
|
|
203
|
-
])
|
|
204
|
-
]),
|
|
205
|
-
s("div", Be, [
|
|
206
|
-
s("div", Le, [
|
|
207
|
-
t(a, {
|
|
208
|
-
for: "meta-title",
|
|
209
|
-
class: "text-sm mb-2"
|
|
210
|
-
}, {
|
|
211
|
-
default: l(() => [...i[5] || (i[5] = [
|
|
212
|
-
d("Title", -1)
|
|
213
|
-
])]),
|
|
214
|
-
_: 1
|
|
215
|
-
}),
|
|
216
|
-
t(_, {
|
|
217
|
-
id: "meta-title",
|
|
218
|
-
placeholder: "T-shirt with red heart",
|
|
219
|
-
modelValue: e(n).title,
|
|
220
|
-
"onUpdate:modelValue": i[1] || (i[1] = (v) => e(n).title = v)
|
|
221
|
-
}, null, 8, ["modelValue"]),
|
|
222
|
-
e(p).seo?.title ? (r(), C("p", Ee, y(e(p).seo.title), 1)) : g("", !0)
|
|
223
|
-
])
|
|
224
|
-
]),
|
|
225
|
-
s("div", Oe, [
|
|
226
|
-
s("div", Je, [
|
|
227
|
-
t(a, {
|
|
228
|
-
for: "meta-description",
|
|
229
|
-
class: "text-sm mb-2"
|
|
230
|
-
}, {
|
|
231
|
-
default: l(() => [...i[6] || (i[6] = [
|
|
232
|
-
d("Description", -1)
|
|
233
|
-
])]),
|
|
234
|
-
_: 1
|
|
235
|
-
}),
|
|
236
|
-
t(V, {
|
|
237
|
-
id: "meta-description",
|
|
238
|
-
placeholder: "Lovely T-shirt featuring a red heart",
|
|
239
|
-
modelValue: e(n).description,
|
|
240
|
-
"onUpdate:modelValue": i[2] || (i[2] = (v) => e(n).description = v),
|
|
241
|
-
class: "mb-1 resize-none"
|
|
242
|
-
}, null, 8, ["modelValue"]),
|
|
243
|
-
e(p).seo?.description ? (r(), C("p", Ae, y(e(p).seo.description), 1)) : e(n).description.length < 155 ? (r(), C("p", Ge, y(e(n).description.length) + " characters", 1)) : (r(), C("p", Re, "Please keep it under 155 characters"))
|
|
244
|
-
])
|
|
245
|
-
])
|
|
246
|
-
]),
|
|
247
|
-
_: 1
|
|
248
|
-
})
|
|
249
|
-
]),
|
|
250
|
-
_: 1
|
|
251
|
-
});
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
}), We = { class: "flex items-center gap-2" }, Xe = {
|
|
255
|
-
key: 0,
|
|
256
|
-
class: "size-3 rounded-full bg-green-500"
|
|
257
|
-
}, He = {
|
|
258
|
-
key: 1,
|
|
259
|
-
class: "size-3 rounded-full bg-blue-500"
|
|
260
|
-
}, Ke = /* @__PURE__ */ B({
|
|
261
|
-
__name: "Status",
|
|
262
|
-
setup(U) {
|
|
263
|
-
const { errors: p } = E(), { value: m } = N("status");
|
|
264
|
-
return (b, n) => {
|
|
265
|
-
const f = c("SelectValue"), S = c("SelectTrigger"), i = c("SelectItem"), a = c("SelectGroup"), _ = c("SelectContent"), V = c("Select"), T = c("CardContent"), I = c("Card");
|
|
266
|
-
return r(), h(I, null, {
|
|
267
|
-
default: l(() => [
|
|
268
|
-
t(T, null, {
|
|
269
|
-
default: l(() => [
|
|
270
|
-
n[3] || (n[3] = s("p", { class: "text-md font-semibold mb-2" }, "Status", -1)),
|
|
271
|
-
t(V, {
|
|
272
|
-
modelValue: e(m),
|
|
273
|
-
"onUpdate:modelValue": n[0] || (n[0] = (v) => j(m) ? m.value = v : null),
|
|
274
|
-
class: "w-full"
|
|
275
|
-
}, {
|
|
276
|
-
default: l(() => [
|
|
277
|
-
t(S, { class: "w-full" }, {
|
|
278
|
-
default: l(() => [
|
|
279
|
-
s("div", We, [
|
|
280
|
-
e(m) === "published" ? (r(), C("span", Xe)) : e(m) === "draft" ? (r(), C("span", He)) : g("", !0),
|
|
281
|
-
t(f, { placeholder: "Status" })
|
|
282
|
-
])
|
|
283
|
-
]),
|
|
284
|
-
_: 1
|
|
285
|
-
}),
|
|
286
|
-
t(_, null, {
|
|
287
|
-
default: l(() => [
|
|
288
|
-
t(a, null, {
|
|
289
|
-
default: l(() => [
|
|
290
|
-
t(i, { value: "published" }, {
|
|
291
|
-
default: l(() => [...n[1] || (n[1] = [
|
|
292
|
-
s("span", { class: "size-3 rounded-full bg-green-500" }, null, -1),
|
|
293
|
-
d(" Published ", -1)
|
|
294
|
-
])]),
|
|
295
|
-
_: 1
|
|
296
|
-
}),
|
|
297
|
-
t(i, { value: "draft" }, {
|
|
298
|
-
default: l(() => [...n[2] || (n[2] = [
|
|
299
|
-
s("span", { class: "size-3 rounded-full bg-blue-500" }, null, -1),
|
|
300
|
-
d(" Draft ", -1)
|
|
301
|
-
])]),
|
|
302
|
-
_: 1
|
|
303
|
-
})
|
|
304
|
-
]),
|
|
305
|
-
_: 1
|
|
306
|
-
})
|
|
307
|
-
]),
|
|
308
|
-
_: 1
|
|
309
|
-
})
|
|
310
|
-
]),
|
|
311
|
-
_: 1
|
|
312
|
-
}, 8, ["modelValue"])
|
|
313
|
-
]),
|
|
314
|
-
_: 1
|
|
315
|
-
})
|
|
316
|
-
]),
|
|
317
|
-
_: 1
|
|
318
|
-
});
|
|
319
|
-
};
|
|
320
|
-
}
|
|
321
|
-
}), Qe = { class: "relative @container" }, Ye = { class: "flex flex-row gap-4 justify-between max-w-5xl mx-auto mt-4 mb-6" }, Ze = { class: "flex items-center" }, et = { class: "text-lg font-semibold mx-2" }, tt = {
|
|
322
|
-
key: 0,
|
|
323
|
-
class: "bg-green-500 text-green-950 px-2 py-1 rounded-lg text-xs"
|
|
324
|
-
}, lt = {
|
|
325
|
-
key: 1,
|
|
326
|
-
class: "bg-blue-500 text-blue-950 px-2 py-1 rounded-lg text-xs"
|
|
327
|
-
}, ot = { class: "flex flex-col @3xl:flex-row gap-4 max-w-5xl mx-auto pb-24" }, st = { class: "flex flex-col gap-4 w-full @3xl:w-2/3" }, nt = { class: "flex flex-col gap-4 w-full @3xl:w-1/3" }, it = {
|
|
328
|
-
key: 0,
|
|
329
|
-
class: "fixed bottom-4 left-0 md:left-12 right-0 min-w-xs max-w-5xl w-[calc(100%-2rem)] md:w-[calc(100%-5rem)] xl:w-[calc(100%-2rem)] h-16 border border-white/10 backdrop-blur-sm border-t border-border flex items-center justify-center px-4 mx-auto z-[9999] rounded-xl overflow-hidden shadow bg-[radial-gradient(#ffffff80,transparent)] dark:bg-[radial-gradient(#00000080,transparent)]"
|
|
330
|
-
}, at = { class: "w-full max-w-5xl flex items-center justify-end mx-auto" }, _t = /* @__PURE__ */ B({
|
|
331
|
-
__name: "Detail",
|
|
332
|
-
props: {
|
|
333
|
-
config: {
|
|
334
|
-
type: Object,
|
|
335
|
-
required: !0
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
setup(U) {
|
|
339
|
-
const p = U, { hasPermission: m, hasAnyPermission: b } = de(), { params: n, navigateTo: f } = pe(), { confirm: S } = me(), i = fe(p.config.project);
|
|
340
|
-
R("sources", p.config.allowedMediaSources), R("defaultSource", p.config.defaultUploadMediaSource);
|
|
341
|
-
const a = ee(() => !n.value.collectionId || n.value.collectionId === "new"), _ = te(!1), V = oe(q({
|
|
342
|
-
id: M().optional(),
|
|
343
|
-
title: M().min(1, "Title is required"),
|
|
344
|
-
type: M(),
|
|
345
|
-
description: M().optional(),
|
|
346
|
-
thumbnail: M().optional(),
|
|
347
|
-
slug: M(),
|
|
348
|
-
seo: q({
|
|
349
|
-
title: M().optional(),
|
|
350
|
-
description: M().optional()
|
|
351
|
-
}).optional(),
|
|
352
|
-
status: M()
|
|
353
|
-
})), { handleSubmit: T, errors: I, values: v, setValues: L } = se({
|
|
354
|
-
validationSchema: V,
|
|
355
|
-
initialValues: {
|
|
356
|
-
status: "draft",
|
|
357
|
-
type: "manual",
|
|
358
|
-
seo: {
|
|
359
|
-
title: "",
|
|
360
|
-
description: ""
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
_e(() => [
|
|
365
|
-
{ text: a.value ? "New Collection" : v.title || "Collection" }
|
|
366
|
-
]);
|
|
367
|
-
const F = T(async (u) => {
|
|
368
|
-
_.value = !0;
|
|
369
|
-
let o = await k() || [];
|
|
370
|
-
if (a.value) {
|
|
371
|
-
let x = JSON.parse(JSON.stringify(u));
|
|
372
|
-
if (x.id = crypto.randomUUID(), await O(x.slug)) {
|
|
373
|
-
P.error("Collection with this slug already exists"), _.value = !1;
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
const $ = [...o, x], w = p.config.collectionsCollection.split(":");
|
|
377
|
-
await i.update(w[0], null, { [w[1]]: $ }), f("/"), P.success("Collection created");
|
|
378
|
-
} else {
|
|
379
|
-
let x = JSON.parse(JSON.stringify(u));
|
|
380
|
-
const $ = o.map((z) => z.id === n.value.collectionId ? x : z), w = p.config.collectionsCollection.split(":");
|
|
381
|
-
await i.update(w[0], null, { [w[1]]: $ }), f("/"), P.success("Collection updated");
|
|
382
|
-
}
|
|
383
|
-
_.value = !1;
|
|
384
|
-
}), k = async () => {
|
|
385
|
-
if (!p.config.collectionsCollection) return [];
|
|
386
|
-
const u = p.config.collectionsCollection.split(":");
|
|
387
|
-
return u.length !== 2 ? [] : (await i.get(u[0]))?.[u[1]] || [];
|
|
388
|
-
}, X = async () => {
|
|
389
|
-
const o = (await k()).find((x) => x.id === n.value.collectionId);
|
|
390
|
-
L(o);
|
|
391
|
-
}, H = async () => {
|
|
392
|
-
try {
|
|
393
|
-
let u = { ...v }, o = u.slug + "-copy", x = 2;
|
|
394
|
-
for (; await O(o); )
|
|
395
|
-
o = u.slug + "-copy-" + x, x++;
|
|
396
|
-
u.id = crypto.randomUUID(), u.slug = o, u.status = "draft", u.title = u.title + " (copy)";
|
|
397
|
-
const w = [...await k() || [], u], z = p.config.collectionsCollection.split(":");
|
|
398
|
-
await i.update(z[0], null, { [z[1]]: w }), f(u.id), P.success("Collection duplicated");
|
|
399
|
-
} catch {
|
|
400
|
-
P.error("Failed to duplicate collection");
|
|
401
|
-
}
|
|
402
|
-
}, K = async () => {
|
|
403
|
-
if (await S("Are you sure you want to delete this collection?"))
|
|
404
|
-
try {
|
|
405
|
-
const o = await k() || [];
|
|
406
|
-
if (o.length === 0 || !n.value.collectionId) throw new Error("Error loading values");
|
|
407
|
-
const x = o.filter((w) => w.id !== n.value.collectionId), $ = p.config.collectionsCollection.split(":");
|
|
408
|
-
await i.update($[0], null, { [$[1]]: x }), f(""), P.success("Collection deleted");
|
|
409
|
-
} catch {
|
|
410
|
-
P.error("Failed to delete collection");
|
|
411
|
-
}
|
|
412
|
-
}, O = async (u) => !!(await k() || []).find((x) => x.slug === u);
|
|
413
|
-
return le(() => {
|
|
414
|
-
a.value || X();
|
|
415
|
-
}), (u, o) => {
|
|
416
|
-
const x = c("Button"), $ = c("MenubarTrigger"), w = c("MenubarMenu"), z = c("MenubarShortcut"), D = c("MenubarItem"), J = c("MenubarSeparator"), A = c("MenubarContent"), Q = c("Menubar");
|
|
417
|
-
return r(), C("div", Qe, [
|
|
418
|
-
s("div", Ye, [
|
|
419
|
-
s("div", Ze, [
|
|
420
|
-
t(x, {
|
|
421
|
-
variant: "ghost",
|
|
422
|
-
onClick: o[0] || (o[0] = (rt) => e(f)(""))
|
|
423
|
-
}, {
|
|
424
|
-
default: l(() => [
|
|
425
|
-
t(e(ae), { class: "size-4" })
|
|
426
|
-
]),
|
|
427
|
-
_: 1
|
|
428
|
-
}),
|
|
429
|
-
t(e(re), { class: "size-3" }),
|
|
430
|
-
s("h1", et, y(a.value ? "New Collection" : e(v).title), 1),
|
|
431
|
-
e(v).status === "published" ? (r(), C("span", tt, "Published")) : e(v).status === "draft" ? (r(), C("span", lt, "Draft")) : g("", !0)
|
|
432
|
-
]),
|
|
433
|
-
a.value ? g("", !0) : (r(), h(Q, {
|
|
434
|
-
key: 0,
|
|
435
|
-
class: "bg-sidebar"
|
|
436
|
-
}, {
|
|
437
|
-
default: l(() => [
|
|
438
|
-
e(m)("create-collection") ? (r(), h(w, { key: 0 }, {
|
|
439
|
-
default: l(() => [
|
|
440
|
-
t($, { onClick: H }, {
|
|
441
|
-
default: l(() => [...o[1] || (o[1] = [
|
|
442
|
-
d("Duplicate", -1)
|
|
443
|
-
])]),
|
|
444
|
-
_: 1
|
|
445
|
-
})
|
|
446
|
-
]),
|
|
447
|
-
_: 1
|
|
448
|
-
})) : g("", !0),
|
|
449
|
-
t(w, null, {
|
|
450
|
-
default: l(() => [
|
|
451
|
-
t($, null, {
|
|
452
|
-
default: l(() => [...o[2] || (o[2] = [
|
|
453
|
-
d("Preview", -1)
|
|
454
|
-
])]),
|
|
455
|
-
_: 1
|
|
456
|
-
})
|
|
457
|
-
]),
|
|
458
|
-
_: 1
|
|
459
|
-
}),
|
|
460
|
-
t(w, null, {
|
|
461
|
-
default: l(() => [
|
|
462
|
-
t($, null, {
|
|
463
|
-
default: l(() => [...o[3] || (o[3] = [
|
|
464
|
-
d("Share", -1)
|
|
465
|
-
])]),
|
|
466
|
-
_: 1
|
|
467
|
-
}),
|
|
468
|
-
t(A, null, {
|
|
469
|
-
default: l(() => [
|
|
470
|
-
t(D, null, {
|
|
471
|
-
default: l(() => [
|
|
472
|
-
o[5] || (o[5] = d(" New Tab ", -1)),
|
|
473
|
-
t(z, null, {
|
|
474
|
-
default: l(() => [...o[4] || (o[4] = [
|
|
475
|
-
d("⌘T", -1)
|
|
476
|
-
])]),
|
|
477
|
-
_: 1
|
|
478
|
-
})
|
|
479
|
-
]),
|
|
480
|
-
_: 1
|
|
481
|
-
}),
|
|
482
|
-
t(D, null, {
|
|
483
|
-
default: l(() => [...o[6] || (o[6] = [
|
|
484
|
-
d("New Window", -1)
|
|
485
|
-
])]),
|
|
486
|
-
_: 1
|
|
487
|
-
}),
|
|
488
|
-
t(J),
|
|
489
|
-
t(D, null, {
|
|
490
|
-
default: l(() => [...o[7] || (o[7] = [
|
|
491
|
-
d("Share", -1)
|
|
492
|
-
])]),
|
|
493
|
-
_: 1
|
|
494
|
-
}),
|
|
495
|
-
t(J),
|
|
496
|
-
t(D, null, {
|
|
497
|
-
default: l(() => [...o[8] || (o[8] = [
|
|
498
|
-
d("Print", -1)
|
|
499
|
-
])]),
|
|
500
|
-
_: 1
|
|
501
|
-
})
|
|
502
|
-
]),
|
|
503
|
-
_: 1
|
|
504
|
-
})
|
|
505
|
-
]),
|
|
506
|
-
_: 1
|
|
507
|
-
}),
|
|
508
|
-
e(b)("edit-collection", "delete-collection") ? (r(), h(w, { key: 1 }, {
|
|
509
|
-
default: l(() => [
|
|
510
|
-
t($, null, {
|
|
511
|
-
default: l(() => [...o[9] || (o[9] = [
|
|
512
|
-
d("More actions", -1)
|
|
513
|
-
])]),
|
|
514
|
-
_: 1
|
|
515
|
-
}),
|
|
516
|
-
t(A, null, {
|
|
517
|
-
default: l(() => [
|
|
518
|
-
e(m)("delete-collection") ? (r(), h(D, {
|
|
519
|
-
key: 0,
|
|
520
|
-
variant: "destructive",
|
|
521
|
-
onClick: K
|
|
522
|
-
}, {
|
|
523
|
-
default: l(() => [
|
|
524
|
-
t(e(ce), { class: "size-4" }),
|
|
525
|
-
o[10] || (o[10] = d(" Delete collection ", -1))
|
|
526
|
-
]),
|
|
527
|
-
_: 1
|
|
528
|
-
})) : g("", !0)
|
|
529
|
-
]),
|
|
530
|
-
_: 1
|
|
531
|
-
})
|
|
532
|
-
]),
|
|
533
|
-
_: 1
|
|
534
|
-
})) : g("", !0)
|
|
535
|
-
]),
|
|
536
|
-
_: 1
|
|
537
|
-
}))
|
|
538
|
-
]),
|
|
539
|
-
s("div", ot, [
|
|
540
|
-
s("div", st, [
|
|
541
|
-
t(Ve),
|
|
542
|
-
t(qe)
|
|
543
|
-
]),
|
|
544
|
-
s("div", nt, [
|
|
545
|
-
t(Ke)
|
|
546
|
-
])
|
|
547
|
-
]),
|
|
548
|
-
e(b)("create-collection", "edit-collection") ? (r(), C("div", it, [
|
|
549
|
-
s("div", at, [
|
|
550
|
-
a.value && e(m)("create-collection") ? (r(), h(x, {
|
|
551
|
-
key: 0,
|
|
552
|
-
onClick: e(F),
|
|
553
|
-
disabled: _.value
|
|
554
|
-
}, {
|
|
555
|
-
default: l(() => [
|
|
556
|
-
_.value ? (r(), h(e(W), {
|
|
557
|
-
key: 0,
|
|
558
|
-
class: "size-4 animate-spin"
|
|
559
|
-
})) : g("", !0),
|
|
560
|
-
d(" " + y(_.value ? "Creating" : "Create") + " New Collection ", 1)
|
|
561
|
-
]),
|
|
562
|
-
_: 1
|
|
563
|
-
}, 8, ["onClick", "disabled"])) : e(m)("edit-collection") ? (r(), h(x, {
|
|
564
|
-
key: 1,
|
|
565
|
-
onClick: e(F),
|
|
566
|
-
disabled: _.value
|
|
567
|
-
}, {
|
|
568
|
-
default: l(() => [
|
|
569
|
-
_.value ? (r(), h(e(W), {
|
|
570
|
-
key: 0,
|
|
571
|
-
class: "size-4 animate-spin"
|
|
572
|
-
})) : g("", !0),
|
|
573
|
-
d(" " + y(_.value ? "Saving" : "Save") + " Changes ", 1)
|
|
574
|
-
]),
|
|
575
|
-
_: 1
|
|
576
|
-
}, 8, ["onClick", "disabled"])) : g("", !0)
|
|
577
|
-
])
|
|
578
|
-
])) : g("", !0)
|
|
579
|
-
]);
|
|
580
|
-
};
|
|
581
|
-
}
|
|
582
|
-
});
|
|
583
|
-
export {
|
|
584
|
-
_t as default
|
|
585
|
-
};
|
package/dist/Detail-CPqug27l.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./vee-validate-zod-ByykgYKJ.js"),b=require("lucide-vue-next"),z=require("./google-D4N3gb01.js"),k=require("@oneclick.dev/cms-kit"),w=require("./index-ijdf0d9-.js"),F={class:"flex flex-col gap-4"},j={class:"flex flex-col gap-2"},U={key:0,class:"text-red-500 text-sm mt-1"},q={class:"flex flex-col gap-4"},L={class:"flex flex-col gap-2"},O={key:0,class:"text-red-500 text-sm mt-1"},R={class:"flex flex-col gap-4"},J={class:"flex flex-col gap-2"},A={class:"flex items-center gap-2 mb-2"},G={class:"flex items-center gap-2"},K=["src"],W={key:0,class:"text-red-500 text-sm mt-1"},X=e.defineComponent({__name:"Main",setup(y){const a=e.inject("sources");e.inject("defaultSource");const{errors:c}=s.useFormContext(),{value:m}=s.useField("title"),{value:o}=s.useField("description"),{value:i}=s.useField("thumbnail"),x=l=>{i.value=l};return(l,n)=>{const d=e.resolveComponent("Label"),g=e.resolveComponent("Input"),V=e.resolveComponent("Textarea"),N=e.resolveComponent("Button"),p=e.resolveComponent("MediaPickerDialog"),S=e.resolveComponent("CardContent"),B=e.resolveComponent("Card");return e.openBlock(),e.createBlock(B,null,{default:e.withCtx(()=>[e.createVNode(S,{class:"flex flex-col gap-4"},{default:e.withCtx(()=>[e.createElementVNode("div",F,[e.createElementVNode("div",j,[e.createVNode(d,{for:"title",class:"text-sm mb-2"},{default:e.withCtx(()=>[...n[5]||(n[5]=[e.createTextVNode("Title",-1)])]),_:1}),e.createVNode(g,{type:"text",id:"title",placeholder:"Summer collection",modelValue:e.unref(m),"onUpdate:modelValue":n[0]||(n[0]=C=>e.isRef(m)?m.value=C:null)},null,8,["modelValue"]),e.unref(c).title?(e.openBlock(),e.createElementBlock("p",U,e.toDisplayString(e.unref(c).title),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",q,[e.createElementVNode("div",L,[e.createVNode(d,{for:"description",class:"text-sm mb-2"},{default:e.withCtx(()=>[...n[6]||(n[6]=[e.createTextVNode("Description",-1)])]),_:1}),e.createVNode(V,{id:"description",placeholder:"Fresh, vibrant, and bold. The perfect collection for the summer season.",modelValue:e.unref(o),"onUpdate:modelValue":n[1]||(n[1]=C=>e.isRef(o)?o.value=C:null)},null,8,["modelValue"]),e.unref(c).description?(e.openBlock(),e.createElementBlock("p",O,e.toDisplayString(e.unref(c).description),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",R,[e.createElementVNode("div",J,[e.createElementVNode("div",A,[e.createVNode(d,{for:"media",class:"text-sm"},{default:e.withCtx(()=>[...n[7]||(n[7]=[e.createTextVNode("Thumbnail",-1)])]),_:1}),e.unref(i)?(e.openBlock(),e.createBlock(N,{key:0,variant:"ghost",size:"icon",onClick:n[2]||(n[2]=C=>i.value="")},{default:e.withCtx(()=>[e.createVNode(e.unref(b.X),{class:"size-4"})]),_:1})):e.createCommentVNode("",!0)]),e.createElementVNode("div",G,[e.createVNode(p,{sources:e.unref(a),maxFiles:1,"initial-value":e.unref(i)?[e.unref(i)]:[],onSubmit:n[4]||(n[4]=C=>x(C))},{default:e.withCtx(()=>[e.createElementVNode("button",{onClick:n[3]||(n[3]=e.withModifiers(()=>{},["stop"])),tabindex:"-1",class:"cursor-pointer block"},[e.unref(i)?(e.openBlock(),e.createElementBlock("img",{key:1,src:e.unref(i),class:"size-42 rounded-md object-cover",draggable:"false"},null,8,K)):(e.openBlock(),e.createBlock(N,{key:0,variant:"outline",class:"size-42 border-dashed cursor-pointer"},{default:e.withCtx(()=>[e.createVNode(e.unref(b.ImagePlus))]),_:1}))])]),_:1},8,["sources","initial-value"]),e.unref(c).thumbnail?(e.openBlock(),e.createElementBlock("p",W,e.toDisplayString(e.unref(c).thumbnail),1)):e.createCommentVNode("",!0)])])])]),_:1})]),_:1})}}}),Z={class:"bg-white dark:bg-gray-50 border-4 dark:border-gray-600 p-4 rounded-lg mb-4"},H={class:"flex items-center gap-2 mb-2"},Q=["src"],Y={class:"text-[#1a0dab] text-lg"},ee={class:"text-[#006621] text-[13px]"},te={class:"text-[#545454] text-[13px]"},oe={class:"flex flex-col gap-4 mb-4"},le={class:"flex flex-col"},ne={key:0,class:"text-red-500 text-sm mt-1"},se={class:"flex flex-col gap-4 mb-4"},re={class:"flex flex-col"},ae={key:0,class:"text-red-500 text-sm mt-1"},ce={class:"flex flex-col gap-4"},ie={class:"flex flex-col"},de={key:0,class:"text-red-500 text-sm mt-1"},ue={key:1,class:"text-[#545454] text-[13px]"},me={key:2,class:"text-orange-500 text-[13px]"},pe=e.defineComponent({__name:"SEO",setup(y){const{errors:a}=s.useFormContext(),{value:c}=s.useField("title"),{value:m}=s.useField("slug"),{value:o}=s.useField("seo");function i(x){return x?x.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^\w\s-]/g,"").trim().replace(/[-\s]+/g,"-"):""}return e.watch(c,(x,l)=>{(!m.value||i(l)===m.value)&&(m.value=i(x)),(!o.value.title||l===o.value.title)&&(o.value.title=x)}),(x,l)=>{const n=e.resolveComponent("Label"),d=e.resolveComponent("Input"),g=e.resolveComponent("Textarea"),V=e.resolveComponent("CardContent"),N=e.resolveComponent("Card");return e.openBlock(),e.createBlock(N,null,{default:e.withCtx(()=>[e.createVNode(V,null,{default:e.withCtx(()=>[l[7]||(l[7]=e.createElementVNode("h3",{class:"text-lg font-semibold mb-4"},"Search engine listing",-1)),e.createElementVNode("div",Z,[e.createElementVNode("div",H,[e.createElementVNode("img",{src:e.unref(z.googleImg),alt:"Google",class:"w-16 pointer-events-none",draggable:"false"},null,8,Q),l[3]||(l[3]=e.createElementVNode("span",{class:"text-[#4186f5] font-medium text-xs"},"Preview",-1))]),e.createElementVNode("p",Y,e.toDisplayString(e.unref(o).title),1),e.createElementVNode("p",ee,e.toDisplayString(e.unref(m)),1),e.createElementVNode("p",te,e.toDisplayString(e.unref(o).description?.slice(0,155))+e.toDisplayString(e.unref(o).description?.length>155?" ...":""),1)]),e.createElementVNode("div",oe,[e.createElementVNode("div",le,[e.createVNode(n,{for:"slug",class:"text-sm mb-2"},{default:e.withCtx(()=>[...l[4]||(l[4]=[e.createTextVNode("Slug",-1)])]),_:1}),e.createVNode(d,{id:"slug",placeholder:"t-shirt-with-red-heart",modelValue:e.unref(m),"onUpdate:modelValue":l[0]||(l[0]=p=>e.isRef(m)?m.value=p:null)},null,8,["modelValue"]),e.unref(a).slug?(e.openBlock(),e.createElementBlock("p",ne,e.toDisplayString(e.unref(a).slug),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",se,[e.createElementVNode("div",re,[e.createVNode(n,{for:"meta-title",class:"text-sm mb-2"},{default:e.withCtx(()=>[...l[5]||(l[5]=[e.createTextVNode("Title",-1)])]),_:1}),e.createVNode(d,{id:"meta-title",placeholder:"T-shirt with red heart",modelValue:e.unref(o).title,"onUpdate:modelValue":l[1]||(l[1]=p=>e.unref(o).title=p)},null,8,["modelValue"]),e.unref(a).seo?.title?(e.openBlock(),e.createElementBlock("p",ae,e.toDisplayString(e.unref(a).seo.title),1)):e.createCommentVNode("",!0)])]),e.createElementVNode("div",ce,[e.createElementVNode("div",ie,[e.createVNode(n,{for:"meta-description",class:"text-sm mb-2"},{default:e.withCtx(()=>[...l[6]||(l[6]=[e.createTextVNode("Description",-1)])]),_:1}),e.createVNode(g,{id:"meta-description",placeholder:"Lovely T-shirt featuring a red heart",modelValue:e.unref(o).description,"onUpdate:modelValue":l[2]||(l[2]=p=>e.unref(o).description=p),class:"mb-1 resize-none"},null,8,["modelValue"]),e.unref(a).seo?.description?(e.openBlock(),e.createElementBlock("p",de,e.toDisplayString(e.unref(a).seo.description),1)):e.unref(o).description.length<155?(e.openBlock(),e.createElementBlock("p",ue,e.toDisplayString(e.unref(o).description.length)+" characters",1)):(e.openBlock(),e.createElementBlock("p",me,"Please keep it under 155 characters"))])])]),_:1})]),_:1})}}}),fe={class:"flex items-center gap-2"},xe={key:0,class:"size-3 rounded-full bg-green-500"},Ce={key:1,class:"size-3 rounded-full bg-blue-500"},_e=e.defineComponent({__name:"Status",setup(y){const{errors:a}=s.useFormContext(),{value:c}=s.useField("status");return(m,o)=>{const i=e.resolveComponent("SelectValue"),x=e.resolveComponent("SelectTrigger"),l=e.resolveComponent("SelectItem"),n=e.resolveComponent("SelectGroup"),d=e.resolveComponent("SelectContent"),g=e.resolveComponent("Select"),V=e.resolveComponent("CardContent"),N=e.resolveComponent("Card");return e.openBlock(),e.createBlock(N,null,{default:e.withCtx(()=>[e.createVNode(V,null,{default:e.withCtx(()=>[o[3]||(o[3]=e.createElementVNode("p",{class:"text-md font-semibold mb-2"},"Status",-1)),e.createVNode(g,{modelValue:e.unref(c),"onUpdate:modelValue":o[0]||(o[0]=p=>e.isRef(c)?c.value=p:null),class:"w-full"},{default:e.withCtx(()=>[e.createVNode(x,{class:"w-full"},{default:e.withCtx(()=>[e.createElementVNode("div",fe,[e.unref(c)==="published"?(e.openBlock(),e.createElementBlock("span",xe)):e.unref(c)==="draft"?(e.openBlock(),e.createElementBlock("span",Ce)):e.createCommentVNode("",!0),e.createVNode(i,{placeholder:"Status"})])]),_:1}),e.createVNode(d,null,{default:e.withCtx(()=>[e.createVNode(n,null,{default:e.withCtx(()=>[e.createVNode(l,{value:"published"},{default:e.withCtx(()=>[...o[1]||(o[1]=[e.createElementVNode("span",{class:"size-3 rounded-full bg-green-500"},null,-1),e.createTextVNode(" Published ",-1)])]),_:1}),e.createVNode(l,{value:"draft"},{default:e.withCtx(()=>[...o[2]||(o[2]=[e.createElementVNode("span",{class:"size-3 rounded-full bg-blue-500"},null,-1),e.createTextVNode(" Draft ",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1})}}}),ge={class:"relative @container"},Ve={class:"flex flex-row gap-4 justify-between max-w-5xl mx-auto mt-4 mb-6"},Ne={class:"flex items-center"},ve={class:"text-lg font-semibold mx-2"},we={key:0,class:"bg-green-500 text-green-950 px-2 py-1 rounded-lg text-xs"},be={key:1,class:"bg-blue-500 text-blue-950 px-2 py-1 rounded-lg text-xs"},he={class:"flex flex-col @3xl:flex-row gap-4 max-w-5xl mx-auto pb-24"},ke={class:"flex flex-col gap-4 w-full @3xl:w-2/3"},ye={class:"flex flex-col gap-4 w-full @3xl:w-1/3"},Be={key:0,class:"fixed bottom-4 left-0 md:left-12 right-0 min-w-xs max-w-5xl w-[calc(100%-2rem)] md:w-[calc(100%-5rem)] xl:w-[calc(100%-2rem)] h-16 border border-white/10 backdrop-blur-sm border-t border-border flex items-center justify-center px-4 mx-auto z-[9999] rounded-xl overflow-hidden shadow bg-[radial-gradient(#ffffff80,transparent)] dark:bg-[radial-gradient(#00000080,transparent)]"},Se={class:"w-full max-w-5xl flex items-center justify-end mx-auto"},Ee=e.defineComponent({__name:"Detail",props:{config:{type:Object,required:!0}},setup(y){const a=y,{hasPermission:c,hasAnyPermission:m}=k.useModulePermissions(),{params:o,navigateTo:i}=k.useModuleRoute(),{confirm:x}=k.useConfirmation(),l=k.useFirebaseIntegration(a.config.project);e.provide("sources",a.config.allowedMediaSources),e.provide("defaultSource",a.config.defaultUploadMediaSource);const n=e.computed(()=>!o.value.collectionId||o.value.collectionId==="new"),d=e.ref(!1),g=s.toTypedSchema(s.objectType({id:s.stringType().optional(),title:s.stringType().min(1,"Title is required"),type:s.stringType(),description:s.stringType().optional(),thumbnail:s.stringType().optional(),slug:s.stringType(),seo:s.objectType({title:s.stringType().optional(),description:s.stringType().optional()}).optional(),status:s.stringType()})),{handleSubmit:V,errors:N,values:p,setValues:S}=s.useForm({validationSchema:g,initialValues:{status:"draft",type:"manual",seo:{title:"",description:""}}});k.useModuleBreadcrumbs(()=>[{text:n.value?"New Collection":p.title||"Collection"}]);const B=V(async r=>{d.value=!0;let t=await C()||[];if(n.value){let u=JSON.parse(JSON.stringify(r));if(u.id=crypto.randomUUID(),await E(u.slug)){w.toast.error("Collection with this slug already exists"),d.value=!1;return}const _=[...t,u],f=a.config.collectionsCollection.split(":");await l.update(f[0],null,{[f[1]]:_}),i("/"),w.toast.success("Collection created")}else{let u=JSON.parse(JSON.stringify(r));const _=t.map(v=>v.id===o.value.collectionId?u:v),f=a.config.collectionsCollection.split(":");await l.update(f[0],null,{[f[1]]:_}),i("/"),w.toast.success("Collection updated")}d.value=!1}),C=async()=>{if(!a.config.collectionsCollection)return[];const r=a.config.collectionsCollection.split(":");return r.length!==2?[]:(await l.get(r[0]))?.[r[1]]||[]},M=async()=>{const t=(await C()).find(u=>u.id===o.value.collectionId);S(t)},D=async()=>{try{let r={...p},t=r.slug+"-copy",u=2;for(;await E(t);)t=r.slug+"-copy-"+u,u++;r.id=crypto.randomUUID(),r.slug=t,r.status="draft",r.title=r.title+" (copy)";const f=[...await C()||[],r],v=a.config.collectionsCollection.split(":");await l.update(v[0],null,{[v[1]]:f}),i(r.id),w.toast.success("Collection duplicated")}catch{w.toast.error("Failed to duplicate collection")}},I=async()=>{if(await x("Are you sure you want to delete this collection?"))try{const t=await C()||[];if(t.length===0||!o.value.collectionId)throw new Error("Error loading values");const u=t.filter(f=>f.id!==o.value.collectionId),_=a.config.collectionsCollection.split(":");await l.update(_[0],null,{[_[1]]:u}),i(""),w.toast.success("Collection deleted")}catch{w.toast.error("Failed to delete collection")}},E=async r=>!!(await C()||[]).find(u=>u.slug===r);return e.onMounted(()=>{n.value||M()}),(r,t)=>{const u=e.resolveComponent("Button"),_=e.resolveComponent("MenubarTrigger"),f=e.resolveComponent("MenubarMenu"),v=e.resolveComponent("MenubarShortcut"),h=e.resolveComponent("MenubarItem"),T=e.resolveComponent("MenubarSeparator"),$=e.resolveComponent("MenubarContent"),P=e.resolveComponent("Menubar");return e.openBlock(),e.createElementBlock("div",ge,[e.createElementVNode("div",Ve,[e.createElementVNode("div",Ne,[e.createVNode(u,{variant:"ghost",onClick:t[0]||(t[0]=Te=>e.unref(i)(""))},{default:e.withCtx(()=>[e.createVNode(e.unref(b.Tag),{class:"size-4"})]),_:1}),e.createVNode(e.unref(b.ChevronRight),{class:"size-3"}),e.createElementVNode("h1",ve,e.toDisplayString(n.value?"New Collection":e.unref(p).title),1),e.unref(p).status==="published"?(e.openBlock(),e.createElementBlock("span",we,"Published")):e.unref(p).status==="draft"?(e.openBlock(),e.createElementBlock("span",be,"Draft")):e.createCommentVNode("",!0)]),n.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(P,{key:0,class:"bg-sidebar"},{default:e.withCtx(()=>[e.unref(c)("create-collection")?(e.openBlock(),e.createBlock(f,{key:0},{default:e.withCtx(()=>[e.createVNode(_,{onClick:D},{default:e.withCtx(()=>[...t[1]||(t[1]=[e.createTextVNode("Duplicate",-1)])]),_:1})]),_:1})):e.createCommentVNode("",!0),e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[...t[2]||(t[2]=[e.createTextVNode("Preview",-1)])]),_:1})]),_:1}),e.createVNode(f,null,{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[...t[3]||(t[3]=[e.createTextVNode("Share",-1)])]),_:1}),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(h,null,{default:e.withCtx(()=>[t[5]||(t[5]=e.createTextVNode(" New Tab ",-1)),e.createVNode(v,null,{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("⌘T",-1)])]),_:1})]),_:1}),e.createVNode(h,null,{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createTextVNode("New Window",-1)])]),_:1}),e.createVNode(T),e.createVNode(h,null,{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Share",-1)])]),_:1}),e.createVNode(T),e.createVNode(h,null,{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode("Print",-1)])]),_:1})]),_:1})]),_:1}),e.unref(m)("edit-collection","delete-collection")?(e.openBlock(),e.createBlock(f,{key:1},{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[...t[9]||(t[9]=[e.createTextVNode("More actions",-1)])]),_:1}),e.createVNode($,null,{default:e.withCtx(()=>[e.unref(c)("delete-collection")?(e.openBlock(),e.createBlock(h,{key:0,variant:"destructive",onClick:I},{default:e.withCtx(()=>[e.createVNode(e.unref(b.Trash),{class:"size-4"}),t[10]||(t[10]=e.createTextVNode(" Delete collection ",-1))]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:1}))]),e.createElementVNode("div",he,[e.createElementVNode("div",ke,[e.createVNode(X),e.createVNode(pe)]),e.createElementVNode("div",ye,[e.createVNode(_e)])]),e.unref(m)("create-collection","edit-collection")?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",Se,[n.value&&e.unref(c)("create-collection")?(e.openBlock(),e.createBlock(u,{key:0,onClick:e.unref(B),disabled:d.value},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createBlock(e.unref(b.Loader2),{key:0,class:"size-4 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(d.value?"Creating":"Create")+" New Collection ",1)]),_:1},8,["onClick","disabled"])):e.unref(c)("edit-collection")?(e.openBlock(),e.createBlock(u,{key:1,onClick:e.unref(B),disabled:d.value},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createBlock(e.unref(b.Loader2),{key:0,class:"size-4 animate-spin"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(d.value?"Saving":"Save")+" Changes ",1)]),_:1},8,["onClick","disabled"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)])}}});exports.default=Ee;
|