camox 0.35.0 → 0.36.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/features/preview/CamoxPreview.js +106 -89
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/PageEditorSidebar.js +35 -25
- package/dist/features/preview/components/PageInfoSidebar.js +1 -1
- package/dist/features/preview/components/PageNavigatorSidebar.js +241 -313
- package/dist/features/preview/components/PreviewToolbar.js +75 -49
- package/dist/features/preview/previewStore.js +13 -6
- package/dist/features/runtime/studioNavigation.js +7 -2
- package/dist/features/studio/components/Navbar.js +5 -5
- package/dist/features/studio/components/ProjectMenu.js +5 -5
- package/dist/features/vite/vite.d.ts +1 -1
- package/dist/features/vite/vite.js +2 -2
- package/dist/lib/telemetry-client.js +2 -2
- package/dist/studio.css +1 -1
- package/package.json +4 -4
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useLocation } from "../../navigation/navigation.js";
|
|
2
2
|
import { actionsStore } from "../../provider/actionsStore.js";
|
|
3
|
-
import { useProjectSlug } from "../../../lib/auth.js";
|
|
4
3
|
import { pageMutations } from "../../../lib/queries.js";
|
|
5
4
|
import { cn } from "../../../lib/utils.js";
|
|
6
5
|
import { trackClientEvent } from "../../../lib/telemetry-client.js";
|
|
7
6
|
import { previewStore } from "../previewStore.js";
|
|
8
|
-
import { pageFullQueryFn } from "../previewQueryFns.js";
|
|
9
7
|
import { PagePicker } from "./PagePicker.js";
|
|
10
8
|
import { PageTree } from "./PageTree.js";
|
|
11
9
|
import { PublishDialog } from "./PublishDialog.js";
|
|
@@ -20,22 +18,19 @@ import { MoreHorizontal } from "lucide-react";
|
|
|
20
18
|
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle } from "@camox/ui/alert-dialog";
|
|
21
19
|
import { toast } from "@camox/ui/toaster";
|
|
22
20
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
23
|
-
import { Label } from "@camox/ui/label";
|
|
24
21
|
import { PanelContent, PanelHeader } from "@camox/ui/panel";
|
|
25
22
|
import { ButtonGroup } from "@camox/ui/button-group";
|
|
26
|
-
import { Switch } from "@camox/ui/switch";
|
|
27
23
|
|
|
28
24
|
//#region src/features/preview/components/PageNavigatorSidebar.tsx
|
|
29
25
|
const PageNavigatorPublishRow = (t0) => {
|
|
30
|
-
const $ = c(
|
|
31
|
-
if ($[0] !== "
|
|
32
|
-
for (let $i = 0; $i <
|
|
33
|
-
$[0] = "
|
|
26
|
+
const $ = c(86);
|
|
27
|
+
if ($[0] !== "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c") {
|
|
28
|
+
for (let $i = 0; $i < 86; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
29
|
+
$[0] = "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c";
|
|
34
30
|
}
|
|
35
31
|
const { page } = t0;
|
|
36
32
|
const previewSource = useSelector(previewStore, _temp);
|
|
37
33
|
const queryClient = useQueryClient();
|
|
38
|
-
const projectSlug = useProjectSlug();
|
|
39
34
|
const { pathname } = useLocation();
|
|
40
35
|
const [isPublishDialogOpen, setIsPublishDialogOpen] = React.useState(false);
|
|
41
36
|
const [isUnpublishDialogOpen, setIsUnpublishDialogOpen] = React.useState(false);
|
|
@@ -54,43 +49,23 @@ const PageNavigatorPublishRow = (t0) => {
|
|
|
54
49
|
const discardChanges = useMutation(t2);
|
|
55
50
|
const hasLiveCheckpoint = page.livePublishedCheckpointId != null;
|
|
56
51
|
const isHomePage = page.fullPath === "/";
|
|
57
|
-
const otherSource = previewSource === "draft" ? "live" : "draft";
|
|
58
|
-
const canPrefetchOther = otherSource === "draft" || hasLiveCheckpoint;
|
|
59
|
-
let t3;
|
|
60
|
-
if ($[3] !== canPrefetchOther || $[4] !== otherSource || $[5] !== pathname || $[6] !== projectSlug || $[7] !== queryClient) {
|
|
61
|
-
t3 = () => {
|
|
62
|
-
if (!canPrefetchOther) return;
|
|
63
|
-
queryClient.prefetchQuery({
|
|
64
|
-
queryKey: queryKeys.pages.getByPath(pathname, otherSource),
|
|
65
|
-
queryFn: pageFullQueryFn(queryClient, pathname, projectSlug, otherSource),
|
|
66
|
-
staleTime: Infinity
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
$[3] = canPrefetchOther;
|
|
70
|
-
$[4] = otherSource;
|
|
71
|
-
$[5] = pathname;
|
|
72
|
-
$[6] = projectSlug;
|
|
73
|
-
$[7] = queryClient;
|
|
74
|
-
$[8] = t3;
|
|
75
|
-
} else t3 = $[8];
|
|
76
|
-
const prefetchOtherSource = t3;
|
|
77
52
|
const canPublish = (page.status === "draft" || page.status === "modified") && previewSource === "draft";
|
|
78
53
|
const canDiscardChanges = page.status === "modified";
|
|
79
|
-
let
|
|
80
|
-
if ($[
|
|
81
|
-
|
|
54
|
+
let t3;
|
|
55
|
+
if ($[3] !== page.modifiedReason) {
|
|
56
|
+
t3 = page.modifiedReason && (page.modifiedReason.reason === "layout" || page.modifiedReason.reason === "both") ? {
|
|
82
57
|
layoutHandle: page.modifiedReason.layoutHandle,
|
|
83
58
|
affectedPagesCount: page.modifiedReason.affectedPagesCount
|
|
84
59
|
} : null;
|
|
85
|
-
$[
|
|
86
|
-
$[
|
|
87
|
-
} else
|
|
88
|
-
const layoutCascade =
|
|
60
|
+
$[3] = page.modifiedReason;
|
|
61
|
+
$[4] = t3;
|
|
62
|
+
} else t3 = $[4];
|
|
63
|
+
const layoutCascade = t3;
|
|
89
64
|
const publishLabel = page.status === "modified" ? "Publish changes" : "Publish page";
|
|
65
|
+
let t4;
|
|
90
66
|
let t5;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
t5 = () => {
|
|
67
|
+
if ($[5] !== canDiscardChanges || $[6] !== canPublish || $[7] !== discardChanges.isPending || $[8] !== hasLiveCheckpoint || $[9] !== isHomePage || $[10] !== publishLabel || $[11] !== unpublishPage.isPending) {
|
|
68
|
+
t4 = () => {
|
|
94
69
|
const actions = [
|
|
95
70
|
{
|
|
96
71
|
id: "publish-current-page",
|
|
@@ -138,7 +113,7 @@ const PageNavigatorPublishRow = (t0) => {
|
|
|
138
113
|
ids: actions.map(_temp2)
|
|
139
114
|
});
|
|
140
115
|
};
|
|
141
|
-
|
|
116
|
+
t5 = [
|
|
142
117
|
canDiscardChanges,
|
|
143
118
|
canPublish,
|
|
144
119
|
discardChanges.isPending,
|
|
@@ -147,23 +122,23 @@ const PageNavigatorPublishRow = (t0) => {
|
|
|
147
122
|
publishLabel,
|
|
148
123
|
unpublishPage.isPending
|
|
149
124
|
];
|
|
150
|
-
$[
|
|
151
|
-
$[
|
|
152
|
-
$[
|
|
153
|
-
$[
|
|
154
|
-
$[
|
|
155
|
-
$[
|
|
156
|
-
$[
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
125
|
+
$[5] = canDiscardChanges;
|
|
126
|
+
$[6] = canPublish;
|
|
127
|
+
$[7] = discardChanges.isPending;
|
|
128
|
+
$[8] = hasLiveCheckpoint;
|
|
129
|
+
$[9] = isHomePage;
|
|
130
|
+
$[10] = publishLabel;
|
|
131
|
+
$[11] = unpublishPage.isPending;
|
|
132
|
+
$[12] = t4;
|
|
133
|
+
$[13] = t5;
|
|
159
134
|
} else {
|
|
160
|
-
|
|
161
|
-
|
|
135
|
+
t4 = $[12];
|
|
136
|
+
t5 = $[13];
|
|
162
137
|
}
|
|
163
|
-
React.useEffect(
|
|
164
|
-
let
|
|
165
|
-
if ($[
|
|
166
|
-
|
|
138
|
+
React.useEffect(t4, t5);
|
|
139
|
+
let t6;
|
|
140
|
+
if ($[14] !== isHomePage || $[15] !== page.id || $[16] !== pathname || $[17] !== queryClient || $[18] !== unpublishPage) {
|
|
141
|
+
t6 = async () => {
|
|
167
142
|
if (isHomePage) return;
|
|
168
143
|
try {
|
|
169
144
|
await unpublishPage.mutateAsync({ id: page.id });
|
|
@@ -181,22 +156,22 @@ const PageNavigatorPublishRow = (t0) => {
|
|
|
181
156
|
trackClientEvent("page_unpublished", { pageId: page.id });
|
|
182
157
|
toast.success("Unpublished this page");
|
|
183
158
|
setIsUnpublishDialogOpen(false);
|
|
184
|
-
} catch (
|
|
185
|
-
console.error("Failed to unpublish page:",
|
|
159
|
+
} catch (t7) {
|
|
160
|
+
console.error("Failed to unpublish page:", t7);
|
|
186
161
|
toast.error("Could not unpublish this page");
|
|
187
162
|
}
|
|
188
163
|
};
|
|
189
|
-
$[
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
193
|
-
$[
|
|
194
|
-
$[
|
|
195
|
-
} else
|
|
196
|
-
const handleUnpublish =
|
|
197
|
-
let
|
|
198
|
-
if ($[
|
|
199
|
-
|
|
164
|
+
$[14] = isHomePage;
|
|
165
|
+
$[15] = page.id;
|
|
166
|
+
$[16] = pathname;
|
|
167
|
+
$[17] = queryClient;
|
|
168
|
+
$[18] = unpublishPage;
|
|
169
|
+
$[19] = t6;
|
|
170
|
+
} else t6 = $[19];
|
|
171
|
+
const handleUnpublish = t6;
|
|
172
|
+
let t7;
|
|
173
|
+
if ($[20] !== discardChanges || $[21] !== page.id) {
|
|
174
|
+
t7 = async () => {
|
|
200
175
|
try {
|
|
201
176
|
await discardChanges.mutateAsync({ id: page.id });
|
|
202
177
|
previewStore.send({
|
|
@@ -206,39 +181,39 @@ const PageNavigatorPublishRow = (t0) => {
|
|
|
206
181
|
trackClientEvent("page_changes_discarded", { pageId: page.id });
|
|
207
182
|
toast.success("Discarded draft changes");
|
|
208
183
|
setIsDiscardDialogOpen(false);
|
|
209
|
-
} catch (
|
|
210
|
-
console.error("Failed to discard page changes:",
|
|
184
|
+
} catch (t8) {
|
|
185
|
+
console.error("Failed to discard page changes:", t8);
|
|
211
186
|
toast.error("Could not discard draft changes");
|
|
212
187
|
}
|
|
213
188
|
};
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
} else
|
|
218
|
-
const handleDiscardChanges =
|
|
219
|
-
const
|
|
189
|
+
$[20] = discardChanges;
|
|
190
|
+
$[21] = page.id;
|
|
191
|
+
$[22] = t7;
|
|
192
|
+
} else t7 = $[22];
|
|
193
|
+
const handleDiscardChanges = t7;
|
|
194
|
+
const t8 = !canPublish;
|
|
195
|
+
let t9;
|
|
196
|
+
if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
|
|
197
|
+
t9 = () => setIsPublishDialogOpen(true);
|
|
198
|
+
$[23] = t9;
|
|
199
|
+
} else t9 = $[23];
|
|
220
200
|
let t10;
|
|
221
|
-
if ($[
|
|
222
|
-
t10 =
|
|
223
|
-
$[29] = t10;
|
|
224
|
-
} else t10 = $[29];
|
|
225
|
-
let t11;
|
|
226
|
-
if ($[30] !== publishLabel || $[31] !== t9) {
|
|
227
|
-
t11 = /* @__PURE__ */ jsx(Button, {
|
|
201
|
+
if ($[24] !== publishLabel || $[25] !== t8) {
|
|
202
|
+
t10 = /* @__PURE__ */ jsx(Button, {
|
|
228
203
|
variant: "outline",
|
|
229
204
|
type: "button",
|
|
230
|
-
disabled:
|
|
231
|
-
onClick:
|
|
205
|
+
disabled: t8,
|
|
206
|
+
onClick: t9,
|
|
232
207
|
className: "flex-1",
|
|
233
208
|
children: publishLabel
|
|
234
209
|
});
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
} else
|
|
239
|
-
let
|
|
240
|
-
if ($[
|
|
241
|
-
|
|
210
|
+
$[24] = publishLabel;
|
|
211
|
+
$[25] = t8;
|
|
212
|
+
$[26] = t10;
|
|
213
|
+
} else t10 = $[26];
|
|
214
|
+
let t11;
|
|
215
|
+
if ($[27] === Symbol.for("react.memo_cache_sentinel")) {
|
|
216
|
+
t11 = /* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
242
217
|
render: /* @__PURE__ */ jsx(Button, {
|
|
243
218
|
type: "button",
|
|
244
219
|
variant: "outline",
|
|
@@ -247,129 +222,88 @@ const PageNavigatorPublishRow = (t0) => {
|
|
|
247
222
|
}),
|
|
248
223
|
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "text-muted-foreground" })
|
|
249
224
|
});
|
|
250
|
-
$[
|
|
251
|
-
} else
|
|
252
|
-
const
|
|
225
|
+
$[27] = t11;
|
|
226
|
+
} else t11 = $[27];
|
|
227
|
+
const t12 = !hasLiveCheckpoint || isHomePage || unpublishPage.isPending;
|
|
228
|
+
let t13;
|
|
229
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
230
|
+
t13 = () => setIsUnpublishDialogOpen(true);
|
|
231
|
+
$[28] = t13;
|
|
232
|
+
} else t13 = $[28];
|
|
253
233
|
let t14;
|
|
254
|
-
if ($[
|
|
255
|
-
t14 =
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
let t15;
|
|
259
|
-
if ($[35] !== t13) {
|
|
260
|
-
t15 = /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
261
|
-
disabled: t13,
|
|
262
|
-
onClick: t14,
|
|
234
|
+
if ($[29] !== t12) {
|
|
235
|
+
t14 = /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
236
|
+
disabled: t12,
|
|
237
|
+
onClick: t13,
|
|
263
238
|
children: "Unpublish"
|
|
264
239
|
});
|
|
265
|
-
$[
|
|
266
|
-
$[
|
|
267
|
-
} else
|
|
268
|
-
const
|
|
240
|
+
$[29] = t12;
|
|
241
|
+
$[30] = t14;
|
|
242
|
+
} else t14 = $[30];
|
|
243
|
+
const t15 = !canDiscardChanges || discardChanges.isPending;
|
|
244
|
+
let t16;
|
|
245
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
246
|
+
t16 = () => setIsDiscardDialogOpen(true);
|
|
247
|
+
$[31] = t16;
|
|
248
|
+
} else t16 = $[31];
|
|
269
249
|
let t17;
|
|
270
|
-
if ($[
|
|
271
|
-
t17 =
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
let t18;
|
|
275
|
-
if ($[38] !== t16) {
|
|
276
|
-
t18 = /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
277
|
-
disabled: t16,
|
|
278
|
-
onClick: t17,
|
|
250
|
+
if ($[32] !== t15) {
|
|
251
|
+
t17 = /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
252
|
+
disabled: t15,
|
|
253
|
+
onClick: t16,
|
|
279
254
|
children: "Discard changes"
|
|
280
255
|
});
|
|
281
|
-
$[
|
|
282
|
-
$[
|
|
283
|
-
} else
|
|
284
|
-
let
|
|
285
|
-
if ($[
|
|
286
|
-
|
|
256
|
+
$[32] = t15;
|
|
257
|
+
$[33] = t17;
|
|
258
|
+
} else t17 = $[33];
|
|
259
|
+
let t18;
|
|
260
|
+
if ($[34] !== t14 || $[35] !== t17) {
|
|
261
|
+
t18 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t11, /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
287
262
|
align: "end",
|
|
288
263
|
className: "w-42",
|
|
289
|
-
children: [
|
|
264
|
+
children: [t14, t17]
|
|
290
265
|
})] });
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
} else
|
|
295
|
-
let
|
|
296
|
-
if ($[
|
|
297
|
-
|
|
298
|
-
className: "w-full",
|
|
299
|
-
children: [t11, t19]
|
|
300
|
-
});
|
|
301
|
-
$[43] = t11;
|
|
302
|
-
$[44] = t19;
|
|
303
|
-
$[45] = t20;
|
|
304
|
-
} else t20 = $[45];
|
|
305
|
-
const t21 = !hasLiveCheckpoint;
|
|
306
|
-
const t22 = previewSource === "draft";
|
|
307
|
-
let t23;
|
|
308
|
-
if ($[46] !== t21 || $[47] !== t22) {
|
|
309
|
-
t23 = /* @__PURE__ */ jsx(Switch, {
|
|
310
|
-
id: "draft-content",
|
|
311
|
-
disabled: t21,
|
|
312
|
-
checked: t22,
|
|
313
|
-
onCheckedChange: _temp4
|
|
314
|
-
});
|
|
315
|
-
$[46] = t21;
|
|
316
|
-
$[47] = t22;
|
|
317
|
-
$[48] = t23;
|
|
318
|
-
} else t23 = $[48];
|
|
319
|
-
let t24;
|
|
320
|
-
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
321
|
-
t24 = /* @__PURE__ */ jsx(Label, {
|
|
322
|
-
htmlFor: "draft-content",
|
|
323
|
-
children: "Draft content"
|
|
324
|
-
});
|
|
325
|
-
$[49] = t24;
|
|
326
|
-
} else t24 = $[49];
|
|
327
|
-
let t25;
|
|
328
|
-
if ($[50] !== prefetchOtherSource || $[51] !== t23) {
|
|
329
|
-
t25 = /* @__PURE__ */ jsxs("div", {
|
|
330
|
-
className: "mt-1 flex items-center gap-2",
|
|
331
|
-
onMouseEnter: prefetchOtherSource,
|
|
332
|
-
onFocus: prefetchOtherSource,
|
|
333
|
-
children: [t23, t24]
|
|
334
|
-
});
|
|
335
|
-
$[50] = prefetchOtherSource;
|
|
336
|
-
$[51] = t23;
|
|
337
|
-
$[52] = t25;
|
|
338
|
-
} else t25 = $[52];
|
|
339
|
-
let t26;
|
|
340
|
-
if ($[53] !== t20 || $[54] !== t25) {
|
|
341
|
-
t26 = /* @__PURE__ */ jsxs("div", {
|
|
266
|
+
$[34] = t14;
|
|
267
|
+
$[35] = t17;
|
|
268
|
+
$[36] = t18;
|
|
269
|
+
} else t18 = $[36];
|
|
270
|
+
let t19;
|
|
271
|
+
if ($[37] !== t10 || $[38] !== t18) {
|
|
272
|
+
t19 = /* @__PURE__ */ jsx("div", {
|
|
342
273
|
className: "flex flex-col gap-2",
|
|
343
|
-
children:
|
|
274
|
+
children: /* @__PURE__ */ jsxs(ButtonGroup, {
|
|
275
|
+
className: "w-full",
|
|
276
|
+
children: [t10, t18]
|
|
277
|
+
})
|
|
344
278
|
});
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
} else
|
|
349
|
-
const
|
|
350
|
-
let
|
|
351
|
-
if ($[
|
|
352
|
-
|
|
353
|
-
page:
|
|
279
|
+
$[37] = t10;
|
|
280
|
+
$[38] = t18;
|
|
281
|
+
$[39] = t19;
|
|
282
|
+
} else t19 = $[39];
|
|
283
|
+
const t20 = isPublishDialogOpen ? page : null;
|
|
284
|
+
let t21;
|
|
285
|
+
if ($[40] !== isPublishDialogOpen || $[41] !== layoutCascade || $[42] !== page.status || $[43] !== t20) {
|
|
286
|
+
t21 = /* @__PURE__ */ jsx(PublishDialog, {
|
|
287
|
+
page: t20,
|
|
354
288
|
pageStatus: page.status,
|
|
355
289
|
alsoPublishLayout: layoutCascade,
|
|
356
290
|
open: isPublishDialogOpen,
|
|
357
291
|
onOpenChange: setIsPublishDialogOpen
|
|
358
292
|
});
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
364
|
-
} else
|
|
365
|
-
let
|
|
366
|
-
if ($[
|
|
367
|
-
|
|
368
|
-
$[
|
|
369
|
-
} else
|
|
370
|
-
let
|
|
371
|
-
if ($[
|
|
372
|
-
|
|
293
|
+
$[40] = isPublishDialogOpen;
|
|
294
|
+
$[41] = layoutCascade;
|
|
295
|
+
$[42] = page.status;
|
|
296
|
+
$[43] = t20;
|
|
297
|
+
$[44] = t21;
|
|
298
|
+
} else t21 = $[44];
|
|
299
|
+
let t22;
|
|
300
|
+
if ($[45] === Symbol.for("react.memo_cache_sentinel")) {
|
|
301
|
+
t22 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unpublish page" });
|
|
302
|
+
$[45] = t22;
|
|
303
|
+
} else t22 = $[45];
|
|
304
|
+
let t23;
|
|
305
|
+
if ($[46] !== page.fullPath) {
|
|
306
|
+
t23 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t22, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
|
|
373
307
|
"Visitors at",
|
|
374
308
|
" ",
|
|
375
309
|
/* @__PURE__ */ jsx("code", {
|
|
@@ -379,67 +313,67 @@ const PageNavigatorPublishRow = (t0) => {
|
|
|
379
313
|
" ",
|
|
380
314
|
"will get a 404. The draft stays available in Camox Studio."
|
|
381
315
|
] })] });
|
|
382
|
-
$[
|
|
383
|
-
$[
|
|
384
|
-
} else
|
|
385
|
-
let
|
|
386
|
-
if ($[
|
|
387
|
-
|
|
316
|
+
$[46] = page.fullPath;
|
|
317
|
+
$[47] = t23;
|
|
318
|
+
} else t23 = $[47];
|
|
319
|
+
let t24;
|
|
320
|
+
if ($[48] !== unpublishPage.isPending) {
|
|
321
|
+
t24 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
388
322
|
variant: "outline",
|
|
389
323
|
size: "default",
|
|
390
324
|
disabled: unpublishPage.isPending,
|
|
391
325
|
children: "Cancel"
|
|
392
326
|
});
|
|
393
|
-
$[
|
|
394
|
-
$[
|
|
395
|
-
} else
|
|
396
|
-
const
|
|
397
|
-
const
|
|
398
|
-
let
|
|
399
|
-
if ($[
|
|
400
|
-
|
|
327
|
+
$[48] = unpublishPage.isPending;
|
|
328
|
+
$[49] = t24;
|
|
329
|
+
} else t24 = $[49];
|
|
330
|
+
const t25 = isHomePage || unpublishPage.isPending;
|
|
331
|
+
const t26 = unpublishPage.isPending ? "Unpublishing…" : "Unpublish";
|
|
332
|
+
let t27;
|
|
333
|
+
if ($[50] !== handleUnpublish || $[51] !== t25 || $[52] !== t26) {
|
|
334
|
+
t27 = /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
401
335
|
onClick: handleUnpublish,
|
|
402
|
-
disabled:
|
|
403
|
-
children:
|
|
336
|
+
disabled: t25,
|
|
337
|
+
children: t26
|
|
404
338
|
});
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
408
|
-
$[
|
|
409
|
-
} else
|
|
410
|
-
let
|
|
411
|
-
if ($[
|
|
412
|
-
|
|
413
|
-
$[
|
|
414
|
-
$[
|
|
415
|
-
$[
|
|
416
|
-
} else
|
|
417
|
-
let
|
|
418
|
-
if ($[
|
|
419
|
-
|
|
420
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
423
|
-
} else
|
|
424
|
-
let
|
|
425
|
-
if ($[
|
|
426
|
-
|
|
339
|
+
$[50] = handleUnpublish;
|
|
340
|
+
$[51] = t25;
|
|
341
|
+
$[52] = t26;
|
|
342
|
+
$[53] = t27;
|
|
343
|
+
} else t27 = $[53];
|
|
344
|
+
let t28;
|
|
345
|
+
if ($[54] !== t24 || $[55] !== t27) {
|
|
346
|
+
t28 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t24, t27] });
|
|
347
|
+
$[54] = t24;
|
|
348
|
+
$[55] = t27;
|
|
349
|
+
$[56] = t28;
|
|
350
|
+
} else t28 = $[56];
|
|
351
|
+
let t29;
|
|
352
|
+
if ($[57] !== t23 || $[58] !== t28) {
|
|
353
|
+
t29 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t23, t28] });
|
|
354
|
+
$[57] = t23;
|
|
355
|
+
$[58] = t28;
|
|
356
|
+
$[59] = t29;
|
|
357
|
+
} else t29 = $[59];
|
|
358
|
+
let t30;
|
|
359
|
+
if ($[60] !== isUnpublishDialogOpen || $[61] !== t29) {
|
|
360
|
+
t30 = /* @__PURE__ */ jsx(AlertDialog, {
|
|
427
361
|
open: isUnpublishDialogOpen,
|
|
428
362
|
onOpenChange: setIsUnpublishDialogOpen,
|
|
429
|
-
children:
|
|
363
|
+
children: t29
|
|
430
364
|
});
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
} else
|
|
435
|
-
let
|
|
436
|
-
if ($[
|
|
437
|
-
|
|
438
|
-
$[
|
|
439
|
-
} else
|
|
440
|
-
let
|
|
441
|
-
if ($[
|
|
442
|
-
|
|
365
|
+
$[60] = isUnpublishDialogOpen;
|
|
366
|
+
$[61] = t29;
|
|
367
|
+
$[62] = t30;
|
|
368
|
+
} else t30 = $[62];
|
|
369
|
+
let t31;
|
|
370
|
+
if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
|
|
371
|
+
t31 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Discard draft changes" });
|
|
372
|
+
$[63] = t31;
|
|
373
|
+
} else t31 = $[63];
|
|
374
|
+
let t32;
|
|
375
|
+
if ($[64] !== page.fullPath) {
|
|
376
|
+
t32 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t31, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
|
|
443
377
|
"The draft for",
|
|
444
378
|
" ",
|
|
445
379
|
/* @__PURE__ */ jsx("code", {
|
|
@@ -449,79 +383,79 @@ const PageNavigatorPublishRow = (t0) => {
|
|
|
449
383
|
" ",
|
|
450
384
|
"will be reset to match the currently published version. This does not change what visitors see."
|
|
451
385
|
] })] });
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
454
|
-
} else
|
|
455
|
-
let
|
|
456
|
-
if ($[
|
|
457
|
-
|
|
386
|
+
$[64] = page.fullPath;
|
|
387
|
+
$[65] = t32;
|
|
388
|
+
} else t32 = $[65];
|
|
389
|
+
let t33;
|
|
390
|
+
if ($[66] !== discardChanges.isPending) {
|
|
391
|
+
t33 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
458
392
|
variant: "outline",
|
|
459
393
|
size: "default",
|
|
460
394
|
disabled: discardChanges.isPending,
|
|
461
395
|
children: "Cancel"
|
|
462
396
|
});
|
|
463
|
-
$[
|
|
464
|
-
$[
|
|
465
|
-
} else
|
|
466
|
-
const
|
|
467
|
-
let
|
|
468
|
-
if ($[
|
|
469
|
-
|
|
397
|
+
$[66] = discardChanges.isPending;
|
|
398
|
+
$[67] = t33;
|
|
399
|
+
} else t33 = $[67];
|
|
400
|
+
const t34 = discardChanges.isPending ? "Discarding…" : "Discard changes";
|
|
401
|
+
let t35;
|
|
402
|
+
if ($[68] !== discardChanges.isPending || $[69] !== handleDiscardChanges || $[70] !== t34) {
|
|
403
|
+
t35 = /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
470
404
|
onClick: handleDiscardChanges,
|
|
471
405
|
disabled: discardChanges.isPending,
|
|
472
|
-
children:
|
|
406
|
+
children: t34
|
|
473
407
|
});
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
} else
|
|
479
|
-
let
|
|
480
|
-
if ($[
|
|
481
|
-
|
|
482
|
-
$[
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
} else
|
|
486
|
-
let
|
|
487
|
-
if ($[
|
|
488
|
-
|
|
489
|
-
$[
|
|
490
|
-
$[
|
|
491
|
-
$[
|
|
492
|
-
} else
|
|
493
|
-
let
|
|
494
|
-
if ($[
|
|
495
|
-
|
|
408
|
+
$[68] = discardChanges.isPending;
|
|
409
|
+
$[69] = handleDiscardChanges;
|
|
410
|
+
$[70] = t34;
|
|
411
|
+
$[71] = t35;
|
|
412
|
+
} else t35 = $[71];
|
|
413
|
+
let t36;
|
|
414
|
+
if ($[72] !== t33 || $[73] !== t35) {
|
|
415
|
+
t36 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t33, t35] });
|
|
416
|
+
$[72] = t33;
|
|
417
|
+
$[73] = t35;
|
|
418
|
+
$[74] = t36;
|
|
419
|
+
} else t36 = $[74];
|
|
420
|
+
let t37;
|
|
421
|
+
if ($[75] !== t32 || $[76] !== t36) {
|
|
422
|
+
t37 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t32, t36] });
|
|
423
|
+
$[75] = t32;
|
|
424
|
+
$[76] = t36;
|
|
425
|
+
$[77] = t37;
|
|
426
|
+
} else t37 = $[77];
|
|
427
|
+
let t38;
|
|
428
|
+
if ($[78] !== isDiscardDialogOpen || $[79] !== t37) {
|
|
429
|
+
t38 = /* @__PURE__ */ jsx(AlertDialog, {
|
|
496
430
|
open: isDiscardDialogOpen,
|
|
497
431
|
onOpenChange: setIsDiscardDialogOpen,
|
|
498
|
-
children:
|
|
432
|
+
children: t37
|
|
499
433
|
});
|
|
500
|
-
$[
|
|
501
|
-
$[
|
|
502
|
-
$[
|
|
503
|
-
} else
|
|
504
|
-
let
|
|
505
|
-
if ($[
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
434
|
+
$[78] = isDiscardDialogOpen;
|
|
435
|
+
$[79] = t37;
|
|
436
|
+
$[80] = t38;
|
|
437
|
+
} else t38 = $[80];
|
|
438
|
+
let t39;
|
|
439
|
+
if ($[81] !== t19 || $[82] !== t21 || $[83] !== t30 || $[84] !== t38) {
|
|
440
|
+
t39 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
441
|
+
t19,
|
|
442
|
+
t21,
|
|
443
|
+
t30,
|
|
444
|
+
t38
|
|
511
445
|
] });
|
|
512
|
-
$[
|
|
513
|
-
$[
|
|
514
|
-
$[
|
|
515
|
-
$[
|
|
516
|
-
$[
|
|
517
|
-
} else
|
|
518
|
-
return
|
|
446
|
+
$[81] = t19;
|
|
447
|
+
$[82] = t21;
|
|
448
|
+
$[83] = t30;
|
|
449
|
+
$[84] = t38;
|
|
450
|
+
$[85] = t39;
|
|
451
|
+
} else t39 = $[85];
|
|
452
|
+
return t39;
|
|
519
453
|
};
|
|
520
454
|
const PageNavigatorSidebar = (t0) => {
|
|
521
455
|
const $ = c(8);
|
|
522
|
-
if ($[0] !== "
|
|
456
|
+
if ($[0] !== "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c") {
|
|
523
457
|
for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
524
|
-
$[0] = "
|
|
458
|
+
$[0] = "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c";
|
|
525
459
|
}
|
|
526
460
|
const { page } = t0;
|
|
527
461
|
let t1;
|
|
@@ -579,12 +513,6 @@ function _temp3(current) {
|
|
|
579
513
|
}
|
|
580
514
|
} : current;
|
|
581
515
|
}
|
|
582
|
-
function _temp4(checked) {
|
|
583
|
-
return previewStore.send({
|
|
584
|
-
type: "setPreviewSource",
|
|
585
|
-
source: checked ? "draft" : "live"
|
|
586
|
-
});
|
|
587
|
-
}
|
|
588
516
|
|
|
589
517
|
//#endregion
|
|
590
518
|
export { PageNavigatorSidebar };
|