@chaibuilder/pages 0.13.4 → 0.14.0
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/{2AITGKQY-DpAgk_u8.cjs → 2AITGKQY-BLi5HVHf.cjs} +1 -1
- package/dist/{2AITGKQY-Dx_Cte-P.js → 2AITGKQY-iyhQ7kgG.js} +5 -5
- package/dist/{NCMVHL6D-B6lv7Umq.cjs → NCMVHL6D-CKYg8-AM.cjs} +1 -1
- package/dist/{NCMVHL6D-CT2qHOTS.js → NCMVHL6D-PLvSyK5P.js} +2 -2
- package/dist/{ZDWCUMSJ-C1vrgsti.cjs → ZDWCUMSJ-BJZ_Yi-4.cjs} +1 -1
- package/dist/{ZDWCUMSJ-W9xywtZH.js → ZDWCUMSJ-CuLkdxY-.js} +1 -1
- package/dist/add-new-language-page--ah9yzN3.cjs +1 -0
- package/dist/add-new-language-page-WM_Ve2vH.js +390 -0
- package/dist/add-new-page-Bs_NXM9x.js +30 -0
- package/dist/add-new-page-CnUo6xzd.cjs +1 -0
- package/dist/confetti.module-BuUnQuWk.cjs +2 -0
- package/dist/confetti.module-DCmCkDyV.js +409 -0
- package/dist/delete-page-Cf88UkqJ.cjs +1 -0
- package/dist/delete-page-D8xhYESu.js +38 -0
- package/dist/digital-asset-manager-BAFTqxsM.js +976 -0
- package/dist/digital-asset-manager-D_lcprwY.cjs +1 -0
- package/dist/duplicate-page-BX1gOez-.cjs +1 -0
- package/dist/duplicate-page-CqXTGmWt.js +120 -0
- package/dist/dynamic-page-selector-0TiUnfUg.js +86 -0
- package/dist/dynamic-page-selector-9JIQrcq5.cjs +1 -0
- package/dist/get-seo-defaults-9zHebckY.js +65 -0
- package/dist/get-seo-defaults-Cw7vFt-B.cjs +1 -0
- package/dist/image-compression-DZ9WMmyn.cjs +1 -0
- package/dist/image-compression-DsZ1oqpb.js +37 -0
- package/dist/index-D7kegQ3M.js +5153 -0
- package/dist/index-LU0FTfeN.cjs +5 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -22
- package/dist/index.js +20 -21
- package/dist/json-diff-viewer-Be-PVOZN.cjs +8 -0
- package/dist/json-diff-viewer-C2GK_BDh.js +258 -0
- package/dist/lang-panel-CPFS1ssC.js +218 -0
- package/dist/lang-panel-CePltxo2.cjs +1 -0
- package/dist/mark-as-template-DeB23sWR.cjs +1 -0
- package/dist/mark-as-template-jdwcgRIB.js +146 -0
- package/dist/nested-path-selector-content-D_iF9Sm3.cjs +1 -0
- package/dist/nested-path-selector-content-DvIL_EoN.js +87 -0
- package/dist/no-language-page-content-DUM4KxWu.js +35 -0
- package/dist/no-language-page-content-Dsm2H3pc.cjs +1 -0
- package/dist/page-creator-BjuYmKfc.js +796 -0
- package/dist/page-creator-DG0LwvL1.cjs +1 -0
- package/dist/page-lock-request-B9WPmFcd.cjs +1 -0
- package/dist/page-lock-request-BceB1S-X.js +64 -0
- package/dist/page-locked-by-dialog-2MULM3jh.cjs +1 -0
- package/dist/page-locked-by-dialog-BEWfFLSc.js +63 -0
- package/dist/page-manager-new-BONZN4c5.cjs +1 -0
- package/dist/page-manager-new-DV6A9WFv.js +354 -0
- package/dist/page-manager-search-and-filter-3h4URMP_.cjs +1 -0
- package/dist/page-manager-search-and-filter-DIiowi9F.js +197 -0
- package/dist/page-revisions-content-BIxeZeND.js +446 -0
- package/dist/page-revisions-content-CQbt25XX.cjs +1 -0
- package/dist/publish-pages-content-CdKHrfys.js +178 -0
- package/dist/publish-pages-content-im9dPOBM.cjs +1 -0
- package/dist/save-to-lib-DGII9CEP.js +476 -0
- package/dist/save-to-lib-DOh-850u.cjs +1 -0
- package/dist/seo-panel-2VdpoGSg.cjs +1 -0
- package/dist/seo-panel-Bxo4f-a_.js +667 -0
- package/dist/shared-json-ld-C1OewNgp.cjs +1 -0
- package/dist/shared-json-ld-gbnBFljN.js +337 -0
- package/dist/slug-input-BmcGmc_i.js +87 -0
- package/dist/slug-input-CfuQV97Z.cjs +1 -0
- package/dist/theme-panel-footer-D3SwHqGR.js +25 -0
- package/dist/theme-panel-footer-FrY4U8zn.cjs +1 -0
- package/dist/translation-warning-modal-DalBhNQy.js +26 -0
- package/dist/translation-warning-modal-Kctu12rQ.cjs +1 -0
- package/dist/unmark-as-template-CihtTMOb.cjs +1 -0
- package/dist/unmark-as-template-UwmCCn0u.js +38 -0
- package/dist/unpublish-page-CNwIU6AS.js +26 -0
- package/dist/unpublish-page-DzLtZcNw.cjs +1 -0
- package/dist/use-page-expand-manager-B7JtHdg5.cjs +1 -0
- package/dist/use-page-expand-manager-BCFQnVkT.js +85 -0
- package/package.json +1 -1
- package/dist/index-C4j31Yhz.js +0 -11471
- package/dist/index-DnjETHks.cjs +0 -6
- package/dist/page-revisions-content-Gx-Qf_91.cjs +0 -8
- package/dist/page-revisions-content-_-Nd4U11.js +0 -712
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { jsx as e, jsxs as r, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { f as P, L, h as F, A as I } from "./index-D7kegQ3M.js";
|
|
3
|
+
import { u as z } from "./use-page-expand-manager-BCFQnVkT.js";
|
|
4
|
+
import { Button as m, Tooltip as f, TooltipTrigger as v, TooltipContent as g, Select as j, SelectTrigger as $, SelectContent as G, Input as S, SelectItem as b } from "@chaibuilder/sdk/ui";
|
|
5
|
+
import { useQueryClient as T } from "@tanstack/react-query";
|
|
6
|
+
import { isEmpty as y, filter as u, map as C, get as o } from "lodash-es";
|
|
7
|
+
import { Star as D, Plus as M, FilterXIcon as R, Filter as W, ListFilter as q, Search as A, ChevronsUpDown as B, ChevronsDownUp as K, RefreshCw as Q } from "lucide-react";
|
|
8
|
+
import { useState as _ } from "react";
|
|
9
|
+
const O = ({ selectedPageType: a, setSelectedPageType: i }) => {
|
|
10
|
+
const [s, l] = _(""), { data: n } = F(), c = (t) => {
|
|
11
|
+
if (!s) return !0;
|
|
12
|
+
const d = s.toLowerCase(), h = (x) => String(o(t, x, "")).toLowerCase().includes(d);
|
|
13
|
+
return h("name") || h("key");
|
|
14
|
+
}, p = n.find((t) => t.key === a);
|
|
15
|
+
return /* @__PURE__ */ r(j, { onValueChange: i, value: a, children: [
|
|
16
|
+
/* @__PURE__ */ e(
|
|
17
|
+
$,
|
|
18
|
+
{
|
|
19
|
+
className: `${a === "all" ? "bg-gray-100/30 hover:bg-gray-100" : "gap-x-1 border bg-gray-100/30 hover:bg-gray-100"} h-9 w-max min-w-[150px] overflow-hidden whitespace-nowrap rounded p-0 px-2 py-1 text-xs text-gray-600 shadow-none ring-0 focus:ring-0 [&>svg]:hidden`,
|
|
20
|
+
children: /* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between gap-x-1.5", children: [
|
|
21
|
+
/* @__PURE__ */ e("span", { className: "max-w-[150px] overflow-hidden truncate whitespace-nowrap font-medium leading-tight", children: (p == null ? void 0 : p.name) || "All" }),
|
|
22
|
+
/* @__PURE__ */ e(
|
|
23
|
+
q,
|
|
24
|
+
{
|
|
25
|
+
className: `${a !== "all" ? "fill-sky-50 text-sky-500" : ""} pointer-events-none h-4 w-4 text-muted-foreground hover:bg-blue-300`
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
] })
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
/* @__PURE__ */ r(G, { children: [
|
|
32
|
+
/* @__PURE__ */ e("div", { className: "sticky top-0 z-10 bg-white pb-2", children: /* @__PURE__ */ r("div", { className: "relative", children: [
|
|
33
|
+
/* @__PURE__ */ e(A, { strokeWidth: 2, className: "absolute left-2 top-2.5 h-3.5 w-3.5 text-gray-400" }),
|
|
34
|
+
/* @__PURE__ */ e(
|
|
35
|
+
S,
|
|
36
|
+
{
|
|
37
|
+
placeholder: "Search page types...",
|
|
38
|
+
className: "h-8 w-full rounded border pl-8 text-xs shadow-none",
|
|
39
|
+
value: s,
|
|
40
|
+
onChange: (t) => l(t.target.value),
|
|
41
|
+
onKeyDown: (t) => t.stopPropagation()
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
] }) }),
|
|
45
|
+
/* @__PURE__ */ e(b, { value: "all", children: "All" }),
|
|
46
|
+
!y(u(n, (t) => t.hasSlug && c(t))) && /* @__PURE__ */ r(w, { children: [
|
|
47
|
+
/* @__PURE__ */ e("div", { className: "mt-2 border-t px-2 py-1.5 pt-2 text-xs font-semibold text-gray-500", children: "Pages" }),
|
|
48
|
+
C(
|
|
49
|
+
[...u(n, (t) => t.hasSlug && c(t))].sort(
|
|
50
|
+
(t, d) => o(t, "name", "").localeCompare(o(d, "name", ""))
|
|
51
|
+
),
|
|
52
|
+
(t) => /* @__PURE__ */ e(b, { value: o(t, "key"), children: o(t, "name") }, o(t, "key"))
|
|
53
|
+
)
|
|
54
|
+
] }),
|
|
55
|
+
!y(u(n, (t) => !t.hasSlug && c(t))) && /* @__PURE__ */ r(w, { children: [
|
|
56
|
+
/* @__PURE__ */ e("div", { className: "mt-2 border-t px-2 py-1.5 pt-2 text-xs font-semibold text-gray-500", children: "Partials" }),
|
|
57
|
+
C(
|
|
58
|
+
[...u(n, (t) => !t.hasSlug && c(t))].sort(
|
|
59
|
+
(t, d) => o(t, "name", "").localeCompare(o(d, "name", ""))
|
|
60
|
+
),
|
|
61
|
+
(t) => /* @__PURE__ */ e(b, { value: o(t, "key"), children: o(t, "name") }, o(t, "key"))
|
|
62
|
+
)
|
|
63
|
+
] }),
|
|
64
|
+
y(u(n, c)) && /* @__PURE__ */ e("div", { className: "px-3 py-2 text-center text-sm text-gray-500", children: "No matching page types found" })
|
|
65
|
+
] })
|
|
66
|
+
] });
|
|
67
|
+
}, U = ({ search: a, setSearch: i }) => /* @__PURE__ */ r("div", { className: "relative flex h-9 flex-1 items-center gap-2 rounded-md border px-2.5", children: [
|
|
68
|
+
/* @__PURE__ */ e("label", { htmlFor: "page-search-input", className: "sr-only", children: "Search Pages" }),
|
|
69
|
+
/* @__PURE__ */ e(
|
|
70
|
+
A,
|
|
71
|
+
{
|
|
72
|
+
className: `${a ? "fill-sky-50 text-sky-500" : ""} pointer-events-none h-4 w-4 text-muted-foreground`,
|
|
73
|
+
"aria-hidden": "true"
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
/* @__PURE__ */ e(
|
|
77
|
+
S,
|
|
78
|
+
{
|
|
79
|
+
id: "page-search-input",
|
|
80
|
+
placeholder: "Search pages",
|
|
81
|
+
value: a,
|
|
82
|
+
onChange: (s) => i(s.target.value),
|
|
83
|
+
className: "border-none px-1.5 shadow-none outline-none ring-0 transition-none focus:outline-none focus:ring-0 focus-visible:ring-0",
|
|
84
|
+
autoComplete: "off"
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] }), V = ({ pages: a }) => {
|
|
88
|
+
const { expandAll: i, collapseAll: s, expandedPages: l } = z(null);
|
|
89
|
+
return /* @__PURE__ */ r("div", { className: "flex gap-1", children: [
|
|
90
|
+
/* @__PURE__ */ r(f, { children: [
|
|
91
|
+
/* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(m, { variant: "outline", size: "icon", onClick: () => i(a), className: "rounded p-1 text-gray-500", children: /* @__PURE__ */ e(B, {}) }) }),
|
|
92
|
+
/* @__PURE__ */ e(g, { children: "Expand All" })
|
|
93
|
+
] }),
|
|
94
|
+
/* @__PURE__ */ r(f, { children: [
|
|
95
|
+
/* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(
|
|
96
|
+
m,
|
|
97
|
+
{
|
|
98
|
+
disabled: l.length === 0,
|
|
99
|
+
variant: "outline",
|
|
100
|
+
size: "icon",
|
|
101
|
+
onClick: () => s(),
|
|
102
|
+
className: "rounded p-1 text-gray-500",
|
|
103
|
+
children: /* @__PURE__ */ e(K, {})
|
|
104
|
+
}
|
|
105
|
+
) }),
|
|
106
|
+
/* @__PURE__ */ e(g, { children: "Collapse All" })
|
|
107
|
+
] })
|
|
108
|
+
] });
|
|
109
|
+
}, X = ({ languages: a, selectedLanguage: i, setSelectedLanguage: s }) => {
|
|
110
|
+
const l = P();
|
|
111
|
+
return /* @__PURE__ */ e("div", { className: "scrollbar-hide flex gap-1 overflow-x-auto pb-1", children: a.map((n) => /* @__PURE__ */ r(
|
|
112
|
+
m,
|
|
113
|
+
{
|
|
114
|
+
variant: i === n ? "default" : "outline",
|
|
115
|
+
size: "sm",
|
|
116
|
+
className: `h-6 flex-shrink-0 whitespace-nowrap rounded px-3 text-xs font-normal ${i === n ? "bg-black text-white hover:bg-black" : "text-gray-500"}`,
|
|
117
|
+
onClick: () => s(n.toLowerCase()),
|
|
118
|
+
children: [
|
|
119
|
+
n === l && /* @__PURE__ */ e(D, { size: 4, className: `p-0.5 ${i === l ? "fill-white" : "fill-black"}` }),
|
|
120
|
+
L[n] || ""
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
n
|
|
124
|
+
)) });
|
|
125
|
+
}, k = () => {
|
|
126
|
+
const a = T();
|
|
127
|
+
return /* @__PURE__ */ r(f, { children: [
|
|
128
|
+
/* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(
|
|
129
|
+
m,
|
|
130
|
+
{
|
|
131
|
+
size: "sm",
|
|
132
|
+
variant: "ghost",
|
|
133
|
+
onClick: () => a.invalidateQueries({ queryKey: [I.GET_WEBSITE_PAGES] }),
|
|
134
|
+
className: "mt-1 h-6 w-6",
|
|
135
|
+
children: /* @__PURE__ */ e(Q, {})
|
|
136
|
+
}
|
|
137
|
+
) }),
|
|
138
|
+
/* @__PURE__ */ e(g, { side: "bottom", children: "Refresh pages list" })
|
|
139
|
+
] });
|
|
140
|
+
}, le = ({
|
|
141
|
+
pages: a,
|
|
142
|
+
search: i,
|
|
143
|
+
setSearch: s,
|
|
144
|
+
languages: l,
|
|
145
|
+
onAddPage: n,
|
|
146
|
+
selectedLanguage: c,
|
|
147
|
+
setSelectedLanguage: p,
|
|
148
|
+
selectedPageType: t,
|
|
149
|
+
setSelectedPageType: d,
|
|
150
|
+
showUntranslatedPages: h,
|
|
151
|
+
setShowUntranslatedPages: x
|
|
152
|
+
}) => {
|
|
153
|
+
const N = l.length > 1;
|
|
154
|
+
return /* @__PURE__ */ r("div", { className: "space-y-3 border-b border-b-gray-200 px-4 pb-1", children: [
|
|
155
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-x-2", children: [
|
|
156
|
+
/* @__PURE__ */ e(O, { selectedPageType: t, setSelectedPageType: d }),
|
|
157
|
+
/* @__PURE__ */ e(U, { search: i, setSearch: s }),
|
|
158
|
+
/* @__PURE__ */ e(V, { pages: a }),
|
|
159
|
+
/* @__PURE__ */ r(m, { variant: "default", onClick: n, className: "rounded px-3 font-normal", children: [
|
|
160
|
+
/* @__PURE__ */ e(M, { strokeWidth: 2, className: "stroke-white stroke-[3]" }),
|
|
161
|
+
/* @__PURE__ */ e("span", { className: "font-normal text-white", children: "Add Page" })
|
|
162
|
+
] }),
|
|
163
|
+
!N && /* @__PURE__ */ e(k, {})
|
|
164
|
+
] }),
|
|
165
|
+
N ? /* @__PURE__ */ r("div", { className: "flex items-center justify-between gap-2", children: [
|
|
166
|
+
/* @__PURE__ */ e(
|
|
167
|
+
X,
|
|
168
|
+
{
|
|
169
|
+
languages: l,
|
|
170
|
+
selectedLanguage: c,
|
|
171
|
+
setSelectedLanguage: (E) => {
|
|
172
|
+
p(E), x(h && (l == null ? void 0 : l[0]) !== c);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
),
|
|
176
|
+
/* @__PURE__ */ r("div", { className: "flex items-center gap-x-2", children: [
|
|
177
|
+
(l == null ? void 0 : l[0]) !== c && /* @__PURE__ */ r(f, { children: [
|
|
178
|
+
/* @__PURE__ */ e(v, { asChild: !0, children: /* @__PURE__ */ e(
|
|
179
|
+
m,
|
|
180
|
+
{
|
|
181
|
+
variant: "ghost",
|
|
182
|
+
onClick: () => x(!h),
|
|
183
|
+
className: "h-6 rounded px-3 py-1 text-xs font-normal",
|
|
184
|
+
children: h ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ e(W, {})
|
|
185
|
+
}
|
|
186
|
+
) }),
|
|
187
|
+
/* @__PURE__ */ e(g, { side: "bottom", children: "Toggle Untranslated Pages" })
|
|
188
|
+
] }),
|
|
189
|
+
/* @__PURE__ */ e(k, {})
|
|
190
|
+
] })
|
|
191
|
+
] }) : /* @__PURE__ */ e("div", { className: "flex items-center justify-between gap-2" })
|
|
192
|
+
] });
|
|
193
|
+
};
|
|
194
|
+
export {
|
|
195
|
+
X as LanguageSelector,
|
|
196
|
+
le as default
|
|
197
|
+
};
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import { jsxs as n, Fragment as p, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { ai as C, aj as A, A as b, ak as j, av as le, ao as I, at as R, au as w } from "./index-D7kegQ3M.js";
|
|
3
|
+
import { useQuery as re, useQueryClient as k, useMutation as G } from "@tanstack/react-query";
|
|
4
|
+
import { useLanguages as ie, useSavePage as de } from "@chaibuilder/sdk";
|
|
5
|
+
import { SheetHeader as ce, SheetTitle as oe, ScrollArea as ue, Skeleton as y, Button as g, DropdownMenu as me, DropdownMenuTrigger as he, DropdownMenuContent as fe, DropdownMenuItem as U, DropdownMenuSeparator as pe, Dialog as q, DialogContent as L, DialogHeader as P, DialogTitle as $, DialogDescription as z, DialogFooter as H } from "@chaibuilder/sdk/ui";
|
|
6
|
+
import { format as D, formatDistanceToNow as xe } from "date-fns";
|
|
7
|
+
import { isEmpty as ge } from "lodash-es";
|
|
8
|
+
import { FileJson as Ne, MoreHorizontal as be, Undo2 as J, Trash as Q, CloudOff as ye, Rocket as ve, Save as we, X as De } from "lucide-react";
|
|
9
|
+
import * as v from "react";
|
|
10
|
+
import { useEffect as F, lazy as Se, useState as Ee, Suspense as Re } from "react";
|
|
11
|
+
function Ce(t) {
|
|
12
|
+
const s = C(), a = A();
|
|
13
|
+
return re({
|
|
14
|
+
queryKey: [b.GET_PAGE_REVISIONS, t],
|
|
15
|
+
queryFn: async () => await a(s, {
|
|
16
|
+
action: b.GET_PAGE_REVISIONS,
|
|
17
|
+
data: { pageId: t }
|
|
18
|
+
}),
|
|
19
|
+
enabled: !!t,
|
|
20
|
+
refetchOnMount: !0
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
const Ae = () => {
|
|
24
|
+
const t = C(), s = A(), a = k();
|
|
25
|
+
return G({
|
|
26
|
+
mutationFn: async (i) => await s(t, {
|
|
27
|
+
action: b.DELETE_PAGE_REVISION,
|
|
28
|
+
data: { revisionId: i }
|
|
29
|
+
}),
|
|
30
|
+
onSuccess: () => {
|
|
31
|
+
a.invalidateQueries({
|
|
32
|
+
queryKey: ["revisions"]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}, Ie = () => {
|
|
37
|
+
const t = C(), s = A(), a = k();
|
|
38
|
+
return G({
|
|
39
|
+
mutationFn: async ({ revisionId: i, discardCurrent: l }) => await s(t, {
|
|
40
|
+
action: b.RESTORE_PAGE_REVISION,
|
|
41
|
+
data: { revisionId: i, discardCurrent: l }
|
|
42
|
+
}),
|
|
43
|
+
onSuccess: () => {
|
|
44
|
+
a.invalidateQueries({
|
|
45
|
+
queryKey: ["revisions"]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}, ke = Se(() => import("./json-diff-viewer-C2GK_BDh.js")), N = ({ tag: t }) => t === "draft" ? /* @__PURE__ */ n("div", { className: "flex items-center gap-1 rounded-full bg-amber-500/10 px-1.5 py-0.5 text-xs text-amber-600", children: [
|
|
50
|
+
/* @__PURE__ */ n("span", { className: "relative flex h-2 w-2", children: [
|
|
51
|
+
/* @__PURE__ */ e("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-amber-400 opacity-75" }),
|
|
52
|
+
/* @__PURE__ */ e("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-amber-500" })
|
|
53
|
+
] }),
|
|
54
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] leading-tight", children: "Draft" })
|
|
55
|
+
] }) : t === "live" ? /* @__PURE__ */ n("span", { className: "flex items-center gap-1 rounded-full bg-primary/10 px-1.5 py-0.5 text-xs text-primary", children: [
|
|
56
|
+
/* @__PURE__ */ n("span", { className: "relative flex h-2 w-2", children: [
|
|
57
|
+
/* @__PURE__ */ e("span", { className: "absolute inline-flex h-full w-full animate-ping rounded-full bg-green-400 opacity-75" }),
|
|
58
|
+
/* @__PURE__ */ e("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-green-500" })
|
|
59
|
+
] }),
|
|
60
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] leading-tight", children: "Live" })
|
|
61
|
+
] }) : t === "published" ? /* @__PURE__ */ n("div", { className: "flex items-center gap-1 rounded-full bg-green-500/10 px-1.5 py-0.5 text-xs text-green-600", children: [
|
|
62
|
+
/* @__PURE__ */ e(ve, { className: "h-3 w-3" }),
|
|
63
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] leading-tight", children: "Published" })
|
|
64
|
+
] }) : t === "unsaved" ? /* @__PURE__ */ n("div", { className: "flex items-center gap-1 rounded-full bg-red-500/10 px-1.5 py-0.5 text-xs text-red-600", children: [
|
|
65
|
+
/* @__PURE__ */ e(we, { className: "h-3 w-3" }),
|
|
66
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] leading-tight", children: "Unsaved changes" })
|
|
67
|
+
] }) : /* @__PURE__ */ e("span", { className: "rounded bg-purple-500/10 px-1.5 py-0.5 font-mono text-xs font-bold text-purple-600", children: t });
|
|
68
|
+
function Oe({ compare: t, setCompare: s }) {
|
|
69
|
+
const { data: a } = j(), { saveState: i } = de(), [l] = le();
|
|
70
|
+
if (!a) return null;
|
|
71
|
+
const d = !!t.find((o) => {
|
|
72
|
+
var r;
|
|
73
|
+
return (r = o == null ? void 0 : o.uid) == null ? void 0 : r.startsWith("draft:");
|
|
74
|
+
}), u = t.length >= 2 && !d, m = i === "UNSAVED";
|
|
75
|
+
return /* @__PURE__ */ n("div", { className: "relative flex items-start gap-3 rounded-md border bg-primary/5 p-2 hover:bg-accent/50", children: [
|
|
76
|
+
/* @__PURE__ */ n("div", { className: "flex-1 space-y-1", children: [
|
|
77
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ n("div", { className: "flex items-center gap-1 text-sm font-medium leading-none", children: [
|
|
78
|
+
/* @__PURE__ */ e(N, { tag: "draft" }),
|
|
79
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-bold", children: "Currently editing" })
|
|
80
|
+
] }) }),
|
|
81
|
+
/* @__PURE__ */ e("div", { className: "flex items-center pl-2 text-[11px] text-muted-foreground", children: !ge(l.lastSaved) && /* @__PURE__ */ n("span", { children: [
|
|
82
|
+
"Last updated",
|
|
83
|
+
" ",
|
|
84
|
+
xe(new Date(l.lastSaved), {
|
|
85
|
+
addSuffix: !0
|
|
86
|
+
})
|
|
87
|
+
] }) }),
|
|
88
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2 pt-0.5", children: m ? /* @__PURE__ */ e(N, { tag: "unsaved" }) : null })
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ e(
|
|
91
|
+
K,
|
|
92
|
+
{
|
|
93
|
+
checked: d,
|
|
94
|
+
disabled: u,
|
|
95
|
+
onChange: () => {
|
|
96
|
+
s(d ? t.filter((o) => o.uid !== `draft:${a == null ? void 0 : a.id}`) : [
|
|
97
|
+
...t,
|
|
98
|
+
{ uid: `draft:${a == null ? void 0 : a.id}`, label: "draft", item: { createdAt: Date.now() } }
|
|
99
|
+
]);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
function Me() {
|
|
106
|
+
return /* @__PURE__ */ e("div", { className: "mt-2 space-y-2", children: Array.from({ length: 5 }).map((t, s) => /* @__PURE__ */ n("div", { className: "flex items-start gap-3 rounded-md border p-2", children: [
|
|
107
|
+
/* @__PURE__ */ n("div", { className: "flex-1 space-y-1", children: [
|
|
108
|
+
/* @__PURE__ */ e(y, { className: "h-4 w-3/4" }),
|
|
109
|
+
/* @__PURE__ */ e(y, { className: "h-3 w-1/2" }),
|
|
110
|
+
/* @__PURE__ */ e(y, { className: "mt-1 h-5 w-20" })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ e(y, { className: "h-8 w-8 rounded-full" })
|
|
113
|
+
] }, s)) });
|
|
114
|
+
}
|
|
115
|
+
function V({
|
|
116
|
+
revision: t,
|
|
117
|
+
isLatest: s,
|
|
118
|
+
onRestore: a,
|
|
119
|
+
onDelete: i,
|
|
120
|
+
revisionNumber: l,
|
|
121
|
+
compare: d,
|
|
122
|
+
setCompare: u,
|
|
123
|
+
pageId: m
|
|
124
|
+
}) {
|
|
125
|
+
const { data: o } = I(t.currentEditor), r = (o == null ? void 0 : o.name) || "Unknown", f = !!d.find((h) => {
|
|
126
|
+
var x;
|
|
127
|
+
return s ? (x = h == null ? void 0 : h.uid) == null ? void 0 : x.startsWith("live") : (h == null ? void 0 : h.uid) === t.uid;
|
|
128
|
+
}), S = d.length >= 2 && !f;
|
|
129
|
+
return /* @__PURE__ */ n("div", { className: "relative flex items-start gap-3 rounded-md border p-2 hover:bg-accent/50", children: [
|
|
130
|
+
/* @__PURE__ */ n("div", { className: "flex-1 space-y-3", children: [
|
|
131
|
+
/* @__PURE__ */ e("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ n("p", { className: "flex items-center gap-1 text-xs leading-none", children: [
|
|
132
|
+
/* @__PURE__ */ e(N, { tag: s ? "live" : `#${l}` }),
|
|
133
|
+
t.type === "published" ? "Published" : "Draft",
|
|
134
|
+
" by ",
|
|
135
|
+
/* @__PURE__ */ e("span", { className: "text-xs font-bold", children: r })
|
|
136
|
+
] }) }),
|
|
137
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-x-3", children: [
|
|
138
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: t.type === "published" ? /* @__PURE__ */ e(N, { tag: "published" }) : /* @__PURE__ */ e(N, { tag: "draft" }) }),
|
|
139
|
+
/* @__PURE__ */ e("div", { className: "flex items-center text-[10px] text-muted-foreground", children: /* @__PURE__ */ e("span", { className: "leading-tight", children: D(t.createdAt, "MMM d, h:mm a") }) })
|
|
140
|
+
] })
|
|
141
|
+
] }),
|
|
142
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e(R, { permissions: [w.RESTORE_REVISION, w.DELETE_REVISION], children: /* @__PURE__ */ e(_e, { revision: t, onRestore: a, onDelete: i }) }) }),
|
|
143
|
+
/* @__PURE__ */ e(
|
|
144
|
+
K,
|
|
145
|
+
{
|
|
146
|
+
checked: f,
|
|
147
|
+
disabled: S,
|
|
148
|
+
onChange: () => {
|
|
149
|
+
u(
|
|
150
|
+
f ? d.filter((h) => s ? h.uid !== `live:${m}` : h.uid !== t.uid) : [
|
|
151
|
+
...d,
|
|
152
|
+
{
|
|
153
|
+
uid: s ? `live:${m}` : t.uid,
|
|
154
|
+
label: s ? "live" : `#${l}`,
|
|
155
|
+
item: t
|
|
156
|
+
}
|
|
157
|
+
].sort((h, x) => new Date(h.item.createdAt).getTime() - new Date(x.item.createdAt).getTime())
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
164
|
+
function Te({ compare: t, setCompare: s, pageId: a }) {
|
|
165
|
+
const [i, l] = Ee(!1), [d, u] = t;
|
|
166
|
+
if (t.length === 0) return null;
|
|
167
|
+
const m = ({ tab: o }) => /* @__PURE__ */ n("span", { className: "flex items-center justify-between rounded border border-blue-100 p-1 font-medium", children: [
|
|
168
|
+
/* @__PURE__ */ e(N, { tag: o.label }),
|
|
169
|
+
/* @__PURE__ */ e(
|
|
170
|
+
"button",
|
|
171
|
+
{
|
|
172
|
+
className: "z-0 flex h-4 w-4 items-center justify-center rounded-full text-gray-400 hover:text-red-500",
|
|
173
|
+
style: { lineHeight: 1 },
|
|
174
|
+
onClick: () => s(t.filter((r) => r.uid !== o.uid)),
|
|
175
|
+
"aria-label": "Remove selection 1",
|
|
176
|
+
children: /* @__PURE__ */ e(De, { className: "h-3 w-3" })
|
|
177
|
+
}
|
|
178
|
+
)
|
|
179
|
+
] });
|
|
180
|
+
return /* @__PURE__ */ n("div", { className: "mb-2 flex w-full max-w-md flex-col gap-1 rounded border bg-accent/60 p-2 shadow-sm", children: [
|
|
181
|
+
/* @__PURE__ */ n("div", { className: "flex items-center gap-x-2 text-xs", children: [
|
|
182
|
+
/* @__PURE__ */ e("span", { className: "font-medium leading-tight text-gray-600", children: "Compare" }),
|
|
183
|
+
d && /* @__PURE__ */ e(m, { tab: d }),
|
|
184
|
+
/* @__PURE__ */ e("span", { className: "font-medium leading-tight text-gray-600", children: "with" }),
|
|
185
|
+
u ? /* @__PURE__ */ e(m, { tab: u }) : /* @__PURE__ */ e("span", { className: "rounded border px-1 text-xs text-muted-foreground", children: "Choose another" })
|
|
186
|
+
] }),
|
|
187
|
+
/* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2 pb-0.5 pt-2", children: [
|
|
188
|
+
/* @__PURE__ */ e(
|
|
189
|
+
g,
|
|
190
|
+
{
|
|
191
|
+
size: "sm",
|
|
192
|
+
className: "h-6 gap-1 rounded px-2 text-xs leading-none text-gray-500",
|
|
193
|
+
variant: "outline",
|
|
194
|
+
onClick: () => s([]),
|
|
195
|
+
children: /* @__PURE__ */ e("span", { children: " Clear" })
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ n(
|
|
199
|
+
g,
|
|
200
|
+
{
|
|
201
|
+
size: "sm",
|
|
202
|
+
className: "h-6 gap-1 rounded px-2 text-xs leading-none",
|
|
203
|
+
variant: "default",
|
|
204
|
+
onClick: () => l(!0),
|
|
205
|
+
disabled: t.length < 2,
|
|
206
|
+
children: [
|
|
207
|
+
/* @__PURE__ */ e(Ne, { className: "h-2.5 w-2.5" }),
|
|
208
|
+
/* @__PURE__ */ e("span", { className: "pt-0.5", children: "Show JSON Diff" })
|
|
209
|
+
]
|
|
210
|
+
}
|
|
211
|
+
)
|
|
212
|
+
] }),
|
|
213
|
+
i && (t == null ? void 0 : t.length) > 1 && a && /* @__PURE__ */ e(
|
|
214
|
+
Re,
|
|
215
|
+
{
|
|
216
|
+
fallback: /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-4", children: /* @__PURE__ */ e("span", { className: "text-sm", children: "Loading diff viewer..." }) }),
|
|
217
|
+
children: /* @__PURE__ */ e(ke, { open: i, onOpenChange: l, compare: t })
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
] });
|
|
221
|
+
}
|
|
222
|
+
function K({ checked: t, disabled: s, onChange: a, label: i = "Compare" }) {
|
|
223
|
+
return /* @__PURE__ */ e("div", { className: "absolute bottom-2 right-2", children: /* @__PURE__ */ n("label", { className: `flex cursor-pointer items-center gap-x-1 text-[11px] ${s ? "opacity-50" : ""}`, children: [
|
|
224
|
+
/* @__PURE__ */ e(
|
|
225
|
+
"input",
|
|
226
|
+
{
|
|
227
|
+
type: "checkbox",
|
|
228
|
+
className: "h-3 w-3 cursor-pointer rounded focus:ring-0 focus:ring-offset-0",
|
|
229
|
+
checked: t,
|
|
230
|
+
disabled: s,
|
|
231
|
+
onChange: a
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ e("span", { className: "select-none leading-tight", children: i })
|
|
235
|
+
] }) });
|
|
236
|
+
}
|
|
237
|
+
function _e({ revision: t, onRestore: s, onDelete: a }) {
|
|
238
|
+
return /* @__PURE__ */ n(me, { children: [
|
|
239
|
+
/* @__PURE__ */ e(he, { asChild: !0, children: /* @__PURE__ */ n(g, { variant: "ghost", size: "icon", className: "h-5 w-5", children: [
|
|
240
|
+
/* @__PURE__ */ e(be, { className: "h-4 w-4" }),
|
|
241
|
+
/* @__PURE__ */ e("span", { className: "sr-only", children: "More options" })
|
|
242
|
+
] }) }),
|
|
243
|
+
/* @__PURE__ */ n(fe, { align: "end", className: "text-xs", children: [
|
|
244
|
+
/* @__PURE__ */ e(R, { permission: w.RESTORE_REVISION, children: /* @__PURE__ */ n(U, { onClick: s, className: "cursor-pointer text-sm", children: [
|
|
245
|
+
/* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
|
|
246
|
+
/* @__PURE__ */ e("span", { children: "Restore this version" })
|
|
247
|
+
] }) }),
|
|
248
|
+
/* @__PURE__ */ e(R, { permission: w.DELETE_REVISION, children: t.uid !== "current" && /* @__PURE__ */ n(p, { children: [
|
|
249
|
+
/* @__PURE__ */ e(pe, {}),
|
|
250
|
+
/* @__PURE__ */ n(U, { onClick: a, className: "cursor-pointer text-destructive", children: [
|
|
251
|
+
/* @__PURE__ */ e(Q, { className: "mr-2 h-4 w-4" }),
|
|
252
|
+
/* @__PURE__ */ e("span", { children: "Delete this version" })
|
|
253
|
+
] })
|
|
254
|
+
] }) })
|
|
255
|
+
] })
|
|
256
|
+
] });
|
|
257
|
+
}
|
|
258
|
+
function Ue({
|
|
259
|
+
open: t,
|
|
260
|
+
onOpenChange: s,
|
|
261
|
+
revision: a,
|
|
262
|
+
onRestore: i,
|
|
263
|
+
isRestoring: l
|
|
264
|
+
}) {
|
|
265
|
+
const { data: d } = I((a == null ? void 0 : a.currentEditor) || ""), u = (d == null ? void 0 : d.name) || "Unknown";
|
|
266
|
+
return a ? /* @__PURE__ */ e(
|
|
267
|
+
q,
|
|
268
|
+
{
|
|
269
|
+
open: t,
|
|
270
|
+
onOpenChange: (m) => {
|
|
271
|
+
l || s(m);
|
|
272
|
+
},
|
|
273
|
+
children: /* @__PURE__ */ n(L, { className: "sm:max-w-md", children: [
|
|
274
|
+
/* @__PURE__ */ n(P, { children: [
|
|
275
|
+
/* @__PURE__ */ e($, { children: "Restore Revision" }),
|
|
276
|
+
/* @__PURE__ */ n(z, { children: [
|
|
277
|
+
"You are about to restore to revision ",
|
|
278
|
+
a.uid.substring(0, 8),
|
|
279
|
+
" from",
|
|
280
|
+
" ",
|
|
281
|
+
D(a.createdAt, "MMM d, yyyy 'at' h:mm a"),
|
|
282
|
+
" by ",
|
|
283
|
+
u
|
|
284
|
+
] })
|
|
285
|
+
] }),
|
|
286
|
+
/* @__PURE__ */ e("div", { className: "py-2", children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "How would you like to handle your current edits?" }) }),
|
|
287
|
+
/* @__PURE__ */ n(H, { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
288
|
+
/* @__PURE__ */ e(g, { variant: "outline", className: "sm:flex-1", onClick: () => i(!1), disabled: l, children: l ? /* @__PURE__ */ n(p, { children: [
|
|
289
|
+
/* @__PURE__ */ e("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
290
|
+
"Saving as draft..."
|
|
291
|
+
] }) : /* @__PURE__ */ n(p, { children: [
|
|
292
|
+
/* @__PURE__ */ e(ye, { className: "mr-2 h-4 w-4" }),
|
|
293
|
+
"Save as draft"
|
|
294
|
+
] }) }),
|
|
295
|
+
/* @__PURE__ */ e(g, { variant: "default", className: "sm:flex-1", onClick: () => i(!0), disabled: l, children: l ? /* @__PURE__ */ n(p, { children: [
|
|
296
|
+
/* @__PURE__ */ e("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
297
|
+
"Discarding current..."
|
|
298
|
+
] }) : /* @__PURE__ */ n(p, { children: [
|
|
299
|
+
/* @__PURE__ */ e(J, { className: "mr-2 h-4 w-4" }),
|
|
300
|
+
"Discard current"
|
|
301
|
+
] }) })
|
|
302
|
+
] })
|
|
303
|
+
] })
|
|
304
|
+
}
|
|
305
|
+
) : null;
|
|
306
|
+
}
|
|
307
|
+
function Fe({
|
|
308
|
+
open: t,
|
|
309
|
+
onOpenChange: s,
|
|
310
|
+
revision: a,
|
|
311
|
+
onDelete: i,
|
|
312
|
+
isDeleting: l
|
|
313
|
+
}) {
|
|
314
|
+
const { data: d } = I((a == null ? void 0 : a.currentEditor) || ""), u = (d == null ? void 0 : d.name) || "Unknown";
|
|
315
|
+
return a ? /* @__PURE__ */ e(
|
|
316
|
+
q,
|
|
317
|
+
{
|
|
318
|
+
open: t,
|
|
319
|
+
onOpenChange: (m) => {
|
|
320
|
+
l || s(m);
|
|
321
|
+
},
|
|
322
|
+
children: /* @__PURE__ */ n(L, { className: "sm:max-w-md", children: [
|
|
323
|
+
/* @__PURE__ */ n(P, { children: [
|
|
324
|
+
/* @__PURE__ */ e($, { children: "Delete Revision" }),
|
|
325
|
+
/* @__PURE__ */ n(z, { children: [
|
|
326
|
+
"You are about to delete revision ",
|
|
327
|
+
a.uid.substring(0, 8),
|
|
328
|
+
" from",
|
|
329
|
+
" ",
|
|
330
|
+
D(a.createdAt, "MMM d, yyyy 'at' h:mm a"),
|
|
331
|
+
" by ",
|
|
332
|
+
u
|
|
333
|
+
] })
|
|
334
|
+
] }),
|
|
335
|
+
/* @__PURE__ */ e("div", { className: "py-2", children: /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: "This action cannot be undone. Are you sure you want to proceed?" }) }),
|
|
336
|
+
/* @__PURE__ */ n(H, { className: "flex flex-col gap-2 sm:flex-row", children: [
|
|
337
|
+
/* @__PURE__ */ e(g, { variant: "outline", className: "sm:flex-1", onClick: () => s(!1), disabled: l, children: "Cancel" }),
|
|
338
|
+
/* @__PURE__ */ e(g, { variant: "destructive", className: "sm:flex-1", onClick: i, disabled: l, children: l ? /* @__PURE__ */ n(p, { children: [
|
|
339
|
+
/* @__PURE__ */ e("span", { className: "mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent" }),
|
|
340
|
+
"Deleting..."
|
|
341
|
+
] }) : /* @__PURE__ */ n(p, { children: [
|
|
342
|
+
/* @__PURE__ */ e(Q, { className: "mr-2 h-4 w-4" }),
|
|
343
|
+
"Delete Revision"
|
|
344
|
+
] }) })
|
|
345
|
+
] })
|
|
346
|
+
] })
|
|
347
|
+
}
|
|
348
|
+
) : null;
|
|
349
|
+
}
|
|
350
|
+
function Je({ isOpen: t }) {
|
|
351
|
+
var T, _;
|
|
352
|
+
const [s, a] = v.useState([]), [i, l] = v.useState(null), [d, u] = v.useState(!1), [m, o] = v.useState(!1), { data: r } = j(), { data: f, isFetching: S, error: h, refetch: x } = Ce(r == null ? void 0 : r.id), { mutate: W, isPending: Y } = Ae(), { mutate: B, isPending: X } = Ie(), Z = k(), { selectedLang: ee, fallbackLang: te } = ie(), ne = ee || te;
|
|
353
|
+
F(() => a([]), [r == null ? void 0 : r.id]);
|
|
354
|
+
const ae = (c) => {
|
|
355
|
+
i && B(
|
|
356
|
+
{ revisionId: i.uid, discardCurrent: c },
|
|
357
|
+
{
|
|
358
|
+
onSuccess: () => {
|
|
359
|
+
u(!1), l(null), Z.invalidateQueries({
|
|
360
|
+
queryKey: [b.GET_DRAFT_PAGE]
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
);
|
|
365
|
+
}, O = (c) => {
|
|
366
|
+
l(c), u(!0);
|
|
367
|
+
}, M = (c) => {
|
|
368
|
+
l(c), o(!0);
|
|
369
|
+
}, se = () => {
|
|
370
|
+
i && W(i.uid, {
|
|
371
|
+
/**
|
|
372
|
+
* Callback for when deletion of a revision is successful. Closes the
|
|
373
|
+
* delete dialog and resets the selected revision to null.
|
|
374
|
+
*/
|
|
375
|
+
onSuccess: () => {
|
|
376
|
+
o(!1), l(null);
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
};
|
|
380
|
+
return F(() => {
|
|
381
|
+
t && x();
|
|
382
|
+
}, [t, x]), /* @__PURE__ */ n(p, { children: [
|
|
383
|
+
/* @__PURE__ */ n(ce, { children: [
|
|
384
|
+
/* @__PURE__ */ e(oe, { children: "Revision History" }),
|
|
385
|
+
(r == null ? void 0 : r.createdAt) && /* @__PURE__ */ n("p", { className: "mt-1 text-xs text-muted-foreground", children: [
|
|
386
|
+
"Page created on ",
|
|
387
|
+
D(new Date(r.createdAt), "MMM d, yyyy 'at' h:mm a")
|
|
388
|
+
] })
|
|
389
|
+
] }),
|
|
390
|
+
S ? /* @__PURE__ */ e(Me, {}) : h ? /* @__PURE__ */ e("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Failed to load revisions. Please try again." }) : /* @__PURE__ */ n("div", { className: "mt-2 flex h-full min-h-0 flex-1 flex-col space-y-2", children: [
|
|
391
|
+
/* @__PURE__ */ e(Te, { lang: ne, compare: s, setCompare: a, pageId: r == null ? void 0 : r.id }),
|
|
392
|
+
/* @__PURE__ */ e(Oe, { compare: s, setCompare: a }),
|
|
393
|
+
(T = f == null ? void 0 : f.filter((c) => c.uid === "current")) == null ? void 0 : T.map((c, E) => /* @__PURE__ */ e(
|
|
394
|
+
V,
|
|
395
|
+
{
|
|
396
|
+
pageId: r == null ? void 0 : r.id,
|
|
397
|
+
revision: c,
|
|
398
|
+
isLatest: !0,
|
|
399
|
+
onRestore: () => O(c),
|
|
400
|
+
onDelete: () => M(c),
|
|
401
|
+
revisionNumber: E,
|
|
402
|
+
compare: s,
|
|
403
|
+
setCompare: a
|
|
404
|
+
},
|
|
405
|
+
c.uid
|
|
406
|
+
)),
|
|
407
|
+
/* @__PURE__ */ e(ue, { className: "min-h-0 flex-1", children: /* @__PURE__ */ e("div", { className: "space-y-2", children: (_ = f == null ? void 0 : f.filter((c) => c.uid !== "current")) == null ? void 0 : _.map((c, E) => /* @__PURE__ */ e(
|
|
408
|
+
V,
|
|
409
|
+
{
|
|
410
|
+
pageId: r == null ? void 0 : r.id,
|
|
411
|
+
revision: c,
|
|
412
|
+
isLatest: c.uid === "current",
|
|
413
|
+
onRestore: () => O(c),
|
|
414
|
+
onDelete: () => M(c),
|
|
415
|
+
revisionNumber: E + 1,
|
|
416
|
+
compare: s,
|
|
417
|
+
setCompare: a
|
|
418
|
+
},
|
|
419
|
+
c.uid
|
|
420
|
+
)) }) })
|
|
421
|
+
] }),
|
|
422
|
+
/* @__PURE__ */ e(
|
|
423
|
+
Ue,
|
|
424
|
+
{
|
|
425
|
+
open: d,
|
|
426
|
+
onOpenChange: u,
|
|
427
|
+
revision: i,
|
|
428
|
+
onRestore: ae,
|
|
429
|
+
isRestoring: X
|
|
430
|
+
}
|
|
431
|
+
),
|
|
432
|
+
/* @__PURE__ */ e(
|
|
433
|
+
Fe,
|
|
434
|
+
{
|
|
435
|
+
open: m,
|
|
436
|
+
onOpenChange: o,
|
|
437
|
+
revision: i,
|
|
438
|
+
onDelete: se,
|
|
439
|
+
isDeleting: Y
|
|
440
|
+
}
|
|
441
|
+
)
|
|
442
|
+
] });
|
|
443
|
+
}
|
|
444
|
+
export {
|
|
445
|
+
Je as default
|
|
446
|
+
};
|