camox 0.48.0 → 0.52.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.
Files changed (127) hide show
  1. package/dist/core/createApp.d.ts +1 -0
  2. package/dist/core/createApp.js +1 -0
  3. package/dist/core/editing/contentEdits.js +78 -0
  4. package/dist/core/editing/createEditableBlock.js +277 -311
  5. package/dist/core/layoutContext.d.ts +1 -0
  6. package/dist/core/lib/contentType.js +2 -2
  7. package/dist/core/recordItem.js +3 -3
  8. package/dist/features/canvas/CamoxCanvas.js +15 -15
  9. package/dist/features/canvas/CanvasLoadingScreen.js +15 -11
  10. package/dist/features/canvas/CanvasPageFrame.js +81 -87
  11. package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
  12. package/dist/features/canvas/DerivedPagePathInput.js +12 -12
  13. package/dist/features/canvas/canvasOverlayGeometry.js +1 -1
  14. package/dist/features/canvas/canvasStore.js +2 -2
  15. package/dist/features/canvas/sidebar/CanvasInspector.js +1 -1
  16. package/dist/features/canvas/sidebar/CuratedPageInspector.js +1 -1
  17. package/dist/features/canvas/sidebar/LayoutPageBlocks.js +23 -31
  18. package/dist/features/canvas/useCanvasCamera.js +1 -1
  19. package/dist/features/canvas/useDiscoveredPreviewPaths.js +16 -9
  20. package/dist/features/content/ContentAssets.js +84 -88
  21. package/dist/features/page/CuratedPageContent.js +1 -1
  22. package/dist/features/preview/CamoxPreview.d.ts +8 -4
  23. package/dist/features/preview/CamoxPreview.js +258 -443
  24. package/dist/features/preview/EditablePageContent.js +244 -2
  25. package/dist/features/preview/EditablePageExperience.js +19 -13
  26. package/dist/features/preview/components/AddBlockSheet.js +55 -15
  27. package/dist/features/preview/components/BlockActionsPopover.js +23 -51
  28. package/dist/features/preview/components/BlockPeek.js +66 -0
  29. package/dist/features/preview/components/BlockThumbnail.js +134 -119
  30. package/dist/features/preview/components/CanvasPreview.js +1 -1
  31. package/dist/features/preview/components/CreatePageModal.js +150 -156
  32. package/dist/features/preview/components/FieldToolbar.js +1 -1
  33. package/dist/features/preview/components/Frame.js +27 -4
  34. package/dist/features/preview/components/MobilePreviewDrawer.js +6 -9
  35. package/dist/features/preview/components/PageInfo.js +161 -126
  36. package/dist/features/preview/components/PagePicker.js +2 -2
  37. package/dist/features/preview/components/PageTree.js +174 -190
  38. package/dist/features/preview/components/PreviewPanel.js +13 -67
  39. package/dist/features/preview/components/PreviewToolbar.js +1 -1
  40. package/dist/features/preview/components/ReferenceFieldEditor.js +4 -4
  41. package/dist/features/preview/components/ReferenceListFieldEditor.js +4 -4
  42. package/dist/features/preview/components/RemovedBlockPlaceholder.js +37 -70
  43. package/dist/features/preview/components/RepeatableItemsList.js +1 -1
  44. package/dist/features/preview/components/SelectionEditor.js +248 -256
  45. package/dist/features/preview/components/StudioEditingFallback.js +22 -26
  46. package/dist/features/preview/components/useFieldWriter.js +19 -19
  47. package/dist/features/preview/components/useRecordView.js +105 -147
  48. package/dist/features/preview/components/useRepeatableItemActions.js +0 -2
  49. package/dist/features/preview/pageRecord.js +30 -24
  50. package/dist/features/preview/previewConstants.js +2 -8
  51. package/dist/features/preview/previewStore.js +2 -0
  52. package/dist/features/preview/studioNotice.js +20 -0
  53. package/dist/features/preview/usePreviewViewportActions.js +1 -1
  54. package/dist/features/provider/AuthenticatedCamoxProvider.js +47 -31
  55. package/dist/features/provider/components/CommandPalette.js +2 -5
  56. package/dist/features/provider/signInShortcut.js +1 -2
  57. package/dist/features/provider/useAdminShortcuts.js +47 -53
  58. package/dist/features/renderer/RendererApp.js +542 -0
  59. package/dist/features/renderer/RendererFrames.js +450 -0
  60. package/dist/features/renderer/definitionAnswers.js +26 -0
  61. package/dist/features/renderer/protocol.js +35 -0
  62. package/dist/features/renderer/rendererHost.js +249 -0
  63. package/dist/features/renderer/studioConnection.js +186 -0
  64. package/dist/features/routes/pageRuntime.d.ts +2 -1
  65. package/dist/features/routes/pageRuntime.js +34 -22
  66. package/dist/features/runtime/RuntimeChrome.js +2 -5
  67. package/dist/features/runtime/assetPrefix.js +14 -0
  68. package/dist/features/runtime/breadcrumbs.js +1 -1
  69. package/dist/features/runtime/editingFallback.js +4 -8
  70. package/dist/features/runtime/livePages.js +1 -1
  71. package/dist/features/runtime/pageApp.js +57 -83
  72. package/dist/features/runtime/pageClient.js +1 -1
  73. package/dist/features/runtime/pageNavigation.js +3 -2
  74. package/dist/features/runtime/publicCache.js +95 -0
  75. package/dist/features/runtime/publishingDraft.js +23 -0
  76. package/dist/features/runtime/rendererClient.d.ts +8 -0
  77. package/dist/features/runtime/rendererClient.js +77 -0
  78. package/dist/features/runtime/runtime.d.ts +22 -3
  79. package/dist/features/runtime/runtime.js +209 -96
  80. package/dist/features/runtime/runtimeRoutes.d.ts +2 -0
  81. package/dist/features/runtime/runtimeRoutes.js +2 -0
  82. package/dist/features/runtime/worker.d.ts +14 -1
  83. package/dist/features/runtime/worker.js +34 -4
  84. package/dist/features/settings/AnalyticsSettings.js +622 -0
  85. package/dist/features/settings/CamoxSettings.js +95 -0
  86. package/dist/features/settings/FaviconSettings.js +254 -0
  87. package/dist/features/settings/ProjectNameSettings.js +145 -0
  88. package/dist/features/settings/SettingsPart.js +73 -0
  89. package/dist/features/settings/SocialProfilesSettings.js +245 -0
  90. package/dist/features/settings/useProjectMutation.js +61 -0
  91. package/dist/features/studio/FollowAgentProvider.js +10 -10
  92. package/dist/features/studio/components/DraftsControl.js +136 -131
  93. package/dist/features/studio/components/LocalePicker.js +178 -174
  94. package/dist/features/studio/components/Navbar.js +107 -66
  95. package/dist/features/studio/components/ProjectMenu.js +119 -171
  96. package/dist/features/studio/components/ReviewDraftSheet.js +1151 -991
  97. package/dist/features/studio/components/ThreadMessages.js +100 -65
  98. package/dist/features/studio/components/UserButton.js +2 -2
  99. package/dist/features/studio/routes.js +3 -1
  100. package/dist/features/studio/showInCanvas.js +129 -0
  101. package/dist/features/vite/definitionsSync.js +5 -6
  102. package/dist/features/vite/hostedChecks.js +127 -0
  103. package/dist/features/vite/runtimeDev.js +58 -17
  104. package/dist/features/vite/staticAssetHeaders.js +52 -0
  105. package/dist/features/vite/vite.d.ts +1 -1
  106. package/dist/features/vite/vite.js +49 -9
  107. package/dist/hooks/use-page-destinations.js +10 -10
  108. package/dist/lib/api-client-server.d.ts +1 -1
  109. package/dist/lib/api-client.d.ts +2 -1
  110. package/dist/lib/draft-scope.d.ts +1 -0
  111. package/dist/lib/locale-path.d.ts +3 -11
  112. package/dist/lib/locale-path.js +3 -27
  113. package/dist/lib/queries.js +7 -1
  114. package/dist/lib/revisions.js +20 -0
  115. package/dist/lib/shortcuts.js +29 -0
  116. package/dist/lib/studio-definitions.js +160 -0
  117. package/dist/lib/studio-reads.d.ts +1 -0
  118. package/dist/lib/studio-reads.js +65 -21
  119. package/dist/lib/use-project-room.js +16 -10
  120. package/dist/lib/utils.js +1 -104
  121. package/dist/package.js +1 -1
  122. package/dist/studio.css +1 -1
  123. package/package.json +9 -4
  124. package/skills/camox/SKILL.md +4 -0
  125. package/skills/camox/references/artifacts.md +1 -1
  126. package/dist/features/studio/components/FaviconDialog.js +0 -318
  127. package/dist/features/studio/components/SocialProfilesDialog.js +0 -342
