camox 0.45.0 → 0.46.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/core/hooks/useArtifactHost.js +2 -2
- package/dist/features/canvas/CamoxCanvas.js +438 -771
- package/dist/features/canvas/CanvasPageFrame.js +1 -3
- package/dist/features/canvas/CanvasPreviewPageSlot.js +26 -6
- package/dist/features/canvas/canvasCamera.js +3 -3
- package/dist/features/canvas/canvasFrameDocument.js +4 -19
- package/dist/features/canvas/canvasItems.js +12 -102
- package/dist/features/canvas/canvasStore.js +3 -92
- package/dist/features/canvas/sidebar/CanvasNavigator.js +81 -183
- package/dist/features/canvas/sidebar/CanvasSidebar.js +22 -28
- package/dist/features/canvas/sidebar/CuratedPageInspector.js +2 -2
- package/dist/features/canvas/useCanvasCamera.js +0 -20
- package/dist/features/canvas/useCanvasFrame.js +5 -6
- package/dist/features/preview/CamoxPreview.js +3 -3
- package/dist/features/preview/components/{AddBlockDialog.js → AddBlockSheet.js} +35 -32
- package/dist/features/preview/components/BlockActionsPopover.js +6 -6
- package/dist/features/preview/components/BlockThumbnail.js +31 -33
- package/dist/features/preview/components/Overlays.js +1 -1
- package/dist/features/preview/components/PageTree.js +1 -1
- package/dist/features/preview/components/PreviewPanel.js +1 -1
- package/dist/features/preview/previewStore.js +9 -9
- package/dist/features/provider/CoreCamoxProvider.js +9 -6
- package/dist/features/routes/pageRuntime.js +8 -8
- package/dist/features/runtime/runtime.d.ts +2 -7
- package/dist/features/runtime/runtime.js +6 -19
- package/dist/features/studio/FollowAgentProvider.js +11 -22
- package/dist/features/studio/components/FaviconDialog.js +3 -3
- package/dist/features/studio/followAgent.js +5 -14
- package/dist/features/studio/routes.js +1 -23
- package/dist/lib/auth.js +36 -24
- package/dist/lib/studio-reads.js +0 -20
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox-expand/SKILL.md +5 -4
- package/dist/features/canvas/CanvasBlockFrame.js +0 -353
- package/dist/features/canvas/CanvasBlockHeader.js +0 -55
- package/dist/features/canvas/CanvasShelfMarker.js +0 -255
- package/dist/features/canvas/sidebar/CatalogBlockInspector.js +0 -189
|
@@ -7,8 +7,8 @@ import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
|
7
7
|
import { reads, useReadQuery, useStudioCache } from "../../lib/studio-reads.js";
|
|
8
8
|
import { pageMutations } from "../../lib/queries.js";
|
|
9
9
|
import { useLocalizedPath } from "../../lib/view-locale.js";
|
|
10
|
-
import { canvasStore
|
|
11
|
-
import { STUDIO_CANVAS_PATH
|
|
10
|
+
import { canvasStore } from "./canvasStore.js";
|
|
11
|
+
import { STUDIO_CANVAS_PATH } from "../studio/routes.js";
|
|
12
12
|
import { previewStore } from "../preview/previewStore.js";
|
|
13
13
|
import { PREVIEW_PAGE_SLOT_ATTRIBUTE, PreviewPageFrameContext } from "../preview/previewPageFrame.js";
|
|
14
14
|
import { PreviewPreparationContext } from "../preview/previewPreparation.js";
|
|
@@ -18,11 +18,8 @@ import { PageRecordContext, getPageRecord } from "../preview/pageRecord.js";
|
|
|
18
18
|
import { CuratedBlockShortcuts } from "../preview/components/PreviewPanel.js";
|
|
19
19
|
import { FollowAgentContext } from "../studio/followAgentContext.js";
|
|
20
20
|
import { useCanvasFrameMode } from "./canvasFrameMode.js";
|
|
21
|
-
import { useCanvasNearness } from "./useCanvasNearness.js";
|
|
22
|
-
import { CanvasBlockFrame } from "./CanvasBlockFrame.js";
|
|
23
|
-
import { CanvasBlockHeader } from "./CanvasBlockHeader.js";
|
|
24
21
|
import { CANVAS_DEVICES, canvasLayoutId, canvasPageId, derivedLayoutIdOf, getCanvasPages } from "./canvasPages.js";
|
|
25
|
-
import { CANVAS_SLOT_WIDTH,
|
|
22
|
+
import { CANVAS_SLOT_WIDTH, canvasSnapTargets, positionCanvasPages } from "./canvasItems.js";
|
|
26
23
|
import { CanvasOverlaysShownContext } from "./CanvasOverlays.js";
|
|
27
24
|
import { CanvasPageEdge } from "./CanvasPageEdge.js";
|
|
28
25
|
import { CANVAS_THUMBNAIL_MAX_ZOOM, CanvasThumbnailsContext, canvasThumbnailsSupported, createCanvasThumbnails, useCanvasThumbnail } from "./canvasThumbnails.js";
|
|
@@ -31,9 +28,9 @@ import { CanvasPageHeader } from "./CanvasPageHeader.js";
|
|
|
31
28
|
import { CanvasPreviewPageSlot } from "./CanvasPreviewPageSlot.js";
|
|
32
29
|
import { CANVAS_WORLD_TRANSFORM, canvasScreenAbove, canvasScreenLength, canvasScreenX } from "./canvasScreenSpace.js";
|
|
33
30
|
import { selectedCanvasPage } from "./canvasSelection.js";
|
|
34
|
-
import { CanvasShelfMarkers } from "./CanvasShelfMarker.js";
|
|
35
31
|
import { CanvasSidebar } from "./sidebar/CanvasSidebar.js";
|
|
36
32
|
import { useCanvasCamera } from "./useCanvasCamera.js";
|
|
33
|
+
import { useCanvasNearness } from "./useCanvasNearness.js";
|
|
37
34
|
import { useDiscoveredPreviewPaths } from "./useDiscoveredPreviewPaths.js";
|
|
38
35
|
import { c } from "react/compiler-runtime";
|
|
39
36
|
import * as React from "react";
|
|
@@ -98,15 +95,11 @@ var CanvasFrameBoundary = class extends React.Component {
|
|
|
98
95
|
if (!this.state.error) return this.props.children;
|
|
99
96
|
return /* @__PURE__ */ jsxs(CanvasMessage, { children: [/* @__PURE__ */ jsx(PreparationFailure, {
|
|
100
97
|
error: this.state.error,
|
|
101
|
-
selected: this.props.selected
|
|
98
|
+
selected: this.props.selected
|
|
102
99
|
}), /* @__PURE__ */ jsxs("div", {
|
|
103
100
|
role: "alert",
|
|
104
101
|
children: [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
"This ",
|
|
107
|
-
this.props.subject,
|
|
108
|
-
" could not be rendered."
|
|
109
|
-
] }),
|
|
102
|
+
/* @__PURE__ */ jsx("p", { children: "This page could not be rendered." }),
|
|
110
103
|
/* @__PURE__ */ jsx("p", {
|
|
111
104
|
className: "mt-2",
|
|
112
105
|
children: this.state.error.message
|
|
@@ -562,84 +555,10 @@ function createCanvasHover() {
|
|
|
562
555
|
on: { set: (context, event) => context.pageKey === event.pageKey ? context : { pageKey: event.pageKey } }
|
|
563
556
|
});
|
|
564
557
|
}
|
|
565
|
-
/** A Block Catalog block's area in the Canvas row, with its frame. */
|
|
566
|
-
function CanvasBlockItem(t0) {
|
|
567
|
-
const $ = c(24);
|
|
568
|
-
const { itemKey, block, projectId, runtimeBasePath, viewport, framed, selected, selectBlock } = t0;
|
|
569
|
-
let t1;
|
|
570
|
-
if ($[0] !== viewport.width) {
|
|
571
|
-
t1 = { width: viewport.width };
|
|
572
|
-
$[0] = viewport.width;
|
|
573
|
-
$[1] = t1;
|
|
574
|
-
} else t1 = $[1];
|
|
575
|
-
let t2;
|
|
576
|
-
if ($[2] !== block || $[3] !== selectBlock) {
|
|
577
|
-
t2 = () => selectBlock(block);
|
|
578
|
-
$[2] = block;
|
|
579
|
-
$[3] = selectBlock;
|
|
580
|
-
$[4] = t2;
|
|
581
|
-
} else t2 = $[4];
|
|
582
|
-
let t3;
|
|
583
|
-
if ($[5] !== block || $[6] !== projectId || $[7] !== runtimeBasePath || $[8] !== selected || $[9] !== t2 || $[10] !== viewport.height || $[11] !== viewport.width) {
|
|
584
|
-
t3 = /* @__PURE__ */ jsx(CanvasFrameBoundary, {
|
|
585
|
-
subject: "block",
|
|
586
|
-
children: /* @__PURE__ */ jsx(CanvasBlockFrame, {
|
|
587
|
-
block,
|
|
588
|
-
projectId,
|
|
589
|
-
runtimeBasePath,
|
|
590
|
-
width: viewport.width,
|
|
591
|
-
viewportHeight: viewport.height,
|
|
592
|
-
selected,
|
|
593
|
-
onSelect: t2
|
|
594
|
-
})
|
|
595
|
-
});
|
|
596
|
-
$[5] = block;
|
|
597
|
-
$[6] = projectId;
|
|
598
|
-
$[7] = runtimeBasePath;
|
|
599
|
-
$[8] = selected;
|
|
600
|
-
$[9] = t2;
|
|
601
|
-
$[10] = viewport.height;
|
|
602
|
-
$[11] = viewport.width;
|
|
603
|
-
$[12] = t3;
|
|
604
|
-
} else t3 = $[12];
|
|
605
|
-
let t4;
|
|
606
|
-
if ($[13] !== framed) {
|
|
607
|
-
t4 = /* @__PURE__ */ jsx(CanvasPageEdge, { shaded: framed });
|
|
608
|
-
$[13] = framed;
|
|
609
|
-
$[14] = t4;
|
|
610
|
-
} else t4 = $[14];
|
|
611
|
-
let t5;
|
|
612
|
-
if ($[15] !== block._internal.id || $[16] !== t1 || $[17] !== t3 || $[18] !== t4) {
|
|
613
|
-
t5 = /* @__PURE__ */ jsxs("div", {
|
|
614
|
-
"data-canvas-block": block._internal.id,
|
|
615
|
-
className: "bg-background relative shrink-0 shadow-xl ring-1 ring-black/10",
|
|
616
|
-
style: t1,
|
|
617
|
-
children: [t3, t4]
|
|
618
|
-
});
|
|
619
|
-
$[15] = block._internal.id;
|
|
620
|
-
$[16] = t1;
|
|
621
|
-
$[17] = t3;
|
|
622
|
-
$[18] = t4;
|
|
623
|
-
$[19] = t5;
|
|
624
|
-
} else t5 = $[19];
|
|
625
|
-
let t6;
|
|
626
|
-
if ($[20] !== framed || $[21] !== itemKey || $[22] !== t5) {
|
|
627
|
-
t6 = /* @__PURE__ */ jsx(CanvasSlot, {
|
|
628
|
-
itemKey,
|
|
629
|
-
framed,
|
|
630
|
-
children: t5
|
|
631
|
-
});
|
|
632
|
-
$[20] = framed;
|
|
633
|
-
$[21] = itemKey;
|
|
634
|
-
$[22] = t5;
|
|
635
|
-
$[23] = t6;
|
|
636
|
-
} else t6 = $[23];
|
|
637
|
-
return t6;
|
|
638
|
-
}
|
|
639
558
|
/** A Page's area in the Canvas row, with its frame. */
|
|
640
559
|
function CanvasPageItem(t0) {
|
|
641
|
-
const $ = c(
|
|
642
|
-
const { page, pathname, selected, previewed,
|
|
560
|
+
const $ = c(39);
|
|
561
|
+
const { page, pathname, selected, previewed, framed, viewport, runtimeBasePath, onActivate, selectPage, hover } = t0;
|
|
643
562
|
let t1;
|
|
644
563
|
if ($[0] !== page.key) {
|
|
645
564
|
t1 = (state) => state.context.pageKey === page.key;
|
|
@@ -677,7 +596,7 @@ function CanvasPageItem(t0) {
|
|
|
677
596
|
$[10] = t4;
|
|
678
597
|
} else t4 = $[10];
|
|
679
598
|
let t5;
|
|
680
|
-
if ($[11] !==
|
|
599
|
+
if ($[11] !== framed || $[12] !== hovered || $[13] !== onPageActivate || $[14] !== page || $[15] !== pathname || $[16] !== previewed || $[17] !== runtimeBasePath || $[18] !== selectPage || $[19] !== selected || $[20] !== viewport) {
|
|
681
600
|
t5 = previewed ? /* @__PURE__ */ jsx(CanvasPreviewPageSlot, {
|
|
682
601
|
pageId: canvasPageId(page),
|
|
683
602
|
layoutId: canvasLayoutId(page),
|
|
@@ -685,7 +604,6 @@ function CanvasPageItem(t0) {
|
|
|
685
604
|
viewportHeight: viewport.height,
|
|
686
605
|
selected,
|
|
687
606
|
hovered,
|
|
688
|
-
hidden: collapsed,
|
|
689
607
|
shaded: framed,
|
|
690
608
|
onActivate: onPageActivate
|
|
691
609
|
}) : pathname ? /* @__PURE__ */ jsx(CanvasPagePreview, {
|
|
@@ -699,39 +617,37 @@ function CanvasPageItem(t0) {
|
|
|
699
617
|
onActivate: onPageActivate,
|
|
700
618
|
onSelect: () => selectPage(pathname)
|
|
701
619
|
}) : /* @__PURE__ */ jsx(CanvasMessage, { children: "Choose a page path above to preview this layout." });
|
|
702
|
-
$[11] =
|
|
703
|
-
$[12] =
|
|
704
|
-
$[13] =
|
|
705
|
-
$[14] =
|
|
706
|
-
$[15] =
|
|
707
|
-
$[16] =
|
|
708
|
-
$[17] =
|
|
709
|
-
$[18] =
|
|
710
|
-
$[19] =
|
|
711
|
-
$[20] =
|
|
712
|
-
$[21] =
|
|
713
|
-
|
|
714
|
-
} else t5 = $[22];
|
|
620
|
+
$[11] = framed;
|
|
621
|
+
$[12] = hovered;
|
|
622
|
+
$[13] = onPageActivate;
|
|
623
|
+
$[14] = page;
|
|
624
|
+
$[15] = pathname;
|
|
625
|
+
$[16] = previewed;
|
|
626
|
+
$[17] = runtimeBasePath;
|
|
627
|
+
$[18] = selectPage;
|
|
628
|
+
$[19] = selected;
|
|
629
|
+
$[20] = viewport;
|
|
630
|
+
$[21] = t5;
|
|
631
|
+
} else t5 = $[21];
|
|
715
632
|
let t6;
|
|
716
|
-
if ($[
|
|
633
|
+
if ($[22] !== pathname || $[23] !== selected || $[24] !== t5) {
|
|
717
634
|
t6 = /* @__PURE__ */ jsx(CanvasFrameBoundary, {
|
|
718
|
-
subject: "page",
|
|
719
635
|
selected,
|
|
720
636
|
children: t5
|
|
721
637
|
}, pathname);
|
|
722
|
-
$[
|
|
723
|
-
$[
|
|
724
|
-
$[
|
|
725
|
-
$[
|
|
726
|
-
} else t6 = $[
|
|
638
|
+
$[22] = pathname;
|
|
639
|
+
$[23] = selected;
|
|
640
|
+
$[24] = t5;
|
|
641
|
+
$[25] = t6;
|
|
642
|
+
} else t6 = $[25];
|
|
727
643
|
let t7;
|
|
728
|
-
if ($[
|
|
644
|
+
if ($[26] !== framed) {
|
|
729
645
|
t7 = /* @__PURE__ */ jsx(CanvasPageEdge, { shaded: framed });
|
|
730
|
-
$[
|
|
731
|
-
$[
|
|
732
|
-
} else t7 = $[
|
|
646
|
+
$[26] = framed;
|
|
647
|
+
$[27] = t7;
|
|
648
|
+
} else t7 = $[27];
|
|
733
649
|
let t8;
|
|
734
|
-
if ($[
|
|
650
|
+
if ($[28] !== page.key || $[29] !== pathname || $[30] !== t3 || $[31] !== t4 || $[32] !== t6 || $[33] !== t7) {
|
|
735
651
|
t8 = /* @__PURE__ */ jsxs("div", {
|
|
736
652
|
"data-canvas-page": page.key,
|
|
737
653
|
"data-canvas-pathname": pathname,
|
|
@@ -740,57 +656,28 @@ function CanvasPageItem(t0) {
|
|
|
740
656
|
style: t4,
|
|
741
657
|
children: [t6, t7]
|
|
742
658
|
});
|
|
743
|
-
$[
|
|
744
|
-
$[
|
|
745
|
-
$[
|
|
746
|
-
$[
|
|
747
|
-
$[
|
|
748
|
-
$[
|
|
749
|
-
$[
|
|
750
|
-
} else t8 = $[
|
|
659
|
+
$[28] = page.key;
|
|
660
|
+
$[29] = pathname;
|
|
661
|
+
$[30] = t3;
|
|
662
|
+
$[31] = t4;
|
|
663
|
+
$[32] = t6;
|
|
664
|
+
$[33] = t7;
|
|
665
|
+
$[34] = t8;
|
|
666
|
+
} else t8 = $[34];
|
|
751
667
|
let t9;
|
|
752
|
-
if ($[
|
|
668
|
+
if ($[35] !== framed || $[36] !== page.key || $[37] !== t8) {
|
|
753
669
|
t9 = /* @__PURE__ */ jsx(CanvasSlot, {
|
|
754
670
|
itemKey: page.key,
|
|
755
671
|
framed,
|
|
756
672
|
children: t8
|
|
757
673
|
});
|
|
758
|
-
$[
|
|
759
|
-
$[
|
|
760
|
-
$[
|
|
761
|
-
$[
|
|
762
|
-
} else t9 = $[
|
|
674
|
+
$[35] = framed;
|
|
675
|
+
$[36] = page.key;
|
|
676
|
+
$[37] = t8;
|
|
677
|
+
$[38] = t9;
|
|
678
|
+
} else t9 = $[38];
|
|
763
679
|
return t9;
|
|
764
680
|
}
|
|
765
|
-
/** A block header with the number of Pages placing the block. */
|
|
766
|
-
function CanvasBlockUsageHeader(t0) {
|
|
767
|
-
const $ = c(7);
|
|
768
|
-
const { projectId, block, onSelect } = t0;
|
|
769
|
-
let t1;
|
|
770
|
-
if ($[0] !== block._internal.id || $[1] !== projectId) {
|
|
771
|
-
t1 = reads.pagesUsingBlock({
|
|
772
|
-
projectId,
|
|
773
|
-
type: block._internal.id
|
|
774
|
-
});
|
|
775
|
-
$[0] = block._internal.id;
|
|
776
|
-
$[1] = projectId;
|
|
777
|
-
$[2] = t1;
|
|
778
|
-
} else t1 = $[2];
|
|
779
|
-
const t2 = useReadQuery(t1).data?.length;
|
|
780
|
-
let t3;
|
|
781
|
-
if ($[3] !== block || $[4] !== onSelect || $[5] !== t2) {
|
|
782
|
-
t3 = /* @__PURE__ */ jsx(CanvasBlockHeader, {
|
|
783
|
-
block,
|
|
784
|
-
pageCount: t2,
|
|
785
|
-
onSelect
|
|
786
|
-
});
|
|
787
|
-
$[3] = block;
|
|
788
|
-
$[4] = onSelect;
|
|
789
|
-
$[5] = t2;
|
|
790
|
-
$[6] = t3;
|
|
791
|
-
} else t3 = $[6];
|
|
792
|
-
return t3;
|
|
793
|
-
}
|
|
794
681
|
/** Gives a Page a new nickname, keeping its path. */
|
|
795
682
|
function useRenamePage() {
|
|
796
683
|
const $ = c(4);
|
|
@@ -888,8 +775,8 @@ function useWorkspaceThumbnails(workspaceKey) {
|
|
|
888
775
|
return thumbnails;
|
|
889
776
|
}
|
|
890
777
|
function CanvasWorkspace(t0) {
|
|
891
|
-
const $ = c(
|
|
892
|
-
const { ref,
|
|
778
|
+
const $ = c(44);
|
|
779
|
+
const { ref, pages, selectedPage, previewedPage, intendedPageKey, runtimeBasePath, viewport, onActivate, onSelectionIntent } = t0;
|
|
893
780
|
const { apiUrl, projectUuid } = useAuthContext();
|
|
894
781
|
const renamePage = useRenamePage();
|
|
895
782
|
const location = useLocation();
|
|
@@ -915,515 +802,292 @@ function CanvasWorkspace(t0) {
|
|
|
915
802
|
$[3] = onSelectionIntent;
|
|
916
803
|
$[4] = t1;
|
|
917
804
|
} else t1 = $[4];
|
|
918
|
-
const
|
|
805
|
+
const goTo = t1;
|
|
919
806
|
let t2;
|
|
920
|
-
if ($[5] !== follow || $[6] !==
|
|
807
|
+
if ($[5] !== follow || $[6] !== goTo) {
|
|
921
808
|
t2 = (pathname_0) => {
|
|
922
809
|
follow?.takeOver();
|
|
923
|
-
|
|
810
|
+
goTo(pathname_0);
|
|
924
811
|
};
|
|
925
812
|
$[5] = follow;
|
|
926
|
-
$[6] =
|
|
813
|
+
$[6] = goTo;
|
|
927
814
|
$[7] = t2;
|
|
928
815
|
} else t2 = $[7];
|
|
929
816
|
const selectPage = t2;
|
|
817
|
+
const latestSelectPage = React.useRef(selectPage);
|
|
930
818
|
let t3;
|
|
931
|
-
if ($[8] !==
|
|
932
|
-
t3 = (
|
|
933
|
-
|
|
934
|
-
$[9] = selectPage;
|
|
935
|
-
$[10] = t3;
|
|
936
|
-
} else t3 = $[10];
|
|
937
|
-
const selectBlock = t3;
|
|
938
|
-
let t4;
|
|
939
|
-
if ($[11] !== selectBlock || $[12] !== selectPage) {
|
|
940
|
-
t4 = {
|
|
941
|
-
selectPage,
|
|
942
|
-
selectBlock
|
|
943
|
-
};
|
|
944
|
-
$[11] = selectBlock;
|
|
945
|
-
$[12] = selectPage;
|
|
946
|
-
$[13] = t4;
|
|
947
|
-
} else t4 = $[13];
|
|
948
|
-
const latestSelect = React.useRef(t4);
|
|
949
|
-
let t5;
|
|
950
|
-
if ($[14] !== selectBlock || $[15] !== selectPage) {
|
|
951
|
-
t5 = () => {
|
|
952
|
-
latestSelect.current = {
|
|
953
|
-
selectPage,
|
|
954
|
-
selectBlock
|
|
955
|
-
};
|
|
819
|
+
if ($[8] !== selectPage) {
|
|
820
|
+
t3 = () => {
|
|
821
|
+
latestSelectPage.current = selectPage;
|
|
956
822
|
};
|
|
957
|
-
$[
|
|
958
|
-
$[
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
let
|
|
963
|
-
if ($[
|
|
964
|
-
|
|
965
|
-
$[17] = t6;
|
|
966
|
-
} else t6 = $[17];
|
|
967
|
-
const selectFramePage = t6;
|
|
968
|
-
let t7;
|
|
969
|
-
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
970
|
-
t7 = (block_0) => latestSelect.current.selectBlock(block_0);
|
|
971
|
-
$[18] = t7;
|
|
972
|
-
} else t7 = $[18];
|
|
973
|
-
const selectFrameBlock = t7;
|
|
974
|
-
let t8;
|
|
975
|
-
if ($[19] !== apiUrl || $[20] !== projectUuid || $[21] !== runtimeBasePath) {
|
|
976
|
-
t8 = JSON.stringify([
|
|
823
|
+
$[8] = selectPage;
|
|
824
|
+
$[9] = t3;
|
|
825
|
+
} else t3 = $[9];
|
|
826
|
+
React.useLayoutEffect(t3);
|
|
827
|
+
const selectFramePage = (pathname_1) => latestSelectPage.current(pathname_1);
|
|
828
|
+
let t4;
|
|
829
|
+
if ($[10] !== apiUrl || $[11] !== projectUuid || $[12] !== runtimeBasePath) {
|
|
830
|
+
t4 = JSON.stringify([
|
|
977
831
|
apiUrl,
|
|
978
832
|
projectUuid,
|
|
979
833
|
runtimeBasePath
|
|
980
834
|
]);
|
|
981
|
-
$[
|
|
982
|
-
$[
|
|
983
|
-
$[
|
|
984
|
-
$[
|
|
985
|
-
} else
|
|
986
|
-
const workspaceKey =
|
|
987
|
-
let
|
|
988
|
-
if ($[
|
|
989
|
-
|
|
990
|
-
$[
|
|
991
|
-
} else
|
|
992
|
-
const [previewPathnames, setPreviewPathnames] = React.useState(
|
|
993
|
-
const
|
|
994
|
-
let
|
|
995
|
-
if ($[
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
$[
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
} else t12 = $[29];
|
|
1013
|
-
const toggleShelf = t12;
|
|
1014
|
-
const { items, markers, width } = positionCanvasShelves(shelves, collapsedShelves);
|
|
1015
|
-
const positions = new Map(items.map(_temp3));
|
|
1016
|
-
const blocksByKey = new Map(items.filter(isCanvasBlock).map(_temp4));
|
|
1017
|
-
const pageSlots = new Map(pages.map((page) => [page.key, {
|
|
1018
|
-
page,
|
|
1019
|
-
left: positions.get(page.key),
|
|
1020
|
-
pathname: page.key === selectedPage?.key ? selectedPath : previewedPath && page.key === previewedPage?.key ? previewedPath : previewPathnames[page.key] ?? page.pathname
|
|
1021
|
-
}]));
|
|
1022
|
-
const selectedKey = selectedItemKey && positions.has(selectedItemKey) ? selectedItemKey : null;
|
|
1023
|
-
const hiddenSelectedShelf = shelves.find((shelf_0) => collapsedShelves.has(shelf_0.key) && shelf_0.items.some((t13) => {
|
|
1024
|
-
const { key: key_0 } = t13;
|
|
1025
|
-
return key_0 === selectedItemKey;
|
|
1026
|
-
}))?.key;
|
|
835
|
+
$[10] = apiUrl;
|
|
836
|
+
$[11] = projectUuid;
|
|
837
|
+
$[12] = runtimeBasePath;
|
|
838
|
+
$[13] = t4;
|
|
839
|
+
} else t4 = $[13];
|
|
840
|
+
const workspaceKey = t4;
|
|
841
|
+
let t5;
|
|
842
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
843
|
+
t5 = {};
|
|
844
|
+
$[14] = t5;
|
|
845
|
+
} else t5 = $[14];
|
|
846
|
+
const [previewPathnames, setPreviewPathnames] = React.useState(t5);
|
|
847
|
+
const { items, width } = positionCanvasPages(pages);
|
|
848
|
+
let t6;
|
|
849
|
+
if ($[15] !== previewPathnames || $[16] !== previewedPage?.key || $[17] !== previewedPath || $[18] !== selectedPage?.key || $[19] !== selectedPath) {
|
|
850
|
+
t6 = (t7) => {
|
|
851
|
+
const { key, page, left } = t7;
|
|
852
|
+
return [key, {
|
|
853
|
+
page,
|
|
854
|
+
left,
|
|
855
|
+
pathname: key === selectedPage?.key ? selectedPath : previewedPath && key === previewedPage?.key ? previewedPath : previewPathnames[key] ?? page.pathname
|
|
856
|
+
}];
|
|
857
|
+
};
|
|
858
|
+
$[15] = previewPathnames;
|
|
859
|
+
$[16] = previewedPage?.key;
|
|
860
|
+
$[17] = previewedPath;
|
|
861
|
+
$[18] = selectedPage?.key;
|
|
862
|
+
$[19] = selectedPath;
|
|
863
|
+
$[20] = t6;
|
|
864
|
+
} else t6 = $[20];
|
|
865
|
+
const pageSlots = new Map(items.map(t6));
|
|
1027
866
|
const framed = viewport.width < CANVAS_SLOT_WIDTH;
|
|
1028
867
|
const snapTargets = canvasSnapTargets(items);
|
|
1029
868
|
const snapRingRef = React.useRef(null);
|
|
1030
869
|
const snapFlash = React.useRef(null);
|
|
1031
|
-
let
|
|
1032
|
-
if ($[
|
|
1033
|
-
|
|
1034
|
-
const { key:
|
|
1035
|
-
return
|
|
870
|
+
let t7;
|
|
871
|
+
if ($[21] !== selectedPage?.key) {
|
|
872
|
+
t7 = (t8) => {
|
|
873
|
+
const { key: key_0 } = t8;
|
|
874
|
+
return key_0 === selectedPage?.key;
|
|
1036
875
|
};
|
|
1037
|
-
$[
|
|
1038
|
-
$[
|
|
1039
|
-
} else
|
|
1040
|
-
let
|
|
1041
|
-
if ($[
|
|
1042
|
-
|
|
1043
|
-
$[
|
|
1044
|
-
$[
|
|
1045
|
-
$[
|
|
1046
|
-
} else
|
|
1047
|
-
let
|
|
1048
|
-
if ($[
|
|
1049
|
-
|
|
1050
|
-
$[
|
|
1051
|
-
$[
|
|
1052
|
-
} else
|
|
1053
|
-
const { viewportRef, contentRef, flyTo, mirrorCamera,
|
|
876
|
+
$[21] = selectedPage?.key;
|
|
877
|
+
$[22] = t7;
|
|
878
|
+
} else t7 = $[22];
|
|
879
|
+
let t8;
|
|
880
|
+
if ($[23] !== goTo || $[24] !== localized) {
|
|
881
|
+
t8 = () => goTo(localized(STUDIO_CANVAS_PATH));
|
|
882
|
+
$[23] = goTo;
|
|
883
|
+
$[24] = localized;
|
|
884
|
+
$[25] = t8;
|
|
885
|
+
} else t8 = $[25];
|
|
886
|
+
let t9;
|
|
887
|
+
if ($[26] !== follow) {
|
|
888
|
+
t9 = () => follow?.takeOver();
|
|
889
|
+
$[26] = follow;
|
|
890
|
+
$[27] = t9;
|
|
891
|
+
} else t9 = $[27];
|
|
892
|
+
const { viewportRef, contentRef, flyTo, mirrorCamera, reveal, fitAll } = useCanvasCamera(workspaceKey, snapTargets.find(t7), {
|
|
1054
893
|
targets: snapTargets,
|
|
1055
894
|
width,
|
|
1056
|
-
onSelect: (
|
|
1057
|
-
const
|
|
1058
|
-
if (block_1) return selectBlock(block_1);
|
|
1059
|
-
const pathname_2 = pageSlots.get(key_2)?.pathname;
|
|
895
|
+
onSelect: (key_1) => {
|
|
896
|
+
const pathname_2 = pageSlots.get(key_1)?.pathname;
|
|
1060
897
|
if (pathname_2) selectPage(pathname_2);
|
|
1061
898
|
},
|
|
1062
|
-
selected:
|
|
1063
|
-
onDeselect:
|
|
899
|
+
selected: intendedPageKey && pageSlots.has(intendedPageKey) ? intendedPageKey : null,
|
|
900
|
+
onDeselect: t8,
|
|
1064
901
|
onSnap: () => {
|
|
1065
902
|
snapFlash.current = snapRingRef.current?.animate(SNAP_FLASH_KEYFRAMES, SNAP_FLASH_TIMING) ?? null;
|
|
1066
903
|
},
|
|
1067
904
|
onSnapStretched: () => snapFlash.current?.cancel(),
|
|
1068
|
-
onEditorMove:
|
|
905
|
+
onEditorMove: t9
|
|
1069
906
|
});
|
|
1070
|
-
let
|
|
1071
|
-
if ($[
|
|
1072
|
-
|
|
907
|
+
let t10;
|
|
908
|
+
if ($[28] !== mirrorCamera || $[29] !== reveal || $[30] !== workspaceKey) {
|
|
909
|
+
t10 = {
|
|
1073
910
|
workspaceKey,
|
|
1074
911
|
mirrorCamera,
|
|
1075
912
|
reveal
|
|
1076
913
|
};
|
|
1077
|
-
$[
|
|
1078
|
-
$[
|
|
1079
|
-
$[
|
|
1080
|
-
$[
|
|
1081
|
-
} else
|
|
1082
|
-
const workspace =
|
|
914
|
+
$[28] = mirrorCamera;
|
|
915
|
+
$[29] = reveal;
|
|
916
|
+
$[30] = workspaceKey;
|
|
917
|
+
$[31] = t10;
|
|
918
|
+
} else t10 = $[31];
|
|
919
|
+
const workspace = t10;
|
|
1083
920
|
const thumbnails = useWorkspaceThumbnails(workspaceKey);
|
|
1084
|
-
const collapsingShelf = React.useRef(null);
|
|
1085
|
-
React.useLayoutEffect(() => {
|
|
1086
|
-
const marker = markers.find((t18) => {
|
|
1087
|
-
const { key: key_3 } = t18;
|
|
1088
|
-
return key_3 === collapsingShelf.current;
|
|
1089
|
-
});
|
|
1090
|
-
collapsingShelf.current = null;
|
|
1091
|
-
if (marker) keepInView(marker.start, 12);
|
|
1092
|
-
});
|
|
1093
921
|
const instructionsId = React.useId();
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
setShelfCollapsed(workspaceKey, hiddenSelectedShelf, false);
|
|
1099
|
-
return;
|
|
1100
|
-
}
|
|
1101
|
-
if (location.source !== "canvas" && !selectedKey) return;
|
|
1102
|
-
previousPath.current = selectedPath;
|
|
1103
|
-
}, [
|
|
1104
|
-
selectedPath,
|
|
1105
|
-
location.source,
|
|
1106
|
-
selectedKey,
|
|
1107
|
-
hiddenSelectedShelf,
|
|
1108
|
-
workspaceKey
|
|
1109
|
-
]);
|
|
1110
|
-
const [pendingFlight, setPendingFlight] = React.useState(null);
|
|
1111
|
-
const pendingFlightPlaced = !!pendingFlight && positions.has(pendingFlight);
|
|
1112
|
-
let t19;
|
|
1113
|
-
let t20;
|
|
1114
|
-
if ($[41] !== flyTo || $[42] !== pendingFlight || $[43] !== pendingFlightPlaced) {
|
|
1115
|
-
t19 = () => {
|
|
1116
|
-
if (!pendingFlight || !pendingFlightPlaced) return;
|
|
1117
|
-
setPendingFlight(null);
|
|
1118
|
-
flyTo(pendingFlight);
|
|
1119
|
-
};
|
|
1120
|
-
t20 = [
|
|
1121
|
-
pendingFlight,
|
|
1122
|
-
pendingFlightPlaced,
|
|
1123
|
-
flyTo
|
|
1124
|
-
];
|
|
1125
|
-
$[41] = flyTo;
|
|
1126
|
-
$[42] = pendingFlight;
|
|
1127
|
-
$[43] = pendingFlightPlaced;
|
|
1128
|
-
$[44] = t19;
|
|
1129
|
-
$[45] = t20;
|
|
1130
|
-
} else {
|
|
1131
|
-
t19 = $[44];
|
|
1132
|
-
t20 = $[45];
|
|
1133
|
-
}
|
|
1134
|
-
React.useEffect(t19, t20);
|
|
1135
|
-
let t21;
|
|
1136
|
-
let t22;
|
|
1137
|
-
if ($[46] !== fitAll) {
|
|
1138
|
-
t21 = () => {
|
|
922
|
+
let t11;
|
|
923
|
+
let t12;
|
|
924
|
+
if ($[32] !== fitAll) {
|
|
925
|
+
t11 = () => {
|
|
1139
926
|
let answered = canvasStore.getSnapshot().context.overviewRequests;
|
|
1140
|
-
const subscription = canvasStore.subscribe((
|
|
1141
|
-
const { context } =
|
|
927
|
+
const subscription = canvasStore.subscribe((t13) => {
|
|
928
|
+
const { context } = t13;
|
|
1142
929
|
if (context.overviewRequests === answered) return;
|
|
1143
930
|
answered = context.overviewRequests;
|
|
1144
931
|
fitAll();
|
|
1145
932
|
});
|
|
1146
933
|
return () => subscription.unsubscribe();
|
|
1147
934
|
};
|
|
1148
|
-
|
|
1149
|
-
$[
|
|
1150
|
-
$[
|
|
1151
|
-
$[
|
|
935
|
+
t12 = [fitAll];
|
|
936
|
+
$[32] = fitAll;
|
|
937
|
+
$[33] = t11;
|
|
938
|
+
$[34] = t12;
|
|
1152
939
|
} else {
|
|
1153
|
-
|
|
1154
|
-
|
|
940
|
+
t11 = $[33];
|
|
941
|
+
t12 = $[34];
|
|
1155
942
|
}
|
|
1156
|
-
React.useEffect(
|
|
943
|
+
React.useEffect(t11, t12);
|
|
1157
944
|
React.useImperativeHandle(ref, () => ({
|
|
1158
|
-
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1161
|
-
if (
|
|
1162
|
-
|
|
1163
|
-
if (pathname_3 && pathname_3 !== selectedPath) {
|
|
1164
|
-
navigate({ to: `${pathname_3}${location.search}${location.hash}` });
|
|
945
|
+
showPage(key_2) {
|
|
946
|
+
const slot = pageSlots.get(key_2);
|
|
947
|
+
if (!slot) return;
|
|
948
|
+
if (slot.pathname && slot.pathname !== selectedPath) {
|
|
949
|
+
navigate({ to: `${slot.pathname}${location.search}${location.hash}` });
|
|
1165
950
|
return;
|
|
1166
951
|
}
|
|
1167
|
-
|
|
1168
|
-
setPendingFlight(key_4);
|
|
952
|
+
flyTo(key_2);
|
|
1169
953
|
},
|
|
1170
954
|
showWholeCanvas() {
|
|
1171
955
|
selectPage(localized(STUDIO_CANVAS_PATH));
|
|
1172
956
|
fitAll();
|
|
1173
957
|
}
|
|
1174
958
|
}));
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
const t26 = true;
|
|
1179
|
-
const t27 = "bg-muted relative min-h-0 min-w-0 flex-1 touch-none overflow-clip outline-none *:*:[--canvas-x:initial] *:*:[--canvas-y:initial] data-[canvas-pan]:cursor-grab data-[canvas-pan]:**:cursor-[inherit]! data-[canvas-pan=dragging]:cursor-grabbing data-[canvas-pan]:[&_iframe]:pointer-events-none";
|
|
1180
|
-
let t28;
|
|
1181
|
-
if ($[49] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1182
|
-
t28 = {
|
|
959
|
+
let t13;
|
|
960
|
+
if ($[35] === Symbol.for("react.memo_cache_sentinel")) {
|
|
961
|
+
t13 = {
|
|
1183
962
|
userSelect: "none",
|
|
1184
963
|
overscrollBehavior: "none"
|
|
1185
964
|
};
|
|
1186
|
-
$[
|
|
1187
|
-
} else
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
gap: 480,
|
|
965
|
+
$[35] = t13;
|
|
966
|
+
} else t13 = $[35];
|
|
967
|
+
let t14;
|
|
968
|
+
if ($[36] === Symbol.for("react.memo_cache_sentinel")) {
|
|
969
|
+
t14 = {
|
|
970
|
+
gap: 240,
|
|
1193
971
|
transform: CANVAS_WORLD_TRANSFORM,
|
|
1194
972
|
transformOrigin: "0 0"
|
|
1195
973
|
};
|
|
1196
|
-
$[
|
|
1197
|
-
} else
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
if (item_3.kind === "block") return /* @__PURE__ */ jsx(CanvasBlockItem, {
|
|
1208
|
-
itemKey: item_3.key,
|
|
1209
|
-
block: item_3.block,
|
|
1210
|
-
projectId,
|
|
1211
|
-
runtimeBasePath,
|
|
1212
|
-
viewport,
|
|
1213
|
-
framed,
|
|
1214
|
-
selected: item_3.block._internal.id === selectedBlock?._internal.id,
|
|
1215
|
-
selectBlock: selectFrameBlock
|
|
1216
|
-
}, item_3.key);
|
|
1217
|
-
const slot = pageSlots.get(item_3.key);
|
|
1218
|
-
if (!slot) return null;
|
|
1219
|
-
const { page: page_0, pathname: pathname_4 } = slot;
|
|
1220
|
-
return /* @__PURE__ */ jsx(CanvasPageItem, {
|
|
1221
|
-
page: page_0,
|
|
1222
|
-
pathname: pathname_4,
|
|
1223
|
-
selected: page_0.key === selectedPage?.key,
|
|
1224
|
-
hover,
|
|
1225
|
-
previewed: !!previewPageFrame && page_0.key === previewedPage?.key && pathname_4 === previewedPath,
|
|
1226
|
-
collapsed,
|
|
1227
|
-
framed,
|
|
1228
|
-
viewport,
|
|
1229
|
-
runtimeBasePath,
|
|
1230
|
-
onActivate,
|
|
1231
|
-
selectPage: selectFramePage
|
|
1232
|
-
}, page_0.key);
|
|
1233
|
-
})
|
|
1234
|
-
}, shelf_2.key);
|
|
1235
|
-
});
|
|
1236
|
-
let t32;
|
|
1237
|
-
if ($[51] !== contentRef || $[52] !== t31) {
|
|
1238
|
-
t32 = /* @__PURE__ */ jsx("div", {
|
|
1239
|
-
ref: contentRef,
|
|
1240
|
-
"data-canvas-items": true,
|
|
1241
|
-
className: "absolute top-0 left-0 flex w-max items-start in-data-[canvas-promoted]:will-change-transform",
|
|
1242
|
-
style: t30,
|
|
1243
|
-
children: t31
|
|
1244
|
-
});
|
|
1245
|
-
$[51] = contentRef;
|
|
1246
|
-
$[52] = t31;
|
|
1247
|
-
$[53] = t32;
|
|
1248
|
-
} else t32 = $[53];
|
|
1249
|
-
let t33;
|
|
1250
|
-
if ($[54] !== t29 || $[55] !== t32) {
|
|
1251
|
-
t33 = /* @__PURE__ */ jsx(CanvasOverlaysShownContext, {
|
|
1252
|
-
value: t29,
|
|
1253
|
-
children: t32
|
|
1254
|
-
});
|
|
1255
|
-
$[54] = t29;
|
|
1256
|
-
$[55] = t32;
|
|
1257
|
-
$[56] = t33;
|
|
1258
|
-
} else t33 = $[56];
|
|
1259
|
-
let t34;
|
|
1260
|
-
if ($[57] !== t33 || $[58] !== thumbnails) {
|
|
1261
|
-
t34 = /* @__PURE__ */ jsx(CanvasThumbnailsContext, {
|
|
1262
|
-
value: thumbnails,
|
|
1263
|
-
children: t33
|
|
1264
|
-
});
|
|
1265
|
-
$[57] = t33;
|
|
1266
|
-
$[58] = thumbnails;
|
|
1267
|
-
$[59] = t34;
|
|
1268
|
-
} else t34 = $[59];
|
|
1269
|
-
let t35;
|
|
1270
|
-
if ($[60] !== t34 || $[61] !== workspace) {
|
|
1271
|
-
t35 = /* @__PURE__ */ jsx(CanvasWorkspaceContext, {
|
|
1272
|
-
value: workspace,
|
|
1273
|
-
children: t34
|
|
1274
|
-
});
|
|
1275
|
-
$[60] = t34;
|
|
1276
|
-
$[61] = workspace;
|
|
1277
|
-
$[62] = t35;
|
|
1278
|
-
} else t35 = $[62];
|
|
1279
|
-
let t36;
|
|
1280
|
-
if ($[63] !== toggleShelf) {
|
|
1281
|
-
t36 = (marker_0) => {
|
|
1282
|
-
if (!marker_0.collapsed) collapsingShelf.current = marker_0.key;
|
|
1283
|
-
toggleShelf(marker_0.key);
|
|
1284
|
-
};
|
|
1285
|
-
$[63] = toggleShelf;
|
|
1286
|
-
$[64] = t36;
|
|
1287
|
-
} else t36 = $[64];
|
|
1288
|
-
let t37;
|
|
1289
|
-
if ($[65] !== markers || $[66] !== t36) {
|
|
1290
|
-
t37 = /* @__PURE__ */ jsx(CanvasShelfMarkers, {
|
|
1291
|
-
markers,
|
|
1292
|
-
onToggle: t36
|
|
1293
|
-
});
|
|
1294
|
-
$[65] = markers;
|
|
1295
|
-
$[66] = t36;
|
|
1296
|
-
$[67] = t37;
|
|
1297
|
-
} else t37 = $[67];
|
|
1298
|
-
const t39 = [...pageSlots.values()].map((t38) => {
|
|
1299
|
-
const { page: page_1, pathname: pathname_5, left } = t38;
|
|
1300
|
-
return left === void 0 ? null : /* @__PURE__ */ jsx(CanvasHeaderSlot, {
|
|
1301
|
-
itemKey: page_1.key,
|
|
1302
|
-
left,
|
|
1303
|
-
children: /* @__PURE__ */ jsx(CanvasPageHeader, {
|
|
1304
|
-
page: page_1,
|
|
1305
|
-
pathname: pathname_5,
|
|
1306
|
-
onRename: page_1.kind === "curated" ? (nickname) => renamePage(page_1.pageId, nickname) : void 0,
|
|
1307
|
-
selected: page_1.key === selectedPage?.key,
|
|
1308
|
-
onHoverChange: (hovered) => hover.send({
|
|
1309
|
-
type: "set",
|
|
1310
|
-
pageKey: hovered ? page_1.key : null
|
|
1311
|
-
}),
|
|
1312
|
-
onSelect: () => {
|
|
1313
|
-
if (!pathname_5) return;
|
|
1314
|
-
selectPage(pathname_5);
|
|
1315
|
-
},
|
|
1316
|
-
onChange: (path) => {
|
|
1317
|
-
const inLocale = localized(path);
|
|
1318
|
-
setPreviewPathnames((current) => ({
|
|
1319
|
-
...current,
|
|
1320
|
-
[page_1.key]: inLocale
|
|
1321
|
-
}));
|
|
1322
|
-
selectPage(inLocale);
|
|
1323
|
-
}
|
|
1324
|
-
})
|
|
1325
|
-
}, page_1.key);
|
|
1326
|
-
});
|
|
1327
|
-
let t40;
|
|
1328
|
-
if ($[68] !== projectId || $[69] !== selectBlock) {
|
|
1329
|
-
t40 = (t41) => {
|
|
1330
|
-
const { key: key_5, left: left_0, block: block_2 } = t41;
|
|
1331
|
-
return /* @__PURE__ */ jsx(CanvasHeaderSlot, {
|
|
1332
|
-
itemKey: key_5,
|
|
1333
|
-
left: left_0,
|
|
1334
|
-
children: /* @__PURE__ */ jsx(CanvasBlockUsageHeader, {
|
|
1335
|
-
projectId,
|
|
1336
|
-
block: block_2,
|
|
1337
|
-
onSelect: () => selectBlock(block_2)
|
|
1338
|
-
})
|
|
1339
|
-
}, key_5);
|
|
1340
|
-
};
|
|
1341
|
-
$[68] = projectId;
|
|
1342
|
-
$[69] = selectBlock;
|
|
1343
|
-
$[70] = t40;
|
|
1344
|
-
} else t40 = $[70];
|
|
1345
|
-
const t41 = items.filter(isCanvasBlock).map(t40);
|
|
1346
|
-
let t42;
|
|
1347
|
-
if ($[71] !== pages.length) {
|
|
1348
|
-
t42 = !pages.length && /* @__PURE__ */ jsx(CanvasMessage, { children: "No pages to preview yet." });
|
|
1349
|
-
$[71] = pages.length;
|
|
1350
|
-
$[72] = t42;
|
|
1351
|
-
} else t42 = $[72];
|
|
1352
|
-
let t43;
|
|
1353
|
-
if ($[73] !== instructionsId) {
|
|
1354
|
-
t43 = /* @__PURE__ */ jsx("p", {
|
|
974
|
+
$[36] = t14;
|
|
975
|
+
} else t14 = $[36];
|
|
976
|
+
let t17;
|
|
977
|
+
if ($[37] !== pages.length) {
|
|
978
|
+
t17 = !pages.length && /* @__PURE__ */ jsx(CanvasMessage, { children: "No pages to preview yet." });
|
|
979
|
+
$[37] = pages.length;
|
|
980
|
+
$[38] = t17;
|
|
981
|
+
} else t17 = $[38];
|
|
982
|
+
let t18;
|
|
983
|
+
if ($[39] !== instructionsId) {
|
|
984
|
+
t18 = /* @__PURE__ */ jsx("p", {
|
|
1355
985
|
id: instructionsId,
|
|
1356
986
|
className: "sr-only",
|
|
1357
987
|
children: "Scroll, or hold Space and drag, to pan. Pinch or Ctrl/⌘ + scroll to zoom. Click a page to edit it. Focus the canvas and use plus or minus to zoom, arrow keys to pan, 0 for 100%, or Home / Shift+1 to fit all pages."
|
|
1358
988
|
});
|
|
1359
|
-
$[
|
|
1360
|
-
$[
|
|
1361
|
-
} else
|
|
1362
|
-
let
|
|
1363
|
-
if ($[
|
|
1364
|
-
|
|
1365
|
-
$[
|
|
1366
|
-
} else
|
|
1367
|
-
let
|
|
1368
|
-
if ($[
|
|
1369
|
-
|
|
989
|
+
$[39] = instructionsId;
|
|
990
|
+
$[40] = t18;
|
|
991
|
+
} else t18 = $[40];
|
|
992
|
+
let t19;
|
|
993
|
+
if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
|
|
994
|
+
t19 = { zIndex: 2 };
|
|
995
|
+
$[41] = t19;
|
|
996
|
+
} else t19 = $[41];
|
|
997
|
+
let t20;
|
|
998
|
+
if ($[42] !== snapRingRef) {
|
|
999
|
+
t20 = /* @__PURE__ */ jsx("div", {
|
|
1370
1000
|
ref: snapRingRef,
|
|
1371
1001
|
"aria-hidden": true,
|
|
1372
1002
|
"data-canvas-snap-ring": true,
|
|
1373
1003
|
className: "ring-primary pointer-events-none absolute inset-0 opacity-0 ring-3 ring-inset",
|
|
1374
|
-
style:
|
|
1375
|
-
});
|
|
1376
|
-
$[76] = snapRingRef;
|
|
1377
|
-
$[77] = t45;
|
|
1378
|
-
} else t45 = $[77];
|
|
1379
|
-
let t46;
|
|
1380
|
-
if ($[78] !== instructionsId || $[79] !== t28 || $[80] !== t35 || $[81] !== t37 || $[82] !== t39 || $[83] !== t41 || $[84] !== t42 || $[85] !== t43 || $[86] !== t45 || $[87] !== viewportRef) {
|
|
1381
|
-
t46 = /* @__PURE__ */ jsxs("div", {
|
|
1382
|
-
ref: viewportRef,
|
|
1383
|
-
role: t23,
|
|
1384
|
-
"aria-label": t24,
|
|
1385
|
-
"aria-describedby": instructionsId,
|
|
1386
|
-
tabIndex: t25,
|
|
1387
|
-
"data-camox-canvas": t26,
|
|
1388
|
-
className: t27,
|
|
1389
|
-
style: t28,
|
|
1390
|
-
children: [
|
|
1391
|
-
t35,
|
|
1392
|
-
t37,
|
|
1393
|
-
t39,
|
|
1394
|
-
t41,
|
|
1395
|
-
t42,
|
|
1396
|
-
t43,
|
|
1397
|
-
t45
|
|
1398
|
-
]
|
|
1004
|
+
style: t19
|
|
1399
1005
|
});
|
|
1400
|
-
$[
|
|
1401
|
-
$[
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1006
|
+
$[42] = snapRingRef;
|
|
1007
|
+
$[43] = t20;
|
|
1008
|
+
} else t20 = $[43];
|
|
1009
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1010
|
+
ref: viewportRef,
|
|
1011
|
+
role: "region",
|
|
1012
|
+
"aria-label": "Page canvas",
|
|
1013
|
+
"aria-describedby": instructionsId,
|
|
1014
|
+
tabIndex: 0,
|
|
1015
|
+
"data-camox-canvas": true,
|
|
1016
|
+
className: "bg-muted relative min-h-0 min-w-0 flex-1 touch-none overflow-clip outline-none *:*:[--canvas-x:initial] *:*:[--canvas-y:initial] data-[canvas-pan]:cursor-grab data-[canvas-pan]:**:cursor-[inherit]! data-[canvas-pan=dragging]:cursor-grabbing data-[canvas-pan]:[&_iframe]:pointer-events-none",
|
|
1017
|
+
style: t13,
|
|
1018
|
+
children: [
|
|
1019
|
+
/* @__PURE__ */ jsx(CanvasWorkspaceContext, {
|
|
1020
|
+
value: workspace,
|
|
1021
|
+
children: /* @__PURE__ */ jsx(CanvasThumbnailsContext, {
|
|
1022
|
+
value: thumbnails,
|
|
1023
|
+
children: /* @__PURE__ */ jsx(CanvasOverlaysShownContext, {
|
|
1024
|
+
value: !!intendedPageKey,
|
|
1025
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
1026
|
+
ref: contentRef,
|
|
1027
|
+
"data-canvas-items": true,
|
|
1028
|
+
className: "absolute top-0 left-0 flex w-max items-start in-data-[canvas-promoted]:will-change-transform",
|
|
1029
|
+
style: t14,
|
|
1030
|
+
children: [...pageSlots.values()].map((t15) => {
|
|
1031
|
+
const { page: page_0, pathname: pathname_3 } = t15;
|
|
1032
|
+
return /* @__PURE__ */ jsx(CanvasPageItem, {
|
|
1033
|
+
page: page_0,
|
|
1034
|
+
pathname: pathname_3,
|
|
1035
|
+
selected: page_0.key === selectedPage?.key,
|
|
1036
|
+
hover,
|
|
1037
|
+
previewed: !!previewPageFrame && page_0.key === previewedPage?.key && pathname_3 === previewedPath,
|
|
1038
|
+
framed,
|
|
1039
|
+
viewport,
|
|
1040
|
+
runtimeBasePath,
|
|
1041
|
+
onActivate,
|
|
1042
|
+
selectPage: selectFramePage
|
|
1043
|
+
}, page_0.key);
|
|
1044
|
+
})
|
|
1045
|
+
})
|
|
1046
|
+
})
|
|
1047
|
+
})
|
|
1048
|
+
}),
|
|
1049
|
+
[...pageSlots.values()].map((t16) => {
|
|
1050
|
+
const { page: page_1, pathname: pathname_4, left: left_0 } = t16;
|
|
1051
|
+
return /* @__PURE__ */ jsx(CanvasHeaderSlot, {
|
|
1052
|
+
itemKey: page_1.key,
|
|
1053
|
+
left: left_0,
|
|
1054
|
+
children: /* @__PURE__ */ jsx(CanvasPageHeader, {
|
|
1055
|
+
page: page_1,
|
|
1056
|
+
pathname: pathname_4,
|
|
1057
|
+
onRename: page_1.kind === "curated" ? (nickname) => renamePage(page_1.pageId, nickname) : void 0,
|
|
1058
|
+
selected: page_1.key === selectedPage?.key,
|
|
1059
|
+
onHoverChange: (hovered) => hover.send({
|
|
1060
|
+
type: "set",
|
|
1061
|
+
pageKey: hovered ? page_1.key : null
|
|
1062
|
+
}),
|
|
1063
|
+
onSelect: () => {
|
|
1064
|
+
if (!pathname_4) return;
|
|
1065
|
+
selectPage(pathname_4);
|
|
1066
|
+
},
|
|
1067
|
+
onChange: (path) => {
|
|
1068
|
+
const inLocale = localized(path);
|
|
1069
|
+
setPreviewPathnames((current) => ({
|
|
1070
|
+
...current,
|
|
1071
|
+
[page_1.key]: inLocale
|
|
1072
|
+
}));
|
|
1073
|
+
selectPage(inLocale);
|
|
1074
|
+
}
|
|
1075
|
+
})
|
|
1076
|
+
}, page_1.key);
|
|
1077
|
+
}),
|
|
1078
|
+
t17,
|
|
1079
|
+
t18,
|
|
1080
|
+
t20
|
|
1081
|
+
]
|
|
1082
|
+
});
|
|
1419
1083
|
}
|
|
1420
1084
|
function CamoxCanvas(t0) {
|
|
1421
|
-
const $ = c(
|
|
1085
|
+
const $ = c(68);
|
|
1422
1086
|
const { runtimeBasePath } = t0;
|
|
1423
1087
|
const app = useCamoxApp();
|
|
1424
1088
|
const renamePage = useRenamePage();
|
|
1425
1089
|
const location = useLocation();
|
|
1426
|
-
const viewportMode = useSelector(previewStore,
|
|
1090
|
+
const viewportMode = useSelector(previewStore, _temp3);
|
|
1427
1091
|
const viewport = CANVAS_DEVICES[viewportMode === "full" ? "desktop" : viewportMode];
|
|
1428
1092
|
const [activeFrame, setActiveFrame] = React.useState(null);
|
|
1429
1093
|
const selectedPath = location.pathname;
|
|
@@ -1453,7 +1117,7 @@ function CamoxCanvas(t0) {
|
|
|
1453
1117
|
t3 = [];
|
|
1454
1118
|
$[4] = t3;
|
|
1455
1119
|
} else t3 = $[4];
|
|
1456
|
-
React.useEffect(
|
|
1120
|
+
React.useEffect(_temp5, t3);
|
|
1457
1121
|
const projectUuid = useProjectUuid();
|
|
1458
1122
|
let t4;
|
|
1459
1123
|
if ($[5] !== projectUuid) {
|
|
@@ -1479,74 +1143,92 @@ function CamoxCanvas(t0) {
|
|
|
1479
1143
|
const discoveredPaths = useDiscoveredPreviewPaths(runtimeBasePath);
|
|
1480
1144
|
const viewLocale = useViewLocale();
|
|
1481
1145
|
const canvasPages = pages.data ? getCanvasPages(pages.data, app.getLayouts(), discoveredPaths, viewLocale.locale) : [];
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
const
|
|
1146
|
+
let t8;
|
|
1147
|
+
if ($[11] !== viewLocale.locales) {
|
|
1148
|
+
t8 = (runtimePath) => parseLocalePath(runtimePath, viewLocale.locales).path === STUDIO_CANVAS_PATH;
|
|
1149
|
+
$[11] = viewLocale.locales;
|
|
1150
|
+
$[12] = t8;
|
|
1151
|
+
} else t8 = $[12];
|
|
1152
|
+
const isCanvasPath = t8;
|
|
1153
|
+
const pageAt = (runtimePath_0) => isCanvasPath(runtimePath_0) ? void 0 : selectedCanvasPage(canvasPages, app.getLayouts(), runtimePath_0, viewLocale.locales);
|
|
1154
|
+
const selectedPage = pageAt(location.pathname);
|
|
1491
1155
|
const previewedPath = React.use(PreviewPageFrameContext)?.pathname;
|
|
1492
|
-
const previewedPage = previewedPath ?
|
|
1156
|
+
const previewedPage = previewedPath ? pageAt(previewedPath) : void 0;
|
|
1493
1157
|
const [intent, setIntent] = React.useState(null);
|
|
1494
1158
|
if (intent && intent.from !== location.pathname) setIntent(null);
|
|
1495
1159
|
const intended = intent?.from === location.pathname ? intent.to : location;
|
|
1496
|
-
const
|
|
1160
|
+
const intendedPage = pageAt(intended.pathname);
|
|
1497
1161
|
const navigate = useNavigate();
|
|
1498
1162
|
const workspace = React.useRef(null);
|
|
1499
|
-
let
|
|
1500
|
-
if ($[
|
|
1501
|
-
|
|
1502
|
-
$[
|
|
1503
|
-
} else
|
|
1163
|
+
let t9;
|
|
1164
|
+
if ($[13] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1165
|
+
t9 = { enabled: false };
|
|
1166
|
+
$[13] = t9;
|
|
1167
|
+
} else t9 = $[13];
|
|
1504
1168
|
const { data: intendedFrameInput } = useReadQuery(reads.canvasFrame({
|
|
1505
1169
|
projectUuid,
|
|
1506
1170
|
runtimeBasePath,
|
|
1507
1171
|
pathname: intended.pathname,
|
|
1508
|
-
derivedLayoutId: derivedLayoutIdOf(
|
|
1509
|
-
}),
|
|
1510
|
-
const recordResult = derivedLayoutIdOf(
|
|
1511
|
-
let
|
|
1512
|
-
if ($[
|
|
1513
|
-
|
|
1514
|
-
$[
|
|
1515
|
-
$[
|
|
1516
|
-
} else
|
|
1517
|
-
const pageRecord =
|
|
1172
|
+
derivedLayoutId: derivedLayoutIdOf(intendedPage)
|
|
1173
|
+
}), t9);
|
|
1174
|
+
const recordResult = derivedLayoutIdOf(intendedPage) ? intendedFrameInput?.derived?.result : void 0;
|
|
1175
|
+
let t10;
|
|
1176
|
+
if ($[14] !== recordResult) {
|
|
1177
|
+
t10 = getPageRecord(recordResult);
|
|
1178
|
+
$[14] = recordResult;
|
|
1179
|
+
$[15] = t10;
|
|
1180
|
+
} else t10 = $[15];
|
|
1181
|
+
const pageRecord = t10;
|
|
1518
1182
|
usePreparationFailure((!project.isFetching ? project.error : null) ?? (!pages.isFetching ? pages.error : null));
|
|
1519
1183
|
const preparation = React.useContext(PreviewPreparationContext);
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
return;
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1184
|
+
let t11;
|
|
1185
|
+
let t12;
|
|
1186
|
+
if ($[16] !== location.pathname || $[17] !== pages.error || $[18] !== pages.isPending || $[19] !== preparation || $[20] !== project.error || $[21] !== project.isPending || $[22] !== selectedPage || $[23] !== viewLocale.locales) {
|
|
1187
|
+
t11 = () => {
|
|
1188
|
+
if (project.isPending || pages.isPending || project.error || pages.error) return;
|
|
1189
|
+
if (parseLocalePath(location.pathname, viewLocale.locales).path === "/camox/canvas") {
|
|
1190
|
+
preparation?.ready();
|
|
1191
|
+
return;
|
|
1192
|
+
}
|
|
1193
|
+
if (selectedPage) return;
|
|
1194
|
+
preparation?.fail(/* @__PURE__ */ new Error(`No canvas page matches ${location.pathname}.`));
|
|
1195
|
+
};
|
|
1196
|
+
t12 = [
|
|
1197
|
+
project.isPending,
|
|
1198
|
+
pages.isPending,
|
|
1199
|
+
project.error,
|
|
1200
|
+
pages.error,
|
|
1201
|
+
selectedPage,
|
|
1202
|
+
location.pathname,
|
|
1203
|
+
viewLocale.locales,
|
|
1204
|
+
preparation
|
|
1205
|
+
];
|
|
1206
|
+
$[16] = location.pathname;
|
|
1207
|
+
$[17] = pages.error;
|
|
1208
|
+
$[18] = pages.isPending;
|
|
1209
|
+
$[19] = preparation;
|
|
1210
|
+
$[20] = project.error;
|
|
1211
|
+
$[21] = project.isPending;
|
|
1212
|
+
$[22] = selectedPage;
|
|
1213
|
+
$[23] = viewLocale.locales;
|
|
1214
|
+
$[24] = t11;
|
|
1215
|
+
$[25] = t12;
|
|
1216
|
+
} else {
|
|
1217
|
+
t11 = $[24];
|
|
1218
|
+
t12 = $[25];
|
|
1219
|
+
}
|
|
1220
|
+
React.useEffect(t11, t12);
|
|
1539
1221
|
if (project.error || pages.error) {
|
|
1540
|
-
let
|
|
1541
|
-
if ($[
|
|
1542
|
-
|
|
1543
|
-
$[
|
|
1544
|
-
} else
|
|
1545
|
-
let
|
|
1546
|
-
if ($[
|
|
1547
|
-
|
|
1222
|
+
let t13;
|
|
1223
|
+
if ($[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1224
|
+
t13 = /* @__PURE__ */ jsx("p", { children: "Could not load the site’s pages." });
|
|
1225
|
+
$[26] = t13;
|
|
1226
|
+
} else t13 = $[26];
|
|
1227
|
+
let t14;
|
|
1228
|
+
if ($[27] !== pages || $[28] !== project) {
|
|
1229
|
+
t14 = /* @__PURE__ */ jsx(CanvasMessage, { children: /* @__PURE__ */ jsxs("div", {
|
|
1548
1230
|
role: "alert",
|
|
1549
|
-
children: [
|
|
1231
|
+
children: [t13, /* @__PURE__ */ jsx("button", {
|
|
1550
1232
|
className: "mt-4 underline",
|
|
1551
1233
|
onClick: () => {
|
|
1552
1234
|
if (project.error) project.refetch();
|
|
@@ -1555,178 +1237,163 @@ function CamoxCanvas(t0) {
|
|
|
1555
1237
|
children: "Try again"
|
|
1556
1238
|
})]
|
|
1557
1239
|
}) });
|
|
1558
|
-
$[
|
|
1559
|
-
$[
|
|
1560
|
-
$[
|
|
1561
|
-
} else
|
|
1562
|
-
return
|
|
1240
|
+
$[27] = pages;
|
|
1241
|
+
$[28] = project;
|
|
1242
|
+
$[29] = t14;
|
|
1243
|
+
} else t14 = $[29];
|
|
1244
|
+
return t14;
|
|
1563
1245
|
}
|
|
1564
1246
|
if (project.isPending || pages.isPending) {
|
|
1565
|
-
let
|
|
1566
|
-
if ($[
|
|
1567
|
-
|
|
1247
|
+
let t13;
|
|
1248
|
+
if ($[30] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1249
|
+
t13 = /* @__PURE__ */ jsx(CanvasMessage, { children: /* @__PURE__ */ jsx("span", {
|
|
1568
1250
|
role: "status",
|
|
1569
1251
|
children: "Loading canvas…"
|
|
1570
1252
|
}) });
|
|
1571
|
-
$[
|
|
1572
|
-
} else
|
|
1573
|
-
return
|
|
1253
|
+
$[30] = t13;
|
|
1254
|
+
} else t13 = $[30];
|
|
1255
|
+
return t13;
|
|
1574
1256
|
}
|
|
1575
1257
|
const editingOwner = activeFrame?.pathname === intended.pathname ? activeFrame.owner : null;
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
const
|
|
1583
|
-
const t12 = intendedSelection.page;
|
|
1584
|
-
const t13 = intendedSelection.block && {
|
|
1585
|
-
block: intendedSelection.block,
|
|
1586
|
-
projectId: project.data.id
|
|
1587
|
-
};
|
|
1588
|
-
const t14 = getCanvasShelves(canvasPages, blockCatalog);
|
|
1258
|
+
let t13;
|
|
1259
|
+
if ($[31] !== selectedPage?.kind) {
|
|
1260
|
+
t13 = selectedPage?.kind === "curated" && /* @__PURE__ */ jsx(CuratedBlockShortcuts, {});
|
|
1261
|
+
$[31] = selectedPage?.kind;
|
|
1262
|
+
$[32] = t13;
|
|
1263
|
+
} else t13 = $[32];
|
|
1264
|
+
const t14 = intendedPage?.key;
|
|
1589
1265
|
let t15;
|
|
1590
|
-
if ($[
|
|
1591
|
-
t15 = (key) => workspace.current?.
|
|
1592
|
-
$[
|
|
1593
|
-
} else t15 = $[
|
|
1266
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1267
|
+
t15 = (key) => workspace.current?.showPage(key);
|
|
1268
|
+
$[33] = t15;
|
|
1269
|
+
} else t15 = $[33];
|
|
1594
1270
|
let t16;
|
|
1595
|
-
if ($[
|
|
1271
|
+
if ($[34] !== canvasPages || $[35] !== t14) {
|
|
1596
1272
|
t16 = {
|
|
1597
|
-
|
|
1598
|
-
selectedKey:
|
|
1599
|
-
|
|
1273
|
+
pages: canvasPages,
|
|
1274
|
+
selectedKey: t14,
|
|
1275
|
+
onShowPage: t15
|
|
1600
1276
|
};
|
|
1601
|
-
$[
|
|
1602
|
-
$[
|
|
1603
|
-
$[
|
|
1604
|
-
} else t16 = $[
|
|
1277
|
+
$[34] = canvasPages;
|
|
1278
|
+
$[35] = t14;
|
|
1279
|
+
$[36] = t16;
|
|
1280
|
+
} else t16 = $[36];
|
|
1605
1281
|
let t17;
|
|
1606
|
-
if ($[
|
|
1282
|
+
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1607
1283
|
t17 = () => workspace.current?.showWholeCanvas();
|
|
1608
|
-
$[
|
|
1609
|
-
} else t17 = $[
|
|
1284
|
+
$[37] = t17;
|
|
1285
|
+
} else t17 = $[37];
|
|
1610
1286
|
let t18;
|
|
1611
|
-
if ($[
|
|
1612
|
-
t18 = /* @__PURE__ */ jsx(
|
|
1613
|
-
page:
|
|
1614
|
-
catalog: t13,
|
|
1287
|
+
if ($[38] !== editingOwner || $[39] !== intendedPage || $[40] !== pageRecord || $[41] !== renamePage || $[42] !== t16) {
|
|
1288
|
+
t18 = /* @__PURE__ */ jsx(CanvasSidebar, {
|
|
1289
|
+
page: intendedPage,
|
|
1615
1290
|
navigator: t16,
|
|
1616
1291
|
onShowWholeCanvas: t17,
|
|
1617
1292
|
onRenamePage: renamePage,
|
|
1618
1293
|
owner: editingOwner,
|
|
1619
1294
|
pageRecord
|
|
1620
1295
|
});
|
|
1621
|
-
$[
|
|
1622
|
-
$[
|
|
1623
|
-
$[
|
|
1624
|
-
$[
|
|
1625
|
-
$[
|
|
1626
|
-
$[
|
|
1627
|
-
|
|
1628
|
-
$[31] = t18;
|
|
1629
|
-
} else t18 = $[31];
|
|
1296
|
+
$[38] = editingOwner;
|
|
1297
|
+
$[39] = intendedPage;
|
|
1298
|
+
$[40] = pageRecord;
|
|
1299
|
+
$[41] = renamePage;
|
|
1300
|
+
$[42] = t16;
|
|
1301
|
+
$[43] = t18;
|
|
1302
|
+
} else t18 = $[43];
|
|
1630
1303
|
let t19;
|
|
1631
|
-
if ($[
|
|
1632
|
-
t19 = /* @__PURE__ */ jsx(
|
|
1304
|
+
if ($[44] !== recordResult || $[45] !== t18) {
|
|
1305
|
+
t19 = /* @__PURE__ */ jsx(PageRecordContext, {
|
|
1633
1306
|
value: recordResult,
|
|
1634
1307
|
children: t18
|
|
1635
1308
|
});
|
|
1636
|
-
$[
|
|
1637
|
-
$[
|
|
1638
|
-
$[
|
|
1639
|
-
|
|
1640
|
-
} else t19 = $[35];
|
|
1309
|
+
$[44] = recordResult;
|
|
1310
|
+
$[45] = t18;
|
|
1311
|
+
$[46] = t19;
|
|
1312
|
+
} else t19 = $[46];
|
|
1641
1313
|
let t20;
|
|
1642
|
-
if ($[
|
|
1643
|
-
t20 = /* @__PURE__ */ jsx(
|
|
1314
|
+
if ($[47] !== intended || $[48] !== navigate || $[49] !== t19) {
|
|
1315
|
+
t20 = /* @__PURE__ */ jsx(NavigationProvider, {
|
|
1644
1316
|
location: intended,
|
|
1645
1317
|
navigate,
|
|
1646
1318
|
children: t19
|
|
1647
1319
|
});
|
|
1648
|
-
$[
|
|
1649
|
-
$[
|
|
1650
|
-
$[
|
|
1651
|
-
$[
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
let
|
|
1655
|
-
if ($[
|
|
1656
|
-
|
|
1657
|
-
pathname
|
|
1320
|
+
$[47] = intended;
|
|
1321
|
+
$[48] = navigate;
|
|
1322
|
+
$[49] = t19;
|
|
1323
|
+
$[50] = t20;
|
|
1324
|
+
} else t20 = $[50];
|
|
1325
|
+
const t21 = intendedPage?.key;
|
|
1326
|
+
let t22;
|
|
1327
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
1328
|
+
t22 = (pathname, owner, release) => setActiveFrame({
|
|
1329
|
+
pathname,
|
|
1658
1330
|
owner,
|
|
1659
1331
|
release
|
|
1660
1332
|
});
|
|
1661
|
-
$[
|
|
1662
|
-
} else
|
|
1663
|
-
let
|
|
1664
|
-
if ($[
|
|
1665
|
-
|
|
1333
|
+
$[51] = t22;
|
|
1334
|
+
} else t22 = $[51];
|
|
1335
|
+
let t23;
|
|
1336
|
+
if ($[52] !== location || $[53] !== setIntent) {
|
|
1337
|
+
t23 = (pathname_0) => setIntent({
|
|
1666
1338
|
from: location.pathname,
|
|
1667
1339
|
to: {
|
|
1668
1340
|
...location,
|
|
1669
|
-
pathname:
|
|
1670
|
-
href: new URL(`${
|
|
1341
|
+
pathname: pathname_0,
|
|
1342
|
+
href: new URL(`${pathname_0}${location.search}${location.hash}`, window.location.href).href
|
|
1671
1343
|
}
|
|
1672
1344
|
});
|
|
1673
|
-
$[
|
|
1674
|
-
$[
|
|
1675
|
-
$[
|
|
1676
|
-
} else
|
|
1677
|
-
let
|
|
1678
|
-
if ($[
|
|
1679
|
-
|
|
1345
|
+
$[52] = location;
|
|
1346
|
+
$[53] = setIntent;
|
|
1347
|
+
$[54] = t23;
|
|
1348
|
+
} else t23 = $[54];
|
|
1349
|
+
let t24;
|
|
1350
|
+
if ($[55] !== canvasPages || $[56] !== previewedPage || $[57] !== project.data.id || $[58] !== runtimeBasePath || $[59] !== selectedPage || $[60] !== t21 || $[61] !== t23 || $[62] !== viewport) {
|
|
1351
|
+
t24 = /* @__PURE__ */ jsx(CanvasWorkspace, {
|
|
1680
1352
|
ref: workspace,
|
|
1681
|
-
projectId: project.data.id,
|
|
1682
1353
|
pages: canvasPages,
|
|
1683
|
-
blocks: blockCatalog,
|
|
1684
1354
|
selectedPage,
|
|
1685
|
-
selectedBlock,
|
|
1686
1355
|
previewedPage,
|
|
1687
|
-
|
|
1356
|
+
intendedPageKey: t21,
|
|
1688
1357
|
runtimeBasePath,
|
|
1689
1358
|
viewport,
|
|
1690
|
-
onActivate:
|
|
1691
|
-
onSelectionIntent:
|
|
1359
|
+
onActivate: t22,
|
|
1360
|
+
onSelectionIntent: t23
|
|
1692
1361
|
}, project.data.id);
|
|
1693
|
-
$[
|
|
1694
|
-
$[
|
|
1695
|
-
$[
|
|
1696
|
-
$[
|
|
1697
|
-
$[
|
|
1698
|
-
$[
|
|
1699
|
-
$[
|
|
1700
|
-
$[
|
|
1701
|
-
$[
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
t24 = /* @__PURE__ */ jsxs("div", {
|
|
1708
|
-
className: t10,
|
|
1362
|
+
$[55] = canvasPages;
|
|
1363
|
+
$[56] = previewedPage;
|
|
1364
|
+
$[57] = project.data.id;
|
|
1365
|
+
$[58] = runtimeBasePath;
|
|
1366
|
+
$[59] = selectedPage;
|
|
1367
|
+
$[60] = t21;
|
|
1368
|
+
$[61] = t23;
|
|
1369
|
+
$[62] = viewport;
|
|
1370
|
+
$[63] = t24;
|
|
1371
|
+
} else t24 = $[63];
|
|
1372
|
+
let t25;
|
|
1373
|
+
if ($[64] !== t13 || $[65] !== t20 || $[66] !== t24) {
|
|
1374
|
+
t25 = /* @__PURE__ */ jsxs("div", {
|
|
1375
|
+
className: "flex min-h-0 flex-1 overflow-hidden",
|
|
1709
1376
|
children: [
|
|
1710
|
-
|
|
1377
|
+
t13,
|
|
1711
1378
|
t20,
|
|
1712
|
-
|
|
1379
|
+
t24
|
|
1713
1380
|
]
|
|
1714
1381
|
});
|
|
1715
|
-
$[
|
|
1716
|
-
$[
|
|
1717
|
-
$[
|
|
1718
|
-
$[
|
|
1719
|
-
} else
|
|
1720
|
-
return
|
|
1382
|
+
$[64] = t13;
|
|
1383
|
+
$[65] = t20;
|
|
1384
|
+
$[66] = t24;
|
|
1385
|
+
$[67] = t25;
|
|
1386
|
+
} else t25 = $[67];
|
|
1387
|
+
return t25;
|
|
1721
1388
|
}
|
|
1722
|
-
function
|
|
1389
|
+
function _temp5() {
|
|
1723
1390
|
previewStore.send({ type: "clearSelection" });
|
|
1724
|
-
return
|
|
1391
|
+
return _temp4;
|
|
1725
1392
|
}
|
|
1726
|
-
function
|
|
1393
|
+
function _temp4() {
|
|
1727
1394
|
previewStore.send({ type: "clearSelection" });
|
|
1728
1395
|
}
|
|
1729
|
-
function
|
|
1396
|
+
function _temp3(state) {
|
|
1730
1397
|
return state.context.viewportMode;
|
|
1731
1398
|
}
|
|
1732
1399
|
|