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
|
@@ -7,17 +7,18 @@ import { BlockErrorBoundary } from "./components/BlockErrorBoundary.js";
|
|
|
7
7
|
import { blockQueries, pageQueries, projectQueries } from "../../lib/queries.js";
|
|
8
8
|
import { cn } from "../../lib/utils.js";
|
|
9
9
|
import { useCamoxApp } from "../provider/components/CamoxAppContext.js";
|
|
10
|
+
import { SharedChromeContext } from "../runtime/SharedChromeContext.js";
|
|
10
11
|
import { previewStore } from "./previewStore.js";
|
|
11
12
|
import { Navbar } from "../studio/components/Navbar.js";
|
|
12
13
|
import { CreatePageModal } from "./components/CreatePageModal.js";
|
|
13
14
|
import { DraftSwitchDialog } from "./components/DraftSwitchDialog.js";
|
|
15
|
+
import { EDIT_MODE_SHORTCUT } from "./previewConstants.js";
|
|
14
16
|
import { LeftSidebar } from "./components/LeftSidebar.js";
|
|
15
17
|
import { PeekedBlock } from "./components/PeekedBlock.js";
|
|
16
18
|
import { PreviewPanel } from "./components/PreviewPanel.js";
|
|
17
19
|
import { RightSidebar } from "./components/RightSidebar.js";
|
|
18
|
-
import { pageFullQueryFn } from "./previewQueryFns.js";
|
|
19
20
|
import { c } from "react/compiler-runtime";
|
|
20
|
-
import {
|
|
21
|
+
import { useQuery, useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
|
|
21
22
|
import * as React from "react";
|
|
22
23
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
23
24
|
import { useSelector } from "@xstate/store-react";
|
|
@@ -35,15 +36,14 @@ function getMobileStudioSnapshot() {
|
|
|
35
36
|
}
|
|
36
37
|
function useIsMobileStudio() {
|
|
37
38
|
const $ = c(1);
|
|
38
|
-
if ($[0] !== "
|
|
39
|
+
if ($[0] !== "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a") {
|
|
39
40
|
for (let $i = 0; $i < 1; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
40
|
-
$[0] = "
|
|
41
|
+
$[0] = "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a";
|
|
41
42
|
}
|
|
42
43
|
return React.useSyncExternalStore(subscribeToMobileStudio, getMobileStudioSnapshot, _temp);
|
|
43
44
|
}
|
|
44
45
|
/**
|
|
45
46
|
* Fetches the current page being previewed, with live updates for authenticated users.
|
|
46
|
-
* Also will switch to peeked page data if there is one.
|
|
47
47
|
*
|
|
48
48
|
* Data for the current route is guaranteed in queryClient cache from the loader's
|
|
49
49
|
* ensureQueryData. Live updates are gated by useProjectRoom only running in
|
|
@@ -70,112 +70,54 @@ function pageStructureQueryFn(path, projectSlug, source) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
function usePreviewedPage() {
|
|
73
|
-
const $ = c(
|
|
74
|
-
if ($[0] !== "
|
|
75
|
-
for (let $i = 0; $i <
|
|
76
|
-
$[0] = "
|
|
73
|
+
const $ = c(11);
|
|
74
|
+
if ($[0] !== "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a") {
|
|
75
|
+
for (let $i = 0; $i < 11; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
76
|
+
$[0] = "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a";
|
|
77
77
|
}
|
|
78
78
|
const { pathname } = useLocation();
|
|
79
|
-
const queryClient = useQueryClient();
|
|
80
79
|
const projectSlug = useProjectSlug();
|
|
81
|
-
const
|
|
82
|
-
const previewSource = useSelector(previewStore, _temp3);
|
|
83
|
-
const prevPathnameRef = React.useRef(pathname);
|
|
80
|
+
const previewSource = useSelector(previewStore, _temp2);
|
|
84
81
|
let t0;
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
t0 = () => {
|
|
88
|
-
if (prevPathnameRef.current !== pathname) {
|
|
89
|
-
prevPathnameRef.current = pathname;
|
|
90
|
-
previewStore.send({ type: "clearPeekedPage" });
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
t1 = [pathname];
|
|
82
|
+
if ($[1] !== pathname || $[2] !== previewSource) {
|
|
83
|
+
t0 = queryKeys.pages.getByPath(pathname, previewSource);
|
|
94
84
|
$[1] = pathname;
|
|
95
|
-
$[2] =
|
|
96
|
-
$[3] =
|
|
97
|
-
} else
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
React.useEffect(t0, t1);
|
|
102
|
-
let t2;
|
|
103
|
-
if ($[4] !== pathname || $[5] !== previewSource) {
|
|
104
|
-
t2 = queryKeys.pages.getByPath(pathname, previewSource);
|
|
85
|
+
$[2] = previewSource;
|
|
86
|
+
$[3] = t0;
|
|
87
|
+
} else t0 = $[3];
|
|
88
|
+
let t1;
|
|
89
|
+
if ($[4] !== pathname || $[5] !== previewSource || $[6] !== projectSlug) {
|
|
90
|
+
t1 = pageStructureQueryFn(pathname, projectSlug, previewSource);
|
|
105
91
|
$[4] = pathname;
|
|
106
92
|
$[5] = previewSource;
|
|
107
|
-
$[6] =
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
$[10] = t3;
|
|
116
|
-
} else t3 = $[10];
|
|
117
|
-
let t4;
|
|
118
|
-
if ($[11] !== t2 || $[12] !== t3) {
|
|
119
|
-
t4 = {
|
|
120
|
-
queryKey: t2,
|
|
121
|
-
queryFn: t3,
|
|
122
|
-
staleTime: Infinity
|
|
123
|
-
};
|
|
124
|
-
$[11] = t2;
|
|
125
|
-
$[12] = t3;
|
|
126
|
-
$[13] = t4;
|
|
127
|
-
} else t4 = $[13];
|
|
128
|
-
const { data: currentPage } = useSuspenseQuery(t4);
|
|
129
|
-
const isAuthenticated = useIsAuthenticated();
|
|
130
|
-
let t5;
|
|
131
|
-
if ($[14] !== peekedPagePathname || $[15] !== previewSource) {
|
|
132
|
-
t5 = queryKeys.pages.getByPath(peekedPagePathname ?? "", previewSource);
|
|
133
|
-
$[14] = peekedPagePathname;
|
|
134
|
-
$[15] = previewSource;
|
|
135
|
-
$[16] = t5;
|
|
136
|
-
} else t5 = $[16];
|
|
137
|
-
const t6 = peekedPagePathname ?? "";
|
|
138
|
-
let t7;
|
|
139
|
-
if ($[17] !== previewSource || $[18] !== projectSlug || $[19] !== queryClient || $[20] !== t6) {
|
|
140
|
-
t7 = pageFullQueryFn(queryClient, t6, projectSlug, previewSource);
|
|
141
|
-
$[17] = previewSource;
|
|
142
|
-
$[18] = projectSlug;
|
|
143
|
-
$[19] = queryClient;
|
|
144
|
-
$[20] = t6;
|
|
145
|
-
$[21] = t7;
|
|
146
|
-
} else t7 = $[21];
|
|
147
|
-
const t8 = isAuthenticated && !!peekedPagePathname;
|
|
148
|
-
let t9;
|
|
149
|
-
if ($[22] !== t5 || $[23] !== t7 || $[24] !== t8) {
|
|
150
|
-
t9 = {
|
|
151
|
-
queryKey: t5,
|
|
152
|
-
queryFn: t7,
|
|
153
|
-
enabled: t8,
|
|
154
|
-
placeholderData: keepPreviousData,
|
|
93
|
+
$[6] = projectSlug;
|
|
94
|
+
$[7] = t1;
|
|
95
|
+
} else t1 = $[7];
|
|
96
|
+
let t2;
|
|
97
|
+
if ($[8] !== t0 || $[9] !== t1) {
|
|
98
|
+
t2 = {
|
|
99
|
+
queryKey: t0,
|
|
100
|
+
queryFn: t1,
|
|
155
101
|
staleTime: Infinity
|
|
156
102
|
};
|
|
157
|
-
$[
|
|
158
|
-
$[
|
|
159
|
-
$[
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
return peekedPagePathname ? peekedPage ?? currentPage : currentPage;
|
|
164
|
-
}
|
|
165
|
-
function _temp3(state_0) {
|
|
166
|
-
return state_0.context.previewSource;
|
|
103
|
+
$[8] = t0;
|
|
104
|
+
$[9] = t1;
|
|
105
|
+
$[10] = t2;
|
|
106
|
+
} else t2 = $[10];
|
|
107
|
+
const { data: currentPage } = useSuspenseQuery(t2);
|
|
108
|
+
return currentPage;
|
|
167
109
|
}
|
|
168
110
|
function _temp2(state) {
|
|
169
|
-
return state.context.
|
|
111
|
+
return state.context.previewSource;
|
|
170
112
|
}
|
|
171
113
|
const BlockRenderer = (t0) => {
|
|
172
114
|
const $ = c(23);
|
|
173
|
-
if ($[0] !== "
|
|
115
|
+
if ($[0] !== "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a") {
|
|
174
116
|
for (let $i = 0; $i < 23; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
175
|
-
$[0] = "
|
|
117
|
+
$[0] = "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a";
|
|
176
118
|
}
|
|
177
119
|
const { blockId, mode, showAddBlockTop, showAddBlockBottom } = t0;
|
|
178
|
-
const previewSource = useSelector(previewStore,
|
|
120
|
+
const previewSource = useSelector(previewStore, _temp3);
|
|
179
121
|
let t1;
|
|
180
122
|
if ($[1] !== blockId || $[2] !== previewSource) {
|
|
181
123
|
t1 = blockQueries.get(blockId, previewSource);
|
|
@@ -315,9 +257,9 @@ const PageContent = () => {
|
|
|
315
257
|
};
|
|
316
258
|
function useHydrateDraftCache() {
|
|
317
259
|
const $ = c(7);
|
|
318
|
-
if ($[0] !== "
|
|
260
|
+
if ($[0] !== "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a") {
|
|
319
261
|
for (let $i = 0; $i < 7; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
320
|
-
$[0] = "
|
|
262
|
+
$[0] = "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a";
|
|
321
263
|
}
|
|
322
264
|
const isAuthenticated = useIsAuthenticated();
|
|
323
265
|
const queryClient = useQueryClient();
|
|
@@ -342,7 +284,7 @@ function useHydrateDraftCache() {
|
|
|
342
284
|
projectName: data.projectName,
|
|
343
285
|
project: data.project
|
|
344
286
|
});
|
|
345
|
-
}).catch(
|
|
287
|
+
}).catch(_temp4);
|
|
346
288
|
return () => {
|
|
347
289
|
cancelled = true;
|
|
348
290
|
};
|
|
@@ -365,44 +307,66 @@ function useHydrateDraftCache() {
|
|
|
365
307
|
}
|
|
366
308
|
React.useEffect(t0, t1);
|
|
367
309
|
}
|
|
368
|
-
function
|
|
310
|
+
function _temp4() {}
|
|
369
311
|
const CamoxPreview = (t0) => {
|
|
370
|
-
const $ = c(
|
|
371
|
-
if ($[0] !== "
|
|
372
|
-
for (let $i = 0; $i <
|
|
373
|
-
$[0] = "
|
|
312
|
+
const $ = c(4);
|
|
313
|
+
if ($[0] !== "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a") {
|
|
314
|
+
for (let $i = 0; $i < 4; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
315
|
+
$[0] = "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a";
|
|
374
316
|
}
|
|
375
317
|
const { children } = t0;
|
|
376
|
-
const isAuthenticated = useIsAuthenticated();
|
|
377
|
-
const isMobileStudio = useIsMobileStudio();
|
|
378
|
-
const isEditMode = useSelector(previewStore, _temp6);
|
|
379
|
-
const isToolbarHidden = useSelector(previewStore, _temp7);
|
|
380
|
-
const isAddBlockSidebarOpen = useSelector(previewStore, _temp8);
|
|
381
|
-
const previewSource = useSelector(previewStore, _temp9);
|
|
382
318
|
const pageData = usePreviewedPage();
|
|
383
319
|
useHydrateDraftCache();
|
|
384
|
-
const hasLiveCheckpoint = pageData.page.livePublishedCheckpointId != null;
|
|
385
320
|
let t1;
|
|
321
|
+
if ($[1] !== children || $[2] !== pageData) {
|
|
322
|
+
t1 = /* @__PURE__ */ jsx(PreviewShell, {
|
|
323
|
+
pageData,
|
|
324
|
+
children
|
|
325
|
+
});
|
|
326
|
+
$[1] = children;
|
|
327
|
+
$[2] = pageData;
|
|
328
|
+
$[3] = t1;
|
|
329
|
+
} else t1 = $[3];
|
|
330
|
+
return t1;
|
|
331
|
+
};
|
|
332
|
+
/** Studio chrome is shared; only curated previews require a Camox page record. */
|
|
333
|
+
const PreviewShell = (t0) => {
|
|
334
|
+
const $ = c(58);
|
|
335
|
+
if ($[0] !== "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a") {
|
|
336
|
+
for (let $i = 0; $i < 58; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
337
|
+
$[0] = "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a";
|
|
338
|
+
}
|
|
339
|
+
const { children, pageData, hasLiveVersion: t1, derivedLayoutId, derivedLayout } = t0;
|
|
340
|
+
const hasLiveVersion = t1 === void 0 ? false : t1;
|
|
341
|
+
const isAuthenticated = useIsAuthenticated();
|
|
342
|
+
const isMobileStudio = useIsMobileStudio();
|
|
343
|
+
const sharedChrome = React.useContext(SharedChromeContext);
|
|
344
|
+
const isEditMode = useSelector(previewStore, _temp5);
|
|
345
|
+
const isToolbarHidden = useSelector(previewStore, _temp6);
|
|
346
|
+
const isAddBlockSidebarOpen = useSelector(previewStore, _temp7);
|
|
347
|
+
const previewSource = useSelector(previewStore, _temp8);
|
|
348
|
+
const hasLiveCheckpoint = pageData ? pageData.page.livePublishedCheckpointId != null : hasLiveVersion;
|
|
386
349
|
let t2;
|
|
350
|
+
let t3;
|
|
387
351
|
if ($[1] !== isMobileStudio) {
|
|
388
|
-
|
|
352
|
+
t2 = () => {
|
|
389
353
|
if (!isMobileStudio) return;
|
|
390
354
|
previewStore.send({ type: "exitEditMode" });
|
|
391
355
|
previewStore.send({ type: "closeAddBlockSidebar" });
|
|
392
356
|
};
|
|
393
|
-
|
|
357
|
+
t3 = [isMobileStudio];
|
|
394
358
|
$[1] = isMobileStudio;
|
|
395
|
-
$[2] =
|
|
396
|
-
$[3] =
|
|
359
|
+
$[2] = t2;
|
|
360
|
+
$[3] = t3;
|
|
397
361
|
} else {
|
|
398
|
-
|
|
399
|
-
|
|
362
|
+
t2 = $[2];
|
|
363
|
+
t3 = $[3];
|
|
400
364
|
}
|
|
401
|
-
React.useEffect(
|
|
402
|
-
let t3;
|
|
365
|
+
React.useEffect(t2, t3);
|
|
403
366
|
let t4;
|
|
367
|
+
let t5;
|
|
404
368
|
if ($[4] !== hasLiveCheckpoint || $[5] !== isAuthenticated || $[6] !== isEditMode || $[7] !== isMobileStudio || $[8] !== previewSource) {
|
|
405
|
-
|
|
369
|
+
t4 = () => {
|
|
406
370
|
const actions = [
|
|
407
371
|
{
|
|
408
372
|
id: "exit-edit-mode",
|
|
@@ -415,11 +379,8 @@ const CamoxPreview = (t0) => {
|
|
|
415
379
|
],
|
|
416
380
|
groupLabel: "Preview",
|
|
417
381
|
checkIfAvailable: () => isAuthenticated && isEditMode,
|
|
418
|
-
execute:
|
|
419
|
-
shortcut:
|
|
420
|
-
key: "Enter",
|
|
421
|
-
withMeta: true
|
|
422
|
-
}
|
|
382
|
+
execute: _temp9,
|
|
383
|
+
shortcut: EDIT_MODE_SHORTCUT
|
|
423
384
|
},
|
|
424
385
|
{
|
|
425
386
|
id: "enter-edit-mode",
|
|
@@ -431,11 +392,8 @@ const CamoxPreview = (t0) => {
|
|
|
431
392
|
],
|
|
432
393
|
groupLabel: "Preview",
|
|
433
394
|
checkIfAvailable: () => isAuthenticated && !isEditMode && !isMobileStudio,
|
|
434
|
-
execute:
|
|
435
|
-
shortcut:
|
|
436
|
-
key: "Enter",
|
|
437
|
-
withMeta: true
|
|
438
|
-
}
|
|
395
|
+
execute: _temp0,
|
|
396
|
+
shortcut: EDIT_MODE_SHORTCUT
|
|
439
397
|
},
|
|
440
398
|
{
|
|
441
399
|
id: "preview-live-content",
|
|
@@ -447,7 +405,7 @@ const CamoxPreview = (t0) => {
|
|
|
447
405
|
],
|
|
448
406
|
groupLabel: "Preview",
|
|
449
407
|
checkIfAvailable: () => isAuthenticated && previewSource === "draft" && hasLiveCheckpoint,
|
|
450
|
-
execute:
|
|
408
|
+
execute: _temp1,
|
|
451
409
|
shortcut: {
|
|
452
410
|
key: "d",
|
|
453
411
|
withAlt: true
|
|
@@ -463,7 +421,7 @@ const CamoxPreview = (t0) => {
|
|
|
463
421
|
],
|
|
464
422
|
groupLabel: "Preview",
|
|
465
423
|
checkIfAvailable: () => isAuthenticated && previewSource === "live",
|
|
466
|
-
execute:
|
|
424
|
+
execute: _temp10,
|
|
467
425
|
shortcut: {
|
|
468
426
|
key: "d",
|
|
469
427
|
withAlt: true
|
|
@@ -474,8 +432,8 @@ const CamoxPreview = (t0) => {
|
|
|
474
432
|
label: "Clear selection",
|
|
475
433
|
aliases: ["Deselect", "Unselect"],
|
|
476
434
|
groupLabel: "Preview",
|
|
477
|
-
checkIfAvailable:
|
|
478
|
-
execute:
|
|
435
|
+
checkIfAvailable: _temp11,
|
|
436
|
+
execute: _temp12,
|
|
479
437
|
shortcut: { key: "Escape" }
|
|
480
438
|
}
|
|
481
439
|
];
|
|
@@ -486,11 +444,11 @@ const CamoxPreview = (t0) => {
|
|
|
486
444
|
return () => {
|
|
487
445
|
actionsStore.send({
|
|
488
446
|
type: "unregisterManyActions",
|
|
489
|
-
ids: actions.map(
|
|
447
|
+
ids: actions.map(_temp13)
|
|
490
448
|
});
|
|
491
449
|
};
|
|
492
450
|
};
|
|
493
|
-
|
|
451
|
+
t5 = [
|
|
494
452
|
isEditMode,
|
|
495
453
|
isAuthenticated,
|
|
496
454
|
isMobileStudio,
|
|
@@ -502,142 +460,161 @@ const CamoxPreview = (t0) => {
|
|
|
502
460
|
$[6] = isEditMode;
|
|
503
461
|
$[7] = isMobileStudio;
|
|
504
462
|
$[8] = previewSource;
|
|
505
|
-
$[9] =
|
|
506
|
-
$[10] =
|
|
463
|
+
$[9] = t4;
|
|
464
|
+
$[10] = t5;
|
|
507
465
|
} else {
|
|
508
|
-
|
|
509
|
-
|
|
466
|
+
t4 = $[9];
|
|
467
|
+
t5 = $[10];
|
|
510
468
|
}
|
|
511
|
-
React.useEffect(
|
|
469
|
+
React.useEffect(t4, t5);
|
|
512
470
|
if (!isAuthenticated) {
|
|
513
|
-
let
|
|
471
|
+
let t6;
|
|
514
472
|
if ($[11] !== children) {
|
|
515
|
-
|
|
473
|
+
t6 = /* @__PURE__ */ jsx(Fragment, { children });
|
|
516
474
|
$[11] = children;
|
|
517
|
-
$[12] =
|
|
518
|
-
} else
|
|
519
|
-
return
|
|
475
|
+
$[12] = t6;
|
|
476
|
+
} else t6 = $[12];
|
|
477
|
+
return t6;
|
|
520
478
|
}
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
$[
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
479
|
+
const t6 = sharedChrome ? "h-full" : "h-screen";
|
|
480
|
+
const t7 = !isEditMode && "bg-black";
|
|
481
|
+
let t8;
|
|
482
|
+
if ($[13] !== t6 || $[14] !== t7) {
|
|
483
|
+
t8 = cn("bg-background flex flex-col overflow-hidden", t6, t7);
|
|
484
|
+
$[13] = t6;
|
|
485
|
+
$[14] = t7;
|
|
486
|
+
$[15] = t8;
|
|
487
|
+
} else t8 = $[15];
|
|
488
|
+
let t9;
|
|
489
|
+
if ($[16] !== isAddBlockSidebarOpen || $[17] !== isMobileStudio || $[18] !== isToolbarHidden || $[19] !== pageData || $[20] !== sharedChrome) {
|
|
490
|
+
t9 = !sharedChrome && !isMobileStudio && !isToolbarHidden && /* @__PURE__ */ jsxs("div", {
|
|
531
491
|
className: "relative",
|
|
532
|
-
children: [/* @__PURE__ */ jsx(Navbar, {}), isAddBlockSidebarOpen && /* @__PURE__ */ jsx("div", {
|
|
492
|
+
children: [/* @__PURE__ */ jsx(Navbar, { isPreview: true }), pageData && isAddBlockSidebarOpen && /* @__PURE__ */ jsx("div", {
|
|
533
493
|
className: "absolute inset-0 z-20",
|
|
534
494
|
style: { background: "rgba(0, 0, 0, 0.66)" },
|
|
535
|
-
onClick:
|
|
495
|
+
onClick: _temp14
|
|
536
496
|
})]
|
|
537
497
|
});
|
|
538
|
-
$[
|
|
539
|
-
$[
|
|
540
|
-
$[
|
|
541
|
-
$[
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
498
|
+
$[16] = isAddBlockSidebarOpen;
|
|
499
|
+
$[17] = isMobileStudio;
|
|
500
|
+
$[18] = isToolbarHidden;
|
|
501
|
+
$[19] = pageData;
|
|
502
|
+
$[20] = sharedChrome;
|
|
503
|
+
$[21] = t9;
|
|
504
|
+
} else t9 = $[21];
|
|
505
|
+
let t10;
|
|
506
|
+
if ($[22] !== derivedLayout || $[23] !== derivedLayoutId || $[24] !== isEditMode || $[25] !== isMobileStudio || $[26] !== pageData) {
|
|
507
|
+
t10 = !isMobileStudio && (pageData || derivedLayoutId) && /* @__PURE__ */ jsx("div", {
|
|
508
|
+
className: isEditMode ? "contents" : "hidden",
|
|
509
|
+
children: /* @__PURE__ */ jsx(LeftSidebar, {
|
|
510
|
+
page: pageData?.page,
|
|
511
|
+
derivedLayout
|
|
512
|
+
})
|
|
513
|
+
});
|
|
514
|
+
$[22] = derivedLayout;
|
|
515
|
+
$[23] = derivedLayoutId;
|
|
516
|
+
$[24] = isEditMode;
|
|
517
|
+
$[25] = isMobileStudio;
|
|
518
|
+
$[26] = pageData;
|
|
519
|
+
$[27] = t10;
|
|
520
|
+
} else t10 = $[27];
|
|
521
|
+
const t11 = pageData?.page;
|
|
522
|
+
const t12 = pageData?.projectName;
|
|
523
|
+
const t13 = pageData?.page.status;
|
|
524
|
+
let t14;
|
|
525
|
+
if ($[28] !== hasLiveCheckpoint || $[29] !== t13) {
|
|
526
|
+
t14 = {
|
|
527
|
+
pageStatus: t13,
|
|
555
528
|
hasLiveVersion: hasLiveCheckpoint
|
|
556
529
|
};
|
|
557
|
-
$[
|
|
558
|
-
$[
|
|
559
|
-
$[
|
|
560
|
-
} else
|
|
561
|
-
let
|
|
562
|
-
if ($[
|
|
563
|
-
|
|
530
|
+
$[28] = hasLiveCheckpoint;
|
|
531
|
+
$[29] = t13;
|
|
532
|
+
$[30] = t14;
|
|
533
|
+
} else t14 = $[30];
|
|
534
|
+
let t15;
|
|
535
|
+
if ($[31] !== isEditMode || $[32] !== isMobileStudio) {
|
|
536
|
+
t15 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx("div", { style: {
|
|
564
537
|
height: "80px",
|
|
565
538
|
background: "transparent"
|
|
566
539
|
} });
|
|
567
|
-
$[
|
|
568
|
-
$[
|
|
569
|
-
$[
|
|
570
|
-
} else
|
|
571
|
-
let
|
|
572
|
-
if ($[
|
|
573
|
-
|
|
540
|
+
$[31] = isEditMode;
|
|
541
|
+
$[32] = isMobileStudio;
|
|
542
|
+
$[33] = t15;
|
|
543
|
+
} else t15 = $[33];
|
|
544
|
+
let t16;
|
|
545
|
+
if ($[34] !== children || $[35] !== isMobileStudio || $[36] !== t11 || $[37] !== t12 || $[38] !== t14 || $[39] !== t15) {
|
|
546
|
+
t16 = /* @__PURE__ */ jsxs(PreviewPanel, {
|
|
574
547
|
isMobileExperience: isMobileStudio,
|
|
575
|
-
page:
|
|
576
|
-
projectName:
|
|
577
|
-
toolbarProps:
|
|
578
|
-
children: [children,
|
|
548
|
+
page: t11,
|
|
549
|
+
projectName: t12,
|
|
550
|
+
toolbarProps: t14,
|
|
551
|
+
children: [children, t15]
|
|
579
552
|
});
|
|
580
|
-
$[
|
|
581
|
-
$[
|
|
582
|
-
$[
|
|
583
|
-
$[
|
|
584
|
-
$[
|
|
585
|
-
$[
|
|
586
|
-
$[
|
|
587
|
-
} else
|
|
588
|
-
let
|
|
589
|
-
if ($[
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
$[
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
553
|
+
$[34] = children;
|
|
554
|
+
$[35] = isMobileStudio;
|
|
555
|
+
$[36] = t11;
|
|
556
|
+
$[37] = t12;
|
|
557
|
+
$[38] = t14;
|
|
558
|
+
$[39] = t15;
|
|
559
|
+
$[40] = t16;
|
|
560
|
+
} else t16 = $[40];
|
|
561
|
+
let t17;
|
|
562
|
+
if ($[41] !== derivedLayoutId || $[42] !== isEditMode || $[43] !== isMobileStudio || $[44] !== pageData?.page) {
|
|
563
|
+
t17 = !isMobileStudio && isEditMode && /* @__PURE__ */ jsx(RightSidebar, {
|
|
564
|
+
pageId: pageData?.page.id,
|
|
565
|
+
derivedLayoutId
|
|
566
|
+
});
|
|
567
|
+
$[41] = derivedLayoutId;
|
|
568
|
+
$[42] = isEditMode;
|
|
569
|
+
$[43] = isMobileStudio;
|
|
570
|
+
$[44] = pageData?.page;
|
|
571
|
+
$[45] = t17;
|
|
572
|
+
} else t17 = $[45];
|
|
573
|
+
let t18;
|
|
574
|
+
if ($[46] !== t10 || $[47] !== t16 || $[48] !== t17) {
|
|
575
|
+
t18 = /* @__PURE__ */ jsxs("div", {
|
|
599
576
|
className: "flex h-full flex-row items-stretch",
|
|
600
577
|
children: [
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
578
|
+
t10,
|
|
579
|
+
t16,
|
|
580
|
+
t17
|
|
604
581
|
]
|
|
605
582
|
});
|
|
606
|
-
$[
|
|
607
|
-
$[
|
|
608
|
-
$[
|
|
609
|
-
$[
|
|
610
|
-
} else
|
|
611
|
-
let
|
|
612
|
-
if ($[
|
|
613
|
-
|
|
614
|
-
$[
|
|
615
|
-
$[
|
|
616
|
-
$[
|
|
617
|
-
} else
|
|
618
|
-
let
|
|
619
|
-
if ($[
|
|
620
|
-
|
|
621
|
-
className:
|
|
583
|
+
$[46] = t10;
|
|
584
|
+
$[47] = t16;
|
|
585
|
+
$[48] = t17;
|
|
586
|
+
$[49] = t18;
|
|
587
|
+
} else t18 = $[49];
|
|
588
|
+
let t19;
|
|
589
|
+
if ($[50] !== isEditMode || $[51] !== isMobileStudio) {
|
|
590
|
+
t19 = (isMobileStudio || isEditMode) && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CreatePageModal, {}), /* @__PURE__ */ jsx(DraftSwitchDialog, {})] });
|
|
591
|
+
$[50] = isEditMode;
|
|
592
|
+
$[51] = isMobileStudio;
|
|
593
|
+
$[52] = t19;
|
|
594
|
+
} else t19 = $[52];
|
|
595
|
+
let t20;
|
|
596
|
+
if ($[53] !== t18 || $[54] !== t19 || $[55] !== t8 || $[56] !== t9) {
|
|
597
|
+
t20 = /* @__PURE__ */ jsxs("div", {
|
|
598
|
+
className: t8,
|
|
622
599
|
children: [
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
600
|
+
t9,
|
|
601
|
+
t18,
|
|
602
|
+
t19
|
|
626
603
|
]
|
|
627
604
|
});
|
|
628
|
-
$[
|
|
629
|
-
$[
|
|
630
|
-
$[
|
|
631
|
-
$[
|
|
632
|
-
$[
|
|
633
|
-
} else
|
|
634
|
-
return
|
|
605
|
+
$[53] = t18;
|
|
606
|
+
$[54] = t19;
|
|
607
|
+
$[55] = t8;
|
|
608
|
+
$[56] = t9;
|
|
609
|
+
$[57] = t20;
|
|
610
|
+
} else t20 = $[57];
|
|
611
|
+
return t20;
|
|
635
612
|
};
|
|
636
613
|
function usePreviewPagesActions() {
|
|
637
614
|
const $ = c(13);
|
|
638
|
-
if ($[0] !== "
|
|
615
|
+
if ($[0] !== "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a") {
|
|
639
616
|
for (let $i = 0; $i < 13; $i += 1) $[$i] = Symbol.for("react.memo_cache_sentinel");
|
|
640
|
-
$[0] = "
|
|
617
|
+
$[0] = "24b649dd4428fd20f053be5828fab17890ad150c780fc5ba746c0c95ac30dd2a";
|
|
641
618
|
}
|
|
642
619
|
const navigate = useNavigate();
|
|
643
620
|
const { pathname } = useLocation();
|
|
@@ -678,8 +655,8 @@ function usePreviewPagesActions() {
|
|
|
678
655
|
label: "Create page",
|
|
679
656
|
aliases: ["New page", "Add page"],
|
|
680
657
|
groupLabel: "Preview",
|
|
681
|
-
checkIfAvailable:
|
|
682
|
-
execute:
|
|
658
|
+
checkIfAvailable: _temp15,
|
|
659
|
+
execute: _temp16
|
|
683
660
|
},
|
|
684
661
|
{
|
|
685
662
|
id: "edit-current-page",
|
|
@@ -710,14 +687,14 @@ function usePreviewPagesActions() {
|
|
|
710
687
|
groupLabel: "Preview",
|
|
711
688
|
checkIfAvailable: () => !!pages,
|
|
712
689
|
hasChildren: true,
|
|
713
|
-
execute:
|
|
690
|
+
execute: _temp17
|
|
714
691
|
},
|
|
715
692
|
...pages ? pages.map((page) => ({
|
|
716
693
|
id: `go-to-page-${page.id}`,
|
|
717
694
|
parentActionId: "go-to-page",
|
|
718
695
|
label: `Go to "${page.nickname}"`,
|
|
719
696
|
groupLabel: "Preview",
|
|
720
|
-
checkIfAvailable:
|
|
697
|
+
checkIfAvailable: _temp18,
|
|
721
698
|
execute: () => navigate({ to: page.fullPath })
|
|
722
699
|
})) : []
|
|
723
700
|
];
|
|
@@ -728,7 +705,7 @@ function usePreviewPagesActions() {
|
|
|
728
705
|
return () => {
|
|
729
706
|
actionsStore.send({
|
|
730
707
|
type: "unregisterManyActions",
|
|
731
|
-
ids: actions.map(
|
|
708
|
+
ids: actions.map(_temp19)
|
|
732
709
|
});
|
|
733
710
|
};
|
|
734
711
|
};
|
|
@@ -748,64 +725,64 @@ function usePreviewPagesActions() {
|
|
|
748
725
|
}
|
|
749
726
|
React.useEffect(t4, t5);
|
|
750
727
|
}
|
|
751
|
-
function
|
|
728
|
+
function _temp19(a) {
|
|
752
729
|
return a.id;
|
|
753
730
|
}
|
|
754
|
-
function
|
|
731
|
+
function _temp18() {
|
|
755
732
|
return true;
|
|
756
733
|
}
|
|
757
|
-
function
|
|
758
|
-
function
|
|
734
|
+
function _temp17() {}
|
|
735
|
+
function _temp16() {
|
|
759
736
|
return previewStore.send({ type: "openCreatePageModal" });
|
|
760
737
|
}
|
|
761
|
-
function
|
|
738
|
+
function _temp15() {
|
|
762
739
|
return true;
|
|
763
740
|
}
|
|
764
|
-
function
|
|
741
|
+
function _temp3(state) {
|
|
765
742
|
return state.context.previewSource;
|
|
766
743
|
}
|
|
767
|
-
function
|
|
744
|
+
function _temp5(state) {
|
|
768
745
|
return state.context.isEditMode;
|
|
769
746
|
}
|
|
770
|
-
function
|
|
747
|
+
function _temp6(state_0) {
|
|
771
748
|
return state_0.context.isToolbarHidden;
|
|
772
749
|
}
|
|
773
|
-
function
|
|
750
|
+
function _temp7(state_1) {
|
|
774
751
|
return state_1.context.isAddBlockSidebarOpen;
|
|
775
752
|
}
|
|
776
|
-
function
|
|
753
|
+
function _temp8(state_2) {
|
|
777
754
|
return state_2.context.previewSource;
|
|
778
755
|
}
|
|
779
|
-
function
|
|
756
|
+
function _temp9() {
|
|
780
757
|
return previewStore.send({ type: "exitEditMode" });
|
|
781
758
|
}
|
|
782
|
-
function
|
|
759
|
+
function _temp0() {
|
|
783
760
|
return previewStore.send({ type: "enterEditMode" });
|
|
784
761
|
}
|
|
785
|
-
function
|
|
762
|
+
function _temp1() {
|
|
786
763
|
return previewStore.send({
|
|
787
764
|
type: "setPreviewSource",
|
|
788
765
|
source: "live"
|
|
789
766
|
});
|
|
790
767
|
}
|
|
791
|
-
function
|
|
768
|
+
function _temp10() {
|
|
792
769
|
return previewStore.send({
|
|
793
770
|
type: "setPreviewSource",
|
|
794
771
|
source: "draft"
|
|
795
772
|
});
|
|
796
773
|
}
|
|
797
|
-
function
|
|
774
|
+
function _temp11() {
|
|
798
775
|
return true;
|
|
799
776
|
}
|
|
800
|
-
function
|
|
777
|
+
function _temp12() {
|
|
801
778
|
previewStore.send({ type: "clearSelection" });
|
|
802
779
|
}
|
|
803
|
-
function
|
|
780
|
+
function _temp13(a) {
|
|
804
781
|
return a.id;
|
|
805
782
|
}
|
|
806
|
-
function
|
|
783
|
+
function _temp14() {
|
|
807
784
|
return previewStore.send({ type: "closeAddBlockSidebar" });
|
|
808
785
|
}
|
|
809
786
|
|
|
810
787
|
//#endregion
|
|
811
|
-
export { CamoxPreview, PageContent, usePreviewPagesActions, usePreviewedPage };
|
|
788
|
+
export { CamoxPreview, PageContent, PreviewShell, usePreviewPagesActions, usePreviewedPage };
|