@@ -2,9 +2,7 @@ import { useProjectUuid } from "../../../lib/auth.js";
2
2
  import { useOptionalDraftScope } from "../../../lib/draft-scope.js";
3
3
  import { useViewLocale } from "../../../lib/view-locale-context.js";
4
4
  import { useNavigate } from "../../navigation/navigation.js";
5
- import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
6
5
  import { reads, useReadQuery, useStudioCache } from "../../../lib/studio-reads.js";
7
- import { curatedLayoutContext } from "../../../core/layoutContext.js";
8
6
  import { cn } from "../../../lib/utils.js";
9
7
  import { UploadDropZone } from "../../content/components/UploadDropZone.js";
10
8
  import { pageMutations } from "../../../lib/queries.js";
@@ -14,6 +12,7 @@ import { Metadata, MetadataRow, formatRelativeTime } from "./Metadata.js";
14
12
  import { useLocalizedPath } from "../../../lib/view-locale.js";
15
13
  import { PageNicknameField } from "./PageNicknameField.js";
16
14
  import { PageInfoSkeleton } from "./PageInfoSkeleton.js";
15
+ import { useRendererAnswer } from "../../renderer/RendererFrames.js";
17
16
  import { PageLocationFieldset } from "./PageLocationFieldset.js";
18
17
  import { pageImageUrl } from "../../og/pageImage.js";
