@chaibuilder/pages 0.5.3-rc.8 → 0.5.4
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/{B4MFY5CR-DLo5zQ8b.cjs → B4MFY5CR-DLMF4Fia.cjs} +1 -1
- package/dist/{B4MFY5CR-BAE-ffyr.js → B4MFY5CR-DlwPVpmD.js} +1 -1
- package/dist/{HO4MOOFI-6JxWAiyn.cjs → HO4MOOFI-CH5TIJEX.cjs} +1 -1
- package/dist/{HO4MOOFI-CfaBj_Sm.js → HO4MOOFI-CTW4q_go.js} +2 -2
- package/dist/{HUY7CZI3-CROytT57.js → HUY7CZI3-Bic9WgW9.js} +2 -2
- package/dist/{HUY7CZI3-D7MdTeo2.cjs → HUY7CZI3-CvHF_hS5.cjs} +1 -1
- package/dist/{index-CB1Gxzbn.cjs → index-BBnsUqd9.cjs} +2 -2
- package/dist/{index-BCnPw3o2.js → index-Cmn1hFYF.js} +166 -166
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +10 -0
- package/dist/server.js +4 -0
- package/package.json +1 -1
|
@@ -1172,7 +1172,7 @@ const eo = () => {
|
|
|
1172
1172
|
} else
|
|
1173
1173
|
S.push(G);
|
|
1174
1174
|
return S;
|
|
1175
|
-
}, [t, r]), [h, f] = A(""), [y, p] = A(""), [g, N] = A(""), [E,
|
|
1175
|
+
}, [t, r]), [h, f] = A(""), [y, p] = A(""), [g, N] = A(""), [E, I] = A(""), [w, k] = A({}), [b, D] = A(!1), [M, J] = A(o), [B, $] = A(!1), { hasPermission: U } = Ft(), Y = U(ge.DELETE_LIBRARY_BLOCK), R = xa(), Ie = () => {
|
|
1176
1176
|
R([s], { _libBlockId: void 0 }), W.success("Block delinked from library"), n();
|
|
1177
1177
|
}, {
|
|
1178
1178
|
data: K,
|
|
@@ -1182,14 +1182,14 @@ const eo = () => {
|
|
|
1182
1182
|
Ee(() => {
|
|
1183
1183
|
ae && o && ($(!0), J(!1));
|
|
1184
1184
|
}, [ae, o]), Ee(() => {
|
|
1185
|
-
K && !_ && (f(K.name || ""), p(K.group || ""), N(K.description || ""),
|
|
1185
|
+
K && !_ && (f(K.name || ""), p(K.group || ""), N(K.description || ""), I(K.preview || ""), J(!1));
|
|
1186
1186
|
}, [K, _]), Ee(() => {
|
|
1187
1187
|
const S = h.trim().length >= 2, G = y.trim() !== "";
|
|
1188
1188
|
D(S && G);
|
|
1189
1189
|
}, [h, y]);
|
|
1190
1190
|
const ke = () => {
|
|
1191
1191
|
const S = {};
|
|
1192
|
-
return h.trim() ? h.length < 2 && (S.name = "Name must be at least 2 characters") : S.name = "Name is required", y || (S.group = "Group is required"),
|
|
1192
|
+
return h.trim() ? h.length < 2 && (S.name = "Name must be at least 2 characters") : S.name = "Name is required", y || (S.group = "Group is required"), k(S), Object.keys(S).length === 0;
|
|
1193
1193
|
}, { resetLibrary: De } = xi({ id: "" }), Ze = no(
|
|
1194
1194
|
(S) => {
|
|
1195
1195
|
o || R([s], { _libBlockId: S.id }), W.success(`Block ${o ? "updated" : "saved"} successfully`), De(S.library), n();
|
|
@@ -1272,7 +1272,7 @@ const eo = () => {
|
|
|
1272
1272
|
] }),
|
|
1273
1273
|
/* @__PURE__ */ c("div", { className: "space-y-2", children: [
|
|
1274
1274
|
/* @__PURE__ */ a(te, { htmlFor: "previewImage", children: "Preview Image (optional)" }),
|
|
1275
|
-
/* @__PURE__ */ a(uo, { value: E, onChange:
|
|
1275
|
+
/* @__PURE__ */ a(uo, { value: E, onChange: I })
|
|
1276
1276
|
] }),
|
|
1277
1277
|
/* @__PURE__ */ c("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
1278
1278
|
o && Y && /* @__PURE__ */ a(
|
|
@@ -1733,13 +1733,13 @@ var zs = {};
|
|
|
1733
1733
|
S
|
|
1734
1734
|
);
|
|
1735
1735
|
}
|
|
1736
|
-
function
|
|
1736
|
+
function I(v) {
|
|
1737
1737
|
return v < 0 ? 0 : Math.floor(v);
|
|
1738
1738
|
}
|
|
1739
1739
|
function w(v, m) {
|
|
1740
1740
|
return Math.floor(Math.random() * (m - v)) + v;
|
|
1741
1741
|
}
|
|
1742
|
-
function
|
|
1742
|
+
function k(v) {
|
|
1743
1743
|
return parseInt(v, 16);
|
|
1744
1744
|
}
|
|
1745
1745
|
function b(v) {
|
|
@@ -1748,9 +1748,9 @@ var zs = {};
|
|
|
1748
1748
|
function D(v) {
|
|
1749
1749
|
var m = String(v).replace(/[^0-9a-f]/gi, "");
|
|
1750
1750
|
return m.length < 6 && (m = m[0] + m[0] + m[1] + m[1] + m[2] + m[2]), {
|
|
1751
|
-
r:
|
|
1752
|
-
g:
|
|
1753
|
-
b:
|
|
1751
|
+
r: k(m.substring(0, 2)),
|
|
1752
|
+
g: k(m.substring(2, 4)),
|
|
1753
|
+
b: k(m.substring(4, 6))
|
|
1754
1754
|
};
|
|
1755
1755
|
}
|
|
1756
1756
|
function M(v) {
|
|
@@ -1831,8 +1831,8 @@ var zs = {};
|
|
|
1831
1831
|
} else if (m.shape === "circle")
|
|
1832
1832
|
v.ellipse ? v.ellipse(m.x, m.y, Math.abs(C - G) * m.ovalScalar, Math.abs(Q - O) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI) : U(v, m.x, m.y, Math.abs(C - G) * m.ovalScalar, Math.abs(Q - O) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI);
|
|
1833
1833
|
else if (m.shape === "star")
|
|
1834
|
-
for (var ee = Math.PI / 2 * 3, Le = 4 * m.scalar, Ue = 8 * m.scalar,
|
|
1835
|
-
|
|
1834
|
+
for (var ee = Math.PI / 2 * 3, Le = 4 * m.scalar, Ue = 8 * m.scalar, L = m.x, re = m.y, x = 5, fe = Math.PI / x; x--; )
|
|
1835
|
+
L = m.x + Math.cos(ee) * Ue, re = m.y + Math.sin(ee) * Ue, v.lineTo(L, re), ee += fe, L = m.x + Math.cos(ee) * Le, re = m.y + Math.sin(ee) * Le, v.lineTo(L, re), ee += fe;
|
|
1836
1836
|
else
|
|
1837
1837
|
v.moveTo(Math.floor(m.x), Math.floor(m.y)), v.lineTo(Math.floor(m.wobbleX), Math.floor(O)), v.lineTo(Math.floor(C), Math.floor(Q)), v.lineTo(Math.floor(G), Math.floor(m.wobbleY));
|
|
1838
1838
|
return v.closePath(), v.fill(), m.tick < m.totalTicks;
|
|
@@ -1863,7 +1863,7 @@ var zs = {};
|
|
|
1863
1863
|
function K(v, m) {
|
|
1864
1864
|
var S = !v, G = !!E(m || {}, "resize"), O = !1, C = E(m, "disableForReducedMotion", Boolean), Q = i && !!E(m || {}, "useWorker"), F = Q ? y() : null, X = S ? J : B, le = v && F ? !!v.__confetti_initialized : !1, ye = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, ce;
|
|
1865
1865
|
function ve(ee, Le, Ue) {
|
|
1866
|
-
for (var
|
|
1866
|
+
for (var L = E(ee, "particleCount", I), re = E(ee, "angle", Number), x = E(ee, "spread", Number), fe = E(ee, "startVelocity", Number), Qe = E(ee, "decay", Number), Fe = E(ee, "gravity", Number), bt = E(ee, "drift", Number), Et = E(ee, "colors", b), An = E(ee, "ticks", Number), Vs = E(ee, "shapes"), Zr = E(ee, "scalar"), Jr = !!E(ee, "flat"), Hs = M(ee), Ws = L, ns = [], ei = v.width * Hs.x, ti = v.height * Hs.y; Ws--; )
|
|
1867
1867
|
ns.push(
|
|
1868
1868
|
Y({
|
|
1869
1869
|
x: ei,
|
|
@@ -1890,7 +1890,7 @@ var zs = {};
|
|
|
1890
1890
|
fe();
|
|
1891
1891
|
});
|
|
1892
1892
|
S && ce ? v = ce.canvas : S && !v && (v = $(Ue), document.body.appendChild(v)), G && !le && X(v);
|
|
1893
|
-
var
|
|
1893
|
+
var L = {
|
|
1894
1894
|
width: v.width,
|
|
1895
1895
|
height: v.height
|
|
1896
1896
|
};
|
|
@@ -1911,12 +1911,12 @@ var zs = {};
|
|
|
1911
1911
|
});
|
|
1912
1912
|
return;
|
|
1913
1913
|
}
|
|
1914
|
-
|
|
1914
|
+
L.width = L.height = null;
|
|
1915
1915
|
}
|
|
1916
1916
|
function x() {
|
|
1917
1917
|
ce = null, G && (O = !1, t.removeEventListener("resize", re)), S && v && (document.body.contains(v) && document.body.removeChild(v), v = null, le = !1);
|
|
1918
1918
|
}
|
|
1919
|
-
return G && !O && (O = !0, t.addEventListener("resize", re, !1)), F ? F.fire(ee,
|
|
1919
|
+
return G && !O && (O = !0, t.addEventListener("resize", re, !1)), F ? F.fire(ee, L, x) : ve(ee, L, x);
|
|
1920
1920
|
}
|
|
1921
1921
|
return Te.reset = function() {
|
|
1922
1922
|
F && F.reset(), ce && ce.reset();
|
|
@@ -2210,11 +2210,11 @@ const He = ({
|
|
|
2210
2210
|
}) => {
|
|
2211
2211
|
const { data: s } = Ve(), { data: r } = Re(), [i, l] = A(e.name || ""), [o, u] = A(e.edit ? e.lang : ""), [d, h] = A(e.edit ? e.slug : ""), { mutate: f, isPending: y } = lr(), { mutate: p, isPending: g } = js(), N = ne(
|
|
2212
2212
|
() => r == null ? void 0 : r.find(
|
|
2213
|
-
(
|
|
2213
|
+
(k) => k.key === e.pageType
|
|
2214
2214
|
),
|
|
2215
2215
|
[r, e.pageType]
|
|
2216
|
-
), E = !(N != null && N.hasSlug),
|
|
2217
|
-
|
|
2216
|
+
), E = !(N != null && N.hasSlug), I = y || g, w = (k) => {
|
|
2217
|
+
k.preventDefault();
|
|
2218
2218
|
const b = {
|
|
2219
2219
|
name: i,
|
|
2220
2220
|
lang: o,
|
|
@@ -2238,14 +2238,14 @@ const He = ({
|
|
|
2238
2238
|
{
|
|
2239
2239
|
value: o,
|
|
2240
2240
|
disabled: e.edit || ue(n),
|
|
2241
|
-
onChange: (
|
|
2242
|
-
const b =
|
|
2241
|
+
onChange: (k) => {
|
|
2242
|
+
const b = k.target.value;
|
|
2243
2243
|
u(b), !E && h(`/${b}`);
|
|
2244
2244
|
},
|
|
2245
2245
|
className: "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",
|
|
2246
2246
|
children: [
|
|
2247
2247
|
/* @__PURE__ */ a("option", { value: "", disabled: !0, selected: !0, children: e.edit ? Z(Xe, e.lang, e.lang) : ue(n) ? H.ALL_AVAILABLE_LANGUAGE_PAGE : H.CHOOSE_LANGUAGE }),
|
|
2248
|
-
We(n, (
|
|
2248
|
+
We(n, (k) => /* @__PURE__ */ a("option", { value: k, children: Z(Xe, k, k) }, k))
|
|
2249
2249
|
]
|
|
2250
2250
|
}
|
|
2251
2251
|
)
|
|
@@ -2257,7 +2257,7 @@ const He = ({
|
|
|
2257
2257
|
{
|
|
2258
2258
|
id: "name",
|
|
2259
2259
|
value: i,
|
|
2260
|
-
onChange: (
|
|
2260
|
+
onChange: (k) => l(k.target.value),
|
|
2261
2261
|
className: "col-span-3",
|
|
2262
2262
|
required: !0,
|
|
2263
2263
|
placeholder: H.ENTER_PAGE_NAME
|
|
@@ -2275,8 +2275,8 @@ const He = ({
|
|
|
2275
2275
|
{
|
|
2276
2276
|
id: "slug",
|
|
2277
2277
|
value: d,
|
|
2278
|
-
onChange: (
|
|
2279
|
-
const b =
|
|
2278
|
+
onChange: (k) => {
|
|
2279
|
+
const b = k.target.value;
|
|
2280
2280
|
Vt(b, `/${o}`) && h($t(ii(b)));
|
|
2281
2281
|
},
|
|
2282
2282
|
className: "col-span-3",
|
|
@@ -2293,8 +2293,8 @@ const He = ({
|
|
|
2293
2293
|
T,
|
|
2294
2294
|
{
|
|
2295
2295
|
type: "submit",
|
|
2296
|
-
disabled:
|
|
2297
|
-
children:
|
|
2296
|
+
disabled: I || !i || !o || !E && !Vt(d, `/${o}`),
|
|
2297
|
+
children: I ? e.edit ? H.UPDATING : H.ADDING : e.edit ? H.UPDATE : H.ADD_NEW_LANGUAGE
|
|
2298
2298
|
}
|
|
2299
2299
|
) })
|
|
2300
2300
|
] })
|
|
@@ -2310,13 +2310,13 @@ const He = ({
|
|
|
2310
2310
|
/* @__PURE__ */ a("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
2311
2311
|
/* @__PURE__ */ a("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
2312
2312
|
] }) : We(i, (E) => {
|
|
2313
|
-
const
|
|
2313
|
+
const I = E.lang, w = E.slug, k = !E.primaryPage;
|
|
2314
2314
|
return /* @__PURE__ */ c(pe, { children: [
|
|
2315
2315
|
/* @__PURE__ */ c(
|
|
2316
2316
|
"li",
|
|
2317
2317
|
{
|
|
2318
|
-
className: `text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${
|
|
2319
|
-
onClick: () => r(
|
|
2318
|
+
className: `text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${I === n ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
2319
|
+
onClick: () => r(I),
|
|
2320
2320
|
children: [
|
|
2321
2321
|
/* @__PURE__ */ c("div", { className: " flex-1 gap-x-3", children: [
|
|
2322
2322
|
/* @__PURE__ */ c(
|
|
@@ -2330,7 +2330,7 @@ const He = ({
|
|
|
2330
2330
|
className: `w-2.5 h-2.5 rounded-full ${E.online ? "bg-green-300" : "bg-gray-300"}`
|
|
2331
2331
|
}
|
|
2332
2332
|
),
|
|
2333
|
-
Z(Xe,
|
|
2333
|
+
Z(Xe, k ? s : I, I)
|
|
2334
2334
|
]
|
|
2335
2335
|
}
|
|
2336
2336
|
),
|
|
@@ -2349,7 +2349,7 @@ const He = ({
|
|
|
2349
2349
|
] })
|
|
2350
2350
|
] })
|
|
2351
2351
|
] }),
|
|
2352
|
-
|
|
2352
|
+
k ? /* @__PURE__ */ c("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
2353
2353
|
/* @__PURE__ */ a(al, { fill: "orange", className: "w-3 h-3" }),
|
|
2354
2354
|
/* @__PURE__ */ a("b", { children: " Primary" })
|
|
2355
2355
|
] }) : /* @__PURE__ */ a("div", { className: "flex items-center gap-x-3", children: /* @__PURE__ */ a(
|
|
@@ -2514,10 +2514,10 @@ function Co({
|
|
|
2514
2514
|
d(D), t(b);
|
|
2515
2515
|
return;
|
|
2516
2516
|
}
|
|
2517
|
-
const E = g.substring(s.length).replace(/\//g, "").replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-_.]/g, "-").replace(/-+/g, "-").replace(/^-+/, "").toLowerCase(),
|
|
2518
|
-
|
|
2519
|
-
const
|
|
2520
|
-
d(
|
|
2517
|
+
const E = g.substring(s.length).replace(/\//g, "").replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-_.]/g, "-").replace(/-+/g, "-").replace(/^-+/, "").toLowerCase(), I = (E.match(/\./g) || []).length, w = I <= 1;
|
|
2518
|
+
I > 1 ? l("Invalid slug. Only one dot (.) is allowed in the slug") : l(null), r && r(w);
|
|
2519
|
+
const k = s + E;
|
|
2520
|
+
d(k), t(E);
|
|
2521
2521
|
}, f = () => {
|
|
2522
2522
|
if (o.current) {
|
|
2523
2523
|
const p = o.current;
|
|
@@ -2742,10 +2742,10 @@ function Uo({
|
|
|
2742
2742
|
close: n,
|
|
2743
2743
|
closePanel: s
|
|
2744
2744
|
}) {
|
|
2745
|
-
var
|
|
2745
|
+
var L, re;
|
|
2746
2746
|
const r = dr(), i = !!(e != null && e.id), { data: l } = Zn(), { mutate: o, isPending: u } = lr(), { mutate: d, isPending: h } = js(), [f, y] = A(null), [p, g] = A(!0), [N, E] = A(
|
|
2747
2747
|
(e == null ? void 0 : e.pageType) ?? "page"
|
|
2748
|
-
), { hasPermission:
|
|
2748
|
+
), { hasPermission: I } = Ft(), w = I(ge.CHANGE_PAGE_TYPE), [k, b] = A(!1), [D, M] = A(""), J = ne(() => {
|
|
2749
2749
|
const x = t.find(
|
|
2750
2750
|
(fe) => fe.key === N
|
|
2751
2751
|
);
|
|
@@ -2887,7 +2887,7 @@ function Uo({
|
|
|
2887
2887
|
] })
|
|
2888
2888
|
}
|
|
2889
2889
|
),
|
|
2890
|
-
|
|
2890
|
+
k && /* @__PURE__ */ c("div", { className: "mt-2 p-3 bg-yellow-50 border border-yellow-200 rounded-md", children: [
|
|
2891
2891
|
/* @__PURE__ */ a("p", { className: "text-sm text-yellow-800", children: "Changing the page type may impact the page data. Are you sure you want to proceed?" }),
|
|
2892
2892
|
/* @__PURE__ */ c("div", { className: "mt-2 flex gap-2", children: [
|
|
2893
2893
|
/* @__PURE__ */ a(
|
|
@@ -3013,7 +3013,7 @@ function Uo({
|
|
|
3013
3013
|
children: /* @__PURE__ */ a("optgroup", { label: "Partials", children: t.filter((x) => x.hasSlug === !1).map((x) => /* @__PURE__ */ a("option", { value: x.key, children: x.name }, x.key)) })
|
|
3014
3014
|
}
|
|
3015
3015
|
),
|
|
3016
|
-
|
|
3016
|
+
k && /* @__PURE__ */ c("div", { className: "mt-2 p-3 bg-yellow-50 border border-yellow-200 rounded-md", children: [
|
|
3017
3017
|
/* @__PURE__ */ a("p", { className: "text-sm text-yellow-800", children: "Changing the page type may impact the page data. Are you sure you want to proceed?" }),
|
|
3018
3018
|
/* @__PURE__ */ c("div", { className: "mt-2 flex gap-2", children: [
|
|
3019
3019
|
/* @__PURE__ */ a(
|
|
@@ -3036,7 +3036,7 @@ function Uo({
|
|
|
3036
3036
|
)
|
|
3037
3037
|
] })
|
|
3038
3038
|
] }),
|
|
3039
|
-
/* @__PURE__ */ a("p", { className: "text-xs text-gray-500", children: (
|
|
3039
|
+
/* @__PURE__ */ a("p", { className: "text-xs text-gray-500", children: (L = t.find((x) => x.key === N)) == null ? void 0 : L.helpText })
|
|
3040
3040
|
] }),
|
|
3041
3041
|
/* @__PURE__ */ c("div", { className: "space-y-0.5", children: [
|
|
3042
3042
|
/* @__PURE__ */ a(te, { htmlFor: "name", className: "text-sm", children: "Name" }),
|
|
@@ -3134,13 +3134,13 @@ const Oo = ({
|
|
|
3134
3134
|
onSuccess: () => {
|
|
3135
3135
|
p(!1), t();
|
|
3136
3136
|
},
|
|
3137
|
-
onError: (
|
|
3138
|
-
p(!1),
|
|
3137
|
+
onError: (I) => {
|
|
3138
|
+
p(!1), I.code === "SLUG_EXISTS" ? i(
|
|
3139
3139
|
"A page with this slug already exists. Please choose a different slug."
|
|
3140
|
-
) :
|
|
3140
|
+
) : I.code === "INVALID_SLUG" ? i(
|
|
3141
3141
|
"The slug format is invalid. Please use only lowercase letters, numbers, and hyphens."
|
|
3142
|
-
) :
|
|
3143
|
-
|
|
3142
|
+
) : I.code === "PERMISSION_DENIED" ? i("You don't have permission to duplicate this page.") : i(
|
|
3143
|
+
I.message || "Failed to duplicate page. Please try again later."
|
|
3144
3144
|
);
|
|
3145
3145
|
}
|
|
3146
3146
|
}
|
|
@@ -3229,11 +3229,11 @@ const Oo = ({
|
|
|
3229
3229
|
onClose: t
|
|
3230
3230
|
}) => {
|
|
3231
3231
|
const [n, s] = A(!1), [r, i] = A(""), [l, o] = A(""), [u, d] = A(!1), h = lt(null), f = vo(), { data: y } = Re(), p = y == null ? void 0 : y.find(
|
|
3232
|
-
(
|
|
3232
|
+
(k) => k.key === e.pageType
|
|
3233
3233
|
), g = (p == null ? void 0 : p.name) || Yt(e.pageType), N = be(
|
|
3234
|
-
(
|
|
3234
|
+
(k) => {
|
|
3235
3235
|
var D;
|
|
3236
|
-
const b = (D =
|
|
3236
|
+
const b = (D = k.target.files) == null ? void 0 : D[0];
|
|
3237
3237
|
if (b) {
|
|
3238
3238
|
if (b.size > Mo) {
|
|
3239
3239
|
W.error("File too large", {
|
|
@@ -3257,9 +3257,9 @@ const Oo = ({
|
|
|
3257
3257
|
[]
|
|
3258
3258
|
), E = () => {
|
|
3259
3259
|
o(""), h.current && (h.current.value = "");
|
|
3260
|
-
},
|
|
3261
|
-
var
|
|
3262
|
-
(
|
|
3260
|
+
}, I = () => {
|
|
3261
|
+
var k;
|
|
3262
|
+
(k = h.current) == null || k.click();
|
|
3263
3263
|
}, w = () => {
|
|
3264
3264
|
s(!0), f.mutate(
|
|
3265
3265
|
{
|
|
@@ -3310,7 +3310,7 @@ const Oo = ({
|
|
|
3310
3310
|
placeholder: "Describe this template's purpose",
|
|
3311
3311
|
className: "text-xs resize-none h-24 mt-1",
|
|
3312
3312
|
value: r,
|
|
3313
|
-
onChange: (
|
|
3313
|
+
onChange: (k) => i(k.target.value)
|
|
3314
3314
|
}
|
|
3315
3315
|
)
|
|
3316
3316
|
] }),
|
|
@@ -3334,7 +3334,7 @@ const Oo = ({
|
|
|
3334
3334
|
{
|
|
3335
3335
|
type: "button",
|
|
3336
3336
|
variant: "outline",
|
|
3337
|
-
onClick:
|
|
3337
|
+
onClick: I,
|
|
3338
3338
|
disabled: u,
|
|
3339
3339
|
className: "w-full",
|
|
3340
3340
|
children: u ? /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
|
|
@@ -3378,8 +3378,8 @@ const Oo = ({
|
|
|
3378
3378
|
T,
|
|
3379
3379
|
{
|
|
3380
3380
|
variant: "outline",
|
|
3381
|
-
onClick: (
|
|
3382
|
-
|
|
3381
|
+
onClick: (k) => {
|
|
3382
|
+
k.stopPropagation(), t();
|
|
3383
3383
|
},
|
|
3384
3384
|
children: "Cancel"
|
|
3385
3385
|
}
|
|
@@ -3455,16 +3455,16 @@ const Oo = ({
|
|
|
3455
3455
|
), N = ne(() => {
|
|
3456
3456
|
const b = Z(t, "slug", ""), D = e ? pt(e) : "", M = D ? b.replace(D, "") : b;
|
|
3457
3457
|
return M || "/";
|
|
3458
|
-
}, [t, e]), E = !y(ge.EDIT_PAGE) && !y(ge.DELETE_PAGE) && !y(ge.UNPUBLISH_PAGE),
|
|
3458
|
+
}, [t, e]), E = !y(ge.EDIT_PAGE) && !y(ge.DELETE_PAGE) && !y(ge.UNPUBLISH_PAGE), I = ne(() => !!t.isTemplate, [t.isTemplate]), w = ne(
|
|
3459
3459
|
() => !!(g != null && g.hasSlug),
|
|
3460
3460
|
[g == null ? void 0 : g.hasSlug]
|
|
3461
|
-
),
|
|
3461
|
+
), k = be(() => {
|
|
3462
3462
|
p("outline"), h(Z(t, "id"), s);
|
|
3463
3463
|
}, [h, s, t, p]);
|
|
3464
3464
|
return /* @__PURE__ */ c(
|
|
3465
3465
|
"div",
|
|
3466
3466
|
{
|
|
3467
|
-
onClick:
|
|
3467
|
+
onClick: k,
|
|
3468
3468
|
className: `rounded flex p-1.5 items-center justify-between leading-none duration-300 cursor-pointer px-3 py-1.5 ${n ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
3469
3469
|
children: [
|
|
3470
3470
|
/* @__PURE__ */ c("div", { className: "flex items-center gap-x-2", children: [
|
|
@@ -3503,7 +3503,7 @@ const Oo = ({
|
|
|
3503
3503
|
children: g == null ? void 0 : g.name
|
|
3504
3504
|
}
|
|
3505
3505
|
),
|
|
3506
|
-
|
|
3506
|
+
I && /* @__PURE__ */ a(
|
|
3507
3507
|
rs,
|
|
3508
3508
|
{
|
|
3509
3509
|
variant: "outline",
|
|
@@ -3572,7 +3572,7 @@ const Oo = ({
|
|
|
3572
3572
|
]
|
|
3573
3573
|
}
|
|
3574
3574
|
),
|
|
3575
|
-
y(ge.MARK_AS_TEMPLATE) && w && /* @__PURE__ */ a(pe, { children:
|
|
3575
|
+
y(ge.MARK_AS_TEMPLATE) && w && /* @__PURE__ */ a(pe, { children: I ? /* @__PURE__ */ c(
|
|
3576
3576
|
Be,
|
|
3577
3577
|
{
|
|
3578
3578
|
className: "flex items-center gap-2 cursor-pointer",
|
|
@@ -3607,7 +3607,7 @@ const Oo = ({
|
|
|
3607
3607
|
close: e,
|
|
3608
3608
|
isOpen: t
|
|
3609
3609
|
}) => {
|
|
3610
|
-
const [, n] = A([]), [s, r] = A(null), [i, l] = A(""), [o, u] = A(null), [d, h] = A(null), [f, y] = A(null), [p, g] = A(null), [N, E] = A(null), { data:
|
|
3610
|
+
const [, n] = A([]), [s, r] = A(null), [i, l] = A(""), [o, u] = A(null), [d, h] = A(null), [f, y] = A(null), [p, g] = A(null), [N, E] = A(null), { data: I, isFetching: w, refetch: k } = Zn(), [b, D] = A(""), { hasPermission: M } = Ft(), [J, B] = Me(), $ = J.get("page"), { data: U } = Re(), Y = be(
|
|
3611
3611
|
(_) => {
|
|
3612
3612
|
var ae;
|
|
3613
3613
|
return (ae = we(U, { key: _ })) == null ? void 0 : ae.hasSlug;
|
|
@@ -3615,8 +3615,8 @@ const Oo = ({
|
|
|
3615
3615
|
[U]
|
|
3616
3616
|
);
|
|
3617
3617
|
Ee(() => {
|
|
3618
|
-
t &&
|
|
3619
|
-
}, [t,
|
|
3618
|
+
t && k();
|
|
3619
|
+
}, [t, k]), Ee(() => {
|
|
3620
3620
|
if (!ue(b)) return;
|
|
3621
3621
|
const _ = sessionStorage.getItem("pageTypeFilter") || "all";
|
|
3622
3622
|
!ue(U) && _ && (we(U, { key: _ }) ? D(_) : D("all"));
|
|
@@ -3632,13 +3632,13 @@ const Oo = ({
|
|
|
3632
3632
|
);
|
|
3633
3633
|
Ee(() => {
|
|
3634
3634
|
if ($ && !w) {
|
|
3635
|
-
const _ = we(
|
|
3635
|
+
const _ = we(I, { id: $ });
|
|
3636
3636
|
_ && (_ != null && _.pageType) ? n((ae) => [...ae, _ == null ? void 0 : _.pageType]) : (window.history.replaceState(null, "", "/"), B(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
3637
3637
|
}
|
|
3638
|
-
}, [
|
|
3638
|
+
}, [I, $, w, B]);
|
|
3639
3639
|
const K = ne(() => {
|
|
3640
3640
|
const _ = On(
|
|
3641
|
-
Ce(
|
|
3641
|
+
Ce(I, (m) => ue(i) ? !0 : Qt($t(m == null ? void 0 : m.name), $t(i)) || Qt($t(m == null ? void 0 : m.slug), $t(i)))
|
|
3642
3642
|
);
|
|
3643
3643
|
if (b !== "all")
|
|
3644
3644
|
return On(Ce(_, { pageType: b }));
|
|
@@ -3663,7 +3663,7 @@ const Oo = ({
|
|
|
3663
3663
|
(m) => Y(m.pageType)
|
|
3664
3664
|
).sort((m, S) => m.name.localeCompare(S.name)), v = Ce(ke, (m) => !Y(m.pageType));
|
|
3665
3665
|
return On([...Ze, ...v]);
|
|
3666
|
-
}, [
|
|
3666
|
+
}, [I, Y, i, b]);
|
|
3667
3667
|
return /* @__PURE__ */ c("div", { className: "flex flex-col justify-between h-full", children: [
|
|
3668
3668
|
/* @__PURE__ */ c("div", { className: "flex flex-col h-full space-y-6", children: [
|
|
3669
3669
|
/* @__PURE__ */ c("div", { className: "relative flex item-center gap-x-4", children: [
|
|
@@ -3956,8 +3956,8 @@ const Oo = ({
|
|
|
3956
3956
|
s(g);
|
|
3957
3957
|
const N = new URLSearchParams(window.location.search);
|
|
3958
3958
|
g === e ? N.delete("lang") : N.set("lang", g);
|
|
3959
|
-
const E = N.toString(),
|
|
3960
|
-
window.history.pushState({}, "",
|
|
3959
|
+
const E = N.toString(), I = `${window.location.pathname}${E ? `?${E}` : ""}`;
|
|
3960
|
+
window.history.pushState({}, "", I), i(N), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
3961
3961
|
};
|
|
3962
3962
|
return ue(t) || f ? null : /* @__PURE__ */ c(pe, { children: [
|
|
3963
3963
|
/* @__PURE__ */ c(pn, { children: [
|
|
@@ -4109,18 +4109,18 @@ function Jo() {
|
|
|
4109
4109
|
isFetching: h,
|
|
4110
4110
|
error: f,
|
|
4111
4111
|
refetch: y
|
|
4112
|
-
} = Yo(u == null ? void 0 : u.id), { mutate: p, isPending: g } = Qo(), { mutate: N, isPending: E } = Xo(),
|
|
4112
|
+
} = Yo(u == null ? void 0 : u.id), { mutate: p, isPending: g } = Qo(), { mutate: N, isPending: E } = Xo(), I = Se(), w = (M) => {
|
|
4113
4113
|
n && N(
|
|
4114
4114
|
{ revisionId: n.uid, discardCurrent: M },
|
|
4115
4115
|
{
|
|
4116
4116
|
onSuccess: () => {
|
|
4117
|
-
i(!1), s(null),
|
|
4117
|
+
i(!1), s(null), I.invalidateQueries({
|
|
4118
4118
|
queryKey: [j, P.GET_DRAFT_PAGE]
|
|
4119
4119
|
});
|
|
4120
4120
|
}
|
|
4121
4121
|
}
|
|
4122
4122
|
);
|
|
4123
|
-
},
|
|
4123
|
+
}, k = (M) => {
|
|
4124
4124
|
s(M), i(!0);
|
|
4125
4125
|
}, b = (M) => {
|
|
4126
4126
|
s(M), o(!0);
|
|
@@ -4165,7 +4165,7 @@ function Jo() {
|
|
|
4165
4165
|
{
|
|
4166
4166
|
revision: M,
|
|
4167
4167
|
isLatest: M.uid === "current",
|
|
4168
|
-
onRestore: () =>
|
|
4168
|
+
onRestore: () => k(M),
|
|
4169
4169
|
onDelete: () => b(M)
|
|
4170
4170
|
},
|
|
4171
4171
|
M.uid
|
|
@@ -4463,7 +4463,7 @@ function lc({
|
|
|
4463
4463
|
);
|
|
4464
4464
|
}, E = () => {
|
|
4465
4465
|
s(g ? [] : We(r, "id"));
|
|
4466
|
-
},
|
|
4466
|
+
}, I = () => {
|
|
4467
4467
|
y(
|
|
4468
4468
|
{ ids: ui(n) },
|
|
4469
4469
|
{
|
|
@@ -4476,7 +4476,7 @@ function lc({
|
|
|
4476
4476
|
if (b === "theme") return "Theme";
|
|
4477
4477
|
const D = we(l, { key: b });
|
|
4478
4478
|
return D ? D == null ? void 0 : D.name : b;
|
|
4479
|
-
},
|
|
4479
|
+
}, k = ne(() => {
|
|
4480
4480
|
const b = [
|
|
4481
4481
|
{ label: "Updated", top: "pt-2" },
|
|
4482
4482
|
...Tn(Ce(d, { online: !0 }), "pageType"),
|
|
@@ -4527,7 +4527,7 @@ function lc({
|
|
|
4527
4527
|
/* @__PURE__ */ a("th", { scope: "col", className: "px-4 py-3 w-[150px] text-right", children: "Status" })
|
|
4528
4528
|
] }) }),
|
|
4529
4529
|
/* @__PURE__ */ a("tbody", { children: We(
|
|
4530
|
-
|
|
4530
|
+
k,
|
|
4531
4531
|
(b) => b.label ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ c(
|
|
4532
4532
|
"td",
|
|
4533
4533
|
{
|
|
@@ -4599,7 +4599,7 @@ function lc({
|
|
|
4599
4599
|
T,
|
|
4600
4600
|
{
|
|
4601
4601
|
disabled: p || i || ue(r),
|
|
4602
|
-
onClick:
|
|
4602
|
+
onClick: I,
|
|
4603
4603
|
children: p ? "Publishing..." : "Publish"
|
|
4604
4604
|
}
|
|
4605
4605
|
)
|
|
@@ -4772,7 +4772,7 @@ const uc = () => {
|
|
|
4772
4772
|
size: "sm",
|
|
4773
4773
|
onClick: async () => {
|
|
4774
4774
|
var N, E;
|
|
4775
|
-
const g = ((E = (N = d == null ? void 0 : d.filter((
|
|
4775
|
+
const g = ((E = (N = d == null ? void 0 : d.filter((I) => (I == null ? void 0 : I._type) === "PartialBlock")) == null ? void 0 : N.map((I) => I == null ? void 0 : I.partialBlockId)) == null ? void 0 : E.filter((I) => typeof I == "string" && I !== "")) || [];
|
|
4776
4776
|
o(
|
|
4777
4777
|
{ ids: [l == null ? void 0 : l.id, ...g] },
|
|
4778
4778
|
{ onSuccess: () => Mn("TOP_RIGHT") }
|
|
@@ -5081,15 +5081,15 @@ const yc = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
5081
5081
|
const { setUser: e, logout: t } = ut(), n = Bs(), [s, r] = A(""), [i, l] = A(""), [o, u] = A({}), [d, h] = A(!1), [f, y] = A(""), p = xe({
|
|
5082
5082
|
mutationFn: async (E) => {
|
|
5083
5083
|
y("");
|
|
5084
|
-
const
|
|
5084
|
+
const I = await Rs(n, {
|
|
5085
5085
|
action: "LOGIN",
|
|
5086
5086
|
data: E
|
|
5087
5087
|
});
|
|
5088
|
-
if (!
|
|
5089
|
-
const
|
|
5090
|
-
throw new Error(
|
|
5088
|
+
if (!I.ok) {
|
|
5089
|
+
const k = await I.json();
|
|
5090
|
+
throw new Error(k.error || "Login failed");
|
|
5091
5091
|
}
|
|
5092
|
-
const w = await
|
|
5092
|
+
const w = await I.json();
|
|
5093
5093
|
if (nt(w, "id") && nt(w, "email") && nt(w, "accessToken") && nt(w, "refreshToken"))
|
|
5094
5094
|
e(w);
|
|
5095
5095
|
else
|
|
@@ -5107,17 +5107,17 @@ const yc = () => /* @__PURE__ */ c("div", { className: "flex px-2 h-full items-c
|
|
|
5107
5107
|
}
|
|
5108
5108
|
}), g = async (E) => {
|
|
5109
5109
|
E.preventDefault(), u({});
|
|
5110
|
-
const
|
|
5110
|
+
const I = { email: s, password: i };
|
|
5111
5111
|
try {
|
|
5112
|
-
const w = ia.parse(
|
|
5112
|
+
const w = ia.parse(I);
|
|
5113
5113
|
p.mutate(w);
|
|
5114
5114
|
} catch (w) {
|
|
5115
5115
|
if (w instanceof Rn.ZodError) {
|
|
5116
|
-
const
|
|
5116
|
+
const k = w.errors.reduce((b, D) => {
|
|
5117
5117
|
const M = D.path[0];
|
|
5118
5118
|
return b[M] = D.message, b;
|
|
5119
5119
|
}, {});
|
|
5120
|
-
u(
|
|
5120
|
+
u(k);
|
|
5121
5121
|
}
|
|
5122
5122
|
}
|
|
5123
5123
|
}, N = ia.safeParse({ email: s, password: i }).success;
|
|
@@ -5613,11 +5613,11 @@ const Mc = ({
|
|
|
5613
5613
|
}, [l]);
|
|
5614
5614
|
const u = e || r, d = be(
|
|
5615
5615
|
async (p) => new Promise((g, N) => {
|
|
5616
|
-
const E = p[0],
|
|
5617
|
-
|
|
5616
|
+
const E = p[0], I = new FileReader();
|
|
5617
|
+
I.readAsDataURL(E), I.onload = async () => {
|
|
5618
5618
|
s(
|
|
5619
5619
|
{
|
|
5620
|
-
file:
|
|
5620
|
+
file: I.result,
|
|
5621
5621
|
folderId: void 0,
|
|
5622
5622
|
name: E.name,
|
|
5623
5623
|
optimize: l
|
|
@@ -5631,7 +5631,7 @@ const Mc = ({
|
|
|
5631
5631
|
}
|
|
5632
5632
|
}
|
|
5633
5633
|
);
|
|
5634
|
-
},
|
|
5634
|
+
}, I.onerror = (w) => N(w);
|
|
5635
5635
|
}),
|
|
5636
5636
|
[s, l, i]
|
|
5637
5637
|
), { getRootProps: h, getInputProps: f, isDragActive: y } = Ul({
|
|
@@ -5774,35 +5774,35 @@ function gr({
|
|
|
5774
5774
|
mode: n = "image",
|
|
5775
5775
|
assetId: s
|
|
5776
5776
|
}) {
|
|
5777
|
-
const l = ne(() => [n], [n]), [o, u] = A(null), [d, h] = A(null), [f, y] = A(null), [p, g] = A({ show: !1, file: "" }), [N, E] = A(!1), [
|
|
5777
|
+
const l = ne(() => [n], [n]), [o, u] = A(null), [d, h] = A(null), [f, y] = A(null), [p, g] = A({ show: !1, file: "" }), [N, E] = A(!1), [I, w] = A(
|
|
5778
5778
|
s ? "details" : "grid"
|
|
5779
|
-
), [
|
|
5779
|
+
), [k, b] = A(""), [D, M] = A(""), [J, B] = A(1), [$] = A(30), [U, Y] = A([]);
|
|
5780
5780
|
Ee(() => {
|
|
5781
5781
|
s && (u(s), w("details"));
|
|
5782
5782
|
}, [s]), Ee(() => {
|
|
5783
|
-
const
|
|
5783
|
+
const L = setTimeout(() => {
|
|
5784
5784
|
b(D), B(1);
|
|
5785
5785
|
}, 300);
|
|
5786
|
-
return () => clearTimeout(
|
|
5786
|
+
return () => clearTimeout(L);
|
|
5787
5787
|
}, [D]);
|
|
5788
5788
|
const { data: R, isLoading: Ie } = Dc({
|
|
5789
|
-
search:
|
|
5789
|
+
search: k.toLowerCase().trim(),
|
|
5790
5790
|
page: J,
|
|
5791
5791
|
limit: $
|
|
5792
5792
|
}), K = (R == null ? void 0 : R.assets) || [], _ = (R == null ? void 0 : R.total) || 0, ae = Math.ceil(_ / $), ke = J < ae, De = J > 1, Ze = (K == null ? void 0 : K.length) > 0, { mutate: v } = kc(), { mutate: m, isPending: S } = Ic(), { mutate: G, isPending: O } = Lc(), C = be(
|
|
5793
|
-
(
|
|
5794
|
-
|
|
5793
|
+
(L) => {
|
|
5794
|
+
L >= 1 && L <= ae && B(L);
|
|
5795
5795
|
},
|
|
5796
5796
|
[ae]
|
|
5797
5797
|
), Q = be(() => {
|
|
5798
5798
|
ke && C(J + 1);
|
|
5799
5799
|
}, [J, ke, C]), F = be(() => {
|
|
5800
5800
|
De && C(J - 1);
|
|
5801
|
-
}, [J, De, C]), X = (
|
|
5802
|
-
M(
|
|
5801
|
+
}, [J, De, C]), X = (L) => {
|
|
5802
|
+
M(L.target.value);
|
|
5803
5803
|
}, le = be(
|
|
5804
|
-
(
|
|
5805
|
-
Y((re) => we(re, { id:
|
|
5804
|
+
(L) => {
|
|
5805
|
+
Y((re) => we(re, { id: L.id }) ? [] : [L]);
|
|
5806
5806
|
},
|
|
5807
5807
|
[!1]
|
|
5808
5808
|
), ye = be(() => {
|
|
@@ -5817,8 +5817,8 @@ function gr({
|
|
|
5817
5817
|
"description"
|
|
5818
5818
|
])
|
|
5819
5819
|
), e());
|
|
5820
|
-
}, ve = async (
|
|
5821
|
-
h(
|
|
5820
|
+
}, ve = async (L) => {
|
|
5821
|
+
h(L);
|
|
5822
5822
|
}, Te = async () => {
|
|
5823
5823
|
d && (y(d == null ? void 0 : d.id), await v(d.id, {
|
|
5824
5824
|
onSuccess: () => {
|
|
@@ -5828,30 +5828,30 @@ function gr({
|
|
|
5828
5828
|
y(null);
|
|
5829
5829
|
}
|
|
5830
5830
|
}), h(null));
|
|
5831
|
-
}, ee = (
|
|
5832
|
-
u(
|
|
5833
|
-
}, Le = async (
|
|
5831
|
+
}, ee = (L) => {
|
|
5832
|
+
u(L.id), w("details");
|
|
5833
|
+
}, Le = async (L, re) => {
|
|
5834
5834
|
try {
|
|
5835
5835
|
const x = localStorage.getItem("chai_optimize_images") !== "false";
|
|
5836
5836
|
re ? (await m({
|
|
5837
|
-
file:
|
|
5837
|
+
file: L,
|
|
5838
5838
|
folderId: void 0,
|
|
5839
5839
|
name: p.name || "",
|
|
5840
5840
|
optimize: x
|
|
5841
5841
|
}), g({ show: !1, file: "" })) : (await G({
|
|
5842
5842
|
id: p.id || "",
|
|
5843
|
-
file:
|
|
5843
|
+
file: L
|
|
5844
5844
|
}), g({ show: !1, file: "" }));
|
|
5845
5845
|
} catch (x) {
|
|
5846
5846
|
console.error("Error saving edited image:", x);
|
|
5847
5847
|
}
|
|
5848
|
-
}, Ue = be((
|
|
5849
|
-
Y([
|
|
5848
|
+
}, Ue = be((L) => {
|
|
5849
|
+
Y([L]);
|
|
5850
5850
|
}, []);
|
|
5851
5851
|
return /* @__PURE__ */ c(pe, { children: [
|
|
5852
5852
|
/* @__PURE__ */ c("div", { className: "max-w-[1232px] max-h-[1232px] w-[80vw] h-[80vh] space-y-4 flex flex-col", children: [
|
|
5853
5853
|
/* @__PURE__ */ a("h1", { className: "text-lg font-medium", children: "Digital Asset Manager" }),
|
|
5854
|
-
|
|
5854
|
+
I === "grid" ? /* @__PURE__ */ c(pe, { children: [
|
|
5855
5855
|
/* @__PURE__ */ a(
|
|
5856
5856
|
Mc,
|
|
5857
5857
|
{
|
|
@@ -5919,35 +5919,35 @@ function gr({
|
|
|
5919
5919
|
] }) : !Ie && !Ze ? /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center h-full border rounded-lg", children: [
|
|
5920
5920
|
/* @__PURE__ */ a("div", { className: "text-muted-foreground", children: /* @__PURE__ */ a(Tl, { className: "h-9 w-9 text-indigo-500" }) }),
|
|
5921
5921
|
/* @__PURE__ */ a("div", { className: "text-muted-foreground text-lg", children: "No assets found" }),
|
|
5922
|
-
/* @__PURE__ */ a("div", { className: "text-muted-foreground text-sm", children:
|
|
5922
|
+
/* @__PURE__ */ a("div", { className: "text-muted-foreground text-sm", children: k.length > 0 ? "No assets found for your search: " + k : "Start uploading assets to get started" }),
|
|
5923
5923
|
/* @__PURE__ */ a("br", {})
|
|
5924
|
-
] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-3 p-1", children: K == null ? void 0 : K.map((
|
|
5924
|
+
] }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-3 p-1", children: K == null ? void 0 : K.map((L) => /* @__PURE__ */ c(
|
|
5925
5925
|
"div",
|
|
5926
5926
|
{
|
|
5927
5927
|
className: xs(
|
|
5928
5928
|
"relative cursor-pointer overflow-hidden transition-all rounded-lg border-2 group max-w-[180px] max-h-[180px] flex flex-col justify-between",
|
|
5929
|
-
U.some((re) => re.id ===
|
|
5930
|
-
f && (d == null ? void 0 : d.id) ===
|
|
5931
|
-
f ===
|
|
5929
|
+
U.some((re) => re.id === L.id) ? "border-blue-500" : "hover:border-black/90",
|
|
5930
|
+
f && (d == null ? void 0 : d.id) === L.id ? "opacity-50 pointer-events-none" : "",
|
|
5931
|
+
f === L.id ? "opacity-50 pointer-events-none" : ""
|
|
5932
5932
|
),
|
|
5933
|
-
onClick: () => le(
|
|
5933
|
+
onClick: () => le(L),
|
|
5934
5934
|
children: [
|
|
5935
5935
|
/* @__PURE__ */ c("div", { className: "aspect-square relative overflow-hidden", children: [
|
|
5936
|
-
f ===
|
|
5937
|
-
|
|
5936
|
+
f === L.id ? /* @__PURE__ */ a("div", { className: "absolute inset-0 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ a(gt, { className: "h-8 w-8 animate-spin text-white" }) }) : null,
|
|
5937
|
+
L.type === "image" ? /* @__PURE__ */ a(
|
|
5938
5938
|
"img",
|
|
5939
5939
|
{
|
|
5940
|
-
src: `${
|
|
5941
|
-
alt:
|
|
5942
|
-
className: `object-contain w-full h-full min-h-[80px] ${U.some((re) => re.id ===
|
|
5940
|
+
src: `${L.thumbnailUrl || "/placeholder.svg"}?v=${(L == null ? void 0 : L.updatedAt) || L.createdAt}`,
|
|
5941
|
+
alt: L.name,
|
|
5942
|
+
className: `object-contain w-full h-full min-h-[80px] ${U.some((re) => re.id === L.id) ? "" : "group-hover:blur group-hover:contrast-50"}`
|
|
5943
5943
|
}
|
|
5944
5944
|
) : /* @__PURE__ */ c("div", { className: "flex items-center justify-center h-full", children: [
|
|
5945
5945
|
/* @__PURE__ */ a(Cl, { className: "h-12 w-12 text-muted-foreground" }),
|
|
5946
|
-
|
|
5946
|
+
L.thumbnailUrl && /* @__PURE__ */ a(
|
|
5947
5947
|
"img",
|
|
5948
5948
|
{
|
|
5949
|
-
src: `${
|
|
5950
|
-
alt:
|
|
5949
|
+
src: `${L.thumbnailUrl || "/placeholder.svg"}?v=${(L == null ? void 0 : L.updatedAt) || L.createdAt}`,
|
|
5950
|
+
alt: L.name,
|
|
5951
5951
|
className: "absolute inset-0 object-cover w-full h-full"
|
|
5952
5952
|
}
|
|
5953
5953
|
)
|
|
@@ -5958,13 +5958,13 @@ function gr({
|
|
|
5958
5958
|
"div",
|
|
5959
5959
|
{
|
|
5960
5960
|
className: "text-xs truncate leading-tight",
|
|
5961
|
-
title:
|
|
5962
|
-
children:
|
|
5961
|
+
title: L.name,
|
|
5962
|
+
children: L.name
|
|
5963
5963
|
}
|
|
5964
5964
|
),
|
|
5965
|
-
/* @__PURE__ */ a("div", { className: "text-[9px] whitespace-nowrap font-light text-muted-foreground flex items-center justify-between", children: /* @__PURE__ */ a("span", { children: Bc((
|
|
5965
|
+
/* @__PURE__ */ a("div", { className: "text-[9px] whitespace-nowrap font-light text-muted-foreground flex items-center justify-between", children: /* @__PURE__ */ a("span", { children: Bc((L == null ? void 0 : L.size) || 0) }) })
|
|
5966
5966
|
] }),
|
|
5967
|
-
!U.some((re) => re.id ===
|
|
5967
|
+
!U.some((re) => re.id === L.id) && /* @__PURE__ */ c("div", { className: "absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2", children: [
|
|
5968
5968
|
/* @__PURE__ */ a(
|
|
5969
5969
|
T,
|
|
5970
5970
|
{
|
|
@@ -5972,7 +5972,7 @@ function gr({
|
|
|
5972
5972
|
size: "icon",
|
|
5973
5973
|
className: "h-8 w-8 rounded-full",
|
|
5974
5974
|
onClick: (re) => {
|
|
5975
|
-
re.stopPropagation(), ee(
|
|
5975
|
+
re.stopPropagation(), ee(L);
|
|
5976
5976
|
},
|
|
5977
5977
|
children: /* @__PURE__ */ a(Xt, { className: "h-4 w-4" })
|
|
5978
5978
|
}
|
|
@@ -5985,10 +5985,10 @@ function gr({
|
|
|
5985
5985
|
className: "h-8 w-8 rounded-full",
|
|
5986
5986
|
onClick: (re) => {
|
|
5987
5987
|
re.stopPropagation(), g({
|
|
5988
|
-
id:
|
|
5988
|
+
id: L.id,
|
|
5989
5989
|
show: !0,
|
|
5990
|
-
file:
|
|
5991
|
-
name:
|
|
5990
|
+
file: L.url,
|
|
5991
|
+
name: L.name
|
|
5992
5992
|
});
|
|
5993
5993
|
},
|
|
5994
5994
|
children: /* @__PURE__ */ a(Ha, { className: "h-4 w-4" })
|
|
@@ -6001,13 +6001,13 @@ function gr({
|
|
|
6001
6001
|
size: "icon",
|
|
6002
6002
|
className: "h-8 w-8 rounded-full",
|
|
6003
6003
|
onClick: (re) => {
|
|
6004
|
-
re.stopPropagation(), ve(
|
|
6004
|
+
re.stopPropagation(), ve(L);
|
|
6005
6005
|
},
|
|
6006
6006
|
children: /* @__PURE__ */ a(Yn, { className: "h-4 w-4" })
|
|
6007
6007
|
}
|
|
6008
6008
|
)
|
|
6009
6009
|
] }),
|
|
6010
|
-
U.some((re) => re.id ===
|
|
6010
|
+
U.some((re) => re.id === L.id) && /* @__PURE__ */ a("div", { className: "absolute top-1 right-1 border border-white h-max rounded-full bg-blue-500 p-1", children: /* @__PURE__ */ a(
|
|
6011
6011
|
Pl,
|
|
6012
6012
|
{
|
|
6013
6013
|
className: "w-3 h-3 text-white",
|
|
@@ -6016,7 +6016,7 @@ function gr({
|
|
|
6016
6016
|
) })
|
|
6017
6017
|
]
|
|
6018
6018
|
},
|
|
6019
|
-
|
|
6019
|
+
L.id
|
|
6020
6020
|
)) }) }),
|
|
6021
6021
|
ae > 1 && /* @__PURE__ */ a("div", { className: "absolute bottom-0 left-0 right-0 bg-white border-t p-4", children: /* @__PURE__ */ c("div", { className: "flex items-center justify-center space-x-2", children: [
|
|
6022
6022
|
/* @__PURE__ */ a(
|
|
@@ -6029,7 +6029,7 @@ function gr({
|
|
|
6029
6029
|
children: "Previous"
|
|
6030
6030
|
}
|
|
6031
6031
|
),
|
|
6032
|
-
Array.from({ length: Math.min(5, ae) }, (
|
|
6032
|
+
Array.from({ length: Math.min(5, ae) }, (L, re) => {
|
|
6033
6033
|
const x = re + 1;
|
|
6034
6034
|
return /* @__PURE__ */ a(
|
|
6035
6035
|
T,
|
|
@@ -6073,20 +6073,20 @@ function gr({
|
|
|
6073
6073
|
onBack: () => {
|
|
6074
6074
|
w("grid"), u(null);
|
|
6075
6075
|
},
|
|
6076
|
-
onEdit: (
|
|
6076
|
+
onEdit: (L) => {
|
|
6077
6077
|
g({
|
|
6078
|
-
id:
|
|
6078
|
+
id: L.id,
|
|
6079
6079
|
show: !0,
|
|
6080
|
-
file:
|
|
6081
|
-
name:
|
|
6080
|
+
file: L.url,
|
|
6081
|
+
name: L.name
|
|
6082
6082
|
});
|
|
6083
6083
|
},
|
|
6084
|
-
onSave: async (
|
|
6084
|
+
onSave: async (L) => {
|
|
6085
6085
|
if (o) {
|
|
6086
6086
|
E(!0);
|
|
6087
6087
|
try {
|
|
6088
6088
|
const re = K.find((x) => x.id === o);
|
|
6089
|
-
re && await G(gi(re, { description:
|
|
6089
|
+
re && await G(gi(re, { description: L }));
|
|
6090
6090
|
} finally {
|
|
6091
6091
|
E(!1);
|
|
6092
6092
|
}
|
|
@@ -6270,7 +6270,7 @@ const Fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6270
6270
|
searchDescription: "",
|
|
6271
6271
|
jsonLD: "",
|
|
6272
6272
|
...u
|
|
6273
|
-
}), y = lt({ initial: h, updated: h }), p = t.length ? t : n, { mutate: g, isPending: N } = js(), E = N, { hasPermission:
|
|
6273
|
+
}), y = lt({ initial: h, updated: h }), p = t.length ? t : n, { mutate: g, isPending: N } = js(), E = N, { hasPermission: I } = Ft(), w = I(ge.EDIT_SEO);
|
|
6274
6274
|
Ee(() => {
|
|
6275
6275
|
!o && u && f({
|
|
6276
6276
|
title: "",
|
|
@@ -6287,7 +6287,7 @@ const Fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6287
6287
|
...u
|
|
6288
6288
|
});
|
|
6289
6289
|
}, [o, u]);
|
|
6290
|
-
const
|
|
6290
|
+
const k = async () => {
|
|
6291
6291
|
g(
|
|
6292
6292
|
{ id: l == null ? void 0 : l.id, seo: h },
|
|
6293
6293
|
{
|
|
@@ -6680,7 +6680,7 @@ const Fc = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
6680
6680
|
{
|
|
6681
6681
|
size: "lg",
|
|
6682
6682
|
variant: "default",
|
|
6683
|
-
onClick:
|
|
6683
|
+
onClick: k,
|
|
6684
6684
|
disabled: ws(y.current.initial, h) || E || !w,
|
|
6685
6685
|
children: e(N ? "Saving..." : "Save")
|
|
6686
6686
|
}
|
|
@@ -6837,9 +6837,9 @@ function eu(e, t, n) {
|
|
|
6837
6837
|
let s, r, i;
|
|
6838
6838
|
arguments.length === 1 ? (s = !0, r = e, i = {}) : (s = e, r = t, i = {});
|
|
6839
6839
|
let l = null, o = is, u = null, d = !1, h = "initialValue" in i, f = typeof s == "function" && je(s);
|
|
6840
|
-
const y = /* @__PURE__ */ new Set(), [p, g] = (i.storage || Pe)(i.initialValue), [N, E] = Pe(void 0), [
|
|
6840
|
+
const y = /* @__PURE__ */ new Set(), [p, g] = (i.storage || Pe)(i.initialValue), [N, E] = Pe(void 0), [I, w] = Pe(void 0, {
|
|
6841
6841
|
equals: !1
|
|
6842
|
-
}), [
|
|
6842
|
+
}), [k, b] = Pe(h ? "ready" : "unresolved");
|
|
6843
6843
|
V.context && (u = V.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : V.load && V.has(u) && (o = V.load(u)));
|
|
6844
6844
|
function D($, U, Y, R) {
|
|
6845
6845
|
return l === $ && (l = null, R !== void 0 && (h = !0), ($ === o || U === o) && i.onHydrated && queueMicrotask(
|
|
@@ -6886,14 +6886,14 @@ function eu(e, t, n) {
|
|
|
6886
6886
|
}
|
|
6887
6887
|
return Object.defineProperties(J, {
|
|
6888
6888
|
state: {
|
|
6889
|
-
get: () =>
|
|
6889
|
+
get: () => k()
|
|
6890
6890
|
},
|
|
6891
6891
|
error: {
|
|
6892
6892
|
get: () => N()
|
|
6893
6893
|
},
|
|
6894
6894
|
loading: {
|
|
6895
6895
|
get() {
|
|
6896
|
-
const $ =
|
|
6896
|
+
const $ = k();
|
|
6897
6897
|
return $ === "pending" || $ === "refreshing";
|
|
6898
6898
|
}
|
|
6899
6899
|
},
|
|
@@ -7205,7 +7205,7 @@ function uu(e, t, n = {}) {
|
|
|
7205
7205
|
return Zt(() => Kn(i)), () => {
|
|
7206
7206
|
let u = e() || [], d = u.length, h, f;
|
|
7207
7207
|
return u[br], Ge(() => {
|
|
7208
|
-
let p, g, N, E,
|
|
7208
|
+
let p, g, N, E, I, w, k, b, D;
|
|
7209
7209
|
if (d === 0)
|
|
7210
7210
|
l !== 0 && (Kn(i), i = [], s = [], r = [], l = 0, o && (o = [])), n.fallback && (s = [ms], r[0] = mt((M) => (i[0] = M, n.fallback())), l = 1);
|
|
7211
7211
|
else if (l === 0) {
|
|
@@ -7213,16 +7213,16 @@ function uu(e, t, n = {}) {
|
|
|
7213
7213
|
s[f] = u[f], r[f] = mt(y);
|
|
7214
7214
|
l = d;
|
|
7215
7215
|
} else {
|
|
7216
|
-
for (N = new Array(d), E = new Array(d), o && (
|
|
7216
|
+
for (N = new Array(d), E = new Array(d), o && (I = new Array(d)), w = 0, k = Math.min(l, d); w < k && s[w] === u[w]; w++)
|
|
7217
7217
|
;
|
|
7218
|
-
for (
|
|
7219
|
-
N[b] = r[
|
|
7218
|
+
for (k = l - 1, b = d - 1; k >= w && b >= w && s[k] === u[b]; k--, b--)
|
|
7219
|
+
N[b] = r[k], E[b] = i[k], o && (I[b] = o[k]);
|
|
7220
7220
|
for (p = /* @__PURE__ */ new Map(), g = new Array(b + 1), f = b; f >= w; f--)
|
|
7221
7221
|
D = u[f], h = p.get(D), g[f] = h === void 0 ? -1 : h, p.set(D, f);
|
|
7222
|
-
for (h = w; h <=
|
|
7223
|
-
D = s[h], f = p.get(D), f !== void 0 && f !== -1 ? (N[f] = r[h], E[f] = i[h], o && (
|
|
7222
|
+
for (h = w; h <= k; h++)
|
|
7223
|
+
D = s[h], f = p.get(D), f !== void 0 && f !== -1 ? (N[f] = r[h], E[f] = i[h], o && (I[f] = o[h]), f = g[f], p.set(D, f)) : i[h]();
|
|
7224
7224
|
for (f = w; f < d; f++)
|
|
7225
|
-
f in N ? (r[f] = N[f], i[f] = E[f], o && (o[f] =
|
|
7225
|
+
f in N ? (r[f] = N[f], i[f] = E[f], o && (o[f] = I[f], o[f](f))) : r[f] = mt(y);
|
|
7226
7226
|
r = r.slice(0, l = d), s = u.slice(0);
|
|
7227
7227
|
}
|
|
7228
7228
|
return r;
|
|
@@ -8498,8 +8498,8 @@ var Hr = (e, t, n, s, r = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
8498
8498
|
if (g === "__proto__" || g === "constructor" || g === "prototype")
|
|
8499
8499
|
throw new Error(`Detected property ${g}. This is a prototype pollution risk, please remove it from your object.`);
|
|
8500
8500
|
const N = Hr(p, t, n, s, [...r, g], [...i, e], l);
|
|
8501
|
-
h[g] = N.transformedValue, ot(N.annotations) ? f[g] = N.annotations : tn(N.annotations) && Mt(N.annotations, (E,
|
|
8502
|
-
f[Br(g) + "." +
|
|
8501
|
+
h[g] = N.transformedValue, ot(N.annotations) ? f[g] = N.annotations : tn(N.annotations) && Mt(N.annotations, (E, I) => {
|
|
8502
|
+
f[Br(g) + "." + I] = E;
|
|
8503
8503
|
});
|
|
8504
8504
|
});
|
|
8505
8505
|
const y = vs(f) ? {
|
|
@@ -8762,7 +8762,7 @@ var hh = (e, t = !1) => {
|
|
|
8762
8762
|
const t = Lr(() => {
|
|
8763
8763
|
const n = this, [s] = q(this, Tt), [r] = q(this, Ct), [i] = q(this, Pt), [l] = q(this, _t), [o] = q(this, xt);
|
|
8764
8764
|
let u;
|
|
8765
|
-
return q(this, It) ? u = q(this, It) : (u = Ir(() => import("./HO4MOOFI-
|
|
8765
|
+
return q(this, It) ? u = q(this, It) : (u = Ir(() => import("./HO4MOOFI-CTW4q_go.js")), oe(this, It, u)), Xr(q(this, on), q(this, At)), Pr(u, _r({
|
|
8766
8766
|
get queryFlavor() {
|
|
8767
8767
|
return q(n, rn);
|
|
8768
8768
|
},
|
|
@@ -8856,7 +8856,7 @@ var hh = (e, t = !1) => {
|
|
|
8856
8856
|
const t = Lr(() => {
|
|
8857
8857
|
const n = this, [s] = q(this, Dt), [r] = q(this, Gt), [i] = q(this, Ut), [l] = q(this, Ot), [o] = q(this, kt), [u] = q(this, Rt);
|
|
8858
8858
|
let d;
|
|
8859
|
-
return q(this, Bt) ? d = q(this, Bt) : (d = Ir(() => import("./HUY7CZI3-
|
|
8859
|
+
return q(this, Bt) ? d = q(this, Bt) : (d = Ir(() => import("./HUY7CZI3-Bic9WgW9.js")), oe(this, Bt, d)), Xr(q(this, mn), q(this, Lt)), Pr(d, _r({
|
|
8860
8860
|
get queryFlavor() {
|
|
8861
8861
|
return q(n, dn);
|
|
8862
8862
|
},
|
|
@@ -9011,10 +9011,10 @@ const Td = (e) => {
|
|
|
9011
9011
|
}
|
|
9012
9012
|
} = wc();
|
|
9013
9013
|
Nc();
|
|
9014
|
-
const { data: l, isFetching: o } = rr(), { blocks: u } = Ec(l), { data: d } = Re(), { mutateAsync: h } = er(), f = vc(), { onSave: y } = Sc(), { getPartialBlocks: p, getPartialBlockBlocks: g } = xc(), { aiContext: N, setAiContext: E } = Ms(), { mutateAsync:
|
|
9014
|
+
const { data: l, isFetching: o } = rr(), { blocks: u } = Ec(l), { data: d } = Re(), { mutateAsync: h } = er(), f = vc(), { onSave: y } = Sc(), { getPartialBlocks: p, getPartialBlockBlocks: g } = xc(), { aiContext: N, setAiContext: E } = Ms(), { mutateAsync: I } = go(), [w, k] = A(!1), { data: b } = yt(), D = ar(), { data: M } = ir(), { data: J } = Sd(), { mutateAsync: B } = xd();
|
|
9015
9015
|
Wl(), Ee(() => {
|
|
9016
9016
|
const R = () => {
|
|
9017
|
-
document.hidden ?
|
|
9017
|
+
document.hidden ? k(!0) : k(!1);
|
|
9018
9018
|
};
|
|
9019
9019
|
return window.addEventListener("visibilitychange", R), () => window.removeEventListener("visibilitychange", R);
|
|
9020
9020
|
}, []), t.current = u;
|
|
@@ -9022,8 +9022,8 @@ const Td = (e) => {
|
|
|
9022
9022
|
const R = {};
|
|
9023
9023
|
return i && (R.permissions = Z(i, "permissions", null), R.role = Z(i, "role", "user")), R;
|
|
9024
9024
|
}, [i]), U = be(
|
|
9025
|
-
async (R, Ie) => await
|
|
9026
|
-
[
|
|
9025
|
+
async (R, Ie) => await I({ pageType: R, query: Ie }),
|
|
9026
|
+
[I]
|
|
9027
9027
|
), Y = ne(
|
|
9028
9028
|
() => Z(b, "theme", {}) || {},
|
|
9029
9029
|
[b]
|