camox 0.28.0 → 0.28.2
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.
|
@@ -86,9 +86,9 @@ function pageFullQueryFn(queryClient, path, projectSlug, source) {
|
|
|
86
86
|
}
|
|
87
87
|
function usePreviewedPage() {
|
|
88
88
|
const $ = c(26);
|
|
89
|
-
if ($[0] !== "
|
|
89
|
+
if ($[0] !== "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888") {
|
|
90
90
|
for (let $i = 0; $i < 26; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
91
|
-
$[0] = "
|
|
91
|
+
$[0] = "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888";
|
|
92
92
|
}
|
|
93
93
|
const { pathname } = useLocation();
|
|
94
94
|
const queryClient = useQueryClient();
|
|
@@ -185,9 +185,9 @@ function _temp(state) {
|
|
|
185
185
|
}
|
|
186
186
|
const BlockRenderer = (t0) => {
|
|
187
187
|
const $ = c(23);
|
|
188
|
-
if ($[0] !== "
|
|
188
|
+
if ($[0] !== "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888") {
|
|
189
189
|
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
190
|
-
$[0] = "
|
|
190
|
+
$[0] = "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888";
|
|
191
191
|
}
|
|
192
192
|
const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
|
|
193
193
|
const previewSource = useSelector(previewStore, _temp3);
|
|
@@ -329,10 +329,10 @@ const PageContent = () => {
|
|
|
329
329
|
});
|
|
330
330
|
};
|
|
331
331
|
const SidebarPublishRow = (t0) => {
|
|
332
|
-
const $ = c(
|
|
333
|
-
if ($[0] !== "
|
|
334
|
-
for (let $i = 0; $i <
|
|
335
|
-
$[0] = "
|
|
332
|
+
const $ = c(102);
|
|
333
|
+
if ($[0] !== "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888") {
|
|
334
|
+
for (let $i = 0; $i < 102; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
335
|
+
$[0] = "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888";
|
|
336
336
|
}
|
|
337
337
|
const { page } = t0;
|
|
338
338
|
const previewSource = useSelector(previewStore, _temp4);
|
|
@@ -355,6 +355,7 @@ const SidebarPublishRow = (t0) => {
|
|
|
355
355
|
} else t2 = $[2];
|
|
356
356
|
const discardChanges = useMutation(t2);
|
|
357
357
|
const hasLiveCheckpoint = page.livePublishedCheckpointId != null;
|
|
358
|
+
const isHomePage = page.fullPath === "/";
|
|
358
359
|
const otherSource = previewSource === "draft" ? "live" : "draft";
|
|
359
360
|
const canPrefetchOther = otherSource === "draft" || hasLiveCheckpoint;
|
|
360
361
|
let t3;
|
|
@@ -390,7 +391,7 @@ const SidebarPublishRow = (t0) => {
|
|
|
390
391
|
const publishLabel = page.status === "modified" ? "Publish changes" : "Publish page";
|
|
391
392
|
let t5;
|
|
392
393
|
let t6;
|
|
393
|
-
if ($[11] !== canDiscardChanges || $[12] !== canPublish || $[13] !== discardChanges.isPending || $[14] !== hasLiveCheckpoint || $[15] !==
|
|
394
|
+
if ($[11] !== canDiscardChanges || $[12] !== canPublish || $[13] !== discardChanges.isPending || $[14] !== hasLiveCheckpoint || $[15] !== isHomePage || $[16] !== publishLabel || $[17] !== unpublishPage.isPending) {
|
|
394
395
|
t5 = () => {
|
|
395
396
|
const actions = [
|
|
396
397
|
{
|
|
@@ -404,7 +405,7 @@ const SidebarPublishRow = (t0) => {
|
|
|
404
405
|
id: "unpublish-current-page",
|
|
405
406
|
label: "Unpublish page",
|
|
406
407
|
groupLabel: "Preview",
|
|
407
|
-
checkIfAvailable: () => hasLiveCheckpoint && !unpublishPage.isPending,
|
|
408
|
+
checkIfAvailable: () => hasLiveCheckpoint && !isHomePage && !unpublishPage.isPending,
|
|
408
409
|
execute: () => setIsUnpublishDialogOpen(true)
|
|
409
410
|
},
|
|
410
411
|
{
|
|
@@ -431,6 +432,7 @@ const SidebarPublishRow = (t0) => {
|
|
|
431
432
|
canPublish,
|
|
432
433
|
discardChanges.isPending,
|
|
433
434
|
hasLiveCheckpoint,
|
|
435
|
+
isHomePage,
|
|
434
436
|
publishLabel,
|
|
435
437
|
unpublishPage.isPending
|
|
436
438
|
];
|
|
@@ -438,18 +440,20 @@ const SidebarPublishRow = (t0) => {
|
|
|
438
440
|
$[12] = canPublish;
|
|
439
441
|
$[13] = discardChanges.isPending;
|
|
440
442
|
$[14] = hasLiveCheckpoint;
|
|
441
|
-
$[15] =
|
|
442
|
-
$[16] =
|
|
443
|
-
$[17] =
|
|
444
|
-
$[18] =
|
|
443
|
+
$[15] = isHomePage;
|
|
444
|
+
$[16] = publishLabel;
|
|
445
|
+
$[17] = unpublishPage.isPending;
|
|
446
|
+
$[18] = t5;
|
|
447
|
+
$[19] = t6;
|
|
445
448
|
} else {
|
|
446
|
-
t5 = $[
|
|
447
|
-
t6 = $[
|
|
449
|
+
t5 = $[18];
|
|
450
|
+
t6 = $[19];
|
|
448
451
|
}
|
|
449
452
|
React.useEffect(t5, t6);
|
|
450
453
|
let t7;
|
|
451
|
-
if ($[
|
|
454
|
+
if ($[20] !== isHomePage || $[21] !== page.id || $[22] !== pathname || $[23] !== queryClient || $[24] !== unpublishPage) {
|
|
452
455
|
t7 = async () => {
|
|
456
|
+
if (isHomePage) return;
|
|
453
457
|
try {
|
|
454
458
|
await unpublishPage.mutateAsync({ id: page.id });
|
|
455
459
|
queryClient.setQueryData(queryKeys.pages.getByPath(pathname, "draft"), _temp6);
|
|
@@ -471,15 +475,16 @@ const SidebarPublishRow = (t0) => {
|
|
|
471
475
|
toast.error("Could not unpublish this page");
|
|
472
476
|
}
|
|
473
477
|
};
|
|
474
|
-
$[
|
|
475
|
-
$[
|
|
476
|
-
$[
|
|
477
|
-
$[
|
|
478
|
-
$[
|
|
479
|
-
|
|
478
|
+
$[20] = isHomePage;
|
|
479
|
+
$[21] = page.id;
|
|
480
|
+
$[22] = pathname;
|
|
481
|
+
$[23] = queryClient;
|
|
482
|
+
$[24] = unpublishPage;
|
|
483
|
+
$[25] = t7;
|
|
484
|
+
} else t7 = $[25];
|
|
480
485
|
const handleUnpublish = t7;
|
|
481
486
|
let t8;
|
|
482
|
-
if ($[
|
|
487
|
+
if ($[26] !== discardChanges || $[27] !== page.id) {
|
|
483
488
|
t8 = async () => {
|
|
484
489
|
try {
|
|
485
490
|
await discardChanges.mutateAsync({ id: page.id });
|
|
@@ -495,19 +500,19 @@ const SidebarPublishRow = (t0) => {
|
|
|
495
500
|
toast.error("Could not discard draft changes");
|
|
496
501
|
}
|
|
497
502
|
};
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
} else t8 = $[
|
|
503
|
+
$[26] = discardChanges;
|
|
504
|
+
$[27] = page.id;
|
|
505
|
+
$[28] = t8;
|
|
506
|
+
} else t8 = $[28];
|
|
502
507
|
const handleDiscardChanges = t8;
|
|
503
508
|
const t9 = !canPublish;
|
|
504
509
|
let t10;
|
|
505
|
-
if ($[
|
|
510
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
506
511
|
t10 = () => setIsPublishDialogOpen(true);
|
|
507
|
-
$[
|
|
508
|
-
} else t10 = $[
|
|
512
|
+
$[29] = t10;
|
|
513
|
+
} else t10 = $[29];
|
|
509
514
|
let t11;
|
|
510
|
-
if ($[
|
|
515
|
+
if ($[30] !== publishLabel || $[31] !== t9) {
|
|
511
516
|
t11 = /* @__PURE__ */ jsx(Button, {
|
|
512
517
|
variant: "outline",
|
|
513
518
|
type: "button",
|
|
@@ -516,12 +521,12 @@ const SidebarPublishRow = (t0) => {
|
|
|
516
521
|
className: "flex-1",
|
|
517
522
|
children: publishLabel
|
|
518
523
|
});
|
|
519
|
-
$[
|
|
520
|
-
$[
|
|
521
|
-
$[
|
|
522
|
-
} else t11 = $[
|
|
524
|
+
$[30] = publishLabel;
|
|
525
|
+
$[31] = t9;
|
|
526
|
+
$[32] = t11;
|
|
527
|
+
} else t11 = $[32];
|
|
523
528
|
let t12;
|
|
524
|
-
if ($[
|
|
529
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
525
530
|
t12 = /* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
526
531
|
render: /* @__PURE__ */ jsx(Button, {
|
|
527
532
|
type: "button",
|
|
@@ -531,108 +536,108 @@ const SidebarPublishRow = (t0) => {
|
|
|
531
536
|
}),
|
|
532
537
|
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "text-muted-foreground" })
|
|
533
538
|
});
|
|
534
|
-
$[
|
|
535
|
-
} else t12 = $[
|
|
536
|
-
const t13 = !hasLiveCheckpoint || unpublishPage.isPending;
|
|
539
|
+
$[33] = t12;
|
|
540
|
+
} else t12 = $[33];
|
|
541
|
+
const t13 = !hasLiveCheckpoint || isHomePage || unpublishPage.isPending;
|
|
537
542
|
let t14;
|
|
538
|
-
if ($[
|
|
543
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
539
544
|
t14 = () => setIsUnpublishDialogOpen(true);
|
|
540
|
-
$[
|
|
541
|
-
} else t14 = $[
|
|
545
|
+
$[34] = t14;
|
|
546
|
+
} else t14 = $[34];
|
|
542
547
|
let t15;
|
|
543
|
-
if ($[
|
|
548
|
+
if ($[35] !== t13) {
|
|
544
549
|
t15 = /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
545
550
|
disabled: t13,
|
|
546
551
|
onClick: t14,
|
|
547
552
|
children: "Unpublish"
|
|
548
553
|
});
|
|
549
|
-
$[
|
|
550
|
-
$[
|
|
551
|
-
} else t15 = $[
|
|
554
|
+
$[35] = t13;
|
|
555
|
+
$[36] = t15;
|
|
556
|
+
} else t15 = $[36];
|
|
552
557
|
const t16 = !canDiscardChanges || discardChanges.isPending;
|
|
553
558
|
let t17;
|
|
554
|
-
if ($[
|
|
559
|
+
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
|
555
560
|
t17 = () => setIsDiscardDialogOpen(true);
|
|
556
|
-
$[
|
|
557
|
-
} else t17 = $[
|
|
561
|
+
$[37] = t17;
|
|
562
|
+
} else t17 = $[37];
|
|
558
563
|
let t18;
|
|
559
|
-
if ($[
|
|
564
|
+
if ($[38] !== t16) {
|
|
560
565
|
t18 = /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
561
566
|
disabled: t16,
|
|
562
567
|
onClick: t17,
|
|
563
568
|
children: "Discard changes"
|
|
564
569
|
});
|
|
565
|
-
$[
|
|
566
|
-
$[
|
|
567
|
-
} else t18 = $[
|
|
570
|
+
$[38] = t16;
|
|
571
|
+
$[39] = t18;
|
|
572
|
+
} else t18 = $[39];
|
|
568
573
|
let t19;
|
|
569
|
-
if ($[
|
|
574
|
+
if ($[40] !== t15 || $[41] !== t18) {
|
|
570
575
|
t19 = /* @__PURE__ */ jsxs(DropdownMenu, { children: [t12, /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
571
576
|
align: "end",
|
|
572
577
|
className: "w-42",
|
|
573
578
|
children: [t15, t18]
|
|
574
579
|
})] });
|
|
575
|
-
$[
|
|
576
|
-
$[
|
|
577
|
-
$[
|
|
578
|
-
} else t19 = $[
|
|
580
|
+
$[40] = t15;
|
|
581
|
+
$[41] = t18;
|
|
582
|
+
$[42] = t19;
|
|
583
|
+
} else t19 = $[42];
|
|
579
584
|
let t20;
|
|
580
|
-
if ($[
|
|
585
|
+
if ($[43] !== t11 || $[44] !== t19) {
|
|
581
586
|
t20 = /* @__PURE__ */ jsxs(ButtonGroup, {
|
|
582
587
|
className: "w-full",
|
|
583
588
|
children: [t11, t19]
|
|
584
589
|
});
|
|
585
|
-
$[
|
|
586
|
-
$[
|
|
587
|
-
$[
|
|
588
|
-
} else t20 = $[
|
|
590
|
+
$[43] = t11;
|
|
591
|
+
$[44] = t19;
|
|
592
|
+
$[45] = t20;
|
|
593
|
+
} else t20 = $[45];
|
|
589
594
|
const t21 = !hasLiveCheckpoint;
|
|
590
595
|
const t22 = previewSource === "draft";
|
|
591
596
|
let t23;
|
|
592
|
-
if ($[
|
|
597
|
+
if ($[46] !== t21 || $[47] !== t22) {
|
|
593
598
|
t23 = /* @__PURE__ */ jsx(Switch, {
|
|
594
599
|
id: "draft-content",
|
|
595
600
|
disabled: t21,
|
|
596
601
|
checked: t22,
|
|
597
602
|
onCheckedChange: _temp7
|
|
598
603
|
});
|
|
599
|
-
$[
|
|
600
|
-
$[
|
|
601
|
-
$[
|
|
602
|
-
} else t23 = $[
|
|
604
|
+
$[46] = t21;
|
|
605
|
+
$[47] = t22;
|
|
606
|
+
$[48] = t23;
|
|
607
|
+
} else t23 = $[48];
|
|
603
608
|
let t24;
|
|
604
|
-
if ($[
|
|
609
|
+
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
605
610
|
t24 = /* @__PURE__ */ jsx(Label, {
|
|
606
611
|
htmlFor: "draft-content",
|
|
607
612
|
children: "Draft content"
|
|
608
613
|
});
|
|
609
|
-
$[
|
|
610
|
-
} else t24 = $[
|
|
614
|
+
$[49] = t24;
|
|
615
|
+
} else t24 = $[49];
|
|
611
616
|
let t25;
|
|
612
|
-
if ($[
|
|
617
|
+
if ($[50] !== prefetchOtherSource || $[51] !== t23) {
|
|
613
618
|
t25 = /* @__PURE__ */ jsxs("div", {
|
|
614
619
|
className: "mt-1 flex items-center gap-2",
|
|
615
620
|
onMouseEnter: prefetchOtherSource,
|
|
616
621
|
onFocus: prefetchOtherSource,
|
|
617
622
|
children: [t23, t24]
|
|
618
623
|
});
|
|
619
|
-
$[
|
|
620
|
-
$[
|
|
621
|
-
$[
|
|
622
|
-
} else t25 = $[
|
|
624
|
+
$[50] = prefetchOtherSource;
|
|
625
|
+
$[51] = t23;
|
|
626
|
+
$[52] = t25;
|
|
627
|
+
} else t25 = $[52];
|
|
623
628
|
let t26;
|
|
624
|
-
if ($[
|
|
629
|
+
if ($[53] !== t20 || $[54] !== t25) {
|
|
625
630
|
t26 = /* @__PURE__ */ jsxs("div", {
|
|
626
631
|
className: "flex flex-col gap-2",
|
|
627
632
|
children: [t20, t25]
|
|
628
633
|
});
|
|
629
|
-
$[
|
|
630
|
-
$[
|
|
631
|
-
$[
|
|
632
|
-
} else t26 = $[
|
|
634
|
+
$[53] = t20;
|
|
635
|
+
$[54] = t25;
|
|
636
|
+
$[55] = t26;
|
|
637
|
+
} else t26 = $[55];
|
|
633
638
|
const t27 = isPublishDialogOpen ? page : null;
|
|
634
639
|
let t28;
|
|
635
|
-
if ($[
|
|
640
|
+
if ($[56] !== isPublishDialogOpen || $[57] !== layoutCascade || $[58] !== page.status || $[59] !== t27) {
|
|
636
641
|
t28 = /* @__PURE__ */ jsx(PublishDialog, {
|
|
637
642
|
page: t27,
|
|
638
643
|
pageStatus: page.status,
|
|
@@ -640,19 +645,19 @@ const SidebarPublishRow = (t0) => {
|
|
|
640
645
|
open: isPublishDialogOpen,
|
|
641
646
|
onOpenChange: setIsPublishDialogOpen
|
|
642
647
|
});
|
|
643
|
-
$[
|
|
644
|
-
$[
|
|
645
|
-
$[
|
|
646
|
-
$[
|
|
647
|
-
$[
|
|
648
|
-
} else t28 = $[
|
|
648
|
+
$[56] = isPublishDialogOpen;
|
|
649
|
+
$[57] = layoutCascade;
|
|
650
|
+
$[58] = page.status;
|
|
651
|
+
$[59] = t27;
|
|
652
|
+
$[60] = t28;
|
|
653
|
+
} else t28 = $[60];
|
|
649
654
|
let t29;
|
|
650
|
-
if ($[
|
|
655
|
+
if ($[61] === Symbol.for("react.memo_cache_sentinel")) {
|
|
651
656
|
t29 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Unpublish page" });
|
|
652
|
-
$[
|
|
653
|
-
} else t29 = $[
|
|
657
|
+
$[61] = t29;
|
|
658
|
+
} else t29 = $[61];
|
|
654
659
|
let t30;
|
|
655
|
-
if ($[
|
|
660
|
+
if ($[62] !== page.fullPath) {
|
|
656
661
|
t30 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t29, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
|
|
657
662
|
"Visitors at",
|
|
658
663
|
" ",
|
|
@@ -663,66 +668,67 @@ const SidebarPublishRow = (t0) => {
|
|
|
663
668
|
" ",
|
|
664
669
|
"will get a 404. The draft stays available in Camox Studio."
|
|
665
670
|
] })] });
|
|
666
|
-
$[
|
|
667
|
-
$[
|
|
668
|
-
} else t30 = $[
|
|
671
|
+
$[62] = page.fullPath;
|
|
672
|
+
$[63] = t30;
|
|
673
|
+
} else t30 = $[63];
|
|
669
674
|
let t31;
|
|
670
|
-
if ($[
|
|
675
|
+
if ($[64] !== unpublishPage.isPending) {
|
|
671
676
|
t31 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
672
677
|
variant: "outline",
|
|
673
678
|
size: "default",
|
|
674
679
|
disabled: unpublishPage.isPending,
|
|
675
680
|
children: "Cancel"
|
|
676
681
|
});
|
|
677
|
-
$[
|
|
678
|
-
$[
|
|
679
|
-
} else t31 = $[
|
|
680
|
-
const t32 = unpublishPage.isPending
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
682
|
+
$[64] = unpublishPage.isPending;
|
|
683
|
+
$[65] = t31;
|
|
684
|
+
} else t31 = $[65];
|
|
685
|
+
const t32 = isHomePage || unpublishPage.isPending;
|
|
686
|
+
const t33 = unpublishPage.isPending ? "Unpublishing…" : "Unpublish";
|
|
687
|
+
let t34;
|
|
688
|
+
if ($[66] !== handleUnpublish || $[67] !== t32 || $[68] !== t33) {
|
|
689
|
+
t34 = /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
684
690
|
onClick: handleUnpublish,
|
|
685
|
-
disabled:
|
|
686
|
-
children:
|
|
691
|
+
disabled: t32,
|
|
692
|
+
children: t33
|
|
687
693
|
});
|
|
688
|
-
$[
|
|
689
|
-
$[
|
|
690
|
-
$[
|
|
691
|
-
$[
|
|
692
|
-
} else
|
|
693
|
-
let t34;
|
|
694
|
-
if ($[68] !== t31 || $[69] !== t33) {
|
|
695
|
-
t34 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t31, t33] });
|
|
696
|
-
$[68] = t31;
|
|
697
|
-
$[69] = t33;
|
|
698
|
-
$[70] = t34;
|
|
699
|
-
} else t34 = $[70];
|
|
694
|
+
$[66] = handleUnpublish;
|
|
695
|
+
$[67] = t32;
|
|
696
|
+
$[68] = t33;
|
|
697
|
+
$[69] = t34;
|
|
698
|
+
} else t34 = $[69];
|
|
700
699
|
let t35;
|
|
701
|
-
if ($[
|
|
702
|
-
t35 = /* @__PURE__ */ jsxs(
|
|
703
|
-
$[
|
|
704
|
-
$[
|
|
705
|
-
$[
|
|
706
|
-
} else t35 = $[
|
|
700
|
+
if ($[70] !== t31 || $[71] !== t34) {
|
|
701
|
+
t35 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t31, t34] });
|
|
702
|
+
$[70] = t31;
|
|
703
|
+
$[71] = t34;
|
|
704
|
+
$[72] = t35;
|
|
705
|
+
} else t35 = $[72];
|
|
707
706
|
let t36;
|
|
708
|
-
if ($[
|
|
709
|
-
t36 = /* @__PURE__ */
|
|
707
|
+
if ($[73] !== t30 || $[74] !== t35) {
|
|
708
|
+
t36 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t30, t35] });
|
|
709
|
+
$[73] = t30;
|
|
710
|
+
$[74] = t35;
|
|
711
|
+
$[75] = t36;
|
|
712
|
+
} else t36 = $[75];
|
|
713
|
+
let t37;
|
|
714
|
+
if ($[76] !== isUnpublishDialogOpen || $[77] !== t36) {
|
|
715
|
+
t37 = /* @__PURE__ */ jsx(AlertDialog, {
|
|
710
716
|
open: isUnpublishDialogOpen,
|
|
711
717
|
onOpenChange: setIsUnpublishDialogOpen,
|
|
712
|
-
children:
|
|
718
|
+
children: t36
|
|
713
719
|
});
|
|
714
|
-
$[
|
|
715
|
-
$[
|
|
716
|
-
$[
|
|
717
|
-
} else
|
|
718
|
-
let t37;
|
|
719
|
-
if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
|
|
720
|
-
t37 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Discard draft changes" });
|
|
721
|
-
$[77] = t37;
|
|
722
|
-
} else t37 = $[77];
|
|
720
|
+
$[76] = isUnpublishDialogOpen;
|
|
721
|
+
$[77] = t36;
|
|
722
|
+
$[78] = t37;
|
|
723
|
+
} else t37 = $[78];
|
|
723
724
|
let t38;
|
|
724
|
-
if ($[
|
|
725
|
-
t38 = /* @__PURE__ */
|
|
725
|
+
if ($[79] === Symbol.for("react.memo_cache_sentinel")) {
|
|
726
|
+
t38 = /* @__PURE__ */ jsx(AlertDialogTitle, { children: "Discard draft changes" });
|
|
727
|
+
$[79] = t38;
|
|
728
|
+
} else t38 = $[79];
|
|
729
|
+
let t39;
|
|
730
|
+
if ($[80] !== page.fullPath) {
|
|
731
|
+
t39 = /* @__PURE__ */ jsxs(AlertDialogHeader, { children: [t38, /* @__PURE__ */ jsxs(AlertDialogDescription, { children: [
|
|
726
732
|
"The draft for",
|
|
727
733
|
" ",
|
|
728
734
|
/* @__PURE__ */ jsx("code", {
|
|
@@ -732,79 +738,79 @@ const SidebarPublishRow = (t0) => {
|
|
|
732
738
|
" ",
|
|
733
739
|
"will be reset to match the currently published version. This does not change what visitors see."
|
|
734
740
|
] })] });
|
|
735
|
-
$[
|
|
736
|
-
$[
|
|
737
|
-
} else
|
|
738
|
-
let
|
|
739
|
-
if ($[
|
|
740
|
-
|
|
741
|
+
$[80] = page.fullPath;
|
|
742
|
+
$[81] = t39;
|
|
743
|
+
} else t39 = $[81];
|
|
744
|
+
let t40;
|
|
745
|
+
if ($[82] !== discardChanges.isPending) {
|
|
746
|
+
t40 = /* @__PURE__ */ jsx(AlertDialogCancel, {
|
|
741
747
|
variant: "outline",
|
|
742
748
|
size: "default",
|
|
743
749
|
disabled: discardChanges.isPending,
|
|
744
750
|
children: "Cancel"
|
|
745
751
|
});
|
|
746
|
-
$[
|
|
747
|
-
$[
|
|
748
|
-
} else
|
|
749
|
-
const
|
|
750
|
-
let
|
|
751
|
-
if ($[
|
|
752
|
-
|
|
752
|
+
$[82] = discardChanges.isPending;
|
|
753
|
+
$[83] = t40;
|
|
754
|
+
} else t40 = $[83];
|
|
755
|
+
const t41 = discardChanges.isPending ? "Discarding…" : "Discard changes";
|
|
756
|
+
let t42;
|
|
757
|
+
if ($[84] !== discardChanges.isPending || $[85] !== handleDiscardChanges || $[86] !== t41) {
|
|
758
|
+
t42 = /* @__PURE__ */ jsx(AlertDialogAction, {
|
|
753
759
|
onClick: handleDiscardChanges,
|
|
754
760
|
disabled: discardChanges.isPending,
|
|
755
|
-
children:
|
|
761
|
+
children: t41
|
|
756
762
|
});
|
|
757
|
-
$[
|
|
758
|
-
$[
|
|
759
|
-
$[
|
|
760
|
-
$[
|
|
761
|
-
} else
|
|
762
|
-
let t42;
|
|
763
|
-
if ($[86] !== t39 || $[87] !== t41) {
|
|
764
|
-
t42 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t39, t41] });
|
|
765
|
-
$[86] = t39;
|
|
766
|
-
$[87] = t41;
|
|
767
|
-
$[88] = t42;
|
|
768
|
-
} else t42 = $[88];
|
|
763
|
+
$[84] = discardChanges.isPending;
|
|
764
|
+
$[85] = handleDiscardChanges;
|
|
765
|
+
$[86] = t41;
|
|
766
|
+
$[87] = t42;
|
|
767
|
+
} else t42 = $[87];
|
|
769
768
|
let t43;
|
|
770
|
-
if ($[
|
|
771
|
-
t43 = /* @__PURE__ */ jsxs(
|
|
772
|
-
$[
|
|
773
|
-
$[
|
|
774
|
-
$[
|
|
775
|
-
} else t43 = $[
|
|
769
|
+
if ($[88] !== t40 || $[89] !== t42) {
|
|
770
|
+
t43 = /* @__PURE__ */ jsxs(AlertDialogFooter, { children: [t40, t42] });
|
|
771
|
+
$[88] = t40;
|
|
772
|
+
$[89] = t42;
|
|
773
|
+
$[90] = t43;
|
|
774
|
+
} else t43 = $[90];
|
|
776
775
|
let t44;
|
|
777
|
-
if ($[
|
|
778
|
-
t44 = /* @__PURE__ */
|
|
776
|
+
if ($[91] !== t39 || $[92] !== t43) {
|
|
777
|
+
t44 = /* @__PURE__ */ jsxs(AlertDialogContent, { children: [t39, t43] });
|
|
778
|
+
$[91] = t39;
|
|
779
|
+
$[92] = t43;
|
|
780
|
+
$[93] = t44;
|
|
781
|
+
} else t44 = $[93];
|
|
782
|
+
let t45;
|
|
783
|
+
if ($[94] !== isDiscardDialogOpen || $[95] !== t44) {
|
|
784
|
+
t45 = /* @__PURE__ */ jsx(AlertDialog, {
|
|
779
785
|
open: isDiscardDialogOpen,
|
|
780
786
|
onOpenChange: setIsDiscardDialogOpen,
|
|
781
|
-
children:
|
|
787
|
+
children: t44
|
|
782
788
|
});
|
|
783
|
-
$[
|
|
784
|
-
$[
|
|
785
|
-
$[
|
|
786
|
-
} else
|
|
787
|
-
let
|
|
788
|
-
if ($[
|
|
789
|
-
|
|
789
|
+
$[94] = isDiscardDialogOpen;
|
|
790
|
+
$[95] = t44;
|
|
791
|
+
$[96] = t45;
|
|
792
|
+
} else t45 = $[96];
|
|
793
|
+
let t46;
|
|
794
|
+
if ($[97] !== t26 || $[98] !== t28 || $[99] !== t37 || $[100] !== t45) {
|
|
795
|
+
t46 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
790
796
|
t26,
|
|
791
797
|
t28,
|
|
792
|
-
|
|
793
|
-
|
|
798
|
+
t37,
|
|
799
|
+
t45
|
|
794
800
|
] });
|
|
795
|
-
$[
|
|
796
|
-
$[
|
|
797
|
-
$[
|
|
798
|
-
$[
|
|
799
|
-
$[
|
|
800
|
-
} else
|
|
801
|
-
return
|
|
801
|
+
$[97] = t26;
|
|
802
|
+
$[98] = t28;
|
|
803
|
+
$[99] = t37;
|
|
804
|
+
$[100] = t45;
|
|
805
|
+
$[101] = t46;
|
|
806
|
+
} else t46 = $[101];
|
|
807
|
+
return t46;
|
|
802
808
|
};
|
|
803
809
|
function useHydrateDraftCache() {
|
|
804
810
|
const $ = c(7);
|
|
805
|
-
if ($[0] !== "
|
|
811
|
+
if ($[0] !== "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888") {
|
|
806
812
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
807
|
-
$[0] = "
|
|
813
|
+
$[0] = "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888";
|
|
808
814
|
}
|
|
809
815
|
const isAuthenticated = useIsAuthenticated();
|
|
810
816
|
const queryClient = useQueryClient();
|
|
@@ -855,9 +861,9 @@ function useHydrateDraftCache() {
|
|
|
855
861
|
function _temp8() {}
|
|
856
862
|
const CamoxPreview = (t0) => {
|
|
857
863
|
const $ = c(32);
|
|
858
|
-
if ($[0] !== "
|
|
864
|
+
if ($[0] !== "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888") {
|
|
859
865
|
for (let $i = 0; $i < 32; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
860
|
-
$[0] = "
|
|
866
|
+
$[0] = "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888";
|
|
861
867
|
}
|
|
862
868
|
const { children } = t0;
|
|
863
869
|
const isAuthenticated = useIsAuthenticated();
|
|
@@ -1085,9 +1091,9 @@ const CamoxPreview = (t0) => {
|
|
|
1085
1091
|
};
|
|
1086
1092
|
function usePreviewPagesActions() {
|
|
1087
1093
|
const $ = c(13);
|
|
1088
|
-
if ($[0] !== "
|
|
1094
|
+
if ($[0] !== "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888") {
|
|
1089
1095
|
for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
1090
|
-
$[0] = "
|
|
1096
|
+
$[0] = "212a5b46b813a81fe0fb973535ad10fd83bded2a583cefcde2dca34ea23e1888";
|
|
1091
1097
|
}
|
|
1092
1098
|
const navigate = useNavigate();
|
|
1093
1099
|
const { pathname } = useLocation();
|
|
@@ -20,8 +20,8 @@ import { Button } from "@camox/ui/button";
|
|
|
20
20
|
import { Switch } from "@camox/ui/switch";
|
|
21
21
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
|
|
22
22
|
import { Globe, Info, Trash2, Upload } from "lucide-react";
|
|
23
|
-
import { Spinner } from "@camox/ui/spinner";
|
|
24
23
|
import { Alert, AlertDescription, AlertTitle } from "@camox/ui/alert";
|
|
24
|
+
import { Spinner } from "@camox/ui/spinner";
|
|
25
25
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@camox/ui/dialog";
|
|
26
26
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
|
|
27
27
|
import { useForm } from "@tanstack/react-form";
|