19
18
  import { ShikiMarkdown } from "./ShikiMarkdown.js";
@@ -41,9 +40,8 @@ import { Checkbox } from "@camox/ui/checkbox";
41
40
 
42
41
  //#region src/features/preview/components/PageInfo.tsx
43
42
  const usePageMetadataData = (pageId) => {
44
- const $ = c(23);
43
+ const $ = c(31);
45
44
  const projectUuid = useProjectUuid();
46
- const camoxApp = useCamoxApp();
47
45
  let t0;
48
46
  if ($[0] !== pageId) {
49
47
  t0 = reads.page({ id: pageId });
@@ -87,48 +85,79 @@ const usePageMetadataData = (pageId) => {
87
85
  } else t7 = $[11];
88
86
  const { data: allLayouts } = useReadQuery(t5, t7);
89
87
  let t8;
90
- if ($[12] !== allLayouts || $[13] !== camoxApp) {
91
- t8 = allLayouts?.filter((layout) => camoxApp.getLayoutById(layout.layoutId)?._internal.kind === "curated");
88
+ if ($[12] !== allLayouts) {
89
+ t8 = allLayouts?.filter(_temp).map(_temp2);
92
90
  $[12] = allLayouts;
93
- $[13] = camoxApp;
94
- $[14] = t8;
95
- } else t8 = $[14];
91
+ $[13] = t8;
92
+ } else t8 = $[13];
96
93
  const layouts = t8;
97
- const pageLayoutRecord = allLayouts?.find((l) => l.layoutId === page?.layoutId);
98
- const layoutDef = pageLayoutRecord ? camoxApp.getLayoutById(pageLayoutRecord.layoutId) : void 0;
99
- const { locale } = useViewLocale();
100
- const metaTitle = layoutDef && page ? layoutDef._internal.toTitle(curatedLayoutContext({
101
- page,
102
- projectName: project?.name ?? ""
103
- }, locale)) : page?.metaTitle ?? "";
104
94
  let t9;
105
- if ($[15] !== camoxApp || $[16] !== layouts || $[17] !== metaTitle || $[18] !== page || $[19] !== pageLayoutRecord || $[20] !== pages || $[21] !== project) {
106
- t9 = {
95
+ if ($[14] !== allLayouts || $[15] !== page?.layoutId) {
96
+ t9 = allLayouts?.find((l) => l.layoutId === page?.layoutId);
97
+ $[14] = allLayouts;
98
+ $[15] = page?.layoutId;
99
+ $[16] = t9;
100
+ } else t9 = $[16];
101
+ const pageLayoutRecord = t9;
102
+ const { locale } = useViewLocale();
103
+ let t10;
104
+ if ($[17] !== locale || $[18] !== page || $[19] !== pageLayoutRecord || $[20] !== project?.name) {
105
+ t10 = pageLayoutRecord && page ? {
106
+ layoutId: pageLayoutRecord.layoutId,
107
+ page: {
108
+ fullPath: page.fullPath,
109
+ nickname: page.nickname,
110
+ metaTitle: page.metaTitle,
111
+ metaDescription: page.metaDescription,
112
+ firstPublishedAt: page.firstPublishedAt,
113
+ publishedAt: page.publishedAt
114
+ },
115
+ projectName: project?.name ?? "",
116
+ locale
117
+ } : null;
118
+ $[17] = locale;
119
+ $[18] = page;
120
+ $[19] = pageLayoutRecord;
121
+ $[20] = project?.name;
122
+ $[21] = t10;
123
+ } else t10 = $[21];
124
+ const titled = t10;
125
+ let t11;
126
+ if ($[22] !== titled) {
127
+ t11 = titled ? {
128
+ type: "pageTitle",
129
+ ...titled
130
+ } : null;
131
+ $[22] = titled;
132
+ $[23] = t11;
133
+ } else t11 = $[23];
134
+ const metaTitle = useRendererAnswer(t11) ?? page?.metaTitle ?? "";
135
+ let t12;
136
+ if ($[24] !== layouts || $[25] !== metaTitle || $[26] !== page || $[27] !== pageLayoutRecord || $[28] !== pages || $[29] !== project) {
137
+ t12 = {
107
138
  page,
108
139
  project,
109
140
  pages,
110
141
  layouts,
111
142
  pageLayoutRecord,
112
- metaTitle,
113
- camoxApp
143
+ metaTitle
114
144
  };
115
- $[15] = camoxApp;
116
- $[16] = layouts;
117
- $[17] = metaTitle;
118
- $[18] = page;
119
- $[19] = pageLayoutRecord;
120
- $[20] = pages;
121
- $[21] = project;
122
- $[22] = t9;
123
- } else t9 = $[22];
124
- return t9;
145
+ $[24] = layouts;
146
+ $[25] = metaTitle;
147
+ $[26] = page;
148
+ $[27] = pageLayoutRecord;
149
+ $[28] = pages;
150
+ $[29] = project;
151
+ $[30] = t12;
152
+ } else t12 = $[30];
153
+ return t12;
125
154
  };
126
155
  const PAGE_SETTINGS_ITEM = "page-settings";
127
156
  const SHOW_PAGE_SETTINGS_STORAGE_KEY = "camox:studio:showPageSettings";
128
157
  /** Whether the page info shows its settings, remembered across pages and sessions. */
129
158
  const useShowPageSettings = () => {
130
159
  const $ = c(3);
131
- const [show, setShow] = React.useState(_temp);
160
+ const [show, setShow] = React.useState(_temp3);
132
161
  let t0;
133
162
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
134
163
  t0 = (next) => {
@@ -515,7 +544,7 @@ const PageNicknameEditor = (t0) => {
515
544
  nickname,
516
545
  pathSegment: page.pathSegment,
517
546
  parentPageId: page.parentPageId
518
- }, { onError: _temp2 });
547
+ }, { onError: _temp4 });
519
548
  };
