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.
- package/dist/core/createApp.d.ts +1 -0
- package/dist/core/createApp.js +1 -0
- package/dist/core/editing/contentEdits.js +78 -0
- package/dist/core/editing/createEditableBlock.js +277 -311
- package/dist/core/layoutContext.d.ts +1 -0
- package/dist/core/lib/contentType.js +2 -2
- package/dist/core/recordItem.js +3 -3
- package/dist/features/canvas/CamoxCanvas.js +15 -15
- package/dist/features/canvas/CanvasLoadingScreen.js +15 -11
- package/dist/features/canvas/CanvasPageFrame.js +81 -87
- package/dist/features/canvas/CanvasPreviewPageSlot.js +1 -1
- package/dist/features/canvas/DerivedPagePathInput.js +12 -12
- package/dist/features/canvas/canvasOverlayGeometry.js +1 -1
- package/dist/features/canvas/canvasStore.js +2 -2
- package/dist/features/canvas/sidebar/CanvasInspector.js +1 -1
- package/dist/features/canvas/sidebar/CuratedPageInspector.js +1 -1
- package/dist/features/canvas/sidebar/LayoutPageBlocks.js +23 -31
- package/dist/features/canvas/useCanvasCamera.js +1 -1
- package/dist/features/canvas/useDiscoveredPreviewPaths.js +16 -9
- package/dist/features/content/ContentAssets.js +84 -88
- package/dist/features/page/CuratedPageContent.js +1 -1
- package/dist/features/preview/CamoxPreview.d.ts +8 -4
- package/dist/features/preview/CamoxPreview.js +258 -443
- package/dist/features/preview/EditablePageContent.js +244 -2
- package/dist/features/preview/EditablePageExperience.js +19 -13
- package/dist/features/preview/components/AddBlockSheet.js +55 -15
- package/dist/features/preview/components/BlockActionsPopover.js +23 -51
- package/dist/features/preview/components/BlockPeek.js +66 -0
- package/dist/features/preview/components/BlockThumbnail.js +134 -119
- package/dist/features/preview/components/CanvasPreview.js +1 -1
- package/dist/features/preview/components/CreatePageModal.js +150 -156
- package/dist/features/preview/components/FieldToolbar.js +1 -1
- package/dist/features/preview/components/Frame.js +27 -4
- package/dist/features/preview/components/MobilePreviewDrawer.js +6 -9
- package/dist/features/preview/components/PageInfo.js +161 -126
- package/dist/features/preview/components/PagePicker.js +2 -2
- package/dist/features/preview/components/PageTree.js +174 -190
- package/dist/features/preview/components/PreviewPanel.js +13 -67
- package/dist/features/preview/components/PreviewToolbar.js +1 -1
- package/dist/features/preview/components/ReferenceFieldEditor.js +4 -4
- package/dist/features/preview/components/ReferenceListFieldEditor.js +4 -4
- package/dist/features/preview/components/RemovedBlockPlaceholder.js +37 -70
- package/dist/features/preview/components/RepeatableItemsList.js +1 -1
- package/dist/features/preview/components/SelectionEditor.js +248 -256
- package/dist/features/preview/components/StudioEditingFallback.js +22 -26
- package/dist/features/preview/components/useFieldWriter.js +19 -19
- package/dist/features/preview/components/useRecordView.js +105 -147
- package/dist/features/preview/components/useRepeatableItemActions.js +0 -2
- package/dist/features/preview/pageRecord.js +30 -24
- package/dist/features/preview/previewConstants.js +2 -8
- package/dist/features/preview/previewStore.js +2 -0
- package/dist/features/preview/studioNotice.js +20 -0
- package/dist/features/preview/usePreviewViewportActions.js +1 -1
- package/dist/features/provider/AuthenticatedCamoxProvider.js +47 -31
- package/dist/features/provider/components/CommandPalette.js +2 -5
- package/dist/features/provider/signInShortcut.js +1 -2
- package/dist/features/provider/useAdminShortcuts.js +47 -53
- package/dist/features/renderer/RendererApp.js +542 -0
- package/dist/features/renderer/RendererFrames.js +450 -0
- package/dist/features/renderer/definitionAnswers.js +26 -0
- package/dist/features/renderer/protocol.js +35 -0
- package/dist/features/renderer/rendererHost.js +249 -0
- package/dist/features/renderer/studioConnection.js +186 -0
- package/dist/features/routes/pageRuntime.d.ts +2 -1
- package/dist/features/routes/pageRuntime.js +34 -22
- package/dist/features/runtime/RuntimeChrome.js +2 -5
- package/dist/features/runtime/assetPrefix.js +14 -0
- package/dist/features/runtime/breadcrumbs.js +1 -1
- package/dist/features/runtime/editingFallback.js +4 -8
- package/dist/features/runtime/livePages.js +1 -1
- package/dist/features/runtime/pageApp.js +57 -83
- package/dist/features/runtime/pageClient.js +1 -1
- package/dist/features/runtime/pageNavigation.js +3 -2
- package/dist/features/runtime/publicCache.js +95 -0
- package/dist/features/runtime/publishingDraft.js +23 -0
- package/dist/features/runtime/rendererClient.d.ts +8 -0
- package/dist/features/runtime/rendererClient.js +77 -0
- package/dist/features/runtime/runtime.d.ts +22 -3
- package/dist/features/runtime/runtime.js +209 -96
- package/dist/features/runtime/runtimeRoutes.d.ts +2 -0
- package/dist/features/runtime/runtimeRoutes.js +2 -0
- package/dist/features/runtime/worker.d.ts +14 -1
- package/dist/features/runtime/worker.js +34 -4
- package/dist/features/settings/AnalyticsSettings.js +622 -0
- package/dist/features/settings/CamoxSettings.js +95 -0
- package/dist/features/settings/FaviconSettings.js +254 -0
- package/dist/features/settings/ProjectNameSettings.js +145 -0
- package/dist/features/settings/SettingsPart.js +73 -0
- package/dist/features/settings/SocialProfilesSettings.js +245 -0
- package/dist/features/settings/useProjectMutation.js +61 -0
- package/dist/features/studio/FollowAgentProvider.js +10 -10
- package/dist/features/studio/components/DraftsControl.js +136 -131
- package/dist/features/studio/components/LocalePicker.js +178 -174
- package/dist/features/studio/components/Navbar.js +107 -66
- package/dist/features/studio/components/ProjectMenu.js +119 -171
- package/dist/features/studio/components/ReviewDraftSheet.js +1151 -991
- package/dist/features/studio/components/ThreadMessages.js +100 -65
- package/dist/features/studio/components/UserButton.js +2 -2
- package/dist/features/studio/routes.js +3 -1
- package/dist/features/studio/showInCanvas.js +129 -0
- package/dist/features/vite/definitionsSync.js +5 -6
- package/dist/features/vite/hostedChecks.js +127 -0
- package/dist/features/vite/runtimeDev.js +58 -17
- package/dist/features/vite/staticAssetHeaders.js +52 -0
- package/dist/features/vite/vite.d.ts +1 -1
- package/dist/features/vite/vite.js +49 -9
- package/dist/hooks/use-page-destinations.js +10 -10
- package/dist/lib/api-client-server.d.ts +1 -1
- package/dist/lib/api-client.d.ts +2 -1
- package/dist/lib/draft-scope.d.ts +1 -0
- package/dist/lib/locale-path.d.ts +3 -11
- package/dist/lib/locale-path.js +3 -27
- package/dist/lib/queries.js +7 -1
- package/dist/lib/revisions.js +20 -0
- package/dist/lib/shortcuts.js +29 -0
- package/dist/lib/studio-definitions.js +160 -0
- package/dist/lib/studio-reads.d.ts +1 -0
- package/dist/lib/studio-reads.js +65 -21
- package/dist/lib/use-project-room.js +16 -10
- package/dist/lib/utils.js +1 -104
- package/dist/package.js +1 -1
- package/dist/studio.css +1 -1
- package/package.json +9 -4
- package/skills/camox/SKILL.md +4 -0
- package/skills/camox/references/artifacts.md +1 -1
- package/dist/features/studio/components/FaviconDialog.js +0 -318
- package/dist/features/studio/components/SocialProfilesDialog.js +0 -342
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
import { useProjectUuid } from "../../lib/auth.js";
|
|
2
|
-
import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
3
2
|
import { reads, useReadQueries } from "../../lib/studio-reads.js";
|
|
3
|
+
import { useLayoutDefinitions } from "../../lib/studio-definitions.js";
|
|
4
|
+
import { routeSegments } from "../../core/derivedRoutes.js";
|
|
4
5
|
import { c } from "react/compiler-runtime";
|
|
5
6
|
|
|
6
7
|
//#region src/features/canvas/useDiscoveredPreviewPaths.ts
|
|
7
|
-
/**
|
|
8
|
+
/**
|
|
9
|
+
* Each derived layout's first discovered page, keyed by layout id. Only a layout with params
|
|
10
|
+
* needs one. Whether it discovers pages is its code's to say: the runtime runs it, and answers
|
|
11
|
+
* no page for a layout without routes.
|
|
12
|
+
*/
|
|
8
13
|
function useDiscoveredPreviewPaths(runtimeBasePath) {
|
|
9
14
|
const $ = c(11);
|
|
10
15
|
const projectUuid = useProjectUuid();
|
|
11
|
-
const t0 =
|
|
16
|
+
const t0 = useLayoutDefinitions();
|
|
12
17
|
let ids;
|
|
13
18
|
let t1;
|
|
14
19
|
let t2;
|
|
15
20
|
if ($[0] !== projectUuid || $[1] !== runtimeBasePath || $[2] !== t0) {
|
|
16
|
-
ids = t0.
|
|
21
|
+
ids = t0.filter(_temp2).map(_temp3);
|
|
17
22
|
t1 = useReadQueries;
|
|
18
23
|
let t3;
|
|
19
24
|
if ($[6] !== projectUuid || $[7] !== runtimeBasePath) {
|
|
@@ -49,13 +54,15 @@ function useDiscoveredPreviewPaths(runtimeBasePath) {
|
|
|
49
54
|
} else t3 = $[10];
|
|
50
55
|
return t1(t2, t3);
|
|
51
56
|
}
|
|
52
|
-
function
|
|
53
|
-
const {
|
|
54
|
-
const { id } = t1;
|
|
57
|
+
function _temp3(t0) {
|
|
58
|
+
const { id } = t0;
|
|
55
59
|
return id;
|
|
56
60
|
}
|
|
57
|
-
function
|
|
58
|
-
return layout.
|
|
61
|
+
function _temp2(layout) {
|
|
62
|
+
return layout.kind === "derived" && routeSegments(layout.id).some(_temp);
|
|
63
|
+
}
|
|
64
|
+
function _temp(segment) {
|
|
65
|
+
return segment.startsWith("$");
|
|
59
66
|
}
|
|
60
67
|
|
|
61
68
|
//#endregion
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { useProjectUuid } from "../../lib/auth.js";
|
|
2
2
|
import { reads, useReadQuery } from "../../lib/studio-reads.js";
|
|
3
|
-
import { checkIfInputFocused } from "../../lib/utils.js";
|
|
4
3
|
import { UploadDropZone } from "./components/UploadDropZone.js";
|
|
5
4
|
import { UploadProgressDrawer } from "./components/UploadProgressDrawer.js";
|
|
6
5
|
import { useFileUpload } from "../../hooks/use-file-upload.js";
|
|
@@ -10,12 +9,13 @@ import { AssetCard } from "./components/AssetCard.js";
|
|
|
10
9
|
import { useMarqueeSelection } from "../../hooks/use-marquee-selection.js";
|
|
11
10
|
import { AssetCardSkeleton } from "./components/AssetCardSkeleton.js";
|
|
12
11
|
import { c } from "react/compiler-runtime";
|
|
13
|
-
import {
|
|
12
|
+
import { useRef, useState } from "react";
|
|
14
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
14
|
import { useMutation } from "@tanstack/react-query";
|
|
16
15
|
import { Button } from "@camox/ui/button";
|
|
17
16
|
import { PanelContent } from "@camox/ui/panel";
|
|
18
17
|
import { ImageIcon, UploadIcon } from "lucide-react";
|
|
18
|
+
import { useHotkey } from "@tanstack/react-hotkeys";
|
|
19
19
|
import { FloatingToolbar } from "@camox/ui/floating-toolbar";
|
|
20
20
|
|
|
21
21
|
//#region src/features/content/ContentAssets.tsx
|
|
@@ -74,31 +74,27 @@ const ContentAssets = () => {
|
|
|
74
74
|
$[10] = t8;
|
|
75
75
|
} else t8 = $[10];
|
|
76
76
|
const { selectionRect, didDragRef, handlers } = useMarqueeSelection(containerRef, t8);
|
|
77
|
-
let t10;
|
|
78
77
|
let t9;
|
|
79
|
-
if ($[11]
|
|
80
|
-
t9 = () =>
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
78
|
+
if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
79
|
+
t9 = () => setSelectedIds(_temp);
|
|
80
|
+
$[11] = t9;
|
|
81
|
+
} else t9 = $[11];
|
|
82
|
+
const t10 = lightboxFileId === null;
|
|
83
|
+
let t11;
|
|
84
|
+
if ($[12] !== t10) {
|
|
85
|
+
t11 = {
|
|
86
|
+
enabled: t10,
|
|
87
|
+
ignoreInputs: true,
|
|
88
|
+
preventDefault: false,
|
|
89
|
+
stopPropagation: false
|
|
89
90
|
};
|
|
90
|
-
t10 = [lightboxFileId];
|
|
91
|
-
$[11] = lightboxFileId;
|
|
92
91
|
$[12] = t10;
|
|
93
|
-
$[13] =
|
|
94
|
-
} else
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
useEffect(t9, t10);
|
|
99
|
-
let t11;
|
|
92
|
+
$[13] = t11;
|
|
93
|
+
} else t11 = $[13];
|
|
94
|
+
useHotkey("Escape", t9, t11);
|
|
95
|
+
let t12;
|
|
100
96
|
if ($[14] !== didDragRef) {
|
|
101
|
-
|
|
97
|
+
t12 = () => {
|
|
102
98
|
if (didDragRef.current) {
|
|
103
99
|
didDragRef.current = false;
|
|
104
100
|
return;
|
|
@@ -106,20 +102,20 @@ const ContentAssets = () => {
|
|
|
106
102
|
setSelectedIds(/* @__PURE__ */ new Set());
|
|
107
103
|
};
|
|
108
104
|
$[14] = didDragRef;
|
|
109
|
-
$[15] =
|
|
110
|
-
} else
|
|
111
|
-
let
|
|
105
|
+
$[15] = t12;
|
|
106
|
+
} else t12 = $[15];
|
|
107
|
+
let t13;
|
|
112
108
|
if ($[16] !== files) {
|
|
113
|
-
|
|
109
|
+
t13 = files === void 0 && /* @__PURE__ */ jsx("div", {
|
|
114
110
|
className: "grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-4",
|
|
115
111
|
children: Array.from({ length: 12 }, _temp2)
|
|
116
112
|
});
|
|
117
113
|
$[16] = files;
|
|
118
|
-
$[17] =
|
|
119
|
-
} else
|
|
120
|
-
let
|
|
114
|
+
$[17] = t13;
|
|
115
|
+
} else t13 = $[17];
|
|
116
|
+
let t14;
|
|
121
117
|
if ($[18] !== files?.length || $[19] !== uploadFiles) {
|
|
122
|
-
|
|
118
|
+
t14 = files?.length === 0 && /* @__PURE__ */ jsx("div", {
|
|
123
119
|
className: "flex h-full items-center justify-center",
|
|
124
120
|
children: /* @__PURE__ */ jsxs("div", {
|
|
125
121
|
className: "flex max-w-sm flex-col items-center gap-2 text-center",
|
|
@@ -150,9 +146,9 @@ const ContentAssets = () => {
|
|
|
150
146
|
type: "file",
|
|
151
147
|
className: "sr-only",
|
|
152
148
|
multiple: true,
|
|
153
|
-
onChange: (
|
|
154
|
-
if (
|
|
155
|
-
|
|
149
|
+
onChange: (event) => {
|
|
150
|
+
if (event.target.files) uploadFiles(event.target.files);
|
|
151
|
+
event.target.value = "";
|
|
156
152
|
}
|
|
157
153
|
})
|
|
158
154
|
]
|
|
@@ -162,11 +158,11 @@ const ContentAssets = () => {
|
|
|
162
158
|
});
|
|
163
159
|
$[18] = files?.length;
|
|
164
160
|
$[19] = uploadFiles;
|
|
165
|
-
$[20] =
|
|
166
|
-
} else
|
|
167
|
-
let
|
|
161
|
+
$[20] = t14;
|
|
162
|
+
} else t14 = $[20];
|
|
163
|
+
let t15;
|
|
168
164
|
if ($[21] !== files || $[22] !== selectedIds) {
|
|
169
|
-
|
|
165
|
+
t15 = files && files.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
170
166
|
className: "grid grid-cols-[repeat(auto-fill,minmax(220px,1fr))] gap-4",
|
|
171
167
|
children: files.map((file) => /* @__PURE__ */ jsx(AssetCard, {
|
|
172
168
|
file,
|
|
@@ -184,11 +180,11 @@ const ContentAssets = () => {
|
|
|
184
180
|
});
|
|
185
181
|
$[21] = files;
|
|
186
182
|
$[22] = selectedIds;
|
|
187
|
-
$[23] =
|
|
188
|
-
} else
|
|
189
|
-
let
|
|
183
|
+
$[23] = t15;
|
|
184
|
+
} else t15 = $[23];
|
|
185
|
+
let t16;
|
|
190
186
|
if ($[24] !== selectionRect) {
|
|
191
|
-
|
|
187
|
+
t16 = selectionRect && /* @__PURE__ */ jsx("div", {
|
|
192
188
|
className: "border-primary bg-primary/10 pointer-events-none absolute z-50 border",
|
|
193
189
|
style: {
|
|
194
190
|
left: selectionRect.left,
|
|
@@ -198,61 +194,61 @@ const ContentAssets = () => {
|
|
|
198
194
|
}
|
|
199
195
|
});
|
|
200
196
|
$[24] = selectionRect;
|
|
201
|
-
$[25] =
|
|
202
|
-
} else
|
|
203
|
-
let
|
|
204
|
-
if ($[26] !== handlers.onPointerDown || $[27] !== handlers.onPointerMove || $[28] !== handlers.onPointerUp || $[29] !==
|
|
205
|
-
|
|
197
|
+
$[25] = t16;
|
|
198
|
+
} else t16 = $[25];
|
|
199
|
+
let t17;
|
|
200
|
+
if ($[26] !== handlers.onPointerDown || $[27] !== handlers.onPointerMove || $[28] !== handlers.onPointerUp || $[29] !== t12 || $[30] !== t13 || $[31] !== t14 || $[32] !== t15 || $[33] !== t16) {
|
|
201
|
+
t17 = /* @__PURE__ */ jsxs(PanelContent, {
|
|
206
202
|
ref: containerRef,
|
|
207
203
|
className: "relative p-4 select-none",
|
|
208
|
-
onClick:
|
|
204
|
+
onClick: t12,
|
|
209
205
|
onPointerDown: handlers.onPointerDown,
|
|
210
206
|
onPointerMove: handlers.onPointerMove,
|
|
211
207
|
onPointerUp: handlers.onPointerUp,
|
|
212
208
|
children: [
|
|
213
|
-
t12,
|
|
214
209
|
t13,
|
|
215
210
|
t14,
|
|
216
|
-
t15
|
|
211
|
+
t15,
|
|
212
|
+
t16
|
|
217
213
|
]
|
|
218
214
|
});
|
|
219
215
|
$[26] = handlers.onPointerDown;
|
|
220
216
|
$[27] = handlers.onPointerMove;
|
|
221
217
|
$[28] = handlers.onPointerUp;
|
|
222
|
-
$[29] =
|
|
223
|
-
$[30] =
|
|
224
|
-
$[31] =
|
|
225
|
-
$[32] =
|
|
226
|
-
$[33] =
|
|
227
|
-
$[34] =
|
|
228
|
-
} else
|
|
229
|
-
let
|
|
230
|
-
if ($[35] !==
|
|
231
|
-
|
|
218
|
+
$[29] = t12;
|
|
219
|
+
$[30] = t13;
|
|
220
|
+
$[31] = t14;
|
|
221
|
+
$[32] = t15;
|
|
222
|
+
$[33] = t16;
|
|
223
|
+
$[34] = t17;
|
|
224
|
+
} else t17 = $[34];
|
|
225
|
+
let t18;
|
|
226
|
+
if ($[35] !== t17 || $[36] !== uploadFiles) {
|
|
227
|
+
t18 = /* @__PURE__ */ jsx("div", {
|
|
232
228
|
className: "flex min-h-0 min-w-0 flex-1 flex-col",
|
|
233
229
|
children: /* @__PURE__ */ jsx(UploadDropZone, {
|
|
234
230
|
onDrop: uploadFiles,
|
|
235
231
|
className: "flex min-h-0 flex-1 flex-col",
|
|
236
|
-
children:
|
|
232
|
+
children: t17
|
|
237
233
|
})
|
|
238
234
|
});
|
|
239
|
-
$[35] =
|
|
235
|
+
$[35] = t17;
|
|
240
236
|
$[36] = uploadFiles;
|
|
241
|
-
$[37] =
|
|
242
|
-
} else
|
|
243
|
-
let
|
|
237
|
+
$[37] = t18;
|
|
238
|
+
} else t18 = $[37];
|
|
239
|
+
let t19;
|
|
244
240
|
if ($[38] !== clearAll || $[39] !== uploads) {
|
|
245
|
-
|
|
241
|
+
t19 = /* @__PURE__ */ jsx(UploadProgressDrawer, {
|
|
246
242
|
uploads,
|
|
247
243
|
onClose: clearAll
|
|
248
244
|
});
|
|
249
245
|
$[38] = clearAll;
|
|
250
246
|
$[39] = uploads;
|
|
251
|
-
$[40] =
|
|
252
|
-
} else
|
|
253
|
-
let
|
|
247
|
+
$[40] = t19;
|
|
248
|
+
} else t19 = $[40];
|
|
249
|
+
let t20;
|
|
254
250
|
if ($[41] !== deleteFiles || $[42] !== selectedIds) {
|
|
255
|
-
|
|
251
|
+
t20 = selectedIds.size > 0 && /* @__PURE__ */ jsxs(FloatingToolbar, {
|
|
256
252
|
className: "bottom-4 min-w-xs justify-between gap-4 pl-3",
|
|
257
253
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
258
254
|
className: "text-muted-foreground",
|
|
@@ -274,11 +270,11 @@ const ContentAssets = () => {
|
|
|
274
270
|
});
|
|
275
271
|
$[41] = deleteFiles;
|
|
276
272
|
$[42] = selectedIds;
|
|
277
|
-
$[43] =
|
|
278
|
-
} else
|
|
279
|
-
let
|
|
273
|
+
$[43] = t20;
|
|
274
|
+
} else t20 = $[43];
|
|
275
|
+
let t21;
|
|
280
276
|
if ($[44] !== lightboxFileId) {
|
|
281
|
-
|
|
277
|
+
t21 = lightboxFileId && /* @__PURE__ */ jsx(AssetLightbox, {
|
|
282
278
|
open: true,
|
|
283
279
|
onOpenChange: (open) => {
|
|
284
280
|
if (!open) setLightboxFileId(null);
|
|
@@ -286,23 +282,23 @@ const ContentAssets = () => {
|
|
|
286
282
|
fileId: lightboxFileId
|
|
287
283
|
});
|
|
288
284
|
$[44] = lightboxFileId;
|
|
289
|
-
$[45] =
|
|
290
|
-
} else
|
|
291
|
-
let
|
|
292
|
-
if ($[46] !==
|
|
293
|
-
|
|
294
|
-
t17,
|
|
285
|
+
$[45] = t21;
|
|
286
|
+
} else t21 = $[45];
|
|
287
|
+
let t22;
|
|
288
|
+
if ($[46] !== t18 || $[47] !== t19 || $[48] !== t20 || $[49] !== t21) {
|
|
289
|
+
t22 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
295
290
|
t18,
|
|
296
291
|
t19,
|
|
297
|
-
t20
|
|
292
|
+
t20,
|
|
293
|
+
t21
|
|
298
294
|
] });
|
|
299
|
-
$[46] =
|
|
300
|
-
$[47] =
|
|
301
|
-
$[48] =
|
|
302
|
-
$[49] =
|
|
303
|
-
$[50] =
|
|
304
|
-
} else
|
|
305
|
-
return
|
|
295
|
+
$[46] = t18;
|
|
296
|
+
$[47] = t19;
|
|
297
|
+
$[48] = t20;
|
|
298
|
+
$[49] = t21;
|
|
299
|
+
$[50] = t22;
|
|
300
|
+
} else t22 = $[50];
|
|
301
|
+
return t22;
|
|
306
302
|
};
|
|
307
303
|
function _temp(prev) {
|
|
308
304
|
return prev.size === 0 ? prev : /* @__PURE__ */ new Set();
|
|
@@ -4,8 +4,8 @@ import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
|
4
4
|
import { NormalizedDataProvider, usePageBlocks } from "../../lib/normalized-data.js";
|
|
5
5
|
import { reads, useRead } from "../../lib/studio-reads.js";
|
|
6
6
|
import { BlockErrorBoundary } from "../preview/components/BlockErrorBoundary.js";
|
|
7
|
-
import { curatedLayoutContext } from "../../core/layoutContext.js";
|
|
8
7
|
import { useLocalePath } from "../../lib/view-locale.js";
|
|
8
|
+
import { curatedLayoutContext } from "../../core/layoutContext.js";
|
|
9
9
|
import { SharedLayoutContent } from "./SharedLayoutContent.js";
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import * as React from "react";
|
|
@@ -6,15 +6,17 @@ import * as React from "react";
|
|
|
6
6
|
//#region src/features/preview/CamoxPreview.d.ts
|
|
7
7
|
/** The page the Preview shows: as the server rendered it, then following edits. */
|
|
8
8
|
export declare function usePreviewedPage(): PageStructure;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The signed-in Website Section. The studio never renders the page itself: the renderer frame,
|
|
11
|
+
* which runs the shown draft's code, renders it into the Preview's slot.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CamoxPreview: ({ runtimeBasePath, derived, canvasOnly }: {
|
|
12
14
|
runtimeBasePath?: string;
|
|
13
15
|
derived?: PageRenderInput["derived"];
|
|
14
16
|
canvasOnly?: PageRenderInput["canvasOnly"];
|
|
15
17
|
}) => React.JSX.Element;
|
|
16
18
|
/** Studio chrome is shared; only curated previews require a Camox page record. */
|
|
17
|
-
export declare const PreviewShell: ({ children, pageData, derivedLayout, pageLocation, canvasOnly, runtimeBasePath }: {
|
|
19
|
+
export declare const PreviewShell: ({ children, pageData, derivedLayout, pageLocation, canvasOnly, runtimeBasePath, pageShown }: {
|
|
18
20
|
children: React.ReactNode;
|
|
19
21
|
pageData?: ReturnType<typeof usePreviewedPage>;
|
|
20
22
|
derivedLayout?: LayoutStructure;
|
|
@@ -22,6 +24,8 @@ export declare const PreviewShell: ({ children, pageData, derivedLayout, pageLoc
|
|
|
22
24
|
pageLocation?: LocationState;
|
|
23
25
|
canvasOnly?: PageRenderInput["canvasOnly"];
|
|
24
26
|
runtimeBasePath?: string;
|
|
27
|
+
/** Whether the Preview's page showed: until then, a loading screen covers the Preview. */
|
|
28
|
+
pageShown?: boolean;
|
|
25
29
|
}) => React.JSX.Element;
|
|
26
30
|
/** Zooms out to the whole Canvas, from anywhere in the site or the Studio. */
|
|
27
31
|
export declare function useShowCanvasAction(): void;
|