camox 0.40.0 → 0.41.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 (108) hide show
  1. package/dist/components/PlatformLabel.js +62 -0
  2. package/dist/core/components/lexical/GradientNode.js +126 -0
  3. package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
  4. package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
  5. package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
  6. package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
  7. package/dist/core/components/lexical/editorConfig.js +25 -7
  8. package/dist/core/components/lexical/selectTextLink.js +21 -0
  9. package/dist/core/createApp.d.ts +30 -17
  10. package/dist/core/createApp.js +14 -3
  11. package/dist/core/createBlock.d.ts +2 -2
  12. package/dist/core/createBlock.js +17 -28
  13. package/dist/core/createLayout.d.ts +48 -4
  14. package/dist/core/createLayout.js +51 -23
  15. package/dist/core/derivedRoutes.js +36 -0
  16. package/dist/core/editing/BlockEditingRuntime.js +4 -4
  17. package/dist/core/editing/CompleteBlockEditingRuntime.js +5 -5
  18. package/dist/core/editing/createEditableBlock.d.ts +9 -8
  19. package/dist/core/editing/createEditableBlock.js +265 -403
  20. package/dist/core/hooks/useIsEditable.js +4 -7
  21. package/dist/core/hooks/useRequireDraftSource.js +7 -11
  22. package/dist/core/lib/lexicalReact.d.ts +1 -26
  23. package/dist/core/lib/lexicalReact.js +46 -60
  24. package/dist/core/lib/lexicalState.js +164 -81
  25. package/dist/core/lib/modifierFormats.js +4 -15
  26. package/dist/core/lib/textStyles.d.ts +27 -0
  27. package/dist/core/lib/textStyles.js +47 -0
  28. package/dist/features/navigation/navigation.d.ts +2 -0
  29. package/dist/features/navigation/navigation.js +51 -46
  30. package/dist/features/page/DerivedPageContent.js +61 -0
  31. package/dist/features/page/PublishedPageContent.js +52 -83
  32. package/dist/features/page/SharedLayoutContent.js +66 -0
  33. package/dist/features/preview/CamoxPreview.d.ts +16 -1
  34. package/dist/features/preview/CamoxPreview.js +246 -290
  35. package/dist/features/preview/DerivedPreview.js +134 -0
  36. package/dist/features/preview/EditablePageExperience.js +25 -8
  37. package/dist/features/preview/components/AddBlockSidebar.js +43 -33
  38. package/dist/features/preview/components/AssetLightbox.js +1 -1
  39. package/dist/features/preview/components/BlockActionsPopover.js +8 -8
  40. package/dist/features/preview/components/BlockThumbnail.js +192 -0
  41. package/dist/features/preview/components/CreatePageModal.js +123 -115
  42. package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
  43. package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
  44. package/dist/features/preview/components/DerivedLayoutSidebar.js +160 -0
  45. package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
  46. package/dist/features/preview/components/FieldToolbar.js +42 -20
  47. package/dist/features/preview/components/Frame.js +133 -140
  48. package/dist/features/preview/components/LeftSidebar.js +42 -38
  49. package/dist/features/preview/components/LinkFieldEditor.js +3 -4
  50. package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
  51. package/dist/features/preview/components/Overlays.js +59 -47
  52. package/dist/features/preview/components/PageEditorSidebar.js +194 -203
  53. package/dist/features/preview/components/PageInfoSidebar.js +63 -55
  54. package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
  55. package/dist/features/preview/components/PagePicker.js +205 -153
  56. package/dist/features/preview/components/PageTree.js +366 -340
  57. package/dist/features/preview/components/PreviewActivation.js +78 -0
  58. package/dist/features/preview/components/PreviewPanel.js +98 -68
  59. package/dist/features/preview/components/PreviewToolbar.js +224 -241
  60. package/dist/features/preview/components/PreviewToolbarSpacer.js +43 -0
  61. package/dist/features/preview/components/PublicationRow.js +425 -0
  62. package/dist/features/preview/components/PublishDialog.js +180 -97
  63. package/dist/features/preview/components/RightSidebar.js +19 -34
  64. package/dist/features/preview/components/previewStyles.js +8 -0
  65. package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
  66. package/dist/features/preview/previewConstants.js +8 -0
  67. package/dist/features/preview/previewStore.js +18 -39
  68. package/dist/features/preview/publication.js +71 -0
  69. package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
  70. package/dist/features/provider/CoreCamoxProvider.js +11 -2
  71. package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
  72. package/dist/features/provider/useAdminShortcuts.js +5 -4
  73. package/dist/features/routes/pageRuntime.d.ts +10 -0
  74. package/dist/features/routes/pageRuntime.js +7 -9
  75. package/dist/features/runtime/PreviewDocumentContext.js +7 -0
  76. package/dist/features/runtime/RuntimeChrome.js +149 -0
  77. package/dist/features/runtime/SharedChromeContext.js +7 -0
  78. package/dist/features/runtime/navigationRequest.js +21 -0
  79. package/dist/features/runtime/navigationTarget.js +23 -0
  80. package/dist/features/runtime/pageApp.js +196 -121
  81. package/dist/features/runtime/pageNavigation.js +79 -130
  82. package/dist/features/runtime/runtime.d.ts +11 -0
  83. package/dist/features/runtime/runtime.js +183 -47
  84. package/dist/features/runtime/studioApp.d.ts +2 -11
  85. package/dist/features/runtime/studioApp.js +14 -177
  86. package/dist/features/studio/CamoxStudio.js +27 -13
  87. package/dist/features/studio/components/Navbar.js +80 -74
  88. package/dist/features/studio/components/UserButton.js +4 -4
  89. package/dist/features/studio/studioTheme.js +25 -0
  90. package/dist/features/studio/useTheme.js +94 -109
  91. package/dist/features/vite/appGeneration.js +12 -3
  92. package/dist/features/vite/definitionsSync.js +4 -2
  93. package/dist/features/vite/layoutGeneration.js +38 -0
  94. package/dist/features/vite/runtimeDev.js +3 -1
  95. package/dist/lib/auth.js +15 -13
  96. package/dist/lib/normalized-data.js +4 -4
  97. package/dist/lib/platform.js +13 -0
  98. package/dist/lib/utils.js +90 -38
  99. package/dist/studio-overlays.css +5 -40
  100. package/dist/studio.css +1 -1
  101. package/package.json +8 -4
  102. package/skills/camox/SKILL.md +2 -0
  103. package/skills/camox/references/block-definitions.md +31 -12
  104. package/skills/camox/references/layout-definitions.md +2 -0
  105. package/dist/core/lib/modifiers.js +0 -24
  106. package/dist/features/preview/components/DraftSwitchDialog.js +0 -66
  107. package/dist/features/preview/previewQueryFns.js +0 -23
  108. package/dist/features/runtime/studioNavigation.js +0 -120