520
549
  $[1] = page;
521
550
  $[2] = updatePage;
@@ -584,9 +613,9 @@ const PageNicknameEditor = (t0) => {
584
613
  return t8;
585
614
  };
586
615
  const PageLayoutSelect = (t0) => {
587
- const $ = c(28);
616
+ const $ = c(22);
588
617
  const { data } = t0;
589
- const { page, layouts, camoxApp } = data;
618
+ const { page, layouts } = data;
590
619
  let t1;
591
620
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
592
621
  t1 = pageMutations.setLayout();
@@ -618,7 +647,7 @@ const PageLayoutSelect = (t0) => {
618
647
  setLayout.mutate({
619
648
  id: page.id,
620
649
  layoutId
621
- }, { onError: _temp3 });
650
+ }, { onError: _temp5 });
622
651
  };
623
652
  $[3] = page.id;
624
653
  $[4] = page.layoutId;
@@ -626,60 +655,40 @@ const PageLayoutSelect = (t0) => {
626
655
  $[6] = t5;
627
656
  } else t5 = $[6];
628
657
  let t6;
629
- if ($[7] !== camoxApp || $[8] !== layouts) {
630
- let t7;
631
- if ($[10] !== camoxApp) {
632
- t7 = (t) => ({
633
- value: t.layoutId,
634
- label: camoxApp.getLayoutById(t.layoutId)?._internal.title ?? t.layoutId
635
- });
636
- $[10] = camoxApp;
637
- $[11] = t7;
638
- } else t7 = $[11];
639
- t6 = layouts.map(t7);
640
- $[7] = camoxApp;
641
- $[8] = layouts;
642
- $[9] = t6;
643
- } else t6 = $[9];
658
+ if ($[7] !== layouts) {
659
+ t6 = layouts.map(_temp6);
660
+ $[7] = layouts;
661
+ $[8] = t6;
662
+ } else t6 = $[8];
644
663
  let t7;
