camox 0.40.0 → 0.41.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/components/PlatformLabel.js +62 -0
- package/dist/core/components/lexical/GradientNode.js +126 -0
- package/dist/core/components/lexical/InlineLexicalEditor.js +37 -56
- package/dist/core/components/lexical/InlineStylesPlugin.js +183 -0
- package/dist/core/components/lexical/SelectionBroadcaster.js +49 -46
- package/dist/core/components/lexical/SidebarLexicalEditor.js +197 -151
- package/dist/core/components/lexical/editorConfig.js +25 -7
- package/dist/core/components/lexical/selectTextLink.js +21 -0
- package/dist/core/createApp.d.ts +30 -17
- package/dist/core/createApp.js +14 -3
- package/dist/core/createBlock.d.ts +2 -2
- package/dist/core/createBlock.js +18 -15
- package/dist/core/createLayout.d.ts +48 -4
- package/dist/core/createLayout.js +51 -23
- package/dist/core/derivedRoutes.js +36 -0
- package/dist/core/editing/createEditableBlock.d.ts +9 -8
- package/dist/core/editing/createEditableBlock.js +167 -168
- package/dist/core/lib/lexicalReact.d.ts +1 -26
- package/dist/core/lib/lexicalReact.js +46 -60
- package/dist/core/lib/lexicalState.js +164 -81
- package/dist/core/lib/modifierFormats.js +4 -15
- package/dist/core/lib/textStyles.d.ts +27 -0
- package/dist/core/lib/textStyles.js +47 -0
- package/dist/features/navigation/navigation.d.ts +2 -0
- package/dist/features/navigation/navigation.js +51 -46
- package/dist/features/page/DerivedPageContent.js +61 -0
- package/dist/features/page/PublishedPageContent.js +52 -83
- package/dist/features/page/SharedLayoutContent.js +66 -0
- package/dist/features/preview/CamoxPreview.d.ts +16 -1
- package/dist/features/preview/CamoxPreview.js +242 -265
- package/dist/features/preview/DerivedPreview.js +137 -0
- package/dist/features/preview/EditablePageExperience.js +25 -8
- package/dist/features/preview/components/AddBlockSidebar.js +43 -33
- package/dist/features/preview/components/AssetLightbox.js +1 -1
- package/dist/features/preview/components/BlockThumbnail.js +192 -0
- package/dist/features/preview/components/CreatePageModal.js +123 -115
- package/dist/features/preview/components/DerivedLayoutDialog.js +100 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.d.ts +5 -0
- package/dist/features/preview/components/DerivedLayoutSidebar.js +163 -0
- package/dist/features/preview/components/DerivedPageInfoSidebar.js +57 -0
- package/dist/features/preview/components/FieldToolbar.js +42 -20
- package/dist/features/preview/components/Frame.js +133 -140
- package/dist/features/preview/components/LeftSidebar.js +42 -38
- package/dist/features/preview/components/MobilePreviewDrawer.js +4 -4
- package/dist/features/preview/components/Overlays.js +57 -42
- package/dist/features/preview/components/PageInfoSidebar.js +63 -55
- package/dist/features/preview/components/PageNavigatorSidebar.js +34 -483
- package/dist/features/preview/components/PagePicker.js +205 -153
- package/dist/features/preview/components/PageTree.js +298 -206
- package/dist/features/preview/components/PreviewActivation.js +78 -0
- package/dist/features/preview/components/PreviewPanel.js +67 -35
- package/dist/features/preview/components/PreviewToolbar.js +218 -232
- package/dist/features/preview/components/PublicationRow.js +431 -0
- package/dist/features/preview/components/PublishDialog.js +180 -97
- package/dist/features/preview/components/RightSidebar.js +19 -34
- package/dist/features/preview/components/previewStyles.js +8 -0
- package/dist/features/preview/components/useUpdateBlockPosition.js +7 -13
- package/dist/features/preview/previewConstants.js +8 -0
- package/dist/features/preview/previewStore.js +0 -10
- package/dist/features/preview/publication.js +71 -0
- package/dist/features/provider/AuthenticatedCamoxProvider.js +2 -1
- package/dist/features/provider/CoreCamoxProvider.js +11 -2
- package/dist/features/provider/LocalhostPreviewProvider.js +6 -7
- package/dist/features/routes/pageRuntime.d.ts +10 -0
- package/dist/features/routes/pageRuntime.js +7 -9
- package/dist/features/runtime/PreviewDocumentContext.js +7 -0
- package/dist/features/runtime/RuntimeChrome.js +137 -0
- package/dist/features/runtime/SharedChromeContext.js +7 -0
- package/dist/features/runtime/navigationRequest.js +21 -0
- package/dist/features/runtime/navigationTarget.js +23 -0
- package/dist/features/runtime/pageApp.js +196 -121
- package/dist/features/runtime/pageNavigation.js +79 -130
- package/dist/features/runtime/runtime.d.ts +11 -0
- package/dist/features/runtime/runtime.js +183 -47
- package/dist/features/runtime/studioApp.d.ts +2 -11
- package/dist/features/runtime/studioApp.js +14 -177
- package/dist/features/studio/CamoxStudio.js +27 -13
- package/dist/features/studio/components/Navbar.js +80 -74
- package/dist/features/studio/studioTheme.js +25 -0
- package/dist/features/studio/useTheme.js +94 -109
- package/dist/features/vite/appGeneration.js +12 -3
- package/dist/features/vite/definitionsSync.js +4 -2
- package/dist/features/vite/layoutGeneration.js +38 -0
- package/dist/features/vite/runtimeDev.js +3 -1
- package/dist/lib/auth.js +15 -13
- package/dist/lib/normalized-data.js +4 -4
- package/dist/lib/platform.js +13 -0
- package/dist/lib/utils.js +90 -38
- package/dist/studio-overlays.css +5 -40
- package/dist/studio.css +1 -1
- package/package.json +8 -4
- package/skills/camox/SKILL.md +2 -0
- package/skills/camox/references/block-definitions.md +31 -12
- package/skills/camox/references/layout-definitions.md +2 -0
- package/dist/core/lib/modifiers.js +0 -24
- package/dist/features/preview/previewQueryFns.js +0 -23
- 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(
|
|
35
|
-
if ($[0] !== "
|
|
36
|
-
for (let $i = 0; $i <
|
|
37
|
-
$[0] = "
|
|
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] =
|
|
57
|
-
$[2] =
|
|
58
|
-
$[3] =
|
|
56
|
+
t4 = [getLocation, controlledLocation];
|
|
57
|
+
$[1] = controlledLocation;
|
|
58
|
+
$[2] = getLocation;
|
|
59
|
+
$[3] = t3;
|
|
60
|
+
$[4] = t4;
|
|
59
61
|
} else {
|
|
60
|
-
t3 = $[
|
|
61
|
-
t4 = $[
|
|
62
|
+
t3 = $[3];
|
|
63
|
+
t4 = $[4];
|
|
62
64
|
}
|
|
63
65
|
React.useEffect(t3, t4);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
} else
|
|
85
|
-
return
|
|
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(
|
|
102
|
-
if ($[0] !== "
|
|
103
|
-
for (let $i = 0; $i <
|
|
104
|
-
$[0] = "
|
|
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] =
|
|
185
|
-
$[23] =
|
|
186
|
-
|
|
188
|
+
$[22] = props.download;
|
|
189
|
+
$[23] = target;
|
|
190
|
+
$[24] = t5;
|
|
191
|
+
} else t5 = $[24];
|
|
187
192
|
let t6;
|
|
188
|
-
if ($[
|
|
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
|
-
$[
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
202
|
-
$[
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
} else t6 = $[
|
|
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] !== "
|
|
24
|
+
if ($[0] !== "d19cbe1f618268fc303b4603ba9a175ff1c94ca8d6fa7a8f779112900a3487f5") {
|
|
25
25
|
for (let $i = 0; $i < 21; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
26
|
-
$[0] = "
|
|
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(
|
|
100
|
-
if ($[0] !== "
|
|
101
|
-
for (let $i = 0; $i <
|
|
102
|
-
$[0] = "
|
|
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
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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:
|
|
152
|
+
blockId: block.id,
|
|
176
153
|
mode: "site",
|
|
177
154
|
source
|
|
178
155
|
})
|
|
179
|
-
},
|
|
180
|
-
$[
|
|
181
|
-
$[
|
|
182
|
-
} else
|
|
183
|
-
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
$[
|
|
187
|
-
} else
|
|
188
|
-
const pageBlocksContent =
|
|
189
|
-
if (!layout
|
|
190
|
-
let
|
|
191
|
-
if ($[
|
|
192
|
-
|
|
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
|
-
$[
|
|
197
|
-
$[
|
|
198
|
-
} else
|
|
199
|
-
return
|
|
173
|
+
$[19] = pageBlocksContent;
|
|
174
|
+
$[20] = t6;
|
|
175
|
+
} else t6 = $[20];
|
|
176
|
+
return t6;
|
|
200
177
|
}
|
|
201
|
-
|
|
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] !==
|
|
204
|
-
t7 = /* @__PURE__ */ jsx(
|
|
205
|
-
|
|
206
|
-
|
|
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:
|
|
192
|
+
children: pageBlocksContent
|
|
226
193
|
});
|
|
227
|
-
$[
|
|
228
|
-
$[
|
|
229
|
-
$[
|
|
230
|
-
$[
|
|
231
|
-
|
|
232
|
-
|
|
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 };
|