@@ -31,19 +31,20 @@ async function browserNavigate({ replace, to }) {
31
31
  window.dispatchEvent(new PopStateEvent("popstate"));
32
32
  }
33
33
  function NavigationProvider(t0) {
34
- const $ = c(10);
35
- if ($[0] !== "ddcd98e64cdc09695f4e9227379a4d90d1598ced9253a16b3dee21623e108a54") {
36
- for (let $i = 0; $i < 10; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
37
- $[0] = "ddcd98e64cdc09695f4e9227379a4d90d1598ced9253a16b3dee21623e108a54";
34
+ const $ = c(11);
35
+ if ($[0] !== "b077805671357d8c221f5828542d8c58cc7da9751e57801b28455420b1a9209a") {
36
+ for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
37
+ $[0] = "b077805671357d8c221f5828542d8c58cc7da9751e57801b28455420b1a9209a";
38
38
  }
39
- const { children, getLocation: t1, initialLocation, navigate: t2 } = t0;
39
+ const { children, getLocation: t1, initialLocation, location: controlledLocation, navigate: t2 } = t0;
40
40
  const getLocation = t1 === void 0 ? getBrowserLocation : t1;
41
41
  const navigate = t2 === void 0 ? browserNavigate : t2;
42
42
  const [location, setLocation] = React.useState(initialLocation ?? getLocation);
43
43
  let t3;
44
44
  let t4;
45
- if ($[1] !== getLocation) {
45
+ if ($[1] !== controlledLocation || $[2] !== getLocation) {
46
46
  t3 = () => {
47
+ if (controlledLocation) return;
47
48
  const updateLocation = () => setLocation(getLocation());
48
49
  window.addEventListener("popstate", updateLocation);
49
50
  window.addEventListener("camox:navigation", updateLocation);
@@ -52,37 +53,39 @@ function NavigationProvider(t0) {
52
53
  window.removeEventListener("camox:navigation", updateLocation);
53
54
  };
54
55
  };
55
- t4 = [getLocation];
56
- $[1] = getLocation;
57
- $[2] = t3;
58
- $[3] = t4;
56
+ t4 = [getLocation, controlledLocation];
57
+ $[1] = controlledLocation;
58
+ $[2] = getLocation;
59
+ $[3] = t3;
60
+ $[4] = t4;
59
61
  } else {
60
- t3 = $[2];
61
- t4 = $[3];
62
+ t3 = $[3];
63
+ t4 = $[4];
62
64
  }
63
65
  React.useEffect(t3, t4);
64
- let t5;
65
- if ($[4] !== location || $[5] !== navigate) {
66
- t5 = {
67
- location,
66
+ const t5 = controlledLocation ?? location;
67
+ let t6;
68
+ if ($[5] !== navigate || $[6] !== t5) {
69
+ t6 = {
70
+ location: t5,
68
71
  navigate
69
72
  };
70
- $[4] = location;
71
73
  $[5] = navigate;
72
74
  $[6] = t5;
73
- } else t5 = $[6];
74
- const value = t5;
75
- let t6;
76
- if ($[7] !== children || $[8] !== value) {
77
- t6 = /* @__PURE__ */ jsx(NavigationContext.Provider, {
75
+ $[7] = t6;
76
+ } else t6 = $[7];
77
+ const value = t6;
78
+ let t7;
79
+ if ($[8] !== children || $[9] !== value) {
80
+ t7 = /* @__PURE__ */ jsx(NavigationContext.Provider, {
78
81
  value,
79
82
  children
80
83
  });
81
- $[7] = children;
82
- $[8] = value;
83
- $[9] = t6;
84
- } else t6 = $[9];
85
- return t6;
84
+ $[8] = children;
85
+ $[9] = value;
86
+ $[10] = t7;
87
+ } else t7 = $[10];
88
+ return t7;
86
89
  }
87
90
  function useLocation(options) {
88
91
  const context = React.useContext(NavigationContext);
@@ -98,10 +101,10 @@ function useNavigate() {
98
101
  return useNavigate$1();
99
102
  }
100
103
  const Link = React.forwardRef(function Link(props, ref) {
101
- const $ = c(33);
102
- if ($[0] !== "ddcd98e64cdc09695f4e9227379a4d90d1598ced9253a16b3dee21623e108a54") {
103
- for (let $i = 0; $i < 33; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
104
- $[0] = "ddcd98e64cdc09695f4e9227379a4d90d1598ced9253a16b3dee21623e108a54";
104
+ const $ = c(34);
105
+ if ($[0] !== "b077805671357d8c221f5828542d8c58cc7da9751e57801b28455420b1a9209a") {
106
+ for (let $i = 0; $i < 34; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
107
+ $[0] = "b077805671357d8c221f5828542d8c58cc7da9751e57801b28455420b1a9209a";
105
108
  }
106
109
  const context = React.useContext(NavigationContext);
107
110
  if (!context) {
@@ -168,10 +171,11 @@ const Link = React.forwardRef(function Link(props, ref) {
168
171
  } else t3 = $[18];
169
172
  const t4 = t3.join(" ") || void 0;
170
173
  let t5;
171
- if ($[19] !== context || $[20] !== href || $[21] !== onClick || $[22] !== target) {
174
+ if ($[19] !== context || $[20] !== href || $[21] !== onClick || $[22] !== props.download || $[23] !== target) {
172
175
  t5 = (event) => {
173
176
  onClick?.(event);
174
177
  if (event.defaultPrevented) return;
178
+ if (props.download !== void 0) return;
175
179
  if (target && target !== "_self") return;
176
180
  if (event.metaKey || event.altKey || event.ctrlKey || event.shiftKey) return;
177
181
  if (event.button !== 0) return;
@@ -181,11 +185,12 @@ const Link = React.forwardRef(function Link(props, ref) {
181
185
  $[19] = context;
182
186
  $[20] = href;
183
187
  $[21] = onClick;
184
- $[22] = target;
185
- $[23] = t5;
186
- } else t5 = $[23];
188
+ $[22] = props.download;
189
+ $[23] = target;
190
+ $[24] = t5;
191
+ } else t5 = $[24];
187
192
  let t6;
188
- if ($[24] !== activeAnchorProps || $[25] !== children || $[26] !== href || $[27] !== ref || $[28] !== rest || $[29] !== t4 || $[30] !== t5 || $[31] !== target) {
193
+ if ($[25] !== activeAnchorProps || $[26] !== children || $[27] !== href || $[28] !== ref || $[29] !== rest || $[30] !== t4 || $[31] !== t5 || $[32] !== target) {
189
194
  t6 = /* @__PURE__ */ jsx("a", {
190
195
  ...rest,
191
196
  ...activeAnchorProps,
@@ -196,16 +201,16 @@ const Link = React.forwardRef(function Link(props, ref) {
196
201
  onClick: t5,
197
202
  children
198
203
  });
199
- $[24] = activeAnchorProps;
200
- $[25] = children;
201
- $[26] = href;
202
- $[27] = ref;
203
- $[28] = rest;
204
- $[29] = t4;
205
- $[30] = t5;
206
- $[31] = target;
207
- $[32] = t6;
208
- } else t6 = $[32];
204
+ $[25] = activeAnchorProps;
205
+ $[26] = children;
206
+ $[27] = href;
207
+ $[28] = ref;
208
+ $[29] = rest;
209
+ $[30] = t4;
210
+ $[31] = t5;
211
+ $[32] = target;
212
+ $[33] = t6;
213
+ } else t6 = $[33];
209
214
  return t6;
210
215
  });
211
216
  function Navigate({ replace, to }) {
@@ -0,0 +1,61 @@
1
+ import { usePageBlocks } from "../../lib/normalized-data.js";
2
+ import { SharedLayoutContent } from "./SharedLayoutContent.js";
3
+ import { c } from "react/compiler-runtime";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/features/page/DerivedPageContent.tsx
7
+ const EMPTY_PAGE = { blockIds: [] };
8
+ function DerivedPageContent(t0) {
9
+ const $ = c(15);
10
+ if ($[0] !== "6487df3c34ea736b7fe1e429fb8204e3df36577cbc2cd7e7dcc4f965d8f49c56") {
11
+ for (let $i = 0; $i < 15; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
12
+ $[0] = "6487df3c34ea736b7fe1e429fb8204e3df36577cbc2cd7e7dcc4f965d8f49c56";
13
+ }
14
+ const { camoxApp, derived, source } = t0;
15
+ let t1;
16
+ if ($[1] !== derived.layout) {
17
+ t1 = {
18
+ page: EMPTY_PAGE,
19
+ layout: derived.layout
20
+ };
21
+ $[1] = derived.layout;
22
+ $[2] = t1;
23
+ } else t1 = $[2];
24
+ const { beforeBlocks, afterBlocks, layoutFiles, layoutItems } = usePageBlocks(t1, source);
25
+ let t2;
26
+ if ($[3] !== camoxApp || $[4] !== derived.layoutId) {
27
+ t2 = camoxApp.getLayoutById(derived.layoutId);
28
+ $[3] = camoxApp;
29
+ $[4] = derived.layoutId;
30
+ $[5] = t2;
31
+ } else t2 = $[5];
32
+ const layout = t2;
33
+ if (!layout) throw new Error(`Unknown derived layout: ${derived.layoutId}`);
34
+ let t3;
35
+ if ($[6] !== afterBlocks || $[7] !== beforeBlocks) {
36
+ t3 = [...beforeBlocks, ...afterBlocks];
37
+ $[6] = afterBlocks;
38
+ $[7] = beforeBlocks;
39
+ $[8] = t3;
40
+ } else t3 = $[8];
41
+ let t4;
42
+ if ($[9] !== derived.data || $[10] !== layout || $[11] !== layoutFiles || $[12] !== layoutItems || $[13] !== t3) {
43
+ t4 = /* @__PURE__ */ jsx(SharedLayoutContent, {
44
+ layout,
45
+ data: derived.data,
46
+ blocks: t3,
47
+ files: layoutFiles,
48
+ repeatableItems: layoutItems
49
+ });
50
+ $[9] = derived.data;
51
+ $[10] = layout;
52
+ $[11] = layoutFiles;
53
+ $[12] = layoutItems;
54
+ $[13] = t3;
55
+ $[14] = t4;
56
+ } else t4 = $[14];
57
+ return t4;
58
+ }
59
+
60
+ //#endregion
61
+ export { DerivedPageContent };
@@ -5,9 +5,9 @@ import { viewBlockQueries } from "../../lib/view-queries.js";
5
5
  import { NormalizedDataProvider, usePageBlocks } from "../../lib/normalized-data.js";
6
6
  import { BlockErrorBoundary } from "../preview/components/BlockErrorBoundary.js";
7
7
  import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
8
+ import { SharedLayoutContent } from "./SharedLayoutContent.js";
8
9
  import { c } from "react/compiler-runtime";
9
10
  import { useSuspenseQuery } from "@tanstack/react-query";
10
- import "react";
11
11
  import { jsx } from "react/jsx-runtime";
12
12
  import { queryKeys } from "@camox/api-contract/query-keys";
13
13
 
@@ -21,9 +21,9 @@ function pageStructureQueryFn(path, projectSlug, source) {
21
21
  }
22
22
  function PublishedBlock(t0) {
23
23
  const $ = c(21);
24
- if ($[0] !== "6b1d872701fbf673bbf88f17d9fcd827a3ba76fd3c668c35080c3a59e9b03bf1") {
24
+ if ($[0] !== "d19cbe1f618268fc303b4603ba9a175ff1c94ca8d6fa7a8f779112900a3487f5") {
25
25
  for (let $i = 0; $i < 21; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
26
- $[0] = "6b1d872701fbf673bbf88f17d9fcd827a3ba76fd3c668c35080c3a59e9b03bf1";
26
+ $[0] = "d19cbe1f618268fc303b4603ba9a175ff1c94ca8d6fa7a8f779112900a3487f5";
27
27
  }
28
28
  const { blockId, mode, source } = t0;
29
29
  let t1;
@@ -96,10 +96,10 @@ function PublishedBlock(t0) {
96
96
  return t12;
97
97
  }
98
98
  function PublishedPageContent(t0) {
99
- const $ = c(35);
100
- if ($[0] !== "6b1d872701fbf673bbf88f17d9fcd827a3ba76fd3c668c35080c3a59e9b03bf1") {
101
- for (let $i = 0; $i < 35; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
102
- $[0] = "6b1d872701fbf673bbf88f17d9fcd827a3ba76fd3c668c35080c3a59e9b03bf1";
99
+ const $ = c(30);
100
+ if ($[0] !== "d19cbe1f618268fc303b4603ba9a175ff1c94ca8d6fa7a8f779112900a3487f5") {
101
+ for (let $i = 0; $i < 30; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
102
+ $[0] = "d19cbe1f618268fc303b4603ba9a175ff1c94ca8d6fa7a8f779112900a3487f5";
103
103
  }
104
104
  const { source } = t0;
105
105
  const { pathname } = useLocation();
@@ -142,94 +142,63 @@ function PublishedPageContent(t0) {
142
142
  } else t4 = $[13];
143
143
  const layout = t4;
144
144
  let t5;
145
- bb0: {
146
- if (!pageData.layout) {
147
- t5 = null;
148
- break bb0;
149
- }
150
- let blocks;
151
- if ($[14] !== afterBlocks || $[15] !== beforeBlocks) {
152
- blocks = {};
153
- for (const block of [...beforeBlocks, ...afterBlocks]) blocks[block.type] = {
154
- _id: block.id,
155
- type: block.type,
156
- content: block.content,
157
- settings: block.settings,
158
- position: String(block.position)
159
- };
160
- $[14] = afterBlocks;
161
- $[15] = beforeBlocks;
162
- $[16] = blocks;
163
- } else blocks = $[16];
164
- t5 = blocks;
165
- }
166
- const layoutBlocksMap = t5;
167
- let t6;
168
- if ($[17] !== pageBlocks || $[18] !== source) {
169
- let t7;
170
- if ($[20] !== source) {
171
- t7 = (block_0) => /* @__PURE__ */ jsx(BlockErrorBoundary, {
172
- blockId: block_0.id,
173
- blockType: block_0.type,
145
+ if ($[14] !== pageBlocks || $[15] !== source) {
146
+ let t6;
147
+ if ($[17] !== source) {
148
+ t6 = (block) => /* @__PURE__ */ jsx(BlockErrorBoundary, {
149
+ blockId: block.id,
150
+ blockType: block.type,
174
151
  children: /* @__PURE__ */ jsx(PublishedBlock, {
175
- blockId: block_0.id,
152
+ blockId: block.id,
176
153
  mode: "site",
177
154
  source
178
155
  })
179
- }, block_0.id);
180
- $[20] = source;
181
- $[21] = t7;
182
- } else t7 = $[21];
183
- t6 = pageBlocks.map(t7);
184
- $[17] = pageBlocks;
185
- $[18] = source;
186
- $[19] = t6;
187
- } else t6 = $[19];
188
- const pageBlocksContent = t6;
189
- if (!layout || !layoutBlocksMap) {
190
- let t7;
191
- if ($[22] !== pageBlocksContent) {
192
- t7 = /* @__PURE__ */ jsx("main", {
156
+ }, block.id);
157
+ $[17] = source;
158
+ $[18] = t6;
159
+ } else t6 = $[18];
160
+ t5 = pageBlocks.map(t6);
161
+ $[14] = pageBlocks;
162
+ $[15] = source;
163
+ $[16] = t5;
164
+ } else t5 = $[16];
165
+ const pageBlocksContent = t5;
166
+ if (!layout) {
167
+ let t6;
168
+ if ($[19] !== pageBlocksContent) {
169
+ t6 = /* @__PURE__ */ jsx("main", {
193
170
  className: "flex min-h-screen flex-col",
194
171
  children: pageBlocksContent
195
172
  });
196
- $[22] = pageBlocksContent;
197
- $[23] = t7;
198
- } else t7 = $[23];
199
- return t7;
173
+ $[19] = pageBlocksContent;
174
+ $[20] = t6;
175
+ } else t6 = $[20];
176
+ return t6;
200
177
  }
201
- const LayoutComponent = layout._internal.component;
178
+ let t6;
179
+ if ($[21] !== afterBlocks || $[22] !== beforeBlocks) {
180
+ t6 = [...beforeBlocks, ...afterBlocks];
181
+ $[21] = afterBlocks;
182
+ $[22] = beforeBlocks;
183
+ $[23] = t6;
184
+ } else t6 = $[23];
202
185
  let t7;
203
- if ($[24] !== LayoutComponent || $[25] !== pageBlocksContent) {
204
- t7 = /* @__PURE__ */ jsx(LayoutComponent, { children: pageBlocksContent });
205
- $[24] = LayoutComponent;
206
- $[25] = pageBlocksContent;
207
- $[26] = t7;
208
- } else t7 = $[26];
209
- let t8;
210
- if ($[27] !== layout._internal.Provider || $[28] !== layoutBlocksMap || $[29] !== t7) {
211
- t8 = /* @__PURE__ */ jsx(layout._internal.Provider, {
212
- layoutBlocks: layoutBlocksMap,
213
- children: t7
214
- });
215
- $[27] = layout._internal.Provider;
216
- $[28] = layoutBlocksMap;
217
- $[29] = t7;
218
- $[30] = t8;
219
- } else t8 = $[30];
220
- let t9;
221
- if ($[31] !== layoutFiles || $[32] !== layoutItems || $[33] !== t8) {
222
- t9 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
186
+ if ($[24] !== layout || $[25] !== layoutFiles || $[26] !== layoutItems || $[27] !== pageBlocksContent || $[28] !== t6) {
187
+ t7 = /* @__PURE__ */ jsx(SharedLayoutContent, {
188
+ layout,
189
+ blocks: t6,
223
190
  files: layoutFiles,
224
191
  repeatableItems: layoutItems,
225
- children: t8
192
+ children: pageBlocksContent
226
193
  });
227
- $[31] = layoutFiles;
228
- $[32] = layoutItems;
229
- $[33] = t8;
230
- $[34] = t9;
231
- } else t9 = $[34];
232
- return t9;
194
+ $[24] = layout;
195
+ $[25] = layoutFiles;
196
+ $[26] = layoutItems;
197
+ $[27] = pageBlocksContent;
198
+ $[28] = t6;
199
+ $[29] = t7;
200
+ } else t7 = $[29];
201
+ return t7;
233
202
  }
234
203
 
235
204
  //#endregion
@@ -0,0 +1,66 @@
1
+ import { NormalizedDataProvider } from "../../lib/normalized-data.js";
2
+ import { c } from "react/compiler-runtime";
3
+ import "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/features/page/SharedLayoutContent.tsx
7
+ /** Shared before/after rendering for both curated and data-derived pages. */
8
+ function SharedLayoutContent(t0) {
9
+ const $ = c(15);
10
+ if ($[0] !== "ebb40224ff334d8d67c214de65bf725acf95dfbfdf466cb61fb0206cfe7c7851") {
11
+ for (let $i = 0; $i < 15; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
12
+ $[0] = "ebb40224ff334d8d67c214de65bf725acf95dfbfdf466cb61fb0206cfe7c7851";
13
+ }
14
+ const { layout, blocks, files, repeatableItems, data, children } = t0;
15
+ let result;
16
+ if ($[1] !== blocks) {
17
+ result = {};
18
+ for (const block of blocks) result[block.type] = {
19
+ _id: block.id,
20
+ type: block.type,
21
+ content: block.content,
22
+ settings: block.settings,
23
+ position: String(block.position)
24
+ };
25
+ $[1] = blocks;
26
+ $[2] = result;
27
+ } else result = $[2];
28
+ const layoutBlocks = result;
29
+ const Component = layout._internal.component;
30
+ let t1;
31
+ if ($[3] !== Component || $[4] !== children) {
32
+ t1 = /* @__PURE__ */ jsx(Component, { children });
33
+ $[3] = Component;
34
+ $[4] = children;
35
+ $[5] = t1;
36
+ } else t1 = $[5];
37
+ let t2;
38
+ if ($[6] !== data || $[7] !== layout._internal.Provider || $[8] !== layoutBlocks || $[9] !== t1) {
39
+ t2 = /* @__PURE__ */ jsx(layout._internal.Provider, {
40
+ layoutBlocks,
41
+ data,
42
+ children: t1
43
+ });
44
+ $[6] = data;
45
+ $[7] = layout._internal.Provider;
46
+ $[8] = layoutBlocks;
47
+ $[9] = t1;
48
+ $[10] = t2;
49
+ } else t2 = $[10];
50
+ let t3;
51
+ if ($[11] !== files || $[12] !== repeatableItems || $[13] !== t2) {
52
+ t3 = /* @__PURE__ */ jsx(NormalizedDataProvider, {
53
+ files,
54
+ repeatableItems,
55
+ children: t2
56
+ });
57
+ $[11] = files;
58
+ $[12] = repeatableItems;
59
+ $[13] = t2;
60
+ $[14] = t3;
61
+ } else t3 = $[14];
62
+ return t3;
63
+ }
64
+
65
+ //#endregion
66
+ export { SharedLayoutContent };
@@ -1,3 +1,4 @@
1
+ import { DerivedLayoutStructure } from "./components/DerivedLayoutSidebar.js";
1
2
  import * as React from "react";
2
3
  import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
4
 
@@ -47,6 +48,20 @@ declare const CamoxPreview: ({
47
48
  }: {
48
49
  children: React.ReactNode;
49
50
  }) => _$react_jsx_runtime0.JSX.Element;
51
+ /** Studio chrome is shared; only curated previews require a Camox page record. */
52
+ declare const PreviewShell: ({
53
+ children,
54
+ pageData,
55
+ hasLiveVersion,
56
+ derivedLayoutId,
57
+ derivedLayout
58
+ }: {
59
+ children: React.ReactNode;
60
+ pageData?: ReturnType<typeof usePreviewedPage>;
61
+ hasLiveVersion?: boolean;
62
+ derivedLayoutId?: string;
63
+ derivedLayout?: DerivedLayoutStructure;
64
+ }) => _$react_jsx_runtime0.JSX.Element;
50
65
  declare function usePreviewPagesActions(): void;
51
66
  //#endregion
52
- export { CamoxPreview, PageContent, usePreviewPagesActions, usePreviewedPage };
67
+ export { CamoxPreview, PageContent, PreviewShell, usePreviewPagesActions, usePreviewedPage };