645
- if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
664
+ if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
646
665
  t7 = /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a layout" });
647
- $[12] = t7;
648
- } else t7 = $[12];
666
+ $[9] = t7;
667
+ } else t7 = $[9];
649
668
  let t8;
650
- if ($[13] !== setLayout.isPending) {
669
+ if ($[10] !== setLayout.isPending) {
651
670
  t8 = /* @__PURE__ */ jsx(SelectTrigger, {
652
671
  disabled: setLayout.isPending,
653
672
  className: "w-full",
654
673
  children: t7
655
674
  });
656
- $[13] = setLayout.isPending;
657
- $[14] = t8;
658
- } else t8 = $[14];
675
+ $[10] = setLayout.isPending;
676
+ $[11] = t8;
677
+ } else t8 = $[11];
659
678
  let t9;
660
- if ($[15] !== camoxApp || $[16] !== layouts) {
661
- let t10;
662
- if ($[18] !== camoxApp) {
663
- t10 = (t_0) => /* @__PURE__ */ jsx(SelectItem, {
664
- value: t_0.layoutId,
665
- children: camoxApp.getLayoutById(t_0.layoutId)?._internal.title ?? t_0.layoutId
666
- }, t_0.layoutId);
667
- $[18] = camoxApp;
668
- $[19] = t10;
669
- } else t10 = $[19];
670
- t9 = layouts.map(t10);
671
- $[15] = camoxApp;
672
- $[16] = layouts;
673
- $[17] = t9;
674
- } else t9 = $[17];
679
+ if ($[12] !== layouts) {
680
+ t9 = layouts.map(_temp7);
681
+ $[12] = layouts;
682
+ $[13] = t9;
683
+ } else t9 = $[13];
675
684
  let t10;
