camox 0.35.0 → 0.36.1

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.
@@ -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(102);
31
- if ($[0] !== "a5c20885a61abde1950615d7a7429cbcd798dd8fc1df8fe6d4416f9d12ca4827") {
32
- for (let $i = 0; $i < 102; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
33
- $[0] = "a5c20885a61abde1950615d7a7429cbcd798dd8fc1df8fe6d4416f9d12ca4827";
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 t4;
80
- if ($[9] !== page.modifiedReason) {
81
- t4 = page.modifiedReason && (page.modifiedReason.reason === "layout" || page.modifiedReason.reason === "both") ? {
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
- $[9] = page.modifiedReason;
86
- $[10] = t4;
87
- } else t4 = $[10];
88
- const layoutCascade = t4;
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
- let t6;
92
- if ($[11] !== canDiscardChanges || $[12] !== canPublish || $[13] !== discardChanges.isPending || $[14] !== hasLiveCheckpoint || $[15] !== isHomePage || $[16] !== publishLabel || $[17] !== unpublishPage.isPending) {
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
- t6 = [
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
- $[11] = canDiscardChanges;
151
- $[12] = canPublish;
152
- $[13] = discardChanges.isPending;
153
- $[14] = hasLiveCheckpoint;
154
- $[15] = isHomePage;
155
- $[16] = publishLabel;
156
- $[17] = unpublishPage.isPending;
157
- $[18] = t5;
158
- $[19] = t6;
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
- t5 = $[18];
161
- t6 = $[19];
135
+ t4 = $[12];
136
+ t5 = $[13];
162
137
  }
163
- React.useEffect(t5, t6);
164
- let t7;
165
- if ($[20] !== isHomePage || $[21] !== page.id || $[22] !== pathname || $[23] !== queryClient || $[24] !== unpublishPage) {
166
- t7 = async () => {
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 (t8) {
185
- console.error("Failed to unpublish page:", t8);
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
- $[20] = isHomePage;
190
- $[21] = page.id;
191
- $[22] = pathname;
192
- $[23] = queryClient;
193
- $[24] = unpublishPage;
194
- $[25] = t7;
195
- } else t7 = $[25];
196
- const handleUnpublish = t7;
197
- let t8;
198
- if ($[26] !== discardChanges || $[27] !== page.id) {
199
- t8 = async () => {
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 (t9) {
210
- console.error("Failed to discard page changes:", t9);
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
- $[26] = discardChanges;
215
- $[27] = page.id;
216
- $[28] = t8;
217
- } else t8 = $[28];
218
- const handleDiscardChanges = t8;
219
- const t9 = !canPublish;
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 ($[29] === Symbol.for("react.memo_cache_sentinel")) {
222
- t10 = () => setIsPublishDialogOpen(true);
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: t9,
231
- onClick: t10,
205
+ disabled: t8,
206
+ onClick: t9,
232
207
  className: "flex-1",
233
208
  children: publishLabel
234
209
  });
235
- $[30] = publishLabel;
236
- $[31] = t9;
237
- $[32] = t11;
238
- } else t11 = $[32];
239
- let t12;
240
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
241
- t12 = /* @__PURE__ */ jsx(DropdownMenuTrigger, {
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
- $[33] = t12;
251
- } else t12 = $[33];
252
- const t13 = !hasLiveCheckpoint || isHomePage || unpublishPage.isPending;
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 ($[34] === Symbol.for("react.memo_cache_sentinel")) {
255
- t14 = () => setIsUnpublishDialogOpen(true);
256
- $[34] = t14;
257
- } else t14 = $[34];
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
- $[35] = t13;
266
- $[36] = t15;
267
- } else t15 = $[36];
268
- const t16 = !canDiscardChanges || discardChanges.isPending;
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 ($[37] === Symbol.for("react.memo_cache_sentinel")) {
271
- t17 = () => setIsDiscardDialogOpen(true);
272
- $[37] = t17;
273
- } else t17 = $[37];
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
- $[38] = t16;
282
- $[39] = t18;
283
- } else t18 = $[39];
284
- let t19;
285
- if ($[40] !== t15 || $[41] !== t18) {
286
- t19 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t12, /* @__PURE__ */ jsxs(DropdownMenuContent, {
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: [t15, t18]
264
+ children: [t14, t17]
290
265
  })] });
291
- $[40] = t15;
292
- $[41] = t18;
293
- $[42] = t19;
294
- } else t19 = $[42];
295
- let t20;
296
- if ($[43] !== t11 || $[44] !== t19) {
297
- t20 = /* @__PURE__ */ jsxs(ButtonGroup, {
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: [t20, t25]
274
+ children: /* @__PURE__ */ jsxs(ButtonGroup, {
275
+ className: "w-full",
276
+ children: [t10, t18]
277
+ })
344
278
  });
345
- $[53] = t20;
346
- $[54] = t25;
347
- $[55] = t26;
348
- } else t26 = $[55];
349
- const t27 = isPublishDialogOpen ? page : null;
350
- let t28;
351
- if ($[56] !== isPublishDialogOpen || $[57] !== layoutCascade || $[58] !== page.status || $[59] !== t27) {
352
- t28 = /* @__PURE__ */ jsx(PublishDialog, {
353
- page: t27,
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
- $[56] = isPublishDialogOpen;
360
- $[57] = layoutCascade;
361
- $[58] = page.status;
362
- $[59] = t27;
363
- $[60] = t28;
364
- } else t28 = $[60];
365
- let t29;
366
- if ($[61] === Symbol.for("react.memo_cache_sentinel")) {
367
- t29 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unpublish page" });
368
- $[61] = t29;
369
- } else t29 = $[61];
370
- let t30;
371
- if ($[62] !== page.fullPath) {
372
- t30 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t29, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
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
- $[62] = page.fullPath;
383
- $[63] = t30;
384
- } else t30 = $[63];
385
- let t31;
386
- if ($[64] !== unpublishPage.isPending) {
387
- t31 = /* @__PURE__ */ jsx(AlertDialogCancel, {
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
- $[64] = unpublishPage.isPending;
394
- $[65] = t31;
395
- } else t31 = $[65];
396
- const t32 = isHomePage || unpublishPage.isPending;
397
- const t33 = unpublishPage.isPending ? "Unpublishing…" : "Unpublish";
398
- let t34;
399
- if ($[66] !== handleUnpublish || $[67] !== t32 || $[68] !== t33) {
400
- t34 = /* @__PURE__ */ jsx(AlertDialogAction, {
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: t32,
403
- children: t33
336
+ disabled: t25,
337
+ children: t26
404
338
  });
405
- $[66] = handleUnpublish;
406
- $[67] = t32;
407
- $[68] = t33;
408
- $[69] = t34;
409
- } else t34 = $[69];
410
- let t35;
411
- if ($[70] !== t31 || $[71] !== t34) {
412
- t35 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t31, t34] });
413
- $[70] = t31;
414
- $[71] = t34;
415
- $[72] = t35;
416
- } else t35 = $[72];
417
- let t36;
418
- if ($[73] !== t30 || $[74] !== t35) {
419
- t36 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t30, t35] });
420
- $[73] = t30;
421
- $[74] = t35;
422
- $[75] = t36;
423
- } else t36 = $[75];
424
- let t37;
425
- if ($[76] !== isUnpublishDialogOpen || $[77] !== t36) {
426
- t37 = /* @__PURE__ */ jsx(AlertDialog, {
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: t36
363
+ children: t29
430
364
  });
431
- $[76] = isUnpublishDialogOpen;
432
- $[77] = t36;
433
- $[78] = t37;
434
- } else t37 = $[78];
435
- let t38;
436
- if ($[79] === Symbol.for("react.memo_cache_sentinel")) {
437
- t38 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Discard draft changes" });
438
- $[79] = t38;
439
- } else t38 = $[79];
440
- let t39;
441
- if ($[80] !== page.fullPath) {
442
- t39 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t38, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
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
- $[80] = page.fullPath;
453
- $[81] = t39;
454
- } else t39 = $[81];
455
- let t40;
456
- if ($[82] !== discardChanges.isPending) {
457
- t40 = /* @__PURE__ */ jsx(AlertDialogCancel, {
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
- $[82] = discardChanges.isPending;
464
- $[83] = t40;
465
- } else t40 = $[83];
466
- const t41 = discardChanges.isPending ? "Discarding…" : "Discard changes";
467
- let t42;
468
- if ($[84] !== discardChanges.isPending || $[85] !== handleDiscardChanges || $[86] !== t41) {
469
- t42 = /* @__PURE__ */ jsx(AlertDialogAction, {
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: t41
406
+ children: t34
473
407
  });
474
- $[84] = discardChanges.isPending;
475
- $[85] = handleDiscardChanges;
476
- $[86] = t41;
477
- $[87] = t42;
478
- } else t42 = $[87];
479
- let t43;
480
- if ($[88] !== t40 || $[89] !== t42) {
481
- t43 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t40, t42] });
482
- $[88] = t40;
483
- $[89] = t42;
484
- $[90] = t43;
485
- } else t43 = $[90];
486
- let t44;
487
- if ($[91] !== t39 || $[92] !== t43) {
488
- t44 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t39, t43] });
489
- $[91] = t39;
490
- $[92] = t43;
491
- $[93] = t44;
492
- } else t44 = $[93];
493
- let t45;
494
- if ($[94] !== isDiscardDialogOpen || $[95] !== t44) {
495
- t45 = /* @__PURE__ */ jsx(AlertDialog, {
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: t44
432
+ children: t37
499
433
  });
500
- $[94] = isDiscardDialogOpen;
501
- $[95] = t44;
502
- $[96] = t45;
503
- } else t45 = $[96];
504
- let t46;
505
- if ($[97] !== t26 || $[98] !== t28 || $[99] !== t37 || $[100] !== t45) {
506
- t46 = /* @__PURE__ */ jsxs(Fragment, { children: [
507
- t26,
508
- t28,
509
- t37,
510
- t45
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
- $[97] = t26;
513
- $[98] = t28;
514
- $[99] = t37;
515
- $[100] = t45;
516
- $[101] = t46;
517
- } else t46 = $[101];
518
- return t46;
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] !== "a5c20885a61abde1950615d7a7429cbcd798dd8fc1df8fe6d4416f9d12ca4827") {
456
+ if ($[0] !== "58005eef0d61f3afd8b013b7c48c297a3232450e2bc7cede8029a7249f17fd1c") {
523
457
  for (let $i = 0; $i < 8; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
524
- $[0] = "a5c20885a61abde1950615d7a7429cbcd798dd8fc1df8fe6d4416f9d12ca4827";
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 };