676
- if ($[20] !== t9) {
685
+ if ($[14] !== t9) {
677
686
  t10 = /* @__PURE__ */ jsx(SelectContent, { children: t9 });
678
- $[20] = t9;
679
- $[21] = t10;
680
- } else t10 = $[21];
687
+ $[14] = t9;
688
+ $[15] = t10;
689
+ } else t10 = $[15];
681
690
  let t11;
682
- if ($[22] !== page.layoutId || $[23] !== t10 || $[24] !== t5 || $[25] !== t6 || $[26] !== t8) {
691
+ if ($[16] !== page.layoutId || $[17] !== t10 || $[18] !== t5 || $[19] !== t6 || $[20] !== t8) {
683
692
  t11 = /* @__PURE__ */ jsxs("div", {
684
693
  className: "space-y-2",
685
694
  children: [t3, /* @__PURE__ */ jsxs(Select, {
@@ -689,13 +698,13 @@ const PageLayoutSelect = (t0) => {
689
698
  children: [t8, t10]
690
699
  })]
691
700
  });
692
- $[22] = page.layoutId;
693
- $[23] = t10;
694
- $[24] = t5;
695
- $[25] = t6;
696
- $[26] = t8;
697
- $[27] = t11;
698
- } else t11 = $[27];
701
+ $[16] = page.layoutId;
702
+ $[17] = t10;
703
+ $[18] = t5;
704
+ $[19] = t6;
705
+ $[20] = t8;
706
+ $[21] = t11;
707
+ } else t11 = $[21];
699
708
  return t11;
700
709
  };
701
710
  const PageStructureModal = (t0) => {
@@ -765,11 +774,11 @@ const PageStructureModal = (t0) => {
765
774
  return t7;
766
775
  };
767
776
  const PageStructureEditor = (t0) => {
768
- const $ = c(37);
777
+ const $ = c(36);
769
778
  const { data, includeNickname: t1, includeLayout: t2, onSaved } = t0;
770
779
  const includeNickname = t1 === void 0 ? true : t1;
771
780
  const includeLayout = t2 === void 0 ? true : t2;
772
- const { page, project, pages, layouts, camoxApp } = data;
781
+ const { page, project, pages, layouts } = data;
773
782
  let t3;
774
783
  if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
775
784
  t3 = pageMutations.update();
@@ -880,7 +889,7 @@ const PageStructureEditor = (t0) => {
880
889
  if ($[16] !== form.Field || $[17] !== includeNickname) {
881
890
  t15 = includeNickname && /* @__PURE__ */ jsx(form.Field, {
882
891
  name: "nickname",
883
- children: _temp4
892
+ children: _temp8
884
893
  });
885
894
  $[16] = form.Field;
886
895
  $[17] = includeNickname;
@@ -913,7 +922,7 @@ const PageStructureEditor = (t0) => {
913
922
  $[23] = t16;
914
923
  } else t16 = $[23];
915
924
  let t17;
916
- if ($[24] !== camoxApp || $[25] !== form.Field || $[26] !== includeLayout || $[27] !== layouts) {
925
+ if ($[24] !== form.Field || $[25] !== includeLayout || $[26] !== layouts) {
917
926
  t17 = includeLayout && layouts && layouts.length > 0 && /* @__PURE__ */ jsx(form.Field, {
918
927
  name: "layoutId",
919
928
  children: (field_0) => /* @__PURE__ */ jsxs("div", {
@@ -923,34 +932,27 @@ const PageStructureEditor = (t0) => {
923
932
  onValueChange: (value) => {
924
933
  if (value != null) field_0.handleChange(value);
925
934
  },
926
- items: layouts.map((t) => ({
927
- value: t.layoutId,
928
- label: camoxApp.getLayoutById(t.layoutId)?._internal.title ?? t.layoutId
929
- })),
930
- children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a layout" }) }), /* @__PURE__ */ jsx(SelectContent, { children: layouts.map((t_0) => /* @__PURE__ */ jsx(SelectItem, {
931
- value: t_0.layoutId,
932
- children: camoxApp.getLayoutById(t_0.layoutId)?._internal.title ?? t_0.layoutId
933
- }, t_0.layoutId)) })]
935
+ items: layouts.map(_temp9),
936
+ children: [/* @__PURE__ */ jsx(SelectTrigger, { children: /* @__PURE__ */ jsx(SelectValue, { placeholder: "Select a layout" }) }), /* @__PURE__ */ jsx(SelectContent, { children: layouts.map(_temp10) })]
934
937
  })]
935
938
  })
936
939
  });
937
- $[24] = camoxApp;
938
- $[25] = form.Field;
939
- $[26] = includeLayout;
940
- $[27] = layouts;
941
- $[28] = t17;
942
- } else t17 = $[28];
940
+ $[24] = form.Field;
941
+ $[25] = includeLayout;
942
+ $[26] = layouts;
943
+ $[27] = t17;
944
+ } else t17 = $[27];
943
945
  let t18;
944
- if ($[29] !== form.Subscribe) {
946
+ if ($[28] !== form.Subscribe) {
945
947
  t18 = /* @__PURE__ */ jsx(form.Subscribe, {
946
- selector: _temp5,
947
- children: _temp6
948
+ selector: _temp11,
949
+ children: _temp12
948
950
  });
949
- $[29] = form.Subscribe;
950
- $[30] = t18;
951
- } else t18 = $[30];
951
+ $[28] = form.Subscribe;
952
+ $[29] = t18;
953
+ } else t18 = $[29];
952
954
  let t19;
953
- if ($[31] !== t14 || $[32] !== t15 || $[33] !== t16 || $[34] !== t17 || $[35] !== t18) {
955
+ if ($[30] !== t14 || $[31] !== t15 || $[32] !== t16 || $[33] !== t17 || $[34] !== t18) {
954
956
  t19 = /* @__PURE__ */ jsxs("form", {
955
957
  onSubmit: t14,
956
958
  className: "space-y-4",
@@ -961,13 +963,13 @@ const PageStructureEditor = (t0) => {
961
963
  t18
962
964
  ]
963
965
  });
964
- $[31] = t14;
965
- $[32] = t15;
966
- $[33] = t16;
967
- $[34] = t17;
968
- $[35] = t18;
969
- $[36] = t19;
970
- } else t19 = $[36];
966
+ $[30] = t14;
967
+ $[31] = t15;
968
+ $[32] = t16;
969
+ $[33] = t17;
970
+ $[34] = t18;
971
+ $[35] = t19;
972
+ } else t19 = $[35];
971
973
  return t19;
972
974
  };
973
975
  const PageSeoSheet = (t0) => {
@@ -1401,7 +1403,7 @@ const SocialPreviewSection = (t0) => {
1401
1403
  onSuccess: () => {
1402
1404
  studioCache.invalidate(reads.page({ id: page.id }));
1403
1405
  },
1404
- onError: _temp7
1406
+ onError: _temp13
1405
1407
  };
1406
1408
  $[17] = page.id;
1407
1409
  $[18] = studioCache;
@@ -1420,7 +1422,7 @@ const SocialPreviewSection = (t0) => {
1420
1422
  onSuccess: () => {
1421
1423
  studioCache.invalidate(reads.page({ id: page.id }));
1422
1424
  },
1423
- onError: _temp8
1425
+ onError: _temp14
1424
1426
  };
1425
1427
  $[21] = page.id;
1426
1428
  $[22] = studioCache;
@@ -1680,32 +1682,65 @@ const PageMarkdownPreview = (t0) => {
1680
1682
  } else t4 = $[7];
1681
1683
  return t4;
1682
1684
  };
1683
- function _temp() {
1685
+ function _temp(layout) {
1686
+ return layout.kind === "curated";
1687
+ }
1688
+ function _temp2(layout_0) {
1689
+ return {
1690
+ ...layout_0,
1691
+ title: layout_0.title ?? layout_0.layoutId
1692
+ };
1693
+ }
1694
+ function _temp3() {
1684
1695
  try {
1685
1696
  return localStorage.getItem(SHOW_PAGE_SETTINGS_STORAGE_KEY) === "true";
1686
1697
  } catch {
1687
1698
  return false;
1688
1699
  }
1689
1700
  }
1690
- function _temp2() {
1701
+ function _temp4() {
1691
1702
  toast.error("Could not update page");
1692
1703
  }
1693
- function _temp3() {
1704
+ function _temp5() {
1694
1705
  toast.error("Could not update page layout");
1695
1706
  }
1696
- function _temp4(field) {
1707
+ function _temp6(t) {
1708
+ return {
1709
+ value: t.layoutId,
1710
+ label: t.title
1711
+ };
1712
+ }
1713
+ function _temp7(t_0) {
1714
+ return /* @__PURE__ */ jsx(SelectItem, {
1715
+ value: t_0.layoutId,
1716
+ children: t_0.title
1717
+ }, t_0.layoutId);
1718
+ }
1719
+ function _temp8(field) {
1697
1720
  return /* @__PURE__ */ jsx(PageNicknameField, {
1698
1721
  value: field.state.value,
1699
1722
  onChange: field.handleChange
1700
1723
  });
1701
1724
  }
1702
- function _temp5(s) {
1725
+ function _temp9(t) {
1726
+ return {
1727
+ value: t.layoutId,
1728
+ label: t.title
1729
+ };
1730
+ }
1731
+ function _temp10(t_0) {
1732
+ return /* @__PURE__ */ jsx(SelectItem, {
1733
+ value: t_0.layoutId,
1734
+ children: t_0.title
1735
+ }, t_0.layoutId);
1736
+ }
1737
+ function _temp11(s) {
1703
1738
  return {
1704
1739
  isSubmitting: s.isSubmitting,
1705
1740
  isPristine: s.isPristine
1706
1741
  };
1707
1742
  }
1708
- function _temp6(t0) {
1743
+ function _temp12(t0) {
1709
1744
  const { isSubmitting, isPristine } = t0;
1710
1745
  return /* @__PURE__ */ jsxs(Button, {
1711
1746
  type: "submit",
@@ -1717,10 +1752,10 @@ function _temp6(t0) {
1717
1752
  ]
1718
1753
  });
1719
1754
  }
1720
- function _temp7(error) {
1755
+ function _temp13(error) {
1721
1756
  toast.error(error.message || "Could not upload image");
1722
1757
  }
1723
- function _temp8() {
1758
+ function _temp14() {
1724
1759
  toast.error("Could not remove image");
1725
1760
  }
1726
1761
 
@@ -1,9 +1,9 @@
1
1
  import { useProjectUuid } from "../../../lib/auth.js";
2
2
  import { useNavigate } from "../../navigation/navigation.js";
3
- import { useCamoxApp } from "../../provider/components/CamoxAppContext.js";
4
3
  import { reads, useReadQuery } from "../../../lib/studio-reads.js";
5
4
  import { cn } from "../../../lib/utils.js";
6
5
  import { pageMutations } from "../../../lib/queries.js";
6
+ import { useRoutableLayouts } from "../../../lib/studio-definitions.js";
7
7
  import { useLocalePath, useLocalizedPath } from "../../../lib/view-locale.js";
8
8
  import { previewStore } from "../previewStore.js";
9
9
  import { matchDerivedLayout, routeSegments } from "../../../core/derivedRoutes.js";
@@ -24,7 +24,7 @@ const CREATE_PAGE_VALUE = "__create_page__";
24
24
  const DERIVED_LAYOUT_PREFIX = "__derived_layout__:";
25
25
  const PagePicker = () => {
26
26
  const [open, setOpen] = React.useState(false);
27
- const derivedLayouts = useCamoxApp().getLayouts().filter((layout) => layout._internal.kind !== "curated");
27
+ const derivedLayouts = useRoutableLayouts().filter((layout) => layout._internal.kind !== "curated");
28
28
  const [layoutToPreview, setLayoutToPreview] = React.useState(null);
29
29
  const [pageToDelete, setPageToDelete] = React.useState(null);
30
30
  const projectUuid = useProjectUuid();